数据可视化大屏
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12545 行
2.5MB

  1. import{a as VV,b as jL,c as GV,d as HV,e as kb}from"./chunk-544QITXJ.js";import{$a as oo,A as Va,Aa as ch,Ba as hh,C as Ga,Ca as fn,Ga as $a,Ia as eo,La as to,Pa as ro,Sa as io,Ua as no,V as Ha,W as OV,X as zV,Xa as ao,_ as Wa,aa as Rm,b as Fb,ba as FV,bb as so,ca as Xn,cb as BV,db as Yn,e as Fa,fb as lo,gb as kV,hb as uo,jb as co,kb as Bb,la as Xa,pa as Ya,ra as qa,ta as Za,u as Ba,ua as ja,v as ka,wa as Ka,y as UV,ya as Ja}from"./chunk-WD6SV3WH.js";import{$ as bV,Ab as Mn,Bb as fi,Cb as pi,D as _V,Db as su,Eb as jt,Fb as ma,Fe as IV,Ga as BL,Ge as Wn,Ha as p_,He as NV,I as xV,Ib as RV,Jb as Ar,Ka as st,Kb as LV,La as da,Lb as qL,Le as Ua,Ma as Ib,Mb as ZL,Me as Ub,Ne as Ob,Nf as Qa,Oa as kL,Pa as VL,Q as SV,Sb as sp,Ta as gr,U as MV,Va as rt,Wa as TV,Xa as Nb,Ya as EV,Za as AV,a as Rb,ba as zL,cc as d_,cd as PV,db as GL,dc as As,e as Kse,eb as HL,f as Jse,fb as WL,g as UL,gb as ft,h as $se,hb as ot,hf as Oa,i as Qse,ia as Db,ib as er,ic as m_,j as Lb,ja as wV,jb as au,kb as ou,la as xn,lb as CV,lf as za,m as vV,na as Er,nc as lh,o as OL,oa as Pb,p as gV,pa as FL,qb as XL,ra as sh,sb as Dr,tb as Sn,tf as zb,u as f_,ub as ni,vb as op,vf as uh,w as yV,xd as v_,xf as lu,yb as YL,yc as DV,zb as Qu}from"./chunk-VDRVUQCF.js";var Bse={};UL(Bse,{AddEquation:()=>Hk,AddOperation:()=>Zoe,AdditiveBlending:()=>Bk,AlphaFormat:()=>ase,AlwaysDepth:()=>Voe,AmbientLight:()=>cL,AnimationClip:()=>Ss,AnimationMixer:()=>fV,AnimationObjectGroup:()=>Ek,AnimationUtils:()=>ca,ArcCurve:()=>ML,ArrowHelper:()=>Tm,Audio:()=>q0,AudioAnalyser:()=>hV,AudioContext:()=>uV,AudioListener:()=>wk,AudioLoader:()=>cV,AxisHelper:()=>SL,BackSide:()=>jf,BasicDepthPacking:()=>_se,BasicShadowMap:()=>BIe,BinaryTextureLoader:()=>rV,BlendingMode:()=>Coe,Bone:()=>eL,BooleanKeyframeTrack:()=>mL,BoundingBoxHelper:()=>p3e,Box2:()=>BM,Box3:()=>Zu,BoxBufferGeometry:()=>lm,BoxGeometry:()=>db,BoxHelper:()=>i_,BufferAttribute:()=>Mt,BufferGeometry:()=>Vt,BufferGeometryLoader:()=>nV,ByteType:()=>Qoe,Cache:()=>Mk,Camera:()=>fa,CameraHelper:()=>bb,CanvasRenderer:()=>x3e,CanvasTexture:()=>iL,CatmullRomCurve3:()=>pV,CineonToneMapping:()=>Joe,CircleBufferGeometry:()=>G0,CircleGeometry:()=>pb,ClampToEdgeWrapping:()=>Ms,Clock:()=>Dk,ClosedSplineCurve3:()=>Fse,Color:()=>Wt,ColorKeyframeTrack:()=>vL,CompressedTexture:()=>C0,CompressedTextureLoader:()=>Pse,ConeBufferGeometry:()=>fb,ConeGeometry:()=>hb,CubeCamera:()=>gL,CubeGeometry:()=>db,CubeReflectionMapping:()=>TL,CubeRefractionMapping:()=>ZR,CubeTexture:()=>Kf,CubeTextureLoader:()=>iV,CubeUVReflectionMapping:()=>EL,CubeUVRefractionMapping:()=>AL,CubicBezierCurve:()=>Mm,CubicBezierCurve3:()=>GOe,CubicInterpolant:()=>hL,CullFaceBack:()=>PM,CullFaceFront:()=>Nk,CullFaceFrontBack:()=>zIe,CullFaceNone:()=>Toe,Curve:()=>pa,CurvePath:()=>yb,CurveUtils:()=>Ab,CustomBlending:()=>Gk,CylinderBufferGeometry:()=>ih,CylinderGeometry:()=>dm,Cylindrical:()=>Ik,DataTexture:()=>sm,DataTextureLoader:()=>BOe,DefaultLoadingManager:()=>Ts,DepthFormat:()=>tm,DepthStencilFormat:()=>S0,DepthTexture:()=>KM,DirectionalLight:()=>uL,DirectionalLightHelper:()=>r_,DirectionalLightShadow:()=>lL,DiscreteInterpolant:()=>fL,DodecahedronBufferGeometry:()=>I0,DodecahedronGeometry:()=>tb,DoubleSide:()=>n_,DstAlphaFactor:()=>Uoe,DstColorFactor:()=>zoe,DynamicBufferAttribute:()=>i3e,EdgesGeometry:()=>V0,EdgesHelper:()=>d3e,EllipseCurve:()=>nh,EqualDepth:()=>Hoe,EquirectangularReflectionMapping:()=>qk,EquirectangularRefractionMapping:()=>jR,Euler:()=>ep,EventDispatcher:()=>pl,ExtrudeGeometry:()=>ml,Face3:()=>ws,Face4:()=>YOe,FaceColors:()=>Fk,FaceNormalsHelper:()=>Mb,FileLoader:()=>vl,FlatShading:()=>Ok,Float32Attribute:()=>h3e,Float32BufferAttribute:()=>Mr,Float64Attribute:()=>f3e,Float64BufferAttribute:()=>YM,FloatType:()=>_0,Fog:()=>E0,FogExp2:()=>T0,Font:()=>lV,FontLoader:()=>Nse,FrontFaceDirectionCCW:()=>FIe,FrontFaceDirectionCW:()=>Eoe,FrontSide:()=>y0,Frustum:()=>kM,GammaEncoding:()=>$k,Geometry:()=>ur,GeometryIdCount:()=>Qk,GeometryUtils:()=>g3e,GreaterDepth:()=>Xoe,GreaterEqualDepth:()=>Woe,GridHelper:()=>Sb,Group:()=>jM,HalfFloatType:()=>JR,HemisphereLight:()=>nL,HemisphereLightHelper:()=>t_,IcosahedronBufferGeometry:()=>P0,IcosahedronGeometry:()=>eb,ImageLoader:()=>Eb,ImageUtils:()=>y3e,ImmediateRenderObject:()=>_b,InstancedBufferAttribute:()=>K0,InstancedBufferGeometry:()=>wm,InstancedInterleavedBuffer:()=>j0,Int16Attribute:()=>s3e,Int16BufferAttribute:()=>WM,Int32Attribute:()=>u3e,Int32BufferAttribute:()=>XM,Int8Attribute:()=>n3e,Int8BufferAttribute:()=>VM,IntType:()=>tse,InterleavedBuffer:()=>Z0,InterleavedBufferAttribute:()=>Ck,Interpolant:()=>Zo,InterpolateDiscrete:()=>OM,InterpolateLinear:()=>DM,InterpolateSmooth:()=>YR,JSONLoader:()=>aV,KeyframeTrack:()=>xm,LOD:()=>ZM,LatheBufferGeometry:()=>F0,LatheGeometry:()=>cb,Layers:()=>$R,LensFlare:()=>Sk,LessDepth:()=>Goe,LessEqualDepth:()=>qR,Light:()=>Bi,LightShadow:()=>Am,Line:()=>rh,Line3:()=>rm,LineBasicMaterial:()=>Fi,LineCurve:()=>Ku,LineCurve3:()=>WOe,LineDashedMaterial:()=>_m,LinePieces:()=>ZOe,LineSegments:()=>yi,LineStrip:()=>qOe,LinearEncoding:()=>FM,LinearFilter:()=>qo,LinearInterpolant:()=>vb,LinearMipMapLinearFilter:()=>Tb,LinearMipMapNearestFilter:()=>jk,LinearToneMapping:()=>Yk,Loader:()=>im,LoadingManager:()=>tV,LogLuvEncoding:()=>VIe,LoopOnce:()=>use,LoopPingPong:()=>hse,LoopRepeat:()=>cse,LuminanceAlphaFormat:()=>sse,LuminanceFormat:()=>ose,MOUSE:()=>OIe,Material:()=>_r,MaterialLoader:()=>DL,Math:()=>fr,Matrix3:()=>dl,Matrix4:()=>Kt,MaxEquation:()=>uk,Mesh:()=>_n,MeshBasicMaterial:()=>jo,MeshDepthMaterial:()=>$f,MeshFaceMaterial:()=>jOe,MeshLambertMaterial:()=>ym,MeshNormalMaterial:()=>gm,MeshPhongMaterial:()=>nu,MeshPhysicalMaterial:()=>mm,MeshStandardMaterial:()=>ju,MeshToonMaterial:()=>vm,MinEquation:()=>lk,MirroredRepeatWrapping:()=>am,MixOperation:()=>qoe,MorphBlendMesh:()=>Hn,MultiMaterial:()=>mb,MultiplyBlending:()=>Vk,MultiplyOperation:()=>wb,NearestFilter:()=>bs,NearestMipMapLinearFilter:()=>RL,NearestMipMapNearestFilter:()=>CL,NeverDepth:()=>koe,NoBlending:()=>IM,NoColors:()=>bL,NoToneMapping:()=>XR,NormalBlending:()=>a_,NotEqualDepth:()=>Yoe,NumberKeyframeTrack:()=>Y0,Object3D:()=>Lt,ObjectLoader:()=>Ise,OctahedronBufferGeometry:()=>fm,OctahedronGeometry:()=>QM,OneFactor:()=>Poe,OneMinusDstAlphaFactor:()=>Ooe,OneMinusDstColorFactor:()=>Foe,OneMinusSrcAlphaFactor:()=>Xk,OneMinusSrcColorFactor:()=>Noe,OrthographicCamera:()=>w0,PCFShadowMap:()=>Uk,PCFSoftShadowMap:()=>Aoe,ParametricBufferGeometry:()=>L0,ParametricGeometry:()=>JM,Particle:()=>JOe,ParticleBasicMaterial:()=>e3e,ParticleSystem:()=>$Oe,ParticleSystemMaterial:()=>t3e,Path:()=>Cb,PerspectiveCamera:()=>ua,Plane:()=>xs,PlaneBufferGeometry:()=>um,PlaneGeometry:()=>ub,PointCloud:()=>KOe,PointCloudMaterial:()=>QOe,PointLight:()=>sL,PointLightHelper:()=>Q0,Points:()=>A0,PointsMaterial:()=>iu,PolarGridHelper:()=>xL,PolyhedronBufferGeometry:()=>Ko,PolyhedronGeometry:()=>rb,PositionalAudio:()=>Tk,Projector:()=>_3e,PropertyBinding:()=>Ii,PropertyMixer:()=>yL,QuadraticBezierCurve:()=>bm,QuadraticBezierCurve3:()=>HOe,Quaternion:()=>cn,QuaternionKeyframeTrack:()=>gb,QuaternionLinearInterpolant:()=>pL,REVISION:()=>woe,RGBADepthPacking:()=>xse,RGBAFormat:()=>qu,RGBA_PVRTC_2BPPV1_Format:()=>_k,RGBA_PVRTC_4BPPV1_Format:()=>yk,RGBA_S3TC_DXT1_Format:()=>pk,RGBA_S3TC_DXT3_Format:()=>dk,RGBA_S3TC_DXT5_Format:()=>mk,RGBDEncoding:()=>yse,RGBEEncoding:()=>mse,RGBEFormat:()=>kIe,RGBFormat:()=>x0,RGBM16Encoding:()=>gse,RGBM7Encoding:()=>vse,RGB_ETC1_Format:()=>lse,RGB_PVRTC_2BPPV1_Format:()=>gk,RGB_PVRTC_4BPPV1_Format:()=>vk,RGB_S3TC_DXT1_Format:()=>fk,RawShaderMaterial:()=>W0,Ray:()=>Qf,Raycaster:()=>Rk,RectAreaLight:()=>bk,RectAreaLightHelper:()=>e_,ReinhardToneMapping:()=>joe,RepeatWrapping:()=>Qc,ReverseSubtractEquation:()=>Loe,RingBufferGeometry:()=>z0,RingGeometry:()=>lb,Scene:()=>cm,SceneUtils:()=>XOe,ShaderChunk:()=>jr,ShaderLib:()=>b0,ShaderMaterial:()=>Na,ShadowMaterial:()=>H0,Shape:()=>nm,ShapeBufferGeometry:()=>B0,ShapeGeometry:()=>k0,ShapePath:()=>sV,ShapeUtils:()=>Gn,ShortType:()=>ese,Skeleton:()=>QR,SkeletonHelper:()=>$0,SkinnedMesh:()=>tL,SmoothShading:()=>zk,Sphere:()=>ha,SphereBufferGeometry:()=>pm,SphereGeometry:()=>sb,Spherical:()=>Pk,SphericalReflectionMapping:()=>Zk,Spline:()=>kOe,SplineCurve:()=>Sm,SplineCurve3:()=>VOe,SpotLight:()=>oL,SpotLightHelper:()=>J0,SpotLightShadow:()=>aL,Sprite:()=>qM,SpriteMaterial:()=>hm,SrcAlphaFactor:()=>Wk,SrcAlphaSaturateFactor:()=>Boe,SrcColorFactor:()=>Ioe,StereoCamera:()=>Use,StringKeyframeTrack:()=>dL,SubtractEquation:()=>Roe,SubtractiveBlending:()=>kk,TetrahedronBufferGeometry:()=>D0,TetrahedronGeometry:()=>$M,TextGeometry:()=>ob,Texture:()=>ci,TextureFilter:()=>hk,TextureLoader:()=>LL,TextureMapping:()=>$oe,TextureWrapping:()=>ck,TorusBufferGeometry:()=>O0,TorusGeometry:()=>ab,TorusKnotBufferGeometry:()=>U0,TorusKnotGeometry:()=>nb,Triangle:()=>fl,TriangleFanDrawMode:()=>pse,TriangleStripDrawMode:()=>fse,TrianglesDrawMode:()=>Jk,TubeBufferGeometry:()=>N0,TubeGeometry:()=>ib,UVMapping:()=>wL,Uint16Attribute:()=>l3e,Uint16BufferAttribute:()=>eh,Uint32Attribute:()=>c3e,Uint32BufferAttribute:()=>th,Uint8Attribute:()=>a3e,Uint8BufferAttribute:()=>GM,Uint8ClampedAttribute:()=>o3e,Uint8ClampedBufferAttribute:()=>HM,Uncharted2ToneMapping:()=>Koe,Uniform:()=>_L,UniformsLib:()=>dr,UniformsUtils:()=>Yo,UnsignedByteType:()=>KR,UnsignedInt248Type:()=>UM,UnsignedIntType:()=>Kk,UnsignedShort4444Type:()=>rse,UnsignedShort5551Type:()=>ise,UnsignedShort565Type:()=>nse,UnsignedShortType:()=>NM,Vector2:()=>Tt,Vector3:()=>oe,Vector4:()=>ii,VectorKeyframeTrack:()=>X0,Vertex:()=>r3e,VertexColors:()=>Em,VertexNormalsHelper:()=>xb,VideoTexture:()=>rL,WebGLRenderTarget:()=>o_,WebGLRenderTargetCube:()=>M0,WebGLRenderer:()=>eV,WireframeGeometry:()=>R0,WireframeHelper:()=>m3e,WrapAroundEnding:()=>zM,XHRLoader:()=>v3e,ZeroCurvatureEnding:()=>om,ZeroFactor:()=>Doe,ZeroSlopeEnding:()=>em,sRGBEncoding:()=>dse});function pl(){}function Tt(r,e){this.x=r||0,this.y=e||0}function ci(r,e,t,i,n,a,o,s,l,u){Object.defineProperty(this,"id",{value:GIe++}),this.uuid=fr.generateUUID(),this.name="",this.image=r!==void 0?r:ci.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=e!==void 0?e:ci.DEFAULT_MAPPING,this.wrapS=t!==void 0?t:Ms,this.wrapT=i!==void 0?i:Ms,this.magFilter=n!==void 0?n:qo,this.minFilter=a!==void 0?a:Tb,this.anisotropy=l!==void 0?l:1,this.format=o!==void 0?o:qu,this.type=s!==void 0?s:KR,this.offset=new Tt(0,0),this.repeat=new Tt(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u!==void 0?u:FM,this.version=0,this.onUpdate=null}function ii(r,e,t,i){this.x=r||0,this.y=e||0,this.z=t||0,this.w=i!==void 0?i:1}function o_(r,e,t){this.uuid=fr.generateUUID(),this.width=r,this.height=e,this.scissor=new ii(0,0,r,e),this.scissorTest=!1,this.viewport=new ii(0,0,r,e),t=t||{},t.minFilter===void 0&&(t.minFilter=qo),this.texture=new ci(void 0,void 0,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.depthBuffer=t.depthBuffer!==void 0?t.depthBuffer:!0,this.stencilBuffer=t.stencilBuffer!==void 0?t.stencilBuffer:!0,this.depthTexture=t.depthTexture!==void 0?t.depthTexture:null}function M0(r,e,t){o_.call(this,r,e,t),this.activeCubeFace=0,this.activeMipMapLevel=0}function cn(r,e,t,i){this._x=r||0,this._y=e||0,this._z=t||0,this._w=i!==void 0?i:1}function oe(r,e,t){this.x=r||0,this.y=e||0,this.z=t||0}function Kt(){this.elements=new Float32Array([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 Kf(r,e,t,i,n,a,o,s,l,u){r=r!==void 0?r:[],e=e!==void 0?e:TL,ci.call(this,r,e,t,i,n,a,o,s,l,u),this.flipY=!1}function bse(){this.seq=[],this.map={}}function s_(r,e,t){var i=r[0];if(i<=0||i>0)return r;var n=e*t,a=goe[n];if(a===void 0&&(a=new Float32Array(n),goe[n]=a),e!==0){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function wse(r,e){var t=yoe[e];t===void 0&&(t=new Int32Array(e),yoe[e]=t);for(var i=0;i!==e;++i)t[i]=r.allocTextureUnit();return t}function HIe(r,e){r.uniform1f(this.addr,e)}function WIe(r,e){r.uniform1i(this.addr,e)}function XIe(r,e){e.x===void 0?r.uniform2fv(this.addr,e):r.uniform2f(this.addr,e.x,e.y)}function YIe(r,e){e.x!==void 0?r.uniform3f(this.addr,e.x,e.y,e.z):e.r!==void 0?r.uniform3f(this.addr,e.r,e.g,e.b):r.uniform3fv(this.addr,e)}function qIe(r,e){e.x===void 0?r.uniform4fv(this.addr,e):r.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function ZIe(r,e){r.uniformMatrix2fv(this.addr,!1,e.elements||e)}function jIe(r,e){r.uniformMatrix3fv(this.addr,!1,e.elements||e)}function KIe(r,e){r.uniformMatrix4fv(this.addr,!1,e.elements||e)}function JIe(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTexture2D(e||Sse,i)}function $Ie(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTextureCube(e||Mse,i)}function Tse(r,e){r.uniform2iv(this.addr,e)}function Ese(r,e){r.uniform3iv(this.addr,e)}function Ase(r,e){r.uniform4iv(this.addr,e)}function QIe(r){switch(r){case 5126:return HIe;case 35664:return XIe;case 35665:return YIe;case 35666:return qIe;case 35674:return ZIe;case 35675:return jIe;case 35676:return KIe;case 35678:return JIe;case 35680:return $Ie;case 5124:case 35670:return WIe;case 35667:case 35671:return Tse;case 35668:case 35672:return Ese;case 35669:case 35673:return Ase}}function eNe(r,e){r.uniform1fv(this.addr,e)}function tNe(r,e){r.uniform1iv(this.addr,e)}function rNe(r,e){r.uniform2fv(this.addr,s_(e,this.size,2))}function iNe(r,e){r.uniform3fv(this.addr,s_(e,this.size,3))}function nNe(r,e){r.uniform4fv(this.addr,s_(e,this.size,4))}function aNe(r,e){r.uniformMatrix2fv(this.addr,!1,s_(e,this.size,4))}function oNe(r,e){r.uniformMatrix3fv(this.addr,!1,s_(e,this.size,9))}function sNe(r,e){r.uniformMatrix4fv(this.addr,!1,s_(e,this.size,16))}function lNe(r,e,t){var i=e.length,n=wse(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTexture2D(e[a]||Sse,n[a])}function uNe(r,e,t){var i=e.length,n=wse(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTextureCube(e[a]||Mse,n[a])}function cNe(r){switch(r){case 5126:return eNe;case 35664:return rNe;case 35665:return iNe;case 35666:return nNe;case 35674:return aNe;case 35675:return oNe;case 35676:return sNe;case 35678:return lNe;case 35680:return uNe;case 5124:case 35670:return tNe;case 35667:case 35671:return Tse;case 35668:case 35672:return Ese;case 35669:case 35673:return Ase}}function hNe(r,e,t){this.id=r,this.addr=t,this.setValue=QIe(e.type)}function fNe(r,e,t){this.id=r,this.addr=t,this.size=e.size,this.setValue=cNe(e.type)}function Cse(r){this.id=r,bse.call(this)}function _oe(r,e){r.seq.push(e),r.map[e.id]=e}function pNe(r,e,t){var i=r.name,n=i.length;for(ok.lastIndex=0;;){var a=ok.exec(i),o=ok.lastIndex,s=a[1],l=a[2]==="]",u=a[3];if(l&&(s=s|0),u===void 0||u==="["&&o+2===n){_oe(t,u===void 0?new hNe(s,r,e):new fNe(s,r,e));break}else{var c=t.map,h=c[s];h===void 0&&(h=new Cse(s),_oe(t,h)),t=h}}}function Jf(r,e,t){bse.call(this),this.renderer=t;for(var i=r.getProgramParameter(e,r.ACTIVE_UNIFORMS),n=0;n!==i;++n){var a=r.getActiveUniform(e,n),o=a.name,s=r.getUniformLocation(e,o);pNe(a,s,this)}}function Wt(r,e,t){return e===void 0&&t===void 0?this.set(r):this.setRGB(r,e,t)}function sm(r,e,t,i,n,a,o,s,l,u,c,h){ci.call(this,null,a,o,s,l,u,i,n,c,h),this.image={data:r,width:e,height:t},this.magFilter=l!==void 0?l:bs,this.minFilter=u!==void 0?u:bs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function BM(r,e){this.min=r!==void 0?r:new Tt(1/0,1/0),this.max=e!==void 0?e:new Tt(-1/0,-1/0)}function pOe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c,h;function f(){var d=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),g=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,g,t.STATIC_DRAW),c=t.createTexture(),h=t.createTexture(),i.bindTexture(t.TEXTURE_2D,c),t.texImage2D(t.TEXTURE_2D,0,t.RGB,16,16,0,t.RGB,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),i.bindTexture(t.TEXTURE_2D,h),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,16,16,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),o={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(`
  2. `),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(`
  3. `)},s=p(o),l={vertex:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},u={renderType:t.getUniformLocation(s,"renderType"),map:t.getUniformLocation(s,"map"),occlusionMap:t.getUniformLocation(s,"occlusionMap"),opacity:t.getUniformLocation(s,"opacity"),color:t.getUniformLocation(s,"color"),scale:t.getUniformLocation(s,"scale"),rotation:t.getUniformLocation(s,"rotation"),screenPosition:t.getUniformLocation(s,"screenPosition")}}this.render=function(d,g,m){if(e.length!==0){var v=new oe,_=m.w/m.z,y=m.z*.5,x=m.w*.5,M=16/m.w,S=new Tt(M*_,M),w=new oe(1,1,0),T=new Tt(1,1),C=new BM;C.min.set(m.x,m.y),C.max.set(m.x+(m.z-16),m.y+(m.w-16)),s===void 0&&f(),t.useProgram(s),i.initAttributes(),i.enableAttribute(l.vertex),i.enableAttribute(l.uv),i.disableUnusedAttributes(),t.uniform1i(u.occlusionMap,0),t.uniform1i(u.map,1),t.bindBuffer(t.ARRAY_BUFFER,n),t.vertexAttribPointer(l.vertex,2,t.FLOAT,!1,2*8,0),t.vertexAttribPointer(l.uv,2,t.FLOAT,!1,2*8,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),i.disable(t.CULL_FACE),i.setDepthWrite(!1);for(var b=0,E=e.length;b<E;b++){M=16/m.w,S.set(M*_,M);var I=e[b];if(v.set(I.matrixWorld.elements[12],I.matrixWorld.elements[13],I.matrixWorld.elements[14]),v.applyMatrix4(g.matrixWorldInverse),v.applyProjection(g.projectionMatrix),w.copy(v),T.x=m.x+w.x*y+y-8,T.y=m.y+w.y*x+x-8,C.containsPoint(T)===!0){i.activeTexture(t.TEXTURE0),i.bindTexture(t.TEXTURE_2D,null),i.activeTexture(t.TEXTURE1),i.bindTexture(t.TEXTURE_2D,c),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGB,T.x,T.y,16,16,0),t.uniform1i(u.renderType,0),t.uniform2f(u.scale,S.x,S.y),t.uniform3f(u.screenPosition,w.x,w.y,w.z),i.disable(t.BLEND),i.enable(t.DEPTH_TEST),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),i.activeTexture(t.TEXTURE0),i.bindTexture(t.TEXTURE_2D,h),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,T.x,T.y,16,16,0),t.uniform1i(u.renderType,1),i.disable(t.DEPTH_TEST),i.activeTexture(t.TEXTURE1),i.bindTexture(t.TEXTURE_2D,c),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),I.positionScreen.copy(w),I.customUpdateCallback?I.customUpdateCallback(I):I.updateLensFlares(),t.uniform1i(u.renderType,2),i.enable(t.BLEND);for(var R=0,A=I.lensFlares.length;R<A;R++){var P=I.lensFlares[R];P.opacity>.001&&P.scale>.001&&(w.x=P.x,w.y=P.y,w.z=P.z,M=P.size*P.scale/m.w,S.x=M*_,S.y=M,t.uniform3f(u.screenPosition,w.x,w.y,w.z),t.uniform2f(u.scale,S.x,S.y),t.uniform1f(u.rotation,P.rotation),t.uniform1f(u.opacity,P.opacity),t.uniform3f(u.color,P.color.r,P.color.g,P.color.b),i.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),r.setTexture2D(P.texture,1),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0))}}}i.enable(t.CULL_FACE),i.enable(t.DEPTH_TEST),i.setDepthWrite(!0),r.resetGLState()}};function p(d){var g=t.createProgram(),m=t.createShader(t.FRAGMENT_SHADER),v=t.createShader(t.VERTEX_SHADER),_="precision "+r.getPrecision()+` float;
  4. `;return t.shaderSource(m,_+d.fragmentShader),t.shaderSource(v,_+d.vertexShader),t.compileShader(m),t.compileShader(v),t.attachShader(g,m),t.attachShader(g,v),t.linkProgram(g),g}}function dOe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c=new oe,h=new cn,f=new oe;function p(){var m=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),v=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,v,t.STATIC_DRAW),o=d(),s={position:t.getAttribLocation(o,"position"),uv:t.getAttribLocation(o,"uv")},l={uvOffset:t.getUniformLocation(o,"uvOffset"),uvScale:t.getUniformLocation(o,"uvScale"),rotation:t.getUniformLocation(o,"rotation"),scale:t.getUniformLocation(o,"scale"),color:t.getUniformLocation(o,"color"),map:t.getUniformLocation(o,"map"),opacity:t.getUniformLocation(o,"opacity"),modelViewMatrix:t.getUniformLocation(o,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(o,"projectionMatrix"),fogType:t.getUniformLocation(o,"fogType"),fogDensity:t.getUniformLocation(o,"fogDensity"),fogNear:t.getUniformLocation(o,"fogNear"),fogFar:t.getUniformLocation(o,"fogFar"),fogColor:t.getUniformLocation(o,"fogColor"),alphaTest:t.getUniformLocation(o,"alphaTest")};var _=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");_.width=8,_.height=8;var y=_.getContext("2d");y.fillStyle="white",y.fillRect(0,0,8,8),u=new ci(_),u.needsUpdate=!0}this.render=function(m,v){if(e.length!==0){o===void 0&&p(),t.useProgram(o),i.initAttributes(),i.enableAttribute(s.position),i.enableAttribute(s.uv),i.disableUnusedAttributes(),i.disable(t.CULL_FACE),i.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,n),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,2*8,0),t.vertexAttribPointer(s.uv,2,t.FLOAT,!1,2*8,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.uniformMatrix4fv(l.projectionMatrix,!1,v.projectionMatrix.elements),i.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var _=0,y=0,x=m.fog;x?(t.uniform3f(l.fogColor,x.color.r,x.color.g,x.color.b),x.isFog?(t.uniform1f(l.fogNear,x.near),t.uniform1f(l.fogFar,x.far),t.uniform1i(l.fogType,1),_=1,y=1):x.isFogExp2&&(t.uniform1f(l.fogDensity,x.density),t.uniform1i(l.fogType,2),_=2,y=2)):(t.uniform1i(l.fogType,0),_=0,y=0);for(var M=0,S=e.length;M<S;M++){var w=e[M];w.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,w.matrixWorld),w.z=-w.modelViewMatrix.elements[14]}e.sort(g);for(var T=[],M=0,S=e.length;M<S;M++){var w=e[M],C=w.material;if(C.visible!==!1){t.uniform1f(l.alphaTest,C.alphaTest),t.uniformMatrix4fv(l.modelViewMatrix,!1,w.modelViewMatrix.elements),w.matrixWorld.decompose(c,h,f),T[0]=f.x,T[1]=f.y;var b=0;m.fog&&C.fog&&(b=y),_!==b&&(t.uniform1i(l.fogType,b),_=b),C.map!==null?(t.uniform2f(l.uvOffset,C.map.offset.x,C.map.offset.y),t.uniform2f(l.uvScale,C.map.repeat.x,C.map.repeat.y)):(t.uniform2f(l.uvOffset,0,0),t.uniform2f(l.uvScale,1,1)),t.uniform1f(l.opacity,C.opacity),t.uniform3f(l.color,C.color.r,C.color.g,C.color.b),t.uniform1f(l.rotation,C.rotation),t.uniform2fv(l.scale,T),i.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),i.setDepthTest(C.depthTest),i.setDepthWrite(C.depthWrite),C.map?r.setTexture2D(C.map,0):r.setTexture2D(u,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0)}}i.enable(t.CULL_FACE),r.resetGLState()}};function d(){var m=t.createProgram(),v=t.createShader(t.VERTEX_SHADER),_=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(v,["precision "+r.getPrecision()+" float;","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(`
  5. `)),t.shaderSource(_,["precision "+r.getPrecision()+" float;","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(`
  6. `)),t.compileShader(v),t.compileShader(_),t.attachShader(m,v),t.attachShader(m,_),t.linkProgram(m),m}function g(m,v){return m.renderOrder!==v.renderOrder?m.renderOrder-v.renderOrder:m.z!==v.z?v.z-m.z:v.id-m.id}}function _r(){Object.defineProperty(this,"id",{value:mOe++}),this.uuid=fr.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=a_,this.side=y0,this.shading=zk,this.vertexColors=bL,this.opacity=1,this.transparent=!1,this.blendSrc=Wk,this.blendDst=Xk,this.blendEquation=Hk,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=qR,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.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0}function Na(r){_r.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() {
  7. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  8. }`,this.fragmentShader=`void main() {
  9. gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
  10. }`,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,r!==void 0&&(r.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(r))}function $f(r){_r.call(this),this.type="MeshDepthMaterial",this.depthPacking=_se,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(r)}function Zu(r,e){this.min=r!==void 0?r:new oe(1/0,1/0,1/0),this.max=e!==void 0?e:new oe(-1/0,-1/0,-1/0)}function ha(r,e){this.center=r!==void 0?r:new oe,this.radius=e!==void 0?e:0}function dl(){this.elements=new Float32Array([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 xs(r,e){this.normal=r!==void 0?r:new oe(1,0,0),this.constant=e!==void 0?e:0}function kM(r,e,t,i,n,a){this.planes=[r!==void 0?r:new xs,e!==void 0?e:new xs,t!==void 0?t:new xs,i!==void 0?i:new xs,n!==void 0?n:new xs,a!==void 0?a:new xs]}function Rse(r,e,t,i){var n=r.context,a=r.state,o=new kM,s=new Kt,l=e.shadows,u=new Tt,c=new Tt(i.maxTextureSize,i.maxTextureSize),h=new oe,f=new oe,p=[],d=1,g=2,m=(d|g)+1,v=new Array(m),_=new Array(m),y={},x=[new oe(1,0,0),new oe(-1,0,0),new oe(0,0,1),new oe(0,0,-1),new oe(0,1,0),new oe(0,-1,0)],M=[new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,0,1),new oe(0,0,-1)],S=[new ii,new ii,new ii,new ii,new ii,new ii],w=new $f;w.depthPacking=xse,w.clipping=!0;for(var T=b0.distanceRGBA,C=Yo.clone(T.uniforms),b=0;b!==m;++b){var E=(b&d)!==0,I=(b&g)!==0,R=w.clone();R.morphTargets=E,R.skinning=I,v[b]=R;var A=new Na({defines:{USE_SHADOWMAP:""},uniforms:C,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,morphTargets:E,skinning:I,clipping:!0});_[b]=A}var P=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Uk,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(z,k){if(P.enabled!==!1&&!(P.autoUpdate===!1&&P.needsUpdate===!1)&&l.length!==0){a.buffers.color.setClear(1,1,1,1),a.disable(n.BLEND),a.setDepthTest(!0),a.setScissorTest(!1);for(var G,Y,J=0,Q=l.length;J<Q;J++){var V=l[J],K=V.shadow;if(K===void 0){console.warn("THREE.WebGLShadowMap:",V,"has no shadow.");continue}var ae=K.camera;if(u.copy(K.mapSize),u.min(c),V&&V.isPointLight){G=6,Y=!0;var ve=u.x,ue=u.y;S[0].set(ve*2,ue,ve,ue),S[1].set(0,ue,ve,ue),S[2].set(ve*3,ue,ve,ue),S[3].set(ve,ue,ve,ue),S[4].set(ve*3,0,ve,ue),S[5].set(ve,0,ve,ue),u.x*=4,u.y*=2}else G=1,Y=!1;if(K.map===null){var se={minFilter:bs,magFilter:bs,format:qu};K.map=new o_(u.x,u.y,se),ae.updateProjectionMatrix()}K.isSpotLightShadow&&K.update(V),K&&K.isRectAreaLightShadow&&K.update(V);var Ee=K.map,q=K.matrix;f.setFromMatrixPosition(V.matrixWorld),ae.position.copy(f),r.setRenderTarget(Ee),r.clear();for(var H=0;H<G;H++){if(Y){h.copy(ae.position),h.add(x[H]),ae.up.copy(M[H]),ae.lookAt(h);var We=S[H];a.viewport(We)}else h.setFromMatrixPosition(V.target.matrixWorld),ae.lookAt(h);ae.updateMatrixWorld(),ae.matrixWorldInverse.getInverse(ae.matrixWorld),q.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),q.multiply(ae.projectionMatrix),q.multiply(ae.matrixWorldInverse),s.multiplyMatrices(ae.projectionMatrix,ae.matrixWorldInverse),o.setFromMatrix(s),p.length=0,B(z,k,ae);for(var _e=0,xe=p.length;_e<xe;_e++){var Le=p[_e],Ue=t.update(Le),Ne=Le.material;if(Ne&&Ne.isMultiMaterial)for(var Ve=Ue.groups,dt=Ne.materials,F=0,L=Ve.length;F<L;F++){var ne=Ve[F],le=dt[ne.materialIndex];if(le.visible===!0){var me=U(Le,le,Y,f);r.renderBufferDirect(ae,null,Ue,me,Le,ne)}}else{var me=U(Le,Ne,Y,f);r.renderBufferDirect(ae,null,Ue,me,Le,null)}}}}var fe=r.getClearColor(),et=r.getClearAlpha();r.setClearColor(fe,et),P.needsUpdate=!1}};function U(z,k,G,Y){var J=z.geometry,Q=null,V=v,K=z.customDepthMaterial;if(G&&(V=_,K=z.customDistanceMaterial),K)Q=K;else{var ae=!1;k.morphTargets&&(J&&J.isBufferGeometry?ae=J.morphAttributes&&J.morphAttributes.position&&J.morphAttributes.position.length>0:J&&J.isGeometry&&(ae=J.morphTargets&&J.morphTargets.length>0));var ve=z.isSkinnedMesh&&k.skinning,ue=0;ae&&(ue|=d),ve&&(ue|=g),Q=V[ue]}if(r.localClippingEnabled&&k.clipShadows===!0&&k.clippingPlanes.length!==0){var se=Q.uuid,Ee=k.uuid,q=y[se];q===void 0&&(q={},y[se]=q);var H=q[Ee];H===void 0&&(H=Q.clone(),q[Ee]=H),Q=H}Q.visible=k.visible,Q.wireframe=k.wireframe;var We=k.side;return P.renderSingleSided&&We==n_&&(We=y0),P.renderReverseSided&&(We===y0?We=jf:We===jf&&(We=y0)),Q.side=We,Q.clipShadows=k.clipShadows,Q.clippingPlanes=k.clippingPlanes,Q.wireframeLinewidth=k.wireframeLinewidth,Q.linewidth=k.linewidth,G&&Q.uniforms.lightPos!==void 0&&Q.uniforms.lightPos.value.copy(Y),Q}function B(z,k,G){if(z.visible!==!1){var Y=(z.layers.mask&k.layers.mask)!==0;if(Y&&(z.isMesh||z.isLine||z.isPoints)&&z.castShadow&&(z.frustumCulled===!1||o.intersectsObject(z)===!0)){var J=z.material;J.visible===!0&&(z.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,z.matrixWorld),p.push(z))}for(var Q=z.children,V=0,K=Q.length;V<K;V++)B(Q[V],k,G)}}}function Qf(r,e){this.origin=r!==void 0?r:new oe,this.direction=e!==void 0?e:new oe}function ep(r,e,t,i){this._x=r||0,this._y=e||0,this._z=t||0,this._order=i||ep.DefaultOrder}function $R(){this.mask=1}function Lt(){Object.defineProperty(this,"id",{value:vOe++}),this.uuid=fr.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Lt.DefaultUp.clone();var r=new oe,e=new ep,t=new cn,i=new oe(1,1,1);function n(){t.setFromEuler(e,!1)}function a(){e.setFromQuaternion(t,void 0,!1)}e.onChange(n),t.onChange(a),Object.defineProperties(this,{position:{enumerable:!0,value:r},rotation:{enumerable:!0,value:e},quaternion:{enumerable:!0,value:t},scale:{enumerable:!0,value:i},modelViewMatrix:{value:new Kt},normalMatrix:{value:new dl}}),this.matrix=new Kt,this.matrixWorld=new Kt,this.matrixAutoUpdate=Lt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new $R,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={},this.onBeforeRender=function(){},this.onAfterRender=function(){}}function rm(r,e){this.start=r!==void 0?r:new oe,this.end=e!==void 0?e:new oe}function fl(r,e,t){this.a=r!==void 0?r:new oe,this.b=e!==void 0?e:new oe,this.c=t!==void 0?t:new oe}function ws(r,e,t,i,n,a){this.a=r,this.b=e,this.c=t,this.normal=i&&i.isVector3?i:new oe,this.vertexNormals=Array.isArray(i)?i:[],this.color=n&&n.isColor?n:new Wt,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=a!==void 0?a:0}function jo(r){_r.call(this),this.type="MeshBasicMaterial",this.color=new Wt(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=wb,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(r)}function Mt(r,e,t){if(Array.isArray(r))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=fr.generateUUID(),this.array=r,this.itemSize=e,this.count=r!==void 0?r.length/e:0,this.normalized=t===!0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function VM(r,e){Mt.call(this,new Int8Array(r),e)}function GM(r,e){Mt.call(this,new Uint8Array(r),e)}function HM(r,e){Mt.call(this,new Uint8ClampedArray(r),e)}function WM(r,e){Mt.call(this,new Int16Array(r),e)}function eh(r,e){Mt.call(this,new Uint16Array(r),e)}function XM(r,e){Mt.call(this,new Int32Array(r),e)}function th(r,e){Mt.call(this,new Uint32Array(r),e)}function Mr(r,e){Mt.call(this,new Float32Array(r),e)}function YM(r,e){Mt.call(this,new Float64Array(r),e)}function Lse(){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 ur(){Object.defineProperty(this,"id",{value:Qk()}),this.uuid=fr.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 Qk(){return gOe++}function Vt(){Object.defineProperty(this,"id",{value:Qk()}),this.uuid=fr.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 _n(r,e){Lt.call(this),this.type="Mesh",this.geometry=r!==void 0?r:new Vt,this.material=e!==void 0?e:new jo({color:Math.random()*16777215}),this.drawMode=Jk,this.updateMorphTargets()}function lm(r,e,t,i,n,a){Vt.call(this),this.type="BoxBufferGeometry",this.parameters={width:r,height:e,depth:t,widthSegments:i,heightSegments:n,depthSegments:a};var o=this;i=Math.floor(i)||1,n=Math.floor(n)||1,a=Math.floor(a)||1;var s=_(i,n,a),l=y(i,n,a),u=new(l>65535?Uint32Array:Uint16Array)(l),c=new Float32Array(s*3),h=new Float32Array(s*3),f=new Float32Array(s*2),p=0,d=0,g=0,m=0,v=0;x("z","y","x",-1,-1,t,e,r,a,n,0),x("z","y","x",1,-1,t,e,-r,a,n,1),x("x","z","y",1,1,r,t,e,i,a,2),x("x","z","y",1,-1,r,t,-e,i,a,3),x("x","y","z",1,-1,r,e,t,i,n,4),x("x","y","z",-1,-1,r,e,-t,i,n,5),this.setIndex(new Mt(u,1)),this.addAttribute("position",new Mt(c,3)),this.addAttribute("normal",new Mt(h,3)),this.addAttribute("uv",new Mt(f,2));function _(M,S,w){var T=0;return T+=(M+1)*(S+1)*2,T+=(M+1)*(w+1)*2,T+=(w+1)*(S+1)*2,T}function y(M,S,w){var T=0;return T+=M*S*2,T+=M*w*2,T+=w*S*2,T*6}function x(M,S,w,T,C,b,E,I,R,A,P){for(var U=b/R,B=E/A,z=b/2,k=E/2,G=I/2,Y=R+1,J=A+1,Q=0,V=0,K=new oe,ae=0;ae<J;ae++)for(var ve=ae*B-k,ue=0;ue<Y;ue++){var se=ue*U-z;K[M]=se*T,K[S]=ve*C,K[w]=G,c[p]=K.x,c[p+1]=K.y,c[p+2]=K.z,K[M]=0,K[S]=0,K[w]=I>0?1:-1,h[p]=K.x,h[p+1]=K.y,h[p+2]=K.z,f[d]=ue/R,f[d+1]=1-ae/A,p+=3,d+=2,Q+=1}for(ae=0;ae<A;ae++)for(ue=0;ue<R;ue++){var Ee=m+ue+Y*ae,q=m+ue+Y*(ae+1),H=m+(ue+1)+Y*(ae+1),We=m+(ue+1)+Y*ae;u[g]=Ee,u[g+1]=q,u[g+2]=We,u[g+3]=q,u[g+4]=H,u[g+5]=We,g+=6,V+=6}o.addGroup(v,V,P),v+=V,m+=Q}}function um(r,e,t,i){Vt.call(this),this.type="PlaneBufferGeometry",this.parameters={width:r,height:e,widthSegments:t,heightSegments:i};for(var n=r/2,a=e/2,o=Math.floor(t)||1,s=Math.floor(i)||1,l=o+1,u=s+1,c=r/o,h=e/s,f=new Float32Array(l*u*3),p=new Float32Array(l*u*3),d=new Float32Array(l*u*2),g=0,m=0,v=0;v<u;v++)for(var _=v*h-a,y=0;y<l;y++){var x=y*c-n;f[g]=x,f[g+1]=-_,p[g+2]=1,d[m]=y/o,d[m+1]=1-v/s,g+=3,m+=2}g=0;for(var M=new(f.length/3>65535?Uint32Array:Uint16Array)(o*s*6),v=0;v<s;v++)for(var y=0;y<o;y++){var S=y+l*v,w=y+l*(v+1),T=y+1+l*(v+1),C=y+1+l*v;M[g]=S,M[g+1]=w,M[g+2]=C,M[g+3]=w,M[g+4]=T,M[g+5]=C,g+=6}this.setIndex(new Mt(M,1)),this.addAttribute("position",new Mt(f,3)),this.addAttribute("normal",new Mt(p,3)),this.addAttribute("uv",new Mt(d,2))}function fa(){Lt.call(this),this.type="Camera",this.matrixWorldInverse=new Kt,this.projectionMatrix=new Kt}function ua(r,e,t,i){fa.call(this),this.type="PerspectiveCamera",this.fov=r!==void 0?r:50,this.zoom=1,this.near=t!==void 0?t:.1,this.far=i!==void 0?i:2e3,this.focus=10,this.aspect=e!==void 0?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function w0(r,e,t,i,n,a){fa.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=r,this.right=e,this.top=t,this.bottom=i,this.near=n!==void 0?n:.1,this.far=a!==void 0?a:2e3,this.updateProjectionMatrix()}function yOe(r,e,t){var i;function n(c){i=c}var a,o;function s(c){c.array instanceof Uint32Array&&e.get("OES_element_index_uint")?(a=r.UNSIGNED_INT,o=4):c.array instanceof Uint16Array?(a=r.UNSIGNED_SHORT,o=2):(a=r.UNSIGNED_BYTE,o=1)}function l(c,h){r.drawElements(i,h,a,c*o),t.calls++,t.vertices+=h,i===r.TRIANGLES&&(t.faces+=h/3)}function u(c,h,f){var p=e.get("ANGLE_instanced_arrays");if(p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p.drawElementsInstancedANGLE(i,f,a,h*o,c.maxInstancedCount),t.calls++,t.vertices+=f*c.maxInstancedCount,i===r.TRIANGLES&&(t.faces+=c.maxInstancedCount*f/3)}return{setMode:n,setIndex:s,render:l,renderInstances:u}}function _Oe(r,e,t){var i;function n(s){i=s}function a(s,l){r.drawArrays(i,s,l),t.calls++,t.vertices+=l,i===r.TRIANGLES&&(t.faces+=l/3)}function o(s){var l=e.get("ANGLE_instanced_arrays");if(l===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var u=s.attributes.position,c=0;u.isInterleavedBufferAttribute?(c=u.data.count,l.drawArraysInstancedANGLE(i,0,c,s.maxInstancedCount)):(c=u.count,l.drawArraysInstancedANGLE(i,0,c,s.maxInstancedCount)),t.calls++,t.vertices+=c*s.maxInstancedCount,i===r.TRIANGLES&&(t.faces+=s.maxInstancedCount*c/3)}return{setMode:n,render:a,renderInstances:o}}function xOe(){var r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];var t;switch(e.type){case"DirectionalLight":t={direction:new oe,color:new Wt,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Tt};break;case"SpotLight":t={position:new oe,direction:new oe,color:new Wt,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Tt};break;case"PointLight":t={position:new oe,color:new Wt,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Tt};break;case"HemisphereLight":t={direction:new oe,skyColor:new Wt,groundColor:new Wt};break;case"RectAreaLight":t={color:new Wt,position:new oe,halfWidth:new oe,halfHeight:new oe};break}return r[e.id]=t,t}}}function SOe(r){for(var e=r.split(`
  11. `),t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join(`
  12. `)}function xoe(r,e,t){var i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),r.getShaderParameter(i,r.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),r.getShaderInfoLog(i)!==""&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===r.VERTEX_SHADER?"vertex":"fragment",r.getShaderInfoLog(i),SOe(t)),i}function Dse(r){switch(r){case FM:return["Linear","( value )"];case dse:return["sRGB","( value )"];case mse:return["RGBE","( value )"];case vse:return["RGBM","( value, 7.0 )"];case gse:return["RGBM","( value, 16.0 )"];case yse:return["RGBD","( value, 256.0 )"];case $k:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+r)}}function sk(r,e){var t=Dse(e);return"vec4 "+r+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function bOe(r,e){var t=Dse(e);return"vec4 "+r+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function wOe(r,e){var t;switch(e){case Yk:t="Linear";break;case joe:t="Reinhard";break;case Koe:t="Uncharted2";break;case Joe:t="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function TOe(r,e,t){r=r||{};var i=[r.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(r.fragDepth||e.logarithmicDepthBuffer)&&t.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",r.drawBuffers&&t.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(r.shaderTextureLOD||e.envMap)&&t.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return i.filter(LM).join(`
  13. `)}function EOe(r){var e=[];for(var t in r){var i=r[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(`
  14. `)}function AOe(r,e,t){for(var i={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES),a=0;a<n;a++){var o=r.getActiveAttrib(e,a),s=o.name;i[s]=r.getAttribLocation(e,s)}return i}function LM(r){return r!==""}function Soe(r,e){return r.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 xk(r){var e=/#include +<([\w\d.]+)>/g;function t(i,n){var a=jr[n];if(a===void 0)throw new Error("Can not resolve #include <"+n+">");return xk(a)}return r.replace(e,t)}function Moe(r){var e=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function t(i,n,a,o){for(var s="",l=parseInt(n);l<parseInt(a);l++)s+=o.replace(/\[ i \]/g,"[ "+l+" ]");return s}return r.replace(e,t)}function COe(r,e,t,i){var n=r.context,a=t.extensions,o=t.defines,s=t.__webglShader.vertexShader,l=t.__webglShader.fragmentShader,u="SHADOWMAP_TYPE_BASIC";i.shadowMapType===Uk?u="SHADOWMAP_TYPE_PCF":i.shadowMapType===Aoe&&(u="SHADOWMAP_TYPE_PCF_SOFT");var c="ENVMAP_TYPE_CUBE",h="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(i.envMap){switch(t.envMap.mapping){case TL:case ZR:c="ENVMAP_TYPE_CUBE";break;case EL:case AL:c="ENVMAP_TYPE_CUBE_UV";break;case qk:case jR:c="ENVMAP_TYPE_EQUIREC";break;case Zk:c="ENVMAP_TYPE_SPHERE";break}switch(t.envMap.mapping){case ZR:case jR:h="ENVMAP_MODE_REFRACTION";break}switch(t.combine){case wb:f="ENVMAP_BLENDING_MULTIPLY";break;case qoe:f="ENVMAP_BLENDING_MIX";break;case Zoe:f="ENVMAP_BLENDING_ADD";break}}var p=r.gammaFactor>0?r.gammaFactor:1,d=TOe(a,i,r.extensions),g=EOe(o),m=n.createProgram(),v,_;t.isRawShaderMaterial?(v=[g,`
  15. `].filter(LM).join(`
  16. `),_=[d,g,`
  17. `].filter(LM).join(`
  18. `)):(v=["precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+t.__webglShader.name,g,i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+i.maxBones,i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",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&&i.flatShading===!1?"#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 "+u:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&r.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"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
  19. `].filter(LM).join(`
  20. `),_=[d,"precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+t.__webglShader.name,g,i.alphaTest?"#define ALPHATEST "+i.alphaTest:"","#define GAMMA_FACTOR "+p,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 "+c:"",i.envMap?"#define "+h:"",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.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 "+u:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&r.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",i.envMap&&r.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",i.toneMapping!==XR?"#define TONE_MAPPING":"",i.toneMapping!==XR?jr.tonemapping_pars_fragment:"",i.toneMapping!==XR?wOe("toneMapping",i.toneMapping):"",i.outputEncoding||i.mapEncoding||i.envMapEncoding||i.emissiveMapEncoding?jr.encodings_pars_fragment:"",i.mapEncoding?sk("mapTexelToLinear",i.mapEncoding):"",i.envMapEncoding?sk("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMapEncoding?sk("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.outputEncoding?bOe("linearToOutputTexel",i.outputEncoding):"",i.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
  21. `].filter(LM).join(`
  22. `)),s=xk(s,i),s=Soe(s,i),l=xk(l,i),l=Soe(l,i),t.isShaderMaterial||(s=Moe(s),l=Moe(l));var y=v+s,x=_+l,M=xoe(n,n.VERTEX_SHADER,y),S=xoe(n,n.FRAGMENT_SHADER,x);n.attachShader(m,M),n.attachShader(m,S),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):i.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);var w=n.getProgramInfoLog(m),T=n.getShaderInfoLog(M),C=n.getShaderInfoLog(S),b=!0,E=!0;n.getProgramParameter(m,n.LINK_STATUS)===!1?(b=!1,console.error("THREE.WebGLProgram: shader error: ",n.getError(),"gl.VALIDATE_STATUS",n.getProgramParameter(m,n.VALIDATE_STATUS),"gl.getProgramInfoLog",w,T,C)):w!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",w):(T===""||C==="")&&(E=!1),E&&(this.diagnostics={runnable:b,material:t,programLog:w,vertexShader:{log:T,prefix:v},fragmentShader:{log:C,prefix:_}}),n.deleteShader(M),n.deleteShader(S);var I;this.getUniforms=function(){return I===void 0&&(I=new Jf(n,m,r)),I};var R;return this.getAttributes=function(){return R===void 0&&(R=AOe(n,m)),R},this.destroy=function(){n.deleteProgram(m),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=MOe++,this.code=e,this.usedTimes=1,this.program=m,this.vertexShader=M,this.fragmentShader=S,this}function ROe(r,e){var t=[],i={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},n=["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"];function a(s){if(e.floatVertexTextures&&s&&s.skeleton&&s.skeleton.useVertexTexture)return 1024;var l=e.maxVertexUniforms,u=Math.floor((l-20)/4),c=u;return s!==void 0&&s&&s.isSkinnedMesh&&(c=Math.min(s.skeleton.bones.length,c),c<s.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+s.skeleton.bones.length+", this GPU supports just "+c+" (try OpenGL instead of ANGLE)")),c}function o(s,l){var u;return s?s.isTexture?u=s.encoding:s.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),u=s.texture.encoding):u=FM,u===FM&&l&&(u=$k),u}this.getParameters=function(s,l,u,c,h,f){var p=i[s.type],d=a(f),g=r.getPrecision();s.precision!==null&&(g=e.getMaxPrecision(s.precision),g!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",g,"instead."));var m=r.getCurrentRenderTarget(),v={shaderID:p,precision:g,supportsVertexTextures:e.vertexTextures,outputEncoding:o(m?m.texture:null,r.gammaOutput),map:!!s.map,mapEncoding:o(s.map,r.gammaInput),envMap:!!s.envMap,envMapMode:s.envMap&&s.envMap.mapping,envMapEncoding:o(s.envMap,r.gammaInput),envMapCubeUV:!!s.envMap&&(s.envMap.mapping===EL||s.envMap.mapping===AL),lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,emissiveMapEncoding:o(s.emissiveMap,r.gammaInput),bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,alphaMap:!!s.alphaMap,gradientMap:!!s.gradientMap,combine:s.combine,vertexColors:s.vertexColors,fog:!!u,useFog:s.fog,fogExp:u&&u.isFogExp2,flatShading:s.shading===Ok,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:e.logarithmicDepthBuffer,skinning:s.skinning,maxBones:d,useVertexTexture:e.floatVertexTextures&&f&&f.skeleton&&f.skeleton.useVertexTexture,morphTargets:s.morphTargets,morphNormals:s.morphNormals,maxMorphTargets:r.maxMorphTargets,maxMorphNormals:r.maxMorphNormals,numDirLights:l.directional.length,numPointLights:l.point.length,numSpotLights:l.spot.length,numRectAreaLights:l.rectArea.length,numHemiLights:l.hemi.length,numClippingPlanes:c,numClipIntersection:h,shadowMapEnabled:r.shadowMap.enabled&&f.receiveShadow&&l.shadows.length>0,shadowMapType:r.shadowMap.type,toneMapping:r.toneMapping,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,alphaTest:s.alphaTest,doubleSided:s.side===n_,flipSided:s.side===jf,depthPacking:s.depthPacking!==void 0?s.depthPacking:!1};return v},this.getProgramCode=function(s,l){var u=[];if(l.shaderID?u.push(l.shaderID):(u.push(s.fragmentShader),u.push(s.vertexShader)),s.defines!==void 0)for(var c in s.defines)u.push(c),u.push(s.defines[c]);for(var h=0;h<n.length;h++)u.push(l[n[h]]);return u.join()},this.acquireProgram=function(s,l,u){for(var c,h=0,f=t.length;h<f;h++){var p=t[h];if(p.code===u){c=p,++c.usedTimes;break}}return c===void 0&&(c=new COe(r,u,s,l),t.push(c)),c},this.releaseProgram=function(s){if(--s.usedTimes===0){var l=t.indexOf(s);t[l]=t[t.length-1],t.pop(),s.destroy()}},this.programs=t}function LOe(r,e,t){var i={};function n(u){var c=u.target,h=i[c.id];h.index!==null&&o(h.index),s(h.attributes),c.removeEventListener("dispose",n),delete i[c.id];var f=e.get(c);f.wireframe&&o(f.wireframe),e.delete(c);var p=e.get(h);p.wireframe&&o(p.wireframe),e.delete(h),t.memory.geometries--}function a(u){return u.isInterleavedBufferAttribute?e.get(u.data).__webglBuffer:e.get(u).__webglBuffer}function o(u){var c=a(u);c!==void 0&&(r.deleteBuffer(c),l(u))}function s(u){for(var c in u)o(u[c])}function l(u){u.isInterleavedBufferAttribute?e.delete(u.data):e.delete(u)}return{get:function(u){var c=u.geometry;if(i[c.id]!==void 0)return i[c.id];c.addEventListener("dispose",n);var h;return c.isBufferGeometry?h=c:c.isGeometry&&(c._bufferGeometry===void 0&&(c._bufferGeometry=new Vt().setFromObject(u)),h=c._bufferGeometry),i[c.id]=h,t.memory.geometries++,h}}}function DOe(r,e,t){var i=new LOe(r,e,t);function n(h){var f=i.get(h);h.geometry.isGeometry&&f.updateFromObject(h);var p=f.index,d=f.attributes;p!==null&&a(p,r.ELEMENT_ARRAY_BUFFER);for(var g in d)a(d[g],r.ARRAY_BUFFER);var m=f.morphAttributes;for(var g in m)for(var v=m[g],_=0,y=v.length;_<y;_++)a(v[_],r.ARRAY_BUFFER);return f}function a(h,f){var p=h.isInterleavedBufferAttribute?h.data:h,d=e.get(p);d.__webglBuffer===void 0?o(d,p,f):d.version!==p.version&&s(d,p,f)}function o(h,f,p){h.__webglBuffer=r.createBuffer(),r.bindBuffer(p,h.__webglBuffer);var d=f.dynamic?r.DYNAMIC_DRAW:r.STATIC_DRAW;r.bufferData(p,f.array,d);var g=r.FLOAT,m=f.array;m instanceof Float32Array?g=r.FLOAT:m instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):m instanceof Uint16Array?g=r.UNSIGNED_SHORT:m instanceof Int16Array?g=r.SHORT:m instanceof Uint32Array?g=r.UNSIGNED_INT:m instanceof Int32Array?g=r.INT:m instanceof Int8Array?g=r.BYTE:m instanceof Uint8Array&&(g=r.UNSIGNED_BYTE),h.bytesPerElement=m.BYTES_PER_ELEMENT,h.type=g,h.version=f.version,f.onUploadCallback()}function s(h,f,p){r.bindBuffer(p,h.__webglBuffer),f.dynamic===!1?r.bufferData(p,f.array,r.STATIC_DRAW):f.updateRange.count===-1?r.bufferSubData(p,0,f.array):f.updateRange.count===0?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."):(r.bufferSubData(p,f.updateRange.offset*f.array.BYTES_PER_ELEMENT,f.array.subarray(f.updateRange.offset,f.updateRange.offset+f.updateRange.count)),f.updateRange.count=0),h.version=f.version}function l(h){return h.isInterleavedBufferAttribute?e.get(h.data).__webglBuffer:e.get(h).__webglBuffer}function u(h){return h.isInterleavedBufferAttribute?e.get(h.data):e.get(h)}function c(h){var f=e.get(h);if(f.wireframe!==void 0)return f.wireframe;var p=[],d=h.index,g=h.attributes,m=g.position;if(d!==null)for(var v={},_=d.array,y=0,x=_.length;y<x;y+=3){var M=_[y+0],S=_[y+1],w=_[y+2];p.push(M,S,S,w,w,M)}else for(var _=g.position.array,y=0,x=_.length/3-1;y<x;y+=3){var M=y+0,S=y+1,w=y+2;p.push(M,S,S,w,w,M)}var T=m.count>65535?Uint32Array:Uint16Array,C=new Mt(new T(p),1);return a(C,r.ELEMENT_ARRAY_BUFFER),f.wireframe=C,C}return{getAttributeBuffer:l,getAttributeProperties:u,getWireframeAttribute:c,update:n}}function POe(r,e,t,i,n,a,o){var s=o.memory,l=typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext;function u(R,A){if(R.width>A||R.height>A){var P=A/Math.max(R.width,R.height),U=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");U.width=Math.floor(R.width*P),U.height=Math.floor(R.height*P);var B=U.getContext("2d");return B.drawImage(R,0,0,R.width,R.height,0,0,U.width,U.height),console.warn("THREE.WebGLRenderer: image is too big ("+R.width+"x"+R.height+"). Resized to "+U.width+"x"+U.height,R),U}return R}function c(R){return fr.isPowerOfTwo(R.width)&&fr.isPowerOfTwo(R.height)}function h(R){if(R instanceof HTMLImageElement||R instanceof HTMLCanvasElement){var A=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");A.width=fr.nearestPowerOfTwo(R.width),A.height=fr.nearestPowerOfTwo(R.height);var P=A.getContext("2d");return P.drawImage(R,0,0,A.width,A.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+R.width+"x"+R.height+"). Resized to "+A.width+"x"+A.height,R),A}return R}function f(R){return R.wrapS!==Ms||R.wrapT!==Ms||R.minFilter!==bs&&R.minFilter!==qo}function p(R){return R===bs||R===CL||R===RL?r.NEAREST:r.LINEAR}function d(R){var A=R.target;A.removeEventListener("dispose",d),m(A),s.textures--}function g(R){var A=R.target;A.removeEventListener("dispose",g),v(A),s.textures--}function m(R){var A=i.get(R);if(R.image&&A.__image__webglTextureCube)r.deleteTexture(A.__image__webglTextureCube);else{if(A.__webglInit===void 0)return;r.deleteTexture(A.__webglTexture)}i.delete(R)}function v(R){var A=i.get(R),P=i.get(R.texture);if(R){if(P.__webglTexture!==void 0&&r.deleteTexture(P.__webglTexture),R.depthTexture&&R.depthTexture.dispose(),R.isWebGLRenderTargetCube)for(var U=0;U<6;U++)r.deleteFramebuffer(A.__webglFramebuffer[U]),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[U]);else r.deleteFramebuffer(A.__webglFramebuffer),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer);i.delete(R.texture),i.delete(R)}}function _(R,A){var P=i.get(R);if(R.version>0&&P.__version!==R.version){var U=R.image;if(U===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",R);else if(U.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",R);else{S(P,R,A);return}}t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_2D,P.__webglTexture)}function y(R,A){var P=i.get(R);if(R.image.length===6)if(R.version>0&&P.__version!==R.version){P.__image__webglTextureCube||(R.addEventListener("dispose",d),P.__image__webglTextureCube=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,P.__image__webglTextureCube),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,R.flipY);for(var U=R&&R.isCompressedTexture,B=R.image[0]&&R.image[0].isDataTexture,z=[],k=0;k<6;k++)!U&&!B?z[k]=u(R.image[k],n.maxCubemapSize):z[k]=B?R.image[k].image:R.image[k];var G=z[0],Y=c(G),J=a(R.format),Q=a(R.type);M(r.TEXTURE_CUBE_MAP,R,Y);for(var k=0;k<6;k++)if(!U)B?t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,z[k].width,z[k].height,0,J,Q,z[k].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,J,Q,z[k]);else for(var V,K=z[k].mipmaps,ae=0,ve=K.length;ae<ve;ae++)V=K[ae],R.format!==qu&&R.format!==x0?t.getCompressedTextureFormats().indexOf(J)>-1?t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,V.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,J,Q,V.data);R.generateMipmaps&&Y&&r.generateMipmap(r.TEXTURE_CUBE_MAP),P.__version=R.version,R.onUpdate&&R.onUpdate(R)}else t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,P.__image__webglTextureCube)}function x(R,A){t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,i.get(R).__webglTexture)}function M(R,A,P){var U;if(P?(r.texParameteri(R,r.TEXTURE_WRAP_S,a(A.wrapS)),r.texParameteri(R,r.TEXTURE_WRAP_T,a(A.wrapT)),r.texParameteri(R,r.TEXTURE_MAG_FILTER,a(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,a(A.minFilter))):(r.texParameteri(R,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(R,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(A.wrapS!==Ms||A.wrapT!==Ms)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",A),r.texParameteri(R,r.TEXTURE_MAG_FILTER,p(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,p(A.minFilter)),A.minFilter!==bs&&A.minFilter!==qo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",A)),U=e.get("EXT_texture_filter_anisotropic"),U){if(A.type===_0&&e.get("OES_texture_float_linear")===null||A.type===JR&&e.get("OES_texture_half_float_linear")===null)return;(A.anisotropy>1||i.get(A).__currentAnisotropy)&&(r.texParameterf(R,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,n.getMaxAnisotropy())),i.get(A).__currentAnisotropy=A.anisotropy)}}function S(R,A,P){R.__webglInit===void 0&&(R.__webglInit=!0,A.addEventListener("dispose",d),R.__webglTexture=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+P),t.bindTexture(r.TEXTURE_2D,R.__webglTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment);var U=u(A.image,n.maxTextureSize);f(A)&&c(U)===!1&&(U=h(U));var B=c(U),z=a(A.format),k=a(A.type);M(r.TEXTURE_2D,A,B);var G,Y=A.mipmaps;if(A.isDepthTexture){var J=r.DEPTH_COMPONENT;if(A.type===_0){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");J=r.DEPTH_COMPONENT32F}else l&&(J=r.DEPTH_COMPONENT16);A.format===tm&&J===r.DEPTH_COMPONENT&&A.type!==NM&&A.type!==Kk&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),A.type=NM,k=a(A.type)),A.format===S0&&(J=r.DEPTH_STENCIL,A.type!==UM&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),A.type=UM,k=a(A.type))),t.texImage2D(r.TEXTURE_2D,0,J,U.width,U.height,0,z,k,null)}else if(A.isDataTexture)if(Y.length>0&&B){for(var Q=0,V=Y.length;Q<V;Q++)G=Y[Q],t.texImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,z,k,G.data);A.generateMipmaps=!1}else t.texImage2D(r.TEXTURE_2D,0,z,U.width,U.height,0,z,k,U.data);else if(A.isCompressedTexture)for(var Q=0,V=Y.length;Q<V;Q++)G=Y[Q],A.format!==qu&&A.format!==x0?t.getCompressedTextureFormats().indexOf(z)>-1?t.compressedTexImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,G.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,z,k,G.data);else if(Y.length>0&&B){for(var Q=0,V=Y.length;Q<V;Q++)G=Y[Q],t.texImage2D(r.TEXTURE_2D,Q,z,z,k,G);A.generateMipmaps=!1}else t.texImage2D(r.TEXTURE_2D,0,z,z,k,U);A.generateMipmaps&&B&&r.generateMipmap(r.TEXTURE_2D),R.__version=A.version,A.onUpdate&&A.onUpdate(A)}function w(R,A,P,U){var B=a(A.texture.format),z=a(A.texture.type);t.texImage2D(U,0,B,A.width,A.height,0,B,z,null),r.bindFramebuffer(r.FRAMEBUFFER,R),r.framebufferTexture2D(r.FRAMEBUFFER,P,U,i.get(A.texture).__webglTexture,0),r.bindFramebuffer(r.FRAMEBUFFER,null)}function T(R,A){r.bindRenderbuffer(r.RENDERBUFFER,R),A.depthBuffer&&!A.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,R)):A.depthBuffer&&A.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,R)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,A.width,A.height),r.bindRenderbuffer(r.RENDERBUFFER,null)}function C(R,A){var P=A&&A.isWebGLRenderTargetCube;if(P)throw new Error("Depth Texture with cube render targets is not supported!");if(r.bindFramebuffer(r.FRAMEBUFFER,R),!(A.depthTexture&&A.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(A.depthTexture).__webglTexture||A.depthTexture.image.width!==A.width||A.depthTexture.image.height!==A.height)&&(A.depthTexture.image.width=A.width,A.depthTexture.image.height=A.height,A.depthTexture.needsUpdate=!0),_(A.depthTexture,0);var U=i.get(A.depthTexture).__webglTexture;if(A.depthTexture.format===tm)r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,U,0);else if(A.depthTexture.format===S0)r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,U,0);else throw new Error("Unknown depthTexture format")}function b(R){var A=i.get(R),P=R.isWebGLRenderTargetCube===!0;if(R.depthTexture){if(P)throw new Error("target.depthTexture not supported in Cube render targets");C(A.__webglFramebuffer,R)}else if(P){A.__webglDepthbuffer=[];for(var U=0;U<6;U++)r.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[U]),A.__webglDepthbuffer[U]=r.createRenderbuffer(),T(A.__webglDepthbuffer[U],R)}else r.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer),A.__webglDepthbuffer=r.createRenderbuffer(),T(A.__webglDepthbuffer,R);r.bindFramebuffer(r.FRAMEBUFFER,null)}function E(R){var A=i.get(R),P=i.get(R.texture);R.addEventListener("dispose",g),P.__webglTexture=r.createTexture(),s.textures++;var U=R.isWebGLRenderTargetCube===!0,B=c(R);if(U){A.__webglFramebuffer=[];for(var z=0;z<6;z++)A.__webglFramebuffer[z]=r.createFramebuffer()}else A.__webglFramebuffer=r.createFramebuffer();if(U){t.bindTexture(r.TEXTURE_CUBE_MAP,P.__webglTexture),M(r.TEXTURE_CUBE_MAP,R.texture,B);for(var z=0;z<6;z++)w(A.__webglFramebuffer[z],R,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+z);R.texture.generateMipmaps&&B&&r.generateMipmap(r.TEXTURE_CUBE_MAP),t.bindTexture(r.TEXTURE_CUBE_MAP,null)}else t.bindTexture(r.TEXTURE_2D,P.__webglTexture),M(r.TEXTURE_2D,R.texture,B),w(A.__webglFramebuffer,R,r.COLOR_ATTACHMENT0,r.TEXTURE_2D),R.texture.generateMipmaps&&B&&r.generateMipmap(r.TEXTURE_2D),t.bindTexture(r.TEXTURE_2D,null);R.depthBuffer&&b(R)}function I(R){var A=R.texture;if(A.generateMipmaps&&c(R)&&A.minFilter!==bs&&A.minFilter!==qo){var P=R&&R.isWebGLRenderTargetCube?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,U=i.get(A).__webglTexture;t.bindTexture(P,U),r.generateMipmap(P),t.bindTexture(P,null)}}this.setTexture2D=_,this.setTextureCube=y,this.setTextureCubeDynamic=x,this.setupRenderTarget=E,this.updateRenderTargetMipmap=I}function IOe(){var r={};return{get:function(e){var t=e.uuid,i=r[t];return i===void 0&&(i={},r[t]=i),i},delete:function(e){delete r[e.uuid]},clear:function(){r={}}}}function NOe(r,e,t){function i(){var $=!1,nt=new ii,Xe=null,Fe=new ii;return{setMask:function(we){Xe!==we&&!$&&(r.colorMask(we,we,we,we),Xe=we)},setLocked:function(we){$=we},setClear:function(we,Ie,ct,Je,Gt){Gt===!0&&(we*=Je,Ie*=Je,ct*=Je),nt.set(we,Ie,ct,Je),Fe.equals(nt)===!1&&(r.clearColor(we,Ie,ct,Je),Fe.copy(nt))},reset:function(){$=!1,Xe=null,Fe.set(0,0,0,1)}}}function n(){var $=!1,nt=null,Xe=null,Fe=null;return{setTest:function(we){we?ve(r.DEPTH_TEST):ue(r.DEPTH_TEST)},setMask:function(we){nt!==we&&!$&&(r.depthMask(we),nt=we)},setFunc:function(we){if(Xe!==we){if(we)switch(we){case koe:r.depthFunc(r.NEVER);break;case Voe:r.depthFunc(r.ALWAYS);break;case Goe:r.depthFunc(r.LESS);break;case qR:r.depthFunc(r.LEQUAL);break;case Hoe:r.depthFunc(r.EQUAL);break;case Woe:r.depthFunc(r.GEQUAL);break;case Xoe:r.depthFunc(r.GREATER);break;case Yoe:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}else r.depthFunc(r.LEQUAL);Xe=we}},setLocked:function(we){$=we},setClear:function(we){Fe!==we&&(r.clearDepth(we),Fe=we)},reset:function(){$=!1,nt=null,Xe=null,Fe=null}}}function a(){var $=!1,nt=null,Xe=null,Fe=null,we=null,Ie=null,ct=null,Je=null,Gt=null;return{setTest:function(X){X?ve(r.STENCIL_TEST):ue(r.STENCIL_TEST)},setMask:function(X){nt!==X&&!$&&(r.stencilMask(X),nt=X)},setFunc:function(X,Te,te){(Xe!==X||Fe!==Te||we!==te)&&(r.stencilFunc(X,Te,te),Xe=X,Fe=Te,we=te)},setOp:function(X,Te,te){(Ie!==X||ct!==Te||Je!==te)&&(r.stencilOp(X,Te,te),Ie=X,ct=Te,Je=te)},setLocked:function(X){$=X},setClear:function(X){Gt!==X&&(r.clearStencil(X),Gt=X)},reset:function(){$=!1,nt=null,Xe=null,Fe=null,we=null,Ie=null,ct=null,Je=null,Gt=null}}}var o=new i,s=new n,l=new a,u=r.getParameter(r.MAX_VERTEX_ATTRIBS),c=new Uint8Array(u),h=new Uint8Array(u),f=new Uint8Array(u),p={},d=null,g=null,m=null,v=null,_=null,y=null,x=null,M=null,S=!1,w=null,T=null,C=null,b=null,E=null,I=null,R=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),A=parseFloat(/^WebGL\ ([0-9])/.exec(r.getParameter(r.VERSION))[1]),P=parseFloat(A)>=1,U=null,B={},z=new ii,k=new ii;function G($,nt,Xe){var Fe=new Uint8Array(4),we=r.createTexture();r.bindTexture($,we),r.texParameteri($,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri($,r.TEXTURE_MAG_FILTER,r.NEAREST);for(var Ie=0;Ie<Xe;Ie++)r.texImage2D(nt+Ie,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Fe);return we}var Y={};Y[r.TEXTURE_2D]=G(r.TEXTURE_2D,r.TEXTURE_2D,1),Y[r.TEXTURE_CUBE_MAP]=G(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6);function J(){o.setClear(0,0,0,1),s.setClear(1),l.setClear(0),ve(r.DEPTH_TEST),_e(qR),Ve(!1),dt(PM),ve(r.CULL_FACE),ve(r.BLEND),Ee(a_)}function Q(){for(var $=0,nt=c.length;$<nt;$++)c[$]=0}function V($){if(c[$]=1,h[$]===0&&(r.enableVertexAttribArray($),h[$]=1),f[$]!==0){var nt=e.get("ANGLE_instanced_arrays");nt.vertexAttribDivisorANGLE($,0),f[$]=0}}function K($,nt,Xe){c[$]=1,h[$]===0&&(r.enableVertexAttribArray($),h[$]=1),f[$]!==nt&&(Xe.vertexAttribDivisorANGLE($,nt),f[$]=nt)}function ae(){for(var $=0,nt=h.length;$!==nt;++$)h[$]!==c[$]&&(r.disableVertexAttribArray($),h[$]=0)}function ve($){p[$]!==!0&&(r.enable($),p[$]=!0)}function ue($){p[$]!==!1&&(r.disable($),p[$]=!1)}function se(){if(d===null&&(d=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var $=r.getParameter(r.COMPRESSED_TEXTURE_FORMATS),nt=0;nt<$.length;nt++)d.push($[nt]);return d}function Ee($,nt,Xe,Fe,we,Ie,ct,Je){$!==IM?ve(r.BLEND):ue(r.BLEND),($!==g||Je!==S)&&($===Bk?Je?(r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD),r.blendFuncSeparate(r.ONE,r.ONE,r.ONE,r.ONE)):(r.blendEquation(r.FUNC_ADD),r.blendFunc(r.SRC_ALPHA,r.ONE)):$===kk?Je?(r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD),r.blendFuncSeparate(r.ZERO,r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ONE_MINUS_SRC_ALPHA)):(r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ZERO,r.ONE_MINUS_SRC_COLOR)):$===Vk?Je?(r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD),r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA)):(r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ZERO,r.SRC_COLOR)):Je?(r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD),r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA)):(r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD),r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA)),g=$,S=Je),$===Gk?(we=we||nt,Ie=Ie||Xe,ct=ct||Fe,(nt!==m||we!==y)&&(r.blendEquationSeparate(t(nt),t(we)),m=nt,y=we),(Xe!==v||Fe!==_||Ie!==x||ct!==M)&&(r.blendFuncSeparate(t(Xe),t(Fe),t(Ie),t(ct)),v=Xe,_=Fe,x=Ie,M=ct)):(m=null,v=null,_=null,y=null,x=null,M=null)}function q($){o.setMask($)}function H($){s.setTest($)}function We($){s.setMask($)}function _e($){s.setFunc($)}function xe($){l.setTest($)}function Le($){l.setMask($)}function Ue($,nt,Xe){l.setFunc($,nt,Xe)}function Ne($,nt,Xe){l.setOp($,nt,Xe)}function Ve($){w!==$&&($?r.frontFace(r.CW):r.frontFace(r.CCW),w=$)}function dt($){$!==Toe?(ve(r.CULL_FACE),$!==T&&($===PM?r.cullFace(r.BACK):$===Nk?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ue(r.CULL_FACE),T=$}function F($){$!==C&&(P&&r.lineWidth($),C=$)}function L($,nt,Xe){$?(ve(r.POLYGON_OFFSET_FILL),(b!==nt||E!==Xe)&&(r.polygonOffset(nt,Xe),b=nt,E=Xe)):ue(r.POLYGON_OFFSET_FILL)}function ne(){return I}function le($){I=$,$?ve(r.SCISSOR_TEST):ue(r.SCISSOR_TEST)}function me($){$===void 0&&($=r.TEXTURE0+R-1),U!==$&&(r.activeTexture($),U=$)}function fe($,nt){U===null&&me();var Xe=B[U];Xe===void 0&&(Xe={type:void 0,texture:void 0},B[U]=Xe),(Xe.type!==$||Xe.texture!==nt)&&(r.bindTexture($,nt||Y[$]),Xe.type=$,Xe.texture=nt)}function et(){try{r.compressedTexImage2D.apply(r,arguments)}catch($){console.error($)}}function Ke(){try{r.texImage2D.apply(r,arguments)}catch($){console.error($)}}function Se($){z.equals($)===!1&&(r.scissor($.x,$.y,$.z,$.w),z.copy($))}function Ae($){k.equals($)===!1&&(r.viewport($.x,$.y,$.z,$.w),k.copy($))}function at(){for(var $=0;$<h.length;$++)h[$]===1&&(r.disableVertexAttribArray($),h[$]=0);p={},d=null,U=null,B={},g=null,w=null,T=null,o.reset(),s.reset(),l.reset()}return{buffers:{color:o,depth:s,stencil:l},init:J,initAttributes:Q,enableAttribute:V,enableAttributeAndDivisor:K,disableUnusedAttributes:ae,enable:ve,disable:ue,getCompressedTextureFormats:se,setBlending:Ee,setColorWrite:q,setDepthTest:H,setDepthWrite:We,setDepthFunc:_e,setStencilTest:xe,setStencilWrite:Le,setStencilFunc:Ue,setStencilOp:Ne,setFlipSided:Ve,setCullFace:dt,setLineWidth:F,setPolygonOffset:L,getScissorTest:ne,setScissorTest:le,activeTexture:me,bindTexture:fe,compressedTexImage2D:et,texImage2D:Ke,scissor:Se,viewport:Ae,reset:at}}function UOe(r,e,t){var i;function n(){if(i!==void 0)return i;var x=e.get("EXT_texture_filter_anisotropic");return x!==null?i=r.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):i=0,i}function a(x){if(x==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=t.precision!==void 0?t.precision:"highp",s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=t.logarithmicDepthBuffer===!0&&!!e.get("EXT_frag_depth"),u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),c=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=r.getParameter(r.MAX_TEXTURE_SIZE),f=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),d=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),g=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),v=c>0,_=!!e.get("OES_texture_float"),y=v&&_;return{getMaxAnisotropy:n,getMaxPrecision:a,precision:o,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:h,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:d,maxVaryings:g,maxFragmentUniforms:m,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:y}}function OOe(r){var e={};return{get:function(t){if(e[t]!==void 0)return e[t];var i;switch(t){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=r.getExtension("WEBGL_compressed_texture_etc1");break;default:i=r.getExtension(t)}return i===null&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e[t]=i,i}}}function zOe(){var r=this,e=null,t=0,i=!1,n=!1,a=new xs,o=new dl,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(c,h,f){var p=c.length!==0||h||t!==0||i;return i=h,e=u(c,f,0),t=c.length,p},this.beginShadows=function(){n=!0,u(null)},this.endShadows=function(){n=!1,l()},this.setState=function(c,h,f,p,d,g){if(!i||c===null||c.length===0||n&&!f)n?u(null):l();else{var m=n?0:t,v=m*4,_=d.clippingState||null;s.value=_,_=u(c,p,v,g);for(var y=0;y!==v;++y)_[y]=e[y];d.clippingState=_,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=m}};function l(){s.value!==e&&(s.value=e,s.needsUpdate=t>0),r.numPlanes=t,r.numIntersection=0}function u(c,h,f,p){var d=c!==null?c.length:0,g=null;if(d!==0){if(g=s.value,p!==!0||g===null){var m=f+d*4,v=h.matrixWorldInverse;o.getNormalMatrix(v),(g===null||g.length<m)&&(g=new Float32Array(m));for(var _=0,y=f;_!==d;++_,y+=4)a.copy(c[_]).applyMatrix4(v,o),a.normal.toArray(g,y),g[y+3]=a.constant}s.value=g,s.needsUpdate=!0}return r.numPlanes=d,g}}function eV(r){console.log("THREE.WebGLRenderer",woe),r=r||{};var e=r.canvas!==void 0?r.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t=r.context!==void 0?r.context:null,i=r.alpha!==void 0?r.alpha:!1,n=r.depth!==void 0?r.depth:!0,a=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,s=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,u=[],c=[],h=-1,f=[],p=-1,d=new Float32Array(8),g=[],m=[];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=Yk,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var v=this,_=null,y=null,x=null,M=-1,S="",w=null,T=new ii,C=null,b=new ii,E=0,I=new Wt(0),R=0,A=e.width,P=e.height,U=1,B=new ii(0,0,A,P),z=!1,k=new ii(0,0,A,P),G=new kM,Y=new zOe,J=!1,Q=!1,V=new ha,K=new Kt,ae=new oe,ve=new Kt,ue=new Kt,se={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},Ee={calls:0,vertices:0,faces:0,points:0};this.info={render:Ee,memory:{geometries:0,textures:0},programs:null};var q;try{var H={alpha:i,depth:n,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l};if(q=t||e.getContext("webgl",H)||e.getContext("experimental-webgl",H),q===null)throw e.getContext("webgl")!==null?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";q.getShaderPrecisionFormat===void 0&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),e.addEventListener("webglcontextlost",Xe,!1)}catch(D){console.error("THREE.WebGLRenderer: "+D)}var We=new OOe(q);We.get("WEBGL_depth_texture"),We.get("OES_texture_float"),We.get("OES_texture_float_linear"),We.get("OES_texture_half_float"),We.get("OES_texture_half_float_linear"),We.get("OES_standard_derivatives"),We.get("ANGLE_instanced_arrays"),We.get("OES_element_index_uint")&&(Vt.MaxIndex=4294967296);var _e=new UOe(q,We,r),xe=new NOe(q,We,ie),Le=new IOe,Ue=new POe(q,We,xe,Le,_e,ie,this.info),Ne=new DOe(q,Le,this.info),Ve=new ROe(this,_e),dt=new xOe;this.info.programs=Ve.programs;var F=new _Oe(q,We,Ee),L=new yOe(q,We,Ee),ne=new w0(-1,1,1,-1,0,1),le=new ua,me=new _n(new um(2,2),new jo({depthTest:!1,depthWrite:!1,fog:!1})),fe=b0.cube,et=new _n(new lm(5,5,5),new Na({uniforms:fe.uniforms,vertexShader:fe.vertexShader,fragmentShader:fe.fragmentShader,side:jf,depthTest:!1,depthWrite:!1,fog:!1}));function Ke(){return y===null?U:1}function Se(){xe.init(),xe.scissor(T.copy(B).multiplyScalar(U)),xe.viewport(b.copy(k).multiplyScalar(U)),xe.buffers.color.setClear(I.r,I.g,I.b,R,s)}function Ae(){_=null,w=null,S="",M=-1,xe.reset()}Se(),this.context=q,this.capabilities=_e,this.extensions=We,this.properties=Le,this.state=xe;var at=new Rse(this,se,Ne,_e);this.shadowMap=at;var $=new dOe(this,g),nt=new pOe(this,m);this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){We.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){return _e.getMaxAnisotropy()},this.getPrecision=function(){return _e.precision},this.getPixelRatio=function(){return U},this.setPixelRatio=function(D){D!==void 0&&(U=D,this.setSize(k.z,k.w,!1))},this.getSize=function(){return{width:A,height:P}},this.setSize=function(D,W,ee){A=D,P=W,e.width=D*U,e.height=W*U,ee!==!1&&(e.style.width=D+"px",e.style.height=W+"px"),this.setViewport(0,0,D,W)},this.setViewport=function(D,W,ee,ge){xe.viewport(k.set(D,W,ee,ge))},this.setScissor=function(D,W,ee,ge){xe.scissor(B.set(D,W,ee,ge))},this.setScissorTest=function(D){xe.setScissorTest(z=D)},this.getClearColor=function(){return I},this.setClearColor=function(D,W){I.set(D),R=W!==void 0?W:1,xe.buffers.color.setClear(I.r,I.g,I.b,R,s)},this.getClearAlpha=function(){return R},this.setClearAlpha=function(D){R=D,xe.buffers.color.setClear(I.r,I.g,I.b,R,s)},this.clear=function(D,W,ee){var ge=0;(D===void 0||D)&&(ge|=q.COLOR_BUFFER_BIT),(W===void 0||W)&&(ge|=q.DEPTH_BUFFER_BIT),(ee===void 0||ee)&&(ge|=q.STENCIL_BUFFER_BIT),q.clear(ge)},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(D,W,ee,ge){this.setRenderTarget(D),this.clear(W,ee,ge)},this.resetGLState=Ae,this.dispose=function(){f=[],p=-1,c=[],h=-1,e.removeEventListener("webglcontextlost",Xe,!1)};function Xe(D){D.preventDefault(),Ae(),Se(),Le.clear()}function Fe(D){var W=D.target;W.removeEventListener("dispose",Fe),we(W)}function we(D){Ie(D),Le.delete(D)}function Ie(D){var W=Le.get(D).program;D.program=void 0,W!==void 0&&Ve.releaseProgram(W)}this.renderBufferImmediate=function(D,W,ee){xe.initAttributes();var ge=Le.get(D);D.hasPositions&&!ge.position&&(ge.position=q.createBuffer()),D.hasNormals&&!ge.normal&&(ge.normal=q.createBuffer()),D.hasUvs&&!ge.uv&&(ge.uv=q.createBuffer()),D.hasColors&&!ge.color&&(ge.color=q.createBuffer());var ce=W.getAttributes();if(D.hasPositions&&(q.bindBuffer(q.ARRAY_BUFFER,ge.position),q.bufferData(q.ARRAY_BUFFER,D.positionArray,q.DYNAMIC_DRAW),xe.enableAttribute(ce.position),q.vertexAttribPointer(ce.position,3,q.FLOAT,!1,0,0)),D.hasNormals){if(q.bindBuffer(q.ARRAY_BUFFER,ge.normal),!ee.isMeshPhongMaterial&&!ee.isMeshStandardMaterial&&!ee.isMeshNormalMaterial&&ee.shading===Ok)for(var Oe=0,Ge=D.count*3;Oe<Ge;Oe+=9){var Re=D.normalArray,gt=(Re[Oe+0]+Re[Oe+3]+Re[Oe+6])/3,_t=(Re[Oe+1]+Re[Oe+4]+Re[Oe+7])/3,$e=(Re[Oe+2]+Re[Oe+5]+Re[Oe+8])/3;Re[Oe+0]=gt,Re[Oe+1]=_t,Re[Oe+2]=$e,Re[Oe+3]=gt,Re[Oe+4]=_t,Re[Oe+5]=$e,Re[Oe+6]=gt,Re[Oe+7]=_t,Re[Oe+8]=$e}q.bufferData(q.ARRAY_BUFFER,D.normalArray,q.DYNAMIC_DRAW),xe.enableAttribute(ce.normal),q.vertexAttribPointer(ce.normal,3,q.FLOAT,!1,0,0)}D.hasUvs&&ee.map&&(q.bindBuffer(q.ARRAY_BUFFER,ge.uv),q.bufferData(q.ARRAY_BUFFER,D.uvArray,q.DYNAMIC_DRAW),xe.enableAttribute(ce.uv),q.vertexAttribPointer(ce.uv,2,q.FLOAT,!1,0,0)),D.hasColors&&ee.vertexColors!==bL&&(q.bindBuffer(q.ARRAY_BUFFER,ge.color),q.bufferData(q.ARRAY_BUFFER,D.colorArray,q.DYNAMIC_DRAW),xe.enableAttribute(ce.color),q.vertexAttribPointer(ce.color,3,q.FLOAT,!1,0,0)),xe.disableUnusedAttributes(),q.drawArrays(q.TRIANGLES,0,D.count),D.count=0},this.renderBufferDirect=function(D,W,ee,ge,ce,Oe){$r(ge);var Ge=Ht(D,W,ge,ce),Re=!1,gt=ee.id+"_"+Ge.id+"_"+ge.wireframe;gt!==S&&(S=gt,Re=!0);var _t=ce.morphTargetInfluences;if(_t!==void 0){for(var $e=[],lt=0,Ct=_t.length;lt<Ct;lt++){var je=_t[lt];$e.push([je,lt])}$e.sort(Je),$e.length>8&&($e.length=8);for(var _i=ee.morphAttributes,lt=0,Ct=$e.length;lt<Ct;lt++){var je=$e[lt];if(d[lt]=je[0],je[0]!==0){var Nr=je[1];ge.morphTargets===!0&&_i.position&&ee.addAttribute("morphTarget"+lt,_i.position[Nr]),ge.morphNormals===!0&&_i.normal&&ee.addAttribute("morphNormal"+lt,_i.normal[Nr])}else ge.morphTargets===!0&&ee.removeAttribute("morphTarget"+lt),ge.morphNormals===!0&&ee.removeAttribute("morphNormal"+lt)}for(var lt=$e.length,Ft=d.length;lt<Ft;lt++)d[lt]=0;Ge.getUniforms().setValue(q,"morphTargetInfluences",d),Re=!0}var Nr=ee.index,Yi=ee.attributes.position,Et=1;ge.wireframe===!0&&(Nr=Ne.getWireframeAttribute(ee),Et=2);var Ei;Nr!==null?(Ei=L,Ei.setIndex(Nr)):Ei=F,Re&&(ct(ge,Ge,ee),Nr!==null&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,Ne.getAttributeBuffer(Nr)));var cr=0;Nr!==null?cr=Nr.count:Yi!==void 0&&(cr=Yi.count);var hn=ee.drawRange.start*Et,Ju=ee.drawRange.count*Et,Qr=Oe!==null?Oe.start*Et:0,$u=Oe!==null?Oe.count*Et:1/0,np=Math.max(hn,Qr),ap=Math.min(cr,hn+Ju,Qr+$u)-1,IL=Math.max(0,ap-np+1);if(IL!==0){if(ce.isMesh)if(ge.wireframe===!0)xe.setLineWidth(ge.wireframeLinewidth*Ke()),Ei.setMode(q.LINES);else switch(ce.drawMode){case Jk:Ei.setMode(q.TRIANGLES);break;case fse:Ei.setMode(q.TRIANGLE_STRIP);break;case pse:Ei.setMode(q.TRIANGLE_FAN);break}else if(ce.isLine){var NL=ge.linewidth;NL===void 0&&(NL=1),xe.setLineWidth(NL*Ke()),ce.isLineSegments?Ei.setMode(q.LINES):Ei.setMode(q.LINE_STRIP)}else ce.isPoints&&Ei.setMode(q.POINTS);ee&&ee.isInstancedBufferGeometry?ee.maxInstancedCount>0&&Ei.renderInstances(ee,np,IL):Ei.render(np,IL)}};function ct(D,W,ee,ge){var ce;if(ee&&ee.isInstancedBufferGeometry&&(ce=We.get("ANGLE_instanced_arrays"),ce===null)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}ge===void 0&&(ge=0),xe.initAttributes();var Oe=ee.attributes,Ge=W.getAttributes(),Re=D.defaultAttributeValues;for(var gt in Ge){var _t=Ge[gt];if(_t>=0){var $e=Oe[gt];if($e!==void 0){var lt=$e.normalized,Ct=$e.itemSize,je=Ne.getAttributeProperties($e),_i=je.__webglBuffer,Ft=je.type,Nr=je.bytesPerElement;if($e.isInterleavedBufferAttribute){var Yi=$e.data,Et=Yi.stride,Ei=$e.offset;Yi&&Yi.isInstancedInterleavedBuffer?(xe.enableAttributeAndDivisor(_t,Yi.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=Yi.meshPerAttribute*Yi.count)):xe.enableAttribute(_t),q.bindBuffer(q.ARRAY_BUFFER,_i),q.vertexAttribPointer(_t,Ct,Ft,lt,Et*Nr,(ge*Et+Ei)*Nr)}else $e.isInstancedBufferAttribute?(xe.enableAttributeAndDivisor(_t,$e.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=$e.meshPerAttribute*$e.count)):xe.enableAttribute(_t),q.bindBuffer(q.ARRAY_BUFFER,_i),q.vertexAttribPointer(_t,Ct,Ft,lt,0,ge*Ct*Nr)}else if(Re!==void 0){var cr=Re[gt];if(cr!==void 0)switch(cr.length){case 2:q.vertexAttrib2fv(_t,cr);break;case 3:q.vertexAttrib3fv(_t,cr);break;case 4:q.vertexAttrib4fv(_t,cr);break;default:q.vertexAttrib1fv(_t,cr)}}}}xe.disableUnusedAttributes()}function Je(D,W){return Math.abs(W[0])-Math.abs(D[0])}function Gt(D,W){return D.object.renderOrder!==W.object.renderOrder?D.object.renderOrder-W.object.renderOrder:D.material.program&&W.material.program&&D.material.program!==W.material.program?D.material.program.id-W.material.program.id:D.material.id!==W.material.id?D.material.id-W.material.id:D.z!==W.z?D.z-W.z:D.id-W.id}function X(D,W){return D.object.renderOrder!==W.object.renderOrder?D.object.renderOrder-W.object.renderOrder:D.z!==W.z?W.z-D.z:D.id-W.id}this.render=function(D,W,ee,ge){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}S="",M=-1,w=null,D.autoUpdate===!0&&D.updateMatrixWorld(),W.parent===null&&W.updateMatrixWorld(),W.matrixWorldInverse.getInverse(W.matrixWorld),K.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),G.setFromMatrix(K),u.length=0,h=-1,p=-1,g.length=0,m.length=0,Q=this.localClippingEnabled,J=Y.init(this.clippingPlanes,Q,W),wt(D,W),c.length=h+1,f.length=p+1,v.sortObjects===!0&&(c.sort(Gt),f.sort(X)),J&&Y.beginShadows(),O(u),at.render(D,W),j(u,W),J&&Y.endShadows(),Ee.calls=0,Ee.vertices=0,Ee.faces=0,Ee.points=0,ee===void 0&&(ee=null),this.setRenderTarget(ee);var ce=D.background;if(ce===null?xe.buffers.color.setClear(I.r,I.g,I.b,R,s):ce&&ce.isColor&&(xe.buffers.color.setClear(ce.r,ce.g,ce.b,1,s),ge=!0),(this.autoClear||ge)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),ce&&ce.isCubeTexture?(le.projectionMatrix.copy(W.projectionMatrix),le.matrixWorld.extractRotation(W.matrixWorld),le.matrixWorldInverse.getInverse(le.matrixWorld),et.material.uniforms.tCube.value=ce,et.modelViewMatrix.multiplyMatrices(le.matrixWorldInverse,et.matrixWorld),Ne.update(et),v.renderBufferDirect(le,null,et.geometry,et.material,et,null)):ce&&ce.isTexture&&(me.material.map=ce,Ne.update(me),v.renderBufferDirect(ne,null,me.geometry,me.material,me,null)),D.overrideMaterial){var Oe=D.overrideMaterial;kt(c,D,W,Oe),kt(f,D,W,Oe)}else xe.setBlending(IM),kt(c,D,W),kt(f,D,W);$.render(D,W),nt.render(D,W,b),ee&&Ue.updateRenderTargetMipmap(ee),xe.setDepthTest(!0),xe.setDepthWrite(!0),xe.setColorWrite(!0)};function Te(D,W,ee,ge,ce){var Oe,Ge;ee.transparent?(Oe=f,Ge=++p):(Oe=c,Ge=++h);var Re=Oe[Ge];Re!==void 0?(Re.id=D.id,Re.object=D,Re.geometry=W,Re.material=ee,Re.z=ae.z,Re.group=ce):(Re={id:D.id,object:D,geometry:W,material:ee,z:ae.z,group:ce},Oe.push(Re))}function te(D){var W=D.geometry;return W.boundingSphere===null&&W.computeBoundingSphere(),V.copy(W.boundingSphere).applyMatrix4(D.matrixWorld),De(V)}function Me(D){return V.center.set(0,0,0),V.radius=.7071067811865476,V.applyMatrix4(D.matrixWorld),De(V)}function De(D){if(!G.intersectsSphere(D))return!1;var W=Y.numPlanes;if(W===0)return!0;var ee=v.clippingPlanes,ge=D.center,ce=-D.radius,Oe=0;do if(ee[Oe].distanceToPoint(ge)<ce)return!1;while(++Oe!==W);return!0}function wt(D,W){if(D.visible!==!1){var ee=(D.layers.mask&W.layers.mask)!==0;if(ee){if(D.isLight)u.push(D);else if(D.isSprite)(D.frustumCulled===!1||Me(D)===!0)&&g.push(D);else if(D.isLensFlare)m.push(D);else if(D.isImmediateRenderObject)v.sortObjects===!0&&(ae.setFromMatrixPosition(D.matrixWorld),ae.applyProjection(K)),Te(D,null,D.material,ae.z,null);else if((D.isMesh||D.isLine||D.isPoints)&&(D.isSkinnedMesh&&D.skeleton.update(),D.frustumCulled===!1||te(D)===!0)){var ge=D.material;if(ge.visible===!0){v.sortObjects===!0&&(ae.setFromMatrixPosition(D.matrixWorld),ae.applyProjection(K));var ce=Ne.update(D);if(ge.isMultiMaterial)for(var Oe=ce.groups,Ge=ge.materials,Re=0,gt=Oe.length;Re<gt;Re++){var _t=Oe[Re],$e=Ge[_t.materialIndex];$e.visible===!0&&Te(D,ce,$e,ae.z,_t)}else Te(D,ce,ge,ae.z,null)}}}for(var lt=D.children,Re=0,gt=lt.length;Re<gt;Re++)wt(lt[Re],W)}}function kt(D,W,ee,ge){for(var ce=0,Oe=D.length;ce<Oe;ce++){var Ge=D[ce],Re=Ge.object,gt=Ge.geometry,_t=ge===void 0?Ge.material:ge,$e=Ge.group;if(Re.modelViewMatrix.multiplyMatrices(ee.matrixWorldInverse,Re.matrixWorld),Re.normalMatrix.getNormalMatrix(Re.modelViewMatrix),Re.onBeforeRender(v,W,ee,gt,_t,$e),Re.isImmediateRenderObject){$r(_t);var lt=Ht(ee,W.fog,_t,Re);S="",Re.render(function(Ct){v.renderBufferImmediate(Ct,lt,_t)})}else v.renderBufferDirect(ee,W.fog,gt,_t,Re,$e);Re.onAfterRender(v,W,ee,gt,_t,$e)}}function Tr(D,W,ee){var ge=Le.get(D),ce=Ve.getParameters(D,se,W,Y.numPlanes,Y.numIntersection,ee),Oe=Ve.getProgramCode(D,ce),Ge=ge.program,Re=!0;if(Ge===void 0)D.addEventListener("dispose",Fe);else if(Ge.code!==Oe)Ie(D);else{if(ce.shaderID!==void 0)return;Re=!1}if(Re){if(ce.shaderID){var gt=b0[ce.shaderID];ge.__webglShader={name:D.type,uniforms:Yo.clone(gt.uniforms),vertexShader:gt.vertexShader,fragmentShader:gt.fragmentShader}}else ge.__webglShader={name:D.type,uniforms:D.uniforms,vertexShader:D.vertexShader,fragmentShader:D.fragmentShader};D.__webglShader=ge.__webglShader,Ge=Ve.acquireProgram(D,ce,Oe),ge.program=Ge,D.program=Ge}var _t=Ge.getAttributes();if(D.morphTargets){D.numSupportedMorphTargets=0;for(var $e=0;$e<v.maxMorphTargets;$e++)_t["morphTarget"+$e]>=0&&D.numSupportedMorphTargets++}if(D.morphNormals){D.numSupportedMorphNormals=0;for(var $e=0;$e<v.maxMorphNormals;$e++)_t["morphNormal"+$e]>=0&&D.numSupportedMorphNormals++}var lt=ge.__webglShader.uniforms;(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(ge.numClippingPlanes=Y.numPlanes,ge.numIntersection=Y.numIntersection,lt.clippingPlanes=Y.uniform),ge.fog=W,ge.lightsHash=se.hash,D.lights&&(lt.ambientLightColor.value=se.ambient,lt.directionalLights.value=se.directional,lt.spotLights.value=se.spot,lt.rectAreaLights.value=se.rectArea,lt.pointLights.value=se.point,lt.hemisphereLights.value=se.hemi,lt.directionalShadowMap.value=se.directionalShadowMap,lt.directionalShadowMatrix.value=se.directionalShadowMatrix,lt.spotShadowMap.value=se.spotShadowMap,lt.spotShadowMatrix.value=se.spotShadowMatrix,lt.pointShadowMap.value=se.pointShadowMap,lt.pointShadowMatrix.value=se.pointShadowMatrix);var Ct=ge.program.getUniforms(),je=Jf.seqWithValue(Ct.seq,lt);ge.uniformsList=je}function $r(D){D.side===n_?xe.disable(q.CULL_FACE):xe.enable(q.CULL_FACE),xe.setFlipSided(D.side===jf),D.transparent===!0?xe.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst,D.blendEquationAlpha,D.blendSrcAlpha,D.blendDstAlpha,D.premultipliedAlpha):xe.setBlending(IM),xe.setDepthFunc(D.depthFunc),xe.setDepthTest(D.depthTest),xe.setDepthWrite(D.depthWrite),xe.setColorWrite(D.colorWrite),xe.setPolygonOffset(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits)}function Ht(D,W,ee,ge){E=0;var ce=Le.get(ee);if(J&&(Q||D!==w)){var Oe=D===w&&ee.id===M;Y.setState(ee.clippingPlanes,ee.clipIntersection,ee.clipShadows,D,ce,Oe)}ee.needsUpdate===!1&&(ce.program===void 0||ee.fog&&ce.fog!==W||ee.lights&&ce.lightsHash!==se.hash||ce.numClippingPlanes!==void 0&&(ce.numClippingPlanes!==Y.numPlanes||ce.numIntersection!==Y.numIntersection))&&(ee.needsUpdate=!0),ee.needsUpdate&&(Tr(ee,W,ge),ee.needsUpdate=!1);var Ge=!1,Re=!1,gt=!1,_t=ce.program,$e=_t.getUniforms(),lt=ce.__webglShader.uniforms;if(_t.id!==_&&(q.useProgram(_t.program),_=_t.id,Ge=!0,Re=!0,gt=!0),ee.id!==M&&(M=ee.id,Re=!0),Ge||D!==w){if($e.set(q,D,"projectionMatrix"),_e.logarithmicDepthBuffer&&$e.setValue(q,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),D!==w&&(w=D,Re=!0,gt=!0),ee.isShaderMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.envMap){var Ct=$e.map.cameraPosition;Ct!==void 0&&Ct.setValue(q,ae.setFromMatrixPosition(D.matrixWorld))}(ee.isMeshPhongMaterial||ee.isMeshLambertMaterial||ee.isMeshBasicMaterial||ee.isMeshStandardMaterial||ee.isShaderMaterial||ee.skinning)&&$e.setValue(q,"viewMatrix",D.matrixWorldInverse),$e.set(q,v,"toneMappingExposure"),$e.set(q,v,"toneMappingWhitePoint")}if(ee.skinning){$e.setOptional(q,ge,"bindMatrix"),$e.setOptional(q,ge,"bindMatrixInverse");var je=ge.skeleton;je&&(_e.floatVertexTextures&&je.useVertexTexture?($e.set(q,je,"boneTexture"),$e.set(q,je,"boneTextureWidth"),$e.set(q,je,"boneTextureHeight")):$e.setOptional(q,je,"boneMatrices"))}return Re&&(ee.lights&&h_(lt,gt),W&&ee.fog&&gl(lt,W),(ee.isMeshBasicMaterial||ee.isMeshLambertMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.isMeshNormalMaterial||ee.isMeshDepthMaterial)&&Or(lt,ee),ee.isLineBasicMaterial?hi(lt,ee):ee.isLineDashedMaterial?(hi(lt,ee),tp(lt,ee)):ee.isPointsMaterial?l_(lt,ee):ee.isMeshLambertMaterial?rp(lt,ee):ee.isMeshToonMaterial?ip(lt,ee):ee.isMeshPhongMaterial?Es(lt,ee):ee.isMeshPhysicalMaterial?u_(lt,ee):ee.isMeshStandardMaterial?oh(lt,ee):ee.isMeshDepthMaterial?ee.displacementMap&&(lt.displacementMap.value=ee.displacementMap,lt.displacementScale.value=ee.displacementScale,lt.displacementBias.value=ee.displacementBias):ee.isMeshNormalMaterial&&c_(lt,ee),lt.ltcMat!==void 0&&(lt.ltcMat.value=THREE.UniformsLib.LTC_MAT_TEXTURE),lt.ltcMag!==void 0&&(lt.ltcMag.value=THREE.UniformsLib.LTC_MAG_TEXTURE),Jf.upload(q,ce.uniformsList,lt,v)),$e.set(q,ge,"modelViewMatrix"),$e.set(q,ge,"normalMatrix"),$e.setValue(q,"modelMatrix",ge.matrixWorld),_t}function Or(D,W){D.opacity.value=W.opacity,D.diffuse.value=W.color,W.emissive&&D.emissive.value.copy(W.emissive).multiplyScalar(W.emissiveIntensity),D.map.value=W.map,D.specularMap.value=W.specularMap,D.alphaMap.value=W.alphaMap,W.lightMap&&(D.lightMap.value=W.lightMap,D.lightMapIntensity.value=W.lightMapIntensity),W.aoMap&&(D.aoMap.value=W.aoMap,D.aoMapIntensity.value=W.aoMapIntensity);var ee;if(W.map?ee=W.map:W.specularMap?ee=W.specularMap:W.displacementMap?ee=W.displacementMap:W.normalMap?ee=W.normalMap:W.bumpMap?ee=W.bumpMap:W.roughnessMap?ee=W.roughnessMap:W.metalnessMap?ee=W.metalnessMap:W.alphaMap?ee=W.alphaMap:W.emissiveMap&&(ee=W.emissiveMap),ee!==void 0){ee.isWebGLRenderTarget&&(ee=ee.texture);var ge=ee.offset,ce=ee.repeat;D.offsetRepeat.value.set(ge.x,ge.y,ce.x,ce.y)}D.envMap.value=W.envMap,D.flipEnvMap.value=W.envMap&&W.envMap.isCubeTexture?-1:1,D.reflectivity.value=W.reflectivity,D.refractionRatio.value=W.refractionRatio}function hi(D,W){D.diffuse.value=W.color,D.opacity.value=W.opacity}function tp(D,W){D.dashSize.value=W.dashSize,D.totalSize.value=W.dashSize+W.gapSize,D.scale.value=W.scale}function l_(D,W){if(D.diffuse.value=W.color,D.opacity.value=W.opacity,D.size.value=W.size*U,D.scale.value=P*.5,D.map.value=W.map,W.map!==null){var ee=W.map.offset,ge=W.map.repeat;D.offsetRepeat.value.set(ee.x,ee.y,ge.x,ge.y)}}function gl(D,W){D.fogColor.value=W.color,W.isFog?(D.fogNear.value=W.near,D.fogFar.value=W.far):W.isFogExp2&&(D.fogDensity.value=W.density)}function rp(D,W){W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap)}function Es(D,W){D.specular.value=W.specular,D.shininess.value=Math.max(W.shininess,1e-4),W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap),W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias)}function ip(D,W){Es(D,W),W.gradientMap&&(D.gradientMap.value=W.gradientMap)}function oh(D,W){D.roughness.value=W.roughness,D.metalness.value=W.metalness,W.roughnessMap&&(D.roughnessMap.value=W.roughnessMap),W.metalnessMap&&(D.metalnessMap.value=W.metalnessMap),W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap),W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias),W.envMap&&(D.envMapIntensity.value=W.envMapIntensity)}function u_(D,W){D.clearCoat.value=W.clearCoat,D.clearCoatRoughness.value=W.clearCoatRoughness,oh(D,W)}function c_(D,W){W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias)}function h_(D,W){D.ambientLightColor.needsUpdate=W,D.directionalLights.needsUpdate=W,D.pointLights.needsUpdate=W,D.spotLights.needsUpdate=W,D.rectAreaLights.needsUpdate=W,D.hemisphereLights.needsUpdate=W}function O(D){for(var W=0,ee=0,ge=D.length;ee<ge;ee++){var ce=D[ee];ce.castShadow&&(se.shadows[W++]=ce)}se.shadows.length=W}function j(D,W){var ee,ge,ce,Oe=0,Ge=0,Re=0,gt,_t,$e,lt,Ct=W.matrixWorldInverse,je=0,_i=0,Ft=0,Nr=0,Yi=0;for(ee=0,ge=D.length;ee<ge;ee++)if(ce=D[ee],gt=ce.color,_t=ce.intensity,$e=ce.distance,lt=ce.shadow&&ce.shadow.map?ce.shadow.map.texture:null,ce.isAmbientLight)Oe+=gt.r*_t,Ge+=gt.g*_t,Re+=gt.b*_t;else if(ce.isDirectionalLight){var Et=dt.get(ce);Et.color.copy(ce.color).multiplyScalar(ce.intensity),Et.direction.setFromMatrixPosition(ce.matrixWorld),ae.setFromMatrixPosition(ce.target.matrixWorld),Et.direction.sub(ae),Et.direction.transformDirection(Ct),Et.shadow=ce.castShadow,ce.castShadow&&(Et.shadowBias=ce.shadow.bias,Et.shadowRadius=ce.shadow.radius,Et.shadowMapSize=ce.shadow.mapSize),se.directionalShadowMap[je]=lt,se.directionalShadowMatrix[je]=ce.shadow.matrix,se.directional[je++]=Et}else if(ce.isSpotLight){var Et=dt.get(ce);Et.position.setFromMatrixPosition(ce.matrixWorld),Et.position.applyMatrix4(Ct),Et.color.copy(gt).multiplyScalar(_t),Et.distance=$e,Et.direction.setFromMatrixPosition(ce.matrixWorld),ae.setFromMatrixPosition(ce.target.matrixWorld),Et.direction.sub(ae),Et.direction.transformDirection(Ct),Et.coneCos=Math.cos(ce.angle),Et.penumbraCos=Math.cos(ce.angle*(1-ce.penumbra)),Et.decay=ce.distance===0?0:ce.decay,Et.shadow=ce.castShadow,ce.castShadow&&(Et.shadowBias=ce.shadow.bias,Et.shadowRadius=ce.shadow.radius,Et.shadowMapSize=ce.shadow.mapSize),se.spotShadowMap[Ft]=lt,se.spotShadowMatrix[Ft]=ce.shadow.matrix,se.spot[Ft++]=Et}else if(ce.isRectAreaLight){var Et=dt.get(ce);Et.color.copy(gt).multiplyScalar(_t/(ce.width*ce.height)),Et.position.setFromMatrixPosition(ce.matrixWorld),Et.position.applyMatrix4(Ct),ue.identity(),ve.copy(ce.matrixWorld),ve.premultiply(Ct),ue.extractRotation(ve),Et.halfWidth.set(ce.width*.5,0,0),Et.halfHeight.set(0,ce.height*.5,0),Et.halfWidth.applyMatrix4(ue),Et.halfHeight.applyMatrix4(ue),se.rectArea[Nr++]=Et}else if(ce.isPointLight){var Et=dt.get(ce);Et.position.setFromMatrixPosition(ce.matrixWorld),Et.position.applyMatrix4(Ct),Et.color.copy(ce.color).multiplyScalar(ce.intensity),Et.distance=ce.distance,Et.decay=ce.distance===0?0:ce.decay,Et.shadow=ce.castShadow,ce.castShadow&&(Et.shadowBias=ce.shadow.bias,Et.shadowRadius=ce.shadow.radius,Et.shadowMapSize=ce.shadow.mapSize),se.pointShadowMap[_i]=lt,se.pointShadowMatrix[_i]===void 0&&(se.pointShadowMatrix[_i]=new Kt),ae.setFromMatrixPosition(ce.matrixWorld).negate(),se.pointShadowMatrix[_i].identity().setPosition(ae),se.point[_i++]=Et}else if(ce.isHemisphereLight){var Et=dt.get(ce);Et.direction.setFromMatrixPosition(ce.matrixWorld),Et.direction.transformDirection(Ct),Et.direction.normalize(),Et.skyColor.copy(ce.color).multiplyScalar(_t),Et.groundColor.copy(ce.groundColor).multiplyScalar(_t),se.hemi[Yi++]=Et}se.ambient[0]=Oe,se.ambient[1]=Ge,se.ambient[2]=Re,se.directional.length=je,se.spot.length=Ft,se.rectArea.length=Nr,se.point.length=_i,se.hemi.length=Yi,se.hash=je+","+_i+","+Ft+","+Nr+","+Yi+","+se.shadows.length}this.setFaceCulling=function(D,W){xe.setCullFace(D),xe.setFlipSided(W===Eoe)};function re(){var D=E;return D>=_e.maxTextures&&console.warn("WebGLRenderer: trying to use "+D+" texture units while this GPU supports only "+_e.maxTextures),E+=1,D}this.allocTextureUnit=re,this.setTexture2D=function(){var D=!1;return function(ee,ge){ee&&ee.isWebGLRenderTarget&&(D||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),D=!0),ee=ee.texture),Ue.setTexture2D(ee,ge)}}(),this.setTexture=function(){var D=!1;return function(ee,ge){D||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),D=!0),Ue.setTexture2D(ee,ge)}}(),this.setTextureCube=function(){var D=!1;return function(ee,ge){ee&&ee.isWebGLRenderTargetCube&&(D||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),D=!0),ee=ee.texture),ee&&ee.isCubeTexture||Array.isArray(ee.image)&&ee.image.length===6?Ue.setTextureCube(ee,ge):Ue.setTextureCubeDynamic(ee,ge)}}(),this.getCurrentRenderTarget=function(){return y},this.setRenderTarget=function(D){y=D,D&&Le.get(D).__webglFramebuffer===void 0&&Ue.setupRenderTarget(D);var W=D&&D.isWebGLRenderTargetCube,ee;if(D){var ge=Le.get(D);W?ee=ge.__webglFramebuffer[D.activeCubeFace]:ee=ge.__webglFramebuffer,T.copy(D.scissor),C=D.scissorTest,b.copy(D.viewport)}else ee=null,T.copy(B).multiplyScalar(U),C=z,b.copy(k).multiplyScalar(U);if(x!==ee&&(q.bindFramebuffer(q.FRAMEBUFFER,ee),x=ee),xe.scissor(T),xe.setScissorTest(C),xe.viewport(b),W){var ce=Le.get(D.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+D.activeCubeFace,ce.__webglTexture,D.activeMipMapLevel)}},this.readRenderTargetPixels=function(D,W,ee,ge,ce,Oe){if((D&&D.isWebGLRenderTarget)===!1){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}var Ge=Le.get(D).__webglFramebuffer;if(Ge){var Re=!1;Ge!==x&&(q.bindFramebuffer(q.FRAMEBUFFER,Ge),Re=!0);try{var gt=D.texture,_t=gt.format,$e=gt.type;if(_t!==qu&&ie(_t)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if($e!==KR&&ie($e)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_TYPE)&&!($e===_0&&(We.get("OES_texture_float")||We.get("WEBGL_color_buffer_float")))&&!($e===JR&&We.get("EXT_color_buffer_half_float"))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?W>=0&&W<=D.width-ge&&ee>=0&&ee<=D.height-ce&&q.readPixels(W,ee,ge,ce,ie(_t),ie($e),Oe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{Re&&q.bindFramebuffer(q.FRAMEBUFFER,x)}}};function ie(D){var W;if(D===Qc)return q.REPEAT;if(D===Ms)return q.CLAMP_TO_EDGE;if(D===am)return q.MIRRORED_REPEAT;if(D===bs)return q.NEAREST;if(D===CL)return q.NEAREST_MIPMAP_NEAREST;if(D===RL)return q.NEAREST_MIPMAP_LINEAR;if(D===qo)return q.LINEAR;if(D===jk)return q.LINEAR_MIPMAP_NEAREST;if(D===Tb)return q.LINEAR_MIPMAP_LINEAR;if(D===KR)return q.UNSIGNED_BYTE;if(D===rse)return q.UNSIGNED_SHORT_4_4_4_4;if(D===ise)return q.UNSIGNED_SHORT_5_5_5_1;if(D===nse)return q.UNSIGNED_SHORT_5_6_5;if(D===Qoe)return q.BYTE;if(D===ese)return q.SHORT;if(D===NM)return q.UNSIGNED_SHORT;if(D===tse)return q.INT;if(D===Kk)return q.UNSIGNED_INT;if(D===_0)return q.FLOAT;if(D===JR&&(W=We.get("OES_texture_half_float"),W!==null))return W.HALF_FLOAT_OES;if(D===ase)return q.ALPHA;if(D===x0)return q.RGB;if(D===qu)return q.RGBA;if(D===ose)return q.LUMINANCE;if(D===sse)return q.LUMINANCE_ALPHA;if(D===tm)return q.DEPTH_COMPONENT;if(D===S0)return q.DEPTH_STENCIL;if(D===Hk)return q.FUNC_ADD;if(D===Roe)return q.FUNC_SUBTRACT;if(D===Loe)return q.FUNC_REVERSE_SUBTRACT;if(D===Doe)return q.ZERO;if(D===Poe)return q.ONE;if(D===Ioe)return q.SRC_COLOR;if(D===Noe)return q.ONE_MINUS_SRC_COLOR;if(D===Wk)return q.SRC_ALPHA;if(D===Xk)return q.ONE_MINUS_SRC_ALPHA;if(D===Uoe)return q.DST_ALPHA;if(D===Ooe)return q.ONE_MINUS_DST_ALPHA;if(D===zoe)return q.DST_COLOR;if(D===Foe)return q.ONE_MINUS_DST_COLOR;if(D===Boe)return q.SRC_ALPHA_SATURATE;if((D===fk||D===pk||D===dk||D===mk)&&(W=We.get("WEBGL_compressed_texture_s3tc"),W!==null)){if(D===fk)return W.COMPRESSED_RGB_S3TC_DXT1_EXT;if(D===pk)return W.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(D===dk)return W.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(D===mk)return W.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((D===vk||D===gk||D===yk||D===_k)&&(W=We.get("WEBGL_compressed_texture_pvrtc"),W!==null)){if(D===vk)return W.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(D===gk)return W.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(D===yk)return W.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(D===_k)return W.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(D===lse&&(W=We.get("WEBGL_compressed_texture_etc1"),W!==null))return W.COMPRESSED_RGB_ETC1_WEBGL;if((D===lk||D===uk)&&(W=We.get("EXT_blend_minmax"),W!==null)){if(D===lk)return W.MIN_EXT;if(D===uk)return W.MAX_EXT}return D===UM&&(W=We.get("WEBGL_depth_texture"),W!==null)?W.UNSIGNED_INT_24_8_WEBGL:0}}function T0(r,e){this.name="",this.color=new Wt(r),this.density=e!==void 0?e:25e-5}function E0(r,e,t){this.name="",this.color=new Wt(r),this.near=e!==void 0?e:1,this.far=t!==void 0?t:1e3}function cm(){Lt.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Sk(r,e,t,i,n){Lt.call(this),this.lensFlares=[],this.positionScreen=new oe,this.customUpdateCallback=void 0,r!==void 0&&this.add(r,e,t,i,n)}function hm(r){_r.call(this),this.type="SpriteMaterial",this.color=new Wt(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(r)}function qM(r){Lt.call(this),this.type="Sprite",this.material=r!==void 0?r:new hm}function ZM(){Lt.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function QR(r,e,t){if(this.useVertexTexture=t!==void 0?t:!0,this.identityMatrix=new Kt,r=r||[],this.bones=r.slice(0),this.useVertexTexture){var i=Math.sqrt(this.bones.length*4);i=fr.nextPowerOfTwo(Math.ceil(i)),i=Math.max(i,4),this.boneTextureWidth=i,this.boneTextureHeight=i,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new sm(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,qu,_0)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(e===void 0)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var n=0,a=this.bones.length;n<a;n++)this.boneInverses.push(new Kt)}}function eL(){Lt.call(this),this.type="Bone"}function tL(r,e,t){_n.call(this,r,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Kt,this.bindMatrixInverse=new Kt;var i=[];if(this.geometry&&this.geometry.bones!==void 0){for(var n,a,o=0,s=this.geometry.bones.length;o<s;++o)a=this.geometry.bones[o],n=new eL,i.push(n),n.name=a.name,n.position.fromArray(a.pos),n.quaternion.fromArray(a.rotq),a.scl!==void 0&&n.scale.fromArray(a.scl);for(var o=0,s=this.geometry.bones.length;o<s;++o)a=this.geometry.bones[o],a.parent!==-1&&a.parent!==null&&i[a.parent]!==void 0?i[a.parent].add(i[o]):this.add(i[o])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new QR(i,void 0,t),this.matrixWorld)}function Fi(r){_r.call(this),this.type="LineBasicMaterial",this.color=new Wt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(r)}function rh(r,e,t){if(t===1)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new yi(r,e);Lt.call(this),this.type="Line",this.geometry=r!==void 0?r:new Vt,this.material=e!==void 0?e:new Fi({color:Math.random()*16777215})}function yi(r,e){rh.call(this,r,e),this.type="LineSegments"}function iu(r){_r.call(this),this.type="PointsMaterial",this.color=new Wt(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(r)}function A0(r,e){Lt.call(this),this.type="Points",this.geometry=r!==void 0?r:new Vt,this.material=e!==void 0?e:new iu({color:Math.random()*16777215})}function jM(){Lt.call(this),this.type="Group"}function rL(r,e,t,i,n,a,o,s,l){ci.call(this,r,e,t,i,n,a,o,s,l),this.generateMipmaps=!1;var u=this;function c(){requestAnimationFrame(c),r.readyState>=r.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}c()}function C0(r,e,t,i,n,a,o,s,l,u,c,h){ci.call(this,null,a,o,s,l,u,i,n,c,h),this.image={width:e,height:t},this.mipmaps=r,this.flipY=!1,this.generateMipmaps=!1}function iL(r,e,t,i,n,a,o,s,l){ci.call(this,r,e,t,i,n,a,o,s,l),this.needsUpdate=!0}function KM(r,e,t,i,n,a,o,s,l,u){if(u=u!==void 0?u:tm,u!==tm&&u!==S0)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");t===void 0&&u===tm&&(t=NM),t===void 0&&u===S0&&(t=UM),ci.call(this,null,i,n,a,o,s,u,t,l),this.image={width:r,height:e},this.magFilter=o!==void 0?o:bs,this.minFilter=s!==void 0?s:bs,this.flipY=!1,this.generateMipmaps=!1}function R0(r){Vt.call(this);var e=[0,0],t={};function i(I,R){return I-R}var n=["a","b","c"];if(r&&r.isGeometry){for(var a=r.vertices,o=r.faces,s=0,l=new Uint32Array(6*o.length),u=0,c=o.length;u<c;u++)for(var h=o[u],f=0;f<3;f++){e[0]=h[n[f]],e[1]=h[n[(f+1)%3]],e.sort(i);var p=e.toString();t[p]===void 0&&(l[2*s]=e[0],l[2*s+1]=e[1],t[p]=!0,s++)}for(var d=new Float32Array(s*2*3),u=0,c=s;u<c;u++)for(var f=0;f<2;f++){var g=a[l[2*u+f]],m=6*u+3*f;d[m+0]=g.x,d[m+1]=g.y,d[m+2]=g.z}this.addAttribute("position",new Mt(d,3))}else if(r&&r.isBufferGeometry)if(r.index!==null){var v=r.index.array,a=r.attributes.position,_=r.groups,s=0;_.length===0&&r.addGroup(0,v.length);for(var l=new Uint32Array(2*v.length),y=0,x=_.length;y<x;++y)for(var M=_[y],S=M.start,w=M.count,u=S,T=S+w;u<T;u+=3)for(var f=0;f<3;f++){e[0]=v[u+f],e[1]=v[u+(f+1)%3],e.sort(i);var p=e.toString();t[p]===void 0&&(l[2*s]=e[0],l[2*s+1]=e[1],t[p]=!0,s++)}for(var d=new Float32Array(s*2*3),u=0,c=s;u<c;u++)for(var f=0;f<2;f++){var m=6*u+3*f,C=l[2*u+f];d[m+0]=a.getX(C),d[m+1]=a.getY(C),d[m+2]=a.getZ(C)}this.addAttribute("position",new Mt(d,3))}else{for(var a=r.attributes.position.array,s=a.length/3,b=s/3,d=new Float32Array(s*2*3),u=0,c=b;u<c;u++)for(var f=0;f<3;f++){var m=18*u+6*f,E=9*u+3*f;d[m+0]=a[E],d[m+1]=a[E+1],d[m+2]=a[E+2];var C=9*u+3*((f+1)%3);d[m+3]=a[C],d[m+4]=a[C+1],d[m+5]=a[C+2]}this.addAttribute("position",new Mt(d,3))}}function L0(r,e,t){Vt.call(this),this.type="ParametricBufferGeometry",this.parameters={func:r,slices:e,stacks:t};var i=[],n=[],a,o,s,l,u,c=e+1;for(a=0;a<=t;a++)for(u=a/t,o=0;o<=e;o++)l=o/e,s=r(l,u),i.push(s.x,s.y,s.z),n.push(l,u);var h=[],f,p,d,g;for(a=0;a<t;a++)for(o=0;o<e;o++)f=a*c+o,p=a*c+o+1,d=(a+1)*c+o+1,g=(a+1)*c+o,h.push(f,p,g),h.push(p,d,g);this.setIndex(new(h.length>65535?th:eh)(h,1)),this.addAttribute("position",new Mr(i,3)),this.addAttribute("uv",new Mr(n,2)),this.computeVertexNormals()}function JM(r,e,t){ur.call(this),this.type="ParametricGeometry",this.parameters={func:r,slices:e,stacks:t},this.fromBufferGeometry(new L0(r,e,t)),this.mergeVertices()}function Ko(r,e,t,i){Vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:e,radius:t,detail:i},t=t||1,i=i||0;var n=[],a=[];o(i),l(t),u(),this.addAttribute("position",new Mr(n,3)),this.addAttribute("normal",new Mr(n.slice(),3)),this.addAttribute("uv",new Mr(a,2)),this.normalizeNormals(),this.boundingSphere=new ha(new oe,t);function o(v){for(var _=new oe,y=new oe,x=new oe,M=0;M<e.length;M+=3)f(e[M+0],_),f(e[M+1],y),f(e[M+2],x),s(_,y,x,v)}function s(v,_,y,x){var M=Math.pow(2,x),S=[],w,T;for(w=0;w<=M;w++){S[w]=[];var C=v.clone().lerp(y,w/M),b=_.clone().lerp(y,w/M),E=M-w;for(T=0;T<=E;T++)T===0&&w===M?S[w][T]=C:S[w][T]=C.clone().lerp(b,T/E)}for(w=0;w<M;w++)for(T=0;T<2*(M-w)-1;T++){var I=Math.floor(T/2);T%2===0?(h(S[w][I+1]),h(S[w+1][I]),h(S[w][I])):(h(S[w][I+1]),h(S[w+1][I+1]),h(S[w+1][I]))}}function l(v){for(var _=new oe,y=0;y<n.length;y+=3)_.x=n[y+0],_.y=n[y+1],_.z=n[y+2],_.normalize().multiplyScalar(v),n[y+0]=_.x,n[y+1]=_.y,n[y+2]=_.z}function u(){for(var v=new oe,_=0;_<n.length;_+=3){v.x=n[_+0],v.y=n[_+1],v.z=n[_+2];var y=g(v)/2/Math.PI+.5,x=m(v)/Math.PI+.5;a.push(y,1-x)}p(),c()}function c(){for(var v=0;v<a.length;v+=6){var _=a[v+0],y=a[v+2],x=a[v+4],M=Math.max(_,y,x),S=Math.min(_,y,x);M>.9&&S<.1&&(_<.2&&(a[v+0]+=1),y<.2&&(a[v+2]+=1),x<.2&&(a[v+4]+=1))}}function h(v){n.push(v.x,v.y,v.z)}function f(v,_){var y=v*3;_.x=r[y+0],_.y=r[y+1],_.z=r[y+2]}function p(){for(var v=new oe,_=new oe,y=new oe,x=new oe,M=new Tt,S=new Tt,w=new Tt,T=0,C=0;T<n.length;T+=9,C+=6){v.set(n[T+0],n[T+1],n[T+2]),_.set(n[T+3],n[T+4],n[T+5]),y.set(n[T+6],n[T+7],n[T+8]),M.set(a[C+0],a[C+1]),S.set(a[C+2],a[C+3]),w.set(a[C+4],a[C+5]),x.copy(v).add(_).add(y).divideScalar(3);var b=g(x);d(M,C+0,v,b),d(S,C+2,_,b),d(w,C+4,y,b)}}function d(v,_,y,x){x<0&&v.x===1&&(a[_]=v.x-1),y.x===0&&y.z===0&&(a[_]=x/2/Math.PI+.5)}function g(v){return Math.atan2(v.z,-v.x)}function m(v){return Math.atan2(-v.y,Math.sqrt(v.x*v.x+v.z*v.z))}}function D0(r,e){var t=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];Ko.call(this,t,i,r,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:r,detail:e}}function $M(r,e){ur.call(this),this.type="TetrahedronGeometry",this.parameters={radius:r,detail:e},this.fromBufferGeometry(new D0(r,e)),this.mergeVertices()}function fm(r,e){var t=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];Ko.call(this,t,i,r,e),this.type="OctahedronBufferGeometry",this.parameters={radius:r,detail:e}}function QM(r,e){ur.call(this),this.type="OctahedronGeometry",this.parameters={radius:r,detail:e},this.fromBufferGeometry(new fm(r,e)),this.mergeVertices()}function P0(r,e){var t=(1+Math.sqrt(5))/2,i=[-1,t,0,1,t,0,-1,-t,0,1,-t,0,0,-1,t,0,1,t,0,-1,-t,0,1,-t,t,0,-1,t,0,1,-t,0,-1,-t,0,1],n=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];Ko.call(this,i,n,r,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:r,detail:e}}function eb(r,e){ur.call(this),this.type="IcosahedronGeometry",this.parameters={radius:r,detail:e},this.fromBufferGeometry(new P0(r,e)),this.mergeVertices()}function I0(r,e){var t=(1+Math.sqrt(5))/2,i=1/t,n=[-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,-i,-t,0,-i,t,0,i,-t,0,i,t,-i,-t,0,-i,t,0,i,-t,0,i,t,0,-t,0,-i,t,0,-i,-t,0,i,t,0,i],a=[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];Ko.call(this,n,a,r,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:r,detail:e}}function tb(r,e){ur.call(this),this.type="DodecahedronGeometry",this.parameters={radius:r,detail:e},this.fromBufferGeometry(new I0(r,e)),this.mergeVertices()}function rb(r,e,t,i){ur.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:r,indices:e,radius:t,detail:i},this.fromBufferGeometry(new Ko(r,e,t,i)),this.mergeVertices()}function N0(r,e,t,i,n){Vt.call(this),this.type="TubeBufferGeometry",this.parameters={path:r,tubularSegments:e,radius:t,radialSegments:i,closed:n},e=e||64,t=t||1,i=i||8,n=n||!1;var a=r.computeFrenetFrames(e,n);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o=new oe,s=new oe,l=new Tt,u,c,h=[],f=[],p=[],d=[];g(),this.setIndex(new(d.length>65535?th:eh)(d,1)),this.addAttribute("position",new Mr(h,3)),this.addAttribute("normal",new Mr(f,3)),this.addAttribute("uv",new Mr(p,2));function g(){for(u=0;u<e;u++)m(u);m(n===!1?e:0),_(),v()}function m(y){var x=r.getPointAt(y/e),M=a.normals[y],S=a.binormals[y];for(c=0;c<=i;c++){var w=c/i*Math.PI*2,T=Math.sin(w),C=-Math.cos(w);s.x=C*M.x+T*S.x,s.y=C*M.y+T*S.y,s.z=C*M.z+T*S.z,s.normalize(),f.push(s.x,s.y,s.z),o.x=x.x+t*s.x,o.y=x.y+t*s.y,o.z=x.z+t*s.z,h.push(o.x,o.y,o.z)}}function v(){for(c=1;c<=e;c++)for(u=1;u<=i;u++){var y=(i+1)*(c-1)+(u-1),x=(i+1)*c+(u-1),M=(i+1)*c+u,S=(i+1)*(c-1)+u;d.push(y,x,S),d.push(x,M,S)}}function _(){for(u=0;u<=e;u++)for(c=0;c<=i;c++)l.x=u/e,l.y=c/i,p.push(l.x,l.y)}}function ib(r,e,t,i,n,a){ur.call(this),this.type="TubeGeometry",this.parameters={path:r,tubularSegments:e,radius:t,radialSegments:i,closed:n},a!==void 0&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new N0(r,e,t,i,n);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function U0(r,e,t,i,n,a){Vt.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:r,tube:e,tubularSegments:t,radialSegments:i,p:n,q:a},r=r||100,e=e||40,t=Math.floor(t)||64,i=Math.floor(i)||8,n=n||2,a=a||3;var o=(i+1)*(t+1),s=i*t*2*3,l=new Mt(new(s>65535?Uint32Array:Uint16Array)(s),1),u=new Mt(new Float32Array(o*3),3),c=new Mt(new Float32Array(o*3),3),h=new Mt(new Float32Array(o*2),2),f,p,d=0,g=0,m=new oe,v=new oe,_=new Tt,y=new oe,x=new oe,M=new oe,S=new oe,w=new oe;for(f=0;f<=t;++f){var T=f/t*n*Math.PI*2;for(U(T,n,a,r,y),U(T+.01,n,a,r,x),S.subVectors(x,y),w.addVectors(x,y),M.crossVectors(S,w),w.crossVectors(M,S),M.normalize(),w.normalize(),p=0;p<=i;++p){var C=p/i*Math.PI*2,b=-e*Math.cos(C),E=e*Math.sin(C);m.x=y.x+(b*w.x+E*M.x),m.y=y.y+(b*w.y+E*M.y),m.z=y.z+(b*w.z+E*M.z),u.setXYZ(d,m.x,m.y,m.z),v.subVectors(m,y).normalize(),c.setXYZ(d,v.x,v.y,v.z),_.x=f/t,_.y=p/i,h.setXY(d,_.x,_.y),d++}}for(p=1;p<=t;p++)for(f=1;f<=i;f++){var I=(i+1)*(p-1)+(f-1),R=(i+1)*p+(f-1),A=(i+1)*p+f,P=(i+1)*(p-1)+f;l.setX(g,I),g++,l.setX(g,R),g++,l.setX(g,P),g++,l.setX(g,R),g++,l.setX(g,A),g++,l.setX(g,P),g++}this.setIndex(l),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",h);function U(B,z,k,G,Y){var J=Math.cos(B),Q=Math.sin(B),V=k/z*B,K=Math.cos(V);Y.x=G*(2+K)*.5*J,Y.y=G*(2+K)*Q*.5,Y.z=G*Math.sin(V)*.5}}function nb(r,e,t,i,n,a,o){ur.call(this),this.type="TorusKnotGeometry",this.parameters={radius:r,tube:e,tubularSegments:t,radialSegments:i,p:n,q:a},o!==void 0&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new U0(r,e,t,i,n,a)),this.mergeVertices()}function O0(r,e,t,i,n){Vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},r=r||100,e=e||40,t=Math.floor(t)||8,i=Math.floor(i)||6,n=n||Math.PI*2;var a=(t+1)*(i+1),o=t*i*2*3,s=new(o>65535?Uint32Array:Uint16Array)(o),l=new Float32Array(a*3),u=new Float32Array(a*3),c=new Float32Array(a*2),h=0,f=0,p=0,d=new oe,g=new oe,m=new oe,v,_;for(v=0;v<=t;v++)for(_=0;_<=i;_++){var y=_/i*n,x=v/t*Math.PI*2;g.x=(r+e*Math.cos(x))*Math.cos(y),g.y=(r+e*Math.cos(x))*Math.sin(y),g.z=e*Math.sin(x),l[h]=g.x,l[h+1]=g.y,l[h+2]=g.z,d.x=r*Math.cos(y),d.y=r*Math.sin(y),m.subVectors(g,d).normalize(),u[h]=m.x,u[h+1]=m.y,u[h+2]=m.z,c[f]=_/i,c[f+1]=v/t,h+=3,f+=2}for(v=1;v<=t;v++)for(_=1;_<=i;_++){var M=(i+1)*v+_-1,S=(i+1)*(v-1)+_-1,w=(i+1)*(v-1)+_,T=(i+1)*v+_;s[p]=M,s[p+1]=S,s[p+2]=T,s[p+3]=S,s[p+4]=w,s[p+5]=T,p+=6}this.setIndex(new Mt(s,1)),this.addAttribute("position",new Mt(l,3)),this.addAttribute("normal",new Mt(u,3)),this.addAttribute("uv",new Mt(c,2))}function ab(r,e,t,i,n){ur.call(this),this.type="TorusGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},this.fromBufferGeometry(new O0(r,e,t,i,n))}function ml(r,e){if(typeof r>"u"){r=[];return}ur.call(this),this.type="ExtrudeGeometry",r=Array.isArray(r)?r:[r],this.addShapeList(r,e),this.computeFaceNormals()}function ob(r,e){e=e||{};var t=e.font;if((t&&t.isFont)===!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ur;var i=t.generateShapes(r,e.size,e.curveSegments);e.amount=e.height!==void 0?e.height:50,e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),ml.call(this,i,e),this.type="TextGeometry"}function pm(r,e,t,i,n,a,o){Vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},r=r||50,e=Math.max(3,Math.floor(e)||8),t=Math.max(2,Math.floor(t)||6),i=i!==void 0?i:0,n=n!==void 0?n:Math.PI*2,a=a!==void 0?a:0,o=o!==void 0?o:Math.PI;for(var s=a+o,l=(e+1)*(t+1),u=new Mt(new Float32Array(l*3),3),c=new Mt(new Float32Array(l*3),3),h=new Mt(new Float32Array(l*2),2),f=0,p=[],d=new oe,g=0;g<=t;g++){for(var m=[],v=g/t,_=0;_<=e;_++){var y=_/e,x=-r*Math.cos(i+y*n)*Math.sin(a+v*o),M=r*Math.cos(a+v*o),S=r*Math.sin(i+y*n)*Math.sin(a+v*o);d.set(x,M,S).normalize(),u.setXYZ(f,x,M,S),c.setXYZ(f,d.x,d.y,d.z),h.setXY(f,y,1-v),m.push(f),f++}p.push(m)}for(var w=[],g=0;g<t;g++)for(var _=0;_<e;_++){var T=p[g][_+1],C=p[g][_],b=p[g+1][_],E=p[g+1][_+1];(g!==0||a>0)&&w.push(T,C,E),(g!==t-1||s<Math.PI)&&w.push(C,b,E)}this.setIndex(new(u.count>65535?th:eh)(w,1)),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",h),this.boundingSphere=new ha(new oe,r)}function sb(r,e,t,i,n,a,o){ur.call(this),this.type="SphereGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new pm(r,e,t,i,n,a,o))}function z0(r,e,t,i,n,a){Vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:r,outerRadius:e,thetaSegments:t,phiSegments:i,thetaStart:n,thetaLength:a},r=r||20,e=e||50,n=n!==void 0?n:0,a=a!==void 0?a:Math.PI*2,t=t!==void 0?Math.max(3,t):8,i=i!==void 0?Math.max(1,i):1;var o=(t+1)*(i+1),s=t*i*2*3,l=new Mt(new(s>65535?Uint32Array:Uint16Array)(s),1),u=new Mt(new Float32Array(o*3),3),c=new Mt(new Float32Array(o*3),3),h=new Mt(new Float32Array(o*2),2),f=0,p=0,d,g=r,m=(e-r)/i,v=new oe,_=new Tt,y,x;for(y=0;y<=i;y++){for(x=0;x<=t;x++)d=n+x/t*a,v.x=g*Math.cos(d),v.y=g*Math.sin(d),u.setXYZ(f,v.x,v.y,v.z),c.setXYZ(f,0,0,1),_.x=(v.x/e+1)/2,_.y=(v.y/e+1)/2,h.setXY(f,_.x,_.y),f++;g+=m}for(y=0;y<i;y++){var M=y*(t+1);for(x=0;x<t;x++){d=x+M;var S=d,w=d+t+1,T=d+t+2,C=d+1;l.setX(p,S),p++,l.setX(p,w),p++,l.setX(p,T),p++,l.setX(p,S),p++,l.setX(p,T),p++,l.setX(p,C),p++}}this.setIndex(l),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",h)}function lb(r,e,t,i,n,a){ur.call(this),this.type="RingGeometry",this.parameters={innerRadius:r,outerRadius:e,thetaSegments:t,phiSegments:i,thetaStart:n,thetaLength:a},this.fromBufferGeometry(new z0(r,e,t,i,n,a))}function ub(r,e,t,i){ur.call(this),this.type="PlaneGeometry",this.parameters={width:r,height:e,widthSegments:t,heightSegments:i},this.fromBufferGeometry(new um(r,e,t,i))}function F0(r,e,t,i){Vt.call(this),this.type="LatheBufferGeometry",this.parameters={points:r,segments:e,phiStart:t,phiLength:i},e=Math.floor(e)||12,t=t||0,i=i||Math.PI*2,i=fr.clamp(i,0,Math.PI*2);var n=(e+1)*r.length,a=e*r.length*2*3,o=new Mt(new(a>65535?Uint32Array:Uint16Array)(a),1),s=new Mt(new Float32Array(n*3),3),l=new Mt(new Float32Array(n*2),2),u=0,c=0,h,f=1/e,p=new oe,d=new Tt,g,m;for(g=0;g<=e;g++){var v=t+g*f*i,_=Math.sin(v),y=Math.cos(v);for(m=0;m<=r.length-1;m++)p.x=r[m].x*_,p.y=r[m].y,p.z=r[m].x*y,s.setXYZ(u,p.x,p.y,p.z),d.x=g/e,d.y=m/(r.length-1),l.setXY(u,d.x,d.y),u++}for(g=0;g<e;g++)for(m=0;m<r.length-1;m++){h=m+g*r.length;var x=h,M=h+r.length,S=h+r.length+1,w=h+1;o.setX(c,x),c++,o.setX(c,M),c++,o.setX(c,w),c++,o.setX(c,M),c++,o.setX(c,S),c++,o.setX(c,w),c++}if(this.setIndex(o),this.addAttribute("position",s),this.addAttribute("uv",l),this.computeVertexNormals(),i===Math.PI*2){var T=this.attributes.normal.array,C=new oe,b=new oe,E=new oe;for(h=e*r.length*3,g=0,m=0;g<r.length;g++,m+=3)C.x=T[m+0],C.y=T[m+1],C.z=T[m+2],b.x=T[h+m+0],b.y=T[h+m+1],b.z=T[h+m+2],E.addVectors(C,b).normalize(),T[m+0]=T[h+m+0]=E.x,T[m+1]=T[h+m+1]=E.y,T[m+2]=T[h+m+2]=E.z}}function cb(r,e,t,i){ur.call(this),this.type="LatheGeometry",this.parameters={points:r,segments:e,phiStart:t,phiLength:i},this.fromBufferGeometry(new F0(r,e,t,i)),this.mergeVertices()}function B0(r,e){Vt.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:r,curveSegments:e},e=e||12;var t=[],i=[],n=[],a=[],o=0,s=0;if(Array.isArray(r)===!1)u(r);else for(var l=0;l<r.length;l++)u(r[l]),this.addGroup(o,s,l),o+=s,s=0;this.setIndex(new(a.length>65535?th:eh)(a,1)),this.addAttribute("position",new Mr(t,3)),this.addAttribute("normal",new Mr(i,3)),this.addAttribute("uv",new Mr(n,2));function u(c){var h,f,p,d=t.length/3,g=c.extractPoints(e),m=g.shape,v=g.holes;if(Gn.isClockWise(m)===!1)for(m=m.reverse(),h=0,f=v.length;h<f;h++)p=v[h],Gn.isClockWise(p)===!0&&(v[h]=p.reverse());var _=Gn.triangulateShape(m,v);for(h=0,f=v.length;h<f;h++)p=v[h],m=m.concat(p);for(h=0,f=m.length;h<f;h++){var y=m[h];t.push(y.x,y.y,0),i.push(0,0,1),n.push(y.x,y.y)}for(h=0,f=_.length;h<f;h++){var x=_[h],M=x[0]+d,S=x[1]+d,w=x[2]+d;a.push(M,S,w),s+=3}}}function k0(r,e){ur.call(this),this.type="ShapeGeometry",typeof e=="object"&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:r,curveSegments:e},this.fromBufferGeometry(new B0(r,e)),this.mergeVertices()}function V0(r,e){Vt.call(this),e=e!==void 0?e:1;var t=Math.cos(fr.DEG2RAD*e),i=[0,0],n={};function a(_,y){return _-y}var o=["a","b","c"],s;r.isBufferGeometry?(s=new ur,s.fromBufferGeometry(r)):s=r.clone(),s.mergeVertices(),s.computeFaceNormals();for(var l=s.vertices,u=s.faces,c=0,h=u.length;c<h;c++)for(var f=u[c],p=0;p<3;p++){i[0]=f[o[p]],i[1]=f[o[(p+1)%3]],i.sort(a);var d=i.toString();n[d]===void 0?n[d]={vert1:i[0],vert2:i[1],face1:c,face2:void 0}:n[d].face2=c}var g=[];for(var d in n){var m=n[d];if(m.face2===void 0||u[m.face1].normal.dot(u[m.face2].normal)<=t){var v=l[m.vert1];g.push(v.x),g.push(v.y),g.push(v.z),v=l[m.vert2],g.push(v.x),g.push(v.y),g.push(v.z)}}this.addAttribute("position",new Mr(g,3))}function ih(r,e,t,i,n,a,o,s){Vt.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:r,radiusBottom:e,height:t,radialSegments:i,heightSegments:n,openEnded:a,thetaStart:o,thetaLength:s};var l=this;r=r!==void 0?r:20,e=e!==void 0?e:20,t=t!==void 0?t:100,i=Math.floor(i)||8,n=Math.floor(n)||1,a=a!==void 0?a:!1,o=o!==void 0?o:0,s=s!==void 0?s:2*Math.PI;var u=0;a===!1&&(r>0&&u++,e>0&&u++);var c=M(),h=S(),f=new Mt(new(h>65535?Uint32Array:Uint16Array)(h),1),p=new Mt(new Float32Array(c*3),3),d=new Mt(new Float32Array(c*3),3),g=new Mt(new Float32Array(c*2),2),m=0,v=0,_=[],y=t/2,x=0;w(),a===!1&&(r>0&&T(!0),e>0&&T(!1)),this.setIndex(f),this.addAttribute("position",p),this.addAttribute("normal",d),this.addAttribute("uv",g);function M(){var C=(i+1)*(n+1);return a===!1&&(C+=(i+1)*u+i*u),C}function S(){var C=i*n*2*3;return a===!1&&(C+=i*u*3),C}function w(){var C,b,E=new oe,I=new oe,R=0,A=(e-r)/t;for(b=0;b<=n;b++){var P=[],U=b/n,B=U*(e-r)+r;for(C=0;C<=i;C++){var z=C/i,k=z*s+o,G=Math.sin(k),Y=Math.cos(k);I.x=B*G,I.y=-U*t+y,I.z=B*Y,p.setXYZ(m,I.x,I.y,I.z),E.set(G,A,Y).normalize(),d.setXYZ(m,E.x,E.y,E.z),g.setXY(m,z,1-U),P.push(m),m++}_.push(P)}for(C=0;C<i;C++)for(b=0;b<n;b++){var J=_[b][C],Q=_[b+1][C],V=_[b+1][C+1],K=_[b][C+1];f.setX(v,J),v++,f.setX(v,Q),v++,f.setX(v,K),v++,f.setX(v,Q),v++,f.setX(v,V),v++,f.setX(v,K),v++,R+=6}l.addGroup(x,R,0),x+=R}function T(C){var b,E,I,R=new Tt,A=new oe,P=0,U=C===!0?r:e,B=C===!0?1:-1;for(E=m,b=1;b<=i;b++)p.setXYZ(m,0,y*B,0),d.setXYZ(m,0,B,0),R.x=.5,R.y=.5,g.setXY(m,R.x,R.y),m++;for(I=m,b=0;b<=i;b++){var z=b/i,k=z*s+o,G=Math.cos(k),Y=Math.sin(k);A.x=U*Y,A.y=y*B,A.z=U*G,p.setXYZ(m,A.x,A.y,A.z),d.setXYZ(m,0,B,0),R.x=G*.5+.5,R.y=Y*.5*B+.5,g.setXY(m,R.x,R.y),m++}for(b=0;b<i;b++){var J=E+b,Q=I+b;C===!0?(f.setX(v,Q),v++,f.setX(v,Q+1),v++,f.setX(v,J),v++):(f.setX(v,Q+1),v++,f.setX(v,Q),v++,f.setX(v,J),v++),P+=3}l.addGroup(x,P,C===!0?1:2),x+=P}}function dm(r,e,t,i,n,a,o,s){ur.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:r,radiusBottom:e,height:t,radialSegments:i,heightSegments:n,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new ih(r,e,t,i,n,a,o,s)),this.mergeVertices()}function hb(r,e,t,i,n,a,o){dm.call(this,0,r,e,t,i,n,a,o),this.type="ConeGeometry",this.parameters={radius:r,height:e,radialSegments:t,heightSegments:i,openEnded:n,thetaStart:a,thetaLength:o}}function fb(r,e,t,i,n,a,o){ih.call(this,0,r,e,t,i,n,a,o),this.type="ConeBufferGeometry",this.parameters={radius:r,height:e,radialSegments:t,heightSegments:i,openEnded:n,thetaStart:a,thetaLength:o}}function G0(r,e,t,i){Vt.call(this),this.type="CircleBufferGeometry",this.parameters={radius:r,segments:e,thetaStart:t,thetaLength:i},r=r||50,e=e!==void 0?Math.max(3,e):8,t=t!==void 0?t:0,i=i!==void 0?i:Math.PI*2;var n=e+2,a=new Float32Array(n*3),o=new Float32Array(n*3),s=new Float32Array(n*2);o[2]=1,s[0]=.5,s[1]=.5;for(var l=0,u=3,c=2;l<=e;l++,u+=3,c+=2){var h=t+l/e*i;a[u]=r*Math.cos(h),a[u+1]=r*Math.sin(h),o[u+2]=1,s[c]=(a[u]/r+1)/2,s[c+1]=(a[u+1]/r+1)/2}for(var f=[],u=1;u<=e;u++)f.push(u,u+1,0);this.setIndex(new Mt(new Uint16Array(f),1)),this.addAttribute("position",new Mt(a,3)),this.addAttribute("normal",new Mt(o,3)),this.addAttribute("uv",new Mt(s,2)),this.boundingSphere=new ha(new oe,r)}function pb(r,e,t,i){ur.call(this),this.type="CircleGeometry",this.parameters={radius:r,segments:e,thetaStart:t,thetaLength:i},this.fromBufferGeometry(new G0(r,e,t,i))}function db(r,e,t,i,n,a){ur.call(this),this.type="BoxGeometry",this.parameters={width:r,height:e,depth:t,widthSegments:i,heightSegments:n,depthSegments:a},this.fromBufferGeometry(new lm(r,e,t,i,n,a)),this.mergeVertices()}function H0(){Na.call(this,{uniforms:Yo.merge([dr.lights,{opacity:{value:1}}]),vertexShader:jr.shadow_vert,fragmentShader:jr.shadow_frag}),this.lights=!0,this.transparent=!0,Object.defineProperties(this,{opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(r){this.uniforms.opacity.value=r}}})}function W0(r){Na.call(this,r),this.type="RawShaderMaterial"}function mb(r){this.uuid=fr.generateUUID(),this.type="MultiMaterial",this.materials=Array.isArray(r)?r:[],this.visible=!0}function ju(r){_r.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Wt(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 Wt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Tt(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(r)}function mm(r){ju.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(r)}function nu(r){_r.call(this),this.type="MeshPhongMaterial",this.color=new Wt(16777215),this.specular=new Wt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=wb,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(r)}function vm(r){nu.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(r)}function gm(r){_r.call(this,r),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new Tt(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(r)}function ym(r){_r.call(this),this.type="MeshLambertMaterial",this.color=new Wt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=wb,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(r)}function _m(r){_r.call(this),this.type="LineDashedMaterial",this.color=new Wt(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(r)}function tV(r,e,t){var i=this,n=!1,a=0,o=0;this.onStart=void 0,this.onLoad=r,this.onProgress=e,this.onError=t,this.itemStart=function(s){o++,n===!1&&i.onStart!==void 0&&i.onStart(s,a,o),n=!0},this.itemEnd=function(s){a++,i.onProgress!==void 0&&i.onProgress(s,a,o),a===o&&(n=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(s){i.onError!==void 0&&i.onError(s)}}function vl(r){this.manager=r!==void 0?r:Ts}function Pse(r){this.manager=r!==void 0?r:Ts,this._parser=null}function rV(r){this.manager=r!==void 0?r:Ts,this._parser=null}function Eb(r){this.manager=r!==void 0?r:Ts}function iV(r){this.manager=r!==void 0?r:Ts}function LL(r){this.manager=r!==void 0?r:Ts}function Bi(r,e){Lt.call(this),this.type="Light",this.color=new Wt(r),this.intensity=e!==void 0?e:1,this.receiveShadow=void 0}function nL(r,e,t){Bi.call(this,r,t),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Lt.DefaultUp),this.updateMatrix(),this.groundColor=new Wt(e)}function Am(r){this.camera=r,this.bias=0,this.radius=1,this.mapSize=new Tt(512,512),this.map=null,this.matrix=new Kt}function aL(){Am.call(this,new ua(50,1,.5,500))}function oL(r,e,t,i,n,a){Bi.call(this,r,e),this.type="SpotLight",this.position.copy(Lt.DefaultUp),this.updateMatrix(),this.target=new Lt,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(o){this.intensity=o/Math.PI}}),this.distance=t!==void 0?t:0,this.angle=i!==void 0?i:Math.PI/3,this.penumbra=n!==void 0?n:0,this.decay=a!==void 0?a:1,this.shadow=new aL}function sL(r,e,t,i){Bi.call(this,r,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return this.intensity*4*Math.PI},set:function(n){this.intensity=n/(4*Math.PI)}}),this.distance=t!==void 0?t:0,this.decay=i!==void 0?i:1,this.shadow=new Am(new ua(90,1,.5,500))}function lL(r){Am.call(this,new w0(-5,5,5,-5,.5,500))}function uL(r,e){Bi.call(this,r,e),this.type="DirectionalLight",this.position.copy(Lt.DefaultUp),this.updateMatrix(),this.target=new Lt,this.shadow=new lL}function cL(r,e){Bi.call(this,r,e),this.type="AmbientLight",this.castShadow=void 0}function Zo(r,e,t,i){this.parameterPositions=r,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(t),this.sampleValues=e,this.valueSize=t}function hL(r,e,t,i){Zo.call(this,r,e,t,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function vb(r,e,t,i){Zo.call(this,r,e,t,i)}function fL(r,e,t,i){Zo.call(this,r,e,t,i)}function Cm(r,e,t,i){if(r===void 0)throw new Error("track name is undefined");if(e===void 0||e.length===0)throw new Error("no keyframes in track named "+r);this.name=r,this.times=ca.convertArray(e,this.TimeBufferType),this.values=ca.convertArray(t,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation),this.validate(),this.optimize()}function X0(r,e,t,i){Cm.call(this,r,e,t,i)}function pL(r,e,t,i){Zo.call(this,r,e,t,i)}function gb(r,e,t,i){Cm.call(this,r,e,t,i)}function Y0(r,e,t,i){Cm.call(this,r,e,t,i)}function dL(r,e,t,i){Cm.call(this,r,e,t,i)}function mL(r,e,t){Cm.call(this,r,e,t)}function vL(r,e,t,i){Cm.call(this,r,e,t,i)}function xm(r,e,t,i){Cm.apply(this,arguments)}function Ss(r,e,t){this.name=r,this.tracks=t,this.duration=e!==void 0?e:-1,this.uuid=fr.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function DL(r){this.manager=r!==void 0?r:Ts,this.textures={}}function nV(r){this.manager=r!==void 0?r:Ts}function im(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function aV(r){typeof r=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),r=void 0),this.manager=r!==void 0?r:Ts,this.withCredentials=!1}function Ise(r){this.manager=r!==void 0?r:Ts,this.texturePath=""}function pa(){}function Ku(r,e){this.v1=r,this.v2=e}function yb(){this.curves=[],this.autoClose=!1}function nh(r,e,t,i,n,a,o,s){this.aX=r,this.aY=e,this.xRadius=t,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s||0}function Sm(r){this.points=r===void 0?[]:r}function Mm(r,e,t,i){this.v0=r,this.v1=e,this.v2=t,this.v3=i}function bm(r,e,t){this.v0=r,this.v1=e,this.v2=t}function nm(){Cb.apply(this,arguments),this.holes=[]}function Cb(r){yb.call(this),this.currentPoint=new Tt,r&&this.fromPoints(r)}function sV(){this.subPaths=[],this.currentPath=null}function lV(r){this.data=r}function Nse(r){this.manager=r!==void 0?r:Ts}function cV(r){this.manager=r!==void 0?r:Ts}function bk(r,e,t,i){Bi.call(this,r,e),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=t!==void 0?t:10,this.height=i!==void 0?i:10}function Use(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ua,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ua,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function gL(r,e,t){Lt.call(this),this.type="CubeCamera";var i=90,n=1,a=new ua(i,n,r,e);a.up.set(0,-1,0),a.lookAt(new oe(1,0,0)),this.add(a);var o=new ua(i,n,r,e);o.up.set(0,-1,0),o.lookAt(new oe(-1,0,0)),this.add(o);var s=new ua(i,n,r,e);s.up.set(0,0,1),s.lookAt(new oe(0,1,0)),this.add(s);var l=new ua(i,n,r,e);l.up.set(0,0,-1),l.lookAt(new oe(0,-1,0)),this.add(l);var u=new ua(i,n,r,e);u.up.set(0,-1,0),u.lookAt(new oe(0,0,1)),this.add(u);var c=new ua(i,n,r,e);c.up.set(0,-1,0),c.lookAt(new oe(0,0,-1)),this.add(c);var h={format:x0,magFilter:qo,minFilter:qo};this.renderTarget=new M0(t,t,h),this.updateCubeMap=function(f,p){this.parent===null&&this.updateMatrixWorld();var d=this.renderTarget,g=d.texture.generateMipmaps;d.texture.generateMipmaps=!1,d.activeCubeFace=0,f.render(p,a,d),d.activeCubeFace=1,f.render(p,o,d),d.activeCubeFace=2,f.render(p,s,d),d.activeCubeFace=3,f.render(p,l,d),d.activeCubeFace=4,f.render(p,u,d),d.texture.generateMipmaps=g,d.activeCubeFace=5,f.render(p,c,d),f.setRenderTarget(null)}}function wk(){Lt.call(this),this.type="AudioListener",this.context=uV.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function q0(r){Lt.call(this),this.type="Audio",this.context=r.context,this.gain=this.context.createGain(),this.gain.connect(r.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 Tk(r){q0.call(this,r),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function hV(r,e){this.analyser=r.context.createAnalyser(),this.analyser.fftSize=e!==void 0?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),r.getOutput().connect(this.analyser)}function yL(r,e,t){this.binding=r,this.valueSize=t;var i=Float64Array,n;switch(e){case"quaternion":n=this._slerp;break;case"string":case"bool":i=Array,n=this._select;break;default:n=this._lerp}this.buffer=new i(t*4),this._mixBufferRegion=n,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Ii(r,e,t){this.path=e,this.parsedPath=t||Ii.parseTrackName(e),this.node=Ii.findNode(r,this.parsedPath.nodeName)||r,this.rootNode=r}function Ek(r){this.uuid=fr.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,i=arguments.length;t!==i;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function Ak(r,e,t){this._mixer=r,this._clip=e,this._localRoot=t||null;for(var i=e.tracks,n=i.length,a=new Array(n),o={endingStart:om,endingEnd:om},s=0;s!==n;++s){var l=i[s].createInterpolant(null);a[s]=l,l.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(n),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=cse,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 fV(r){this._root=r,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function _L(r){typeof r=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),r=arguments[1]),this.value=r}function wm(){Vt.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Ck(r,e,t,i){this.uuid=fr.generateUUID(),this.data=r,this.itemSize=e,this.offset=t,this.normalized=i===!0}function Z0(r,e){this.uuid=fr.generateUUID(),this.array=r,this.stride=e,this.count=r!==void 0?r.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function j0(r,e,t){Z0.call(this,r,e),this.meshPerAttribute=t||1}function K0(r,e,t){Mt.call(this,r,e),this.meshPerAttribute=t||1}function Rk(r,e,t,i){this.ray=new Qf(r,e),this.near=t||0,this.far=i||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 boe(r,e){return r.distance-e.distance}function Lk(r,e,t,i){if(r.visible!==!1&&(r.raycast(e,t),i===!0))for(var n=r.children,a=0,o=n.length;a<o;a++)Lk(n[a],e,t,!0)}function Dk(r){this.autoStart=r!==void 0?r:!0,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function kOe(r){this.points=r;var e=[],t={x:0,y:0,z:0},i,n,a,o,s,l,u,c,h;this.initFromArray=function(p){this.points=[];for(var d=0;d<p.length;d++)this.points[d]={x:p[d][0],y:p[d][1],z:p[d][2]}},this.getPoint=function(p){return i=(this.points.length-1)*p,n=Math.floor(i),a=i-n,e[0]=n===0?n:n-1,e[1]=n,e[2]=n>this.points.length-2?this.points.length-1:n+1,e[3]=n>this.points.length-3?this.points.length-1:n+2,l=this.points[e[0]],u=this.points[e[1]],c=this.points[e[2]],h=this.points[e[3]],o=a*a,s=a*o,t.x=f(l.x,u.x,c.x,h.x,a,o,s),t.y=f(l.y,u.y,c.y,h.y,a,o,s),t.z=f(l.z,u.z,c.z,h.z,a,o,s),t},this.getControlPointsArray=function(){var p,d,g=this.points.length,m=[];for(p=0;p<g;p++)d=this.points[p],m[p]=[d.x,d.y,d.z];return m},this.getLength=function(p){var d,g,m,v,_=0,y=0,x=0,M=new oe,S=new oe,w=[],T=0;for(w[0]=0,p||(p=100),m=this.points.length*p,M.copy(this.points[0]),d=1;d<m;d++)g=d/m,v=this.getPoint(g),S.copy(v),T+=S.distanceTo(M),M.copy(v),_=(this.points.length-1)*g,y=Math.floor(_),y!==x&&(w[y]=T,x=y);return w[w.length]=T,{chunks:w,total:T}},this.reparametrizeByArcLength=function(p){var d,g,m,v,_,y,x,M,S=[],w=new oe,T=this.getLength();for(S.push(w.copy(this.points[0]).clone()),d=1;d<this.points.length;d++){for(y=T.chunks[d]-T.chunks[d-1],x=Math.ceil(p*y/T.total),v=(d-1)/(this.points.length-1),_=d/(this.points.length-1),g=1;g<x-1;g++)m=v+g*(1/x)*(_-v),M=this.getPoint(m),S.push(w.copy(M).clone());S.push(w.copy(this.points[d]).clone())}this.points=S};function f(p,d,g,m,v,_,y){var x=(g-p)*.5,M=(m-d)*.5;return(2*(d-g)+x+M)*y+(-3*(d-g)-2*x-M)*_+x*v+d}}function Pk(r,e,t){return this.radius=r!==void 0?r:1,this.phi=e!==void 0?e:0,this.theta=t!==void 0?t:0,this}function Ik(r,e,t){return this.radius=r!==void 0?r:1,this.theta=e!==void 0?e:0,this.y=t!==void 0?t:0,this}function Hn(r,e){_n.call(this,r,e),this.animationsMap={},this.animationsList=[];var t=this.geometry.morphTargets.length,i="__default",n=0,a=t-1,o=t/1;this.createAnimation(i,n,a,o),this.setAnimationWeight(i,1)}function _b(r){Lt.call(this),this.material=r,this.render=function(e){}}function xb(r,e,t,i){this.object=r,this.size=e!==void 0?e:1;var n=t!==void 0?t:16711680,a=i!==void 0?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length*3:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var l=new Vt,u=new Mr(o*2*3,3);l.addAttribute("position",u),yi.call(this,l,new Fi({color:n,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function J0(r){Lt.call(this),this.light=r,this.light.updateMatrixWorld(),this.matrix=r.matrixWorld,this.matrixAutoUpdate=!1;for(var e=new Vt,t=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,n=1,a=32;i<a;i++,n++){var o=i/a*Math.PI*2,s=n/a*Math.PI*2;t.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}e.addAttribute("position",new Mr(t,3));var l=new Fi({fog:!1});this.cone=new yi(e,l),this.add(this.cone),this.update()}function $0(r){this.bones=this.getBoneList(r);for(var e=new Vt,t=[],i=[],n=new Wt(0,0,1),a=new Wt(0,1,0),o=0;o<this.bones.length;o++){var s=this.bones[o];s.parent&&s.parent.isBone&&(t.push(0,0,0),t.push(0,0,0),i.push(n.r,n.g,n.b),i.push(a.r,a.g,a.b))}e.addAttribute("position",new Mr(t,3)),e.addAttribute("color",new Mr(i,3));var l=new Fi({vertexColors:Em,depthTest:!1,depthWrite:!1,transparent:!0});yi.call(this,e,l),this.root=r,this.matrix=r.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Q0(r,e){this.light=r,this.light.updateMatrixWorld();var t=new pm(e,4,2),i=new jo({wireframe:!0,fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),_n.call(this,t,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1}function e_(r){Lt.call(this),this.light=r,this.light.updateMatrixWorld();var e=new jo({color:r.color,fog:!1}),t=new jo({color:r.color,fog:!1,wireframe:!0}),i=new Vt;i.addAttribute("position",new Mt(new Float32Array(6*3),3)),this.add(new _n(i,e)),this.add(new _n(i,t)),this.update()}function t_(r,e){Lt.call(this),this.light=r,this.light.updateMatrixWorld(),this.matrix=r.matrixWorld,this.matrixAutoUpdate=!1;var t=new fm(e);t.rotateY(Math.PI*.5);var i=new jo({vertexColors:Em,wireframe:!0}),n=t.getAttribute("position"),a=new Float32Array(n.count*3);t.addAttribute("color",new Mt(a,3)),this.add(new _n(t,i)),this.update()}function Sb(r,e,t,i){r=r||10,e=e||10,t=new Wt(t!==void 0?t:4473924),i=new Wt(i!==void 0?i:8947848);for(var n=e/2,a=r*2/e,o=[],s=[],l=0,u=0,c=-r;l<=e;l++,c+=a){o.push(-r,0,c,r,0,c),o.push(c,0,-r,c,0,r);var h=l===n?t:i;h.toArray(s,u),u+=3,h.toArray(s,u),u+=3,h.toArray(s,u),u+=3,h.toArray(s,u),u+=3}var f=new Vt;f.addAttribute("position",new Mr(o,3)),f.addAttribute("color",new Mr(s,3));var p=new Fi({vertexColors:Em});yi.call(this,f,p)}function xL(r,e,t,i,n,a){r=r||10,e=e||16,t=t||8,i=i||64,n=new Wt(n!==void 0?n:4473924),a=new Wt(a!==void 0?a:8947848);var o=[],s=[],l,u,c,h,f,p,d;for(h=0;h<=e;h++)c=h/e*(Math.PI*2),l=Math.sin(c)*r,u=Math.cos(c)*r,o.push(0,0,0),o.push(l,0,u),d=h&1?n:a,s.push(d.r,d.g,d.b),s.push(d.r,d.g,d.b);for(h=0;h<=t;h++)for(d=h&1?n:a,p=r-r/t*h,f=0;f<i;f++)c=f/i*(Math.PI*2),l=Math.sin(c)*p,u=Math.cos(c)*p,o.push(l,0,u),s.push(d.r,d.g,d.b),c=(f+1)/i*(Math.PI*2),l=Math.sin(c)*p,u=Math.cos(c)*p,o.push(l,0,u),s.push(d.r,d.g,d.b);var g=new Vt;g.addAttribute("position",new Mr(o,3)),g.addAttribute("color",new Mr(s,3));var m=new Fi({vertexColors:Em});yi.call(this,g,m)}function Mb(r,e,t,i){this.object=r,this.size=e!==void 0?e:1;var n=t!==void 0?t:16776960,a=i!==void 0?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var l=new Vt,u=new Mr(o*2*3,3);l.addAttribute("position",u),yi.call(this,l,new Fi({color:n,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function r_(r,e){Lt.call(this),this.light=r,this.light.updateMatrixWorld(),this.matrix=r.matrixWorld,this.matrixAutoUpdate=!1,e===void 0&&(e=1);var t=new Vt;t.addAttribute("position",new Mr([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new Fi({fog:!1});this.add(new rh(t,i)),t=new Vt,t.addAttribute("position",new Mr([0,0,0,0,0,1],3)),this.add(new rh(t,i)),this.update()}function bb(r){var e=new Vt,t=new Fi({color:16777215,vertexColors:Fk}),i=[],n=[],a={},o=new Wt(16755200),s=new Wt(16711680),l=new Wt(43775),u=new Wt(16777215),c=new Wt(3355443);h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",u),h("p","c",c),h("cn1","cn2",c),h("cn3","cn4",c),h("cf1","cf2",c),h("cf3","cf4",c);function h(p,d,g){f(p,g),f(d,g)}function f(p,d){i.push(0,0,0),n.push(d.r,d.g,d.b),a[p]===void 0&&(a[p]=[]),a[p].push(i.length/3-1)}e.addAttribute("position",new Mr(i,3)),e.addAttribute("color",new Mr(n,3)),yi.call(this,e,t),this.camera=r,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=r.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function i_(r,e){e===void 0&&(e=16776960);var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),n=new Vt;n.setIndex(new Mt(t,1)),n.addAttribute("position",new Mt(i,3)),yi.call(this,n,new Fi({color:e})),r!==void 0&&this.update(r)}function Tm(r,e,t,i,n,a){Lt.call(this),i===void 0&&(i=16776960),t===void 0&&(t=1),n===void 0&&(n=.2*t),a===void 0&&(a=.2*n),this.position.copy(e),this.line=new rh(Ose,new Fi({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new _n(zse,new jo({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(r),this.setLength(t,n,a)}function SL(r){r=r||1;var e=[0,0,0,r,0,0,0,0,0,0,r,0,0,0,0,0,0,r],t=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Vt;i.addAttribute("position",new Mr(e,3)),i.addAttribute("color",new Mr(t,3));var n=new Fi({vertexColors:Em});yi.call(this,i,n)}function ML(r,e,t,i,n,a){nh.call(this,r,e,t,t,i,n,a)}function YOe(r,e,t,i,n,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new ws(r,e,t,n,a,o)}function jOe(r){return console.warn("THREE.MeshFaceMaterial has been renamed to THREE.MultiMaterial."),new mb(r)}function KOe(r,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new A0(r,e)}function JOe(r){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new qM(r)}function $Oe(r,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new A0(r,e)}function QOe(r){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new iu(r)}function e3e(r){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new iu(r)}function t3e(r){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new iu(r)}function r3e(r,e,t){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new oe(r,e,t)}function i3e(r,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new Mt(r,e).setDynamic(!0)}function n3e(r,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new VM(r,e)}function a3e(r,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new GM(r,e)}function o3e(r,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new HM(r,e)}function s3e(r,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new WM(r,e)}function l3e(r,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new eh(r,e)}function u3e(r,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new XM(r,e)}function c3e(r,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new th(r,e)}function h3e(r,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Mr(r,e)}function f3e(r,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new YM(r,e)}function Fse(r){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),pV.call(this,r),this.type="catmullrom",this.closed=!0}function p3e(r,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new i_(r,e)}function d3e(r,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new yi(new V0(r.geometry),new Fi({color:e!==void 0?e:16777215}))}function m3e(r,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new yi(new R0(r.geometry),new Fi({color:e!==void 0?e:16777215}))}function v3e(r){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new vl(r)}function _3e(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(r,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),r.project(e)},this.unprojectVector=function(r,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),r.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function x3e(){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(){}}var woe,OIe,Toe,PM,Nk,zIe,Eoe,FIe,BIe,Uk,Aoe,y0,jf,n_,Ok,zk,bL,Fk,Em,IM,a_,Bk,kk,Vk,Gk,Coe,Hk,Roe,Loe,lk,uk,Doe,Poe,Ioe,Noe,Wk,Xk,Uoe,Ooe,zoe,Foe,Boe,koe,Voe,Goe,qR,Hoe,Woe,Xoe,Yoe,wb,qoe,Zoe,XR,Yk,joe,Koe,Joe,wL,TL,ZR,qk,jR,Zk,EL,AL,$oe,Qc,Ms,am,ck,bs,CL,RL,qo,jk,Tb,hk,KR,Qoe,ese,NM,tse,Kk,_0,JR,rse,ise,nse,UM,ase,x0,qu,ose,sse,kIe,tm,S0,fk,pk,dk,mk,vk,gk,yk,_k,lse,use,cse,hse,OM,DM,YR,om,em,zM,Jk,fse,pse,FM,dse,$k,mse,VIe,vse,gse,yse,_se,xse,fr,GIe,Sse,Mse,goe,yoe,ok,Yo,dNe,mNe,vNe,gNe,yNe,_Ne,xNe,SNe,MNe,bNe,wNe,TNe,ENe,ANe,CNe,RNe,LNe,DNe,PNe,INe,NNe,UNe,ONe,zNe,FNe,BNe,kNe,VNe,GNe,HNe,WNe,XNe,YNe,qNe,ZNe,jNe,KNe,JNe,$Ne,QNe,eUe,tUe,rUe,iUe,nUe,aUe,oUe,sUe,lUe,uUe,cUe,hUe,fUe,pUe,dUe,mUe,vUe,gUe,yUe,_Ue,xUe,SUe,MUe,bUe,wUe,TUe,EUe,AUe,CUe,RUe,LUe,DUe,PUe,IUe,NUe,UUe,OUe,zUe,FUe,BUe,kUe,VUe,GUe,HUe,WUe,XUe,YUe,qUe,ZUe,jUe,KUe,JUe,$Ue,QUe,eOe,tOe,rOe,iOe,nOe,aOe,oOe,sOe,lOe,uOe,cOe,hOe,jr,fOe,dr,b0,mOe,vOe,gOe,MOe,Gn,ru,FOe,Mk,Ts,BOe,ca,ah,Ab,oV,WR,uV,Ose,zse,pV,VOe,GOe,HOe,WOe,XOe,qOe,ZOe,g3e,y3e,kse=Kse(()=>{"use strict";Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52));Math.sign===void 0&&(Math.sign=function(r){return r<0?-1:r>0?1:+r});Function.prototype.name===void 0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});Object.assign===void 0&&function(){Object.assign=function(r){"use strict";if(r==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(r),t=1;t<arguments.length;t++){var i=arguments[t];if(i!=null)for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}}();Object.assign(pl.prototype,{addEventListener:function(r,e){this._listeners===void 0&&(this._listeners={});var t=this._listeners;t[r]===void 0&&(t[r]=[]),t[r].indexOf(e)===-1&&t[r].push(e)},hasEventListener:function(r,e){if(this._listeners===void 0)return!1;var t=this._listeners;return t[r]!==void 0&&t[r].indexOf(e)!==-1},removeEventListener:function(r,e){if(this._listeners!==void 0){var t=this._listeners,i=t[r];if(i!==void 0){var n=i.indexOf(e);n!==-1&&i.splice(n,1)}}},dispatchEvent:function(r){if(this._listeners!==void 0){var e=this._listeners,t=e[r.type];if(t!==void 0){r.target=this;var i=[],n=0,a=t.length;for(n=0;n<a;n++)i[n]=t[n];for(n=0;n<a;n++)i[n].call(this,r)}}}});woe="83",OIe={LEFT:0,MIDDLE:1,RIGHT:2},Toe=0,PM=1,Nk=2,zIe=3,Eoe=0,FIe=1,BIe=0,Uk=1,Aoe=2,y0=0,jf=1,n_=2,Ok=1,zk=2,bL=0,Fk=1,Em=2,IM=0,a_=1,Bk=2,kk=3,Vk=4,Gk=5,Coe={NoBlending:IM,NormalBlending:a_,AdditiveBlending:Bk,SubtractiveBlending:kk,MultiplyBlending:Vk,CustomBlending:Gk},Hk=100,Roe=101,Loe=102,lk=103,uk=104,Doe=200,Poe=201,Ioe=202,Noe=203,Wk=204,Xk=205,Uoe=206,Ooe=207,zoe=208,Foe=209,Boe=210,koe=0,Voe=1,Goe=2,qR=3,Hoe=4,Woe=5,Xoe=6,Yoe=7,wb=0,qoe=1,Zoe=2,XR=0,Yk=1,joe=2,Koe=3,Joe=4,wL=300,TL=301,ZR=302,qk=303,jR=304,Zk=305,EL=306,AL=307,$oe={UVMapping:wL,CubeReflectionMapping:TL,CubeRefractionMapping:ZR,EquirectangularReflectionMapping:qk,EquirectangularRefractionMapping:jR,SphericalReflectionMapping:Zk,CubeUVReflectionMapping:EL,CubeUVRefractionMapping:AL},Qc=1e3,Ms=1001,am=1002,ck={RepeatWrapping:Qc,ClampToEdgeWrapping:Ms,MirroredRepeatWrapping:am},bs=1003,CL=1004,RL=1005,qo=1006,jk=1007,Tb=1008,hk={NearestFilter:bs,NearestMipMapNearestFilter:CL,NearestMipMapLinearFilter:RL,LinearFilter:qo,LinearMipMapNearestFilter:jk,LinearMipMapLinearFilter:Tb},KR=1009,Qoe=1010,ese=1011,NM=1012,tse=1013,Kk=1014,_0=1015,JR=1016,rse=1017,ise=1018,nse=1019,UM=1020,ase=1021,x0=1022,qu=1023,ose=1024,sse=1025,kIe=qu,tm=1026,S0=1027,fk=2001,pk=2002,dk=2003,mk=2004,vk=2100,gk=2101,yk=2102,_k=2103,lse=2151,use=2200,cse=2201,hse=2202,OM=2300,DM=2301,YR=2302,om=2400,em=2401,zM=2402,Jk=0,fse=1,pse=2,FM=3e3,dse=3001,$k=3007,mse=3002,VIe=3003,vse=3004,gse=3005,yse=3006,_se=3200,xse=3201,fr={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i;return function(){for(var a=0;a<36;a++)a===8||a===13||a===18||a===23?e[a]="-":a===14?e[a]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[a]=r[a===19?i&3|8:i]);return e.join("")}}(),clamp:function(r,e,t){return Math.max(e,Math.min(t,r))},euclideanModulo:function(r,e){return(r%e+e)%e},mapLinear:function(r,e,t,i,n){return i+(r-e)*(n-i)/(t-e)},lerp:function(r,e,t){return(1-t)*r+t*e},smoothstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))},smootherstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))},randInt:function(r,e){return r+Math.floor(Math.random()*(e-r+1))},randFloat:function(r,e){return r+Math.random()*(e-r)},randFloatSpread:function(r){return r*(.5-Math.random())},degToRad:function(r){return r*fr.DEG2RAD},radToDeg:function(r){return r*fr.RAD2DEG},isPowerOfTwo:function(r){return(r&r-1)===0&&r!==0},nearestPowerOfTwo:function(r){return Math.pow(2,Math.round(Math.log(r)/Math.LN2))},nextPowerOfTwo:function(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}};Tt.prototype={constructor:Tt,isVector2:!0,get width(){return this.x},set width(r){this.x=r},get height(){return this.y},set height(r){this.y=r},set:function(r,e){return this.x=r,this.y=e,this},setScalar:function(r){return this.x=r,this.y=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(r){return this.x=r.x,this.y=r.y,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this)},addScalar:function(r){return this.x+=r,this.y+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this)},subScalar:function(r){return this.x-=r,this.y-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this},multiply:function(r){return this.x*=r.x,this.y*=r.y,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r):(this.x=0,this.y=0),this},divide:function(r){return this.x/=r.x,this.y/=r.y,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new Tt,e=new Tt),r.set(i,i),e.set(n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},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(r){return this.x*r.x+this.y*r.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())},angle:function(){var r=Math.atan2(this.y,this.x);return r<0&&(r+=2*Math.PI),r},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y;return e*e+t*t},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},equals:function(r){return r.x===this.x&&r.y===this.y},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this},rotateAround:function(r,e){var t=Math.cos(e),i=Math.sin(e),n=this.x-r.x,a=this.y-r.y;return this.x=n*t-a*i+r.x,this.y=n*i+a*t+r.y,this}};GIe=0;ci.DEFAULT_IMAGE=void 0;ci.DEFAULT_MAPPING=wL;ci.prototype={constructor:ci,isTexture:!0,set needsUpdate(r){r===!0&&this.version++},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.image=r.image,this.mipmaps=r.mipmaps.slice(0),this.mapping=r.mapping,this.wrapS=r.wrapS,this.wrapT=r.wrapT,this.magFilter=r.magFilter,this.minFilter=r.minFilter,this.anisotropy=r.anisotropy,this.format=r.format,this.type=r.type,this.offset.copy(r.offset),this.repeat.copy(r.repeat),this.generateMipmaps=r.generateMipmaps,this.premultiplyAlpha=r.premultiplyAlpha,this.flipY=r.flipY,this.unpackAlignment=r.unpackAlignment,this.encoding=r.encoding,this},toJSON:function(r){if(r.textures[this.uuid]!==void 0)return r.textures[this.uuid];function e(n){var a;return n.toDataURL!==void 0?a=n:(a=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),a.width=n.width,a.height=n.height,a.getContext("2d").drawImage(n,0,0,n.width,n.height)),a.width>2048||a.height>2048?a.toDataURL("image/jpeg",.6):a.toDataURL("image/png")}var t={metadata:{version:4.4,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(this.image!==void 0){var i=this.image;i.uuid===void 0&&(i.uuid=fr.generateUUID()),r.images[i.uuid]===void 0&&(r.images[i.uuid]={uuid:i.uuid,url:e(i)}),t.image=i.uuid}return r.textures[this.uuid]=t,t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(r){if(this.mapping===wL){if(r.multiply(this.repeat),r.add(this.offset),r.x<0||r.x>1)switch(this.wrapS){case Qc:r.x=r.x-Math.floor(r.x);break;case Ms:r.x=r.x<0?0:1;break;case am:Math.abs(Math.floor(r.x)%2)===1?r.x=Math.ceil(r.x)-r.x:r.x=r.x-Math.floor(r.x);break}if(r.y<0||r.y>1)switch(this.wrapT){case Qc:r.y=r.y-Math.floor(r.y);break;case Ms:r.y=r.y<0?0:1;break;case am:Math.abs(Math.floor(r.y)%2)===1?r.y=Math.ceil(r.y)-r.y:r.y=r.y-Math.floor(r.y);break}this.flipY&&(r.y=1-r.y)}}};Object.assign(ci.prototype,pl.prototype);ii.prototype={constructor:ii,isVector4:!0,set:function(r,e,t,i){return this.x=r,this.y=e,this.z=t,this.w=i,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this.w=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setW:function(r){return this.w=r,this},setComponent:function(r,e){switch(r){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: "+r)}return this},getComponent:function(r){switch(r){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: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this.w=r.w!==void 0?r.w:1,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this.w+=r.w,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this.w+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this.w=r.w+e.w,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this.w+=r.w*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this.w-=r.w,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this.w-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this.w=r.w-e.w,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r,this.w*=r):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=this.w,a=r.elements;return this.x=a[0]*e+a[4]*t+a[8]*i+a[12]*n,this.y=a[1]*e+a[5]*t+a[9]*i+a[13]*n,this.z=a[2]*e+a[6]*t+a[10]*i+a[14]*n,this.w=a[3]*e+a[7]*t+a[11]*i+a[15]*n,this},divideScalar:function(r){return this.multiplyScalar(1/r)},setAxisAngleFromQuaternion:function(r){this.w=2*Math.acos(r.w);var e=Math.sqrt(1-r.w*r.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=r.x/e,this.y=r.y/e,this.z=r.z/e),this},setAxisAngleFromRotationMatrix:function(r){var e,t,i,n,a=.01,o=.1,s=r.elements,l=s[0],u=s[4],c=s[8],h=s[1],f=s[5],p=s[9],d=s[2],g=s[6],m=s[10];if(Math.abs(u-h)<a&&Math.abs(c-d)<a&&Math.abs(p-g)<a){if(Math.abs(u+h)<o&&Math.abs(c+d)<o&&Math.abs(p+g)<o&&Math.abs(l+f+m-3)<o)return this.set(1,0,0,0),this;e=Math.PI;var v=(l+1)/2,_=(f+1)/2,y=(m+1)/2,x=(u+h)/4,M=(c+d)/4,S=(p+g)/4;return v>_&&v>y?v<a?(t=0,i=.707106781,n=.707106781):(t=Math.sqrt(v),i=x/t,n=M/t):_>y?_<a?(t=.707106781,i=0,n=.707106781):(i=Math.sqrt(_),t=x/i,n=S/i):y<a?(t=.707106781,i=.707106781,n=0):(n=Math.sqrt(y),t=M/n,i=S/n),this.set(t,i,n,e),this}var w=Math.sqrt((g-p)*(g-p)+(c-d)*(c-d)+(h-u)*(h-u));return Math.abs(w)<.001&&(w=1),this.x=(g-p)/w,this.y=(c-d)/w,this.z=(h-u)/w,this.w=Math.acos((l+f+m-1)/2),this},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this.z=Math.min(this.z,r.z),this.w=Math.min(this.w,r.w),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this.z=Math.max(this.z,r.z),this.w=Math.max(this.w,r.w),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this.z=Math.max(r.z,Math.min(e.z,this.z)),this.w=Math.max(r.w,Math.min(e.w,this.w)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new ii,e=new ii),r.set(i,i,i,i),e.set(n,n,n,n),this.clamp(r,e)}}(),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(r){return this.x*r.x+this.y*r.y+this.z*r.z+this.w*r.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())},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this.z+=(r.z-this.z)*e,this.w+=(r.w-this.w)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},equals:function(r){return r.x===this.x&&r.y===this.y&&r.z===this.z&&r.w===this.w},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this.z=r[e+2],this.w=r[e+3],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r[e+2]=this.z,r[e+3]=this.w,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this.z=r.getZ(e),this.w=r.getW(e),this}};Object.assign(o_.prototype,pl.prototype,{isWebGLRenderTarget:!0,setSize:function(r,e){(this.width!==r||this.height!==e)&&(this.width=r,this.height=e,this.dispose()),this.viewport.set(0,0,r,e),this.scissor.set(0,0,r,e)},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.width=r.width,this.height=r.height,this.viewport.copy(r.viewport),this.texture=r.texture.clone(),this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});M0.prototype=Object.create(o_.prototype);M0.prototype.constructor=M0;M0.prototype.isWebGLRenderTargetCube=!0;cn.prototype={constructor:cn,get x(){return this._x},set x(r){this._x=r,this.onChangeCallback()},get y(){return this._y},set y(r){this._y=r,this.onChangeCallback()},get z(){return this._z},set z(r){this._z=r,this.onChangeCallback()},get w(){return this._w},set w(r){this._w=r,this.onChangeCallback()},set:function(r,e,t,i){return this._x=r,this._y=e,this._z=t,this._w=i,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(r){return this._x=r.x,this._y=r.y,this._z=r.z,this._w=r.w,this.onChangeCallback(),this},setFromEuler:function(r,e){if((r&&r.isEuler)===!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var t=Math.cos(r._x/2),i=Math.cos(r._y/2),n=Math.cos(r._z/2),a=Math.sin(r._x/2),o=Math.sin(r._y/2),s=Math.sin(r._z/2),l=r.order;return l==="XYZ"?(this._x=a*i*n+t*o*s,this._y=t*o*n-a*i*s,this._z=t*i*s+a*o*n,this._w=t*i*n-a*o*s):l==="YXZ"?(this._x=a*i*n+t*o*s,this._y=t*o*n-a*i*s,this._z=t*i*s-a*o*n,this._w=t*i*n+a*o*s):l==="ZXY"?(this._x=a*i*n-t*o*s,this._y=t*o*n+a*i*s,this._z=t*i*s+a*o*n,this._w=t*i*n-a*o*s):l==="ZYX"?(this._x=a*i*n-t*o*s,this._y=t*o*n+a*i*s,this._z=t*i*s-a*o*n,this._w=t*i*n+a*o*s):l==="YZX"?(this._x=a*i*n+t*o*s,this._y=t*o*n+a*i*s,this._z=t*i*s-a*o*n,this._w=t*i*n-a*o*s):l==="XZY"&&(this._x=a*i*n-t*o*s,this._y=t*o*n-a*i*s,this._z=t*i*s+a*o*n,this._w=t*i*n+a*o*s),e!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(r,e){var t=e/2,i=Math.sin(t);return this._x=r.x*i,this._y=r.y*i,this._z=r.z*i,this._w=Math.cos(t),this.onChangeCallback(),this},setFromRotationMatrix:function(r){var e=r.elements,t=e[0],i=e[4],n=e[8],a=e[1],o=e[5],s=e[9],l=e[2],u=e[6],c=e[10],h=t+o+c,f;return h>0?(f=.5/Math.sqrt(h+1),this._w=.25/f,this._x=(u-s)*f,this._y=(n-l)*f,this._z=(a-i)*f):t>o&&t>c?(f=2*Math.sqrt(1+t-o-c),this._w=(u-s)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(n+l)/f):o>c?(f=2*Math.sqrt(1+o-t-c),this._w=(n-l)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(s+u)/f):(f=2*Math.sqrt(1+c-t-o),this._w=(a-i)/f,this._x=(n+l)/f,this._y=(s+u)/f,this._z=.25*f),this.onChangeCallback(),this},setFromUnitVectors:function(){var r,e,t=1e-6;return function(n,a){return r===void 0&&(r=new oe),e=n.dot(a)+1,e<t?(e=0,Math.abs(n.x)>Math.abs(n.z)?r.set(-n.y,n.x,0):r.set(0,-n.z,n.y)):r.crossVectors(n,a),this._x=r.x,this._y=r.y,this._z=r.z,this._w=e,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(r){return this._x*r._x+this._y*r._y+this._z*r._z+this._w*r._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 r=this.length();return r===0?(this._x=0,this._y=0,this._z=0,this._w=1):(r=1/r,this._x=this._x*r,this._y=this._y*r,this._z=this._z*r,this._w=this._w*r),this.onChangeCallback(),this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(r,e)):this.multiplyQuaternions(this,r)},premultiply:function(r){return this.multiplyQuaternions(r,this)},multiplyQuaternions:function(r,e){var t=r._x,i=r._y,n=r._z,a=r._w,o=e._x,s=e._y,l=e._z,u=e._w;return this._x=t*u+a*o+i*l-n*s,this._y=i*u+a*s+n*o-t*l,this._z=n*u+a*l+t*s-i*o,this._w=a*u-t*o-i*s-n*l,this.onChangeCallback(),this},slerp:function(r,e){if(e===0)return this;if(e===1)return this.copy(r);var t=this._x,i=this._y,n=this._z,a=this._w,o=a*r._w+t*r._x+i*r._y+n*r._z;if(o<0?(this._w=-r._w,this._x=-r._x,this._y=-r._y,this._z=-r._z,o=-o):this.copy(r),o>=1)return this._w=a,this._x=t,this._y=i,this._z=n,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(t+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z),this;var l=Math.atan2(s,o),u=Math.sin((1-e)*l)/s,c=Math.sin(e*l)/s;return this._w=a*u+this._w*c,this._x=t*u+this._x*c,this._y=i*u+this._y*c,this._z=n*u+this._z*c,this.onChangeCallback(),this},equals:function(r){return r._x===this._x&&r._y===this._y&&r._z===this._z&&r._w===this._w},fromArray:function(r,e){return e===void 0&&(e=0),this._x=r[e],this._y=r[e+1],this._z=r[e+2],this._w=r[e+3],this.onChangeCallback(),this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this._x,r[e+1]=this._y,r[e+2]=this._z,r[e+3]=this._w,r},onChange:function(r){return this.onChangeCallback=r,this},onChangeCallback:function(){}};Object.assign(cn,{slerp:function(r,e,t,i){return t.copy(r).slerp(e,i)},slerpFlat:function(r,e,t,i,n,a,o){var s=t[i+0],l=t[i+1],u=t[i+2],c=t[i+3],h=n[a+0],f=n[a+1],p=n[a+2],d=n[a+3];if(c!==d||s!==h||l!==f||u!==p){var g=1-o,m=s*h+l*f+u*p+c*d,v=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){var y=Math.sqrt(_),x=Math.atan2(y,m*v);g=Math.sin(g*x)/y,o=Math.sin(o*x)/y}var M=o*v;if(s=s*g+h*M,l=l*g+f*M,u=u*g+p*M,c=c*g+d*M,g===1-o){var S=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=S,l*=S,u*=S,c*=S}}r[e]=s,r[e+1]=l,r[e+2]=u,r[e+3]=c}});oe.prototype={constructor:oe,isVector3:!0,set:function(r,e,t){return this.x=r,this.y=e,this.z=t,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setComponent:function(r,e){switch(r){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: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(r,e)):(this.x*=r.x,this.y*=r.y,this.z*=r.z,this)},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(r,e){return this.x=r.x*e.x,this.y=r.y*e.y,this.z=r.z*e.z,this},applyEuler:function(){var r;return function(t){return(t&&t.isEuler)===!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),r===void 0&&(r=new cn),this.applyQuaternion(r.setFromEuler(t))}}(),applyAxisAngle:function(){var r;return function(t,i){return r===void 0&&(r=new cn),this.applyQuaternion(r.setFromAxisAngle(t,i))}}(),applyMatrix3:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[3]*t+n[6]*i,this.y=n[1]*e+n[4]*t+n[7]*i,this.z=n[2]*e+n[5]*t+n[8]*i,this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i+n[12],this.y=n[1]*e+n[5]*t+n[9]*i+n[13],this.z=n[2]*e+n[6]*t+n[10]*i+n[14],this},applyProjection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements,a=1/(n[3]*e+n[7]*t+n[11]*i+n[15]);return this.x=(n[0]*e+n[4]*t+n[8]*i+n[12])*a,this.y=(n[1]*e+n[5]*t+n[9]*i+n[13])*a,this.z=(n[2]*e+n[6]*t+n[10]*i+n[14])*a,this},applyQuaternion:function(r){var e=this.x,t=this.y,i=this.z,n=r.x,a=r.y,o=r.z,s=r.w,l=s*e+a*i-o*t,u=s*t+o*e-n*i,c=s*i+n*t-a*e,h=-n*e-a*t-o*i;return this.x=l*s+h*-n+u*-o-c*-a,this.y=u*s+h*-a+c*-n-l*-o,this.z=c*s+h*-o+l*-a-u*-n,this},project:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.multiplyMatrices(t.projectionMatrix,r.getInverse(t.matrixWorld)),this.applyProjection(r)}}(),unproject:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.multiplyMatrices(t.matrixWorld,r.getInverse(t.projectionMatrix)),this.applyProjection(r)}}(),transformDirection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i,this.y=n[1]*e+n[5]*t+n[9]*i,this.z=n[2]*e+n[6]*t+n[10]*i,this.normalize()},divide:function(r){return this.x/=r.x,this.y/=r.y,this.z/=r.z,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this.z=Math.min(this.z,r.z),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this.z=Math.max(this.z,r.z),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this.z=Math.max(r.z,Math.min(e.z,this.z)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new oe,e=new oe),r.set(i,i,i),e.set(n,n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},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(r){return this.x*r.x+this.y*r.y+this.z*r.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())},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this.z+=(r.z-this.z)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},cross:function(r,e){if(e!==void 0)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(r,e);var t=this.x,i=this.y,n=this.z;return this.x=i*r.z-n*r.y,this.y=n*r.x-t*r.z,this.z=t*r.y-i*r.x,this},crossVectors:function(r,e){var t=r.x,i=r.y,n=r.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-n*o,this.y=n*a-t*s,this.z=t*o-i*a,this},projectOnVector:function(r){var e=r.dot(this)/r.lengthSq();return this.copy(r).multiplyScalar(e)},projectOnPlane:function(){var r;return function(t){return r===void 0&&(r=new oe),r.copy(this).projectOnVector(t),this.sub(r)}}(),reflect:function(){var r;return function(t){return r===void 0&&(r=new oe),this.sub(r.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(r){var e=this.dot(r)/Math.sqrt(this.lengthSq()*r.lengthSq());return Math.acos(fr.clamp(e,-1,1))},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y,i=this.z-r.z;return e*e+t*t+i*i},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)+Math.abs(this.z-r.z)},setFromSpherical:function(r){var e=Math.sin(r.phi)*r.radius;return this.x=e*Math.sin(r.theta),this.y=Math.cos(r.phi)*r.radius,this.z=e*Math.cos(r.theta),this},setFromCylindrical:function(r){return this.x=r.radius*Math.sin(r.theta),this.y=r.y,this.z=r.radius*Math.cos(r.theta),this},setFromMatrixPosition:function(r){return this.setFromMatrixColumn(r,3)},setFromMatrixScale:function(r){var e=this.setFromMatrixColumn(r,0).length(),t=this.setFromMatrixColumn(r,1).length(),i=this.setFromMatrixColumn(r,2).length();return this.x=e,this.y=t,this.z=i,this},setFromMatrixColumn:function(r,e){if(typeof r=="number"){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var t=r;r=e,e=t}return this.fromArray(r.elements,e*4)},equals:function(r){return r.x===this.x&&r.y===this.y&&r.z===this.z},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this.z=r[e+2],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r[e+2]=this.z,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this.z=r.getZ(e),this}};Kt.prototype={constructor:Kt,isMatrix4:!0,set:function(r,e,t,i,n,a,o,s,l,u,c,h,f,p,d,g){var m=this.elements;return m[0]=r,m[4]=e,m[8]=t,m[12]=i,m[1]=n,m[5]=a,m[9]=o,m[13]=s,m[2]=l,m[6]=u,m[10]=c,m[14]=h,m[3]=f,m[7]=p,m[11]=d,m[15]=g,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return new Kt().fromArray(this.elements)},copy:function(r){return this.elements.set(r.elements),this},copyPosition:function(r){var e=this.elements,t=r.elements;return e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(r,e,t){return r.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),t.setFromMatrixColumn(this,2),this},makeBasis:function(r,e,t){return this.set(r.x,e.x,t.x,0,r.y,e.y,t.y,0,r.z,e.z,t.z,0,0,0,0,1),this},extractRotation:function(){var r;return function(t){r===void 0&&(r=new oe);var i=this.elements,n=t.elements,a=1/r.setFromMatrixColumn(t,0).length(),o=1/r.setFromMatrixColumn(t,1).length(),s=1/r.setFromMatrixColumn(t,2).length();return i[0]=n[0]*a,i[1]=n[1]*a,i[2]=n[2]*a,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[8]=n[8]*s,i[9]=n[9]*s,i[10]=n[10]*s,this}}(),makeRotationFromEuler:function(r){(r&&r.isEuler)===!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,t=r.x,i=r.y,n=r.z,a=Math.cos(t),o=Math.sin(t),s=Math.cos(i),l=Math.sin(i),u=Math.cos(n),c=Math.sin(n);if(r.order==="XYZ"){var h=a*u,f=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=-s*c,e[8]=l,e[1]=f+p*l,e[5]=h-d*l,e[9]=-o*s,e[2]=d-h*l,e[6]=p+f*l,e[10]=a*s}else if(r.order==="YXZ"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g+_*o,e[4]=v*o-m,e[8]=a*l,e[1]=a*c,e[5]=a*u,e[9]=-o,e[2]=m*o-v,e[6]=_+g*o,e[10]=a*s}else if(r.order==="ZXY"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g-_*o,e[4]=-a*c,e[8]=v+m*o,e[1]=m+v*o,e[5]=a*u,e[9]=_-g*o,e[2]=-a*l,e[6]=o,e[10]=a*s}else if(r.order==="ZYX"){var h=a*u,f=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=p*l-f,e[8]=h*l+d,e[1]=s*c,e[5]=d*l+h,e[9]=f*l-p,e[2]=-l,e[6]=o*s,e[10]=a*s}else if(r.order==="YZX"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=S-y*c,e[8]=M*c+x,e[1]=c,e[5]=a*u,e[9]=-o*u,e[2]=-l*u,e[6]=x*c+M,e[10]=y-S*c}else if(r.order==="XZY"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=-c,e[8]=l*u,e[1]=y*c+S,e[5]=a*u,e[9]=x*c-M,e[2]=M*c-x,e[6]=o*u,e[10]=S*c+y}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(r){var e=this.elements,t=r.x,i=r.y,n=r.z,a=r.w,o=t+t,s=i+i,l=n+n,u=t*o,c=t*s,h=t*l,f=i*s,p=i*l,d=n*l,g=a*o,m=a*s,v=a*l;return e[0]=1-(f+d),e[4]=c-v,e[8]=h+m,e[1]=c+v,e[5]=1-(u+d),e[9]=p-g,e[2]=h-m,e[6]=p+g,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:function(){var r,e,t;return function(n,a,o){r===void 0&&(r=new oe,e=new oe,t=new oe);var s=this.elements;return t.subVectors(n,a).normalize(),t.lengthSq()===0&&(t.z=1),r.crossVectors(o,t).normalize(),r.lengthSq()===0&&(t.z+=1e-4,r.crossVectors(o,t).normalize()),e.crossVectors(t,r),s[0]=r.x,s[4]=e.x,s[8]=t.x,s[1]=r.y,s[5]=e.y,s[9]=t.y,s[2]=r.z,s[6]=e.z,s[10]=t.z,this}}(),multiply:function(r,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(r,e)):this.multiplyMatrices(this,r)},premultiply:function(r){return this.multiplyMatrices(r,this)},multiplyMatrices:function(r,e){var t=r.elements,i=e.elements,n=this.elements,a=t[0],o=t[4],s=t[8],l=t[12],u=t[1],c=t[5],h=t[9],f=t[13],p=t[2],d=t[6],g=t[10],m=t[14],v=t[3],_=t[7],y=t[11],x=t[15],M=i[0],S=i[4],w=i[8],T=i[12],C=i[1],b=i[5],E=i[9],I=i[13],R=i[2],A=i[6],P=i[10],U=i[14],B=i[3],z=i[7],k=i[11],G=i[15];return n[0]=a*M+o*C+s*R+l*B,n[4]=a*S+o*b+s*A+l*z,n[8]=a*w+o*E+s*P+l*k,n[12]=a*T+o*I+s*U+l*G,n[1]=u*M+c*C+h*R+f*B,n[5]=u*S+c*b+h*A+f*z,n[9]=u*w+c*E+h*P+f*k,n[13]=u*T+c*I+h*U+f*G,n[2]=p*M+d*C+g*R+m*B,n[6]=p*S+d*b+g*A+m*z,n[10]=p*w+d*E+g*P+m*k,n[14]=p*T+d*I+g*U+m*G,n[3]=v*M+_*C+y*R+x*B,n[7]=v*S+_*b+y*A+x*z,n[11]=v*w+_*E+y*P+x*k,n[15]=v*T+_*I+y*U+x*G,this},multiplyToArray:function(r,e,t){var i=this.elements;return this.multiplyMatrices(r,e),t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},multiplyScalar:function(r){var e=this.elements;return e[0]*=r,e[4]*=r,e[8]*=r,e[12]*=r,e[1]*=r,e[5]*=r,e[9]*=r,e[13]*=r,e[2]*=r,e[6]*=r,e[10]*=r,e[14]*=r,e[3]*=r,e[7]*=r,e[11]*=r,e[15]*=r,this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a<n;a+=3,o+=3)r.fromArray(t,o),r.applyMatrix4(this),r.toArray(t,o);return t}}(),applyToBufferAttribute:function(){var r;return function(t){r===void 0&&(r=new oe);for(var i=0,n=t.count;i<n;i++)r.x=t.getX(i),r.y=t.getY(i),r.z=t.getZ(i),r.applyMatrix4(this),t.setXYZ(i,r.x,r.y,r.z);return t}}(),determinant:function(){var r=this.elements,e=r[0],t=r[4],i=r[8],n=r[12],a=r[1],o=r[5],s=r[9],l=r[13],u=r[2],c=r[6],h=r[10],f=r[14],p=r[3],d=r[7],g=r[11],m=r[15];return p*(+n*s*c-i*l*c-n*o*h+t*l*h+i*o*f-t*s*f)+d*(+e*s*f-e*l*h+n*a*h-i*a*f+i*l*u-n*s*u)+g*(+e*l*c-e*o*f-n*a*c+t*a*f+n*o*u-t*l*u)+m*(-i*o*u-e*s*c+e*o*h+i*a*c-t*a*h+t*s*u)},transpose:function(){var r=this.elements,e;return e=r[1],r[1]=r[4],r[4]=e,e=r[2],r[2]=r[8],r[8]=e,e=r[6],r[6]=r[9],r[9]=e,e=r[3],r[3]=r[12],r[12]=e,e=r[7],r[7]=r[13],r[13]=e,e=r[11],r[11]=r[14],r[14]=e,this},setPosition:function(r){var e=this.elements;return e[12]=r.x,e[13]=r.y,e[14]=r.z,this},getInverse:function(r,e){var t=this.elements,i=r.elements,n=i[0],a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],c=i[6],h=i[7],f=i[8],p=i[9],d=i[10],g=i[11],m=i[12],v=i[13],_=i[14],y=i[15],x=p*_*h-v*d*h+v*c*g-u*_*g-p*c*y+u*d*y,M=m*d*h-f*_*h-m*c*g+l*_*g+f*c*y-l*d*y,S=f*v*h-m*p*h+m*u*g-l*v*g-f*u*y+l*p*y,w=m*p*c-f*v*c-m*u*d+l*v*d+f*u*_-l*p*_,T=n*x+a*M+o*S+s*w;if(T===0){var C="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(e===!0)throw new Error(C);return console.warn(C),this.identity()}var b=1/T;return t[0]=x*b,t[1]=(v*d*s-p*_*s-v*o*g+a*_*g+p*o*y-a*d*y)*b,t[2]=(u*_*s-v*c*s+v*o*h-a*_*h-u*o*y+a*c*y)*b,t[3]=(p*c*s-u*d*s-p*o*h+a*d*h+u*o*g-a*c*g)*b,t[4]=M*b,t[5]=(f*_*s-m*d*s+m*o*g-n*_*g-f*o*y+n*d*y)*b,t[6]=(m*c*s-l*_*s-m*o*h+n*_*h+l*o*y-n*c*y)*b,t[7]=(l*d*s-f*c*s+f*o*h-n*d*h-l*o*g+n*c*g)*b,t[8]=S*b,t[9]=(m*p*s-f*v*s-m*a*g+n*v*g+f*a*y-n*p*y)*b,t[10]=(l*v*s-m*u*s+m*a*h-n*v*h-l*a*y+n*u*y)*b,t[11]=(f*u*s-l*p*s-f*a*h+n*p*h+l*a*g-n*u*g)*b,t[12]=w*b,t[13]=(f*v*o-m*p*o+m*a*d-n*v*d-f*a*_+n*p*_)*b,t[14]=(m*u*o-l*v*o-m*a*c+n*v*c+l*a*_-n*u*_)*b,t[15]=(l*p*o-f*u*o+f*a*c-n*p*c-l*a*d+n*u*d)*b,this},scale:function(r){var e=this.elements,t=r.x,i=r.y,n=r.z;return e[0]*=t,e[4]*=i,e[8]*=n,e[1]*=t,e[5]*=i,e[9]*=n,e[2]*=t,e[6]*=i,e[10]*=n,e[3]*=t,e[7]*=i,e[11]*=n,this},getMaxScaleOnAxis:function(){var r=this.elements,e=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],t=r[4]*r[4]+r[5]*r[5]+r[6]*r[6],i=r[8]*r[8]+r[9]*r[9]+r[10]*r[10];return Math.sqrt(Math.max(e,t,i))},makeTranslation:function(r,e,t){return this.set(1,0,0,r,0,1,0,e,0,0,1,t,0,0,0,1),this},makeRotationX:function(r){var e=Math.cos(r),t=Math.sin(r);return this.set(1,0,0,0,0,e,-t,0,0,t,e,0,0,0,0,1),this},makeRotationY:function(r){var e=Math.cos(r),t=Math.sin(r);return this.set(e,0,t,0,0,1,0,0,-t,0,e,0,0,0,0,1),this},makeRotationZ:function(r){var e=Math.cos(r),t=Math.sin(r);return this.set(e,-t,0,0,t,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(r,e){var t=Math.cos(e),i=Math.sin(e),n=1-t,a=r.x,o=r.y,s=r.z,l=n*a,u=n*o;return this.set(l*a+t,l*o-i*s,l*s+i*o,0,l*o+i*s,u*o+t,u*s-i*a,0,l*s-i*o,u*s+i*a,n*s*s+t,0,0,0,0,1),this},makeScale:function(r,e,t){return this.set(r,0,0,0,0,e,0,0,0,0,t,0,0,0,0,1),this},makeShear:function(r,e,t){return this.set(1,e,t,0,r,1,t,0,r,e,1,0,0,0,0,1),this},compose:function(r,e,t){return this.makeRotationFromQuaternion(e),this.scale(t),this.setPosition(r),this},decompose:function(){var r,e;return function(i,n,a){r===void 0&&(r=new oe,e=new Kt);var o=this.elements,s=r.set(o[0],o[1],o[2]).length(),l=r.set(o[4],o[5],o[6]).length(),u=r.set(o[8],o[9],o[10]).length(),c=this.determinant();c<0&&(s=-s),i.x=o[12],i.y=o[13],i.z=o[14],e.elements.set(this.elements);var h=1/s,f=1/l,p=1/u;return e.elements[0]*=h,e.elements[1]*=h,e.elements[2]*=h,e.elements[4]*=f,e.elements[5]*=f,e.elements[6]*=f,e.elements[8]*=p,e.elements[9]*=p,e.elements[10]*=p,n.setFromRotationMatrix(e),a.x=s,a.y=l,a.z=u,this}}(),makeFrustum:function(r,e,t,i,n,a){var o=this.elements,s=2*n/(e-r),l=2*n/(i-t),u=(e+r)/(e-r),c=(i+t)/(i-t),h=-(a+n)/(a-n),f=-2*a*n/(a-n);return o[0]=s,o[4]=0,o[8]=u,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=f,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makePerspective:function(r,e,t,i){var n=t*Math.tan(fr.DEG2RAD*r*.5),a=-n,o=a*e,s=n*e;return this.makeFrustum(o,s,a,n,t,i)},makeOrthographic:function(r,e,t,i,n,a){var o=this.elements,s=1/(e-r),l=1/(t-i),u=1/(a-n),c=(e+r)*s,h=(t+i)*l,f=(a+n)*u;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*u,o[14]=-f,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(r){for(var e=this.elements,t=r.elements,i=0;i<16;i++)if(e[i]!==t[i])return!1;return!0},fromArray:function(r,e){e===void 0&&(e=0);for(var t=0;t<16;t++)this.elements[t]=r[t+e];return this},toArray:function(r,e){r===void 0&&(r=[]),e===void 0&&(e=0);var t=this.elements;return r[e]=t[0],r[e+1]=t[1],r[e+2]=t[2],r[e+3]=t[3],r[e+4]=t[4],r[e+5]=t[5],r[e+6]=t[6],r[e+7]=t[7],r[e+8]=t[8],r[e+9]=t[9],r[e+10]=t[10],r[e+11]=t[11],r[e+12]=t[12],r[e+13]=t[13],r[e+14]=t[14],r[e+15]=t[15],r}};Kf.prototype=Object.create(ci.prototype);Kf.prototype.constructor=Kf;Kf.prototype.isCubeTexture=!0;Object.defineProperty(Kf.prototype,"images",{get:function(){return this.image},set:function(r){this.image=r}});Sse=new ci,Mse=new Kf;goe=[],yoe=[];Cse.prototype.setValue=function(r,e){for(var t=this.seq,i=0,n=t.length;i!==n;++i){var a=t[i];a.setValue(r,e[a.id])}};ok=/([\w\d_]+)(\])?(\[|\.)?/g;Jf.prototype.setValue=function(r,e,t){var i=this.map[e];i!==void 0&&i.setValue(r,t,this.renderer)};Jf.prototype.set=function(r,e,t){var i=this.map[t];i!==void 0&&i.setValue(r,e[t],this.renderer)};Jf.prototype.setOptional=function(r,e,t){var i=e[t];i!==void 0&&this.setValue(r,t,i)};Jf.upload=function(r,e,t,i){for(var n=0,a=e.length;n!==a;++n){var o=e[n],s=t[o.id];s.needsUpdate!==!1&&o.setValue(r,s.value,i)}};Jf.seqWithValue=function(r,e){for(var t=[],i=0,n=r.length;i!==n;++i){var a=r[i];a.id in e&&t.push(a)}return t};Yo={merge:function(r){for(var e={},t=0;t<r.length;t++){var i=this.clone(r[t]);for(var n in i)e[n]=i[n]}return e},clone:function(r){var e={};for(var t in r){e[t]={};for(var i in r[t]){var n=r[t][i];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture)?e[t][i]=n.clone():Array.isArray(n)?e[t][i]=n.slice():e[t][i]=n}}return e}},dNe=`#ifdef USE_ALPHAMAP
  23. diffuseColor.a *= texture2D( alphaMap, vUv ).g;
  24. #endif
  25. `,mNe=`#ifdef USE_ALPHAMAP
  26. uniform sampler2D alphaMap;
  27. #endif
  28. `,vNe=`#ifdef ALPHATEST
  29. if ( diffuseColor.a < ALPHATEST ) discard;
  30. #endif
  31. `,gNe=`#ifdef USE_AOMAP
  32. float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
  33. reflectedLight.indirectDiffuse *= ambientOcclusion;
  34. #if defined( USE_ENVMAP ) && defined( PHYSICAL )
  35. float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
  36. reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );
  37. #endif
  38. #endif
  39. `,yNe=`#ifdef USE_AOMAP
  40. uniform sampler2D aoMap;
  41. uniform float aoMapIntensity;
  42. #endif`,_Ne=`
  43. vec3 transformed = vec3( position );
  44. `,xNe=`
  45. vec3 objectNormal = vec3( normal );
  46. `,SNe=`float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
  47. if( decayExponent > 0.0 ) {
  48. #if defined ( PHYSICALLY_CORRECT_LIGHTS )
  49. float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
  50. float maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
  51. return distanceFalloff * maxDistanceCutoffFactor;
  52. #else
  53. return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );
  54. #endif
  55. }
  56. return 1.0;
  57. }
  58. vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {
  59. return RECIPROCAL_PI * diffuseColor;
  60. }
  61. vec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {
  62. float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );
  63. return ( 1.0 - specularColor ) * fresnel + specularColor;
  64. }
  65. float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {
  66. float a2 = pow2( alpha );
  67. float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
  68. float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
  69. return 1.0 / ( gl * gv );
  70. }
  71. float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
  72. float a2 = pow2( alpha );
  73. float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
  74. float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
  75. return 0.5 / max( gv + gl, EPSILON );
  76. }
  77. float D_GGX( const in float alpha, const in float dotNH ) {
  78. float a2 = pow2( alpha );
  79. float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
  80. return RECIPROCAL_PI * a2 / pow2( denom );
  81. }
  82. vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {
  83. float alpha = pow2( roughness );
  84. vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );
  85. float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );
  86. float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
  87. float dotNH = saturate( dot( geometry.normal, halfDir ) );
  88. float dotLH = saturate( dot( incidentLight.direction, halfDir ) );
  89. vec3 F = F_Schlick( specularColor, dotLH );
  90. float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );
  91. float D = D_GGX( alpha, dotNH );
  92. return F * ( G * D );
  93. }
  94. vec2 ltcTextureCoords( const in GeometricContext geometry, const in float roughness ) {
  95. const float LUT_SIZE = 64.0;
  96. const float LUT_SCALE = (LUT_SIZE - 1.0)/LUT_SIZE;
  97. const float LUT_BIAS = 0.5/LUT_SIZE;
  98. vec3 N = geometry.normal;
  99. vec3 V = geometry.viewDir;
  100. vec3 P = geometry.position;
  101. float theta = acos( dot( N, V ) );
  102. vec2 uv = vec2(
  103. sqrt( saturate( roughness ) ),
  104. saturate( theta / ( 0.5 * PI ) ) );
  105. uv = uv * LUT_SCALE + LUT_BIAS;
  106. return uv;
  107. }
  108. void clipQuadToHorizon( inout vec3 L[5], out int n ) {
  109. int config = 0;
  110. if ( L[0].z > 0.0 ) config += 1;
  111. if ( L[1].z > 0.0 ) config += 2;
  112. if ( L[2].z > 0.0 ) config += 4;
  113. if ( L[3].z > 0.0 ) config += 8;
  114. n = 0;
  115. if ( config == 0 ) {
  116. } else if ( config == 1 ) {
  117. n = 3;
  118. L[1] = -L[1].z * L[0] + L[0].z * L[1];
  119. L[2] = -L[3].z * L[0] + L[0].z * L[3];
  120. } else if ( config == 2 ) {
  121. n = 3;
  122. L[0] = -L[0].z * L[1] + L[1].z * L[0];
  123. L[2] = -L[2].z * L[1] + L[1].z * L[2];
  124. } else if ( config == 3 ) {
  125. n = 4;
  126. L[2] = -L[2].z * L[1] + L[1].z * L[2];
  127. L[3] = -L[3].z * L[0] + L[0].z * L[3];
  128. } else if ( config == 4 ) {
  129. n = 3;
  130. L[0] = -L[3].z * L[2] + L[2].z * L[3];
  131. L[1] = -L[1].z * L[2] + L[2].z * L[1];
  132. } else if ( config == 5 ) {
  133. n = 0;
  134. } else if ( config == 6 ) {
  135. n = 4;
  136. L[0] = -L[0].z * L[1] + L[1].z * L[0];
  137. L[3] = -L[3].z * L[2] + L[2].z * L[3];
  138. } else if ( config == 7 ) {
  139. n = 5;
  140. L[4] = -L[3].z * L[0] + L[0].z * L[3];
  141. L[3] = -L[3].z * L[2] + L[2].z * L[3];
  142. } else if ( config == 8 ) {
  143. n = 3;
  144. L[0] = -L[0].z * L[3] + L[3].z * L[0];
  145. L[1] = -L[2].z * L[3] + L[3].z * L[2];
  146. L[2] = L[3];
  147. } else if ( config == 9 ) {
  148. n = 4;
  149. L[1] = -L[1].z * L[0] + L[0].z * L[1];
  150. L[2] = -L[2].z * L[3] + L[3].z * L[2];
  151. } else if ( config == 10 ) {
  152. n = 0;
  153. } else if ( config == 11 ) {
  154. n = 5;
  155. L[4] = L[3];
  156. L[3] = -L[2].z * L[3] + L[3].z * L[2];
  157. L[2] = -L[2].z * L[1] + L[1].z * L[2];
  158. } else if ( config == 12 ) {
  159. n = 4;
  160. L[1] = -L[1].z * L[2] + L[2].z * L[1];
  161. L[0] = -L[0].z * L[3] + L[3].z * L[0];
  162. } else if ( config == 13 ) {
  163. n = 5;
  164. L[4] = L[3];
  165. L[3] = L[2];
  166. L[2] = -L[1].z * L[2] + L[2].z * L[1];
  167. L[1] = -L[1].z * L[0] + L[0].z * L[1];
  168. } else if ( config == 14 ) {
  169. n = 5;
  170. L[4] = -L[0].z * L[3] + L[3].z * L[0];
  171. L[0] = -L[0].z * L[1] + L[1].z * L[0];
  172. } else if ( config == 15 ) {
  173. n = 4;
  174. }
  175. if ( n == 3 )
  176. L[3] = L[0];
  177. if ( n == 4 )
  178. L[4] = L[0];
  179. }
  180. float integrateLtcBrdfOverRectEdge( vec3 v1, vec3 v2 ) {
  181. float cosTheta = dot( v1, v2 );
  182. float theta = acos( cosTheta );
  183. float res = cross( v1, v2 ).z * ( ( theta > 0.001 ) ? theta / sin( theta ) : 1.0 );
  184. return res;
  185. }
  186. void initRectPoints( const in vec3 pos, const in vec3 halfWidth, const in vec3 halfHeight, out vec3 rectPoints[4] ) {
  187. rectPoints[0] = pos - halfWidth - halfHeight;
  188. rectPoints[1] = pos + halfWidth - halfHeight;
  189. rectPoints[2] = pos + halfWidth + halfHeight;
  190. rectPoints[3] = pos - halfWidth + halfHeight;
  191. }
  192. vec3 integrateLtcBrdfOverRect( const in GeometricContext geometry, const in mat3 brdfMat, const in vec3 rectPoints[4] ) {
  193. vec3 N = geometry.normal;
  194. vec3 V = geometry.viewDir;
  195. vec3 P = geometry.position;
  196. vec3 T1, T2;
  197. T1 = normalize(V - N * dot( V, N ));
  198. T2 = - cross( N, T1 );
  199. mat3 brdfWrtSurface = brdfMat * transpose( mat3( T1, T2, N ) );
  200. vec3 clippedRect[5];
  201. clippedRect[0] = brdfWrtSurface * ( rectPoints[0] - P );
  202. clippedRect[1] = brdfWrtSurface * ( rectPoints[1] - P );
  203. clippedRect[2] = brdfWrtSurface * ( rectPoints[2] - P );
  204. clippedRect[3] = brdfWrtSurface * ( rectPoints[3] - P );
  205. int n;
  206. clipQuadToHorizon(clippedRect, n);
  207. if ( n == 0 )
  208. return vec3( 0, 0, 0 );
  209. clippedRect[0] = normalize( clippedRect[0] );
  210. clippedRect[1] = normalize( clippedRect[1] );
  211. clippedRect[2] = normalize( clippedRect[2] );
  212. clippedRect[3] = normalize( clippedRect[3] );
  213. clippedRect[4] = normalize( clippedRect[4] );
  214. float sum = 0.0;
  215. sum += integrateLtcBrdfOverRectEdge( clippedRect[0], clippedRect[1] );
  216. sum += integrateLtcBrdfOverRectEdge( clippedRect[1], clippedRect[2] );
  217. sum += integrateLtcBrdfOverRectEdge( clippedRect[2], clippedRect[3] );
  218. if (n >= 4)
  219. sum += integrateLtcBrdfOverRectEdge( clippedRect[3], clippedRect[4] );
  220. if (n == 5)
  221. sum += integrateLtcBrdfOverRectEdge( clippedRect[4], clippedRect[0] );
  222. sum = max( 0.0, sum );
  223. vec3 Lo_i = vec3( sum, sum, sum );
  224. return Lo_i;
  225. }
  226. vec3 Rect_Area_Light_Specular_Reflectance(
  227. const in GeometricContext geometry,
  228. const in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight,
  229. const in float roughness,
  230. const in sampler2D ltcMat, const in sampler2D ltcMag ) {
  231. vec3 rectPoints[4];
  232. initRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );
  233. vec2 uv = ltcTextureCoords( geometry, roughness );
  234. vec4 brdfLtcApproxParams, t;
  235. brdfLtcApproxParams = texture2D( ltcMat, uv );
  236. t = texture2D( ltcMat, uv );
  237. float brdfLtcScalar = texture2D( ltcMag, uv ).a;
  238. mat3 brdfLtcApproxMat = mat3(
  239. vec3( 1, 0, t.y ),
  240. vec3( 0, t.z, 0 ),
  241. vec3( t.w, 0, t.x )
  242. );
  243. vec3 specularReflectance = integrateLtcBrdfOverRect( geometry, brdfLtcApproxMat, rectPoints );
  244. specularReflectance *= brdfLtcScalar;
  245. return specularReflectance;
  246. }
  247. vec3 Rect_Area_Light_Diffuse_Reflectance(
  248. const in GeometricContext geometry,
  249. const in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight ) {
  250. vec3 rectPoints[4];
  251. initRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );
  252. mat3 diffuseBrdfMat = mat3(1);
  253. vec3 diffuseReflectance = integrateLtcBrdfOverRect( geometry, diffuseBrdfMat, rectPoints );
  254. return diffuseReflectance;
  255. }
  256. vec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {
  257. float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
  258. const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
  259. const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
  260. vec4 r = roughness * c0 + c1;
  261. float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
  262. vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;
  263. return specularColor * AB.x + AB.y;
  264. }
  265. float G_BlinnPhong_Implicit( ) {
  266. return 0.25;
  267. }
  268. float D_BlinnPhong( const in float shininess, const in float dotNH ) {
  269. return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
  270. }
  271. vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {
  272. vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );
  273. float dotNH = saturate( dot( geometry.normal, halfDir ) );
  274. float dotLH = saturate( dot( incidentLight.direction, halfDir ) );
  275. vec3 F = F_Schlick( specularColor, dotLH );
  276. float G = G_BlinnPhong_Implicit( );
  277. float D = D_BlinnPhong( shininess, dotNH );
  278. return F * ( G * D );
  279. }
  280. float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {
  281. return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );
  282. }
  283. float BlinnExponentToGGXRoughness( const in float blinnExponent ) {
  284. return sqrt( 2.0 / ( blinnExponent + 2.0 ) );
  285. }
  286. `,MNe=`#ifdef USE_BUMPMAP
  287. uniform sampler2D bumpMap;
  288. uniform float bumpScale;
  289. vec2 dHdxy_fwd() {
  290. vec2 dSTdx = dFdx( vUv );
  291. vec2 dSTdy = dFdy( vUv );
  292. float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
  293. float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
  294. float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
  295. return vec2( dBx, dBy );
  296. }
  297. vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {
  298. vec3 vSigmaX = dFdx( surf_pos );
  299. vec3 vSigmaY = dFdy( surf_pos );
  300. vec3 vN = surf_norm;
  301. vec3 R1 = cross( vSigmaY, vN );
  302. vec3 R2 = cross( vN, vSigmaX );
  303. float fDet = dot( vSigmaX, R1 );
  304. vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
  305. return normalize( abs( fDet ) * surf_norm - vGrad );
  306. }
  307. #endif
  308. `,bNe=`#if NUM_CLIPPING_PLANES > 0
  309. for ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {
  310. vec4 plane = clippingPlanes[ i ];
  311. if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;
  312. }
  313. #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
  314. bool clipped = true;
  315. for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {
  316. vec4 plane = clippingPlanes[ i ];
  317. clipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;
  318. }
  319. if ( clipped ) discard;
  320. #endif
  321. #endif
  322. `,wNe=`#if NUM_CLIPPING_PLANES > 0
  323. #if ! defined( PHYSICAL ) && ! defined( PHONG )
  324. varying vec3 vViewPosition;
  325. #endif
  326. uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
  327. #endif
  328. `,TNe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )
  329. varying vec3 vViewPosition;
  330. #endif
  331. `,ENe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )
  332. vViewPosition = - mvPosition.xyz;
  333. #endif
  334. `,ANe=`#ifdef USE_COLOR
  335. diffuseColor.rgb *= vColor;
  336. #endif`,CNe=`#ifdef USE_COLOR
  337. varying vec3 vColor;
  338. #endif
  339. `,RNe=`#ifdef USE_COLOR
  340. varying vec3 vColor;
  341. #endif`,LNe=`#ifdef USE_COLOR
  342. vColor.xyz = color.xyz;
  343. #endif`,DNe=`#define PI 3.14159265359
  344. #define PI2 6.28318530718
  345. #define PI_HALF 1.5707963267949
  346. #define RECIPROCAL_PI 0.31830988618
  347. #define RECIPROCAL_PI2 0.15915494
  348. #define LOG2 1.442695
  349. #define EPSILON 1e-6
  350. #define saturate(a) clamp( a, 0.0, 1.0 )
  351. #define whiteCompliment(a) ( 1.0 - saturate( a ) )
  352. float pow2( const in float x ) { return x*x; }
  353. float pow3( const in float x ) { return x*x*x; }
  354. float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
  355. float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
  356. highp float rand( const in vec2 uv ) {
  357. const highp float a = 12.9898, b = 78.233, c = 43758.5453;
  358. highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
  359. return fract(sin(sn) * c);
  360. }
  361. struct IncidentLight {
  362. vec3 color;
  363. vec3 direction;
  364. bool visible;
  365. };
  366. struct ReflectedLight {
  367. vec3 directDiffuse;
  368. vec3 directSpecular;
  369. vec3 indirectDiffuse;
  370. vec3 indirectSpecular;
  371. };
  372. struct GeometricContext {
  373. vec3 position;
  374. vec3 normal;
  375. vec3 viewDir;
  376. };
  377. vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
  378. return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
  379. }
  380. vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
  381. return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
  382. }
  383. vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
  384. float distance = dot( planeNormal, point - pointOnPlane );
  385. return - distance * planeNormal + point;
  386. }
  387. float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
  388. return sign( dot( point - pointOnPlane, planeNormal ) );
  389. }
  390. vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {
  391. return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;
  392. }
  393. mat3 transpose( const in mat3 v ) {
  394. mat3 tmp;
  395. tmp[0] = vec3(v[0].x, v[1].x, v[2].x);
  396. tmp[1] = vec3(v[0].y, v[1].y, v[2].y);
  397. tmp[2] = vec3(v[0].z, v[1].z, v[2].z);
  398. return tmp;
  399. }
  400. `,PNe=`#ifdef ENVMAP_TYPE_CUBE_UV
  401. #define cubeUV_textureSize (1024.0)
  402. int getFaceFromDirection(vec3 direction) {
  403. vec3 absDirection = abs(direction);
  404. int face = -1;
  405. if( absDirection.x > absDirection.z ) {
  406. if(absDirection.x > absDirection.y )
  407. face = direction.x > 0.0 ? 0 : 3;
  408. else
  409. face = direction.y > 0.0 ? 1 : 4;
  410. }
  411. else {
  412. if(absDirection.z > absDirection.y )
  413. face = direction.z > 0.0 ? 2 : 5;
  414. else
  415. face = direction.y > 0.0 ? 1 : 4;
  416. }
  417. return face;
  418. }
  419. #define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)
  420. #define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))
  421. vec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {
  422. float scale = exp2(cubeUV_maxLods1 - roughnessLevel);
  423. float dxRoughness = dFdx(roughness);
  424. float dyRoughness = dFdy(roughness);
  425. vec3 dx = dFdx( vec * scale * dxRoughness );
  426. vec3 dy = dFdy( vec * scale * dyRoughness );
  427. float d = max( dot( dx, dx ), dot( dy, dy ) );
  428. d = clamp(d, 1.0, cubeUV_rangeClamp);
  429. float mipLevel = 0.5 * log2(d);
  430. return vec2(floor(mipLevel), fract(mipLevel));
  431. }
  432. #define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)
  433. #define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)
  434. vec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {
  435. mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;
  436. float a = 16.0 * cubeUV_rcpTextureSize;
  437. vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );
  438. vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;
  439. float powScale = exp2_packed.x * exp2_packed.y;
  440. float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;
  441. float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;
  442. bool bRes = mipLevel == 0.0;
  443. scale = bRes && (scale < a) ? a : scale;
  444. vec3 r;
  445. vec2 offset;
  446. int face = getFaceFromDirection(direction);
  447. float rcpPowScale = 1.0 / powScale;
  448. if( face == 0) {
  449. r = vec3(direction.x, -direction.z, direction.y);
  450. offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);
  451. offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;
  452. }
  453. else if( face == 1) {
  454. r = vec3(direction.y, direction.x, direction.z);
  455. offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);
  456. offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;
  457. }
  458. else if( face == 2) {
  459. r = vec3(direction.z, direction.x, direction.y);
  460. offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);
  461. offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;
  462. }
  463. else if( face == 3) {
  464. r = vec3(direction.x, direction.z, direction.y);
  465. offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);
  466. offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;
  467. }
  468. else if( face == 4) {
  469. r = vec3(direction.y, direction.x, -direction.z);
  470. offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);
  471. offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;
  472. }
  473. else {
  474. r = vec3(direction.z, -direction.x, direction.y);
  475. offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);
  476. offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;
  477. }
  478. r = normalize(r);
  479. float texelOffset = 0.5 * cubeUV_rcpTextureSize;
  480. vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;
  481. vec2 base = offset + vec2( texelOffset );
  482. return base + s * ( scale - 2.0 * texelOffset );
  483. }
  484. #define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)
  485. vec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {
  486. float roughnessVal = roughness* cubeUV_maxLods3;
  487. float r1 = floor(roughnessVal);
  488. float r2 = r1 + 1.0;
  489. float t = fract(roughnessVal);
  490. vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);
  491. float s = mipInfo.y;
  492. float level0 = mipInfo.x;
  493. float level1 = level0 + 1.0;
  494. level1 = level1 > 5.0 ? 5.0 : level1;
  495. level0 += min( floor( s + 0.5 ), 5.0 );
  496. vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);
  497. vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));
  498. vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);
  499. vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));
  500. vec4 result = mix(color10, color20, t);
  501. return vec4(result.rgb, 1.0);
  502. }
  503. #endif
  504. `,INe=`#ifdef FLIP_SIDED
  505. objectNormal = -objectNormal;
  506. #endif
  507. vec3 transformedNormal = normalMatrix * objectNormal;
  508. `,NNe=`#ifdef USE_DISPLACEMENTMAP
  509. uniform sampler2D displacementMap;
  510. uniform float displacementScale;
  511. uniform float displacementBias;
  512. #endif
  513. `,UNe=`#ifdef USE_DISPLACEMENTMAP
  514. transformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );
  515. #endif
  516. `,ONe=`#ifdef USE_EMISSIVEMAP
  517. vec4 emissiveColor = texture2D( emissiveMap, vUv );
  518. emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;
  519. totalEmissiveRadiance *= emissiveColor.rgb;
  520. #endif
  521. `,zNe=`#ifdef USE_EMISSIVEMAP
  522. uniform sampler2D emissiveMap;
  523. #endif
  524. `,FNe=` gl_FragColor = linearToOutputTexel( gl_FragColor );
  525. `,BNe=`
  526. vec4 LinearToLinear( in vec4 value ) {
  527. return value;
  528. }
  529. vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
  530. return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );
  531. }
  532. vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
  533. return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );
  534. }
  535. vec4 sRGBToLinear( in vec4 value ) {
  536. return 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 );
  537. }
  538. vec4 LinearTosRGB( in vec4 value ) {
  539. return 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 );
  540. }
  541. vec4 RGBEToLinear( in vec4 value ) {
  542. return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
  543. }
  544. vec4 LinearToRGBE( in vec4 value ) {
  545. float maxComponent = max( max( value.r, value.g ), value.b );
  546. float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
  547. return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
  548. }
  549. vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
  550. return vec4( value.xyz * value.w * maxRange, 1.0 );
  551. }
  552. vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
  553. float maxRGB = max( value.x, max( value.g, value.b ) );
  554. float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
  555. M = ceil( M * 255.0 ) / 255.0;
  556. return vec4( value.rgb / ( M * maxRange ), M );
  557. }
  558. vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
  559. return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
  560. }
  561. vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
  562. float maxRGB = max( value.x, max( value.g, value.b ) );
  563. float D = max( maxRange / maxRGB, 1.0 );
  564. D = min( floor( D ) / 255.0, 1.0 );
  565. return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
  566. }
  567. const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
  568. vec4 LinearToLogLuv( in vec4 value ) {
  569. vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;
  570. Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));
  571. vec4 vResult;
  572. vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
  573. float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
  574. vResult.w = fract(Le);
  575. vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;
  576. return vResult;
  577. }
  578. const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
  579. vec4 LogLuvToLinear( in vec4 value ) {
  580. float Le = value.z * 255.0 + value.w;
  581. vec3 Xp_Y_XYZp;
  582. Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);
  583. Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
  584. Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
  585. vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;
  586. return vec4( max(vRGB, 0.0), 1.0 );
  587. }
  588. `,kNe=`#ifdef USE_ENVMAP
  589. #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
  590. vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );
  591. vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
  592. #ifdef ENVMAP_MODE_REFLECTION
  593. vec3 reflectVec = reflect( cameraToVertex, worldNormal );
  594. #else
  595. vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );
  596. #endif
  597. #else
  598. vec3 reflectVec = vReflect;
  599. #endif
  600. #ifdef ENVMAP_TYPE_CUBE
  601. vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
  602. #elif defined( ENVMAP_TYPE_EQUIREC )
  603. vec2 sampleUV;
  604. sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );
  605. sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;
  606. vec4 envColor = texture2D( envMap, sampleUV );
  607. #elif defined( ENVMAP_TYPE_SPHERE )
  608. vec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );
  609. vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );
  610. #else
  611. vec4 envColor = vec4( 0.0 );
  612. #endif
  613. envColor = envMapTexelToLinear( envColor );
  614. #ifdef ENVMAP_BLENDING_MULTIPLY
  615. outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
  616. #elif defined( ENVMAP_BLENDING_MIX )
  617. outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
  618. #elif defined( ENVMAP_BLENDING_ADD )
  619. outgoingLight += envColor.xyz * specularStrength * reflectivity;
  620. #endif
  621. #endif
  622. `,VNe=`#if defined( USE_ENVMAP ) || defined( PHYSICAL )
  623. uniform float reflectivity;
  624. uniform float envMapIntensity;
  625. #endif
  626. #ifdef USE_ENVMAP
  627. #if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )
  628. varying vec3 vWorldPosition;
  629. #endif
  630. #ifdef ENVMAP_TYPE_CUBE
  631. uniform samplerCube envMap;
  632. #else
  633. uniform sampler2D envMap;
  634. #endif
  635. uniform float flipEnvMap;
  636. #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )
  637. uniform float refractionRatio;
  638. #else
  639. varying vec3 vReflect;
  640. #endif
  641. #endif
  642. `,GNe=`#ifdef USE_ENVMAP
  643. #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
  644. varying vec3 vWorldPosition;
  645. #else
  646. varying vec3 vReflect;
  647. uniform float refractionRatio;
  648. #endif
  649. #endif
  650. `,HNe=`#ifdef USE_ENVMAP
  651. #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
  652. vWorldPosition = worldPosition.xyz;
  653. #else
  654. vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
  655. vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
  656. #ifdef ENVMAP_MODE_REFLECTION
  657. vReflect = reflect( cameraToVertex, worldNormal );
  658. #else
  659. vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
  660. #endif
  661. #endif
  662. #endif
  663. `,WNe=`#ifdef USE_FOG
  664. #ifdef USE_LOGDEPTHBUF_EXT
  665. float depth = gl_FragDepthEXT / gl_FragCoord.w;
  666. #else
  667. float depth = gl_FragCoord.z / gl_FragCoord.w;
  668. #endif
  669. #ifdef FOG_EXP2
  670. float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );
  671. #else
  672. float fogFactor = smoothstep( fogNear, fogFar, depth );
  673. #endif
  674. gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
  675. #endif
  676. `,XNe=`#ifdef USE_FOG
  677. uniform vec3 fogColor;
  678. #ifdef FOG_EXP2
  679. uniform float fogDensity;
  680. #else
  681. uniform float fogNear;
  682. uniform float fogFar;
  683. #endif
  684. #endif`,YNe=`#ifdef TOON
  685. uniform sampler2D gradientMap;
  686. vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
  687. float dotNL = dot( normal, lightDirection );
  688. vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
  689. #ifdef USE_GRADIENTMAP
  690. return texture2D( gradientMap, coord ).rgb;
  691. #else
  692. return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );
  693. #endif
  694. }
  695. #endif
  696. `,qNe=`#ifdef USE_LIGHTMAP
  697. reflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;
  698. #endif
  699. `,ZNe=`#ifdef USE_LIGHTMAP
  700. uniform sampler2D lightMap;
  701. uniform float lightMapIntensity;
  702. #endif`,jNe=`vec3 diffuse = vec3( 1.0 );
  703. GeometricContext geometry;
  704. geometry.position = mvPosition.xyz;
  705. geometry.normal = normalize( transformedNormal );
  706. geometry.viewDir = normalize( -mvPosition.xyz );
  707. GeometricContext backGeometry;
  708. backGeometry.position = geometry.position;
  709. backGeometry.normal = -geometry.normal;
  710. backGeometry.viewDir = geometry.viewDir;
  711. vLightFront = vec3( 0.0 );
  712. #ifdef DOUBLE_SIDED
  713. vLightBack = vec3( 0.0 );
  714. #endif
  715. IncidentLight directLight;
  716. float dotNL;
  717. vec3 directLightColor_Diffuse;
  718. #if NUM_POINT_LIGHTS > 0
  719. for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
  720. getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );
  721. dotNL = dot( geometry.normal, directLight.direction );
  722. directLightColor_Diffuse = PI * directLight.color;
  723. vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
  724. #ifdef DOUBLE_SIDED
  725. vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
  726. #endif
  727. }
  728. #endif
  729. #if NUM_SPOT_LIGHTS > 0
  730. for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
  731. getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );
  732. dotNL = dot( geometry.normal, directLight.direction );
  733. directLightColor_Diffuse = PI * directLight.color;
  734. vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
  735. #ifdef DOUBLE_SIDED
  736. vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
  737. #endif
  738. }
  739. #endif
  740. #if NUM_RECT_AREA_LIGHTS > 0
  741. for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
  742. }
  743. #endif
  744. #if NUM_DIR_LIGHTS > 0
  745. for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
  746. getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );
  747. dotNL = dot( geometry.normal, directLight.direction );
  748. directLightColor_Diffuse = PI * directLight.color;
  749. vLightFront += saturate( dotNL ) * directLightColor_Diffuse;
  750. #ifdef DOUBLE_SIDED
  751. vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;
  752. #endif
  753. }
  754. #endif
  755. #if NUM_HEMI_LIGHTS > 0
  756. for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
  757. vLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
  758. #ifdef DOUBLE_SIDED
  759. vLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );
  760. #endif
  761. }
  762. #endif
  763. `,KNe=`uniform vec3 ambientLightColor;
  764. vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
  765. vec3 irradiance = ambientLightColor;
  766. #ifndef PHYSICALLY_CORRECT_LIGHTS
  767. irradiance *= PI;
  768. #endif
  769. return irradiance;
  770. }
  771. #if NUM_DIR_LIGHTS > 0
  772. struct DirectionalLight {
  773. vec3 direction;
  774. vec3 color;
  775. int shadow;
  776. float shadowBias;
  777. float shadowRadius;
  778. vec2 shadowMapSize;
  779. };
  780. uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
  781. void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {
  782. directLight.color = directionalLight.color;
  783. directLight.direction = directionalLight.direction;
  784. directLight.visible = true;
  785. }
  786. #endif
  787. #if NUM_POINT_LIGHTS > 0
  788. struct PointLight {
  789. vec3 position;
  790. vec3 color;
  791. float distance;
  792. float decay;
  793. int shadow;
  794. float shadowBias;
  795. float shadowRadius;
  796. vec2 shadowMapSize;
  797. };
  798. uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
  799. void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {
  800. vec3 lVector = pointLight.position - geometry.position;
  801. directLight.direction = normalize( lVector );
  802. float lightDistance = length( lVector );
  803. directLight.color = pointLight.color;
  804. directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );
  805. directLight.visible = ( directLight.color != vec3( 0.0 ) );
  806. }
  807. #endif
  808. #if NUM_SPOT_LIGHTS > 0
  809. struct SpotLight {
  810. vec3 position;
  811. vec3 direction;
  812. vec3 color;
  813. float distance;
  814. float decay;
  815. float coneCos;
  816. float penumbraCos;
  817. int shadow;
  818. float shadowBias;
  819. float shadowRadius;
  820. vec2 shadowMapSize;
  821. };
  822. uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
  823. void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {
  824. vec3 lVector = spotLight.position - geometry.position;
  825. directLight.direction = normalize( lVector );
  826. float lightDistance = length( lVector );
  827. float angleCos = dot( directLight.direction, spotLight.direction );
  828. if ( angleCos > spotLight.coneCos ) {
  829. float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );
  830. directLight.color = spotLight.color;
  831. directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );
  832. directLight.visible = true;
  833. } else {
  834. directLight.color = vec3( 0.0 );
  835. directLight.visible = false;
  836. }
  837. }
  838. #endif
  839. #if NUM_RECT_AREA_LIGHTS > 0
  840. struct RectAreaLight {
  841. vec3 color;
  842. vec3 position;
  843. vec3 halfWidth;
  844. vec3 halfHeight;
  845. };
  846. uniform sampler2D ltcMat; uniform sampler2D ltcMag;
  847. uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
  848. #endif
  849. #if NUM_HEMI_LIGHTS > 0
  850. struct HemisphereLight {
  851. vec3 direction;
  852. vec3 skyColor;
  853. vec3 groundColor;
  854. };
  855. uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
  856. vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {
  857. float dotNL = dot( geometry.normal, hemiLight.direction );
  858. float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
  859. vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
  860. #ifndef PHYSICALLY_CORRECT_LIGHTS
  861. irradiance *= PI;
  862. #endif
  863. return irradiance;
  864. }
  865. #endif
  866. #if defined( USE_ENVMAP ) && defined( PHYSICAL )
  867. vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {
  868. vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );
  869. #ifdef ENVMAP_TYPE_CUBE
  870. vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );
  871. #ifdef TEXTURE_LOD_EXT
  872. vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );
  873. #else
  874. vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );
  875. #endif
  876. envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
  877. #elif defined( ENVMAP_TYPE_CUBE_UV )
  878. vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );
  879. vec4 envMapColor = textureCubeUV( queryVec, 1.0 );
  880. #else
  881. vec4 envMapColor = vec4( 0.0 );
  882. #endif
  883. return PI * envMapColor.rgb * envMapIntensity;
  884. }
  885. float getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {
  886. float maxMIPLevelScalar = float( maxMIPLevel );
  887. float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );
  888. return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );
  889. }
  890. vec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {
  891. #ifdef ENVMAP_MODE_REFLECTION
  892. vec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );
  893. #else
  894. vec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );
  895. #endif
  896. reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
  897. float specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );
  898. #ifdef ENVMAP_TYPE_CUBE
  899. vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );
  900. #ifdef TEXTURE_LOD_EXT
  901. vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );
  902. #else
  903. vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );
  904. #endif
  905. envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
  906. #elif defined( ENVMAP_TYPE_CUBE_UV )
  907. vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );
  908. vec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));
  909. #elif defined( ENVMAP_TYPE_EQUIREC )
  910. vec2 sampleUV;
  911. sampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );
  912. sampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;
  913. #ifdef TEXTURE_LOD_EXT
  914. vec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );
  915. #else
  916. vec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );
  917. #endif
  918. envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
  919. #elif defined( ENVMAP_TYPE_SPHERE )
  920. vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );
  921. #ifdef TEXTURE_LOD_EXT
  922. vec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );
  923. #else
  924. vec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );
  925. #endif
  926. envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;
  927. #endif
  928. return envMapColor.rgb * envMapIntensity;
  929. }
  930. #endif
  931. `,JNe=`BlinnPhongMaterial material;
  932. material.diffuseColor = diffuseColor.rgb;
  933. material.specularColor = specular;
  934. material.specularShininess = shininess;
  935. material.specularStrength = specularStrength;
  936. `,$Ne=`varying vec3 vViewPosition;
  937. #ifndef FLAT_SHADED
  938. varying vec3 vNormal;
  939. #endif
  940. struct BlinnPhongMaterial {
  941. vec3 diffuseColor;
  942. vec3 specularColor;
  943. float specularShininess;
  944. float specularStrength;
  945. };
  946. #if NUM_RECT_AREA_LIGHTS > 0
  947. void RE_Direct_RectArea_BlinnPhong( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
  948. vec3 matDiffColor = material.diffuseColor;
  949. vec3 matSpecColor = material.specularColor;
  950. vec3 lightColor = rectAreaLight.color;
  951. float roughness = BlinnExponentToGGXRoughness( material.specularShininess );
  952. vec3 spec = Rect_Area_Light_Specular_Reflectance(
  953. geometry,
  954. rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,
  955. roughness,
  956. ltcMat, ltcMag );
  957. vec3 diff = Rect_Area_Light_Diffuse_Reflectance(
  958. geometry,
  959. rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );
  960. reflectedLight.directSpecular += lightColor * matSpecColor * spec / PI2;
  961. reflectedLight.directDiffuse += lightColor * matDiffColor * diff / PI2;
  962. }
  963. #endif
  964. void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
  965. #ifdef TOON
  966. vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
  967. #else
  968. float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
  969. vec3 irradiance = dotNL * directLight.color;
  970. #endif
  971. #ifndef PHYSICALLY_CORRECT_LIGHTS
  972. irradiance *= PI;
  973. #endif
  974. reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
  975. reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;
  976. }
  977. void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
  978. reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
  979. }
  980. #define RE_Direct RE_Direct_BlinnPhong
  981. #define RE_Direct_RectArea RE_Direct_RectArea_BlinnPhong
  982. #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
  983. #define Material_LightProbeLOD( material ) (0)
  984. `,QNe=`PhysicalMaterial material;
  985. material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
  986. material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );
  987. #ifdef STANDARD
  988. material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );
  989. #else
  990. material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );
  991. material.clearCoat = saturate( clearCoat ); material.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );
  992. #endif
  993. `,eUe=`struct PhysicalMaterial {
  994. vec3 diffuseColor;
  995. float specularRoughness;
  996. vec3 specularColor;
  997. #ifndef STANDARD
  998. float clearCoat;
  999. float clearCoatRoughness;
  1000. #endif
  1001. };
  1002. #define MAXIMUM_SPECULAR_COEFFICIENT 0.16
  1003. #define DEFAULT_SPECULAR_COEFFICIENT 0.04
  1004. float clearCoatDHRApprox( const in float roughness, const in float dotNL ) {
  1005. return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );
  1006. }
  1007. #if NUM_RECT_AREA_LIGHTS > 0
  1008. void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  1009. vec3 matDiffColor = material.diffuseColor;
  1010. vec3 matSpecColor = material.specularColor;
  1011. vec3 lightColor = rectAreaLight.color;
  1012. float roughness = material.specularRoughness;
  1013. vec3 spec = Rect_Area_Light_Specular_Reflectance(
  1014. geometry,
  1015. rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,
  1016. roughness,
  1017. ltcMat, ltcMag );
  1018. vec3 diff = Rect_Area_Light_Diffuse_Reflectance(
  1019. geometry,
  1020. rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );
  1021. reflectedLight.directSpecular += lightColor * matSpecColor * spec;
  1022. reflectedLight.directDiffuse += lightColor * matDiffColor * diff;
  1023. }
  1024. #endif
  1025. void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  1026. float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
  1027. vec3 irradiance = dotNL * directLight.color;
  1028. #ifndef PHYSICALLY_CORRECT_LIGHTS
  1029. irradiance *= PI;
  1030. #endif
  1031. #ifndef STANDARD
  1032. float clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );
  1033. #else
  1034. float clearCoatDHR = 0.0;
  1035. #endif
  1036. reflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );
  1037. reflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
  1038. #ifndef STANDARD
  1039. reflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );
  1040. #endif
  1041. }
  1042. void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  1043. reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );
  1044. }
  1045. void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  1046. #ifndef STANDARD
  1047. float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
  1048. float dotNL = dotNV;
  1049. float clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );
  1050. #else
  1051. float clearCoatDHR = 0.0;
  1052. #endif
  1053. reflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );
  1054. #ifndef STANDARD
  1055. reflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );
  1056. #endif
  1057. }
  1058. #define RE_Direct RE_Direct_Physical
  1059. #define RE_Direct_RectArea RE_Direct_RectArea_Physical
  1060. #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
  1061. #define RE_IndirectSpecular RE_IndirectSpecular_Physical
  1062. #define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )
  1063. #define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )
  1064. float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
  1065. return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
  1066. }
  1067. `,tUe=`
  1068. GeometricContext geometry;
  1069. geometry.position = - vViewPosition;
  1070. geometry.normal = normal;
  1071. geometry.viewDir = normalize( vViewPosition );
  1072. IncidentLight directLight;
  1073. #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
  1074. PointLight pointLight;
  1075. for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
  1076. pointLight = pointLights[ i ];
  1077. getPointDirectLightIrradiance( pointLight, geometry, directLight );
  1078. #ifdef USE_SHADOWMAP
  1079. directLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;
  1080. #endif
  1081. RE_Direct( directLight, geometry, material, reflectedLight );
  1082. }
  1083. #endif
  1084. #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
  1085. SpotLight spotLight;
  1086. for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
  1087. spotLight = spotLights[ i ];
  1088. getSpotDirectLightIrradiance( spotLight, geometry, directLight );
  1089. #ifdef USE_SHADOWMAP
  1090. directLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
  1091. #endif
  1092. RE_Direct( directLight, geometry, material, reflectedLight );
  1093. }
  1094. #endif
  1095. #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
  1096. DirectionalLight directionalLight;
  1097. for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
  1098. directionalLight = directionalLights[ i ];
  1099. getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );
  1100. #ifdef USE_SHADOWMAP
  1101. directLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
  1102. #endif
  1103. RE_Direct( directLight, geometry, material, reflectedLight );
  1104. }
  1105. #endif
  1106. #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
  1107. RectAreaLight rectAreaLight;
  1108. for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
  1109. rectAreaLight = rectAreaLights[ i ];
  1110. RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
  1111. }
  1112. #endif
  1113. #if defined( RE_IndirectDiffuse )
  1114. vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
  1115. #ifdef USE_LIGHTMAP
  1116. vec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;
  1117. #ifndef PHYSICALLY_CORRECT_LIGHTS
  1118. lightMapIrradiance *= PI;
  1119. #endif
  1120. irradiance += lightMapIrradiance;
  1121. #endif
  1122. #if ( NUM_HEMI_LIGHTS > 0 )
  1123. for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
  1124. irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );
  1125. }
  1126. #endif
  1127. #if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )
  1128. irradiance += getLightProbeIndirectIrradiance( geometry, 8 );
  1129. #endif
  1130. RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
  1131. #endif
  1132. #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
  1133. vec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );
  1134. #ifndef STANDARD
  1135. vec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );
  1136. #else
  1137. vec3 clearCoatRadiance = vec3( 0.0 );
  1138. #endif
  1139. RE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );
  1140. #endif
  1141. `,rUe=`#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)
  1142. gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;
  1143. #endif`,iUe=`#ifdef USE_LOGDEPTHBUF
  1144. uniform float logDepthBufFC;
  1145. #ifdef USE_LOGDEPTHBUF_EXT
  1146. varying float vFragDepth;
  1147. #endif
  1148. #endif
  1149. `,nUe=`#ifdef USE_LOGDEPTHBUF
  1150. #ifdef USE_LOGDEPTHBUF_EXT
  1151. varying float vFragDepth;
  1152. #endif
  1153. uniform float logDepthBufFC;
  1154. #endif`,aUe=`#ifdef USE_LOGDEPTHBUF
  1155. gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;
  1156. #ifdef USE_LOGDEPTHBUF_EXT
  1157. vFragDepth = 1.0 + gl_Position.w;
  1158. #else
  1159. gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;
  1160. #endif
  1161. #endif
  1162. `,oUe=`#ifdef USE_MAP
  1163. vec4 texelColor = texture2D( map, vUv );
  1164. texelColor = mapTexelToLinear( texelColor );
  1165. diffuseColor *= texelColor;
  1166. #endif
  1167. `,sUe=`#ifdef USE_MAP
  1168. uniform sampler2D map;
  1169. #endif
  1170. `,lUe=`#ifdef USE_MAP
  1171. vec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );
  1172. diffuseColor *= mapTexelToLinear( mapTexel );
  1173. #endif
  1174. `,uUe=`#ifdef USE_MAP
  1175. uniform vec4 offsetRepeat;
  1176. uniform sampler2D map;
  1177. #endif
  1178. `,cUe=`float metalnessFactor = metalness;
  1179. #ifdef USE_METALNESSMAP
  1180. vec4 texelMetalness = texture2D( metalnessMap, vUv );
  1181. metalnessFactor *= texelMetalness.r;
  1182. #endif
  1183. `,hUe=`#ifdef USE_METALNESSMAP
  1184. uniform sampler2D metalnessMap;
  1185. #endif`,fUe=`#ifdef USE_MORPHNORMALS
  1186. objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];
  1187. objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];
  1188. objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];
  1189. objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];
  1190. #endif
  1191. `,pUe=`#ifdef USE_MORPHTARGETS
  1192. #ifndef USE_MORPHNORMALS
  1193. uniform float morphTargetInfluences[ 8 ];
  1194. #else
  1195. uniform float morphTargetInfluences[ 4 ];
  1196. #endif
  1197. #endif`,dUe=`#ifdef USE_MORPHTARGETS
  1198. transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];
  1199. transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];
  1200. transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];
  1201. transformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];
  1202. #ifndef USE_MORPHNORMALS
  1203. transformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];
  1204. transformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];
  1205. transformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];
  1206. transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];
  1207. #endif
  1208. #endif
  1209. `,mUe=`#ifdef DOUBLE_SIDED
  1210. float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );
  1211. #else
  1212. float flipNormal = 1.0;
  1213. #endif
  1214. `,vUe=`#ifdef FLAT_SHADED
  1215. vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
  1216. vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
  1217. vec3 normal = normalize( cross( fdx, fdy ) );
  1218. #else
  1219. vec3 normal = normalize( vNormal ) * flipNormal;
  1220. #endif
  1221. #ifdef USE_NORMALMAP
  1222. normal = perturbNormal2Arb( -vViewPosition, normal );
  1223. #elif defined( USE_BUMPMAP )
  1224. normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );
  1225. #endif
  1226. `,gUe=`#ifdef USE_NORMALMAP
  1227. uniform sampler2D normalMap;
  1228. uniform vec2 normalScale;
  1229. vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {
  1230. vec3 q0 = dFdx( eye_pos.xyz );
  1231. vec3 q1 = dFdy( eye_pos.xyz );
  1232. vec2 st0 = dFdx( vUv.st );
  1233. vec2 st1 = dFdy( vUv.st );
  1234. vec3 S = normalize( q0 * st1.t - q1 * st0.t );
  1235. vec3 T = normalize( -q0 * st1.s + q1 * st0.s );
  1236. vec3 N = normalize( surf_norm );
  1237. vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
  1238. mapN.xy = normalScale * mapN.xy;
  1239. mat3 tsn = mat3( S, T, N );
  1240. return normalize( tsn * mapN );
  1241. }
  1242. #endif
  1243. `,yUe=`vec3 packNormalToRGB( const in vec3 normal ) {
  1244. return normalize( normal ) * 0.5 + 0.5;
  1245. }
  1246. vec3 unpackRGBToNormal( const in vec3 rgb ) {
  1247. return 1.0 - 2.0 * rgb.xyz;
  1248. }
  1249. const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
  1250. const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
  1251. const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
  1252. const float ShiftRight8 = 1. / 256.;
  1253. vec4 packDepthToRGBA( const in float v ) {
  1254. vec4 r = vec4( fract( v * PackFactors ), v );
  1255. r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
  1256. }
  1257. float unpackRGBAToDepth( const in vec4 v ) {
  1258. return dot( v, UnpackFactors );
  1259. }
  1260. float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
  1261. return ( viewZ + near ) / ( near - far );
  1262. }
  1263. float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
  1264. return linearClipZ * ( near - far ) - near;
  1265. }
  1266. float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
  1267. return (( near + viewZ ) * far ) / (( far - near ) * viewZ );
  1268. }
  1269. float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
  1270. return ( near * far ) / ( ( far - near ) * invClipZ - far );
  1271. }
  1272. `,_Ue=`#ifdef PREMULTIPLIED_ALPHA
  1273. gl_FragColor.rgb *= gl_FragColor.a;
  1274. #endif
  1275. `,xUe=`#ifdef USE_SKINNING
  1276. vec4 mvPosition = modelViewMatrix * skinned;
  1277. #else
  1278. vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );
  1279. #endif
  1280. gl_Position = projectionMatrix * mvPosition;
  1281. `,SUe=`float roughnessFactor = roughness;
  1282. #ifdef USE_ROUGHNESSMAP
  1283. vec4 texelRoughness = texture2D( roughnessMap, vUv );
  1284. roughnessFactor *= texelRoughness.r;
  1285. #endif
  1286. `,MUe=`#ifdef USE_ROUGHNESSMAP
  1287. uniform sampler2D roughnessMap;
  1288. #endif`,bUe=`#ifdef USE_SHADOWMAP
  1289. #if NUM_DIR_LIGHTS > 0
  1290. uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];
  1291. varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];
  1292. #endif
  1293. #if NUM_SPOT_LIGHTS > 0
  1294. uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];
  1295. varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];
  1296. #endif
  1297. #if NUM_POINT_LIGHTS > 0
  1298. uniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];
  1299. varying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];
  1300. #endif
  1301. #if NUM_RECT_AREA_LIGHTS > 0
  1302. #endif
  1303. float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
  1304. return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
  1305. }
  1306. float texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {
  1307. const vec2 offset = vec2( 0.0, 1.0 );
  1308. vec2 texelSize = vec2( 1.0 ) / size;
  1309. vec2 centroidUV = floor( uv * size + 0.5 ) / size;
  1310. float lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );
  1311. float lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );
  1312. float rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );
  1313. float rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );
  1314. vec2 f = fract( uv * size + 0.5 );
  1315. float a = mix( lb, lt, f.y );
  1316. float b = mix( rb, rt, f.y );
  1317. float c = mix( a, b, f.x );
  1318. return c;
  1319. }
  1320. float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
  1321. shadowCoord.xyz /= shadowCoord.w;
  1322. shadowCoord.z += shadowBias;
  1323. bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
  1324. bool inFrustum = all( inFrustumVec );
  1325. bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
  1326. bool frustumTest = all( frustumTestVec );
  1327. if ( frustumTest ) {
  1328. #if defined( SHADOWMAP_TYPE_PCF )
  1329. vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
  1330. float dx0 = - texelSize.x * shadowRadius;
  1331. float dy0 = - texelSize.y * shadowRadius;
  1332. float dx1 = + texelSize.x * shadowRadius;
  1333. float dy1 = + texelSize.y * shadowRadius;
  1334. return (
  1335. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
  1336. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
  1337. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
  1338. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
  1339. texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
  1340. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
  1341. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
  1342. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
  1343. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
  1344. ) * ( 1.0 / 9.0 );
  1345. #elif defined( SHADOWMAP_TYPE_PCF_SOFT )
  1346. vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
  1347. float dx0 = - texelSize.x * shadowRadius;
  1348. float dy0 = - texelSize.y * shadowRadius;
  1349. float dx1 = + texelSize.x * shadowRadius;
  1350. float dy1 = + texelSize.y * shadowRadius;
  1351. return (
  1352. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
  1353. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
  1354. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
  1355. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
  1356. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +
  1357. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
  1358. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
  1359. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
  1360. texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
  1361. ) * ( 1.0 / 9.0 );
  1362. #else
  1363. return texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
  1364. #endif
  1365. }
  1366. return 1.0;
  1367. }
  1368. vec2 cubeToUV( vec3 v, float texelSizeY ) {
  1369. vec3 absV = abs( v );
  1370. float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
  1371. absV *= scaleToCube;
  1372. v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
  1373. vec2 planar = v.xy;
  1374. float almostATexel = 1.5 * texelSizeY;
  1375. float almostOne = 1.0 - almostATexel;
  1376. if ( absV.z >= almostOne ) {
  1377. if ( v.z > 0.0 )
  1378. planar.x = 4.0 - v.x;
  1379. } else if ( absV.x >= almostOne ) {
  1380. float signX = sign( v.x );
  1381. planar.x = v.z * signX + 2.0 * signX;
  1382. } else if ( absV.y >= almostOne ) {
  1383. float signY = sign( v.y );
  1384. planar.x = v.x + 2.0 * signY + 2.0;
  1385. planar.y = v.z * signY - 2.0;
  1386. }
  1387. return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
  1388. }
  1389. float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
  1390. vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
  1391. vec3 lightToPosition = shadowCoord.xyz;
  1392. vec3 bd3D = normalize( lightToPosition );
  1393. float dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;
  1394. #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )
  1395. vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
  1396. return (
  1397. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
  1398. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
  1399. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
  1400. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
  1401. texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
  1402. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
  1403. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
  1404. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
  1405. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
  1406. ) * ( 1.0 / 9.0 );
  1407. #else
  1408. return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
  1409. #endif
  1410. }
  1411. #endif
  1412. `,wUe=`#ifdef USE_SHADOWMAP
  1413. #if NUM_DIR_LIGHTS > 0
  1414. uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];
  1415. varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];
  1416. #endif
  1417. #if NUM_SPOT_LIGHTS > 0
  1418. uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];
  1419. varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];
  1420. #endif
  1421. #if NUM_POINT_LIGHTS > 0
  1422. uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];
  1423. varying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];
  1424. #endif
  1425. #if NUM_RECT_AREA_LIGHTS > 0
  1426. #endif
  1427. #endif
  1428. `,TUe=`#ifdef USE_SHADOWMAP
  1429. #if NUM_DIR_LIGHTS > 0
  1430. for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
  1431. vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;
  1432. }
  1433. #endif
  1434. #if NUM_SPOT_LIGHTS > 0
  1435. for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
  1436. vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;
  1437. }
  1438. #endif
  1439. #if NUM_POINT_LIGHTS > 0
  1440. for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
  1441. vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;
  1442. }
  1443. #endif
  1444. #if NUM_RECT_AREA_LIGHTS > 0
  1445. #endif
  1446. #endif
  1447. `,EUe=`float getShadowMask() {
  1448. float shadow = 1.0;
  1449. #ifdef USE_SHADOWMAP
  1450. #if NUM_DIR_LIGHTS > 0
  1451. DirectionalLight directionalLight;
  1452. for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
  1453. directionalLight = directionalLights[ i ];
  1454. shadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
  1455. }
  1456. #endif
  1457. #if NUM_SPOT_LIGHTS > 0
  1458. SpotLight spotLight;
  1459. for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
  1460. spotLight = spotLights[ i ];
  1461. shadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;
  1462. }
  1463. #endif
  1464. #if NUM_POINT_LIGHTS > 0
  1465. PointLight pointLight;
  1466. for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
  1467. pointLight = pointLights[ i ];
  1468. shadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;
  1469. }
  1470. #endif
  1471. #if NUM_RECT_AREA_LIGHTS > 0
  1472. #endif
  1473. #endif
  1474. return shadow;
  1475. }
  1476. `,AUe=`#ifdef USE_SKINNING
  1477. mat4 boneMatX = getBoneMatrix( skinIndex.x );
  1478. mat4 boneMatY = getBoneMatrix( skinIndex.y );
  1479. mat4 boneMatZ = getBoneMatrix( skinIndex.z );
  1480. mat4 boneMatW = getBoneMatrix( skinIndex.w );
  1481. #endif`,CUe=`#ifdef USE_SKINNING
  1482. uniform mat4 bindMatrix;
  1483. uniform mat4 bindMatrixInverse;
  1484. #ifdef BONE_TEXTURE
  1485. uniform sampler2D boneTexture;
  1486. uniform int boneTextureWidth;
  1487. uniform int boneTextureHeight;
  1488. mat4 getBoneMatrix( const in float i ) {
  1489. float j = i * 4.0;
  1490. float x = mod( j, float( boneTextureWidth ) );
  1491. float y = floor( j / float( boneTextureWidth ) );
  1492. float dx = 1.0 / float( boneTextureWidth );
  1493. float dy = 1.0 / float( boneTextureHeight );
  1494. y = dy * ( y + 0.5 );
  1495. vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
  1496. vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
  1497. vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
  1498. vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
  1499. mat4 bone = mat4( v1, v2, v3, v4 );
  1500. return bone;
  1501. }
  1502. #else
  1503. uniform mat4 boneMatrices[ MAX_BONES ];
  1504. mat4 getBoneMatrix( const in float i ) {
  1505. mat4 bone = boneMatrices[ int(i) ];
  1506. return bone;
  1507. }
  1508. #endif
  1509. #endif
  1510. `,RUe=`#ifdef USE_SKINNING
  1511. vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
  1512. vec4 skinned = vec4( 0.0 );
  1513. skinned += boneMatX * skinVertex * skinWeight.x;
  1514. skinned += boneMatY * skinVertex * skinWeight.y;
  1515. skinned += boneMatZ * skinVertex * skinWeight.z;
  1516. skinned += boneMatW * skinVertex * skinWeight.w;
  1517. skinned = bindMatrixInverse * skinned;
  1518. #endif
  1519. `,LUe=`#ifdef USE_SKINNING
  1520. mat4 skinMatrix = mat4( 0.0 );
  1521. skinMatrix += skinWeight.x * boneMatX;
  1522. skinMatrix += skinWeight.y * boneMatY;
  1523. skinMatrix += skinWeight.z * boneMatZ;
  1524. skinMatrix += skinWeight.w * boneMatW;
  1525. skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
  1526. objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
  1527. #endif
  1528. `,DUe=`float specularStrength;
  1529. #ifdef USE_SPECULARMAP
  1530. vec4 texelSpecular = texture2D( specularMap, vUv );
  1531. specularStrength = texelSpecular.r;
  1532. #else
  1533. specularStrength = 1.0;
  1534. #endif`,PUe=`#ifdef USE_SPECULARMAP
  1535. uniform sampler2D specularMap;
  1536. #endif`,IUe=`#if defined( TONE_MAPPING )
  1537. gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
  1538. #endif
  1539. `,NUe=`#define saturate(a) clamp( a, 0.0, 1.0 )
  1540. uniform float toneMappingExposure;
  1541. uniform float toneMappingWhitePoint;
  1542. vec3 LinearToneMapping( vec3 color ) {
  1543. return toneMappingExposure * color;
  1544. }
  1545. vec3 ReinhardToneMapping( vec3 color ) {
  1546. color *= toneMappingExposure;
  1547. return saturate( color / ( vec3( 1.0 ) + color ) );
  1548. }
  1549. #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 ) )
  1550. vec3 Uncharted2ToneMapping( vec3 color ) {
  1551. color *= toneMappingExposure;
  1552. return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
  1553. }
  1554. vec3 OptimizedCineonToneMapping( vec3 color ) {
  1555. color *= toneMappingExposure;
  1556. color = max( vec3( 0.0 ), color - 0.004 );
  1557. return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
  1558. }
  1559. `,UUe=`#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 )
  1560. varying vec2 vUv;
  1561. #endif`,OUe=`#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 )
  1562. varying vec2 vUv;
  1563. uniform vec4 offsetRepeat;
  1564. #endif
  1565. `,zUe=`#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 )
  1566. vUv = uv * offsetRepeat.zw + offsetRepeat.xy;
  1567. #endif`,FUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
  1568. varying vec2 vUv2;
  1569. #endif`,BUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
  1570. attribute vec2 uv2;
  1571. varying vec2 vUv2;
  1572. #endif`,kUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
  1573. vUv2 = uv2;
  1574. #endif`,VUe=`#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )
  1575. #ifdef USE_SKINNING
  1576. vec4 worldPosition = modelMatrix * skinned;
  1577. #else
  1578. vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );
  1579. #endif
  1580. #endif
  1581. `,GUe=`uniform samplerCube tCube;
  1582. uniform float tFlip;
  1583. uniform float opacity;
  1584. varying vec3 vWorldPosition;
  1585. #include <common>
  1586. void main() {
  1587. gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );
  1588. gl_FragColor.a *= opacity;
  1589. }
  1590. `,HUe=`varying vec3 vWorldPosition;
  1591. #include <common>
  1592. void main() {
  1593. vWorldPosition = transformDirection( position, modelMatrix );
  1594. #include <begin_vertex>
  1595. #include <project_vertex>
  1596. }
  1597. `,WUe=`#if DEPTH_PACKING == 3200
  1598. uniform float opacity;
  1599. #endif
  1600. #include <common>
  1601. #include <packing>
  1602. #include <uv_pars_fragment>
  1603. #include <map_pars_fragment>
  1604. #include <alphamap_pars_fragment>
  1605. #include <logdepthbuf_pars_fragment>
  1606. #include <clipping_planes_pars_fragment>
  1607. void main() {
  1608. #include <clipping_planes_fragment>
  1609. vec4 diffuseColor = vec4( 1.0 );
  1610. #if DEPTH_PACKING == 3200
  1611. diffuseColor.a = opacity;
  1612. #endif
  1613. #include <map_fragment>
  1614. #include <alphamap_fragment>
  1615. #include <alphatest_fragment>
  1616. #include <logdepthbuf_fragment>
  1617. #if DEPTH_PACKING == 3200
  1618. gl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );
  1619. #elif DEPTH_PACKING == 3201
  1620. gl_FragColor = packDepthToRGBA( gl_FragCoord.z );
  1621. #endif
  1622. }
  1623. `,XUe=`#include <common>
  1624. #include <uv_pars_vertex>
  1625. #include <displacementmap_pars_vertex>
  1626. #include <morphtarget_pars_vertex>
  1627. #include <skinning_pars_vertex>
  1628. #include <logdepthbuf_pars_vertex>
  1629. #include <clipping_planes_pars_vertex>
  1630. void main() {
  1631. #include <uv_vertex>
  1632. #include <skinbase_vertex>
  1633. #include <begin_vertex>
  1634. #include <displacementmap_vertex>
  1635. #include <morphtarget_vertex>
  1636. #include <skinning_vertex>
  1637. #include <project_vertex>
  1638. #include <logdepthbuf_vertex>
  1639. #include <clipping_planes_vertex>
  1640. }
  1641. `,YUe=`uniform vec3 lightPos;
  1642. varying vec4 vWorldPosition;
  1643. #include <common>
  1644. #include <packing>
  1645. #include <clipping_planes_pars_fragment>
  1646. void main () {
  1647. #include <clipping_planes_fragment>
  1648. gl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );
  1649. }
  1650. `,qUe=`varying vec4 vWorldPosition;
  1651. #include <common>
  1652. #include <morphtarget_pars_vertex>
  1653. #include <skinning_pars_vertex>
  1654. #include <clipping_planes_pars_vertex>
  1655. void main() {
  1656. #include <skinbase_vertex>
  1657. #include <begin_vertex>
  1658. #include <morphtarget_vertex>
  1659. #include <skinning_vertex>
  1660. #include <project_vertex>
  1661. #include <worldpos_vertex>
  1662. #include <clipping_planes_vertex>
  1663. vWorldPosition = worldPosition;
  1664. }
  1665. `,ZUe=`uniform sampler2D tEquirect;
  1666. uniform float tFlip;
  1667. varying vec3 vWorldPosition;
  1668. #include <common>
  1669. void main() {
  1670. vec3 direction = normalize( vWorldPosition );
  1671. vec2 sampleUV;
  1672. sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );
  1673. sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;
  1674. gl_FragColor = texture2D( tEquirect, sampleUV );
  1675. }
  1676. `,jUe=`varying vec3 vWorldPosition;
  1677. #include <common>
  1678. void main() {
  1679. vWorldPosition = transformDirection( position, modelMatrix );
  1680. #include <begin_vertex>
  1681. #include <project_vertex>
  1682. }
  1683. `,KUe=`uniform vec3 diffuse;
  1684. uniform float opacity;
  1685. uniform float dashSize;
  1686. uniform float totalSize;
  1687. varying float vLineDistance;
  1688. #include <common>
  1689. #include <color_pars_fragment>
  1690. #include <fog_pars_fragment>
  1691. #include <logdepthbuf_pars_fragment>
  1692. #include <clipping_planes_pars_fragment>
  1693. void main() {
  1694. #include <clipping_planes_fragment>
  1695. if ( mod( vLineDistance, totalSize ) > dashSize ) {
  1696. discard;
  1697. }
  1698. vec3 outgoingLight = vec3( 0.0 );
  1699. vec4 diffuseColor = vec4( diffuse, opacity );
  1700. #include <logdepthbuf_fragment>
  1701. #include <color_fragment>
  1702. outgoingLight = diffuseColor.rgb;
  1703. gl_FragColor = vec4( outgoingLight, diffuseColor.a );
  1704. #include <premultiplied_alpha_fragment>
  1705. #include <tonemapping_fragment>
  1706. #include <encodings_fragment>
  1707. #include <fog_fragment>
  1708. }
  1709. `,JUe=`uniform float scale;
  1710. attribute float lineDistance;
  1711. varying float vLineDistance;
  1712. #include <common>
  1713. #include <color_pars_vertex>
  1714. #include <logdepthbuf_pars_vertex>
  1715. #include <clipping_planes_pars_vertex>
  1716. void main() {
  1717. #include <color_vertex>
  1718. vLineDistance = scale * lineDistance;
  1719. vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
  1720. gl_Position = projectionMatrix * mvPosition;
  1721. #include <logdepthbuf_vertex>
  1722. #include <clipping_planes_vertex>
  1723. }
  1724. `,$Ue=`uniform vec3 diffuse;
  1725. uniform float opacity;
  1726. #ifndef FLAT_SHADED
  1727. varying vec3 vNormal;
  1728. #endif
  1729. #include <common>
  1730. #include <color_pars_fragment>
  1731. #include <uv_pars_fragment>
  1732. #include <uv2_pars_fragment>
  1733. #include <map_pars_fragment>
  1734. #include <alphamap_pars_fragment>
  1735. #include <aomap_pars_fragment>
  1736. #include <lightmap_pars_fragment>
  1737. #include <envmap_pars_fragment>
  1738. #include <fog_pars_fragment>
  1739. #include <specularmap_pars_fragment>
  1740. #include <logdepthbuf_pars_fragment>
  1741. #include <clipping_planes_pars_fragment>
  1742. void main() {
  1743. #include <clipping_planes_fragment>
  1744. vec4 diffuseColor = vec4( diffuse, opacity );
  1745. #include <logdepthbuf_fragment>
  1746. #include <map_fragment>
  1747. #include <color_fragment>
  1748. #include <alphamap_fragment>
  1749. #include <alphatest_fragment>
  1750. #include <specularmap_fragment>
  1751. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  1752. #ifdef USE_LIGHTMAP
  1753. reflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;
  1754. #else
  1755. reflectedLight.indirectDiffuse += vec3( 1.0 );
  1756. #endif
  1757. #include <aomap_fragment>
  1758. reflectedLight.indirectDiffuse *= diffuseColor.rgb;
  1759. vec3 outgoingLight = reflectedLight.indirectDiffuse;
  1760. #include <normal_flip>
  1761. #include <envmap_fragment>
  1762. gl_FragColor = vec4( outgoingLight, diffuseColor.a );
  1763. #include <premultiplied_alpha_fragment>
  1764. #include <tonemapping_fragment>
  1765. #include <encodings_fragment>
  1766. #include <fog_fragment>
  1767. }
  1768. `,QUe=`#include <common>
  1769. #include <uv_pars_vertex>
  1770. #include <uv2_pars_vertex>
  1771. #include <envmap_pars_vertex>
  1772. #include <color_pars_vertex>
  1773. #include <morphtarget_pars_vertex>
  1774. #include <skinning_pars_vertex>
  1775. #include <logdepthbuf_pars_vertex>
  1776. #include <clipping_planes_pars_vertex>
  1777. void main() {
  1778. #include <uv_vertex>
  1779. #include <uv2_vertex>
  1780. #include <color_vertex>
  1781. #include <skinbase_vertex>
  1782. #ifdef USE_ENVMAP
  1783. #include <beginnormal_vertex>
  1784. #include <morphnormal_vertex>
  1785. #include <skinnormal_vertex>
  1786. #include <defaultnormal_vertex>
  1787. #endif
  1788. #include <begin_vertex>
  1789. #include <morphtarget_vertex>
  1790. #include <skinning_vertex>
  1791. #include <project_vertex>
  1792. #include <logdepthbuf_vertex>
  1793. #include <worldpos_vertex>
  1794. #include <clipping_planes_vertex>
  1795. #include <envmap_vertex>
  1796. }
  1797. `,eOe=`uniform vec3 diffuse;
  1798. uniform vec3 emissive;
  1799. uniform float opacity;
  1800. varying vec3 vLightFront;
  1801. #ifdef DOUBLE_SIDED
  1802. varying vec3 vLightBack;
  1803. #endif
  1804. #include <common>
  1805. #include <packing>
  1806. #include <color_pars_fragment>
  1807. #include <uv_pars_fragment>
  1808. #include <uv2_pars_fragment>
  1809. #include <map_pars_fragment>
  1810. #include <alphamap_pars_fragment>
  1811. #include <aomap_pars_fragment>
  1812. #include <lightmap_pars_fragment>
  1813. #include <emissivemap_pars_fragment>
  1814. #include <envmap_pars_fragment>
  1815. #include <bsdfs>
  1816. #include <lights_pars>
  1817. #include <fog_pars_fragment>
  1818. #include <shadowmap_pars_fragment>
  1819. #include <shadowmask_pars_fragment>
  1820. #include <specularmap_pars_fragment>
  1821. #include <logdepthbuf_pars_fragment>
  1822. #include <clipping_planes_pars_fragment>
  1823. void main() {
  1824. #include <clipping_planes_fragment>
  1825. vec4 diffuseColor = vec4( diffuse, opacity );
  1826. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  1827. vec3 totalEmissiveRadiance = emissive;
  1828. #include <logdepthbuf_fragment>
  1829. #include <map_fragment>
  1830. #include <color_fragment>
  1831. #include <alphamap_fragment>
  1832. #include <alphatest_fragment>
  1833. #include <specularmap_fragment>
  1834. #include <emissivemap_fragment>
  1835. reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );
  1836. #include <lightmap_fragment>
  1837. reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );
  1838. #ifdef DOUBLE_SIDED
  1839. reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;
  1840. #else
  1841. reflectedLight.directDiffuse = vLightFront;
  1842. #endif
  1843. reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();
  1844. #include <aomap_fragment>
  1845. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
  1846. #include <normal_flip>
  1847. #include <envmap_fragment>
  1848. gl_FragColor = vec4( outgoingLight, diffuseColor.a );
  1849. #include <premultiplied_alpha_fragment>
  1850. #include <tonemapping_fragment>
  1851. #include <encodings_fragment>
  1852. #include <fog_fragment>
  1853. }
  1854. `,tOe=`#define LAMBERT
  1855. varying vec3 vLightFront;
  1856. #ifdef DOUBLE_SIDED
  1857. varying vec3 vLightBack;
  1858. #endif
  1859. #include <common>
  1860. #include <uv_pars_vertex>
  1861. #include <uv2_pars_vertex>
  1862. #include <envmap_pars_vertex>
  1863. #include <bsdfs>
  1864. #include <lights_pars>
  1865. #include <color_pars_vertex>
  1866. #include <morphtarget_pars_vertex>
  1867. #include <skinning_pars_vertex>
  1868. #include <shadowmap_pars_vertex>
  1869. #include <logdepthbuf_pars_vertex>
  1870. #include <clipping_planes_pars_vertex>
  1871. void main() {
  1872. #include <uv_vertex>
  1873. #include <uv2_vertex>
  1874. #include <color_vertex>
  1875. #include <beginnormal_vertex>
  1876. #include <morphnormal_vertex>
  1877. #include <skinbase_vertex>
  1878. #include <skinnormal_vertex>
  1879. #include <defaultnormal_vertex>
  1880. #include <begin_vertex>
  1881. #include <morphtarget_vertex>
  1882. #include <skinning_vertex>
  1883. #include <project_vertex>
  1884. #include <logdepthbuf_vertex>
  1885. #include <clipping_planes_vertex>
  1886. #include <worldpos_vertex>
  1887. #include <envmap_vertex>
  1888. #include <lights_lambert_vertex>
  1889. #include <shadowmap_vertex>
  1890. }
  1891. `,rOe=`#define PHONG
  1892. uniform vec3 diffuse;
  1893. uniform vec3 emissive;
  1894. uniform vec3 specular;
  1895. uniform float shininess;
  1896. uniform float opacity;
  1897. #include <common>
  1898. #include <packing>
  1899. #include <color_pars_fragment>
  1900. #include <uv_pars_fragment>
  1901. #include <uv2_pars_fragment>
  1902. #include <map_pars_fragment>
  1903. #include <alphamap_pars_fragment>
  1904. #include <aomap_pars_fragment>
  1905. #include <lightmap_pars_fragment>
  1906. #include <emissivemap_pars_fragment>
  1907. #include <envmap_pars_fragment>
  1908. #include <gradientmap_pars_fragment>
  1909. #include <fog_pars_fragment>
  1910. #include <bsdfs>
  1911. #include <lights_pars>
  1912. #include <lights_phong_pars_fragment>
  1913. #include <shadowmap_pars_fragment>
  1914. #include <bumpmap_pars_fragment>
  1915. #include <normalmap_pars_fragment>
  1916. #include <specularmap_pars_fragment>
  1917. #include <logdepthbuf_pars_fragment>
  1918. #include <clipping_planes_pars_fragment>
  1919. void main() {
  1920. #include <clipping_planes_fragment>
  1921. vec4 diffuseColor = vec4( diffuse, opacity );
  1922. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  1923. vec3 totalEmissiveRadiance = emissive;
  1924. #include <logdepthbuf_fragment>
  1925. #include <map_fragment>
  1926. #include <color_fragment>
  1927. #include <alphamap_fragment>
  1928. #include <alphatest_fragment>
  1929. #include <specularmap_fragment>
  1930. #include <normal_flip>
  1931. #include <normal_fragment>
  1932. #include <emissivemap_fragment>
  1933. #include <lights_phong_fragment>
  1934. #include <lights_template>
  1935. #include <aomap_fragment>
  1936. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
  1937. #include <envmap_fragment>
  1938. gl_FragColor = vec4( outgoingLight, diffuseColor.a );
  1939. #include <premultiplied_alpha_fragment>
  1940. #include <tonemapping_fragment>
  1941. #include <encodings_fragment>
  1942. #include <fog_fragment>
  1943. }
  1944. `,iOe=`#define PHONG
  1945. varying vec3 vViewPosition;
  1946. #ifndef FLAT_SHADED
  1947. varying vec3 vNormal;
  1948. #endif
  1949. #include <common>
  1950. #include <uv_pars_vertex>
  1951. #include <uv2_pars_vertex>
  1952. #include <displacementmap_pars_vertex>
  1953. #include <envmap_pars_vertex>
  1954. #include <color_pars_vertex>
  1955. #include <morphtarget_pars_vertex>
  1956. #include <skinning_pars_vertex>
  1957. #include <shadowmap_pars_vertex>
  1958. #include <logdepthbuf_pars_vertex>
  1959. #include <clipping_planes_pars_vertex>
  1960. void main() {
  1961. #include <uv_vertex>
  1962. #include <uv2_vertex>
  1963. #include <color_vertex>
  1964. #include <beginnormal_vertex>
  1965. #include <morphnormal_vertex>
  1966. #include <skinbase_vertex>
  1967. #include <skinnormal_vertex>
  1968. #include <defaultnormal_vertex>
  1969. #ifndef FLAT_SHADED
  1970. vNormal = normalize( transformedNormal );
  1971. #endif
  1972. #include <begin_vertex>
  1973. #include <displacementmap_vertex>
  1974. #include <morphtarget_vertex>
  1975. #include <skinning_vertex>
  1976. #include <project_vertex>
  1977. #include <logdepthbuf_vertex>
  1978. #include <clipping_planes_vertex>
  1979. vViewPosition = - mvPosition.xyz;
  1980. #include <worldpos_vertex>
  1981. #include <envmap_vertex>
  1982. #include <shadowmap_vertex>
  1983. }
  1984. `,nOe=`#define PHYSICAL
  1985. uniform vec3 diffuse;
  1986. uniform vec3 emissive;
  1987. uniform float roughness;
  1988. uniform float metalness;
  1989. uniform float opacity;
  1990. #ifndef STANDARD
  1991. uniform float clearCoat;
  1992. uniform float clearCoatRoughness;
  1993. #endif
  1994. varying vec3 vViewPosition;
  1995. #ifndef FLAT_SHADED
  1996. varying vec3 vNormal;
  1997. #endif
  1998. #include <common>
  1999. #include <packing>
  2000. #include <color_pars_fragment>
  2001. #include <uv_pars_fragment>
  2002. #include <uv2_pars_fragment>
  2003. #include <map_pars_fragment>
  2004. #include <alphamap_pars_fragment>
  2005. #include <aomap_pars_fragment>
  2006. #include <lightmap_pars_fragment>
  2007. #include <emissivemap_pars_fragment>
  2008. #include <envmap_pars_fragment>
  2009. #include <fog_pars_fragment>
  2010. #include <bsdfs>
  2011. #include <cube_uv_reflection_fragment>
  2012. #include <lights_pars>
  2013. #include <lights_physical_pars_fragment>
  2014. #include <shadowmap_pars_fragment>
  2015. #include <bumpmap_pars_fragment>
  2016. #include <normalmap_pars_fragment>
  2017. #include <roughnessmap_pars_fragment>
  2018. #include <metalnessmap_pars_fragment>
  2019. #include <logdepthbuf_pars_fragment>
  2020. #include <clipping_planes_pars_fragment>
  2021. void main() {
  2022. #include <clipping_planes_fragment>
  2023. vec4 diffuseColor = vec4( diffuse, opacity );
  2024. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  2025. vec3 totalEmissiveRadiance = emissive;
  2026. #include <logdepthbuf_fragment>
  2027. #include <map_fragment>
  2028. #include <color_fragment>
  2029. #include <alphamap_fragment>
  2030. #include <alphatest_fragment>
  2031. #include <specularmap_fragment>
  2032. #include <roughnessmap_fragment>
  2033. #include <metalnessmap_fragment>
  2034. #include <normal_flip>
  2035. #include <normal_fragment>
  2036. #include <emissivemap_fragment>
  2037. #include <lights_physical_fragment>
  2038. #include <lights_template>
  2039. #include <aomap_fragment>
  2040. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
  2041. gl_FragColor = vec4( outgoingLight, diffuseColor.a );
  2042. #include <premultiplied_alpha_fragment>
  2043. #include <tonemapping_fragment>
  2044. #include <encodings_fragment>
  2045. #include <fog_fragment>
  2046. }
  2047. `,aOe=`#define PHYSICAL
  2048. varying vec3 vViewPosition;
  2049. #ifndef FLAT_SHADED
  2050. varying vec3 vNormal;
  2051. #endif
  2052. #include <common>
  2053. #include <uv_pars_vertex>
  2054. #include <uv2_pars_vertex>
  2055. #include <displacementmap_pars_vertex>
  2056. #include <color_pars_vertex>
  2057. #include <morphtarget_pars_vertex>
  2058. #include <skinning_pars_vertex>
  2059. #include <shadowmap_pars_vertex>
  2060. #include <specularmap_pars_fragment>
  2061. #include <logdepthbuf_pars_vertex>
  2062. #include <clipping_planes_pars_vertex>
  2063. void main() {
  2064. #include <uv_vertex>
  2065. #include <uv2_vertex>
  2066. #include <color_vertex>
  2067. #include <beginnormal_vertex>
  2068. #include <morphnormal_vertex>
  2069. #include <skinbase_vertex>
  2070. #include <skinnormal_vertex>
  2071. #include <defaultnormal_vertex>
  2072. #ifndef FLAT_SHADED
  2073. vNormal = normalize( transformedNormal );
  2074. #endif
  2075. #include <begin_vertex>
  2076. #include <displacementmap_vertex>
  2077. #include <morphtarget_vertex>
  2078. #include <skinning_vertex>
  2079. #include <project_vertex>
  2080. #include <logdepthbuf_vertex>
  2081. #include <clipping_planes_vertex>
  2082. vViewPosition = - mvPosition.xyz;
  2083. #include <worldpos_vertex>
  2084. #include <shadowmap_vertex>
  2085. }
  2086. `,oOe=`#define NORMAL
  2087. uniform float opacity;
  2088. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )
  2089. varying vec3 vViewPosition;
  2090. #endif
  2091. #ifndef FLAT_SHADED
  2092. varying vec3 vNormal;
  2093. #endif
  2094. #include <packing>
  2095. #include <uv_pars_fragment>
  2096. #include <bumpmap_pars_fragment>
  2097. #include <normalmap_pars_fragment>
  2098. #include <logdepthbuf_pars_fragment>
  2099. void main() {
  2100. #include <logdepthbuf_fragment>
  2101. #include <normal_flip>
  2102. #include <normal_fragment>
  2103. gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
  2104. #include <premultiplied_alpha_fragment>
  2105. #include <encodings_fragment>
  2106. }
  2107. `,sOe=`#define NORMAL
  2108. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )
  2109. varying vec3 vViewPosition;
  2110. #endif
  2111. #ifndef FLAT_SHADED
  2112. varying vec3 vNormal;
  2113. #endif
  2114. #include <uv_pars_vertex>
  2115. #include <displacementmap_pars_vertex>
  2116. #include <morphtarget_pars_vertex>
  2117. #include <skinning_pars_vertex>
  2118. #include <logdepthbuf_pars_vertex>
  2119. void main() {
  2120. #include <uv_vertex>
  2121. #include <beginnormal_vertex>
  2122. #include <morphnormal_vertex>
  2123. #include <skinbase_vertex>
  2124. #include <skinnormal_vertex>
  2125. #include <defaultnormal_vertex>
  2126. #ifndef FLAT_SHADED
  2127. vNormal = normalize( transformedNormal );
  2128. #endif
  2129. #include <begin_vertex>
  2130. #include <displacementmap_vertex>
  2131. #include <morphtarget_vertex>
  2132. #include <skinning_vertex>
  2133. #include <project_vertex>
  2134. #include <logdepthbuf_vertex>
  2135. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )
  2136. vViewPosition = - mvPosition.xyz;
  2137. #endif
  2138. }
  2139. `,lOe=`uniform vec3 diffuse;
  2140. uniform float opacity;
  2141. #include <common>
  2142. #include <packing>
  2143. #include <color_pars_fragment>
  2144. #include <map_particle_pars_fragment>
  2145. #include <fog_pars_fragment>
  2146. #include <shadowmap_pars_fragment>
  2147. #include <logdepthbuf_pars_fragment>
  2148. #include <clipping_planes_pars_fragment>
  2149. void main() {
  2150. #include <clipping_planes_fragment>
  2151. vec3 outgoingLight = vec3( 0.0 );
  2152. vec4 diffuseColor = vec4( diffuse, opacity );
  2153. #include <logdepthbuf_fragment>
  2154. #include <map_particle_fragment>
  2155. #include <color_fragment>
  2156. #include <alphatest_fragment>
  2157. outgoingLight = diffuseColor.rgb;
  2158. gl_FragColor = vec4( outgoingLight, diffuseColor.a );
  2159. #include <premultiplied_alpha_fragment>
  2160. #include <tonemapping_fragment>
  2161. #include <encodings_fragment>
  2162. #include <fog_fragment>
  2163. }
  2164. `,uOe=`uniform float size;
  2165. uniform float scale;
  2166. #include <common>
  2167. #include <color_pars_vertex>
  2168. #include <shadowmap_pars_vertex>
  2169. #include <logdepthbuf_pars_vertex>
  2170. #include <clipping_planes_pars_vertex>
  2171. void main() {
  2172. #include <color_vertex>
  2173. #include <begin_vertex>
  2174. #include <project_vertex>
  2175. #ifdef USE_SIZEATTENUATION
  2176. gl_PointSize = size * ( scale / - mvPosition.z );
  2177. #else
  2178. gl_PointSize = size;
  2179. #endif
  2180. #include <logdepthbuf_vertex>
  2181. #include <clipping_planes_vertex>
  2182. #include <worldpos_vertex>
  2183. #include <shadowmap_vertex>
  2184. }
  2185. `,cOe=`uniform float opacity;
  2186. #include <common>
  2187. #include <packing>
  2188. #include <bsdfs>
  2189. #include <lights_pars>
  2190. #include <shadowmap_pars_fragment>
  2191. #include <shadowmask_pars_fragment>
  2192. void main() {
  2193. gl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );
  2194. }
  2195. `,hOe=`#include <shadowmap_pars_vertex>
  2196. void main() {
  2197. #include <begin_vertex>
  2198. #include <project_vertex>
  2199. #include <worldpos_vertex>
  2200. #include <shadowmap_vertex>
  2201. }
  2202. `,jr={alphamap_fragment:dNe,alphamap_pars_fragment:mNe,alphatest_fragment:vNe,aomap_fragment:gNe,aomap_pars_fragment:yNe,begin_vertex:_Ne,beginnormal_vertex:xNe,bsdfs:SNe,bumpmap_pars_fragment:MNe,clipping_planes_fragment:bNe,clipping_planes_pars_fragment:wNe,clipping_planes_pars_vertex:TNe,clipping_planes_vertex:ENe,color_fragment:ANe,color_pars_fragment:CNe,color_pars_vertex:RNe,color_vertex:LNe,common:DNe,cube_uv_reflection_fragment:PNe,defaultnormal_vertex:INe,displacementmap_pars_vertex:NNe,displacementmap_vertex:UNe,emissivemap_fragment:ONe,emissivemap_pars_fragment:zNe,encodings_fragment:FNe,encodings_pars_fragment:BNe,envmap_fragment:kNe,envmap_pars_fragment:VNe,envmap_pars_vertex:GNe,envmap_vertex:HNe,fog_fragment:WNe,fog_pars_fragment:XNe,gradientmap_pars_fragment:YNe,lightmap_fragment:qNe,lightmap_pars_fragment:ZNe,lights_lambert_vertex:jNe,lights_pars:KNe,lights_phong_fragment:JNe,lights_phong_pars_fragment:$Ne,lights_physical_fragment:QNe,lights_physical_pars_fragment:eUe,lights_template:tUe,logdepthbuf_fragment:rUe,logdepthbuf_pars_fragment:iUe,logdepthbuf_pars_vertex:nUe,logdepthbuf_vertex:aUe,map_fragment:oUe,map_pars_fragment:sUe,map_particle_fragment:lUe,map_particle_pars_fragment:uUe,metalnessmap_fragment:cUe,metalnessmap_pars_fragment:hUe,morphnormal_vertex:fUe,morphtarget_pars_vertex:pUe,morphtarget_vertex:dUe,normal_flip:mUe,normal_fragment:vUe,normalmap_pars_fragment:gUe,packing:yUe,premultiplied_alpha_fragment:_Ue,project_vertex:xUe,roughnessmap_fragment:SUe,roughnessmap_pars_fragment:MUe,shadowmap_pars_fragment:bUe,shadowmap_pars_vertex:wUe,shadowmap_vertex:TUe,shadowmask_pars_fragment:EUe,skinbase_vertex:AUe,skinning_pars_vertex:CUe,skinning_vertex:RUe,skinnormal_vertex:LUe,specularmap_fragment:DUe,specularmap_pars_fragment:PUe,tonemapping_fragment:IUe,tonemapping_pars_fragment:NUe,uv_pars_fragment:UUe,uv_pars_vertex:OUe,uv_vertex:zUe,uv2_pars_fragment:FUe,uv2_pars_vertex:BUe,uv2_vertex:kUe,worldpos_vertex:VUe,cube_frag:GUe,cube_vert:HUe,depth_frag:WUe,depth_vert:XUe,distanceRGBA_frag:YUe,distanceRGBA_vert:qUe,equirect_frag:ZUe,equirect_vert:jUe,linedashed_frag:KUe,linedashed_vert:JUe,meshbasic_frag:$Ue,meshbasic_vert:QUe,meshlambert_frag:eOe,meshlambert_vert:tOe,meshphong_frag:rOe,meshphong_vert:iOe,meshphysical_frag:nOe,meshphysical_vert:aOe,normal_frag:oOe,normal_vert:sOe,points_frag:lOe,points_vert:uOe,shadow_frag:cOe,shadow_vert:hOe};Wt.prototype={constructor:Wt,isColor:!0,r:1,g:1,b:1,set:function(r){return r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r),this},setScalar:function(r){return this.r=r,this.g=r,this.b=r,this},setHex:function(r){return r=Math.floor(r),this.r=(r>>16&255)/255,this.g=(r>>8&255)/255,this.b=(r&255)/255,this},setRGB:function(r,e,t){return this.r=r,this.g=e,this.b=t,this},setHSL:function(){function r(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*6*(2/3-i):e}return function(t,i,n){if(t=fr.euclideanModulo(t,1),i=fr.clamp(i,0,1),n=fr.clamp(n,0,1),i===0)this.r=this.g=this.b=n;else{var a=n<=.5?n*(1+i):n+i-n*i,o=2*n-a;this.r=r(o,a,t+1/3),this.g=r(o,a,t),this.b=r(o,a,t-1/3)}return this}}(),setStyle:function(r){function e(h){h!==void 0&&parseFloat(h)<1&&console.warn("THREE.Color: Alpha component of "+r+" will be ignored.")}var t;if(t=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(r)){var i,n=t[1],a=t[2];switch(n){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(o,s,l)}break}}else if(t=/^\#([A-Fa-f0-9]+)$/.exec(r)){var u=t[1],c=u.length;if(c===3)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(c===6)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}if(r&&r.length>0){var u=fOe[r];u!==void 0?this.setHex(u):console.warn("THREE.Color: Unknown color "+r)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(r){return this.r=r.r,this.g=r.g,this.b=r.b,this},copyGammaToLinear:function(r,e){return e===void 0&&(e=2),this.r=Math.pow(r.r,e),this.g=Math.pow(r.g,e),this.b=Math.pow(r.b,e),this},copyLinearToGamma:function(r,e){e===void 0&&(e=2);var t=e>0?1/e:1;return this.r=Math.pow(r.r,t),this.g=Math.pow(r.g,t),this.b=Math.pow(r.b,t),this},convertGammaToLinear:function(){var r=this.r,e=this.g,t=this.b;return this.r=r*r,this.g=e*e,this.b=t*t,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 this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(r){var e=r||{h:0,s:0,l:0},t=this.r,i=this.g,n=this.b,a=Math.max(t,i,n),o=Math.min(t,i,n),s,l,u=(o+a)/2;if(o===a)s=0,l=0;else{var c=a-o;switch(l=u<=.5?c/(a+o):c/(2-a-o),a){case t:s=(i-n)/c+(i<n?6:0);break;case i:s=(n-t)/c+2;break;case n:s=(t-i)/c+4;break}s/=6}return e.h=s,e.s=l,e.l=u,e},getStyle:function(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"},offsetHSL:function(r,e,t){var i=this.getHSL();return i.h+=r,i.s+=e,i.l+=t,this.setHSL(i.h,i.s,i.l),this},add:function(r){return this.r+=r.r,this.g+=r.g,this.b+=r.b,this},addColors:function(r,e){return this.r=r.r+e.r,this.g=r.g+e.g,this.b=r.b+e.b,this},addScalar:function(r){return this.r+=r,this.g+=r,this.b+=r,this},sub:function(r){return this.r=Math.max(0,this.r-r.r),this.g=Math.max(0,this.g-r.g),this.b=Math.max(0,this.b-r.b),this},multiply:function(r){return this.r*=r.r,this.g*=r.g,this.b*=r.b,this},multiplyScalar:function(r){return this.r*=r,this.g*=r,this.b*=r,this},lerp:function(r,e){return this.r+=(r.r-this.r)*e,this.g+=(r.g-this.g)*e,this.b+=(r.b-this.b)*e,this},equals:function(r){return r.r===this.r&&r.g===this.g&&r.b===this.b},fromArray:function(r,e){return e===void 0&&(e=0),this.r=r[e],this.g=r[e+1],this.b=r[e+2],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.r,r[e+1]=this.g,r[e+2]=this.b,r},toJSON:function(){return this.getHex()}};fOe={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};sm.prototype=Object.create(ci.prototype);sm.prototype.constructor=sm;sm.prototype.isDataTexture=!0;dr={common:{diffuse:{value:new Wt(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new ii(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 Tt(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 Wt(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 Wt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new ii(0,0,1,1)}}},b0={basic:{uniforms:Yo.merge([dr.common,dr.aomap,dr.lightmap,dr.fog]),vertexShader:jr.meshbasic_vert,fragmentShader:jr.meshbasic_frag},lambert:{uniforms:Yo.merge([dr.common,dr.aomap,dr.lightmap,dr.emissivemap,dr.fog,dr.lights,{emissive:{value:new Wt(0)}}]),vertexShader:jr.meshlambert_vert,fragmentShader:jr.meshlambert_frag},phong:{uniforms:Yo.merge([dr.common,dr.aomap,dr.lightmap,dr.emissivemap,dr.bumpmap,dr.normalmap,dr.displacementmap,dr.gradientmap,dr.fog,dr.lights,{emissive:{value:new Wt(0)},specular:{value:new Wt(1118481)},shininess:{value:30}}]),vertexShader:jr.meshphong_vert,fragmentShader:jr.meshphong_frag},standard:{uniforms:Yo.merge([dr.common,dr.aomap,dr.lightmap,dr.emissivemap,dr.bumpmap,dr.normalmap,dr.displacementmap,dr.roughnessmap,dr.metalnessmap,dr.fog,dr.lights,{emissive:{value:new Wt(0)},roughness:{value:.5},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:jr.meshphysical_vert,fragmentShader:jr.meshphysical_frag},points:{uniforms:Yo.merge([dr.points,dr.fog]),vertexShader:jr.points_vert,fragmentShader:jr.points_frag},dashed:{uniforms:Yo.merge([dr.common,dr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:jr.linedashed_vert,fragmentShader:jr.linedashed_frag},depth:{uniforms:Yo.merge([dr.common,dr.displacementmap]),vertexShader:jr.depth_vert,fragmentShader:jr.depth_frag},normal:{uniforms:Yo.merge([dr.common,dr.bumpmap,dr.normalmap,dr.displacementmap,{opacity:{value:1}}]),vertexShader:jr.normal_vert,fragmentShader:jr.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:jr.cube_vert,fragmentShader:jr.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:jr.equirect_vert,fragmentShader:jr.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new oe}},vertexShader:jr.distanceRGBA_vert,fragmentShader:jr.distanceRGBA_frag}};b0.physical={uniforms:Yo.merge([b0.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:jr.meshphysical_vert,fragmentShader:jr.meshphysical_frag};BM.prototype={constructor:BM,set:function(r,e){return this.min.copy(r),this.max.copy(e),this},setFromPoints:function(r){this.makeEmpty();for(var e=0,t=r.length;e<t;e++)this.expandByPoint(r[e]);return this},setFromCenterAndSize:function(){var r=new Tt;return function(t,i){var n=r.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.min.copy(r.min),this.max.copy(r.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(r){var e=r||new Tt;return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(r){var e=r||new Tt;return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(r){return this.min.min(r),this.max.max(r),this},expandByVector:function(r){return this.min.sub(r),this.max.add(r),this},expandByScalar:function(r){return this.min.addScalar(-r),this.max.addScalar(r),this},containsPoint:function(r){return!(r.x<this.min.x||r.x>this.max.x||r.y<this.min.y||r.y>this.max.y)},containsBox:function(r){return this.min.x<=r.min.x&&r.max.x<=this.max.x&&this.min.y<=r.min.y&&r.max.y<=this.max.y},getParameter:function(r,e){var t=e||new Tt;return t.set((r.x-this.min.x)/(this.max.x-this.min.x),(r.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(r){return!(r.max.x<this.min.x||r.min.x>this.max.x||r.max.y<this.min.y||r.min.y>this.max.y)},clampPoint:function(r,e){var t=e||new Tt;return t.copy(r).clamp(this.min,this.max)},distanceToPoint:function(){var r=new Tt;return function(t){var i=r.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(r){return this.min.max(r.min),this.max.min(r.max),this},union:function(r){return this.min.min(r.min),this.max.max(r.max),this},translate:function(r){return this.min.add(r),this.max.add(r),this},equals:function(r){return r.min.equals(this.min)&&r.max.equals(this.max)}};mOe=0;_r.prototype={constructor:_r,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(r){r===!0&&this.update(),this._needsUpdate=r},setValues:function(r){if(r!==void 0)for(var e in r){var t=r[e];if(t===void 0){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}var i=this[e];if(i===void 0){console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.");continue}i&&i.isColor?i.set(t):i&&i.isVector3&&t&&t.isVector3?i.copy(t):e==="overdraw"?this[e]=Number(t):this[e]=t}},toJSON:function(r){var e=r===void 0;e&&(r={textures:{},images:{}});var t={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),this.roughness!==void 0&&(t.roughness=this.roughness),this.metalness!==void 0&&(t.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),this.shininess!==void 0&&(t.shininess=this.shininess),this.clearCoat!==void 0&&(t.clearCoat=this.clearCoat),this.clearCoatRoughness!==void 0&&(t.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(r).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(r).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(r).uuid),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(r).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(r).uuid,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(r).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(r).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(r).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(r).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(r).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(r).uuid,t.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(r).uuid),this.size!==void 0&&(t.size=this.size),this.sizeAttenuation!==void 0&&(t.sizeAttenuation=this.sizeAttenuation),this.blending!==a_&&(t.blending=this.blending),this.shading!==zk&&(t.shading=this.shading),this.side!==y0&&(t.side=this.side),this.vertexColors!==bL&&(t.vertexColors=this.vertexColors),this.opacity<1&&(t.opacity=this.opacity),this.transparent===!0&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,this.alphaTest>0&&(t.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(t.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(t.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(t.wireframeLinejoin=this.wireframeLinejoin),t.skinning=this.skinning,t.morphTargets=this.morphTargets;function i(o){var s=[];for(var l in o){var u=o[l];delete u.metadata,s.push(u)}return s}if(e){var n=i(r.textures),a=i(r.images);n.length>0&&(t.textures=n),a.length>0&&(t.images=a)}return t},clone:function(){return new this.constructor().copy(this)},copy:function(r){this.name=r.name,this.fog=r.fog,this.lights=r.lights,this.blending=r.blending,this.side=r.side,this.shading=r.shading,this.vertexColors=r.vertexColors,this.opacity=r.opacity,this.transparent=r.transparent,this.blendSrc=r.blendSrc,this.blendDst=r.blendDst,this.blendEquation=r.blendEquation,this.blendSrcAlpha=r.blendSrcAlpha,this.blendDstAlpha=r.blendDstAlpha,this.blendEquationAlpha=r.blendEquationAlpha,this.depthFunc=r.depthFunc,this.depthTest=r.depthTest,this.depthWrite=r.depthWrite,this.colorWrite=r.colorWrite,this.precision=r.precision,this.polygonOffset=r.polygonOffset,this.polygonOffsetFactor=r.polygonOffsetFactor,this.polygonOffsetUnits=r.polygonOffsetUnits,this.alphaTest=r.alphaTest,this.premultipliedAlpha=r.premultipliedAlpha,this.overdraw=r.overdraw,this.visible=r.visible,this.clipShadows=r.clipShadows,this.clipIntersection=r.clipIntersection;var e=r.clippingPlanes,t=null;if(e!==null){var i=e.length;t=new Array(i);for(var n=0;n!==i;++n)t[n]=e[n].clone()}return this.clippingPlanes=t,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};Object.assign(_r.prototype,pl.prototype);Na.prototype=Object.create(_r.prototype);Na.prototype.constructor=Na;Na.prototype.isShaderMaterial=!0;Na.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.fragmentShader=r.fragmentShader,this.vertexShader=r.vertexShader,this.uniforms=Yo.clone(r.uniforms),this.defines=r.defines,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.lights=r.lights,this.clipping=r.clipping,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.morphNormals=r.morphNormals,this.extensions=r.extensions,this};Na.prototype.toJSON=function(r){var e=_r.prototype.toJSON.call(this,r);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e};$f.prototype=Object.create(_r.prototype);$f.prototype.constructor=$f;$f.prototype.isMeshDepthMaterial=!0;$f.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.depthPacking=r.depthPacking,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.map=r.map,this.alphaMap=r.alphaMap,this.displacementMap=r.displacementMap,this.displacementScale=r.displacementScale,this.displacementBias=r.displacementBias,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this};Zu.prototype={constructor:Zu,isBox3:!0,set:function(r,e){return this.min.copy(r),this.max.copy(e),this},setFromArray:function(r){for(var e=1/0,t=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=0,l=r.length;s<l;s+=3){var u=r[s],c=r[s+1],h=r[s+2];u<e&&(e=u),c<t&&(t=c),h<i&&(i=h),u>n&&(n=u),c>a&&(a=c),h>o&&(o=h)}this.min.set(e,t,i),this.max.set(n,a,o)},setFromBufferAttribute:function(r){for(var e=1/0,t=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=0,l=r.count;s<l;s++){var u=r.getX(s),c=r.getY(s),h=r.getZ(s);u<e&&(e=u),c<t&&(t=c),h<i&&(i=h),u>n&&(n=u),c>a&&(a=c),h>o&&(o=h)}this.min.set(e,t,i),this.max.set(n,a,o)},setFromPoints:function(r){this.makeEmpty();for(var e=0,t=r.length;e<t;e++)this.expandByPoint(r[e]);return this},setFromCenterAndSize:function(){var r=new oe;return function(t,i){var n=r.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),setFromObject:function(){var r=new oe;return function(t){var i=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(n){var a,o,s=n.geometry;if(s!==void 0){if(s.isGeometry){var l=s.vertices;for(a=0,o=l.length;a<o;a++)r.copy(l[a]),r.applyMatrix4(n.matrixWorld),i.expandByPoint(r)}else if(s.isBufferGeometry){var u=s.attributes.position;if(u!==void 0)for(a=0,o=u.count;a<o;a++)r.fromAttribute(u,a).applyMatrix4(n.matrixWorld),i.expandByPoint(r)}}}),this}}(),clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.min.copy(r.min),this.max.copy(r.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(r){var e=r||new oe;return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(r){var e=r||new oe;return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(r){return this.min.min(r),this.max.max(r),this},expandByVector:function(r){return this.min.sub(r),this.max.add(r),this},expandByScalar:function(r){return this.min.addScalar(-r),this.max.addScalar(r),this},containsPoint:function(r){return!(r.x<this.min.x||r.x>this.max.x||r.y<this.min.y||r.y>this.max.y||r.z<this.min.z||r.z>this.max.z)},containsBox:function(r){return this.min.x<=r.min.x&&r.max.x<=this.max.x&&this.min.y<=r.min.y&&r.max.y<=this.max.y&&this.min.z<=r.min.z&&r.max.z<=this.max.z},getParameter:function(r,e){var t=e||new oe;return t.set((r.x-this.min.x)/(this.max.x-this.min.x),(r.y-this.min.y)/(this.max.y-this.min.y),(r.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(r){return!(r.max.x<this.min.x||r.min.x>this.max.x||r.max.y<this.min.y||r.min.y>this.max.y||r.max.z<this.min.z||r.min.z>this.max.z)},intersectsSphere:function(){var r;return function(t){return r===void 0&&(r=new oe),this.clampPoint(t.center,r),r.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(r){var e,t;return r.normal.x>0?(e=r.normal.x*this.min.x,t=r.normal.x*this.max.x):(e=r.normal.x*this.max.x,t=r.normal.x*this.min.x),r.normal.y>0?(e+=r.normal.y*this.min.y,t+=r.normal.y*this.max.y):(e+=r.normal.y*this.max.y,t+=r.normal.y*this.min.y),r.normal.z>0?(e+=r.normal.z*this.min.z,t+=r.normal.z*this.max.z):(e+=r.normal.z*this.max.z,t+=r.normal.z*this.min.z),e<=r.constant&&t>=r.constant},clampPoint:function(r,e){var t=e||new oe;return t.copy(r).clamp(this.min,this.max)},distanceToPoint:function(){var r=new oe;return function(t){var i=r.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var r=new oe;return function(t){var i=t||new ha;return this.getCenter(i.center),i.radius=this.getSize(r).length()*.5,i}}(),intersect:function(r){return this.min.max(r.min),this.max.min(r.max),this.isEmpty()&&this.makeEmpty(),this},union:function(r){return this.min.min(r.min),this.max.max(r.max),this},applyMatrix4:function(){var r=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe];return function(t){return this.isEmpty()?this:(r[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),r[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),r[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),r[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),r[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),r[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),r[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),r[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(r),this)}}(),translate:function(r){return this.min.add(r),this.max.add(r),this},equals:function(r){return r.min.equals(this.min)&&r.max.equals(this.max)}};ha.prototype={constructor:ha,set:function(r,e){return this.center.copy(r),this.radius=e,this},setFromPoints:function(){var r=new Zu;return function(t,i){var n=this.center;i!==void 0?n.copy(i):r.setFromPoints(t).getCenter(n);for(var a=0,o=0,s=t.length;o<s;o++)a=Math.max(a,n.distanceToSquared(t[o]));return this.radius=Math.sqrt(a),this}}(),clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.center.copy(r.center),this.radius=r.radius,this},empty:function(){return this.radius<=0},containsPoint:function(r){return r.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(r){return r.distanceTo(this.center)-this.radius},intersectsSphere:function(r){var e=this.radius+r.radius;return r.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(r){return r.intersectsSphere(this)},intersectsPlane:function(r){return Math.abs(this.center.dot(r.normal)-r.constant)<=this.radius},clampPoint:function(r,e){var t=this.center.distanceToSquared(r),i=e||new oe;return i.copy(r),t>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(r){var e=r||new Zu;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(r){return this.center.applyMatrix4(r),this.radius=this.radius*r.getMaxScaleOnAxis(),this},translate:function(r){return this.center.add(r),this},equals:function(r){return r.center.equals(this.center)&&r.radius===this.radius}};dl.prototype={constructor:dl,isMatrix3:!0,set:function(r,e,t,i,n,a,o,s,l){var u=this.elements;return u[0]=r,u[1]=i,u[2]=o,u[3]=e,u[4]=n,u[5]=s,u[6]=t,u[7]=a,u[8]=l,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(r){var e=r.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},setFromMatrix4:function(r){var e=r.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a<n;a+=3,o+=3)r.fromArray(t,o),r.applyMatrix3(this),r.toArray(t,o);return t}}(),applyToBufferAttribute:function(){var r;return function(t){r===void 0&&(r=new oe);for(var i=0,n=t.count;i<n;i++)r.x=t.getX(i),r.y=t.getY(i),r.z=t.getZ(i),r.applyMatrix3(this),t.setXYZ(i,r.x,r.y,r.z);return t}}(),multiplyScalar:function(r){var e=this.elements;return e[0]*=r,e[3]*=r,e[6]*=r,e[1]*=r,e[4]*=r,e[7]*=r,e[2]*=r,e[5]*=r,e[8]*=r,this},determinant:function(){var r=this.elements,e=r[0],t=r[1],i=r[2],n=r[3],a=r[4],o=r[5],s=r[6],l=r[7],u=r[8];return e*a*u-e*o*l-t*n*u+t*o*s+i*n*l-i*a*s},getInverse:function(r,e){r&&r.isMatrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var t=r.elements,i=this.elements,n=t[0],a=t[1],o=t[2],s=t[3],l=t[4],u=t[5],c=t[6],h=t[7],f=t[8],p=f*l-u*h,d=u*c-f*s,g=h*s-l*c,m=n*p+a*d+o*g;if(m===0){var v="THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";if(e===!0)throw new Error(v);return console.warn(v),this.identity()}var _=1/m;return i[0]=p*_,i[1]=(o*h-f*a)*_,i[2]=(u*a-o*l)*_,i[3]=d*_,i[4]=(f*n-o*c)*_,i[5]=(o*s-u*n)*_,i[6]=g*_,i[7]=(a*c-h*n)*_,i[8]=(l*n-a*s)*_,this},transpose:function(){var r,e=this.elements;return r=e[1],e[1]=e[3],e[3]=r,r=e[2],e[2]=e[6],e[6]=r,r=e[5],e[5]=e[7],e[7]=r,this},getNormalMatrix:function(r){return this.setFromMatrix4(r).getInverse(this).transpose()},transposeIntoArray:function(r){var e=this.elements;return r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],this},fromArray:function(r,e){e===void 0&&(e=0);for(var t=0;t<9;t++)this.elements[t]=r[t+e];return this},toArray:function(r,e){r===void 0&&(r=[]),e===void 0&&(e=0);var t=this.elements;return r[e]=t[0],r[e+1]=t[1],r[e+2]=t[2],r[e+3]=t[3],r[e+4]=t[4],r[e+5]=t[5],r[e+6]=t[6],r[e+7]=t[7],r[e+8]=t[8],r}};xs.prototype={constructor:xs,set:function(r,e){return this.normal.copy(r),this.constant=e,this},setComponents:function(r,e,t,i){return this.normal.set(r,e,t),this.constant=i,this},setFromNormalAndCoplanarPoint:function(r,e){return this.normal.copy(r),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var r=new oe,e=new oe;return function(i,n,a){var o=r.subVectors(a,n).cross(e.subVectors(i,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),this}}(),clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.normal.copy(r.normal),this.constant=r.constant,this},normalize:function(){var r=1/this.normal.length();return this.normal.multiplyScalar(r),this.constant*=r,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(r){return this.normal.dot(r)+this.constant},distanceToSphere:function(r){return this.distanceToPoint(r.center)-r.radius},projectPoint:function(r,e){return this.orthoPoint(r,e).sub(r).negate()},orthoPoint:function(r,e){var t=this.distanceToPoint(r),i=e||new oe;return i.copy(this.normal).multiplyScalar(t)},intersectLine:function(){var r=new oe;return function(t,i){var n=i||new oe,a=t.delta(r),o=this.normal.dot(a);if(o===0)return this.distanceToPoint(t.start)===0?n.copy(t.start):void 0;var s=-(t.start.dot(this.normal)+this.constant)/o;if(!(s<0||s>1))return n.copy(a).multiplyScalar(s).add(t.start)}}(),intersectsLine:function(r){var e=this.distanceToPoint(r.start),t=this.distanceToPoint(r.end);return e<0&&t>0||t<0&&e>0},intersectsBox:function(r){return r.intersectsPlane(this)},intersectsSphere:function(r){return r.intersectsPlane(this)},coplanarPoint:function(r){var e=r||new oe;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var r=new oe,e=new dl;return function(i,n){var a=this.coplanarPoint(r).applyMatrix4(i),o=n||e.getNormalMatrix(i),s=this.normal.applyMatrix3(o).normalize();return this.constant=-a.dot(s),this}}(),translate:function(r){return this.constant=this.constant-r.dot(this.normal),this},equals:function(r){return r.normal.equals(this.normal)&&r.constant===this.constant}};kM.prototype={constructor:kM,set:function(r,e,t,i,n,a){var o=this.planes;return o[0].copy(r),o[1].copy(e),o[2].copy(t),o[3].copy(i),o[4].copy(n),o[5].copy(a),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){for(var e=this.planes,t=0;t<6;t++)e[t].copy(r.planes[t]);return this},setFromMatrix:function(r){var e=this.planes,t=r.elements,i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],p=t[10],d=t[11],g=t[12],m=t[13],v=t[14],_=t[15];return e[0].setComponents(o-i,c-s,d-h,_-g).normalize(),e[1].setComponents(o+i,c+s,d+h,_+g).normalize(),e[2].setComponents(o+n,c+l,d+f,_+m).normalize(),e[3].setComponents(o-n,c-l,d-f,_-m).normalize(),e[4].setComponents(o-a,c-u,d-p,_-v).normalize(),e[5].setComponents(o+a,c+u,d+p,_+v).normalize(),this},intersectsObject:function(){var r=new ha;return function(t){var i=t.geometry;return i.boundingSphere===null&&i.computeBoundingSphere(),r.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSprite:function(){var r=new ha;return function(t){return r.center.set(0,0,0),r.radius=.7071067811865476,r.applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSphere:function(r){for(var e=this.planes,t=r.center,i=-r.radius,n=0;n<6;n++){var a=e[n].distanceToPoint(t);if(a<i)return!1}return!0},intersectsBox:function(){var r=new oe,e=new oe;return function(i){for(var n=this.planes,a=0;a<6;a++){var o=n[a];r.x=o.normal.x>0?i.min.x:i.max.x,e.x=o.normal.x>0?i.max.x:i.min.x,r.y=o.normal.y>0?i.min.y:i.max.y,e.y=o.normal.y>0?i.max.y:i.min.y,r.z=o.normal.z>0?i.min.z:i.max.z,e.z=o.normal.z>0?i.max.z:i.min.z;var s=o.distanceToPoint(r),l=o.distanceToPoint(e);if(s<0&&l<0)return!1}return!0}}(),containsPoint:function(r){for(var e=this.planes,t=0;t<6;t++)if(e[t].distanceToPoint(r)<0)return!1;return!0}};Qf.prototype={constructor:Qf,set:function(r,e){return this.origin.copy(r),this.direction.copy(e),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.origin.copy(r.origin),this.direction.copy(r.direction),this},at:function(r,e){var t=e||new oe;return t.copy(this.direction).multiplyScalar(r).add(this.origin)},lookAt:function(r){return this.direction.copy(r).sub(this.origin).normalize(),this},recast:function(){var r=new oe;return function(t){return this.origin.copy(this.at(t,r)),this}}(),closestPointToPoint:function(r,e){var t=e||new oe;t.subVectors(r,this.origin);var i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(r){return Math.sqrt(this.distanceSqToPoint(r))},distanceSqToPoint:function(){var r=new oe;return function(t){var i=r.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(r.copy(this.direction).multiplyScalar(i).add(this.origin),r.distanceToSquared(t))}}(),distanceSqToSegment:function(){var r=new oe,e=new oe,t=new oe;return function(n,a,o,s){r.copy(n).add(a).multiplyScalar(.5),e.copy(a).sub(n).normalize(),t.copy(this.origin).sub(r);var l=n.distanceTo(a)*.5,u=-this.direction.dot(e),c=t.dot(this.direction),h=-t.dot(e),f=t.lengthSq(),p=Math.abs(1-u*u),d,g,m,v;if(p>0)if(d=u*h-c,g=u*c-h,v=l*p,d>=0)if(g>=-v)if(g<=v){var _=1/p;d*=_,g*=_,m=d*(d+u*g+2*c)+g*(u*d+g+2*h)+f}else g=l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*h)+f;else g=-l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*h)+f;else g<=-v?(d=Math.max(0,-(-u*l+c)),g=d>0?-l:Math.min(Math.max(-l,-h),l),m=-d*d+g*(g+2*h)+f):g<=v?(d=0,g=Math.min(Math.max(-l,-h),l),m=g*(g+2*h)+f):(d=Math.max(0,-(u*l+c)),g=d>0?l:Math.min(Math.max(-l,-h),l),m=-d*d+g*(g+2*h)+f);else g=u>0?-l:l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*h)+f;return o&&o.copy(this.direction).multiplyScalar(d).add(this.origin),s&&s.copy(e).multiplyScalar(g).add(r),m}}(),intersectSphere:function(){var r=new oe;return function(t,i){r.subVectors(t.center,this.origin);var n=r.dot(this.direction),a=r.dot(r)-n*n,o=t.radius*t.radius;if(a>o)return null;var s=Math.sqrt(o-a),l=n-s,u=n+s;return l<0&&u<0?null:l<0?this.at(u,i):this.at(l,i)}}(),intersectsSphere:function(r){return this.distanceToPoint(r.center)<=r.radius},distanceToPlane:function(r){var e=r.normal.dot(this.direction);if(e===0)return r.distanceToPoint(this.origin)===0?0:null;var t=-(this.origin.dot(r.normal)+r.constant)/e;return t>=0?t:null},intersectPlane:function(r,e){var t=this.distanceToPlane(r);return t===null?null:this.at(t,e)},intersectsPlane:function(r){var e=r.distanceToPoint(this.origin);if(e===0)return!0;var t=r.normal.dot(this.direction);return t*e<0},intersectBox:function(r,e){var t,i,n,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return l>=0?(t=(r.min.x-h.x)*l,i=(r.max.x-h.x)*l):(t=(r.max.x-h.x)*l,i=(r.min.x-h.x)*l),u>=0?(n=(r.min.y-h.y)*u,a=(r.max.y-h.y)*u):(n=(r.max.y-h.y)*u,a=(r.min.y-h.y)*u),t>a||n>i||((n>t||t!==t)&&(t=n),(a<i||i!==i)&&(i=a),c>=0?(o=(r.min.z-h.z)*c,s=(r.max.z-h.z)*c):(o=(r.max.z-h.z)*c,s=(r.min.z-h.z)*c),t>s||o>i)||((o>t||t!==t)&&(t=o),(s<i||i!==i)&&(i=s),i<0)?null:this.at(t>=0?t:i,e)},intersectsBox:function(){var r=new oe;return function(t){return this.intersectBox(t,r)!==null}}(),intersectTriangle:function(){var r=new oe,e=new oe,t=new oe,i=new oe;return function(a,o,s,l,u){e.subVectors(o,a),t.subVectors(s,a),i.crossVectors(e,t);var c=this.direction.dot(i),h;if(c>0){if(l)return null;h=1}else if(c<0)h=-1,c=-c;else return null;r.subVectors(this.origin,a);var f=h*this.direction.dot(t.crossVectors(r,t));if(f<0)return null;var p=h*this.direction.dot(e.cross(r));if(p<0||f+p>c)return null;var d=-h*r.dot(i);return d<0?null:this.at(d/c,u)}}(),applyMatrix4:function(r){return this.direction.add(this.origin).applyMatrix4(r),this.origin.applyMatrix4(r),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(r){return r.origin.equals(this.origin)&&r.direction.equals(this.direction)}};ep.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];ep.DefaultOrder="XYZ";ep.prototype={constructor:ep,isEuler:!0,get x(){return this._x},set x(r){this._x=r,this.onChangeCallback()},get y(){return this._y},set y(r){this._y=r,this.onChangeCallback()},get z(){return this._z},set z(r){this._z=r,this.onChangeCallback()},get order(){return this._order},set order(r){this._order=r,this.onChangeCallback()},set:function(r,e,t,i){return this._x=r,this._y=e,this._z=t,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(r){return this._x=r._x,this._y=r._y,this._z=r._z,this._order=r._order,this.onChangeCallback(),this},setFromRotationMatrix:function(r,e,t){var i=fr.clamp,n=r.elements,a=n[0],o=n[4],s=n[8],l=n[1],u=n[5],c=n[9],h=n[2],f=n[6],p=n[10];return e=e||this._order,e==="XYZ"?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(f,u),this._z=0)):e==="YXZ"?(this._x=Math.asin(-i(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,a),this._z=0)):e==="ZXY"?(this._x=Math.asin(i(f,-1,1)),Math.abs(f)<.99999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,a))):e==="ZYX"?(this._y=Math.asin(-i(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,u))):e==="YZX"?(this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,p))):e==="XZY"?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(f,u),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,t!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var r;return function(t,i,n){return r===void 0&&(r=new Kt),r.makeRotationFromQuaternion(t),this.setFromRotationMatrix(r,i,n)}}(),setFromVector3:function(r,e){return this.set(r.x,r.y,r.z,e||this._order)},reorder:function(){var r=new cn;return function(t){return r.setFromEuler(this),this.setFromQuaternion(r,t)}}(),equals:function(r){return r._x===this._x&&r._y===this._y&&r._z===this._z&&r._order===this._order},fromArray:function(r){return this._x=r[0],this._y=r[1],this._z=r[2],r[3]!==void 0&&(this._order=r[3]),this.onChangeCallback(),this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this._x,r[e+1]=this._y,r[e+2]=this._z,r[e+3]=this._order,r},toVector3:function(r){return r?r.set(this._x,this._y,this._z):new oe(this._x,this._y,this._z)},onChange:function(r){return this.onChangeCallback=r,this},onChangeCallback:function(){}};$R.prototype={constructor:$R,set:function(r){this.mask=1<<r},enable:function(r){this.mask|=1<<r},toggle:function(r){this.mask^=1<<r},disable:function(r){this.mask&=~(1<<r)},test:function(r){return(this.mask&r.mask)!==0}};vOe=0;Lt.DefaultUp=new oe(0,1,0);Lt.DefaultMatrixAutoUpdate=!0;Object.assign(Lt.prototype,pl.prototype,{isObject3D:!0,applyMatrix:function(r){this.matrix.multiplyMatrices(r,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(r,e){this.quaternion.setFromAxisAngle(r,e)},setRotationFromEuler:function(r){this.quaternion.setFromEuler(r,!0)},setRotationFromMatrix:function(r){this.quaternion.setFromRotationMatrix(r)},setRotationFromQuaternion:function(r){this.quaternion.copy(r)},rotateOnAxis:function(){var r=new cn;return function(t,i){return r.setFromAxisAngle(t,i),this.quaternion.multiply(r),this}}(),rotateX:function(){var r=new oe(1,0,0);return function(t){return this.rotateOnAxis(r,t)}}(),rotateY:function(){var r=new oe(0,1,0);return function(t){return this.rotateOnAxis(r,t)}}(),rotateZ:function(){var r=new oe(0,0,1);return function(t){return this.rotateOnAxis(r,t)}}(),translateOnAxis:function(){var r=new oe;return function(t,i){return r.copy(t).applyQuaternion(this.quaternion),this.position.add(r.multiplyScalar(i)),this}}(),translateX:function(){var r=new oe(1,0,0);return function(t){return this.translateOnAxis(r,t)}}(),translateY:function(){var r=new oe(0,1,0);return function(t){return this.translateOnAxis(r,t)}}(),translateZ:function(){var r=new oe(0,0,1);return function(t){return this.translateOnAxis(r,t)}}(),localToWorld:function(r){return r.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var r=new Kt;return function(t){return t.applyMatrix4(r.getInverse(this.matrixWorld))}}(),lookAt:function(){var r=new Kt;return function(t){r.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(r)}}(),add:function(r){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return r===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",r),this):(r&&r.isObject3D?(r.parent!==null&&r.parent.remove(r),r.parent=this,r.dispatchEvent({type:"added"}),this.children.push(r)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",r),this)},remove:function(r){if(arguments.length>1)for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);var t=this.children.indexOf(r);t!==-1&&(r.parent=null,r.dispatchEvent({type:"removed"}),this.children.splice(t,1))},getObjectById:function(r){return this.getObjectByProperty("id",r)},getObjectByName:function(r){return this.getObjectByProperty("name",r)},getObjectByProperty:function(r,e){if(this[r]===e)return this;for(var t=0,i=this.children.length;t<i;t++){var n=this.children[t],a=n.getObjectByProperty(r,e);if(a!==void 0)return a}},getWorldPosition:function(r){var e=r||new oe;return this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var r=new oe,e=new oe;return function(i){var n=i||new cn;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(r,n,e),n}}(),getWorldRotation:function(){var r=new cn;return function(t){var i=t||new ep;return this.getWorldQuaternion(r),i.setFromQuaternion(r,this.rotation.order,!1)}}(),getWorldScale:function(){var r=new oe,e=new cn;return function(i){var n=i||new oe;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(r,e,n),n}}(),getWorldDirection:function(){var r=new cn;return function(t){var i=t||new oe;return this.getWorldQuaternion(r),i.set(0,0,1).applyQuaternion(r)}}(),raycast:function(){},traverse:function(r){r(this);for(var e=this.children,t=0,i=e.length;t<i;t++)e[t].traverse(r)},traverseVisible:function(r){if(this.visible!==!1){r(this);for(var e=this.children,t=0,i=e.length;t<i;t++)e[t].traverseVisible(r)}},traverseAncestors:function(r){var e=this.parent;e!==null&&(r(e),e.traverseAncestors(r))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(r){this.matrixAutoUpdate===!0&&this.updateMatrix(),(this.matrixWorldNeedsUpdate===!0||r===!0)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,r=!0);for(var e=this.children,t=0,i=e.length;t<i;t++)e[t].updateMatrixWorld(r)},toJSON:function(r){var e=r===void 0||r==="",t={};e&&(r={geometries:{},materials:{},textures:{},images:{}},t.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var i={};if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),i.matrix=this.matrix.toArray(),this.geometry!==void 0&&(r.geometries[this.geometry.uuid]===void 0&&(r.geometries[this.geometry.uuid]=this.geometry.toJSON(r)),i.geometry=this.geometry.uuid),this.material!==void 0&&(r.materials[this.material.uuid]===void 0&&(r.materials[this.material.uuid]=this.material.toJSON(r)),i.material=this.material.uuid),this.children.length>0){i.children=[];for(var n=0;n<this.children.length;n++)i.children.push(this.children[n].toJSON(r).object)}if(e){var a=u(r.geometries),o=u(r.materials),s=u(r.textures),l=u(r.images);a.length>0&&(t.geometries=a),o.length>0&&(t.materials=o),s.length>0&&(t.textures=s),l.length>0&&(t.images=l)}return t.object=i,t;function u(c){var h=[];for(var f in c){var p=c[f];delete p.metadata,h.push(p)}return h}},clone:function(r){return new this.constructor().copy(this,r)},copy:function(r,e){if(e===void 0&&(e=!0),this.name=r.name,this.up.copy(r.up),this.position.copy(r.position),this.quaternion.copy(r.quaternion),this.scale.copy(r.scale),this.matrix.copy(r.matrix),this.matrixWorld.copy(r.matrixWorld),this.matrixAutoUpdate=r.matrixAutoUpdate,this.matrixWorldNeedsUpdate=r.matrixWorldNeedsUpdate,this.layers.mask=r.layers.mask,this.visible=r.visible,this.castShadow=r.castShadow,this.receiveShadow=r.receiveShadow,this.frustumCulled=r.frustumCulled,this.renderOrder=r.renderOrder,this.userData=JSON.parse(JSON.stringify(r.userData)),e===!0)for(var t=0;t<r.children.length;t++){var i=r.children[t];this.add(i.clone())}return this}});rm.prototype={constructor:rm,set:function(r,e){return this.start.copy(r),this.end.copy(e),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.start.copy(r.start),this.end.copy(r.end),this},getCenter:function(r){var e=r||new oe;return e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(r){var e=r||new oe;return e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(r,e){var t=e||new oe;return this.delta(t).multiplyScalar(r).add(this.start)},closestPointToPointParameter:function(){var r=new oe,e=new oe;return function(i,n){r.subVectors(i,this.start),e.subVectors(this.end,this.start);var a=e.dot(e),o=e.dot(r),s=o/a;return n&&(s=fr.clamp(s,0,1)),s}}(),closestPointToPoint:function(r,e,t){var i=this.closestPointToPointParameter(r,e),n=t||new oe;return this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(r){return this.start.applyMatrix4(r),this.end.applyMatrix4(r),this},equals:function(r){return r.start.equals(this.start)&&r.end.equals(this.end)}};fl.normal=function(){var r=new oe;return function(t,i,n,a){var o=a||new oe;o.subVectors(n,i),r.subVectors(t,i),o.cross(r);var s=o.lengthSq();return s>0?o.multiplyScalar(1/Math.sqrt(s)):o.set(0,0,0)}}();fl.barycoordFromPoint=function(){var r=new oe,e=new oe,t=new oe;return function(n,a,o,s,l){r.subVectors(s,a),e.subVectors(o,a),t.subVectors(n,a);var u=r.dot(r),c=r.dot(e),h=r.dot(t),f=e.dot(e),p=e.dot(t),d=u*f-c*c,g=l||new oe;if(d===0)return g.set(-2,-1,-1);var m=1/d,v=(f*h-c*p)*m,_=(u*p-c*h)*m;return g.set(1-v-_,_,v)}}();fl.containsPoint=function(){var r=new oe;return function(t,i,n,a){var o=fl.barycoordFromPoint(t,i,n,a,r);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}();fl.prototype={constructor:fl,set:function(r,e,t){return this.a.copy(r),this.b.copy(e),this.c.copy(t),this},setFromPointsAndIndices:function(r,e,t,i){return this.a.copy(r[e]),this.b.copy(r[t]),this.c.copy(r[i]),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.a.copy(r.a),this.b.copy(r.b),this.c.copy(r.c),this},area:function(){var r=new oe,e=new oe;return function(){return r.subVectors(this.c,this.b),e.subVectors(this.a,this.b),r.cross(e).length()*.5}}(),midpoint:function(r){var e=r||new oe;return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(r){return fl.normal(this.a,this.b,this.c,r)},plane:function(r){var e=r||new xs;return e.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(r,e){return fl.barycoordFromPoint(r,this.a,this.b,this.c,e)},containsPoint:function(r){return fl.containsPoint(r,this.a,this.b,this.c)},closestPointToPoint:function(){var r,e,t,i;return function(a,o){r===void 0&&(r=new xs,e=[new rm,new rm,new rm],t=new oe,i=new oe);var s=o||new oe,l=1/0;if(r.setFromCoplanarPoints(this.a,this.b,this.c),r.projectPoint(a,t),this.containsPoint(t)===!0)s.copy(t);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var u=0;u<e.length;u++){e[u].closestPointToPoint(t,!0,i);var c=t.distanceToSquared(i);c<l&&(l=c,s.copy(i))}}return s}}(),equals:function(r){return r.a.equals(this.a)&&r.b.equals(this.b)&&r.c.equals(this.c)}};ws.prototype={constructor:ws,clone:function(){return new this.constructor().copy(this)},copy:function(r){this.a=r.a,this.b=r.b,this.c=r.c,this.normal.copy(r.normal),this.color.copy(r.color),this.materialIndex=r.materialIndex;for(var e=0,t=r.vertexNormals.length;e<t;e++)this.vertexNormals[e]=r.vertexNormals[e].clone();for(var e=0,t=r.vertexColors.length;e<t;e++)this.vertexColors[e]=r.vertexColors[e].clone();return this}};jo.prototype=Object.create(_r.prototype);jo.prototype.constructor=jo;jo.prototype.isMeshBasicMaterial=!0;jo.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.color.copy(r.color),this.map=r.map,this.lightMap=r.lightMap,this.lightMapIntensity=r.lightMapIntensity,this.aoMap=r.aoMap,this.aoMapIntensity=r.aoMapIntensity,this.specularMap=r.specularMap,this.alphaMap=r.alphaMap,this.envMap=r.envMap,this.combine=r.combine,this.reflectivity=r.reflectivity,this.refractionRatio=r.refractionRatio,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.wireframeLinecap=r.wireframeLinecap,this.wireframeLinejoin=r.wireframeLinejoin,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this};Mt.prototype={constructor:Mt,isBufferAttribute:!0,set needsUpdate(r){r===!0&&this.version++},setArray:function(r){if(Array.isArray(r))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=r!==void 0?r.length/this.itemSize:0,this.array=r},setDynamic:function(r){return this.dynamic=r,this},copy:function(r){return this.array=new r.array.constructor(r.array),this.itemSize=r.itemSize,this.count=r.count,this.normalized=r.normalized,this.dynamic=r.dynamic,this},copyAt:function(r,e,t){r*=this.itemSize,t*=e.itemSize;for(var i=0,n=this.itemSize;i<n;i++)this.array[r+i]=e.array[t+i];return this},copyArray:function(r){return this.array.set(r),this},copyColorsArray:function(r){for(var e=this.array,t=0,i=0,n=r.length;i<n;i++){var a=r[i];a===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new Wt),e[t++]=a.r,e[t++]=a.g,e[t++]=a.b}return this},copyIndicesArray:function(r){for(var e=this.array,t=0,i=0,n=r.length;i<n;i++){var a=r[i];e[t++]=a.a,e[t++]=a.b,e[t++]=a.c}return this},copyVector2sArray:function(r){for(var e=this.array,t=0,i=0,n=r.length;i<n;i++){var a=r[i];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new Tt),e[t++]=a.x,e[t++]=a.y}return this},copyVector3sArray:function(r){for(var e=this.array,t=0,i=0,n=r.length;i<n;i++){var a=r[i];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new oe),e[t++]=a.x,e[t++]=a.y,e[t++]=a.z}return this},copyVector4sArray:function(r){for(var e=this.array,t=0,i=0,n=r.length;i<n;i++){var a=r[i];a===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new ii),e[t++]=a.x,e[t++]=a.y,e[t++]=a.z,e[t++]=a.w}return this},set:function(r,e){return e===void 0&&(e=0),this.array.set(r,e),this},getX:function(r){return this.array[r*this.itemSize]},setX:function(r,e){return this.array[r*this.itemSize]=e,this},getY:function(r){return this.array[r*this.itemSize+1]},setY:function(r,e){return this.array[r*this.itemSize+1]=e,this},getZ:function(r){return this.array[r*this.itemSize+2]},setZ:function(r,e){return this.array[r*this.itemSize+2]=e,this},getW:function(r){return this.array[r*this.itemSize+3]},setW:function(r,e){return this.array[r*this.itemSize+3]=e,this},setXY:function(r,e,t){return r*=this.itemSize,this.array[r+0]=e,this.array[r+1]=t,this},setXYZ:function(r,e,t,i){return r*=this.itemSize,this.array[r+0]=e,this.array[r+1]=t,this.array[r+2]=i,this},setXYZW:function(r,e,t,i,n){return r*=this.itemSize,this.array[r+0]=e,this.array[r+1]=t,this.array[r+2]=i,this.array[r+3]=n,this},onUpload:function(r){return this.onUploadCallback=r,this},clone:function(){return new this.constructor().copy(this)}};VM.prototype=Object.create(Mt.prototype);VM.prototype.constructor=VM;GM.prototype=Object.create(Mt.prototype);GM.prototype.constructor=GM;HM.prototype=Object.create(Mt.prototype);HM.prototype.constructor=HM;WM.prototype=Object.create(Mt.prototype);WM.prototype.constructor=WM;eh.prototype=Object.create(Mt.prototype);eh.prototype.constructor=eh;XM.prototype=Object.create(Mt.prototype);XM.prototype.constructor=XM;th.prototype=Object.create(Mt.prototype);th.prototype.constructor=th;Mr.prototype=Object.create(Mt.prototype);Mr.prototype.constructor=Mr;YM.prototype=Object.create(Mt.prototype);YM.prototype.constructor=YM;Object.assign(Lse.prototype,{computeGroups:function(r){for(var e,t=[],i=void 0,n=r.faces,a=0;a<n.length;a++){var o=n[a];o.materialIndex!==i&&(i=o.materialIndex,e!==void 0&&(e.count=a*3-e.start,t.push(e)),e={start:a*3,materialIndex:i})}e!==void 0&&(e.count=a*3-e.start,t.push(e)),this.groups=t},fromGeometry:function(r){var e=r.faces,t=r.vertices,i=r.faceVertexUvs,n=i[0]&&i[0].length>0,a=i[1]&&i[1].length>0,o=r.morphTargets,s=o.length,l;if(s>0){l=[];for(var u=0;u<s;u++)l[u]=[];this.morphTargets.position=l}var c=r.morphNormals,h=c.length,f;if(h>0){f=[];for(var u=0;u<h;u++)f[u]=[];this.morphTargets.normal=f}for(var p=r.skinIndices,d=r.skinWeights,g=p.length===t.length,m=d.length===t.length,u=0;u<e.length;u++){var v=e[u];this.vertices.push(t[v.a],t[v.b],t[v.c]);var _=v.vertexNormals;if(_.length===3)this.normals.push(_[0],_[1],_[2]);else{var y=v.normal;this.normals.push(y,y,y)}var x=v.vertexColors;if(x.length===3)this.colors.push(x[0],x[1],x[2]);else{var M=v.color;this.colors.push(M,M,M)}if(n===!0){var S=i[0][u];S!==void 0?this.uvs.push(S[0],S[1],S[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new Tt,new Tt,new Tt))}if(a===!0){var S=i[1][u];S!==void 0?this.uvs2.push(S[0],S[1],S[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new Tt,new Tt,new Tt))}for(var w=0;w<s;w++){var T=o[w].vertices;l[w].push(T[v.a],T[v.b],T[v.c])}for(var w=0;w<h;w++){var C=c[w].vertexNormals[u];f[w].push(C.a,C.b,C.c)}g&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),m&&this.skinWeights.push(d[v.a],d[v.b],d[v.c])}return this.computeGroups(r),this.verticesNeedUpdate=r.verticesNeedUpdate,this.normalsNeedUpdate=r.normalsNeedUpdate,this.colorsNeedUpdate=r.colorsNeedUpdate,this.uvsNeedUpdate=r.uvsNeedUpdate,this.groupsNeedUpdate=r.groupsNeedUpdate,this}});Object.assign(ur.prototype,pl.prototype,{isGeometry:!0,applyMatrix:function(r){for(var e=new dl().getNormalMatrix(r),t=0,i=this.vertices.length;t<i;t++){var n=this.vertices[t];n.applyMatrix4(r)}for(var t=0,i=this.faces.length;t<i;t++){var a=this.faces[t];a.normal.applyMatrix3(e).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(e).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.makeRotationX(t),this.applyMatrix(r),this}}(),rotateY:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.makeRotationY(t),this.applyMatrix(r),this}}(),rotateZ:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.makeRotationZ(t),this.applyMatrix(r),this}}(),translate:function(){var r;return function(t,i,n){return r===void 0&&(r=new Kt),r.makeTranslation(t,i,n),this.applyMatrix(r),this}}(),scale:function(){var r;return function(t,i,n){return r===void 0&&(r=new Kt),r.makeScale(t,i,n),this.applyMatrix(r),this}}(),lookAt:function(){var r;return function(t){r===void 0&&(r=new Lt),r.lookAt(t),r.updateMatrix(),this.applyMatrix(r.matrix)}}(),fromBufferGeometry:function(r){var e=this,t=r.index!==null?r.index.array:void 0,i=r.attributes,n=i.position.array,a=i.normal!==void 0?i.normal.array:void 0,o=i.color!==void 0?i.color.array:void 0,s=i.uv!==void 0?i.uv.array:void 0,l=i.uv2!==void 0?i.uv2.array:void 0;l!==void 0&&(this.faceVertexUvs[1]=[]);for(var u=[],c=[],h=[],f=0,p=0;f<n.length;f+=3,p+=2)e.vertices.push(new oe(n[f],n[f+1],n[f+2])),a!==void 0&&u.push(new oe(a[f],a[f+1],a[f+2])),o!==void 0&&e.colors.push(new Wt(o[f],o[f+1],o[f+2])),s!==void 0&&c.push(new Tt(s[p],s[p+1])),l!==void 0&&h.push(new Tt(l[p],l[p+1]));function d(x,M,S,w){var T=a!==void 0?[u[x].clone(),u[M].clone(),u[S].clone()]:[],C=o!==void 0?[e.colors[x].clone(),e.colors[M].clone(),e.colors[S].clone()]:[],b=new ws(x,M,S,T,C,w);e.faces.push(b),s!==void 0&&e.faceVertexUvs[0].push([c[x].clone(),c[M].clone(),c[S].clone()]),l!==void 0&&e.faceVertexUvs[1].push([h[x].clone(),h[M].clone(),h[S].clone()])}if(t!==void 0){var g=r.groups;if(g.length>0)for(var f=0;f<g.length;f++)for(var m=g[f],v=m.start,_=m.count,p=v,y=v+_;p<y;p+=3)d(t[p],t[p+1],t[p+2],m.materialIndex);else for(var f=0;f<t.length;f+=3)d(t[f],t[f+1],t[f+2])}else for(var f=0;f<n.length/3;f+=3)d(f,f+1,f+2);return this.computeFaceNormals(),r.boundingBox!==null&&(this.boundingBox=r.boundingBox.clone()),r.boundingSphere!==null&&(this.boundingSphere=r.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var r=this.boundingBox.getCenter().negate();return this.translate(r.x,r.y,r.z),r},normalize:function(){this.computeBoundingSphere();var r=this.boundingSphere.center,e=this.boundingSphere.radius,t=e===0?1:1/e,i=new Kt;return i.set(t,0,0,-t*r.x,0,t,0,-t*r.y,0,0,t,-t*r.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var r=new oe,e=new oe,t=0,i=this.faces.length;t<i;t++){var n=this.faces[t],a=this.vertices[n.a],o=this.vertices[n.b],s=this.vertices[n.c];r.subVectors(s,o),e.subVectors(a,o),r.cross(e),r.normalize(),n.normal.copy(r)}},computeVertexNormals:function(r){r===void 0&&(r=!0);var e,t,i,n,a,o;for(o=new Array(this.vertices.length),e=0,t=this.vertices.length;e<t;e++)o[e]=new oe;if(r){var s,l,u,c=new oe,h=new oe;for(i=0,n=this.faces.length;i<n;i++)a=this.faces[i],s=this.vertices[a.a],l=this.vertices[a.b],u=this.vertices[a.c],c.subVectors(u,l),h.subVectors(s,l),c.cross(h),o[a.a].add(c),o[a.b].add(c),o[a.c].add(c)}else for(this.computeFaceNormals(),i=0,n=this.faces.length;i<n;i++)a=this.faces[i],o[a.a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,t=this.vertices.length;e<t;e++)o[e].normalize();for(i=0,n=this.faces.length;i<n;i++){a=this.faces[i];var f=a.vertexNormals;f.length===3?(f[0].copy(o[a.a]),f[1].copy(o[a.b]),f[2].copy(o[a.c])):(f[0]=o[a.a].clone(),f[1]=o[a.b].clone(),f[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var r,e,t;for(this.computeFaceNormals(),r=0,e=this.faces.length;r<e;r++){t=this.faces[r];var i=t.vertexNormals;i.length===3?(i[0].copy(t.normal),i[1].copy(t.normal),i[2].copy(t.normal)):(i[0]=t.normal.clone(),i[1]=t.normal.clone(),i[2]=t.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var r,e,t,i,n;for(t=0,i=this.faces.length;t<i;t++)for(n=this.faces[t],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),r=0,e=n.vertexNormals.length;r<e;r++)n.__originalVertexNormals[r]?n.__originalVertexNormals[r].copy(n.vertexNormals[r]):n.__originalVertexNormals[r]=n.vertexNormals[r].clone();var a=new ur;for(a.faces=this.faces,r=0,e=this.morphTargets.length;r<e;r++){if(!this.morphNormals[r]){this.morphNormals[r]={},this.morphNormals[r].faceNormals=[],this.morphNormals[r].vertexNormals=[];var o=this.morphNormals[r].faceNormals,s=this.morphNormals[r].vertexNormals,u,c;for(t=0,i=this.faces.length;t<i;t++)u=new oe,c={a:new oe,b:new oe,c:new oe},o.push(u),s.push(c)}var l=this.morphNormals[r];a.vertices=this.morphTargets[r].vertices,a.computeFaceNormals(),a.computeVertexNormals();var u,c;for(t=0,i=this.faces.length;t<i;t++)n=this.faces[t],u=l.faceNormals[t],c=l.vertexNormals[t],u.copy(n.normal),c.a.copy(n.vertexNormals[0]),c.b.copy(n.vertexNormals[1]),c.c.copy(n.vertexNormals[2])}for(t=0,i=this.faces.length;t<i;t++)n=this.faces[t],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeLineDistances:function(){for(var r=0,e=this.vertices,t=0,i=e.length;t<i;t++)t>0&&(r+=e[t].distanceTo(e[t-1])),this.lineDistances[t]=r},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new Zu),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new ha),this.boundingSphere.setFromPoints(this.vertices)},merge:function(r,e,t){if((r&&r.isGeometry)===!1){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",r);return}var i,n=this.vertices.length,a=this.vertices,o=r.vertices,s=this.faces,l=r.faces,u=this.faceVertexUvs[0],c=r.faceVertexUvs[0],h=this.colors,f=r.colors;t===void 0&&(t=0),e!==void 0&&(i=new dl().getNormalMatrix(e));for(var p=0,d=o.length;p<d;p++){var g=o[p],m=g.clone();e!==void 0&&m.applyMatrix4(e),a.push(m)}for(var p=0,d=f.length;p<d;p++)h.push(f[p].clone());for(p=0,d=l.length;p<d;p++){var v=l[p],_,y,x,M=v.vertexNormals,S=v.vertexColors;_=new ws(v.a+n,v.b+n,v.c+n),_.normal.copy(v.normal),i!==void 0&&_.normal.applyMatrix3(i).normalize();for(var w=0,T=M.length;w<T;w++)y=M[w].clone(),i!==void 0&&y.applyMatrix3(i).normalize(),_.vertexNormals.push(y);_.color.copy(v.color);for(var w=0,T=S.length;w<T;w++)x=S[w],_.vertexColors.push(x.clone());_.materialIndex=v.materialIndex+t,s.push(_)}for(p=0,d=c.length;p<d;p++){var C=c[p],b=[];if(C!==void 0){for(var w=0,T=C.length;w<T;w++)b.push(C[w].clone());u.push(b)}}},mergeMesh:function(r){if((r&&r.isMesh)===!1){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",r);return}r.matrixAutoUpdate&&r.updateMatrix(),this.merge(r.geometry,r.matrix)},mergeVertices:function(){var r={},e=[],t=[],i,n,a=4,o=Math.pow(10,a),s,l,u,c,h,f;for(s=0,l=this.vertices.length;s<l;s++)i=this.vertices[s],n=Math.round(i.x*o)+"_"+Math.round(i.y*o)+"_"+Math.round(i.z*o),r[n]===void 0?(r[n]=s,e.push(this.vertices[s]),t[s]=e.length-1):t[s]=t[r[n]];var p=[];for(s=0,l=this.faces.length;s<l;s++){u=this.faces[s],u.a=t[u.a],u.b=t[u.b],u.c=t[u.c],c=[u.a,u.b,u.c];for(var d=-1,g=0;g<3;g++)if(c[g]===c[(g+1)%3]){d=g,p.push(s);break}}for(s=p.length-1;s>=0;s--){var m=p[s];for(this.faces.splice(m,1),h=0,f=this.faceVertexUvs.length;h<f;h++)this.faceVertexUvs[h].splice(m,1)}var v=this.vertices.length-e.length;return this.vertices=e,v},sortFacesByMaterialIndex:function(){for(var r=this.faces,e=r.length,t=0;t<e;t++)r[t]._id=t;function i(u,c){return u.materialIndex-c.materialIndex}r.sort(i);var n=this.faceVertexUvs[0],a=this.faceVertexUvs[1],o,s;n&&n.length===e&&(o=[]),a&&a.length===e&&(s=[]);for(var t=0;t<e;t++){var l=r[t]._id;o&&o.push(n[l]),s&&s.push(a[l])}o&&(this.faceVertexUvs[0]=o),s&&(this.faceVertexUvs[1]=s)},toJSON:function(){var r={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.parameters!==void 0){var e=this.parameters;for(var t in e)e[t]!==void 0&&(r[t]=e[t]);return r}for(var i=[],n=0;n<this.vertices.length;n++){var a=this.vertices[n];i.push(a.x,a.y,a.z)}for(var o=[],s=[],l={},u=[],c={},h=[],f={},n=0;n<this.faces.length;n++){var p=this.faces[n],d=!0,g=!1,m=this.faceVertexUvs[0][n]!==void 0,v=p.normal.length()>0,_=p.vertexNormals.length>0,y=p.color.r!==1||p.color.g!==1||p.color.b!==1,x=p.vertexColors.length>0,M=0;if(M=C(M,0,0),M=C(M,1,d),M=C(M,2,g),M=C(M,3,m),M=C(M,4,v),M=C(M,5,_),M=C(M,6,y),M=C(M,7,x),o.push(M),o.push(p.a,p.b,p.c),o.push(p.materialIndex),m){var S=this.faceVertexUvs[0][n];o.push(I(S[0]),I(S[1]),I(S[2]))}if(v&&o.push(b(p.normal)),_){var w=p.vertexNormals;o.push(b(w[0]),b(w[1]),b(w[2]))}if(y&&o.push(E(p.color)),x){var T=p.vertexColors;o.push(E(T[0]),E(T[1]),E(T[2]))}}function C(R,A,P){return P?R|1<<A:R&~(1<<A)}function b(R){var A=R.x.toString()+R.y.toString()+R.z.toString();return l[A]!==void 0||(l[A]=s.length/3,s.push(R.x,R.y,R.z)),l[A]}function E(R){var A=R.r.toString()+R.g.toString()+R.b.toString();return c[A]!==void 0||(c[A]=u.length,u.push(R.getHex())),c[A]}function I(R){var A=R.x.toString()+R.y.toString();return f[A]!==void 0||(f[A]=h.length/2,h.push(R.x,R.y)),f[A]}return r.data={},r.data.vertices=i,r.data.normals=s,u.length>0&&(r.data.colors=u),h.length>0&&(r.data.uvs=[h]),r.data.faces=o,r},clone:function(){return new ur().copy(this)},copy:function(r){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]],this.colors=[];for(var e=r.vertices,t=0,i=e.length;t<i;t++)this.vertices.push(e[t].clone());for(var n=r.colors,t=0,i=n.length;t<i;t++)this.colors.push(n[t].clone());for(var a=r.faces,t=0,i=a.length;t<i;t++)this.faces.push(a[t].clone());for(var t=0,i=r.faceVertexUvs.length;t<i;t++){var o=r.faceVertexUvs[t];this.faceVertexUvs[t]===void 0&&(this.faceVertexUvs[t]=[]);for(var s=0,l=o.length;s<l;s++){for(var u=o[s],c=[],h=0,f=u.length;h<f;h++){var p=u[h];c.push(p.clone())}this.faceVertexUvs[t].push(c)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});gOe=0;Object.assign(Vt.prototype,pl.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(r){this.index=r},addAttribute:function(r,e){if((e&&e.isBufferAttribute)===!1&&(e&&e.isInterleavedBufferAttribute)===!1){console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(r,new Mt(arguments[1],arguments[2]));return}if(r==="index"){console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e);return}return this.attributes[r]=e,this},getAttribute:function(r){return this.attributes[r]},removeAttribute:function(r){return delete this.attributes[r],this},addGroup:function(r,e,t){this.groups.push({start:r,count:e,materialIndex:t!==void 0?t:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(r,e){this.drawRange.start=r,this.drawRange.count=e},applyMatrix:function(r){var e=this.attributes.position;e!==void 0&&(r.applyToVector3Array(e.array),e.needsUpdate=!0);var t=this.attributes.normal;if(t!==void 0){var i=new dl().getNormalMatrix(r);i.applyToVector3Array(t.array),t.needsUpdate=!0}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},rotateX:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.makeRotationX(t),this.applyMatrix(r),this}}(),rotateY:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.makeRotationY(t),this.applyMatrix(r),this}}(),rotateZ:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.makeRotationZ(t),this.applyMatrix(r),this}}(),translate:function(){var r;return function(t,i,n){return r===void 0&&(r=new Kt),r.makeTranslation(t,i,n),this.applyMatrix(r),this}}(),scale:function(){var r;return function(t,i,n){return r===void 0&&(r=new Kt),r.makeScale(t,i,n),this.applyMatrix(r),this}}(),lookAt:function(){var r;return function(t){r===void 0&&(r=new Lt),r.lookAt(t),r.updateMatrix(),this.applyMatrix(r.matrix)}}(),center:function(){this.computeBoundingBox();var r=this.boundingBox.getCenter().negate();return this.translate(r.x,r.y,r.z),r},setFromObject:function(r){var e=r.geometry;if(r.isPoints||r.isLine){var t=new Mr(e.vertices.length*3,3),i=new Mr(e.colors.length*3,3);if(this.addAttribute("position",t.copyVector3sArray(e.vertices)),this.addAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var n=new Mr(e.lineDistances.length,1);this.addAttribute("lineDistance",n.copyArray(e.lineDistances))}e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone())}else r.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},updateFromObject:function(r){var e=r.geometry;if(r.isMesh){var t=e.__directGeometry;if(e.elementsNeedUpdate===!0&&(t=void 0,e.elementsNeedUpdate=!1),t===void 0)return this.fromGeometry(e);t.verticesNeedUpdate=e.verticesNeedUpdate,t.normalsNeedUpdate=e.normalsNeedUpdate,t.colorsNeedUpdate=e.colorsNeedUpdate,t.uvsNeedUpdate=e.uvsNeedUpdate,t.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=t}var i;return e.verticesNeedUpdate===!0&&(i=this.attributes.position,i!==void 0&&(i.copyVector3sArray(e.vertices),i.needsUpdate=!0),e.verticesNeedUpdate=!1),e.normalsNeedUpdate===!0&&(i=this.attributes.normal,i!==void 0&&(i.copyVector3sArray(e.normals),i.needsUpdate=!0),e.normalsNeedUpdate=!1),e.colorsNeedUpdate===!0&&(i=this.attributes.color,i!==void 0&&(i.copyColorsArray(e.colors),i.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(i=this.attributes.uv,i!==void 0&&(i.copyVector2sArray(e.uvs),i.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(i=this.attributes.lineDistance,i!==void 0&&(i.copyArray(e.lineDistances),i.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(r.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(r){return r.__directGeometry=new Lse().fromGeometry(r),this.fromDirectGeometry(r.__directGeometry)},fromDirectGeometry:function(r){var e=new Float32Array(r.vertices.length*3);if(this.addAttribute("position",new Mt(e,3).copyVector3sArray(r.vertices)),r.normals.length>0){var t=new Float32Array(r.normals.length*3);this.addAttribute("normal",new Mt(t,3).copyVector3sArray(r.normals))}if(r.colors.length>0){var i=new Float32Array(r.colors.length*3);this.addAttribute("color",new Mt(i,3).copyColorsArray(r.colors))}if(r.uvs.length>0){var n=new Float32Array(r.uvs.length*2);this.addAttribute("uv",new Mt(n,2).copyVector2sArray(r.uvs))}if(r.uvs2.length>0){var a=new Float32Array(r.uvs2.length*2);this.addAttribute("uv2",new Mt(a,2).copyVector2sArray(r.uvs2))}if(r.indices.length>0){var o=r.vertices.length>65535?Uint32Array:Uint16Array,s=new o(r.indices.length*3);this.setIndex(new Mt(s,1).copyIndicesArray(r.indices))}this.groups=r.groups;for(var l in r.morphTargets){for(var u=[],c=r.morphTargets[l],h=0,f=c.length;h<f;h++){var p=c[h],d=new Mr(p.length*3,3);u.push(d.copyVector3sArray(p))}this.morphAttributes[l]=u}if(r.skinIndices.length>0){var g=new Mr(r.skinIndices.length*4,4);this.addAttribute("skinIndex",g.copyVector4sArray(r.skinIndices))}if(r.skinWeights.length>0){var m=new Mr(r.skinWeights.length*4,4);this.addAttribute("skinWeight",m.copyVector4sArray(r.skinWeights))}return r.boundingSphere!==null&&(this.boundingSphere=r.boundingSphere.clone()),r.boundingBox!==null&&(this.boundingBox=r.boundingBox.clone()),this},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new Zu);var r=this.attributes.position;r!==void 0?this.boundingBox.setFromBufferAttribute(r):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 r=new Zu,e=new oe;return function(){this.boundingSphere===null&&(this.boundingSphere=new ha);var i=this.attributes.position;if(i){var n=this.boundingSphere.center;r.setFromBufferAttribute(i),r.getCenter(n);for(var a=0,o=0,s=i.count;o<s;o++)e.x=i.getX(o),e.y=i.getY(o),e.z=i.getZ(o),a=Math.max(a,n.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(a),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 r=this.index,e=this.attributes,t=this.groups;if(e.position){var i=e.position.array;if(e.normal===void 0)this.addAttribute("normal",new Mt(new Float32Array(i.length),3));else for(var n=e.normal.array,a=0,o=n.length;a<o;a++)n[a]=0;var s=e.normal.array,l,u,c,h=new oe,f=new oe,p=new oe,d=new oe,g=new oe;if(r){var m=r.array;t.length===0&&this.addGroup(0,m.length);for(var v=0,_=t.length;v<_;++v)for(var y=t[v],x=y.start,M=y.count,a=x,o=x+M;a<o;a+=3)l=m[a+0]*3,u=m[a+1]*3,c=m[a+2]*3,h.fromArray(i,l),f.fromArray(i,u),p.fromArray(i,c),d.subVectors(p,f),g.subVectors(h,f),d.cross(g),s[l]+=d.x,s[l+1]+=d.y,s[l+2]+=d.z,s[u]+=d.x,s[u+1]+=d.y,s[u+2]+=d.z,s[c]+=d.x,s[c+1]+=d.y,s[c+2]+=d.z}else for(var a=0,o=i.length;a<o;a+=9)h.fromArray(i,a),f.fromArray(i,a+3),p.fromArray(i,a+6),d.subVectors(p,f),g.subVectors(h,f),d.cross(g),s[a]=d.x,s[a+1]=d.y,s[a+2]=d.z,s[a+3]=d.x,s[a+4]=d.y,s[a+5]=d.z,s[a+6]=d.x,s[a+7]=d.y,s[a+8]=d.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(r,e){if((r&&r.isBufferGeometry)===!1){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",r);return}e===void 0&&(e=0);var t=this.attributes;for(var i in t)if(r.attributes[i]!==void 0)for(var n=t[i],a=n.array,o=r.attributes[i],s=o.array,l=o.itemSize,u=0,c=l*e;u<s.length;u++,c++)a[c]=s[u];return this},normalizeNormals:function(){for(var r=this.attributes.normal.array,e,t,i,n,a=0,o=r.length;a<o;a+=3)e=r[a],t=r[a+1],i=r[a+2],n=1/Math.sqrt(e*e+t*t+i*i),r[a]*=n,r[a+1]*=n,r[a+2]*=n},toNonIndexed:function(){if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var r=new Vt,e=this.index.array,t=this.attributes;for(var i in t){for(var n=t[i],a=n.array,o=n.itemSize,s=new a.constructor(e.length*o),l=0,u=0,c=0,h=e.length;c<h;c++){l=e[c]*o;for(var f=0;f<o;f++)s[u++]=a[l++]}r.addAttribute(i,new Mt(s,o))}return r},toJSON:function(){var r={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.parameters!==void 0){var e=this.parameters;for(var t in e)e[t]!==void 0&&(r[t]=e[t]);return r}r.data={attributes:{}};var i=this.index;if(i!==null){var n=Array.prototype.slice.call(i.array);r.data.index={type:i.array.constructor.name,array:n}}var a=this.attributes;for(var t in a){var o=a[t],n=Array.prototype.slice.call(o.array);r.data.attributes[t]={itemSize:o.itemSize,type:o.array.constructor.name,array:n,normalized:o.normalized}}var s=this.groups;s.length>0&&(r.data.groups=JSON.parse(JSON.stringify(s)));var l=this.boundingSphere;return l!==null&&(r.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),r},clone:function(){return new Vt().copy(this)},copy:function(r){var e=r.index;e!==null&&this.setIndex(e.clone());var t=r.attributes;for(var i in t){var n=t[i];this.addAttribute(i,n.clone())}for(var a=r.groups,o=0,s=a.length;o<s;o++){var l=a[o];this.addGroup(l.start,l.count,l.materialIndex)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Vt.MaxIndex=65535;_n.prototype=Object.assign(Object.create(Lt.prototype),{constructor:_n,isMesh:!0,setDrawMode:function(r){this.drawMode=r},copy:function(r){return Lt.prototype.copy.call(this,r),this.drawMode=r.drawMode,this},updateMorphTargets:function(){var r=this.geometry.morphTargets;if(r!==void 0&&r.length>0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=r.length;e<t;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[r[e].name]=e}},raycast:function(){var r=new Kt,e=new Qf,t=new ha,i=new oe,n=new oe,a=new oe,o=new oe,s=new oe,l=new oe,u=new Tt,c=new Tt,h=new Tt,f=new oe,p=new oe,d=new oe;function g(_,y,x,M,S,w,T){return fl.barycoordFromPoint(_,y,x,M,f),S.multiplyScalar(f.x),w.multiplyScalar(f.y),T.multiplyScalar(f.z),S.add(w).add(T),S.clone()}function m(_,y,x,M,S,w,T){var C,b=_.material;if(b.side===jf?C=x.intersectTriangle(w,S,M,!0,T):C=x.intersectTriangle(M,S,w,b.side!==n_,T),C===null)return null;d.copy(T),d.applyMatrix4(_.matrixWorld);var E=y.ray.origin.distanceTo(d);return E<y.near||E>y.far?null:{distance:E,point:d.clone(),object:_}}function v(_,y,x,M,S,w,T,C){i.fromArray(M,w*3),n.fromArray(M,T*3),a.fromArray(M,C*3);var b=m(_,y,x,i,n,a,p);return b&&(S&&(u.fromArray(S,w*2),c.fromArray(S,T*2),h.fromArray(S,C*2),b.uv=g(p,i,n,a,u,c,h)),b.face=new ws(w,T,C,fl.normal(i,n,a)),b.faceIndex=w),b}return function(y,x){var M=this.geometry,S=this.material,w=this.matrixWorld;if(S!==void 0&&(M.boundingSphere===null&&M.computeBoundingSphere(),t.copy(M.boundingSphere),t.applyMatrix4(w),y.ray.intersectsSphere(t)!==!1&&(r.getInverse(w),e.copy(y.ray).applyMatrix4(r),!(M.boundingBox!==null&&e.intersectsBox(M.boundingBox)===!1)))){var T,C;if(M.isBufferGeometry){var b,E,I,R=M.index,A=M.attributes,P=A.position.array;if(A.uv!==void 0&&(T=A.uv.array),R!==null)for(var U=R.array,B=0,z=U.length;B<z;B+=3)b=U[B],E=U[B+1],I=U[B+2],C=v(this,y,e,P,T,b,E,I),C&&(C.faceIndex=Math.floor(B/3),x.push(C));else for(var B=0,z=P.length;B<z;B+=9)b=B/3,E=b+1,I=b+2,C=v(this,y,e,P,T,b,E,I),C&&(C.index=b,x.push(C))}else if(M.isGeometry){var k,G,Y,J=S&&S.isMultiMaterial,Q=J===!0?S.materials:null,V=M.vertices,K=M.faces,ae=M.faceVertexUvs[0];ae.length>0&&(T=ae);for(var ve=0,ue=K.length;ve<ue;ve++){var se=K[ve],Ee=J===!0?Q[se.materialIndex]:S;if(Ee!==void 0){if(k=V[se.a],G=V[se.b],Y=V[se.c],Ee.morphTargets===!0){var q=M.morphTargets,H=this.morphTargetInfluences;i.set(0,0,0),n.set(0,0,0),a.set(0,0,0);for(var We=0,_e=q.length;We<_e;We++){var xe=H[We];if(xe!==0){var Le=q[We].vertices;i.addScaledVector(o.subVectors(Le[se.a],k),xe),n.addScaledVector(s.subVectors(Le[se.b],G),xe),a.addScaledVector(l.subVectors(Le[se.c],Y),xe)}}i.add(k),n.add(G),a.add(Y),k=i,G=n,Y=a}if(C=m(this,y,e,k,G,Y,p),C){if(T){var Ue=T[ve];u.copy(Ue[0]),c.copy(Ue[1]),h.copy(Ue[2]),C.uv=g(p,k,G,Y,u,c,h)}C.face=se,C.faceIndex=ve,x.push(C)}}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});lm.prototype=Object.create(Vt.prototype);lm.prototype.constructor=lm;um.prototype=Object.create(Vt.prototype);um.prototype.constructor=um;fa.prototype=Object.create(Lt.prototype);fa.prototype.constructor=fa;fa.prototype.isCamera=!0;fa.prototype.getWorldDirection=function(){var r=new cn;return function(t){var i=t||new oe;return this.getWorldQuaternion(r),i.set(0,0,-1).applyQuaternion(r)}}();fa.prototype.lookAt=function(){var r=new Kt;return function(t){r.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(r)}}();fa.prototype.clone=function(){return new this.constructor().copy(this)};fa.prototype.copy=function(r){return Lt.prototype.copy.call(this,r),this.matrixWorldInverse.copy(r.matrixWorldInverse),this.projectionMatrix.copy(r.projectionMatrix),this};ua.prototype=Object.assign(Object.create(fa.prototype),{constructor:ua,isPerspectiveCamera:!0,copy:function(r){return fa.prototype.copy.call(this,r),this.fov=r.fov,this.zoom=r.zoom,this.near=r.near,this.far=r.far,this.focus=r.focus,this.aspect=r.aspect,this.view=r.view===null?null:Object.assign({},r.view),this.filmGauge=r.filmGauge,this.filmOffset=r.filmOffset,this},setFocalLength:function(r){var e=.5*this.getFilmHeight()/r;this.fov=fr.RAD2DEG*2*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var r=Math.tan(fr.DEG2RAD*.5*this.fov);return .5*this.getFilmHeight()/r},getEffectiveFOV:function(){return fr.RAD2DEG*2*Math.atan(Math.tan(fr.DEG2RAD*.5*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(r,e,t,i,n,a){this.aspect=r/e,this.view={fullWidth:r,fullHeight:e,offsetX:t,offsetY:i,width:n,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var r=this.near,e=r*Math.tan(fr.DEG2RAD*.5*this.fov)/this.zoom,t=2*e,i=this.aspect*t,n=-.5*i,a=this.view;if(a!==null){var o=a.fullWidth,s=a.fullHeight;n+=a.offsetX*i/o,e-=a.offsetY*t/s,i*=a.width/o,t*=a.height/s}var l=this.filmOffset;l!==0&&(n+=r*l/this.getFilmWidth()),this.projectionMatrix.makeFrustum(n,n+i,e-t,e,r,this.far)},toJSON:function(r){var e=Lt.prototype.toJSON.call(this,r);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,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});w0.prototype=Object.assign(Object.create(fa.prototype),{constructor:w0,isOrthographicCamera:!0,copy:function(r){return fa.prototype.copy.call(this,r),this.left=r.left,this.right=r.right,this.top=r.top,this.bottom=r.bottom,this.near=r.near,this.far=r.far,this.zoom=r.zoom,this.view=r.view===null?null:Object.assign({},r.view),this},setViewOffset:function(r,e,t,i,n,a){this.view={fullWidth:r,fullHeight:e,offsetX:t,offsetY:i,width:n,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var r=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),t=(this.right+this.left)/2,i=(this.top+this.bottom)/2,n=t-r,a=t+r,o=i+e,s=i-e;if(this.view!==null){var l=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;n+=c*(this.view.offsetX/l),a=n+c*(this.view.width/l),o-=h*(this.view.offsetY/u),s=o-h*(this.view.height/u)}this.projectionMatrix.makeOrthographic(n,a,o,s,this.near,this.far)},toJSON:function(r){var e=Lt.prototype.toJSON.call(this,r);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,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}});MOe=0;T0.prototype.isFogExp2=!0;T0.prototype.clone=function(){return new T0(this.color.getHex(),this.density)};T0.prototype.toJSON=function(r){return{type:"FogExp2",color:this.color.getHex(),density:this.density}};E0.prototype.isFog=!0;E0.prototype.clone=function(){return new E0(this.color.getHex(),this.near,this.far)};E0.prototype.toJSON=function(r){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}};cm.prototype=Object.create(Lt.prototype);cm.prototype.constructor=cm;cm.prototype.copy=function(r,e){return Lt.prototype.copy.call(this,r,e),r.background!==null&&(this.background=r.background.clone()),r.fog!==null&&(this.fog=r.fog.clone()),r.overrideMaterial!==null&&(this.overrideMaterial=r.overrideMaterial.clone()),this.autoUpdate=r.autoUpdate,this.matrixAutoUpdate=r.matrixAutoUpdate,this};cm.prototype.toJSON=function(r){var e=Lt.prototype.toJSON.call(this,r);return this.background!==null&&(e.object.background=this.background.toJSON(r)),this.fog!==null&&(e.object.fog=this.fog.toJSON()),e};Sk.prototype=Object.assign(Object.create(Lt.prototype),{constructor:Sk,isLensFlare:!0,copy:function(r){Lt.prototype.copy.call(this,r),this.positionScreen.copy(r.positionScreen),this.customUpdateCallback=r.customUpdateCallback;for(var e=0,t=r.lensFlares.length;e<t;e++)this.lensFlares.push(r.lensFlares[e]);return this},add:function(r,e,t,i,n,a){e===void 0&&(e=-1),t===void 0&&(t=0),a===void 0&&(a=1),n===void 0&&(n=new Wt(16777215)),i===void 0&&(i=a_),t=Math.min(t,Math.max(0,t)),this.lensFlares.push({texture:r,size:e,distance:t,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:n,blending:i})},updateLensFlares:function(){var r,e=this.lensFlares.length,t,i=-this.positionScreen.x*2,n=-this.positionScreen.y*2;for(r=0;r<e;r++)t=this.lensFlares[r],t.x=this.positionScreen.x+i*t.distance,t.y=this.positionScreen.y+n*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=(t.wantedRotation-t.rotation)*.25}});hm.prototype=Object.create(_r.prototype);hm.prototype.constructor=hm;hm.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.color.copy(r.color),this.map=r.map,this.rotation=r.rotation,this};qM.prototype=Object.assign(Object.create(Lt.prototype),{constructor:qM,isSprite:!0,raycast:function(){var r=new oe;return function(t,i){r.setFromMatrixPosition(this.matrixWorld);var n=t.ray.distanceSqToPoint(r),a=this.scale.x*this.scale.y/4;n>a||i.push({distance:Math.sqrt(n),point:this.position,face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}});ZM.prototype=Object.assign(Object.create(Lt.prototype),{constructor:ZM,copy:function(r){Lt.prototype.copy.call(this,r,!1);for(var e=r.levels,t=0,i=e.length;t<i;t++){var n=e[t];this.addLevel(n.object.clone(),n.distance)}return this},addLevel:function(r,e){e===void 0&&(e=0),e=Math.abs(e);for(var t=this.levels,i=0;i<t.length&&!(e<t[i].distance);i++);t.splice(i,0,{distance:e,object:r}),this.add(r)},getObjectForDistance:function(r){for(var e=this.levels,t=1,i=e.length;t<i&&!(r<e[t].distance);t++);return e[t-1].object},raycast:function(){var r=new oe;return function(t,i){r.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(r);this.getObjectForDistance(n).raycast(t,i)}}(),update:function(){var r=new oe,e=new oe;return function(i){var n=this.levels;if(n.length>1){r.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var a=r.distanceTo(e);n[0].object.visible=!0;for(var o=1,s=n.length;o<s&&a>=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;o<s;o++)n[o].object.visible=!1}}}(),toJSON:function(r){var e=Lt.prototype.toJSON.call(this,r);e.object.levels=[];for(var t=this.levels,i=0,n=t.length;i<n;i++){var a=t[i];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}});Object.assign(QR.prototype,{calculateInverses:function(){this.boneInverses=[];for(var r=0,e=this.bones.length;r<e;r++){var t=new Kt;this.bones[r]&&t.getInverse(this.bones[r].matrixWorld),this.boneInverses.push(t)}},pose:function(){for(var r,e=0,t=this.bones.length;e<t;e++)r=this.bones[e],r&&r.matrixWorld.getInverse(this.boneInverses[e]);for(var e=0,t=this.bones.length;e<t;e++)r=this.bones[e],r&&(r.parent&&r.parent.isBone?(r.matrix.getInverse(r.parent.matrixWorld),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))},update:function(){var r=new Kt;return function(){for(var t=0,i=this.bones.length;t<i;t++){var n=this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix;r.multiplyMatrices(n,this.boneInverses[t]),r.toArray(this.boneMatrices,t*16)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),clone:function(){return new QR(this.bones,this.boneInverses,this.useVertexTexture)}});eL.prototype=Object.assign(Object.create(Lt.prototype),{constructor:eL,isBone:!0});tL.prototype=Object.assign(Object.create(_n.prototype),{constructor:tL,isSkinnedMesh:!0,bind:function(r,e){this.skeleton=r,e===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){if(this.geometry&&this.geometry.isGeometry)for(var r=0;r<this.geometry.skinWeights.length;r++){var e=this.geometry.skinWeights[r],t=1/e.lengthManhattan();t!==1/0?e.multiplyScalar(t):e.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry)for(var i=new ii,n=this.geometry.attributes.skinWeight,r=0;r<n.count;r++){i.x=n.getX(r),i.y=n.getY(r),i.z=n.getZ(r),i.w=n.getW(r);var t=1/i.lengthManhattan();t!==1/0?i.multiplyScalar(t):i.set(1,0,0,0),n.setXYZW(r,i.x,i.y,i.z,i.w)}},updateMatrixWorld:function(r){_n.prototype.updateMatrixWorld.call(this,!0),this.bindMode==="attached"?this.bindMatrixInverse.getInverse(this.matrixWorld):this.bindMode==="detached"?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material,this.skeleton.useVertexTexture).copy(this)}});Fi.prototype=Object.create(_r.prototype);Fi.prototype.constructor=Fi;Fi.prototype.isLineBasicMaterial=!0;Fi.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.color.copy(r.color),this.linewidth=r.linewidth,this.linecap=r.linecap,this.linejoin=r.linejoin,this};rh.prototype=Object.assign(Object.create(Lt.prototype),{constructor:rh,isLine:!0,raycast:function(){var r=new Kt,e=new Qf,t=new ha;return function(n,a){var o=n.linePrecision,s=o*o,l=this.geometry,u=this.matrixWorld;if(l.boundingSphere===null&&l.computeBoundingSphere(),t.copy(l.boundingSphere),t.applyMatrix4(u),n.ray.intersectsSphere(t)!==!1){r.getInverse(u),e.copy(n.ray).applyMatrix4(r);var c=new oe,h=new oe,f=new oe,p=new oe,d=this&&this.isLineSegments?2:1;if(l.isBufferGeometry){var g=l.index,m=l.attributes,v=m.position.array;if(g!==null)for(var _=g.array,y=0,x=_.length-1;y<x;y+=d){var M=_[y],S=_[y+1];c.fromArray(v,M*3),h.fromArray(v,S*3);var w=e.distanceSqToSegment(c,h,p,f);if(!(w>s)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);T<n.near||T>n.far||a.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else for(var y=0,x=v.length/3-1;y<x;y+=d){c.fromArray(v,3*y),h.fromArray(v,3*y+3);var w=e.distanceSqToSegment(c,h,p,f);if(!(w>s)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);T<n.near||T>n.far||a.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}else if(l.isGeometry)for(var C=l.vertices,b=C.length,y=0;y<b-1;y+=d){var w=e.distanceSqToSegment(C[y],C[y+1],p,f);if(!(w>s)){p.applyMatrix4(this.matrixWorld);var T=n.ray.origin.distanceTo(p);T<n.near||T>n.far||a.push({distance:T,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});yi.prototype=Object.assign(Object.create(rh.prototype),{constructor:yi,isLineSegments:!0});iu.prototype=Object.create(_r.prototype);iu.prototype.constructor=iu;iu.prototype.isPointsMaterial=!0;iu.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.color.copy(r.color),this.map=r.map,this.size=r.size,this.sizeAttenuation=r.sizeAttenuation,this};A0.prototype=Object.assign(Object.create(Lt.prototype),{constructor:A0,isPoints:!0,raycast:function(){var r=new Kt,e=new Qf,t=new ha;return function(n,a){var o=this,s=this.geometry,l=this.matrixWorld,u=n.params.Points.threshold;if(s.boundingSphere===null&&s.computeBoundingSphere(),t.copy(s.boundingSphere),t.applyMatrix4(l),n.ray.intersectsSphere(t)===!1)return;r.getInverse(l),e.copy(n.ray).applyMatrix4(r);var c=u/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,f=new oe;function p(w,T){var C=e.distanceSqToPoint(w);if(C<h){var b=e.closestPointToPoint(w);b.applyMatrix4(l);var E=n.ray.origin.distanceTo(b);if(E<n.near||E>n.far)return;a.push({distance:E,distanceToRay:Math.sqrt(C),point:b.clone(),index:T,face:null,object:o})}}if(s.isBufferGeometry){var d=s.index,g=s.attributes,m=g.position.array;if(d!==null)for(var v=d.array,_=0,y=v.length;_<y;_++){var x=v[_];f.fromArray(m,x*3),p(f,x)}else for(var _=0,M=m.length/3;_<M;_++)f.fromArray(m,_*3),p(f,_)}else for(var S=s.vertices,_=0,M=S.length;_<M;_++)p(S[_],_)}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});jM.prototype=Object.assign(Object.create(Lt.prototype),{constructor:jM});rL.prototype=Object.create(ci.prototype);rL.prototype.constructor=rL;C0.prototype=Object.create(ci.prototype);C0.prototype.constructor=C0;C0.prototype.isCompressedTexture=!0;iL.prototype=Object.create(ci.prototype);iL.prototype.constructor=iL;KM.prototype=Object.create(ci.prototype);KM.prototype.constructor=KM;KM.prototype.isDepthTexture=!0;R0.prototype=Object.create(Vt.prototype);R0.prototype.constructor=R0;L0.prototype=Object.create(Vt.prototype);L0.prototype.constructor=L0;JM.prototype=Object.create(ur.prototype);JM.prototype.constructor=JM;Ko.prototype=Object.create(Vt.prototype);Ko.prototype.constructor=Ko;D0.prototype=Object.create(Ko.prototype);D0.prototype.constructor=D0;$M.prototype=Object.create(ur.prototype);$M.prototype.constructor=$M;fm.prototype=Object.create(Ko.prototype);fm.prototype.constructor=fm;QM.prototype=Object.create(ur.prototype);QM.prototype.constructor=QM;P0.prototype=Object.create(Ko.prototype);P0.prototype.constructor=P0;eb.prototype=Object.create(ur.prototype);eb.prototype.constructor=eb;I0.prototype=Object.create(Ko.prototype);I0.prototype.constructor=I0;tb.prototype=Object.create(ur.prototype);tb.prototype.constructor=tb;rb.prototype=Object.create(ur.prototype);rb.prototype.constructor=rb;N0.prototype=Object.create(Vt.prototype);N0.prototype.constructor=N0;ib.prototype=Object.create(ur.prototype);ib.prototype.constructor=ib;U0.prototype=Object.create(Vt.prototype);U0.prototype.constructor=U0;nb.prototype=Object.create(ur.prototype);nb.prototype.constructor=nb;O0.prototype=Object.create(Vt.prototype);O0.prototype.constructor=O0;ab.prototype=Object.create(ur.prototype);ab.prototype.constructor=ab;Gn={area:function(r){for(var e=r.length,t=0,i=e-1,n=0;n<e;i=n++)t+=r[i].x*r[n].y-r[n].x*r[i].y;return t*.5},triangulate:function(){function r(e,t,i,n,a,o){var s,l,u,c,h,f,p,d,g;if(l=e[o[t]].x,u=e[o[t]].y,c=e[o[i]].x,h=e[o[i]].y,f=e[o[n]].x,p=e[o[n]].y,(c-l)*(p-u)-(h-u)*(f-l)<=0)return!1;var m,v,_,y,x,M,S,w,T,C,b,E,I,R,A;for(m=f-c,v=p-h,_=l-f,y=u-p,x=c-l,M=h-u,s=0;s<a;s++)if(d=e[o[s]].x,g=e[o[s]].y,!(d===l&&g===u||d===c&&g===h||d===f&&g===p)&&(S=d-l,w=g-u,T=d-c,C=g-h,b=d-f,E=g-p,A=m*C-v*T,I=x*w-M*S,R=_*E-y*b,A>=-Number.EPSILON&&R>=-Number.EPSILON&&I>=-Number.EPSILON))return!1;return!0}return function(t,i){var n=t.length;if(n<3)return null;var a=[],o=[],s=[],l,u,c;if(Gn.area(t)>0)for(u=0;u<n;u++)o[u]=u;else for(u=0;u<n;u++)o[u]=n-1-u;var h=n,f=2*h;for(u=h-1;h>2;){if(f--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?s:a;if(l=u,h<=l&&(l=0),u=l+1,h<=u&&(u=0),c=u+1,h<=c&&(c=0),r(t,l,u,c,h,o)){var p,d,g,m,v;for(p=o[l],d=o[u],g=o[c],a.push([t[p],t[d],t[g]]),s.push([o[l],o[u],o[c]]),m=u,v=u+1;v<h;m++,v++)o[m]=o[v];h--,f=2*h}}return i?s:a}}(),triangulateShape:function(r,e){function t(y){var x=y.length;x>2&&y[x-1].equals(y[0])&&y.pop()}t(r),e.forEach(t);function i(y,x,M){return y.x!==x.x?y.x<x.x?y.x<=M.x&&M.x<=x.x:x.x<=M.x&&M.x<=y.x:y.y<x.y?y.y<=M.y&&M.y<=x.y:x.y<=M.y&&M.y<=y.y}function n(y,x,M,S,w){var T=x.x-y.x,C=x.y-y.y,b=S.x-M.x,E=S.y-M.y,I=y.x-M.x,R=y.y-M.y,A=C*b-T*E,P=C*I-T*R;if(Math.abs(A)>Number.EPSILON){var U;if(A>0){if(P<0||P>A)return[];if(U=E*I-b*R,U<0||U>A)return[]}else{if(P>0||P<A)return[];if(U=E*I-b*R,U>0||U<A)return[]}if(U===0)return w&&(P===0||P===A)?[]:[y];if(U===A)return w&&(P===0||P===A)?[]:[x];if(P===0)return[M];if(P===A)return[S];var B=U/A;return[{x:y.x+B*T,y:y.y+B*C}]}else{if(P!==0||E*I!==b*R)return[];var z=T===0&&C===0,k=b===0&&E===0;if(z&&k)return y.x!==M.x||y.y!==M.y?[]:[y];if(z)return i(M,S,y)?[y]:[];if(k)return i(y,x,M)?[M]:[];var G,Y,J,Q,V,K,ae,ve;return T!==0?(y.x<x.x?(G=y,J=y.x,Y=x,Q=x.x):(G=x,J=x.x,Y=y,Q=y.x),M.x<S.x?(V=M,ae=M.x,K=S,ve=S.x):(V=S,ae=S.x,K=M,ve=M.x)):(y.y<x.y?(G=y,J=y.y,Y=x,Q=x.y):(G=x,J=x.y,Y=y,Q=y.y),M.y<S.y?(V=M,ae=M.y,K=S,ve=S.y):(V=S,ae=S.y,K=M,ve=M.y)),J<=ae?Q<ae?[]:Q===ae?w?[]:[V]:Q<=ve?[V,Y]:[V,K]:J>ve?[]:J===ve?w?[]:[G]:Q<=ve?[G,Y]:[G,K]}}function a(y,x,M,S){var w=x.x-y.x,T=x.y-y.y,C=M.x-y.x,b=M.y-y.y,E=S.x-y.x,I=S.y-y.y,R=w*b-T*C,A=w*I-T*E;if(Math.abs(R)>Number.EPSILON){var P=E*b-I*C;return R>0?A>=0&&P>=0:A>=0||P>=0}else return A>0}function o(y,x){var M=y.concat(),S;function w(ve,ue){var se=M.length-1,Ee=ve-1;Ee<0&&(Ee=se);var q=ve+1;q>se&&(q=0);var H=a(M[ve],M[Ee],M[q],S[ue]);if(!H)return!1;var We=S.length-1,_e=ue-1;_e<0&&(_e=We);var xe=ue+1;return xe>We&&(xe=0),H=a(S[ue],S[_e],S[xe],M[ve]),!!H}function T(ve,ue){var se,Ee,q;for(se=0;se<M.length;se++)if(Ee=se+1,Ee%=M.length,q=n(ve,ue,M[se],M[Ee],!0),q.length>0)return!0;return!1}var C=[];function b(ve,ue){var se,Ee,q,H,We;for(se=0;se<C.length;se++)for(Ee=x[C[se]],q=0;q<Ee.length;q++)if(H=q+1,H%=Ee.length,We=n(ve,ue,Ee[q],Ee[H],!0),We.length>0)return!0;return!1}for(var E,I,R,A,P,U,B=[],z,k,G,Y,J=0,Q=x.length;J<Q;J++)C.push(J);for(var V=0,K=C.length*2;C.length>0;){if(K--,K<0){console.log("Infinite Loop! Holes left:"+C.length+", Probably Hole outside Shape!");break}for(I=V;I<M.length;I++){R=M[I],E=-1;for(var J=0;J<C.length;J++)if(P=C[J],U=R.x+":"+R.y+":"+P,B[U]===void 0){S=x[P];for(var ae=0;ae<S.length;ae++)if(A=S[ae],!!w(I,ae)&&!T(R,A)&&!b(R,A)){E=ae,C.splice(J,1),z=M.slice(0,I+1),k=M.slice(I),G=S.slice(E),Y=S.slice(0,E+1),M=z.concat(G).concat(Y).concat(k),V=I;break}if(E>=0)break;B[U]=!0}if(E>=0)break}}return M}for(var s,l,u,c,h,f,p={},d=r.concat(),g=0,m=e.length;g<m;g++)Array.prototype.push.apply(d,e[g]);for(s=0,l=d.length;s<l;s++)h=d[s].x+":"+d[s].y,p[h]!==void 0&&console.warn("THREE.ShapeUtils: Duplicate point",h,s),p[h]=s;var v=o(r,e),_=Gn.triangulate(v,!1);for(s=0,l=_.length;s<l;s++)for(c=_[s],u=0;u<3;u++)h=c[u].x+":"+c[u].y,f=p[h],f!==void 0&&(c[u]=f);return _.concat()},isClockWise:function(r){return Gn.area(r)<0},b2:function(){function r(i,n){var a=1-i;return a*a*n}function e(i,n){return 2*(1-i)*i*n}function t(i,n){return i*i*n}return function(n,a,o,s){return r(n,a)+e(n,o)+t(n,s)}}(),b3:function(){function r(n,a){var o=1-n;return o*o*o*a}function e(n,a){var o=1-n;return 3*o*o*n*a}function t(n,a){var o=1-n;return 3*o*n*n*a}function i(n,a){return n*n*n*a}return function(a,o,s,l,u){return r(a,o)+e(a,s)+t(a,l)+i(a,u)}}()};ml.prototype=Object.create(ur.prototype);ml.prototype.constructor=ml;ml.prototype.addShapeList=function(r,e){for(var t=r.length,i=0;i<t;i++){var n=r[i];this.addShape(n,e)}};ml.prototype.addShape=function(r,e){var t=e.amount!==void 0?e.amount:100,i=e.bevelThickness!==void 0?e.bevelThickness:6,n=e.bevelSize!==void 0?e.bevelSize:i-2,a=e.bevelSegments!==void 0?e.bevelSegments:3,o=e.bevelEnabled!==void 0?e.bevelEnabled:!0,s=e.curveSegments!==void 0?e.curveSegments:12,l=e.steps!==void 0?e.steps:1,u=e.extrudePath,c,h=!1,f=e.UVGenerator!==void 0?e.UVGenerator:ml.WorldUVGenerator,p,d,g,m;u&&(c=u.getSpacedPoints(l),h=!0,o=!1,p=e.frames!==void 0?e.frames:u.computeFrenetFrames(l,!1),d=new oe,g=new oe,m=new oe),o||(a=0,i=0,n=0);var v,_,y,x=this,M=this.vertices.length,S=r.extractPoints(s),w=S.shape,T=S.holes,C=!Gn.isClockWise(w);if(C){for(w=w.reverse(),_=0,y=T.length;_<y;_++)v=T[_],Gn.isClockWise(v)&&(T[_]=v.reverse());C=!1}var b=Gn.triangulateShape(w,T),E=w;for(_=0,y=T.length;_<y;_++)v=T[_],w=w.concat(v);function I(Ue,Ne,Ve){return Ne||console.error("THREE.ExtrudeGeometry: vec does not exist"),Ne.clone().multiplyScalar(Ve).add(Ue)}var R,A,P,U,B,z=w.length,k,G=b.length;function Y(Ue,Ne,Ve){var dt,F,L=1,ne=Ue.x-Ne.x,le=Ue.y-Ne.y,me=Ve.x-Ue.x,fe=Ve.y-Ue.y,et=ne*ne+le*le,Ke=ne*fe-le*me;if(Math.abs(Ke)>Number.EPSILON){var Se=Math.sqrt(et),Ae=Math.sqrt(me*me+fe*fe),at=Ne.x-le/Se,$=Ne.y+ne/Se,nt=Ve.x-fe/Ae,Xe=Ve.y+me/Ae,Fe=((nt-at)*fe-(Xe-$)*me)/(ne*fe-le*me);dt=at+ne*Fe-Ue.x,F=$+le*Fe-Ue.y;var we=dt*dt+F*F;if(we<=2)return new Tt(dt,F);L=Math.sqrt(we/2)}else{var Ie=!1;ne>Number.EPSILON?me>Number.EPSILON&&(Ie=!0):ne<-Number.EPSILON?me<-Number.EPSILON&&(Ie=!0):Math.sign(le)===Math.sign(fe)&&(Ie=!0),Ie?(dt=-le,F=ne,L=Math.sqrt(et)):(dt=ne,F=le,L=Math.sqrt(et/2))}return new Tt(dt/L,F/L)}for(var J=[],Q=0,V=E.length,K=V-1,ae=Q+1;Q<V;Q++,K++,ae++)K===V&&(K=0),ae===V&&(ae=0),J[Q]=Y(E[Q],E[K],E[ae]);var ve=[],ue,se=J.concat();for(_=0,y=T.length;_<y;_++){for(v=T[_],ue=[],Q=0,V=v.length,K=V-1,ae=Q+1;Q<V;Q++,K++,ae++)K===V&&(K=0),ae===V&&(ae=0),ue[Q]=Y(v[Q],v[K],v[ae]);ve.push(ue),se=se.concat(ue)}for(R=0;R<a;R++){for(P=R/a,U=i*Math.cos(P*Math.PI/2),A=n*Math.sin(P*Math.PI/2),Q=0,V=E.length;Q<V;Q++)B=I(E[Q],J[Q],A),_e(B.x,B.y,-U);for(_=0,y=T.length;_<y;_++)for(v=T[_],ue=ve[_],Q=0,V=v.length;Q<V;Q++)B=I(v[Q],ue[Q],A),_e(B.x,B.y,-U)}for(A=n,Q=0;Q<z;Q++)B=o?I(w[Q],se[Q],A):w[Q],h?(g.copy(p.normals[0]).multiplyScalar(B.x),d.copy(p.binormals[0]).multiplyScalar(B.y),m.copy(c[0]).add(g).add(d),_e(m.x,m.y,m.z)):_e(B.x,B.y,0);var Ee;for(Ee=1;Ee<=l;Ee++)for(Q=0;Q<z;Q++)B=o?I(w[Q],se[Q],A):w[Q],h?(g.copy(p.normals[Ee]).multiplyScalar(B.x),d.copy(p.binormals[Ee]).multiplyScalar(B.y),m.copy(c[Ee]).add(g).add(d),_e(m.x,m.y,m.z)):_e(B.x,B.y,t/l*Ee);for(R=a-1;R>=0;R--){for(P=R/a,U=i*Math.cos(P*Math.PI/2),A=n*Math.sin(P*Math.PI/2),Q=0,V=E.length;Q<V;Q++)B=I(E[Q],J[Q],A),_e(B.x,B.y,t+U);for(_=0,y=T.length;_<y;_++)for(v=T[_],ue=ve[_],Q=0,V=v.length;Q<V;Q++)B=I(v[Q],ue[Q],A),h?_e(B.x,B.y+c[l-1].y,c[l-1].x+U):_e(B.x,B.y,t+U)}q(),H();function q(){if(o){var Ue=0,Ne=z*Ue;for(Q=0;Q<G;Q++)k=b[Q],xe(k[2]+Ne,k[1]+Ne,k[0]+Ne);for(Ue=l+a*2,Ne=z*Ue,Q=0;Q<G;Q++)k=b[Q],xe(k[0]+Ne,k[1]+Ne,k[2]+Ne)}else{for(Q=0;Q<G;Q++)k=b[Q],xe(k[2],k[1],k[0]);for(Q=0;Q<G;Q++)k=b[Q],xe(k[0]+z*l,k[1]+z*l,k[2]+z*l)}}function H(){var Ue=0;for(We(E,Ue),Ue+=E.length,_=0,y=T.length;_<y;_++)v=T[_],We(v,Ue),Ue+=v.length}function We(Ue,Ne){var Ve,dt;for(Q=Ue.length;--Q>=0;){Ve=Q,dt=Q-1,dt<0&&(dt=Ue.length-1);var F=0,L=l+a*2;for(F=0;F<L;F++){var ne=z*F,le=z*(F+1),me=Ne+Ve+ne,fe=Ne+dt+ne,et=Ne+dt+le,Ke=Ne+Ve+le;Le(me,fe,et,Ke,Ue,F,L,Ve,dt)}}}function _e(Ue,Ne,Ve){x.vertices.push(new oe(Ue,Ne,Ve))}function xe(Ue,Ne,Ve){Ue+=M,Ne+=M,Ve+=M,x.faces.push(new ws(Ue,Ne,Ve,null,null,0));var dt=f.generateTopUV(x,Ue,Ne,Ve);x.faceVertexUvs[0].push(dt)}function Le(Ue,Ne,Ve,dt,F,L,ne,le,me){Ue+=M,Ne+=M,Ve+=M,dt+=M,x.faces.push(new ws(Ue,Ne,dt,null,null,1)),x.faces.push(new ws(Ne,Ve,dt,null,null,1));var fe=f.generateSideWallUV(x,Ue,Ne,Ve,dt);x.faceVertexUvs[0].push([fe[0],fe[1],fe[3]]),x.faceVertexUvs[0].push([fe[1],fe[2],fe[3]])}};ml.WorldUVGenerator={generateTopUV:function(r,e,t,i){var n=r.vertices,a=n[e],o=n[t],s=n[i];return[new Tt(a.x,a.y),new Tt(o.x,o.y),new Tt(s.x,s.y)]},generateSideWallUV:function(r,e,t,i,n){var a=r.vertices,o=a[e],s=a[t],l=a[i],u=a[n];return Math.abs(o.y-s.y)<.01?[new Tt(o.x,1-o.z),new Tt(s.x,1-s.z),new Tt(l.x,1-l.z),new Tt(u.x,1-u.z)]:[new Tt(o.y,1-o.z),new Tt(s.y,1-s.z),new Tt(l.y,1-l.z),new Tt(u.y,1-u.z)]}};ob.prototype=Object.create(ml.prototype);ob.prototype.constructor=ob;pm.prototype=Object.create(Vt.prototype);pm.prototype.constructor=pm;sb.prototype=Object.create(ur.prototype);sb.prototype.constructor=sb;z0.prototype=Object.create(Vt.prototype);z0.prototype.constructor=z0;lb.prototype=Object.create(ur.prototype);lb.prototype.constructor=lb;ub.prototype=Object.create(ur.prototype);ub.prototype.constructor=ub;F0.prototype=Object.create(Vt.prototype);F0.prototype.constructor=F0;cb.prototype=Object.create(ur.prototype);cb.prototype.constructor=cb;B0.prototype=Object.create(Vt.prototype);B0.prototype.constructor=B0;k0.prototype=Object.create(ur.prototype);k0.prototype.constructor=k0;V0.prototype=Object.create(Vt.prototype);V0.prototype.constructor=V0;ih.prototype=Object.create(Vt.prototype);ih.prototype.constructor=ih;dm.prototype=Object.create(ur.prototype);dm.prototype.constructor=dm;hb.prototype=Object.create(dm.prototype);hb.prototype.constructor=hb;fb.prototype=Object.create(ih.prototype);fb.prototype.constructor=fb;G0.prototype=Object.create(Vt.prototype);G0.prototype.constructor=G0;pb.prototype=Object.create(ur.prototype);pb.prototype.constructor=pb;db.prototype=Object.create(ur.prototype);db.prototype.constructor=db;ru=Object.freeze({WireframeGeometry:R0,ParametricGeometry:JM,ParametricBufferGeometry:L0,TetrahedronGeometry:$M,TetrahedronBufferGeometry:D0,OctahedronGeometry:QM,OctahedronBufferGeometry:fm,IcosahedronGeometry:eb,IcosahedronBufferGeometry:P0,DodecahedronGeometry:tb,DodecahedronBufferGeometry:I0,PolyhedronGeometry:rb,PolyhedronBufferGeometry:Ko,TubeGeometry:ib,TubeBufferGeometry:N0,TorusKnotGeometry:nb,TorusKnotBufferGeometry:U0,TorusGeometry:ab,TorusBufferGeometry:O0,TextGeometry:ob,SphereBufferGeometry:pm,SphereGeometry:sb,RingGeometry:lb,RingBufferGeometry:z0,PlaneBufferGeometry:um,PlaneGeometry:ub,LatheGeometry:cb,LatheBufferGeometry:F0,ShapeGeometry:k0,ShapeBufferGeometry:B0,ExtrudeGeometry:ml,EdgesGeometry:V0,ConeGeometry:hb,ConeBufferGeometry:fb,CylinderGeometry:dm,CylinderBufferGeometry:ih,CircleBufferGeometry:G0,CircleGeometry:pb,BoxBufferGeometry:lm,BoxGeometry:db});H0.prototype=Object.create(Na.prototype);H0.prototype.constructor=H0;H0.prototype.isShadowMaterial=!0;W0.prototype=Object.create(Na.prototype);W0.prototype.constructor=W0;W0.prototype.isRawShaderMaterial=!0;mb.prototype={constructor:mb,isMultiMaterial:!0,toJSON:function(r){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},t=this.materials,i=0,n=t.length;i<n;i++){var a=t[i].toJSON(r);delete a.metadata,e.materials.push(a)}return e.visible=this.visible,e},clone:function(){for(var r=new this.constructor,e=0;e<this.materials.length;e++)r.materials.push(this.materials[e].clone());return r.visible=this.visible,r}};ju.prototype=Object.create(_r.prototype);ju.prototype.constructor=ju;ju.prototype.isMeshStandardMaterial=!0;ju.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.defines={STANDARD:""},this.color.copy(r.color),this.roughness=r.roughness,this.metalness=r.metalness,this.map=r.map,this.lightMap=r.lightMap,this.lightMapIntensity=r.lightMapIntensity,this.aoMap=r.aoMap,this.aoMapIntensity=r.aoMapIntensity,this.emissive.copy(r.emissive),this.emissiveMap=r.emissiveMap,this.emissiveIntensity=r.emissiveIntensity,this.bumpMap=r.bumpMap,this.bumpScale=r.bumpScale,this.normalMap=r.normalMap,this.normalScale.copy(r.normalScale),this.displacementMap=r.displacementMap,this.displacementScale=r.displacementScale,this.displacementBias=r.displacementBias,this.roughnessMap=r.roughnessMap,this.metalnessMap=r.metalnessMap,this.alphaMap=r.alphaMap,this.envMap=r.envMap,this.envMapIntensity=r.envMapIntensity,this.refractionRatio=r.refractionRatio,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.wireframeLinecap=r.wireframeLinecap,this.wireframeLinejoin=r.wireframeLinejoin,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.morphNormals=r.morphNormals,this};mm.prototype=Object.create(ju.prototype);mm.prototype.constructor=mm;mm.prototype.isMeshPhysicalMaterial=!0;mm.prototype.copy=function(r){return ju.prototype.copy.call(this,r),this.defines={PHYSICAL:""},this.reflectivity=r.reflectivity,this.clearCoat=r.clearCoat,this.clearCoatRoughness=r.clearCoatRoughness,this};nu.prototype=Object.create(_r.prototype);nu.prototype.constructor=nu;nu.prototype.isMeshPhongMaterial=!0;nu.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.color.copy(r.color),this.specular.copy(r.specular),this.shininess=r.shininess,this.map=r.map,this.lightMap=r.lightMap,this.lightMapIntensity=r.lightMapIntensity,this.aoMap=r.aoMap,this.aoMapIntensity=r.aoMapIntensity,this.emissive.copy(r.emissive),this.emissiveMap=r.emissiveMap,this.emissiveIntensity=r.emissiveIntensity,this.bumpMap=r.bumpMap,this.bumpScale=r.bumpScale,this.normalMap=r.normalMap,this.normalScale.copy(r.normalScale),this.displacementMap=r.displacementMap,this.displacementScale=r.displacementScale,this.displacementBias=r.displacementBias,this.specularMap=r.specularMap,this.alphaMap=r.alphaMap,this.envMap=r.envMap,this.combine=r.combine,this.reflectivity=r.reflectivity,this.refractionRatio=r.refractionRatio,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.wireframeLinecap=r.wireframeLinecap,this.wireframeLinejoin=r.wireframeLinejoin,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.morphNormals=r.morphNormals,this};vm.prototype=Object.create(nu.prototype);vm.prototype.constructor=vm;vm.prototype.isMeshToonMaterial=!0;vm.prototype.copy=function(r){return nu.prototype.copy.call(this,r),this.gradientMap=r.gradientMap,this};gm.prototype=Object.create(_r.prototype);gm.prototype.constructor=gm;gm.prototype.isMeshNormalMaterial=!0;gm.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.bumpMap=r.bumpMap,this.bumpScale=r.bumpScale,this.normalMap=r.normalMap,this.normalScale.copy(r.normalScale),this.displacementMap=r.displacementMap,this.displacementScale=r.displacementScale,this.displacementBias=r.displacementBias,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.morphNormals=r.morphNormals,this};ym.prototype=Object.create(_r.prototype);ym.prototype.constructor=ym;ym.prototype.isMeshLambertMaterial=!0;ym.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.color.copy(r.color),this.map=r.map,this.lightMap=r.lightMap,this.lightMapIntensity=r.lightMapIntensity,this.aoMap=r.aoMap,this.aoMapIntensity=r.aoMapIntensity,this.emissive.copy(r.emissive),this.emissiveMap=r.emissiveMap,this.emissiveIntensity=r.emissiveIntensity,this.specularMap=r.specularMap,this.alphaMap=r.alphaMap,this.envMap=r.envMap,this.combine=r.combine,this.reflectivity=r.reflectivity,this.refractionRatio=r.refractionRatio,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.wireframeLinecap=r.wireframeLinecap,this.wireframeLinejoin=r.wireframeLinejoin,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.morphNormals=r.morphNormals,this};_m.prototype=Object.create(_r.prototype);_m.prototype.constructor=_m;_m.prototype.isLineDashedMaterial=!0;_m.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.color.copy(r.color),this.linewidth=r.linewidth,this.scale=r.scale,this.dashSize=r.dashSize,this.gapSize=r.gapSize,this};FOe=Object.freeze({ShadowMaterial:H0,SpriteMaterial:hm,RawShaderMaterial:W0,ShaderMaterial:Na,PointsMaterial:iu,MultiMaterial:mb,MeshPhysicalMaterial:mm,MeshStandardMaterial:ju,MeshPhongMaterial:nu,MeshToonMaterial:vm,MeshNormalMaterial:gm,MeshLambertMaterial:ym,MeshDepthMaterial:$f,MeshBasicMaterial:jo,LineDashedMaterial:_m,LineBasicMaterial:Fi,Material:_r}),Mk={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};Ts=new tV;Object.assign(vl.prototype,{load:function(r,e,t,i){r===void 0&&(r=""),this.path!==void 0&&(r=this.path+r);var n=this,a=Mk.get(r);if(a!==void 0)return n.manager.itemStart(r),setTimeout(function(){e&&e(a),n.manager.itemEnd(r)},0),a;var o=/^data:(.*?)(;base64)?,(.*)$/,s=r.match(o);if(s){var l=s[1],u=!!s[2],c=s[3];c=window.decodeURIComponent(c),u&&(c=window.atob(c));try{var h,f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":h=new ArrayBuffer(c.length);for(var p=new Uint8Array(h),d=0;d<c.length;d++)p[d]=c.charCodeAt(d);f==="blob"&&(h=new Blob([h],{type:l}));break;case"document":var g=new DOMParser;h=g.parseFromString(c,l);break;case"json":h=JSON.parse(c);break;default:h=c;break}window.setTimeout(function(){e&&e(h),n.manager.itemEnd(r)},0)}catch(v){window.setTimeout(function(){i&&i(v),n.manager.itemError(r)},0)}}else{var m=new XMLHttpRequest;m.open("GET",r,!0),m.addEventListener("load",function(v){var _=v.target.response;Mk.add(r,_),this.status===200?(e&&e(_),n.manager.itemEnd(r)):this.status===0?(console.warn("THREE.FileLoader: HTTP Status 0 received."),e&&e(_),n.manager.itemEnd(r)):(i&&i(v),n.manager.itemError(r))},!1),t!==void 0&&m.addEventListener("progress",function(v){t(v)},!1),m.addEventListener("error",function(v){i&&i(v),n.manager.itemError(r)},!1),this.responseType!==void 0&&(m.responseType=this.responseType),this.withCredentials!==void 0&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain"),m.send(null)}return n.manager.itemStart(r),m},setPath:function(r){return this.path=r,this},setResponseType:function(r){return this.responseType=r,this},setWithCredentials:function(r){return this.withCredentials=r,this},setMimeType:function(r){return this.mimeType=r,this}});Object.assign(Pse.prototype,{load:function(r,e,t,i){var n=this,a=[],o=new C0;o.image=a;var s=new vl(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer");function l(f){s.load(r[f],function(p){var d=n._parser(p,!0);a[f]={width:d.width,height:d.height,format:d.format,mipmaps:d.mipmaps},u+=1,u===6&&(d.mipmapCount===1&&(o.minFilter=qo),o.format=d.format,o.needsUpdate=!0,e&&e(o))},t,i)}if(Array.isArray(r))for(var u=0,c=0,h=r.length;c<h;++c)l(c);else s.load(r,function(f){var p=n._parser(f,!0);if(p.isCubemap)for(var d=p.mipmaps.length/p.mipmapCount,g=0;g<d;g++){a[g]={mipmaps:[]};for(var m=0;m<p.mipmapCount;m++)a[g].mipmaps.push(p.mipmaps[g*p.mipmapCount+m]),a[g].format=p.format,a[g].width=p.width,a[g].height=p.height}else o.image.width=p.width,o.image.height=p.height,o.mipmaps=p.mipmaps;p.mipmapCount===1&&(o.minFilter=qo),o.format=p.format,o.needsUpdate=!0,e&&e(o)},t,i);return o},setPath:function(r){return this.path=r,this}});BOe=rV;Object.assign(rV.prototype,{load:function(r,e,t,i){var n=this,a=new sm,o=new vl(this.manager);return o.setResponseType("arraybuffer"),o.load(r,function(s){var l=n._parser(s);l&&(l.image!==void 0?a.image=l.image:l.data!==void 0&&(a.image.width=l.width,a.image.height=l.height,a.image.data=l.data),a.wrapS=l.wrapS!==void 0?l.wrapS:Ms,a.wrapT=l.wrapT!==void 0?l.wrapT:Ms,a.magFilter=l.magFilter!==void 0?l.magFilter:qo,a.minFilter=l.minFilter!==void 0?l.minFilter:Tb,a.anisotropy=l.anisotropy!==void 0?l.anisotropy:1,l.format!==void 0&&(a.format=l.format),l.type!==void 0&&(a.type=l.type),l.mipmaps!==void 0&&(a.mipmaps=l.mipmaps),l.mipmapCount===1&&(a.minFilter=qo),a.needsUpdate=!0,e&&e(a,l))},t,i),a}});Object.assign(Eb.prototype,{load:function(r,e,t,i){var n=this,a=document.createElementNS("http://www.w3.org/1999/xhtml","img");if(a.onload=function(){a.onload=null,URL.revokeObjectURL(a.src),e&&e(a),n.manager.itemEnd(r)},a.onerror=i,r.indexOf("data:")===0)a.src=r;else if(this.crossOrigin!==void 0)a.crossOrigin=this.crossOrigin,a.src=r;else{var o=new vl;o.setPath(this.path),o.setResponseType("blob"),o.setWithCredentials(this.withCredentials),o.load(r,function(s){a.src=URL.createObjectURL(s)},t,i)}return n.manager.itemStart(r),a},setCrossOrigin:function(r){return this.crossOrigin=r,this},setWithCredentials:function(r){return this.withCredentials=r,this},setPath:function(r){return this.path=r,this}});Object.assign(iV.prototype,{load:function(r,e,t,i){var n=new Kf,a=new Eb(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(u){a.load(r[u],function(c){n.images[u]=c,o++,o===6&&(n.needsUpdate=!0,e&&e(n))},void 0,i)}for(var l=0;l<r.length;++l)s(l);return n},setCrossOrigin:function(r){return this.crossOrigin=r,this},setPath:function(r){return this.path=r,this}});Object.assign(LL.prototype,{load:function(r,e,t,i){var n=new ci,a=new Eb(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setWithCredentials(this.withCredentials),a.setPath(this.path),a.load(r,function(o){var s=r.search(/\.(jpg|jpeg)$/)>0||r.search(/^data\:image\/jpeg/)===0;n.format=s?x0:qu,n.image=o,n.needsUpdate=!0,e!==void 0&&e(n)},t,i),n},setCrossOrigin:function(r){return this.crossOrigin=r,this},setWithCredentials:function(r){return this.withCredentials=r,this},setPath:function(r){return this.path=r,this}});Bi.prototype=Object.assign(Object.create(Lt.prototype),{constructor:Bi,isLight:!0,copy:function(r){return Lt.prototype.copy.call(this,r),this.color.copy(r.color),this.intensity=r.intensity,this},toJSON:function(r){var e=Lt.prototype.toJSON.call(this,r);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}});nL.prototype=Object.assign(Object.create(Bi.prototype),{constructor:nL,isHemisphereLight:!0,copy:function(r){return Bi.prototype.copy.call(this,r),this.groundColor.copy(r.groundColor),this}});Object.assign(Am.prototype,{copy:function(r){return this.camera=r.camera.clone(),this.bias=r.bias,this.radius=r.radius,this.mapSize.copy(r.mapSize),this},clone:function(){return new this.constructor().copy(this)},toJSON:function(){var r={};return this.bias!==0&&(r.bias=this.bias),this.radius!==1&&(r.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(r.mapSize=this.mapSize.toArray()),r.camera=this.camera.toJSON(!1).object,delete r.camera.matrix,r}});aL.prototype=Object.assign(Object.create(Am.prototype),{constructor:aL,isSpotLightShadow:!0,update:function(r){var e=fr.RAD2DEG*2*r.angle,t=this.mapSize.width/this.mapSize.height,i=r.distance||500,n=this.camera;(e!==n.fov||t!==n.aspect||i!==n.far)&&(n.fov=e,n.aspect=t,n.far=i,n.updateProjectionMatrix())}});oL.prototype=Object.assign(Object.create(Bi.prototype),{constructor:oL,isSpotLight:!0,copy:function(r){return Bi.prototype.copy.call(this,r),this.distance=r.distance,this.angle=r.angle,this.penumbra=r.penumbra,this.decay=r.decay,this.target=r.target.clone(),this.shadow=r.shadow.clone(),this}});sL.prototype=Object.assign(Object.create(Bi.prototype),{constructor:sL,isPointLight:!0,copy:function(r){return Bi.prototype.copy.call(this,r),this.distance=r.distance,this.decay=r.decay,this.shadow=r.shadow.clone(),this}});lL.prototype=Object.assign(Object.create(Am.prototype),{constructor:lL});uL.prototype=Object.assign(Object.create(Bi.prototype),{constructor:uL,isDirectionalLight:!0,copy:function(r){return Bi.prototype.copy.call(this,r),this.target=r.target.clone(),this.shadow=r.shadow.clone(),this}});cL.prototype=Object.assign(Object.create(Bi.prototype),{constructor:cL,isAmbientLight:!0});ca={arraySlice:function(r,e,t){return ca.isTypedArray(r)?new r.constructor(r.subarray(e,t)):r.slice(e,t)},convertArray:function(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)},isTypedArray:function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},getKeyframeOrder:function(r){function e(a,o){return r[a]-r[o]}for(var t=r.length,i=new Array(t),n=0;n!==t;++n)i[n]=n;return i.sort(e),i},sortedArray:function(r,e,t){for(var i=r.length,n=new r.constructor(i),a=0,o=0;o!==i;++a)for(var s=t[a]*e,l=0;l!==e;++l)n[o++]=r[s+l];return n},flattenJSON:function(r,e,t,i){for(var n=1,a=r[0];a!==void 0&&a[i]===void 0;)a=r[n++];if(a!==void 0){var o=a[i];if(o!==void 0)if(Array.isArray(o))do o=a[i],o!==void 0&&(e.push(a.time),t.push.apply(t,o)),a=r[n++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[i],o!==void 0&&(e.push(a.time),o.toArray(t,t.length)),a=r[n++];while(a!==void 0);else do o=a[i],o!==void 0&&(e.push(a.time),t.push(o)),a=r[n++];while(a!==void 0)}}};Zo.prototype={constructor:Zo,evaluate:function(r){var e=this.parameterPositions,t=this._cachedIndex,i=e[t],n=e[t-1];e:{t:{var a;r:{i:if(!(r<i)){for(var o=t+2;;){if(i===void 0){if(r<n)break i;return t=e.length,this._cachedIndex=t,this.afterEnd_(t-1,r,n)}if(t===o)break;if(n=i,i=e[++t],r<i)break t}a=e.length;break r}if(!(r>=n)){var s=e[1];r<s&&(t=2,n=s);for(var o=t-2;;){if(n===void 0)return this._cachedIndex=0,this.beforeStart_(0,r,i);if(t===o)break;if(i=n,n=e[--t-1],r>=n)break t}a=t,t=0;break r}break e}for(;t<a;){var l=t+a>>>1;r<e[l]?a=l:t=l+1}if(i=e[t],n=e[t-1],n===void 0)return this._cachedIndex=0,this.beforeStart_(0,r,i);if(i===void 0)return t=e.length,this._cachedIndex=t,this.afterEnd_(t-1,n,r)}this._cachedIndex=t,this.intervalChanged_(t,n,i)}return this.interpolate_(t,n,r,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(r){for(var e=this.resultBuffer,t=this.sampleValues,i=this.valueSize,n=r*i,a=0;a!==i;++a)e[a]=t[n+a];return e},interpolate_:function(r,e,t,i){throw new Error("call to abstract method")},intervalChanged_:function(r,e,t){}};Object.assign(Zo.prototype,{beforeStart_:Zo.prototype.copySampleValue_,afterEnd_:Zo.prototype.copySampleValue_});hL.prototype=Object.assign(Object.create(Zo.prototype),{constructor:hL,DefaultSettings_:{endingStart:om,endingEnd:om},intervalChanged_:function(r,e,t){var i=this.parameterPositions,n=r-2,a=r+1,o=i[n],s=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case em:n=r,o=2*e-t;break;case zM:n=i.length-2,o=e+i[n]-i[n+1];break;default:n=r,o=t}if(s===void 0)switch(this.getSettings_().endingEnd){case em:a=r,s=2*t-e;break;case zM:a=1,s=t+i[1]-i[0];break;default:a=r-1,s=e}var l=(t-e)*.5,u=this.valueSize;this._weightPrev=l/(e-o),this._weightNext=l/(s-t),this._offsetPrev=n*u,this._offsetNext=a*u},interpolate_:function(r,e,t,i){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=r*o,l=s-o,u=this._offsetPrev,c=this._offsetNext,h=this._weightPrev,f=this._weightNext,p=(t-e)/(i-e),d=p*p,g=d*p,m=-h*g+2*h*d-h*p,v=(1+h)*g+(-1.5-2*h)*d+(-.5+h)*p+1,_=(-1-f)*g+(1.5+f)*d+.5*p,y=f*g-f*d,x=0;x!==o;++x)n[x]=m*a[u+x]+v*a[l+x]+_*a[s+x]+y*a[c+x];return n}});vb.prototype=Object.assign(Object.create(Zo.prototype),{constructor:vb,interpolate_:function(r,e,t,i){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=r*o,l=s-o,u=(t-e)/(i-e),c=1-u,h=0;h!==o;++h)n[h]=a[l+h]*c+a[s+h]*u;return n}});fL.prototype=Object.assign(Object.create(Zo.prototype),{constructor:fL,interpolate_:function(r,e,t,i){return this.copySampleValue_(r-1)}});ah={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:DM,InterpolantFactoryMethodDiscrete:function(r){return new fL(this.times,this.values,this.getValueSize(),r)},InterpolantFactoryMethodLinear:function(r){return new vb(this.times,this.values,this.getValueSize(),r)},InterpolantFactoryMethodSmooth:function(r){return new hL(this.times,this.values,this.getValueSize(),r)},setInterpolation:function(r){var e;switch(r){case OM:e=this.InterpolantFactoryMethodDiscrete;break;case DM:e=this.InterpolantFactoryMethodLinear;break;case YR:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){var t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(r!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(t);console.warn(t);return}this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return OM;case this.InterpolantFactoryMethodLinear:return DM;case this.InterpolantFactoryMethodSmooth:return YR}},getValueSize:function(){return this.values.length/this.times.length},shift:function(r){if(r!==0)for(var e=this.times,t=0,i=e.length;t!==i;++t)e[t]+=r;return this},scale:function(r){if(r!==1)for(var e=this.times,t=0,i=e.length;t!==i;++t)e[t]*=r;return this},trim:function(r,e){for(var t=this.times,i=t.length,n=0,a=i-1;n!==i&&t[n]<r;)++n;for(;a!==-1&&t[a]>e;)--a;if(++a,n!==0||a!==i){n>=a&&(a=Math.max(a,1),n=a-1);var o=this.getValueSize();this.times=ca.arraySlice(t,n,a),this.values=ca.arraySlice(this.values,n*o,a*o)}return this},validate:function(){var r=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("invalid value size in track",this),r=!1);var t=this.times,i=this.values,n=t.length;n===0&&(console.error("track is empty",this),r=!1);for(var a=null,o=0;o!==n;o++){var s=t[o];if(typeof s=="number"&&isNaN(s)){console.error("time is not a valid number",this,o,s),r=!1;break}if(a!==null&&a>s){console.error("out of order keys",this,o,s,a),r=!1;break}a=s}if(i!==void 0&&ca.isTypedArray(i))for(var o=0,l=i.length;o!==l;++o){var u=i[o];if(isNaN(u)){console.error("value is not a valid number",this,o,u),r=!1;break}}return r},optimize:function(){for(var r=this.times,e=this.values,t=this.getValueSize(),i=this.getInterpolation()===YR,n=1,a=r.length-1,o=1;o<a;++o){var s=!1,l=r[o],u=r[o+1];if(l!==u&&(o!==1||l!==l[0]))if(i)s=!0;else for(var c=o*t,h=c-t,f=c+t,p=0;p!==t;++p){var d=e[c+p];if(d!==e[h+p]||d!==e[f+p]){s=!0;break}}if(s){if(o!==n){r[n]=r[o];for(var g=o*t,m=n*t,p=0;p!==t;++p)e[m+p]=e[g+p]}++n}}if(a>0){r[n]=r[a];for(var g=a*t,m=n*t,p=0;p!==t;++p)e[m+p]=e[g+p];++n}return n!==r.length&&(this.times=ca.arraySlice(r,0,n),this.values=ca.arraySlice(e,0,n*t)),this}};X0.prototype=Object.assign(Object.create(ah),{constructor:X0,ValueTypeName:"vector"});pL.prototype=Object.assign(Object.create(Zo.prototype),{constructor:pL,interpolate_:function(r,e,t,i){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=r*o,l=(t-e)/(i-e),u=s+o;s!==u;s+=4)cn.slerpFlat(n,0,a,s-o,a,s,l);return n}});gb.prototype=Object.assign(Object.create(ah),{constructor:gb,ValueTypeName:"quaternion",DefaultInterpolation:DM,InterpolantFactoryMethodLinear:function(r){return new pL(this.times,this.values,this.getValueSize(),r)},InterpolantFactoryMethodSmooth:void 0});Y0.prototype=Object.assign(Object.create(ah),{constructor:Y0,ValueTypeName:"number"});dL.prototype=Object.assign(Object.create(ah),{constructor:dL,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:OM,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});mL.prototype=Object.assign(Object.create(ah),{constructor:mL,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:OM,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});vL.prototype=Object.assign(Object.create(ah),{constructor:vL,ValueTypeName:"color"});xm.prototype=ah;ah.constructor=xm;Object.assign(xm,{parse:function(r){if(r.type===void 0)throw new Error("track type undefined, can not parse");var e=xm._getTrackTypeForValueTypeName(r.type);if(r.times===void 0){var t=[],i=[];ca.flattenJSON(r.keys,t,i,"value"),r.times=t,r.values=i}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)},toJSON:function(r){var e=r.constructor,t;if(e.toJSON!==void 0)t=e.toJSON(r);else{t={name:r.name,times:ca.convertArray(r.times,Array),values:ca.convertArray(r.values,Array)};var i=r.getInterpolation();i!==r.DefaultInterpolation&&(t.interpolation=i)}return t.type=r.ValueTypeName,t},_getTrackTypeForValueTypeName:function(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Y0;case"vector":case"vector2":case"vector3":case"vector4":return X0;case"color":return vL;case"quaternion":return gb;case"bool":case"boolean":return mL;case"string":return dL}throw new Error("Unsupported typeName: "+r)}});Ss.prototype={constructor:Ss,resetDuration:function(){for(var r=this.tracks,e=0,t=0,i=r.length;t!==i;++t){var n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}this.duration=e},trim:function(){for(var r=0;r<this.tracks.length;r++)this.tracks[r].trim(0,this.duration);return this},optimize:function(){for(var r=0;r<this.tracks.length;r++)this.tracks[r].optimize();return this}};Object.assign(Ss,{parse:function(r){for(var e=[],t=r.tracks,i=1/(r.fps||1),n=0,a=t.length;n!==a;++n)e.push(xm.parse(t[n]).scale(i));return new Ss(r.name,r.duration,e)},toJSON:function(r){for(var e=[],t=r.tracks,i={name:r.name,duration:r.duration,tracks:e},n=0,a=t.length;n!==a;++n)e.push(xm.toJSON(t[n]));return i},CreateFromMorphTargetSequence:function(r,e,t,i){for(var n=e.length,a=[],o=0;o<n;o++){var s=[],l=[];s.push((o+n-1)%n,o,(o+1)%n),l.push(0,1,0);var u=ca.getKeyframeOrder(s);s=ca.sortedArray(s,1,u),l=ca.sortedArray(l,1,u),!i&&s[0]===0&&(s.push(n),l.push(l[0])),a.push(new Y0(".morphTargetInfluences["+e[o].name+"]",s,l).scale(1/t))}return new Ss(r,-1,a)},findByName:function(r,e){var t=r;if(!Array.isArray(r)){var i=r;t=i.geometry&&i.geometry.animations||i.animations}for(var n=0;n<t.length;n++)if(t[n].name===e)return t[n];return null},CreateClipsFromMorphTargetSequences:function(r,e,t){for(var i={},n=/^([\w-]*?)([\d]+)$/,a=0,o=r.length;a<o;a++){var s=r[a],l=s.name.match(n);if(l&&l.length>1){var u=l[1],c=i[u];c||(i[u]=c=[]),c.push(s)}}var h=[];for(var u in i)h.push(Ss.CreateFromMorphTargetSequence(u,i[u],e,t));return h},parseAnimation:function(r,e){if(!r)return console.error(" no animation in JSONLoader data"),null;for(var t=function(y,x,M,S,w){if(M.length!==0){var T=[],C=[];ca.flattenJSON(M,T,C,S),T.length!==0&&w.push(new y(x,T,C))}},i=[],n=r.name||"default",a=r.length||-1,o=r.fps||30,s=r.hierarchy||[],l=0;l<s.length;l++){var u=s[l].keys;if(!(!u||u.length===0))if(u[0].morphTargets){for(var c={},h=0;h<u.length;h++)if(u[h].morphTargets)for(var f=0;f<u[h].morphTargets.length;f++)c[u[h].morphTargets[f]]=-1;for(var p in c){for(var d=[],g=[],f=0;f!==u[h].morphTargets.length;++f){var m=u[h];d.push(m.time),g.push(m.morphTarget===p?1:0)}i.push(new Y0(".morphTargetInfluence["+p+"]",d,g))}a=c.length*(o||1)}else{var v=".bones["+e[l].name+"]";t(X0,v+".position",u,"pos",i),t(gb,v+".quaternion",u,"rot",i),t(X0,v+".scale",u,"scl",i)}}if(i.length===0)return null;var _=new Ss(n,a,i);return _}});Object.assign(DL.prototype,{load:function(r,e,t,i){var n=this,a=new vl(n.manager);a.load(r,function(o){e(n.parse(JSON.parse(o)))},t,i)},setTextures:function(r){this.textures=r},parse:function(r){var e=this.textures;function t(s){return e[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),e[s]}var i=new FOe[r.type];if(r.uuid!==void 0&&(i.uuid=r.uuid),r.name!==void 0&&(i.name=r.name),r.color!==void 0&&i.color.setHex(r.color),r.roughness!==void 0&&(i.roughness=r.roughness),r.metalness!==void 0&&(i.metalness=r.metalness),r.emissive!==void 0&&i.emissive.setHex(r.emissive),r.specular!==void 0&&i.specular.setHex(r.specular),r.shininess!==void 0&&(i.shininess=r.shininess),r.clearCoat!==void 0&&(i.clearCoat=r.clearCoat),r.clearCoatRoughness!==void 0&&(i.clearCoatRoughness=r.clearCoatRoughness),r.uniforms!==void 0&&(i.uniforms=r.uniforms),r.vertexShader!==void 0&&(i.vertexShader=r.vertexShader),r.fragmentShader!==void 0&&(i.fragmentShader=r.fragmentShader),r.vertexColors!==void 0&&(i.vertexColors=r.vertexColors),r.fog!==void 0&&(i.fog=r.fog),r.shading!==void 0&&(i.shading=r.shading),r.blending!==void 0&&(i.blending=r.blending),r.side!==void 0&&(i.side=r.side),r.opacity!==void 0&&(i.opacity=r.opacity),r.transparent!==void 0&&(i.transparent=r.transparent),r.alphaTest!==void 0&&(i.alphaTest=r.alphaTest),r.depthTest!==void 0&&(i.depthTest=r.depthTest),r.depthWrite!==void 0&&(i.depthWrite=r.depthWrite),r.colorWrite!==void 0&&(i.colorWrite=r.colorWrite),r.wireframe!==void 0&&(i.wireframe=r.wireframe),r.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=r.wireframeLinewidth),r.wireframeLinecap!==void 0&&(i.wireframeLinecap=r.wireframeLinecap),r.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=r.wireframeLinejoin),r.skinning!==void 0&&(i.skinning=r.skinning),r.morphTargets!==void 0&&(i.morphTargets=r.morphTargets),r.size!==void 0&&(i.size=r.size),r.sizeAttenuation!==void 0&&(i.sizeAttenuation=r.sizeAttenuation),r.map!==void 0&&(i.map=t(r.map)),r.alphaMap!==void 0&&(i.alphaMap=t(r.alphaMap),i.transparent=!0),r.bumpMap!==void 0&&(i.bumpMap=t(r.bumpMap)),r.bumpScale!==void 0&&(i.bumpScale=r.bumpScale),r.normalMap!==void 0&&(i.normalMap=t(r.normalMap)),r.normalScale!==void 0){var n=r.normalScale;Array.isArray(n)===!1&&(n=[n,n]),i.normalScale=new Tt().fromArray(n)}if(r.displacementMap!==void 0&&(i.displacementMap=t(r.displacementMap)),r.displacementScale!==void 0&&(i.displacementScale=r.displacementScale),r.displacementBias!==void 0&&(i.displacementBias=r.displacementBias),r.roughnessMap!==void 0&&(i.roughnessMap=t(r.roughnessMap)),r.metalnessMap!==void 0&&(i.metalnessMap=t(r.metalnessMap)),r.emissiveMap!==void 0&&(i.emissiveMap=t(r.emissiveMap)),r.emissiveIntensity!==void 0&&(i.emissiveIntensity=r.emissiveIntensity),r.specularMap!==void 0&&(i.specularMap=t(r.specularMap)),r.envMap!==void 0&&(i.envMap=t(r.envMap)),r.reflectivity!==void 0&&(i.reflectivity=r.reflectivity),r.lightMap!==void 0&&(i.lightMap=t(r.lightMap)),r.lightMapIntensity!==void 0&&(i.lightMapIntensity=r.lightMapIntensity),r.aoMap!==void 0&&(i.aoMap=t(r.aoMap)),r.aoMapIntensity!==void 0&&(i.aoMapIntensity=r.aoMapIntensity),r.gradientMap!==void 0&&(i.gradientMap=t(r.gradientMap)),r.materials!==void 0)for(var a=0,o=r.materials.length;a<o;a++)i.materials.push(this.parse(r.materials[a]));return i}});Object.assign(nV.prototype,{load:function(r,e,t,i){var n=this,a=new vl(n.manager);a.load(r,function(o){e(n.parse(JSON.parse(o)))},t,i)},parse:function(r){var e=new Vt,t=r.data.index,i={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};if(t!==void 0){var n=new i[t.type](t.array);e.setIndex(new Mt(n,1))}var a=r.data.attributes;for(var o in a){var s=a[o],n=new i[s.type](s.array);e.addAttribute(o,new Mt(n,s.itemSize,s.normalized))}var l=r.data.groups||r.data.drawcalls||r.data.offsets;if(l!==void 0)for(var u=0,c=l.length;u!==c;++u){var h=l[u];e.addGroup(h.start,h.count,h.materialIndex)}var f=r.data.boundingSphere;if(f!==void 0){var p=new oe;f.center!==void 0&&p.fromArray(f.center),e.boundingSphere=new ha(p,f.radius)}return e}});im.prototype={constructor:im,crossOrigin:void 0,extractUrlBase:function(r){var e=r.split("/");return e.length===1?"./":(e.pop(),e.join("/")+"/")},initMaterials:function(r,e,t){for(var i=[],n=0;n<r.length;++n)i[n]=this.createMaterial(r[n],e,t);return i},createMaterial:function(){var r,e,t;return function(n,a,o){r===void 0&&(r=new Wt),e===void 0&&(e=new LL),t===void 0&&(t=new DL);var s={};function l(f,p,d,g,m){var v=a+f,_=im.Handlers.get(v),y;_!==null?y=_.load(v):(e.setCrossOrigin(o),y=e.load(v)),p!==void 0&&(y.repeat.fromArray(p),p[0]!==1&&(y.wrapS=Qc),p[1]!==1&&(y.wrapT=Qc)),d!==void 0&&y.offset.fromArray(d),g!==void 0&&(g[0]==="repeat"&&(y.wrapS=Qc),g[0]==="mirror"&&(y.wrapS=am),g[1]==="repeat"&&(y.wrapT=Qc),g[1]==="mirror"&&(y.wrapT=am)),m!==void 0&&(y.anisotropy=m);var x=fr.generateUUID();return s[x]=y,x}var u={uuid:fr.generateUUID(),type:"MeshLambertMaterial"};for(var c in n){var h=n[c];switch(c){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":u.name=h;break;case"blending":u.blending=Coe[h];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",c,"is no longer supported.");break;case"colorDiffuse":u.color=r.fromArray(h).getHex();break;case"colorSpecular":u.specular=r.fromArray(h).getHex();break;case"colorEmissive":u.emissive=r.fromArray(h).getHex();break;case"specularCoef":u.shininess=h;break;case"shading":h.toLowerCase()==="basic"&&(u.type="MeshBasicMaterial"),h.toLowerCase()==="phong"&&(u.type="MeshPhongMaterial"),h.toLowerCase()==="standard"&&(u.type="MeshStandardMaterial");break;case"mapDiffuse":u.map=l(h,n.mapDiffuseRepeat,n.mapDiffuseOffset,n.mapDiffuseWrap,n.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":u.emissiveMap=l(h,n.mapEmissiveRepeat,n.mapEmissiveOffset,n.mapEmissiveWrap,n.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":u.lightMap=l(h,n.mapLightRepeat,n.mapLightOffset,n.mapLightWrap,n.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":u.aoMap=l(h,n.mapAORepeat,n.mapAOOffset,n.mapAOWrap,n.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":u.bumpMap=l(h,n.mapBumpRepeat,n.mapBumpOffset,n.mapBumpWrap,n.mapBumpAnisotropy);break;case"mapBumpScale":u.bumpScale=h;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":u.normalMap=l(h,n.mapNormalRepeat,n.mapNormalOffset,n.mapNormalWrap,n.mapNormalAnisotropy);break;case"mapNormalFactor":u.normalScale=[h,h];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":u.specularMap=l(h,n.mapSpecularRepeat,n.mapSpecularOffset,n.mapSpecularWrap,n.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":u.metalnessMap=l(h,n.mapMetalnessRepeat,n.mapMetalnessOffset,n.mapMetalnessWrap,n.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":u.roughnessMap=l(h,n.mapRoughnessRepeat,n.mapRoughnessOffset,n.mapRoughnessWrap,n.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":u.alphaMap=l(h,n.mapAlphaRepeat,n.mapAlphaOffset,n.mapAlphaWrap,n.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":u.side=jf;break;case"doubleSided":u.side=n_;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),u.opacity=h;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":u[c]=h;break;case"vertexColors":h===!0&&(u.vertexColors=Em),h==="face"&&(u.vertexColors=Fk);break;default:console.error("THREE.Loader.createMaterial: Unsupported",c,h);break}}return u.type==="MeshBasicMaterial"&&delete u.emissive,u.type!=="MeshPhongMaterial"&&delete u.specular,u.opacity<1&&(u.transparent=!0),t.setTextures(s),t.parse(u)}}()};im.Handlers={handlers:[],add:function(r,e){this.handlers.push(r,e)},get:function(r){for(var e=this.handlers,t=0,i=e.length;t<i;t+=2){var n=e[t],a=e[t+1];if(n.test(r))return a}return null}};Object.assign(aV.prototype,{load:function(r,e,t,i){var n=this,a=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:im.prototype.extractUrlBase(r),o=new vl(this.manager);o.setWithCredentials(this.withCredentials),o.load(r,function(s){var l=JSON.parse(s),u=l.metadata;if(u!==void 0){var c=u.type;if(c!==void 0){if(c.toLowerCase()==="object"){console.error("THREE.JSONLoader: "+r+" should be loaded with THREE.ObjectLoader instead.");return}if(c.toLowerCase()==="scene"){console.error("THREE.JSONLoader: "+r+" should be loaded with THREE.SceneLoader instead.");return}}}var h=n.parse(l,a);e(h.geometry,h.materials)},t,i)},setTexturePath:function(r){this.texturePath=r},parse:function(r,e){var t=new ur,i=r.scale!==void 0?1/r.scale:1;n(i),a(),o(i),s(),t.computeFaceNormals(),t.computeBoundingSphere();function n(u){function c(ve,ue){return ve&1<<ue}var h,f,p,d,g,m,v,_,y,x,M,S,w,T,C,b,E,I,R,A,P,U,B,z,k,G,Y,J=r.faces,Q=r.vertices,V=r.normals,K=r.colors,ae=0;if(r.uvs!==void 0){for(h=0;h<r.uvs.length;h++)r.uvs[h].length&&ae++;for(h=0;h<ae;h++)t.faceVertexUvs[h]=[]}for(d=0,g=Q.length;d<g;)I=new oe,I.x=Q[d++]*u,I.y=Q[d++]*u,I.z=Q[d++]*u,t.vertices.push(I);for(d=0,g=J.length;d<g;)if(x=J[d++],M=c(x,0),S=c(x,1),w=c(x,3),T=c(x,4),C=c(x,5),b=c(x,6),E=c(x,7),M){if(A=new ws,A.a=J[d],A.b=J[d+1],A.c=J[d+3],P=new ws,P.a=J[d+1],P.b=J[d+2],P.c=J[d+3],d+=4,S&&(y=J[d++],A.materialIndex=y,P.materialIndex=y),p=t.faces.length,w)for(h=0;h<ae;h++)for(z=r.uvs[h],t.faceVertexUvs[h][p]=[],t.faceVertexUvs[h][p+1]=[],f=0;f<4;f++)_=J[d++],G=z[_*2],Y=z[_*2+1],k=new Tt(G,Y),f!==2&&t.faceVertexUvs[h][p].push(k),f!==0&&t.faceVertexUvs[h][p+1].push(k);if(T&&(v=J[d++]*3,A.normal.set(V[v++],V[v++],V[v]),P.normal.copy(A.normal)),C)for(h=0;h<4;h++)v=J[d++]*3,B=new oe(V[v++],V[v++],V[v]),h!==2&&A.vertexNormals.push(B),h!==0&&P.vertexNormals.push(B);if(b&&(m=J[d++],U=K[m],A.color.setHex(U),P.color.setHex(U)),E)for(h=0;h<4;h++)m=J[d++],U=K[m],h!==2&&A.vertexColors.push(new Wt(U)),h!==0&&P.vertexColors.push(new Wt(U));t.faces.push(A),t.faces.push(P)}else{if(R=new ws,R.a=J[d++],R.b=J[d++],R.c=J[d++],S&&(y=J[d++],R.materialIndex=y),p=t.faces.length,w)for(h=0;h<ae;h++)for(z=r.uvs[h],t.faceVertexUvs[h][p]=[],f=0;f<3;f++)_=J[d++],G=z[_*2],Y=z[_*2+1],k=new Tt(G,Y),t.faceVertexUvs[h][p].push(k);if(T&&(v=J[d++]*3,R.normal.set(V[v++],V[v++],V[v])),C)for(h=0;h<3;h++)v=J[d++]*3,B=new oe(V[v++],V[v++],V[v]),R.vertexNormals.push(B);if(b&&(m=J[d++],R.color.setHex(K[m])),E)for(h=0;h<3;h++)m=J[d++],R.vertexColors.push(new Wt(K[m]));t.faces.push(R)}}function a(){var u=r.influencesPerVertex!==void 0?r.influencesPerVertex:2;if(r.skinWeights)for(var c=0,h=r.skinWeights.length;c<h;c+=u){var f=r.skinWeights[c],p=u>1?r.skinWeights[c+1]:0,d=u>2?r.skinWeights[c+2]:0,g=u>3?r.skinWeights[c+3]:0;t.skinWeights.push(new ii(f,p,d,g))}if(r.skinIndices)for(var c=0,h=r.skinIndices.length;c<h;c+=u){var m=r.skinIndices[c],v=u>1?r.skinIndices[c+1]:0,_=u>2?r.skinIndices[c+2]:0,y=u>3?r.skinIndices[c+3]:0;t.skinIndices.push(new ii(m,v,_,y))}t.bones=r.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}function o(u){if(r.morphTargets!==void 0)for(var c=0,h=r.morphTargets.length;c<h;c++){t.morphTargets[c]={},t.morphTargets[c].name=r.morphTargets[c].name,t.morphTargets[c].vertices=[];for(var f=t.morphTargets[c].vertices,p=r.morphTargets[c].vertices,d=0,g=p.length;d<g;d+=3){var m=new oe;m.x=p[d]*u,m.y=p[d+1]*u,m.z=p[d+2]*u,f.push(m)}}if(r.morphColors!==void 0&&r.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var v=t.faces,_=r.morphColors[0].colors,c=0,h=v.length;c<h;c++)v[c].color.fromArray(_,c*3)}}function s(){var u=[],c=[];r.animation!==void 0&&c.push(r.animation),r.animations!==void 0&&(r.animations.length?c=c.concat(r.animations):c.push(r.animations));for(var h=0;h<c.length;h++){var f=Ss.parseAnimation(c[h],t.bones);f&&u.push(f)}if(t.morphTargets){var p=Ss.CreateClipsFromMorphTargetSequences(t.morphTargets,10);u=u.concat(p)}u.length>0&&(t.animations=u)}if(r.materials===void 0||r.materials.length===0)return{geometry:t};var l=im.prototype.initMaterials(r.materials,e,this.crossOrigin);return{geometry:t,materials:l}}});Object.assign(Ise.prototype,{load:function(r,e,t,i){this.texturePath===""&&(this.texturePath=r.substring(0,r.lastIndexOf("/")+1));var n=this,a=new vl(n.manager);a.load(r,function(o){var s=null;try{s=JSON.parse(o)}catch(u){console.error("THREE:ObjectLoader: Can't parse "+r+".",u.message);return}var l=s.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+r+". Use THREE.JSONLoader instead.");return}n.parse(s,e)},t,i)},setTexturePath:function(r){this.texturePath=r},setCrossOrigin:function(r){this.crossOrigin=r},parse:function(r,e){var t=this.parseGeometries(r.geometries),i=this.parseImages(r.images,function(){e!==void 0&&e(o)}),n=this.parseTextures(r.textures,i),a=this.parseMaterials(r.materials,n),o=this.parseObject(r.object,t,a);return r.animations&&(o.animations=this.parseAnimations(r.animations)),(r.images===void 0||r.images.length===0)&&e!==void 0&&e(o),o},parseGeometries:function(r){var e={};if(r!==void 0)for(var t=new aV,i=new nV,n=0,a=r.length;n<a;n++){var o,s=r[n];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new ru[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new ru[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new ru[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new ru[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new ru[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new ru[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":o=new ru[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new ru[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new ru[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new ru[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":o=new ru[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":o=i.parse(s);break;case"Geometry":o=t.parse(s.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,s.name!==void 0&&(o.name=s.name),e[s.uuid]=o}return e},parseMaterials:function(r,e){var t={};if(r!==void 0){var i=new DL;i.setTextures(e);for(var n=0,a=r.length;n<a;n++){var o=i.parse(r[n]);t[o.uuid]=o}}return t},parseAnimations:function(r){for(var e=[],t=0;t<r.length;t++){var i=Ss.parse(r[t]);e.push(i)}return e},parseImages:function(r,e){var t=this,i={};function n(h){return t.manager.itemStart(h),o.load(h,function(){t.manager.itemEnd(h)},void 0,function(){t.manager.itemError(h)})}if(r!==void 0&&r.length>0){var a=new tV(e),o=new Eb(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,l=r.length;s<l;s++){var u=r[s],c=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:t.texturePath+u.url;i[u.uuid]=n(c)}}return i},parseTextures:function(r,e){function t(l,u){return typeof l=="number"?l:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",l),u[l])}var i={};if(r!==void 0)for(var n=0,a=r.length;n<a;n++){var o=r[n];o.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),e[o.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s=new ci(e[o.image]);s.needsUpdate=!0,s.uuid=o.uuid,o.name!==void 0&&(s.name=o.name),o.mapping!==void 0&&(s.mapping=t(o.mapping,$oe)),o.offset!==void 0&&s.offset.fromArray(o.offset),o.repeat!==void 0&&s.repeat.fromArray(o.repeat),o.wrap!==void 0&&(s.wrapS=t(o.wrap[0],ck),s.wrapT=t(o.wrap[1],ck)),o.minFilter!==void 0&&(s.minFilter=t(o.minFilter,hk)),o.magFilter!==void 0&&(s.magFilter=t(o.magFilter,hk)),o.anisotropy!==void 0&&(s.anisotropy=o.anisotropy),o.flipY!==void 0&&(s.flipY=o.flipY),i[o.uuid]=s}return i},parseObject:function(){var r=new Kt;return function(t,i,n){var a;function o(d){return i[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",d),i[d]}function s(d){if(d!==void 0)return n[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",d),n[d]}switch(t.type){case"Scene":a=new cm,t.background!==void 0&&Number.isInteger(t.background)&&(a.background=new Wt(t.background)),t.fog!==void 0&&(t.fog.type==="Fog"?a.fog=new E0(t.fog.color,t.fog.near,t.fog.far):t.fog.type==="FogExp2"&&(a.fog=new T0(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":a=new ua(t.fov,t.aspect,t.near,t.far),t.focus!==void 0&&(a.focus=t.focus),t.zoom!==void 0&&(a.zoom=t.zoom),t.filmGauge!==void 0&&(a.filmGauge=t.filmGauge),t.filmOffset!==void 0&&(a.filmOffset=t.filmOffset),t.view!==void 0&&(a.view=Object.assign({},t.view));break;case"OrthographicCamera":a=new w0(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":a=new cL(t.color,t.intensity);break;case"DirectionalLight":a=new uL(t.color,t.intensity);break;case"PointLight":a=new sL(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":a=new oL(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":a=new nL(t.color,t.groundColor,t.intensity);break;case"Mesh":var l=o(t.geometry),u=s(t.material);l.bones&&l.bones.length>0?a=new tL(l,u):a=new _n(l,u);break;case"LOD":a=new ZM;break;case"Line":a=new rh(o(t.geometry),s(t.material),t.mode);break;case"LineSegments":a=new yi(o(t.geometry),s(t.material));break;case"PointCloud":case"Points":a=new A0(o(t.geometry),s(t.material));break;case"Sprite":a=new qM(s(t.material));break;case"Group":a=new jM;break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh type. Instantiates Object3D instead.");default:a=new Lt}if(a.uuid=t.uuid,t.name!==void 0&&(a.name=t.name),t.matrix!==void 0?(r.fromArray(t.matrix),r.decompose(a.position,a.quaternion,a.scale)):(t.position!==void 0&&a.position.fromArray(t.position),t.rotation!==void 0&&a.rotation.fromArray(t.rotation),t.quaternion!==void 0&&a.quaternion.fromArray(t.quaternion),t.scale!==void 0&&a.scale.fromArray(t.scale)),t.castShadow!==void 0&&(a.castShadow=t.castShadow),t.receiveShadow!==void 0&&(a.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==void 0&&(a.shadow.bias=t.shadow.bias),t.shadow.radius!==void 0&&(a.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(a.visible=t.visible),t.userData!==void 0&&(a.userData=t.userData),t.children!==void 0)for(var c in t.children)a.add(this.parseObject(t.children[c],i,n));if(t.type==="LOD")for(var h=t.levels,f=0;f<h.length;f++){var p=h[f],c=a.getObjectByProperty("uuid",p.object);c!==void 0&&a.addLevel(c,p.distance)}return a}}()});pa.prototype={constructor:pa,getPoint:function(r){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(r){var e=this.getUtoTmapping(r);return this.getPoint(e)},getPoints:function(r){r||(r=5);for(var e=[],t=0;t<=r;t++)e.push(this.getPoint(t/r));return e},getSpacedPoints:function(r){r||(r=5);for(var e=[],t=0;t<=r;t++)e.push(this.getPointAt(t/r));return e},getLength:function(){var r=this.getLengths();return r[r.length-1]},getLengths:function(r){if(r||(r=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===r+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e=[],t,i=this.getPoint(0),n,a=0;for(e.push(0),n=1;n<=r;n++)t=this.getPoint(n/r),a+=t.distanceTo(i),e.push(a),i=t;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(r,e){var t=this.getLengths(),i=0,n=t.length,a;e?a=e:a=r*t[n-1];for(var o=0,s=n-1,l;o<=s;)if(i=Math.floor(o+(s-o)/2),l=t[i]-a,l<0)o=i+1;else if(l>0)s=i-1;else{s=i;break}if(i=s,t[i]===a){var p=i/(n-1);return p}var u=t[i],c=t[i+1],h=c-u,f=(a-u)/h,p=(i+f)/(n-1);return p},getTangent:function(r){var e=1e-4,t=r-e,i=r+e;t<0&&(t=0),i>1&&(i=1);var n=this.getPoint(t),a=this.getPoint(i),o=a.clone().sub(n);return o.normalize()},getTangentAt:function(r){var e=this.getUtoTmapping(r);return this.getTangent(e)},computeFrenetFrames:function(r,e){var t=new oe,i=[],n=[],a=[],o=new oe,s=new Kt,l,u,c;for(l=0;l<=r;l++)u=l/r,i[l]=this.getTangentAt(u),i[l].normalize();n[0]=new oe,a[0]=new oe;var h=Number.MAX_VALUE,f=Math.abs(i[0].x),p=Math.abs(i[0].y),d=Math.abs(i[0].z);for(f<=h&&(h=f,t.set(1,0,0)),p<=h&&(h=p,t.set(0,1,0)),d<=h&&t.set(0,0,1),o.crossVectors(i[0],t).normalize(),n[0].crossVectors(i[0],o),a[0].crossVectors(i[0],n[0]),l=1;l<=r;l++)n[l]=n[l-1].clone(),a[l]=a[l-1].clone(),o.crossVectors(i[l-1],i[l]),o.length()>Number.EPSILON&&(o.normalize(),c=Math.acos(fr.clamp(i[l-1].dot(i[l]),-1,1)),n[l].applyMatrix4(s.makeRotationAxis(o,c))),a[l].crossVectors(i[l],n[l]);if(e===!0)for(c=Math.acos(fr.clamp(n[0].dot(n[r]),-1,1)),c/=r,i[0].dot(o.crossVectors(n[0],n[r]))>0&&(c=-c),l=1;l<=r;l++)n[l].applyMatrix4(s.makeRotationAxis(i[l],c*l)),a[l].crossVectors(i[l],n[l]);return{tangents:i,normals:n,binormals:a}}};pa.create=function(r,e){return r.prototype=Object.create(pa.prototype),r.prototype.constructor=r,r.prototype.getPoint=e,r};Ku.prototype=Object.create(pa.prototype);Ku.prototype.constructor=Ku;Ku.prototype.isLineCurve=!0;Ku.prototype.getPoint=function(r){if(r===1)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(r).add(this.v1),e};Ku.prototype.getPointAt=function(r){return this.getPoint(r)};Ku.prototype.getTangent=function(r){var e=this.v2.clone().sub(this.v1);return e.normalize()};yb.prototype=Object.assign(Object.create(pa.prototype),{constructor:yb,add:function(r){this.curves.push(r)},closePath:function(){var r=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);r.equals(e)||this.curves.push(new Ku(e,r))},getPoint:function(r){for(var e=r*this.getLength(),t=this.getCurveLengths(),i=0;i<t.length;){if(t[i]>=e){var n=t[i]-e,a=this.curves[i],o=a.getLength(),s=o===0?0:1-n/o;return a.getPointAt(s)}i++}return null},getLength:function(){var r=this.getCurveLengths();return r[r.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var r=[],e=0,t=0,i=this.curves.length;t<i;t++)e+=this.curves[t].getLength(),r.push(e);return this.cacheLengths=r,r},getSpacedPoints:function(r){r||(r=40);for(var e=[],t=0;t<=r;t++)e.push(this.getPoint(t/r));return this.autoClose&&e.push(e[0]),e},getPoints:function(r){r=r||12;for(var e=[],t,i=0,n=this.curves;i<n.length;i++)for(var a=n[i],o=a&&a.isEllipseCurve?r*2:a&&a.isLineCurve?1:a&&a.isSplineCurve?r*a.points.length:r,s=a.getPoints(o),l=0;l<s.length;l++){var u=s[l];t&&t.equals(u)||(e.push(u),t=u)}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},createPointsGeometry:function(r){var e=this.getPoints(r);return this.createGeometry(e)},createSpacedPointsGeometry:function(r){var e=this.getSpacedPoints(r);return this.createGeometry(e)},createGeometry:function(r){for(var e=new ur,t=0,i=r.length;t<i;t++){var n=r[t];e.vertices.push(new oe(n.x,n.y,n.z||0))}return e}});nh.prototype=Object.create(pa.prototype);nh.prototype.constructor=nh;nh.prototype.isEllipseCurve=!0;nh.prototype.getPoint=function(r){for(var e=Math.PI*2,t=this.aEndAngle-this.aStartAngle,i=Math.abs(t)<Number.EPSILON;t<0;)t+=e;for(;t>e;)t-=e;t<Number.EPSILON&&(i?t=0:t=e),this.aClockwise===!0&&!i&&(t===e?t=-e:t=t-e);var n=this.aStartAngle+r*t,a=this.aX+this.xRadius*Math.cos(n),o=this.aY+this.yRadius*Math.sin(n);if(this.aRotation!==0){var s=Math.cos(this.aRotation),l=Math.sin(this.aRotation),u=a-this.aX,c=o-this.aY;a=u*s-c*l+this.aX,o=u*l+c*s+this.aY}return new Tt(a,o)};Ab={tangentQuadraticBezier:function(r,e,t,i){return 2*(1-r)*(t-e)+2*r*(i-t)},tangentCubicBezier:function(r,e,t,i,n){return-3*e*(1-r)*(1-r)+3*t*(1-r)*(1-r)-6*r*t*(1-r)+6*r*i*(1-r)-3*r*r*i+3*r*r*n},tangentSpline:function(r,e,t,i,n){var a=6*r*r-6*r,o=3*r*r-4*r+1,s=-6*r*r+6*r,l=3*r*r-2*r;return a+o+s+l},interpolate:function(r,e,t,i,n){var a=(t-r)*.5,o=(i-e)*.5,s=n*n,l=n*s;return(2*e-2*t+a+o)*l+(-3*e+3*t-2*a-o)*s+a*n+e}};Sm.prototype=Object.create(pa.prototype);Sm.prototype.constructor=Sm;Sm.prototype.isSplineCurve=!0;Sm.prototype.getPoint=function(r){var e=this.points,t=(e.length-1)*r,i=Math.floor(t),n=t-i,a=e[i===0?i:i-1],o=e[i],s=e[i>e.length-2?e.length-1:i+1],l=e[i>e.length-3?e.length-1:i+2],u=Ab.interpolate;return new Tt(u(a.x,o.x,s.x,l.x,n),u(a.y,o.y,s.y,l.y,n))};Mm.prototype=Object.create(pa.prototype);Mm.prototype.constructor=Mm;Mm.prototype.getPoint=function(r){var e=Gn.b3;return new Tt(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y))};Mm.prototype.getTangent=function(r){var e=Ab.tangentCubicBezier;return new Tt(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()};bm.prototype=Object.create(pa.prototype);bm.prototype.constructor=bm;bm.prototype.getPoint=function(r){var e=Gn.b2;return new Tt(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y))};bm.prototype.getTangent=function(r){var e=Ab.tangentQuadraticBezier;return new Tt(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y)).normalize()};oV=Object.assign(Object.create(yb.prototype),{fromPoints:function(r){this.moveTo(r[0].x,r[0].y);for(var e=1,t=r.length;e<t;e++)this.lineTo(r[e].x,r[e].y)},moveTo:function(r,e){this.currentPoint.set(r,e)},lineTo:function(r,e){var t=new Ku(this.currentPoint.clone(),new Tt(r,e));this.curves.push(t),this.currentPoint.set(r,e)},quadraticCurveTo:function(r,e,t,i){var n=new bm(this.currentPoint.clone(),new Tt(r,e),new Tt(t,i));this.curves.push(n),this.currentPoint.set(t,i)},bezierCurveTo:function(r,e,t,i,n,a){var o=new Mm(this.currentPoint.clone(),new Tt(r,e),new Tt(t,i),new Tt(n,a));this.curves.push(o),this.currentPoint.set(n,a)},splineThru:function(r){var e=[this.currentPoint.clone()].concat(r),t=new Sm(e);this.curves.push(t),this.currentPoint.copy(r[r.length-1])},arc:function(r,e,t,i,n,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(r+o,e+s,t,i,n,a)},absarc:function(r,e,t,i,n,a){this.absellipse(r,e,t,t,i,n,a)},ellipse:function(r,e,t,i,n,a,o,s){var l=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(r+l,e+u,t,i,n,a,o,s)},absellipse:function(r,e,t,i,n,a,o,s){var l=new nh(r,e,t,i,n,a,o,s);if(this.curves.length>0){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var c=l.getPoint(1);this.currentPoint.copy(c)}});nm.prototype=Object.assign(Object.create(oV),{constructor:nm,getPointsHoles:function(r){for(var e=[],t=0,i=this.holes.length;t<i;t++)e[t]=this.holes[t].getPoints(r);return e},extractAllPoints:function(r){return{shape:this.getPoints(r),holes:this.getPointsHoles(r)}},extractPoints:function(r){return this.extractAllPoints(r)}});Cb.prototype=oV;oV.constructor=Cb;sV.prototype={moveTo:function(r,e){this.currentPath=new Cb,this.subPaths.push(this.currentPath),this.currentPath.moveTo(r,e)},lineTo:function(r,e){this.currentPath.lineTo(r,e)},quadraticCurveTo:function(r,e,t,i){this.currentPath.quadraticCurveTo(r,e,t,i)},bezierCurveTo:function(r,e,t,i,n,a){this.currentPath.bezierCurveTo(r,e,t,i,n,a)},splineThru:function(r){this.currentPath.splineThru(r)},toShapes:function(r,e){function t(P){for(var U=[],B=0,z=P.length;B<z;B++){var k=P[B],G=new nm;G.curves=k.curves,U.push(G)}return U}function i(P,U){for(var B=U.length,z=!1,k=B-1,G=0;G<B;k=G++){var Y=U[k],J=U[G],Q=J.x-Y.x,V=J.y-Y.y;if(Math.abs(V)>Number.EPSILON){if(V<0&&(Y=U[G],Q=-Q,J=U[k],V=-V),P.y<Y.y||P.y>J.y)continue;if(P.y===Y.y){if(P.x===Y.x)return!0}else{var K=V*(P.x-Y.x)-Q*(P.y-Y.y);if(K===0)return!0;if(K<0)continue;z=!z}}else{if(P.y!==Y.y)continue;if(J.x<=P.x&&P.x<=Y.x||Y.x<=P.x&&P.x<=J.x)return!0}}return z}var n=Gn.isClockWise,a=this.subPaths;if(a.length===0)return[];if(e===!0)return t(a);var o,s,l,u=[];if(a.length===1)return s=a[0],l=new nm,l.curves=s.curves,u.push(l),u;var c=!n(a[0].getPoints());c=r?!c:c;var h=[],f=[],p=[],d=0,g;f[d]=void 0,p[d]=[];for(var m=0,v=a.length;m<v;m++)s=a[m],g=s.getPoints(),o=n(g),o=r?!o:o,o?(!c&&f[d]&&d++,f[d]={s:new nm,p:g},f[d].s.curves=s.curves,c&&d++,p[d]=[]):p[d].push({h:s,p:g[0]});if(!f[0])return t(a);if(f.length>1){for(var _=!1,y=[],x=0,M=f.length;x<M;x++)h[x]=[];for(var x=0,M=f.length;x<M;x++)for(var S=p[x],w=0;w<S.length;w++){for(var T=S[w],C=!0,b=0;b<f.length;b++)i(T.p,f[b].p)&&(x!==b&&y.push({froms:x,tos:b,hole:w}),C?(C=!1,h[b].push(T)):_=!0);C&&h[x].push(T)}y.length>0&&(_||(p=h))}for(var E,m=0,I=f.length;m<I;m++){l=f[m].s,u.push(l),E=p[m];for(var R=0,A=E.length;R<A;R++)l.holes.push(E[R].h)}return u}};Object.assign(lV.prototype,{isFont:!0,generateShapes:function(r,e,t){function i(c){for(var h=String(c).split(""),f=e/a.resolution,p=0,d=[],g=0;g<h.length;g++){var m=n(h[g],f,p);p+=m.offset,d.push(m.path)}return d}function n(c,h,f){var p=a.glyphs[c]||a.glyphs["?"];if(p){var d=new sV,g=[],m=Gn.b2,v=Gn.b3,_,y,x,M,S,w,T,C,b,E,I;if(p.o)for(var R=p._cachedOutline||(p._cachedOutline=p.o.split(" ")),A=0,P=R.length;A<P;){var U=R[A++];switch(U){case"m":_=R[A++]*h+f,y=R[A++]*h,d.moveTo(_,y);break;case"l":_=R[A++]*h+f,y=R[A++]*h,d.lineTo(_,y);break;case"q":if(x=R[A++]*h+f,M=R[A++]*h,T=R[A++]*h+f,C=R[A++]*h,d.quadraticCurveTo(T,C,x,M),I=g[g.length-1],I){S=I.x,w=I.y;for(var B=1;B<=t;B++){var z=B/t;m(z,S,T,x),m(z,w,C,M)}}break;case"b":if(x=R[A++]*h+f,M=R[A++]*h,T=R[A++]*h+f,C=R[A++]*h,b=R[A++]*h+f,E=R[A++]*h,d.bezierCurveTo(T,C,b,E,x,M),I=g[g.length-1],I){S=I.x,w=I.y;for(var B=1;B<=t;B++){var z=B/t;v(z,S,T,b,x),v(z,w,C,E,M)}}break}}return{offset:p.ha*h,path:d}}}e===void 0&&(e=100),t===void 0&&(t=4);for(var a=this.data,o=i(r),s=[],l=0,u=o.length;l<u;l++)Array.prototype.push.apply(s,o[l].toShapes());return s}});Object.assign(Nse.prototype,{load:function(r,e,t,i){var n=this,a=new vl(this.manager);a.load(r,function(o){var s;try{s=JSON.parse(o)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),s=JSON.parse(o.substring(65,o.length-2))}var l=n.parse(s);e&&e(l)},t,i)},parse:function(r){return new lV(r)}});uV={getContext:function(){return WR===void 0&&(WR=new(window.AudioContext||window.webkitAudioContext)),WR},setContext:function(r){WR=r}};Object.assign(cV.prototype,{load:function(r,e,t,i){var n=new vl(this.manager);n.setResponseType("arraybuffer"),n.load(r,function(a){var o=uV.getContext();o.decodeAudioData(a,function(s){e(s)})},t,i)}});bk.prototype=Object.assign(Object.create(Bi.prototype),{constructor:bk,isRectAreaLight:!0,copy:function(r){return Bi.prototype.copy.call(this,r),this.width=r.width,this.height=r.height,this}});Object.assign(Use.prototype,{update:function(){var r,e,t,i,n,a,o,s=new Kt,l=new Kt;return function(c){var h=r!==this||e!==c.focus||t!==c.fov||i!==c.aspect*this.aspect||n!==c.near||a!==c.far||o!==c.zoom;if(h){r=this,e=c.focus,t=c.fov,i=c.aspect*this.aspect,n=c.near,a=c.far,o=c.zoom;var f=c.projectionMatrix.clone(),p=this.eyeSep/2,d=p*n/e,g=n*Math.tan(fr.DEG2RAD*t*.5)/o,m,v;l.elements[12]=-p,s.elements[12]=p,m=-g*i+d,v=g*i+d,f.elements[0]=2*n/(v-m),f.elements[8]=(v+m)/(v-m),this.cameraL.projectionMatrix.copy(f),m=-g*i-d,v=g*i-d,f.elements[0]=2*n/(v-m),f.elements[8]=(v+m)/(v-m),this.cameraR.projectionMatrix.copy(f)}this.cameraL.matrixWorld.copy(c.matrixWorld).multiply(l),this.cameraR.matrixWorld.copy(c.matrixWorld).multiply(s)}}()});gL.prototype=Object.create(Lt.prototype);gL.prototype.constructor=gL;wk.prototype=Object.assign(Object.create(Lt.prototype),{constructor:wk,getInput:function(){return this.gain},removeFilter:function(){this.filter!==null&&(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(r){this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=r,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(r){this.gain.gain.value=r},updateMatrixWorld:function(){var r=new oe,e=new cn,t=new oe,i=new oe;return function(a){Lt.prototype.updateMatrixWorld.call(this,a);var o=this.context.listener,s=this.up;this.matrixWorld.decompose(r,e,t),i.set(0,0,-1).applyQuaternion(e),o.positionX?(o.positionX.setValueAtTime(r.x,this.context.currentTime),o.positionY.setValueAtTime(r.y,this.context.currentTime),o.positionZ.setValueAtTime(r.z,this.context.currentTime),o.forwardX.setValueAtTime(i.x,this.context.currentTime),o.forwardY.setValueAtTime(i.y,this.context.currentTime),o.forwardZ.setValueAtTime(i.z,this.context.currentTime),o.upX.setValueAtTime(s.x,this.context.currentTime),o.upY.setValueAtTime(s.y,this.context.currentTime),o.upZ.setValueAtTime(s.z,this.context.currentTime)):(o.setPosition(r.x,r.y,r.z),o.setOrientation(i.x,i.y,i.z,s.x,s.y,s.z))}}()});q0.prototype=Object.assign(Object.create(Lt.prototype),{constructor:q0,getOutput:function(){return this.gain},setNodeSource:function(r){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=r,this.connect(),this},setBuffer:function(r){return this.buffer=r,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}var r=this.context.createBufferSource();return r.buffer=this.buffer,r.loop=this.loop,r.onended=this.onEnded.bind(this),r.playbackRate.setValueAtTime(this.playbackRate,this.startTime),r.start(0,this.startTime),this.isPlaying=!0,this.source=r,this.connect()},pause:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.source.stop(),this.startTime=this.context.currentTime,this.isPlaying=!1,this},stop:function(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.source.stop(),this.startTime=0,this.isPlaying=!1,this},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var r=1,e=this.filters.length;r<e;r++)this.filters[r-1].connect(this.filters[r]);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 r=1,e=this.filters.length;r<e;r++)this.filters[r-1].disconnect(this.filters[r]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(r){return r||(r=[]),this.isPlaying===!0?(this.disconnect(),this.filters=r,this.connect()):this.filters=r,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(r){return this.setFilters(r?[r]:[])},setPlaybackRate:function(r){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=r,this.isPlaying===!0&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(r){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=r,this.isPlaying===!0&&(this.source.loop=this.loop),this},getVolume:function(){return this.gain.gain.value},setVolume:function(r){return this.gain.gain.value=r,this}});Tk.prototype=Object.assign(Object.create(q0.prototype),{constructor:Tk,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(r){this.panner.refDistance=r},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(r){this.panner.rolloffFactor=r},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(r){this.panner.distanceModel=r},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(r){this.panner.maxDistance=r},updateMatrixWorld:function(){var r=new oe;return function(t){Lt.prototype.updateMatrixWorld.call(this,t),r.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(r.x,r.y,r.z)}}()});Object.assign(hV.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var r=0,e=this.getFrequencyData(),t=0;t<e.length;t++)r+=e[t];return r/e.length}});yL.prototype={constructor:yL,accumulate:function(r,e){var t=this.buffer,i=this.valueSize,n=r*i+i,a=this.cumulativeWeight;if(a===0){for(var o=0;o!==i;++o)t[n+o]=t[o];a=e}else{a+=e;var s=e/a;this._mixBufferRegion(t,n,0,s,i)}this.cumulativeWeight=a},apply:function(r){var e=this.valueSize,t=this.buffer,i=r*e+e,n=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,n<1){var o=e*3;this._mixBufferRegion(t,i,o,1-n,e)}for(var s=e,l=e+e;s!==l;++s)if(t[s]!==t[s+e]){a.setValue(t,i);break}},saveOriginalState:function(){var r=this.binding,e=this.buffer,t=this.valueSize,i=t*3;r.getValue(e,i);for(var n=t,a=i;n!==a;++n)e[n]=e[i+n%t];this.cumulativeWeight=0},restoreOriginalState:function(){var r=this.valueSize*3;this.binding.setValue(this.buffer,r)},_select:function(r,e,t,i,n){if(i>=.5)for(var a=0;a!==n;++a)r[e+a]=r[t+a]},_slerp:function(r,e,t,i,n){cn.slerpFlat(r,e,r,e,r,t,i)},_lerp:function(r,e,t,i,n){for(var a=1-i,o=0;o!==n;++o){var s=e+o;r[s]=r[s]*a+r[t+o]*i}}};Ii.prototype={constructor:Ii,getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var r=this.node,e=this.parsedPath,t=e.objectName,i=e.propertyName,n=e.propertyIndex;if(r||(r=Ii.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=r),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!r){console.error(" trying to update node for track: "+this.path+" but it wasn't found.");return}if(t){var a=e.objectIndex;switch(t){case"materials":if(!r.material){console.error(" can not bind to material as node does not have a material",this);return}if(!r.material.materials){console.error(" can not bind to material.materials as node.material does not have a materials array",this);return}r=r.material.materials;break;case"bones":if(!r.skeleton){console.error(" can not bind to bones as node does not have a skeleton",this);return}r=r.skeleton.bones;for(var o=0;o<r.length;o++)if(r[o].name===a){a=o;break}break;default:if(r[t]===void 0){console.error(" can not bind to objectName of node, undefined",this);return}r=r[t]}if(a!==void 0){if(r[a]===void 0){console.error(" trying to bind to objectIndex of objectName, but is undefined:",this,r);return}r=r[a]}}var s=r[i];if(s===void 0){var l=e.nodeName;console.error(" trying to update property for track: "+l+"."+i+" but it wasn't found.",r);return}var u=this.Versioning.None;r.needsUpdate!==void 0?(u=this.Versioning.NeedsUpdate,this.targetObject=r):r.matrixWorldNeedsUpdate!==void 0&&(u=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=r);var c=this.BindingType.Direct;if(n!==void 0){if(i==="morphTargetInfluences"){if(!r.geometry){console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry",this);return}if(!r.geometry.morphTargets){console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);return}for(var o=0;o<this.node.geometry.morphTargets.length;o++)if(r.geometry.morphTargets[o].name===n){n=o;break}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=n}else s.fromArray!==void 0&&s.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):s.length!==void 0?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][u]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Object.assign(Ii.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:Ii.prototype.getValue,_setValue_unbound:Ii.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var i=this.resolvedProperty,n=0,a=i.length;n!==a;++n)e[t++]=i[n]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.node[this.propertyName]=e[t]},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var i=this.resolvedProperty,n=0,a=i.length;n!==a;++n)i[n]=e[t++]},function(e,t){for(var i=this.resolvedProperty,n=0,a=i.length;n!==a;++n)i[n]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var i=this.resolvedProperty,n=0,a=i.length;n!==a;++n)i[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]]});Ii.Composite=function(r,e,t){var i=t||Ii.parseTrackName(e);this._targetGroup=r,this._bindings=r.subscribe_(e,i)};Ii.Composite.prototype={constructor:Ii.Composite,getValue:function(r,e){this.bind();var t=this._targetGroup.nCachedObjects_,i=this._bindings[t];i!==void 0&&i.getValue(r,e)},setValue:function(r,e){for(var t=this._bindings,i=this._targetGroup.nCachedObjects_,n=t.length;i!==n;++i)t[i].setValue(r,e)},bind:function(){for(var r=this._bindings,e=this._targetGroup.nCachedObjects_,t=r.length;e!==t;++e)r[e].bind()},unbind:function(){for(var r=this._bindings,e=this._targetGroup.nCachedObjects_,t=r.length;e!==t;++e)r[e].unbind()}};Ii.create=function(r,e,t){return r&&r.isAnimationObjectGroup?new Ii.Composite(r,e,t):new Ii(r,e,t)};Ii.parseTrackName=function(r){var e=/^((?:[\w-]+[\/:])*)([\w-]+)?(?:\.([\w-]+)(?:\[(.+)\])?)?\.([\w-]+)(?:\[(.+)\])?$/,t=e.exec(r);if(!t)throw new Error("cannot parse trackName at all: "+r);var i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]};if(i.propertyName===null||i.propertyName.length===0)throw new Error("can not parse propertyName from trackName: "+r);return i};Ii.findNode=function(r,e){if(!e||e===""||e==="root"||e==="."||e===-1||e===r.name||e===r.uuid)return r;if(r.skeleton){var t=function(o){for(var s=0;s<o.bones.length;s++){var l=o.bones[s];if(l.name===e)return l}return null},i=t(r.skeleton);if(i)return i}if(r.children){var n=function(o){for(var s=0;s<o.length;s++){var l=o[s];if(l.name===e||l.uuid===e)return l;var u=n(l.children);if(u)return u}return null},a=n(r.children);if(a)return a}return null};Ek.prototype={constructor:Ek,isAnimationObjectGroup:!0,add:function(r){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,a=this._paths,o=this._parsedPaths,s=this._bindings,l=s.length,u=0,c=arguments.length;u!==c;++u){var h=arguments[u],f=h.uuid,p=n[f],d=void 0;if(p===void 0){p=t++,n[f]=p,e.push(h);for(var g=0,m=l;g!==m;++g)s[g].push(new Ii(h,a[g],o[g]))}else if(p<i){d=e[p];var v=--i,_=e[v];n[_.uuid]=p,e[p]=_,n[f]=v,e[v]=h;for(var g=0,m=l;g!==m;++g){var y=s[g],x=y[v],M=y[p];y[p]=x,M===void 0&&(M=new Ii(h,a[g],o[g])),y[v]=M}}else e[p]!==d&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=i},remove:function(r){for(var e=this._objects,t=this.nCachedObjects_,i=this._indicesByUUID,n=this._bindings,a=n.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o],u=l.uuid,c=i[u];if(c!==void 0&&c>=t){var h=t++,f=e[h];i[f.uuid]=c,e[c]=f,i[u]=h,e[h]=l;for(var p=0,d=a;p!==d;++p){var g=n[p],m=g[h],v=g[c];g[c]=m,g[h]=v}}}this.nCachedObjects_=t},uncache:function(r){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,a=this._bindings,o=a.length,s=0,l=arguments.length;s!==l;++s){var u=arguments[s],c=u.uuid,h=n[c];if(h!==void 0)if(delete n[c],h<i){var f=--i,p=e[f],d=--t,g=e[d];n[p.uuid]=h,e[h]=p,n[g.uuid]=f,e[f]=g,e.pop();for(var m=0,v=o;m!==v;++m){var _=a[m],y=_[f],x=_[d];_[h]=y,_[f]=x,_.pop()}}else{var d=--t,g=e[d];n[g.uuid]=h,e[h]=g,e.pop();for(var m=0,v=o;m!==v;++m){var _=a[m];_[h]=_[d],_.pop()}}}this.nCachedObjects_=i},subscribe_:function(r,e){var t=this._bindingsIndicesByPath,i=t[r],n=this._bindings;if(i!==void 0)return n[i];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,c=new Array(l);i=n.length,t[r]=i,a.push(r),o.push(e),n.push(c);for(var h=u,f=s.length;h!==f;++h){var p=s[h];c[h]=new Ii(p,r,e)}return c},unsubscribe_:function(r){var e=this._bindingsIndicesByPath,t=e[r];if(t!==void 0){var i=this._paths,n=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],l=r[o];e[l]=t,a[t]=s,a.pop(),n[t]=n[o],n.pop(),i[t]=i[o],i.pop()}}};Ak.prototype={constructor:Ak,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&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(r){return this._startTime=r,this},setLoop:function(r,e){return this.loop=r,this.repetitions=e,this},setEffectiveWeight:function(r){return this.weight=r,this._effectiveWeight=this.enabled?r:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(r){return this._scheduleFading(r,0,1)},fadeOut:function(r){return this._scheduleFading(r,1,0)},crossFadeFrom:function(r,e,t){if(r.fadeOut(e),this.fadeIn(e),t){var i=this._clip.duration,n=r._clip.duration,a=n/i,o=i/n;r.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(r,e,t){return r.crossFadeFrom(this,e,t)},stopFading:function(){var r=this._weightInterpolant;return r!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(r)),this},setEffectiveTimeScale:function(r){return this.timeScale=r,this._effectiveTimeScale=this.paused?0:r,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(r){return this.timeScale=this._clip.duration/r,this.stopWarping()},syncWith:function(r){return this.time=r.time,this.timeScale=r.timeScale,this.stopWarping()},halt:function(r){return this.warp(this._effectiveTimeScale,0,r)},warp:function(r,e,t){var i=this._mixer,n=i.time,a=this._timeScaleInterpolant,o=this.timeScale;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=n,s[1]=n+t,l[0]=r/o,l[1]=e/o,this},stopWarping:function(){var r=this._timeScaleInterpolant;return r!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(r)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(r,e,t,i){var n=this._startTime;if(n!==null){var a=(r-n)*t;if(a<0||t===0)return;this._startTime=null,e=t*a}e*=this._updateTimeScale(r);var o=this._updateTime(e),s=this._updateWeight(r);if(s>0)for(var l=this._interpolants,u=this._propertyBindings,c=0,h=l.length;c!==h;++c)l[c].evaluate(o),u[c].accumulate(i,s)},_updateWeight:function(r){var e=0;if(this.enabled){e=this.weight;var t=this._weightInterpolant;if(t!==null){var i=t.evaluate(r)[0];e*=i,r>t.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(r){var e=0;if(!this.paused){e=this.timeScale;var t=this._timeScaleInterpolant;if(t!==null){var i=t.evaluate(r)[0];e*=i,r>t.parameterPositions[1]&&(this.stopWarping(),e===0?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(r){var e=this.time+r;if(r===0)return e;var t=this._clip.duration,i=this.loop,n=this._loopCount;if(i===use){n===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(e>=t)e=t;else if(e<0)e=0;else break e;this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:r<0?-1:1})}}else{var a=i===hse;if(n===-1&&(r>=0?(n=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),e>=t||e<0){var o=Math.floor(e/t);e-=t*o,n+=Math.abs(o);var s=this.repetitions-n;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=r>0?t:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:r>0?1:-1});else{if(s===0){var l=r<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&(n&1)===1)return this.time=e,t-e}return this.time=e,e},_setEndings:function(r,e,t){var i=this._interpolantSettings;t?(i.endingStart=em,i.endingEnd=em):(r?i.endingStart=this.zeroSlopeAtStart?em:om:i.endingStart=zM,e?i.endingEnd=this.zeroSlopeAtEnd?em:om:i.endingEnd=zM)},_scheduleFading:function(r,e,t){var i=this._mixer,n=i.time,a=this._weightInterpolant;a===null&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=n,s[0]=e,o[1]=n+r,s[1]=t,this}};Object.assign(fV.prototype,pl.prototype,{clipAction:function(r,e){var t=e||this._root,i=t.uuid,n=typeof r=="string"?Ss.findByName(t,r):r,a=n!==null?n.uuid:r,o=this._actionsByClip[a],s=null;if(o!==void 0){var l=o.actionByRoot[i];if(l!==void 0)return l;s=o.knownActions[0],n===null&&(n=s._clip)}if(n===null)return null;var u=new Ak(this,n,e);return this._bindAction(u,s),this._addInactiveAction(u,a,i),u},existingAction:function(r,e){var t=e||this._root,i=t.uuid,n=typeof r=="string"?Ss.findByName(t,r):r,a=n?n.uuid:r,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[i]||null},stopAllAction:function(){var r=this._actions,e=this._nActiveActions,t=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==e;++n)r[n].reset();for(var n=0;n!==i;++n)t[n].useCount=0;return this},update:function(r){r*=this.timeScale;for(var e=this._actions,t=this._nActiveActions,i=this.time+=r,n=Math.sign(r),a=this._accuIndex^=1,o=0;o!==t;++o){var s=e[o];s.enabled&&s._update(i,r,n,a)}for(var l=this._bindings,u=this._nActiveBindings,o=0;o!==u;++o)l[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(r){var e=this._actions,t=r.uuid,i=this._actionsByClip,n=i[t];if(n!==void 0){for(var a=n.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var u=l._cacheIndex,c=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=u,e[u]=c,e.pop(),this._removeInactiveBindingsForAction(l)}delete i[t]}},uncacheRoot:function(r){var e=r.uuid,t=this._actionsByClip;for(var i in t){var n=t[i].actionByRoot,a=n[e];a!==void 0&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[e];if(s!==void 0)for(var l in s){var u=s[l];u.restoreOriginalState(),this._removeInactiveBinding(u)}},uncacheAction:function(r,e){var t=this.existingAction(r,e);t!==null&&(this._deactivateAction(t),this._removeInactiveAction(t))}});Object.assign(fV.prototype,{_bindAction:function(r,e){var t=r._localRoot||this._root,i=r._clip.tracks,n=i.length,a=r._propertyBindings,o=r._interpolants,s=t.uuid,l=this._bindingsByRootAndName,u=l[s];u===void 0&&(u={},l[s]=u);for(var c=0;c!==n;++c){var h=i[c],f=h.name,p=u[f];if(p!==void 0)a[c]=p;else{if(p=a[c],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,s,f));continue}var d=e&&e._propertyBindings[c].binding.parsedPath;p=new yL(Ii.create(t,f,d),h.ValueTypeName,h.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,s,f),a[c]=p}o[c].resultBuffer=p.buffer}},_activateAction:function(r){if(!this._isActiveAction(r)){if(r._cacheIndex===null){var e=(r._localRoot||this._root).uuid,t=r._clip.uuid,i=this._actionsByClip[t];this._bindAction(r,i&&i.knownActions[0]),this._addInactiveAction(r,t,e)}for(var n=r._propertyBindings,a=0,o=n.length;a!==o;++a){var s=n[a];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(r)}},_deactivateAction:function(r){if(this._isActiveAction(r)){for(var e=r._propertyBindings,t=0,i=e.length;t!==i;++t){var n=e[t];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(r)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var r=this;this.stats={actions:{get total(){return r._actions.length},get inUse(){return r._nActiveActions}},bindings:{get total(){return r._bindings.length},get inUse(){return r._nActiveBindings}},controlInterpolants:{get total(){return r._controlInterpolants.length},get inUse(){return r._nActiveControlInterpolants}}}},_isActiveAction:function(r){var e=r._cacheIndex;return e!==null&&e<this._nActiveActions},_addInactiveAction:function(r,e,t){var i=this._actions,n=this._actionsByClip,a=n[e];if(a===void 0)a={knownActions:[r],actionByRoot:{}},r._byClipCacheIndex=0,n[e]=a;else{var o=a.knownActions;r._byClipCacheIndex=o.length,o.push(r)}r._cacheIndex=i.length,i.push(r),a.actionByRoot[t]=r},_removeInactiveAction:function(r){var e=this._actions,t=e[e.length-1],i=r._cacheIndex;t._cacheIndex=i,e[i]=t,e.pop(),r._cacheIndex=null;var n=r._clip.uuid,a=this._actionsByClip,o=a[n],s=o.knownActions,l=s[s.length-1],u=r._byClipCacheIndex;l._byClipCacheIndex=u,s[u]=l,s.pop(),r._byClipCacheIndex=null;var c=o.actionByRoot,h=(e._localRoot||this._root).uuid;delete c[h],s.length===0&&delete a[n],this._removeInactiveBindingsForAction(r)},_removeInactiveBindingsForAction:function(r){for(var e=r._propertyBindings,t=0,i=e.length;t!==i;++t){var n=e[t];--n.referenceCount===0&&this._removeInactiveBinding(n)}},_lendAction:function(r){var e=this._actions,t=r._cacheIndex,i=this._nActiveActions++,n=e[i];r._cacheIndex=i,e[i]=r,n._cacheIndex=t,e[t]=n},_takeBackAction:function(r){var e=this._actions,t=r._cacheIndex,i=--this._nActiveActions,n=e[i];r._cacheIndex=i,e[i]=r,n._cacheIndex=t,e[t]=n},_addInactiveBinding:function(r,e,t){var i=this._bindingsByRootAndName,n=i[e],a=this._bindings;n===void 0&&(n={},i[e]=n),n[t]=r,r._cacheIndex=a.length,a.push(r)},_removeInactiveBinding:function(r){var e=this._bindings,t=r.binding,i=t.rootNode.uuid,n=t.path,a=this._bindingsByRootAndName,o=a[i],s=e[e.length-1],l=r._cacheIndex;s._cacheIndex=l,e[l]=s,e.pop(),delete o[n];e:{for(var u in o)break e;delete a[i]}},_lendBinding:function(r){var e=this._bindings,t=r._cacheIndex,i=this._nActiveBindings++,n=e[i];r._cacheIndex=i,e[i]=r,n._cacheIndex=t,e[t]=n},_takeBackBinding:function(r){var e=this._bindings,t=r._cacheIndex,i=--this._nActiveBindings,n=e[i];r._cacheIndex=i,e[i]=r,n._cacheIndex=t,e[t]=n},_lendControlInterpolant:function(){var r=this._controlInterpolants,e=this._nActiveControlInterpolants++,t=r[e];return t===void 0&&(t=new vb(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),t.__cacheIndex=e,r[e]=t),t},_takeBackControlInterpolant:function(r){var e=this._controlInterpolants,t=r.__cacheIndex,i=--this._nActiveControlInterpolants,n=e[i];r.__cacheIndex=i,e[i]=r,n.__cacheIndex=t,e[t]=n},_controlInterpolantsResultBuffer:new Float32Array(1)});_L.prototype.clone=function(){return new _L(this.value.clone===void 0?this.value:this.value.clone())};wm.prototype=Object.create(Vt.prototype);wm.prototype.constructor=wm;wm.prototype.isInstancedBufferGeometry=!0;wm.prototype.addGroup=function(r,e,t){this.groups.push({start:r,count:e,materialIndex:t})};wm.prototype.copy=function(r){var e=r.index;e!==null&&this.setIndex(e.clone());var t=r.attributes;for(var i in t){var n=t[i];this.addAttribute(i,n.clone())}for(var a=r.groups,o=0,s=a.length;o<s;o++){var l=a[o];this.addGroup(l.start,l.count,l.materialIndex)}return this};Ck.prototype={constructor:Ck,isInterleavedBufferAttribute:!0,get count(){return this.data.count},get array(){return this.data.array},setX:function(r,e){return this.data.array[r*this.data.stride+this.offset]=e,this},setY:function(r,e){return this.data.array[r*this.data.stride+this.offset+1]=e,this},setZ:function(r,e){return this.data.array[r*this.data.stride+this.offset+2]=e,this},setW:function(r,e){return this.data.array[r*this.data.stride+this.offset+3]=e,this},getX:function(r){return this.data.array[r*this.data.stride+this.offset]},getY:function(r){return this.data.array[r*this.data.stride+this.offset+1]},getZ:function(r){return this.data.array[r*this.data.stride+this.offset+2]},getW:function(r){return this.data.array[r*this.data.stride+this.offset+3]},setXY:function(r,e,t){return r=r*this.data.stride+this.offset,this.data.array[r+0]=e,this.data.array[r+1]=t,this},setXYZ:function(r,e,t,i){return r=r*this.data.stride+this.offset,this.data.array[r+0]=e,this.data.array[r+1]=t,this.data.array[r+2]=i,this},setXYZW:function(r,e,t,i,n){return r=r*this.data.stride+this.offset,this.data.array[r+0]=e,this.data.array[r+1]=t,this.data.array[r+2]=i,this.data.array[r+3]=n,this}};Z0.prototype={constructor:Z0,isInterleavedBuffer:!0,set needsUpdate(r){r===!0&&this.version++},setArray:function(r){if(Array.isArray(r))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=r!==void 0?r.length/this.stride:0,this.array=r},setDynamic:function(r){return this.dynamic=r,this},copy:function(r){return this.array=new r.array.constructor(r.array),this.count=r.count,this.stride=r.stride,this.dynamic=r.dynamic,this},copyAt:function(r,e,t){r*=this.stride,t*=e.stride;for(var i=0,n=this.stride;i<n;i++)this.array[r+i]=e.array[t+i];return this},set:function(r,e){return e===void 0&&(e=0),this.array.set(r,e),this},clone:function(){return new this.constructor().copy(this)},onUpload:function(r){return this.onUploadCallback=r,this}};j0.prototype=Object.create(Z0.prototype);j0.prototype.constructor=j0;j0.prototype.isInstancedInterleavedBuffer=!0;j0.prototype.copy=function(r){return Z0.prototype.copy.call(this,r),this.meshPerAttribute=r.meshPerAttribute,this};K0.prototype=Object.create(Mt.prototype);K0.prototype.constructor=K0;K0.prototype.isInstancedBufferAttribute=!0;K0.prototype.copy=function(r){return Mt.prototype.copy.call(this,r),this.meshPerAttribute=r.meshPerAttribute,this};Rk.prototype={constructor:Rk,linePrecision:1,set:function(r,e){this.ray.set(r,e)},setFromCamera:function(r,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(r.x,r.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(r.x,r.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(r,e){var t=[];return Lk(r,this,t,e),t.sort(boe),t},intersectObjects:function(r,e){var t=[];if(Array.isArray(r)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),t;for(var i=0,n=r.length;i<n;i++)Lk(r[i],this,t,e);return t.sort(boe),t}};Dk.prototype={constructor:Dk,start:function(){this.startTime=(performance||Date).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var r=0;if(this.autoStart&&!this.running&&this.start(),this.running){var e=(performance||Date).now();r=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=r}return r}};Pk.prototype={constructor:Pk,set:function(r,e,t){return this.radius=r,this.phi=e,this.theta=t,this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.radius=r.radius,this.phi=r.phi,this.theta=r.theta,this},makeSafe:function(){var r=1e-6;return this.phi=Math.max(r,Math.min(Math.PI-r,this.phi)),this},setFromVector3:function(r){return this.radius=r.length(),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(r.x,r.z),this.phi=Math.acos(fr.clamp(r.y/this.radius,-1,1))),this}};Ik.prototype={constructor:Ik,set:function(r,e,t){return this.radius=r,this.theta=e,this.y=t,this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.radius=r.radius,this.theta=r.theta,this.y=r.y,this},setFromVector3:function(r){return this.radius=Math.sqrt(r.x*r.x+r.z*r.z),this.theta=Math.atan2(r.x,r.z),this.y=r.y,this}};Hn.prototype=Object.create(_n.prototype);Hn.prototype.constructor=Hn;Hn.prototype.createAnimation=function(r,e,t,i){var n={start:e,end:t,length:t-e+1,fps:i,duration:(t-e)/i,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[r]=n,this.animationsList.push(n)};Hn.prototype.autoCreateAnimations=function(r){for(var e=/([a-z]+)_?(\d+)/i,t,i={},n=this.geometry,a=0,o=n.morphTargets.length;a<o;a++){var s=n.morphTargets[a],l=s.name.match(e);if(l&&l.length>1){var u=l[1];i[u]||(i[u]={start:1/0,end:-1/0});var c=i[u];a<c.start&&(c.start=a),a>c.end&&(c.end=a),t||(t=u)}}for(var u in i){var c=i[u];this.createAnimation(u,c.start,c.end,r)}this.firstAnimation=t};Hn.prototype.setAnimationDirectionForward=function(r){var e=this.animationsMap[r];e&&(e.direction=1,e.directionBackwards=!1)};Hn.prototype.setAnimationDirectionBackward=function(r){var e=this.animationsMap[r];e&&(e.direction=-1,e.directionBackwards=!0)};Hn.prototype.setAnimationFPS=function(r,e){var t=this.animationsMap[r];t&&(t.fps=e,t.duration=(t.end-t.start)/t.fps)};Hn.prototype.setAnimationDuration=function(r,e){var t=this.animationsMap[r];t&&(t.duration=e,t.fps=(t.end-t.start)/t.duration)};Hn.prototype.setAnimationWeight=function(r,e){var t=this.animationsMap[r];t&&(t.weight=e)};Hn.prototype.setAnimationTime=function(r,e){var t=this.animationsMap[r];t&&(t.time=e)};Hn.prototype.getAnimationTime=function(r){var e=0,t=this.animationsMap[r];return t&&(e=t.time),e};Hn.prototype.getAnimationDuration=function(r){var e=-1,t=this.animationsMap[r];return t&&(e=t.duration),e};Hn.prototype.playAnimation=function(r){var e=this.animationsMap[r];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+r+"] undefined in .playAnimation()")};Hn.prototype.stopAnimation=function(r){var e=this.animationsMap[r];e&&(e.active=!1)};Hn.prototype.update=function(r){for(var e=0,t=this.animationsList.length;e<t;e++){var i=this.animationsList[e];if(i.active){var n=i.duration/i.length;i.time+=i.direction*r,i.mirroredLoop?(i.time>i.duration||i.time<0)&&(i.direction*=-1,i.time>i.duration&&(i.time=i.duration,i.directionBackwards=!0),i.time<0&&(i.time=0,i.directionBackwards=!1)):(i.time=i.time%i.duration,i.time<0&&(i.time+=i.duration));var a=i.start+fr.clamp(Math.floor(i.time/n),0,i.length-1),o=i.weight;a!==i.currentFrame&&(this.morphTargetInfluences[i.lastFrame]=0,this.morphTargetInfluences[i.currentFrame]=1*o,this.morphTargetInfluences[a]=0,i.lastFrame=i.currentFrame,i.currentFrame=a);var s=i.time%n/n;i.directionBackwards&&(s=1-s),i.currentFrame!==i.lastFrame?(this.morphTargetInfluences[i.currentFrame]=s*o,this.morphTargetInfluences[i.lastFrame]=(1-s)*o):this.morphTargetInfluences[i.currentFrame]=o}}};_b.prototype=Object.create(Lt.prototype);_b.prototype.constructor=_b;_b.prototype.isImmediateRenderObject=!0;xb.prototype=Object.create(yi.prototype);xb.prototype.constructor=xb;xb.prototype.update=function(){var r=new oe,e=new oe,t=new dl;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),t.getNormalMatrix(this.object.matrixWorld);var a=this.object.matrixWorld,o=this.geometry.attributes.position,s=this.object.geometry;if(s&&s.isGeometry)for(var l=s.vertices,u=s.faces,c=0,h=0,f=u.length;h<f;h++)for(var p=u[h],d=0,g=p.vertexNormals.length;d<g;d++){var m=l[p[n[d]]],v=p.vertexNormals[d];r.copy(m).applyMatrix4(a),e.copy(v).applyMatrix3(t).normalize().multiplyScalar(this.size).add(r),o.setXYZ(c,r.x,r.y,r.z),c=c+1,o.setXYZ(c,e.x,e.y,e.z),c=c+1}else if(s&&s.isBufferGeometry)for(var _=s.attributes.position,y=s.attributes.normal,c=0,d=0,g=_.count;d<g;d++)r.set(_.getX(d),_.getY(d),_.getZ(d)).applyMatrix4(a),e.set(y.getX(d),y.getY(d),y.getZ(d)),e.applyMatrix3(t).normalize().multiplyScalar(this.size).add(r),o.setXYZ(c,r.x,r.y,r.z),c=c+1,o.setXYZ(c,e.x,e.y,e.z),c=c+1;return o.needsUpdate=!0,this}}();J0.prototype=Object.create(Lt.prototype);J0.prototype.constructor=J0;J0.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()};J0.prototype.update=function(){var r=new oe,e=new oe;return function(){var i=this.light.distance?this.light.distance:1e3,n=i*Math.tan(this.light.angle);this.cone.scale.set(n,n,i),r.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(r)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();$0.prototype=Object.create(yi.prototype);$0.prototype.constructor=$0;$0.prototype.getBoneList=function(r){var e=[];r&&r.isBone&&e.push(r);for(var t=0;t<r.children.length;t++)e.push.apply(e,this.getBoneList(r.children[t]));return e};$0.prototype.update=function(){var r=new oe,e=new Kt,t=new Kt;return function(){var n=this.geometry,a=n.getAttribute("position");t.getInverse(this.root.matrixWorld);for(var o=0,s=0;o<this.bones.length;o++){var l=this.bones[o];l.parent&&l.parent.isBone&&(e.multiplyMatrices(t,l.matrixWorld),r.setFromMatrixPosition(e),a.setXYZ(s,r.x,r.y,r.z),e.multiplyMatrices(t,l.parent.matrixWorld),r.setFromMatrixPosition(e),a.setXYZ(s+1,r.x,r.y,r.z),s+=2)}n.getAttribute("position").needsUpdate=!0}}();Q0.prototype=Object.create(_n.prototype);Q0.prototype.constructor=Q0;Q0.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()};Q0.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};e_.prototype=Object.create(Lt.prototype);e_.prototype.constructor=e_;e_.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose(),this.children[1].geometry.dispose(),this.children[1].material.dispose()};e_.prototype.update=function(){var r=new oe,e=new oe;return function(){var i=this.children[0],n=this.children[1];if(this.light.target){r.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld);var a=e.clone().sub(r);i.lookAt(a),n.lookAt(a)}i.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),n.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var o=this.light.width*.5,s=this.light.height*.5,l=i.geometry.getAttribute("position"),u=l.array;u[0]=o,u[1]=-s,u[2]=0,u[3]=o,u[4]=s,u[5]=0,u[6]=-o,u[7]=s,u[8]=0,u[9]=-o,u[10]=s,u[11]=0,u[12]=-o,u[13]=-s,u[14]=0,u[15]=o,u[16]=-s,u[17]=0,l.needsUpdate=!0}}();t_.prototype=Object.create(Lt.prototype);t_.prototype.constructor=t_;t_.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()};t_.prototype.update=function(){var r=new oe,e=new Wt,t=new Wt;return function(){var n=this.children[0],a=n.geometry.getAttribute("color");e.copy(this.light.color).multiplyScalar(this.light.intensity),t.copy(this.light.groundColor).multiplyScalar(this.light.intensity);for(var o=0,s=a.count;o<s;o++){var l=o<s/2?e:t;a.setXYZ(o,l.r,l.g,l.b)}n.lookAt(r.setFromMatrixPosition(this.light.matrixWorld).negate()),a.needsUpdate=!0}}();Sb.prototype=Object.create(yi.prototype);Sb.prototype.constructor=Sb;xL.prototype=Object.create(yi.prototype);xL.prototype.constructor=xL;Mb.prototype=Object.create(yi.prototype);Mb.prototype.constructor=Mb;Mb.prototype.update=function(){var r=new oe,e=new oe,t=new dl;return function(){this.object.updateMatrixWorld(!0),t.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry,s=o.vertices,l=o.faces,u=0,c=0,h=l.length;c<h;c++){var f=l[c],p=f.normal;r.copy(s[f.a]).add(s[f.b]).add(s[f.c]).divideScalar(3).applyMatrix4(n),e.copy(p).applyMatrix3(t).normalize().multiplyScalar(this.size).add(r),a.setXYZ(u,r.x,r.y,r.z),u=u+1,a.setXYZ(u,e.x,e.y,e.z),u=u+1}return a.needsUpdate=!0,this}}();r_.prototype=Object.create(Lt.prototype);r_.prototype.constructor=r_;r_.prototype.dispose=function(){var r=this.children[0],e=this.children[1];r.geometry.dispose(),r.material.dispose(),e.geometry.dispose(),e.material.dispose()};r_.prototype.update=function(){var r=new oe,e=new oe,t=new oe;return function(){r.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),t.subVectors(e,r);var n=this.children[0],a=this.children[1];n.lookAt(t),n.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),a.lookAt(t),a.scale.z=t.length()}}();bb.prototype=Object.create(yi.prototype);bb.prototype.constructor=bb;bb.prototype.update=function(){var r,e,t=new oe,i=new fa;function n(a,o,s,l){t.set(o,s,l).unproject(i);var u=e[a];if(u!==void 0)for(var c=r.getAttribute("position"),h=0,f=u.length;h<f;h++)c.setXYZ(u[h],t.x,t.y,t.z)}return function(){r=this.geometry,e=this.pointMap;var o=1,s=1;i.projectionMatrix.copy(this.camera.projectionMatrix),n("c",0,0,-1),n("t",0,0,1),n("n1",-o,-s,-1),n("n2",o,-s,-1),n("n3",-o,s,-1),n("n4",o,s,-1),n("f1",-o,-s,1),n("f2",o,-s,1),n("f3",-o,s,1),n("f4",o,s,1),n("u1",o*.7,s*1.1,-1),n("u2",-o*.7,s*1.1,-1),n("u3",0,s*2,-1),n("cf1",-o,0,1),n("cf2",o,0,1),n("cf3",0,-s,1),n("cf4",0,s,1),n("cn1",-o,0,-1),n("cn2",o,0,-1),n("cn3",0,-s,-1),n("cn4",0,s,-1),r.getAttribute("position").needsUpdate=!0}}();i_.prototype=Object.create(yi.prototype);i_.prototype.constructor=i_;i_.prototype.update=function(){var r=new Zu;return function(t){if(t&&t.isBox3?r.copy(t):r.setFromObject(t),!r.isEmpty()){var i=r.min,n=r.max,a=this.geometry.attributes.position,o=a.array;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=i.x,o[4]=n.y,o[5]=n.z,o[6]=i.x,o[7]=i.y,o[8]=n.z,o[9]=n.x,o[10]=i.y,o[11]=n.z,o[12]=n.x,o[13]=n.y,o[14]=i.z,o[15]=i.x,o[16]=n.y,o[17]=i.z,o[18]=i.x,o[19]=i.y,o[20]=i.z,o[21]=n.x,o[22]=i.y,o[23]=i.z,a.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}();Ose=new Vt;Ose.addAttribute("position",new Mr([0,0,0,0,1,0],3));zse=new ih(0,.5,1,5,1);zse.translate(0,-.5,0);Tm.prototype=Object.create(Lt.prototype);Tm.prototype.constructor=Tm;Tm.prototype.setDirection=function(){var r=new oe,e;return function(i){i.y>.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(r.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(r,e))}}();Tm.prototype.setLength=function(r,e,t){e===void 0&&(e=.2*r),t===void 0&&(t=.2*e),this.line.scale.set(1,Math.max(0,r-e),1),this.line.updateMatrix(),this.cone.scale.set(t,e,t),this.cone.position.y=r,this.cone.updateMatrix()};Tm.prototype.setColor=function(r){this.line.material.color.copy(r),this.cone.material.color.copy(r)};SL.prototype=Object.create(yi.prototype);SL.prototype.constructor=SL;pV=function(){var r=new oe,e=new n,t=new n,i=new n;function n(){}return n.prototype.init=function(a,o,s,l){this.c0=a,this.c1=s,this.c2=-3*a+3*o-2*s-l,this.c3=2*a-2*o+s+l},n.prototype.initNonuniformCatmullRom=function(a,o,s,l,u,c,h){var f=(o-a)/u-(s-a)/(u+c)+(s-o)/c,p=(s-o)/c-(l-o)/(c+h)+(l-s)/h;f*=c,p*=c,this.init(o,s,f,p)},n.prototype.initCatmullRom=function(a,o,s,l,u){this.init(o,s,u*(s-a),u*(l-o))},n.prototype.calc=function(a){var o=a*a,s=o*a;return this.c0+this.c1*a+this.c2*o+this.c3*s},pa.create(function(a){this.points=a||[],this.closed=!1},function(a){var o=this.points,s,l,u,c;c=o.length,c<2&&console.log("duh, you need at least 2 points"),s=(c-(this.closed?0:1))*a,l=Math.floor(s),u=s-l,this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/o.length)+1)*o.length:u===0&&l===c-1&&(l=c-2,u=1);var h,f,p,d;if(this.closed||l>0?h=o[(l-1)%c]:(r.subVectors(o[0],o[1]).add(o[0]),h=r),f=o[l%c],p=o[(l+1)%c],this.closed||l+2<c?d=o[(l+2)%c]:(r.subVectors(o[c-1],o[c-2]).add(o[c-1]),d=r),this.type===void 0||this.type==="centripetal"||this.type==="chordal"){var g=this.type==="chordal"?.5:.25,m=Math.pow(h.distanceToSquared(f),g),v=Math.pow(f.distanceToSquared(p),g),_=Math.pow(p.distanceToSquared(d),g);v<1e-4&&(v=1),m<1e-4&&(m=v),_<1e-4&&(_=v),e.initNonuniformCatmullRom(h.x,f.x,p.x,d.x,m,v,_),t.initNonuniformCatmullRom(h.y,f.y,p.y,d.y,m,v,_),i.initNonuniformCatmullRom(h.z,f.z,p.z,d.z,m,v,_)}else if(this.type==="catmullrom"){var y=this.tension!==void 0?this.tension:.5;e.initCatmullRom(h.x,f.x,p.x,d.x,y),t.initCatmullRom(h.y,f.y,p.y,d.y,y),i.initCatmullRom(h.z,f.z,p.z,d.z,y)}var x=new oe(e.calc(u),t.calc(u),i.calc(u));return x})}(),VOe=pa.create(function(r){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=r===void 0?[]:r},function(r){var e=this.points,t=(e.length-1)*r,i=Math.floor(t),n=t-i,a=e[i==0?i:i-1],o=e[i],s=e[i>e.length-2?e.length-1:i+1],l=e[i>e.length-3?e.length-1:i+2],u=Ab.interpolate;return new oe(u(a.x,o.x,s.x,l.x,n),u(a.y,o.y,s.y,l.y,n),u(a.z,o.z,s.z,l.z,n))}),GOe=pa.create(function(r,e,t,i){this.v0=r,this.v1=e,this.v2=t,this.v3=i},function(r){var e=Gn.b3;return new oe(e(r,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(r,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(r,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),HOe=pa.create(function(r,e,t){this.v0=r,this.v1=e,this.v2=t},function(r){var e=Gn.b2;return new oe(e(r,this.v0.x,this.v1.x,this.v2.x),e(r,this.v0.y,this.v1.y,this.v2.y),e(r,this.v0.z,this.v1.z,this.v2.z))}),WOe=pa.create(function(r,e){this.v1=r,this.v2=e},function(r){if(r===1)return this.v2.clone();var e=new oe;return e.subVectors(this.v2,this.v1),e.multiplyScalar(r),e.add(this.v1),e});ML.prototype=Object.create(nh.prototype);ML.prototype.constructor=ML;XOe={createMultiMaterialObject:function(r,e){for(var t=new jM,i=0,n=e.length;i<n;i++)t.add(new _n(r,e[i]));return t},detach:function(r,e,t){r.applyMatrix(e.matrixWorld),e.remove(r),t.add(r)},attach:function(r,e,t){var i=new Kt;i.getInverse(t.matrixWorld),r.applyMatrix(i),e.remove(r),t.add(r)}};qOe=0,ZOe=1;Fse.prototype=Object.create(pV.prototype);Sb.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};Object.assign(BM.prototype,{center:function(r){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(r)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(r){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},size:function(r){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(r)}});Object.assign(Zu.prototype,{center:function(r){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(r)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(r){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},isIntersectionSphere:function(r){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(r)},size:function(r){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(r)}});rm.prototype.center=function(r){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(r)};fr.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()};Object.assign(dl.prototype,{flattenToArrayOffset:function(r,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(r,e)},multiplyVector3:function(r){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),r.applyMatrix3(this)},multiplyVector3Array:function(r){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(r)},applyToBuffer:function(r,e,t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(r)}});Object.assign(Kt.prototype,{extractPosition:function(r){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(r)},flattenToArrayOffset:function(r,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(r,e)},getPosition:function(){var r;return function(){return r===void 0&&(r=new oe),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),r.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(r){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(r)},multiplyVector3:function(r){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),r.applyProjection(this)},multiplyVector4:function(r){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.applyMatrix4(this)},multiplyVector3Array:function(r){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(r)},rotateAxis:function(r){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),r.transformDirection(this)},crossVector:function(r){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),r.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(r,e,t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(r)}});xs.prototype.isIntersectionLine=function(r){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(r)};cn.prototype.multiplyVector3=function(r){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),r.applyQuaternion(this)};Object.assign(Qf.prototype,{isIntersectionBox:function(r){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(r)},isIntersectionPlane:function(r){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(r)},isIntersectionSphere:function(r){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(r)}});Object.assign(nm.prototype,{extrude:function(r){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ml(this,r)},makeGeometry:function(r){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new k0(this,r)}});Object.assign(oe.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(r){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(r)},getScaleFromMatrix:function(r){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(r)},getColumnFromMatrix:function(r,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,r)}});ur.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")};Object.assign(Lt.prototype,{getChildByName:function(r){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(r)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(r,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,r)}});Object.defineProperties(Lt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(r){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=r}},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(ZM.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}});ua.prototype.setLens=function(r,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(r)};Object.defineProperties(Bi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(r){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=r}},shadowCameraLeft:{set:function(r){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=r}},shadowCameraRight:{set:function(r){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=r}},shadowCameraTop:{set:function(r){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=r}},shadowCameraBottom:{set:function(r){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=r}},shadowCameraNear:{set:function(r){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=r}},shadowCameraFar:{set:function(r){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=r}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(r){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=r}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(r){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=r}},shadowMapHeight:{set:function(r){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=r}}});Object.defineProperties(Mt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}});Object.assign(Vt.prototype,{addIndex:function(r){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(r)},addDrawCall:function(r,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(r,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(Vt.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(_L.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(_r.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new Wt}}});Object.defineProperties(nu.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(Na.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(r){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=r}}});pl.prototype=Object.assign(Object.create({constructor:pl,apply:function(r){console.warn("THREE.EventDispatcher: .apply is deprecated, just inherit or Object.assign the prototype to mix-in."),Object.assign(r,this)}}),pl.prototype);Object.assign(eV.prototype,{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(r){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(r)},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(eV.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=r}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=r}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(r){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=r}}});Object.defineProperties(Rse.prototype,{cullFace:{get:function(){return this.renderReverseSided?Nk:PM},set:function(r){var e=r!==PM;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+e+"."),this.renderReverseSided=e}}});Object.defineProperties(o_.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(r){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=r}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(r){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=r}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(r){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=r}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(r){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=r}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(r){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=r}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(r){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=r}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(r){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=r}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(r){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=r}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(r){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=r}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(r){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=r}}});q0.prototype.load=function(r){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this,t=new cV;return t.load(r,function(i){e.setBuffer(i)}),this};hV.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};g3e={merge:function(r,e,t){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var i;e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),r.merge(e,i,t)},center:function(r){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),r.center()}},y3e={crossOrigin:void 0,loadTexture:function(r,e,t,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var n=new LL;n.setCrossOrigin(this.crossOrigin);var a=n.load(r,t,void 0,i);return e&&(a.mapping=e),a},loadTextureCube:function(r,e,t,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var n=new iV;n.setCrossOrigin(this.crossOrigin);var a=n.load(r,t,void 0,i);return e&&(a.mapping=e),a},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.")}}});var Hse=Jse(PL=>{"use strict";var S3e=PL&&PL.__extends||function(r,e){for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);function i(){this.constructor=r}r.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)},Gr=(kse(),Qse(Bse)),Ti={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},Vse={type:"change"},dV={type:"start"},mV={type:"end"},Gse=1e-6,M3e=function(r){S3e(e,r);function e(t,i,n){var a=r.call(this)||this;return a.object=t,a.domElement=i!==void 0?i:document,a.window=n!==void 0?n:window,a.enabled=!0,a.target=new Gr.Vector3,a.minDistance=0,a.maxDistance=1/0,a.minZoom=0,a.maxZoom=1/0,a.minPolarAngle=0,a.maxPolarAngle=Math.PI,a.minAzimuthAngle=-1/0,a.maxAzimuthAngle=1/0,a.enableDamping=!1,a.dampingFactor=.25,a.enableZoom=!0,a.zoomSpeed=1,a.enableRotate=!0,a.rotateSpeed=1,a.enablePan=!0,a.keyPanSpeed=7,a.autoRotate=!1,a.autoRotateSpeed=2,a.enableKeys=!0,a.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},a.mouseButtons={ORBIT:Gr.MOUSE.LEFT,ZOOM:Gr.MOUSE.MIDDLE,PAN:Gr.MOUSE.RIGHT},a.target0=a.target.clone(),a.position0=a.object.position.clone(),a.zoom0=a.object.zoom,a.updateOffset=new Gr.Vector3,a.updateQuat=new Gr.Quaternion().setFromUnitVectors(t.up,new Gr.Vector3(0,1,0)),a.updateQuatInverse=a.updateQuat.clone().inverse(),a.updateLastPosition=new Gr.Vector3,a.updateLastQuaternion=new Gr.Quaternion,a.state=Ti.NONE,a.scale=1,a.spherical=new Gr.Spherical,a.sphericalDelta=new Gr.Spherical,a.panOffset=new Gr.Vector3,a.zoomChanged=!1,a.rotateStart=new Gr.Vector2,a.rotateEnd=new Gr.Vector2,a.rotateDelta=new Gr.Vector2,a.panStart=new Gr.Vector2,a.panEnd=new Gr.Vector2,a.panDelta=new Gr.Vector2,a.dollyStart=new Gr.Vector2,a.dollyEnd=new Gr.Vector2,a.dollyDelta=new Gr.Vector2,a.panLeftV=new Gr.Vector3,a.panUpV=new Gr.Vector3,a.panInternalOffset=new Gr.Vector3,a.onMouseDown=function(o){if(a.enabled!==!1){if(o.preventDefault(),o.button===a.mouseButtons.ORBIT){if(a.enableRotate===!1)return;a.rotateStart.set(o.clientX,o.clientY),a.state=Ti.ROTATE}else if(o.button===a.mouseButtons.ZOOM){if(a.enableZoom===!1)return;a.dollyStart.set(o.clientX,o.clientY),a.state=Ti.DOLLY}else if(o.button===a.mouseButtons.PAN){if(a.enablePan===!1)return;a.panStart.set(o.clientX,o.clientY),a.state=Ti.PAN}a.state!==Ti.NONE&&(document.addEventListener("mousemove",a.onMouseMove,!1),document.addEventListener("mouseup",a.onMouseUp,!1),a.dispatchEvent(dV))}},a.onMouseMove=function(o){if(a.enabled!==!1){if(o.preventDefault(),a.state===Ti.ROTATE){if(a.enableRotate===!1)return;a.rotateEnd.set(o.clientX,o.clientY),a.rotateDelta.subVectors(a.rotateEnd,a.rotateStart);var s=a.domElement===document?a.domElement.body:a.domElement;a.rotateLeft(2*Math.PI*a.rotateDelta.x/s.clientWidth*a.rotateSpeed),a.rotateUp(2*Math.PI*a.rotateDelta.y/s.clientHeight*a.rotateSpeed),a.rotateStart.copy(a.rotateEnd),a.update()}else if(a.state===Ti.DOLLY){if(a.enableZoom===!1)return;a.dollyEnd.set(o.clientX,o.clientY),a.dollyDelta.subVectors(a.dollyEnd,a.dollyStart),a.dollyDelta.y>0?a.dollyIn(a.getZoomScale()):a.dollyDelta.y<0&&a.dollyOut(a.getZoomScale()),a.dollyStart.copy(a.dollyEnd),a.update()}else if(a.state===Ti.PAN){if(a.enablePan===!1)return;a.panEnd.set(o.clientX,o.clientY),a.panDelta.subVectors(a.panEnd,a.panStart),a.pan(a.panDelta.x,a.panDelta.y),a.panStart.copy(a.panEnd),a.update()}}},a.onMouseUp=function(o){a.enabled!==!1&&(document.removeEventListener("mousemove",a.onMouseMove,!1),document.removeEventListener("mouseup",a.onMouseUp,!1),a.dispatchEvent(mV),a.state=Ti.NONE)},a.onMouseWheel=function(o){a.enabled===!1||a.enableZoom===!1||a.state!==Ti.NONE&&a.state!==Ti.ROTATE||(o.preventDefault(),o.stopPropagation(),o.deltaY<0?a.dollyOut(a.getZoomScale()):o.deltaY>0&&a.dollyIn(a.getZoomScale()),a.update(),a.dispatchEvent(dV),a.dispatchEvent(mV))},a.onKeyDown=function(o){if(!(a.enabled===!1||a.enableKeys===!1||a.enablePan===!1))switch(o.keyCode){case a.keys.UP:a.pan(0,a.keyPanSpeed),a.update();break;case a.keys.BOTTOM:a.pan(0,-a.keyPanSpeed),a.update();break;case a.keys.LEFT:a.pan(a.keyPanSpeed,0),a.update();break;case a.keys.RIGHT:a.pan(-a.keyPanSpeed,0),a.update();break}},a.onTouchStart=function(o){if(a.enabled!==!1){switch(o.touches.length){case 1:{if(a.enableRotate===!1)return;a.rotateStart.set(o.touches[0].pageX,o.touches[0].pageY),a.state=Ti.TOUCH_ROTATE}break;case 2:{if(a.enableZoom===!1)return;var s=o.touches[0].pageX-o.touches[1].pageX,l=o.touches[0].pageY-o.touches[1].pageY,u=Math.sqrt(s*s+l*l);a.dollyStart.set(0,u),a.state=Ti.TOUCH_DOLLY}break;case 3:{if(a.enablePan===!1)return;a.panStart.set(o.touches[0].pageX,o.touches[0].pageY),a.state=Ti.TOUCH_PAN}break;default:a.state=Ti.NONE}a.state!==Ti.NONE&&a.dispatchEvent(dV)}},a.onTouchMove=function(o){if(a.enabled!==!1)switch(o.preventDefault(),o.stopPropagation(),o.touches.length){case 1:{if(a.enableRotate===!1||a.state!==Ti.TOUCH_ROTATE)return;a.rotateEnd.set(o.touches[0].pageX,o.touches[0].pageY),a.rotateDelta.subVectors(a.rotateEnd,a.rotateStart);var s=a.domElement===document?a.domElement.body:a.domElement;a.rotateLeft(2*Math.PI*a.rotateDelta.x/s.clientWidth*a.rotateSpeed),a.rotateUp(2*Math.PI*a.rotateDelta.y/s.clientHeight*a.rotateSpeed),a.rotateStart.copy(a.rotateEnd),a.update()}break;case 2:{if(a.enableZoom===!1||a.state!==Ti.TOUCH_DOLLY)return;var l=o.touches[0].pageX-o.touches[1].pageX,u=o.touches[0].pageY-o.touches[1].pageY,c=Math.sqrt(l*l+u*u);a.dollyEnd.set(0,c),a.dollyDelta.subVectors(a.dollyEnd,a.dollyStart),a.dollyDelta.y>0?a.dollyOut(a.getZoomScale()):a.dollyDelta.y<0&&a.dollyIn(a.getZoomScale()),a.dollyStart.copy(a.dollyEnd),a.update()}break;case 3:{if(a.enablePan===!1||a.state!==Ti.TOUCH_PAN)return;a.panEnd.set(o.touches[0].pageX,o.touches[0].pageY),a.panDelta.subVectors(a.panEnd,a.panStart),a.pan(a.panDelta.x,a.panDelta.y),a.panStart.copy(a.panEnd),a.update()}break;default:a.state=Ti.NONE}},a.onTouchEnd=function(o){a.enabled!==!1&&(a.dispatchEvent(mV),a.state=Ti.NONE)},a.onContextMenu=function(o){o.preventDefault()},a.domElement.addEventListener("contextmenu",a.onContextMenu,!1),a.domElement.addEventListener("mousedown",a.onMouseDown,!1),a.domElement.addEventListener("wheel",a.onMouseWheel,!1),a.domElement.addEventListener("touchstart",a.onTouchStart,!1),a.domElement.addEventListener("touchend",a.onTouchEnd,!1),a.domElement.addEventListener("touchmove",a.onTouchMove,!1),a.window.addEventListener("keydown",a.onKeyDown,!1),a.update(),a}return e.prototype.update=function(){var t=this.object.position;return this.updateOffset.copy(t).sub(this.target),this.updateOffset.applyQuaternion(this.updateQuat),this.spherical.setFromVector3(this.updateOffset),this.autoRotate&&this.state===Ti.NONE&&this.rotateLeft(this.getAutoRotationAngle()),this.spherical.theta+=this.sphericalDelta.theta,this.spherical.phi+=this.sphericalDelta.phi,this.spherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.spherical.theta)),this.spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.spherical.phi)),this.spherical.makeSafe(),this.spherical.radius*=this.scale,this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),this.target.add(this.panOffset),this.updateOffset.setFromSpherical(this.spherical),this.updateOffset.applyQuaternion(this.updateQuatInverse),t.copy(this.target).add(this.updateOffset),this.object.lookAt(this.target),this.enableDamping===!0?(this.sphericalDelta.theta*=1-this.dampingFactor,this.sphericalDelta.phi*=1-this.dampingFactor):this.sphericalDelta.set(0,0,0),this.scale=1,this.panOffset.set(0,0,0),this.zoomChanged||this.updateLastPosition.distanceToSquared(this.object.position)>Gse||8*(1-this.updateLastQuaternion.dot(this.object.quaternion))>Gse?(this.dispatchEvent(Vse),this.updateLastPosition.copy(this.object.position),this.updateLastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0):!1},e.prototype.panLeft=function(t,i){this.panLeftV.setFromMatrixColumn(i,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)},e.prototype.panUp=function(t,i){this.panUpV.setFromMatrixColumn(i,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)},e.prototype.pan=function(t,i){var n=this.domElement===document?this.domElement.body:this.domElement;if(this.object instanceof Gr.PerspectiveCamera){var a=this.object.position;this.panInternalOffset.copy(a).sub(this.target);var o=this.panInternalOffset.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*o/n.clientHeight,this.object.matrix),this.panUp(2*i*o/n.clientHeight,this.object.matrix)}else this.object instanceof Gr.OrthographicCamera?(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this.panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)},e.prototype.dollyIn=function(t){this.object instanceof Gr.PerspectiveCamera?this.scale/=t:this.object instanceof Gr.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*t)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)},e.prototype.dollyOut=function(t){this.object instanceof Gr.PerspectiveCamera?this.scale*=t:this.object instanceof Gr.OrthographicCamera?(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/t)),this.object.updateProjectionMatrix(),this.zoomChanged=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)},e.prototype.getAutoRotationAngle=function(){return 2*Math.PI/60/60*this.autoRotateSpeed},e.prototype.getZoomScale=function(){return Math.pow(.95,this.zoomSpeed)},e.prototype.rotateLeft=function(t){this.sphericalDelta.theta-=t},e.prototype.rotateUp=function(t){this.sphericalDelta.phi-=t},e.prototype.getPolarAngle=function(){return this.spherical.phi},e.prototype.getAzimuthalAngle=function(){return this.spherical.theta},e.prototype.dispose=function(){this.domElement.removeEventListener("contextmenu",this.onContextMenu,!1),this.domElement.removeEventListener("mousedown",this.onMouseDown,!1),this.domElement.removeEventListener("wheel",this.onMouseWheel,!1),this.domElement.removeEventListener("touchstart",this.onTouchStart,!1),this.domElement.removeEventListener("touchend",this.onTouchEnd,!1),this.domElement.removeEventListener("touchmove",this.onTouchMove,!1),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),this.window.removeEventListener("keydown",this.onKeyDown,!1)},e.prototype.reset=function(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Vse),this.update(),this.state=Ti.NONE},Object.defineProperty(e.prototype,"center",{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"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},enumerable:!0,configurable:!0}),e}(Gr.EventDispatcher);PL.OrbitControls=M3e});var KL=function(r,e){return KL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},KL(r,e)};function Z(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");KL(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ele=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),tle=function(){function r(){this.browser=new ele,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r}(),lp=new tle;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(lp.wxa=!0,lp.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?lp.worker=!0:typeof navigator>"u"||navigator.userAgent.indexOf("Node.js")===0?(lp.node=!0,lp.svgSupported=!0):rle(navigator.userAgent,lp);function rle(r,e){var t=e.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(t.firefox=!0,t.version=i[1]),n&&(t.ie=!0,t.version=n[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in s||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}var Bt=lp;var Vb=12,JL="sans-serif",Jo=Vb+"px "+JL,ile=20,nle=100,ale="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function ole(r){var e={};if(typeof JSON>"u")return e;for(var t=0;t<r.length;t++){var i=String.fromCharCode(t+32),n=(r.charCodeAt(t)-ile)/nle;e[i]=n}return e}var sle=ole(ale),qn={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var r,e;return function(t,i){if(!r){var n=qn.createCanvas();r=n&&n.getContext("2d")}if(r)return e!==i&&(e=r.font=i||Jo),r.measureText(t);t=t||"",i=i||Jo;var a=/(\d+)px/.exec(i),o=a&&+a[1]||Vb,s=0;if(i.indexOf("mono")>=0)s=o*t.length;else for(var l=0;l<t.length;l++){var u=sle[t[l]];s+=u==null?o:u*o}return{width:s}}}(),loadImage:function(r,e,t){var i=new Image;return i.onload=e,i.onerror=t,i.src=r,i}};var YV=bn(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(r,e){return r["[object "+e+"]"]=!0,r},{}),qV=bn(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(r,e){return r["[object "+e+"Array]"]=!0,r},{}),Lm=Object.prototype.toString,Hb=Array.prototype,lle=Hb.forEach,ule=Hb.filter,$L=Hb.slice,cle=Hb.map,WV=(function(){}).constructor,Gb=WV?WV.prototype:null,QL="__proto__",hle=2311;function Wb(){return hle++}function up(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];typeof console<"u"&&console.error.apply(console,r)}function Qe(r){if(r==null||typeof r!="object")return r;var e=r,t=Lm.call(r);if(t==="[object Array]"){if(!g_(r)){e=[];for(var i=0,n=r.length;i<n;i++)e[i]=Qe(r[i])}}else if(qV[t]){if(!g_(r)){var a=r.constructor;if(a.from)e=a.from(r);else{e=new a(r.length);for(var i=0,n=r.length;i<n;i++)e[i]=r[i]}}}else if(!YV[t]&&!g_(r)&&!fh(r)){e={};for(var o in r)r.hasOwnProperty(o)&&o!==QL&&(e[o]=Qe(r[o]))}return e}function bt(r,e,t){if(!qe(e)||!qe(r))return t?Qe(e):r;for(var i in e)if(e.hasOwnProperty(i)&&i!==QL){var n=r[i],a=e[i];qe(a)&&qe(n)&&!pe(a)&&!pe(n)&&!fh(a)&&!fh(n)&&!XV(a)&&!XV(n)&&!g_(a)&&!g_(n)?bt(n,a,t):(t||!(i in r))&&(r[i]=Qe(e[i]))}return r}function Dm(r,e){for(var t=r[0],i=1,n=r.length;i<n;i++)t=bt(t,r[i],e);return t}function he(r,e){if(Object.assign)Object.assign(r,e);else for(var t in e)e.hasOwnProperty(t)&&t!==QL&&(r[t]=e[t]);return r}function Ye(r,e,t){for(var i=At(e),n=0;n<i.length;n++){var a=i[n];(t?e[a]!=null:r[a]==null)&&(r[a]=e[a])}return r}var I3e=qn.createCanvas;function yt(r,e){if(r){if(r.indexOf)return r.indexOf(e);for(var t=0,i=r.length;t<i;t++)if(r[t]===e)return t}return-1}function ZV(r,e){var t=r.prototype;function i(){}i.prototype=e.prototype,r.prototype=new i;for(var n in t)t.hasOwnProperty(n)&&(r.prototype[n]=t[n]);r.prototype.constructor=r,r.superClass=e}function Cr(r,e,t){if(r="prototype"in r?r.prototype:r,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),n=0;n<i.length;n++){var a=i[n];a!=="constructor"&&(t?e[a]!=null:r[a]==null)&&(r[a]=e[a])}else Ye(r,e,t)}function di(r){return!r||typeof r=="string"?!1:typeof r.length=="number"}function N(r,e,t){if(r&&e)if(r.forEach&&r.forEach===lle)r.forEach(e,t);else if(r.length===+r.length)for(var i=0,n=r.length;i<n;i++)e.call(t,r[i],i,r);else for(var a in r)r.hasOwnProperty(a)&&e.call(t,r[a],a,r)}function de(r,e,t){if(!r)return[];if(!e)return Xb(r);if(r.map&&r.map===cle)return r.map(e,t);for(var i=[],n=0,a=r.length;n<a;n++)i.push(e.call(t,r[n],n,r));return i}function bn(r,e,t,i){if(r&&e){for(var n=0,a=r.length;n<a;n++)t=e.call(i,t,r[n],n,r);return t}}function Yt(r,e,t){if(!r)return[];if(!e)return Xb(r);if(r.filter&&r.filter===ule)return r.filter(e,t);for(var i=[],n=0,a=r.length;n<a;n++)e.call(t,r[n],n,r)&&i.push(r[n]);return i}function jV(r,e,t){if(r&&e){for(var i=0,n=r.length;i<n;i++)if(e.call(t,r[i],i,r))return r[i]}}function At(r){if(!r)return[];if(Object.keys)return Object.keys(r);var e=[];for(var t in r)r.hasOwnProperty(t)&&e.push(t);return e}function fle(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return function(){return r.apply(e,t.concat($L.call(arguments)))}}var Be=Gb&&He(Gb.bind)?Gb.call.bind(Gb.bind):fle;function ut(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return function(){return r.apply(this,e.concat($L.call(arguments)))}}function pe(r){return Array.isArray?Array.isArray(r):Lm.call(r)==="[object Array]"}function He(r){return typeof r=="function"}function Ce(r){return typeof r=="string"}function y_(r){return Lm.call(r)==="[object String]"}function Dt(r){return typeof r=="number"}function qe(r){var e=typeof r;return e==="function"||!!r&&e==="object"}function XV(r){return!!YV[Lm.call(r)]}function Ai(r){return!!qV[Lm.call(r)]}function fh(r){return typeof r=="object"&&typeof r.nodeType=="number"&&typeof r.ownerDocument=="object"}function ph(r){return r.colorStops!=null}function KV(r){return r.image!=null}function JV(r){return Lm.call(r)==="[object RegExp]"}function dh(r){return r!==r}function Hr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=0,i=r.length;t<i;t++)if(r[t]!=null)return r[t]}function mt(r,e){return r??e}function qi(r,e,t){return r??e??t}function Xb(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return $L.apply(r,e)}function Pm(r){if(typeof r=="number")return[r,r,r,r];var e=r.length;return e===2?[r[0],r[1],r[0],r[1]]:e===3?[r[0],r[1],r[2],r[1]]:r}function Wr(r,e){if(!r)throw new Error(e)}function Zi(r){return r==null?null:typeof r.trim=="function"?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var $V="__ec_primitive__";function cp(r){r[$V]=!0}function g_(r){return r[$V]}var ple=function(){function r(){this.data={}}return r.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},r.prototype.has=function(e){return this.data.hasOwnProperty(e)},r.prototype.get=function(e){return this.data[e]},r.prototype.set=function(e,t){return this.data[e]=t,this},r.prototype.keys=function(){return At(this.data)},r.prototype.forEach=function(e){var t=this.data;for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},r}(),QV=typeof Map=="function";function dle(){return QV?new Map:new ple}var mle=function(){function r(e){var t=pe(e);this.data=dle();var i=this;e instanceof r?e.each(n):e&&N(e,n);function n(a,o){t?i.set(a,o):i.set(o,a)}}return r.prototype.hasKey=function(e){return this.data.has(e)},r.prototype.get=function(e){return this.data.get(e)},r.prototype.set=function(e,t){return this.data.set(e,t),t},r.prototype.each=function(e,t){this.data.forEach(function(i,n){e.call(t,i,n)})},r.prototype.keys=function(){var e=this.data.keys();return QV?Array.from(e):e},r.prototype.removeKey=function(e){this.data.delete(e)},r}();function ke(r){return new mle(r)}function hp(r,e){for(var t=new r.constructor(r.length+e.length),i=0;i<r.length;i++)t[i]=r[i];for(var n=r.length,i=0;i<e.length;i++)t[i+n]=e[i];return t}function mh(r,e){var t;if(Object.create)t=Object.create(r);else{var i=function(){};i.prototype=r,t=new i}return e&&he(t,e),t}function Yb(r){var e=r.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function tt(r,e){return r.hasOwnProperty(e)}function zr(){}var Im=180/Math.PI;var e2=function(r,e){return e2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},e2(r,e)};function qt(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");e2(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function uu(r,e){return r==null&&(r=0),e==null&&(e=0),[r,e]}function ji(r,e){return r[0]=e[0],r[1]=e[1],r}function ho(r){return[r[0],r[1]]}function eG(r,e,t){return r[0]=e,r[1]=t,r}function t2(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function __(r,e,t,i){return r[0]=e[0]+t[0]*i,r[1]=e[1]+t[1]*i,r}function yl(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function qb(r){return Math.sqrt(vle(r))}function vle(r){return r[0]*r[0]+r[1]*r[1]}function Nm(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}function Cs(r,e){var t=qb(e);return t===0?(r[0]=0,r[1]=0):(r[0]=e[0]/t,r[1]=e[1]/t),r}function Zb(r,e){return Math.sqrt((r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1]))}var Rs=Zb;function gle(r,e){return(r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1])}var ec=gle;function Um(r,e,t,i){return r[0]=e[0]+i*(t[0]-e[0]),r[1]=e[1]+i*(t[1]-e[1]),r}function mi(r,e,t){var i=e[0],n=e[1];return r[0]=t[0]*i+t[2]*n+t[4],r[1]=t[1]*i+t[3]*n+t[5],r}function $o(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function Qo(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}var Om=function(){function r(e,t){this.target=e,this.topTarget=t&&t.topTarget}return r}(),yle=function(){function r(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return r.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new Om(t,e),"dragstart",e.event))},r.prototype._drag=function(e){var t=this._draggingTarget;if(t){var i=e.offsetX,n=e.offsetY,a=i-this._x,o=n-this._y;this._x=i,this._y=n,t.drift(a,o,e),this.handler.dispatchToElement(new Om(t,e),"drag",e.event);var s=this.handler.findHover(i,n,t).target,l=this._dropTarget;this._dropTarget=s,t!==s&&(l&&s!==l&&this.handler.dispatchToElement(new Om(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new Om(s,e),"dragenter",e.event))}},r.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new Om(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new Om(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},r}(),tG=yle;var _le=function(){function r(e){e&&(this._$eventProcessor=e)}return r.prototype.on=function(e,t,i,n){this._$handlers||(this._$handlers={});var a=this._$handlers;if(typeof t=="function"&&(n=i,i=t,t=null),!i||!e)return this;var o=this._$eventProcessor;t!=null&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),a[e]||(a[e]=[]);for(var s=0;s<a[e].length;s++)if(a[e][s].h===i)return this;var l={h:i,query:t,ctx:n||this,callAtLast:i.zrEventfulCallAtLast},u=a[e].length-1,c=a[e][u];return c&&c.callAtLast?a[e].splice(u,0,l):a[e].push(l),this},r.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},r.prototype.off=function(e,t){var i=this._$handlers;if(!i)return this;if(!e)return this._$handlers={},this;if(t){if(i[e]){for(var n=[],a=0,o=i[e].length;a<o;a++)i[e][a].h!==t&&n.push(i[e][a]);i[e]=n}i[e]&&i[e].length===0&&delete i[e]}else delete i[e];return this},r.prototype.trigger=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[e],a=this._$eventProcessor;if(n)for(var o=t.length,s=n.length,l=0;l<s;l++){var u=n[l];if(!(a&&a.filter&&u.query!=null&&!a.filter(e,u.query)))switch(o){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,t[0]);break;case 2:u.h.call(u.ctx,t[0],t[1]);break;default:u.h.apply(u.ctx,t);break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},r.prototype.triggerWithContext=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[e],a=this._$eventProcessor;if(n)for(var o=t.length,s=t[o-1],l=n.length,u=0;u<l;u++){var c=n[u];if(!(a&&a.filter&&c.query!=null&&!a.filter(e,c.query)))switch(o){case 0:c.h.call(s);break;case 1:c.h.call(s,t[0]);break;case 2:c.h.call(s,t[0],t[1]);break;default:c.h.apply(s,t.slice(1,o-1));break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},r}(),Ni=_le;var xle=Math.log(2);function r2(r,e,t,i,n,a){var o=i+"-"+n,s=r.length;if(a.hasOwnProperty(o))return a[o];if(e===1){var l=Math.round(Math.log((1<<s)-1&~n)/xle);return r[t][l]}for(var u=i|1<<t,c=t+1;i&1<<c;)c++;for(var h=0,f=0,p=0;f<s;f++){var d=1<<f;d&n||(h+=(p%2?-1:1)*r[t][f]*r2(r,e-1,c,u,n|d,a),p++)}return a[o]=h,h}function i2(r,e){var t=[[r[0],r[1],1,0,0,0,-e[0]*r[0],-e[0]*r[1]],[0,0,0,r[0],r[1],1,-e[1]*r[0],-e[1]*r[1]],[r[2],r[3],1,0,0,0,-e[2]*r[2],-e[2]*r[3]],[0,0,0,r[2],r[3],1,-e[3]*r[2],-e[3]*r[3]],[r[4],r[5],1,0,0,0,-e[4]*r[4],-e[4]*r[5]],[0,0,0,r[4],r[5],1,-e[5]*r[4],-e[5]*r[5]],[r[6],r[7],1,0,0,0,-e[6]*r[6],-e[6]*r[7]],[0,0,0,r[6],r[7],1,-e[7]*r[6],-e[7]*r[7]]],i={},n=r2(t,8,0,0,0,i);if(n!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]==null&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*r2(t,7,o===0?1:0,1<<o,1<<s,i)/n*e[o];return function(l,u,c){var h=u*a[6]+c*a[7]+1;l[0]=(u*a[0]+c*a[1]+a[2])/h,l[1]=(u*a[3]+c*a[4]+a[5])/h}}}var rG="___zrEVENTSAVED",n2=[];function iG(r,e,t,i,n){return jb(n2,e,i,n,!0)&&jb(r,t,n2[0],n2[1])}function jb(r,e,t,i,n){if(e.getBoundingClientRect&&Bt.domSupported&&!a2(e)){var a=e[rG]||(e[rG]={}),o=Sle(e,a),s=Mle(o,a,n);if(s)return s(r,t,i),!0}return!1}function Sle(r,e){var t=e.markers;if(t)return t;t=e.markers=[];for(var i=["left","right"],n=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=o.style,l=a%2,u=(a>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),r.appendChild(o),t.push(o)}return t}function Mle(r,e,t){for(var i=t?"invTrans":"trans",n=e[i],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=r[u].getBoundingClientRect(),h=2*u,f=c.left,p=c.top;o.push(f,p),l=l&&a&&f===a[h]&&p===a[h+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&n?n:(e.srcCoords=o,e[i]=t?i2(s,o):i2(o,s))}function a2(r){return r.nodeName.toUpperCase()==="CANVAS"}var ble=/([&<>"'])/g,wle={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function wn(r){return r==null?"":(r+"").replace(ble,function(e,t){return wle[t]})}var Tle=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,o2=[],Ele=Bt.browser.firefox&&+Bt.browser.version.split(".")[0]<39;function Kb(r,e,t,i){return t=t||{},i?nG(r,e,t):Ele&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):nG(r,e,t),t}function nG(r,e,t){if(Bt.domSupported&&r.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(a2(r)){var a=r.getBoundingClientRect();t.zrX=i-a.left,t.zrY=n-a.top;return}else if(jb(o2,r,i,n)){t.zrX=o2[0],t.zrY=o2[1];return}}t.zrX=t.zrY=0}function Jb(r){return r||window.event}function fo(r,e,t){if(e=Jb(e),e.zrX!=null)return e;var i=e.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Kb(r,o,e,t)}else{Kb(r,e,e,t);var a=Ale(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&Tle.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function Ale(r){var e=r.wheelDelta;if(e)return e;var t=r.deltaX,i=r.deltaY;if(t==null||i==null)return e;var n=Math.abs(i!==0?i:t),a=i>0?-1:i<0?1:t>0?-1:1;return 3*n*a}function x_(r,e,t,i){r.addEventListener(e,t,i)}function aG(r,e,t,i){r.removeEventListener(e,t,i)}var po=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function s2(r){return r.which===2||r.which===3}var sG=function(){function r(){this._track=[]}return r.prototype.recognize=function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(e,t,i){var n=e.touches;if(n){for(var a={points:[],touches:[],target:t,event:e},o=0,s=n.length;o<s;o++){var l=n[o],u=Kb(i,l,{});a.points.push([u.zrX,u.zrY]),a.touches.push(l)}this._track.push(a)}},r.prototype._recognize=function(e){for(var t in l2)if(l2.hasOwnProperty(t)){var i=l2[t](this._track,e);if(i)return i}},r}();function oG(r){var e=r[1][0]-r[0][0],t=r[1][1]-r[0][1];return Math.sqrt(e*e+t*t)}function Cle(r){return[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]}var l2={pinch:function(r,e){var t=r.length;if(t){var i=(r[t-1]||{}).points,n=(r[t-2]||{}).points||i;if(n&&n.length>1&&i&&i.length>1){var a=oG(i)/oG(n);!isFinite(a)&&(a=1),e.pinchScale=a;var o=Cle(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:r[0].target,event:e}}}}};function Ci(){return[1,0,0,1,0,0]}function vh(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function S_(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r}function mo(r,e,t){var i=e[0]*t[0]+e[2]*t[1],n=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function Tn(r,e,t){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4]+t[0],r[5]=e[5]+t[1],r}function vo(r,e,t,i){i===void 0&&(i=[0,0]);var n=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],c=Math.sin(t),h=Math.cos(t);return r[0]=n*h+s*c,r[1]=-n*c+s*h,r[2]=a*h+l*c,r[3]=-a*c+h*l,r[4]=h*(o-i[0])+c*(u-i[1])+i[0],r[5]=h*(u-i[1])-c*(o-i[0])+i[1],r}function Fm(r,e,t){var i=t[0],n=t[1];return r[0]=e[0]*i,r[1]=e[1]*n,r[2]=e[2]*i,r[3]=e[3]*n,r[4]=e[4]*i,r[5]=e[5]*n,r}function Ls(r,e){var t=e[0],i=e[2],n=e[4],a=e[1],o=e[3],s=e[5],l=t*o-a*i;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-i*l,r[3]=t*l,r[4]=(i*s-o*n)*l,r[5]=(a*n-t*s)*l,r):null}function lG(r){var e=Ci();return S_(e,r),e}var Rle=function(){function r(e,t){this.x=e||0,this.y=t||0}return r.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(e,t){return this.x=e,this.y=t,this},r.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},r.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},r.prototype.scale=function(e){this.x*=e,this.y*=e},r.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},r.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},r.prototype.dot=function(e){return this.x*e.x+this.y*e.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},r.prototype.distance=function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},r.prototype.distanceSquare=function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(e){if(e){var t=this.x,i=this.y;return this.x=e[0]*t+e[2]*i+e[4],this.y=e[1]*t+e[3]*i+e[5],this}},r.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},r.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},r.set=function(e,t,i){e.x=t,e.y=i},r.copy=function(e,t){e.x=t.x,e.y=t.y},r.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},r.lenSquare=function(e){return e.x*e.x+e.y*e.y},r.dot=function(e,t){return e.x*t.x+e.y*t.y},r.add=function(e,t,i){e.x=t.x+i.x,e.y=t.y+i.y},r.sub=function(e,t,i){e.x=t.x-i.x,e.y=t.y-i.y},r.scale=function(e,t,i){e.x=t.x*i,e.y=t.y*i},r.scaleAndAdd=function(e,t,i,n){e.x=t.x+i.x*n,e.y=t.y+i.y*n},r.lerp=function(e,t,i,n){var a=1-n;e.x=a*t.x+n*i.x,e.y=a*t.y+n*i.y},r}(),zt=Rle;var $b=Math.min,Qb=Math.max,fp=new zt,pp=new zt,dp=new zt,mp=new zt,M_=new zt,b_=new zt,Lle=function(){function r(e,t,i,n){i<0&&(e=e+i,i=-i),n<0&&(t=t+n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}return r.prototype.union=function(e){var t=$b(e.x,this.x),i=$b(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Qb(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Qb(e.y+e.height,this.y+this.height)-i:this.height=e.height,this.x=t,this.y=i},r.prototype.applyTransform=function(e){r.applyTransform(this,this,e)},r.prototype.calculateTransform=function(e){var t=this,i=e.width/t.width,n=e.height/t.height,a=Ci();return Tn(a,a,[-t.x,-t.y]),Fm(a,a,[i,n]),Tn(a,a,[e.x,e.y]),a},r.prototype.intersect=function(e,t){if(!e)return!1;e instanceof r||(e=r.create(e));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,c=e.y,h=e.y+e.height,f=!(a<l||u<n||s<c||h<o);if(t){var p=1/0,d=0,g=Math.abs(a-l),m=Math.abs(u-n),v=Math.abs(s-c),_=Math.abs(h-o),y=Math.min(g,m),x=Math.min(v,_);a<l||u<n?y>d&&(d=y,g<m?zt.set(b_,-g,0):zt.set(b_,m,0)):y<p&&(p=y,g<m?zt.set(M_,g,0):zt.set(M_,-m,0)),s<c||h<o?x>d&&(d=x,v<_?zt.set(b_,0,-v):zt.set(b_,0,_)):y<p&&(p=y,v<_?zt.set(M_,0,v):zt.set(M_,0,-_))}return t&&zt.copy(t,f?M_:b_),f},r.prototype.contain=function(e,t){var i=this;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(e){r.copy(this,e)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(e){return new r(e.x,e.y,e.width,e.height)},r.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},r.applyTransform=function(e,t,i){if(!i){e!==t&&r.copy(e,t);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];e.x=t.x*n+o,e.y=t.y*a+s,e.width=t.width*n,e.height=t.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}fp.x=dp.x=t.x,fp.y=mp.y=t.y,pp.x=mp.x=t.x+t.width,pp.y=dp.y=t.y+t.height,fp.transform(i),mp.transform(i),pp.transform(i),dp.transform(i),e.x=$b(fp.x,pp.x,dp.x,mp.x),e.y=$b(fp.y,pp.y,dp.y,mp.y);var l=Qb(fp.x,pp.x,dp.x,mp.x),u=Qb(fp.y,pp.y,dp.y,mp.y);e.width=l-e.x,e.height=u-e.y},r}(),ht=Lle;var cG="silent";function Dle(r,e,t){return{type:r,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:Ple}}function Ple(){po(this.event)}var Ile=function(r){qt(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Ni),w_=function(){function r(e,t){this.x=e,this.y=t}return r}(),Nle=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],u2=new ht(0,0,0,0),hG=function(r){qt(e,r);function e(t,i,n,a,o){var s=r.call(this)||this;return s._hovered=new w_(0,0),s.storage=t,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new Ile,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new tG(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(N(Nle,function(i){t.on&&t.on(i,this[i],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var i=t.zrX,n=t.zrY,a=fG(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new w_(i,n):this.findHover(i,n),u=l.target,c=this.proxy;c.setCursor&&c.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var i=t.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new w_(0,0)},e.prototype.dispatch=function(t,i){var n=this[t];n&&n.call(this,i)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var i=this.proxy;i.setCursor&&i.setCursor(t)},e.prototype.dispatchToElement=function(t,i,n){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var o="on"+i,s=Dle(i,t,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},e.prototype.findHover=function(t,i,n){var a=this.storage.getDisplayList(),o=new w_(t,i);if(uG(a,o,t,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,c=new ht(t-u,i-u,l,l),h=a.length-1;h>=0;h--){var f=a[h];f!==n&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(u2.copy(f.getBoundingRect()),f.transform&&u2.applyTransform(f.transform),u2.intersect(c)&&s.push(f))}if(s.length)for(var p=4,d=Math.PI/12,g=Math.PI*2,m=0;m<u;m+=p)for(var v=0;v<g;v+=d){var _=t+m*Math.cos(v),y=i+m*Math.sin(v);if(uG(s,o,_,y,n),o.target)return o}}return o},e.prototype.processGesture=function(t,i){this._gestureMgr||(this._gestureMgr=new sG);var n=this._gestureMgr;i==="start"&&n.clear();var a=n.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if(i==="end"&&n.clear(),a){var o=a.type;t.gestureEvent=o;var s=new w_;s.target=a.target,this.dispatchToElement(s,o,a.event)}},e}(Ni);N(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(r){hG.prototype[r]=function(e){var t=e.zrX,i=e.zrY,n=fG(this,t,i),a,o;if((r!=="mouseup"||!n)&&(a=this.findHover(t,i),o=a.target),r==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(r==="mouseup")this._upEl=o;else if(r==="click"){if(this._downEl!==this._upEl||!this._downPoint||Rs(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,r,e)}});function Ule(r,e,t){if(r[r.rectHover?"rectContain":"contain"](e,t)){for(var i=r,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(e,t))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s||i.parent}return n?cG:!0}return!1}function uG(r,e,t,i,n){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==n&&!o.ignore&&(s=Ule(o,t,i))&&(!e.topTarget&&(e.topTarget=o),s!==cG)){e.target=o;break}}}function fG(r,e,t){var i=r.painter;return e<0||e>i.getWidth()||t<0||t>i.getHeight()}var pG=hG;var vG=32,T_=7;function Ole(r){for(var e=0;r>=vG;)e|=r&1,r>>=1;return r+e}function dG(r,e,t,i){var n=e+1;if(n===t)return 1;if(i(r[n++],r[e])<0){for(;n<t&&i(r[n],r[n-1])<0;)n++;zle(r,e,n)}else for(;n<t&&i(r[n],r[n-1])>=0;)n++;return n-e}function zle(r,e,t){for(t--;e<t;){var i=r[e];r[e++]=r[t],r[t--]=i}}function mG(r,e,t,i,n){for(i===e&&i++;i<t;i++){for(var a=r[i],o=e,s=i,l;o<s;)l=o+s>>>1,n(a,r[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function c2(r,e,t,i,n,a){var o=0,s=0,l=1;if(a(r,e[t+n])>0){for(s=i-n;l<s&&a(r,e[t+n+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;l<s&&a(r,e[t+n-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o<l;){var c=o+(l-o>>>1);a(r,e[t+c])>0?o=c+1:l=c}return l}function h2(r,e,t,i,n,a){var o=0,s=0,l=1;if(a(r,e[t+n])<0){for(s=n+1;l<s&&a(r,e[t+n-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l<s&&a(r,e[t+n+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o<l;){var c=o+(l-o>>>1);a(r,e[t+c])<0?l=c:o=c+1}return l}function Fle(r,e){var t=T_,i,n,a=0,o=[];i=[],n=[];function s(p,d){i[a]=p,n[a]=d,a+=1}function l(){for(;a>1;){var p=a-2;if(p>=1&&n[p-1]<=n[p]+n[p+1]||p>=2&&n[p-2]<=n[p]+n[p-1])n[p-1]<n[p+1]&&p--;else if(n[p]>n[p+1])break;c(p)}}function u(){for(;a>1;){var p=a-2;p>0&&n[p-1]<n[p+1]&&p--,c(p)}}function c(p){var d=i[p],g=n[p],m=i[p+1],v=n[p+1];n[p]=g+v,p===a-3&&(i[p+1]=i[p+2],n[p+1]=n[p+2]),a--;var _=h2(r[m],r,d,g,0,e);d+=_,g-=_,g!==0&&(v=c2(r[d+g-1],r,m,v,v-1,e),v!==0&&(g<=v?h(d,g,m,v):f(d,g,m,v)))}function h(p,d,g,m){var v=0;for(v=0;v<d;v++)o[v]=r[p+v];var _=0,y=g,x=p;if(r[x++]=r[y++],--m===0){for(v=0;v<d;v++)r[x+v]=o[_+v];return}if(d===1){for(v=0;v<m;v++)r[x+v]=r[y+v];r[x+m]=o[_];return}for(var M=t,S,w,T;;){S=0,w=0,T=!1;do if(e(r[y],o[_])<0){if(r[x++]=r[y++],w++,S=0,--m===0){T=!0;break}}else if(r[x++]=o[_++],S++,w=0,--d===1){T=!0;break}while((S|w)<M);if(T)break;do{if(S=h2(r[y],o,_,d,0,e),S!==0){for(v=0;v<S;v++)r[x+v]=o[_+v];if(x+=S,_+=S,d-=S,d<=1){T=!0;break}}if(r[x++]=r[y++],--m===0){T=!0;break}if(w=c2(o[_],r,y,m,0,e),w!==0){for(v=0;v<w;v++)r[x+v]=r[y+v];if(x+=w,y+=w,m-=w,m===0){T=!0;break}}if(r[x++]=o[_++],--d===1){T=!0;break}M--}while(S>=T_||w>=T_);if(T)break;M<0&&(M=0),M+=2}if(t=M,t<1&&(t=1),d===1){for(v=0;v<m;v++)r[x+v]=r[y+v];r[x+m]=o[_]}else{if(d===0)throw new Error;for(v=0;v<d;v++)r[x+v]=o[_+v]}}function f(p,d,g,m){var v=0;for(v=0;v<m;v++)o[v]=r[g+v];var _=p+d-1,y=m-1,x=g+m-1,M=0,S=0;if(r[x--]=r[_--],--d===0){for(M=x-(m-1),v=0;v<m;v++)r[M+v]=o[v];return}if(m===1){for(x-=d,_-=d,S=x+1,M=_+1,v=d-1;v>=0;v--)r[S+v]=r[M+v];r[x]=o[y];return}for(var w=t;;){var T=0,C=0,b=!1;do if(e(o[y],r[_])<0){if(r[x--]=r[_--],T++,C=0,--d===0){b=!0;break}}else if(r[x--]=o[y--],C++,T=0,--m===1){b=!0;break}while((T|C)<w);if(b)break;do{if(T=d-h2(o[y],r,p,d,d-1,e),T!==0){for(x-=T,_-=T,d-=T,S=x+1,M=_+1,v=T-1;v>=0;v--)r[S+v]=r[M+v];if(d===0){b=!0;break}}if(r[x--]=o[y--],--m===1){b=!0;break}if(C=m-c2(r[_],o,0,m,m-1,e),C!==0){for(x-=C,y-=C,m-=C,S=x+1,M=y+1,v=0;v<C;v++)r[S+v]=o[M+v];if(m<=1){b=!0;break}}if(r[x--]=r[_--],--d===0){b=!0;break}w--}while(T>=T_||C>=T_);if(b)break;w<0&&(w=0),w+=2}if(t=w,t<1&&(t=1),m===1){for(x-=d,_-=d,S=x+1,M=_+1,v=d-1;v>=0;v--)r[S+v]=r[M+v];r[x]=o[y]}else{if(m===0)throw new Error;for(M=x-(m-1),v=0;v<m;v++)r[M+v]=o[v]}}return{mergeRuns:l,forceMergeRuns:u,pushRun:s}}function vp(r,e,t,i){t||(t=0),i||(i=r.length);var n=i-t;if(!(n<2)){var a=0;if(n<vG){a=dG(r,t,i,e),mG(r,t,i,t+a,e);return}var o=Fle(r,e),s=Ole(n);do{if(a=dG(r,t,i,e),a<s){var l=n;l>s&&(l=s),mG(r,t,t+l,t+a,e),a=l}o.pushRun(t,a),o.mergeRuns(),n-=a,t+=a}while(n!==0);o.forceMergeRuns()}}var ki=1,gp=2,gh=4;var gG=!1;function f2(){gG||(gG=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function yG(r,e){return r.zlevel===e.zlevel?r.z===e.z?r.z2-e.z2:r.z-e.z:r.zlevel-e.zlevel}var Ble=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=yG}return r.prototype.traverse=function(e,t){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,t)},r.prototype.getDisplayList=function(e,t){t=t||!1;var i=this._displayList;return(e||!i.length)&&this.updateDisplayList(t),i},r.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,i=this._displayList,n=0,a=t.length;n<a;n++)this._updateAndAddDisplayable(t[n],null,e);i.length=this._displayListLen,vp(i,yG)},r.prototype._updateAndAddDisplayable=function(e,t,i){if(!(e.ignore&&!i)){e.beforeUpdate(),e.update(),e.afterUpdate();var n=e.getClipPath();if(e.ignoreClip)t=null;else if(n){t?t=t.slice():t=[];for(var a=n,o=e;a;)a.parent=o,a.updateTransform(),t.push(a),o=a,a=a.getClipPath()}if(e.childrenRef){for(var s=e.childrenRef(),l=0;l<s.length;l++){var u=s[l];e.__dirty&&(u.__dirty|=ki),this._updateAndAddDisplayable(u,t,i)}e.__dirty=0}else{var c=e;t&&t.length?c.__clipPaths=t:c.__clipPaths&&c.__clipPaths.length>0&&(c.__clipPaths=[]),isNaN(c.z)&&(f2(),c.z=0),isNaN(c.z2)&&(f2(),c.z2=0),isNaN(c.zlevel)&&(f2(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var h=e.getDecalElement&&e.getDecalElement();h&&this._updateAndAddDisplayable(h,t,i);var f=e.getTextGuideLine();f&&this._updateAndAddDisplayable(f,t,i);var p=e.getTextContent();p&&this._updateAndAddDisplayable(p,t,i)}},r.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},r.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,i=e.length;t<i;t++)this.delRoot(e[t]);return}var n=yt(this._roots,e);n>=0&&this._roots.splice(n,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),_G=Ble;var xG;xG=Bt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var E_=xG;var ew={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)))},elasticOut:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*r)*Math.sin((r-e)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var e,t=.1,i=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),(r*=2)<1?-.5*(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)):t*Math.pow(2,-10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var e=1.70158;return r*r*((e+1)*r-e)},backOut:function(r){var e=1.70158;return--r*r*((e+1)*r+e)+1},backInOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)},bounceIn:function(r){return 1-ew.bounceOut(1-r)},bounceOut:function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},bounceInOut:function(r){return r<.5?ew.bounceIn(r*2)*.5:ew.bounceOut(r*2-1)*.5+.5}},tw=ew;var rw=Math.pow,_h=Math.sqrt,nw=1e-8,MG=1e-4,SG=_h(3),iw=1/3,cu=uu(),Ds=uu(),Bm=uu();function yh(r){return r>-nw&&r<nw}function bG(r){return r>nw||r<-nw}function vi(r,e,t,i,n){var a=1-n;return a*a*(a*r+3*n*e)+n*n*(n*i+3*a*t)}function p2(r,e,t,i,n){var a=1-n;return 3*(((e-r)*a+2*(t-e)*n)*a+(i-t)*n*n)}function yp(r,e,t,i,n,a){var o=i+3*(e-t)-r,s=3*(t-e*2+r),l=3*(e-r),u=r-n,c=s*s-3*o*l,h=s*l-9*o*u,f=l*l-3*s*u,p=0;if(yh(c)&&yh(h))if(yh(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[p++]=d)}else{var g=h*h-4*c*f;if(yh(g)){var m=h/c,d=-s/o+m,v=-m/2;d>=0&&d<=1&&(a[p++]=d),v>=0&&v<=1&&(a[p++]=v)}else if(g>0){var _=_h(g),y=c*s+1.5*o*(-h+_),x=c*s+1.5*o*(-h-_);y<0?y=-rw(-y,iw):y=rw(y,iw),x<0?x=-rw(-x,iw):x=rw(x,iw);var d=(-s-(y+x))/(3*o);d>=0&&d<=1&&(a[p++]=d)}else{var M=(2*c*s-3*o*h)/(2*_h(c*c*c)),S=Math.acos(M)/3,w=_h(c),T=Math.cos(S),d=(-s-2*w*T)/(3*o),v=(-s+w*(T+SG*Math.sin(S)))/(3*o),C=(-s+w*(T-SG*Math.sin(S)))/(3*o);d>=0&&d<=1&&(a[p++]=d),v>=0&&v<=1&&(a[p++]=v),C>=0&&C<=1&&(a[p++]=C)}}return p}function aw(r,e,t,i,n){var a=6*t-12*e+6*r,o=9*e+3*i-3*r-9*t,s=3*e-3*r,l=0;if(yh(o)){if(bG(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var c=a*a-4*o*s;if(yh(c))n[0]=-a/(2*o);else if(c>0){var h=_h(c),u=(-a+h)/(2*o),f=(-a-h)/(2*o);u>=0&&u<=1&&(n[l++]=u),f>=0&&f<=1&&(n[l++]=f)}}return l}function Ps(r,e,t,i,n,a){var o=(e-r)*n+r,s=(t-e)*n+e,l=(i-t)*n+t,u=(s-o)*n+o,c=(l-s)*n+s,h=(c-u)*n+u;a[0]=r,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=c,a[6]=l,a[7]=i}function ow(r,e,t,i,n,a,o,s,l,u,c){var h,f=.005,p=1/0,d,g,m,v;cu[0]=l,cu[1]=u;for(var _=0;_<1;_+=.05)Ds[0]=vi(r,t,n,o,_),Ds[1]=vi(e,i,a,s,_),m=ec(cu,Ds),m<p&&(h=_,p=m);p=1/0;for(var y=0;y<32&&!(f<MG);y++)d=h-f,g=h+f,Ds[0]=vi(r,t,n,o,d),Ds[1]=vi(e,i,a,s,d),m=ec(Ds,cu),d>=0&&m<p?(h=d,p=m):(Bm[0]=vi(r,t,n,o,g),Bm[1]=vi(e,i,a,s,g),v=ec(Bm,cu),g<=1&&v<p?(h=g,p=v):f*=.5);return c&&(c[0]=vi(r,t,n,o,h),c[1]=vi(e,i,a,s,h)),_h(p)}function wG(r,e,t,i,n,a,o,s,l){for(var u=r,c=e,h=0,f=1/l,p=1;p<=l;p++){var d=p*f,g=vi(r,t,n,o,d),m=vi(e,i,a,s,d),v=g-u,_=m-c;h+=Math.sqrt(v*v+_*_),u=g,c=m}return h}function xi(r,e,t,i){var n=1-i;return n*(n*r+2*i*e)+i*i*t}function A_(r,e,t,i){return 2*((1-i)*(e-r)+i*(t-e))}function TG(r,e,t,i,n){var a=r-2*e+t,o=2*(e-r),s=r-i,l=0;if(yh(a)){if(bG(o)){var u=-s/o;u>=0&&u<=1&&(n[l++]=u)}}else{var c=o*o-4*a*s;if(yh(c)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(c>0){var h=_h(c),u=(-o+h)/(2*a),f=(-o-h)/(2*a);u>=0&&u<=1&&(n[l++]=u),f>=0&&f<=1&&(n[l++]=f)}}return l}function sw(r,e,t){var i=r+t-2*e;return i===0?.5:(r-e)/i}function xh(r,e,t,i,n){var a=(e-r)*i+r,o=(t-e)*i+e,s=(o-a)*i+a;n[0]=r,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=t}function lw(r,e,t,i,n,a,o,s,l){var u,c=.005,h=1/0;cu[0]=o,cu[1]=s;for(var f=0;f<1;f+=.05){Ds[0]=xi(r,t,n,f),Ds[1]=xi(e,i,a,f);var p=ec(cu,Ds);p<h&&(u=f,h=p)}h=1/0;for(var d=0;d<32&&!(c<MG);d++){var g=u-c,m=u+c;Ds[0]=xi(r,t,n,g),Ds[1]=xi(e,i,a,g);var p=ec(Ds,cu);if(g>=0&&p<h)u=g,h=p;else{Bm[0]=xi(r,t,n,m),Bm[1]=xi(e,i,a,m);var v=ec(Bm,cu);m<=1&&v<h?(u=m,h=v):c*=.5}}return l&&(l[0]=xi(r,t,n,u),l[1]=xi(e,i,a,u)),_h(h)}function EG(r,e,t,i,n,a,o){for(var s=r,l=e,u=0,c=1/o,h=1;h<=o;h++){var f=h*c,p=xi(r,t,n,f),d=xi(e,i,a,f),g=p-s,m=d-l;u+=Math.sqrt(g*g+m*m),s=p,l=d}return u}var kle=/cubic-bezier\(([0-9,\.e ]+)\)/;function km(r){var e=r&&kle.exec(r);if(e){var t=e[1].split(","),i=+Zi(t[0]),n=+Zi(t[1]),a=+Zi(t[2]),o=+Zi(t[3]);if(isNaN(i+n+a+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:yp(0,i,a,1,l,s)&&vi(0,n,o,1,s[0])}}}var Vle=function(){function r(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||zr,this.ondestroy=e.ondestroy||zr,this.onrestart=e.onrestart||zr,e.easing&&this.setEasing(e.easing)}return r.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var i=this._life,n=e-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(e){this.easing=e,this.easingFunc=He(e)?e:tw[e]||km(e)},r}(),AG=Vle;var CG=function(){function r(e){this.value=e}return r}();var Gle=function(){function r(){this._len=0}return r.prototype.insert=function(e){var t=new CG(e);return this.insertEntry(t),t},r.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},r.prototype.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}();var Hle=function(){function r(e){this._list=new Gle,this._maxSize=10,this._map={},this._maxSize=e}return r.prototype.put=function(e,t){var i=this._list,n=this._map,a=null;if(n[e]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new CG(t),s.key=e,i.insertEntry(s),n[e]=s}return a},r.prototype.get=function(e){var t=this._map[e],i=this._list;if(t!=null)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),tc=Hle;var RG={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function _l(r){return r=Math.round(r),r<0?0:r>255?255:r}function Wle(r){return r=Math.round(r),r<0?0:r>360?360:r}function R_(r){return r<0?0:r>1?1:r}function d2(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?_l(parseFloat(e)/100*255):_l(parseInt(e,10))}function _p(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?R_(parseFloat(e)/100):R_(parseFloat(e))}function m2(r,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?r+(e-r)*t*6:t*2<1?e:t*3<2?r+(e-r)*(2/3-t)*6:r}function Sh(r,e,t){return r+(e-r)*t}function Is(r,e,t,i,n){return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r}function v2(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}var DG=new tc(20),uw=null;function Vm(r,e){uw&&v2(uw,e),uw=DG.put(r,uw||e.slice())}function pn(r,e){if(r){e=e||[];var t=DG.get(r);if(t)return v2(e,t);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in RG)return v2(e,RG[i]),Vm(r,e),e;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){Is(e,0,0,0,1);return}return Is(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),Vm(r,e),e}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){Is(e,0,0,0,1);return}return Is(e,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),Vm(r,e),e}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Is(e,+u[0],+u[1],+u[2],1):Is(e,0,0,0,1);c=_p(u.pop());case"rgb":if(u.length>=3)return Is(e,d2(u[0]),d2(u[1]),d2(u[2]),u.length===3?c:_p(u[3])),Vm(r,e),e;Is(e,0,0,0,1);return;case"hsla":if(u.length!==4){Is(e,0,0,0,1);return}return u[3]=_p(u[3]),g2(u,e),Vm(r,e),e;case"hsl":if(u.length!==3){Is(e,0,0,0,1);return}return g2(u,e),Vm(r,e),e;default:return}}Is(e,0,0,0,1)}}function g2(r,e){var t=(parseFloat(r[0])%360+360)%360/360,i=_p(r[1]),n=_p(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],Is(e,_l(m2(o,a,t+1/3)*255),_l(m2(o,a,t)*255),_l(m2(o,a,t-1/3)*255),1),r.length===4&&(e[3]=r[3]),e}function Xle(r){if(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(e,t,i),a=Math.max(e,t,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var c=((a-e)/6+o/2)/o,h=((a-t)/6+o/2)/o,f=((a-i)/6+o/2)/o;e===a?l=f-h:t===a?l=1/3+c-f:i===a&&(l=2/3+h-c),l<0&&(l+=1),l>1&&(l-=1)}var p=[l*360,u,s];return r[3]!=null&&p.push(r[3]),p}}function cw(r,e){var t=pn(r);if(t){for(var i=0;i<3;i++)e<0?t[i]=t[i]*(1-e)|0:t[i]=(255-t[i])*e+t[i]|0,t[i]>255?t[i]=255:t[i]<0&&(t[i]=0);return Ns(t,t.length===4?"rgba":"rgb")}}function hw(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){t=t||[];var i=r*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=e[n],s=e[a],l=i-n;return t[0]=_l(Sh(o[0],s[0],l)),t[1]=_l(Sh(o[1],s[1],l)),t[2]=_l(Sh(o[2],s[2],l)),t[3]=R_(Sh(o[3],s[3],l)),t}}function PG(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){var i=r*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=pn(e[n]),s=pn(e[a]),l=i-n,u=Ns([_l(Sh(o[0],s[0],l)),_l(Sh(o[1],s[1],l)),_l(Sh(o[2],s[2],l)),R_(Sh(o[3],s[3],l))],"rgba");return t?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function xp(r,e,t,i){var n=pn(r);if(r)return n=Xle(n),e!=null&&(n[0]=Wle(e)),t!=null&&(n[1]=_p(t)),i!=null&&(n[2]=_p(i)),Ns(g2(n),"rgba")}function Sp(r,e){var t=pn(r);if(t&&e!=null)return t[3]=R_(e),Ns(t,"rgba")}function Ns(r,e){if(!(!r||!r.length)){var t=r[0]+","+r[1]+","+r[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+r[3]),e+"("+t+")"}}function Gm(r,e){var t=pn(r);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var LG=new tc(100);function L_(r){if(Ce(r)){var e=LG.get(r);return e||(e=cw(r,-.1),LG.put(r,e)),e}else if(ph(r)){var t=he({},r);return t.colorStops=de(r.colorStops,function(i){return{offset:i.offset,color:cw(i.color,-.1)}}),t}return r}var pw=Math.round;function Mh(r){var e;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var t=pn(r);t&&(r="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:r,opacity:e??1}}var IG=1e-4;function hu(r){return r<IG&&r>-IG}function fw(r){return pw(r*1e3)/1e3}function dw(r){return pw(r*1e4)/1e4}function NG(r){return"matrix("+fw(r[0])+","+fw(r[1])+","+fw(r[2])+","+fw(r[3])+","+dw(r[4])+","+dw(r[5])+")"}var UG={left:"start",right:"end",center:"middle",middle:"middle"};function OG(r,e,t){return t==="top"?r+=e/2:t==="bottom"&&(r-=e/2),r}function zG(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function FG(r){var e=r.style,t=r.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function _2(r){return r&&!!r.image}function Yle(r){return r&&!!r.svgElement}function D_(r){return _2(r)||Yle(r)}function mw(r){return r.type==="linear"}function vw(r){return r.type==="radial"}function gw(r){return r&&(r.type==="linear"||r.type==="radial")}function P_(r){return"url(#"+r+")"}function yw(r){var e=r.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function _w(r){var e=r.x||0,t=r.y||0,i=(r.rotation||0)*Im,n=mt(r.scaleX,1),a=mt(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+pw(o*Im)+"deg, "+pw(s*Im)+"deg)"),l.join(" ")}var BG=function(){return Bt.hasGlobalWindow&&He(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}();var S2=Array.prototype.slice;function rc(r,e,t){return(e-r)*t+r}function x2(r,e,t,i){for(var n=e.length,a=0;a<n;a++)r[a]=rc(e[a],t[a],i);return r}function qle(r,e,t,i){for(var n=e.length,a=n&&e[0].length,o=0;o<n;o++){r[o]||(r[o]=[]);for(var s=0;s<a;s++)r[o][s]=rc(e[o][s],t[o][s],i)}return r}function xw(r,e,t,i){for(var n=e.length,a=0;a<n;a++)r[a]=e[a]+t[a]*i;return r}function kG(r,e,t,i){for(var n=e.length,a=n&&e[0].length,o=0;o<n;o++){r[o]||(r[o]=[]);for(var s=0;s<a;s++)r[o][s]=e[o][s]+t[o][s]*i}return r}function Zle(r,e){for(var t=r.length,i=e.length,n=t>i?e:r,a=Math.min(t,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;s<Math.max(t,i);s++)n.push({offset:o.offset,color:o.color.slice()})}function jle(r,e,t){var i=r,n=e;if(!(!i.push||!n.push)){var a=i.length,o=n.length;if(a!==o){var s=a>o;if(s)i.length=o;else for(var l=a;l<o;l++)i.push(t===1?n[l]:S2.call(n[l]))}for(var u=i[0]&&i[0].length,l=0;l<i.length;l++)if(t===1)isNaN(i[l])&&(i[l]=n[l]);else for(var c=0;c<u;c++)isNaN(i[l][c])&&(i[l][c]=n[l][c])}}function Mp(r){if(di(r)){var e=r.length;if(di(r[0])){for(var t=[],i=0;i<e;i++)t.push(S2.call(r[i]));return t}return S2.call(r)}return r}function bw(r){return r[0]=Math.floor(r[0])||0,r[1]=Math.floor(r[1])||0,r[2]=Math.floor(r[2])||0,r[3]=r[3]==null?1:r[3],"rgba("+r.join(",")+")"}function Kle(r){return di(r&&r[0])?2:1}var Sw=0,ww=1,HG=2,N_=3,M2=4,b2=5,VG=6;function GG(r){return r===M2||r===b2}function Mw(r){return r===ww||r===HG}var I_=[0,0,0,0],Jle=function(){function r(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return r.prototype.isFinished=function(){return this._finished},r.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},r.prototype.needsAnimate=function(){return this.keyframes.length>=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(e,t,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=VG,l=t;if(di(t)){var u=Kle(t);s=u,(u===1&&!Dt(t[0])||u===2&&!Dt(t[0][0]))&&(o=!0)}else if(Dt(t)&&!dh(t))s=Sw;else if(Ce(t))if(!isNaN(+t))s=Sw;else{var c=pn(t);c&&(l=c,s=N_)}else if(ph(t)){var h=he({},l);h.colorStops=de(t.colorStops,function(p){return{offset:p.offset,color:pn(p.color)}}),mw(t)?s=M2:vw(t)&&(s=b2),l=h}a===0?this.valType=s:(s!==this.valType||s===VG)&&(o=!0),this.discrete=this.discrete||o;var f={time:e,value:l,rawValue:t,percent:0};return i&&(f.easing=i,f.easingFunc=He(i)?i:tw[i]||km(i)),n.push(f),f},r.prototype.prepare=function(e,t){var i=this.keyframes;this._needsSort&&i.sort(function(g,m){return g.time-m.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=Mw(n),u=GG(n),c=0;c<a;c++){var h=i[c],f=h.value,p=o.value;h.percent=h.time/e,s||(l&&c!==a-1?jle(f,p,n):u&&Zle(f.colorStops,p.colorStops))}if(!s&&n!==b2&&t&&this.needsAnimate()&&t.needsAnimate()&&n===t.valType&&!t._finished){this._additiveTrack=t;for(var d=i[0].value,c=0;c<a;c++)n===Sw?i[c].additiveValue=i[c].value-d:n===N_?i[c].additiveValue=xw([],i[c].value,d,-1):Mw(n)&&(i[c].additiveValue=n===ww?xw([],i[c].value,d,-1):kG([],i[c].value,d,-1))}},r.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var i=this._additiveTrack!=null,n=i?"additiveValue":"value",a=this.valType,o=this.keyframes,s=o.length,l=this.propName,u=a===N_,c,h=this._lastFr,f=Math.min,p,d;if(s===1)p=d=o[0];else{if(t<0)c=0;else if(t<this._lastFrP){var g=f(h+1,s-1);for(c=g;c>=0&&!(o[c].percent<=t);c--);c=f(c,s-2)}else{for(c=h;c<s&&!(o[c].percent>t);c++);c=f(c-1,s-2)}d=o[c+1],p=o[c]}if(p&&d){this._lastFr=c,this._lastFrP=t;var m=d.percent-p.percent,v=m===0?1:f((t-p.percent)/m,1);d.easingFunc&&(v=d.easingFunc(v));var _=i?this._additiveValue:u?I_:e[l];if((Mw(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)e[l]=v<1?p.rawValue:d.rawValue;else if(Mw(a))a===ww?x2(_,p[n],d[n],v):qle(_,p[n],d[n],v);else if(GG(a)){var y=p[n],x=d[n],M=a===M2;e[l]={type:M?"linear":"radial",x:rc(y.x,x.x,v),y:rc(y.y,x.y,v),colorStops:de(y.colorStops,function(w,T){var C=x.colorStops[T];return{offset:rc(w.offset,C.offset,v),color:bw(x2([],w.color,C.color,v))}}),global:x.global},M?(e[l].x2=rc(y.x2,x.x2,v),e[l].y2=rc(y.y2,x.y2,v)):e[l].r=rc(y.r,x.r,v)}else if(u)x2(_,p[n],d[n],v),i||(e[l]=bw(_));else{var S=rc(p[n],d[n],v);i?this._additiveValue=S:e[l]=S}i&&this._addToTarget(e)}}},r.prototype._addToTarget=function(e){var t=this.valType,i=this.propName,n=this._additiveValue;t===Sw?e[i]=e[i]+n:t===N_?(pn(e[i],I_),xw(I_,I_,n,1),e[i]=bw(I_)):t===ww?xw(e[i],e[i],n,1):t===HG&&kG(e[i],e[i],n,1)},r}(),$le=function(){function r(e,t,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&n){up("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(e){this._target=e},r.prototype.when=function(e,t,i){return this.whenWithKeys(e,t,At(t),i)},r.prototype.whenWithKeys=function(e,t,i,n){for(var a=this._tracks,o=0;o<i.length;o++){var s=i[o],l=a[s];if(!l){l=a[s]=new Jle(s);var u=void 0,c=this._getAdditiveTrack(s);if(c){var h=c.keyframes,f=h[h.length-1];u=f&&f.value,c.valType===N_&&u&&(u=bw(u))}else u=this._target[s];if(u==null)continue;e>0&&l.addKeyframe(0,Mp(u),n),this._trackKeys.push(s)}l.addKeyframe(e,Mp(t[s]),n)}return this._maxTime=Math.max(this._maxTime,e),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,i=0;i<t;i++)e[i].call(this)},r.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var i=0;i<t.length;i++)t[i].call(this)},r.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,i=0;i<t.length;i++)e[t[i]].setFinished()},r.prototype._getAdditiveTrack=function(e){var t,i=this._additiveAnimators;if(i)for(var n=0;n<i.length;n++){var a=i[n].getTrack(e);a&&(t=a)}return t},r.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,i=[],n=this._maxTime||0,a=0;a<this._trackKeys.length;a++){var o=this._trackKeys[a],s=this._tracks[o],l=this._getAdditiveTrack(o),u=s.keyframes,c=u.length;if(s.prepare(n,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var h=u[c-1];h&&(t._target[s.propName]=h.rawValue),s.setFinished()}else i.push(s)}if(i.length||this._force){var f=new AG({life:n,loop:this._loop,delay:this._delay||0,onframe:function(p){t._started=2;var d=t._additiveAnimators;if(d){for(var g=!1,m=0;m<d.length;m++)if(d[m]._clip){g=!0;break}g||(t._additiveAnimators=null)}for(var m=0;m<i.length;m++)i[m].step(t._target,p);var v=t._onframeCbs;if(v)for(var m=0;m<v.length;m++)v[m](t._target,p)},ondestroy:function(){t._doneCallback()}});this._clip=f,this.animation&&this.animation.addClip(f),e&&f.setEasing(e)}else this._doneCallback();return this}},r.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},r.prototype.delay=function(e){return this._delay=e,this},r.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},r.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},r.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},r.prototype.getClip=function(){return this._clip},r.prototype.getTrack=function(e){return this._tracks[e]},r.prototype.getTracks=function(){var e=this;return de(this._trackKeys,function(t){return e._tracks[t]})},r.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var i=this._tracks,n=this._trackKeys,a=0;a<e.length;a++){var o=i[e[a]];o&&!o.isFinished()&&(t?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,a=0;a<n.length;a++)if(!i[n[a]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},r.prototype.saveTo=function(e,t,i){if(e){t=t||this._trackKeys;for(var n=0;n<t.length;n++){var a=t[n],o=this._tracks[a];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[i?0:s.length-1];l&&(e[a]=Mp(l.rawValue))}}}},r.prototype.__changeFinalValue=function(e,t){t=t||At(e);for(var i=0;i<t.length;i++){var n=t[i],a=this._tracks[n];if(a){var o=a.keyframes;if(o.length>1){var s=o.pop();a.addKeyframe(s.time,e[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}(),U_=$le;function bp(){return new Date().getTime()}var Qle=function(r){qt(e,r);function e(t){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,t=t||{},i.stage=t.stage||{},i}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var i=t.getClip();i&&this.addClip(i)},e.prototype.removeClip=function(t){if(t.animation){var i=t.prev,n=t.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var i=t.getClip();i&&this.removeClip(i),t.animation=null},e.prototype.update=function(t){for(var i=bp()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function i(){t._running&&(E_(i),!t._paused&&t.update())}E_(i)},e.prototype.start=function(){this._running||(this._time=bp(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=bp(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=bp()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var i=t.next;t.prev=t.next=t.animation=null,t=i}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,i){i=i||{},this.start();var n=new U_(t,i.loop);return this.addAnimator(n),n},e}(Ni),WG=Qle;var eue=300,w2=Bt.domSupported,T2=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=de(r,function(n){var a=n.replace("mouse","pointer");return t.hasOwnProperty(a)?a:n});return{mouse:r,touch:e,pointer:i}}(),XG={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},YG=!1;function C2(r){var e=r.pointerType;return e==="pen"||e==="touch"}function tue(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function E2(r){r&&(r.zrByTouch=!0)}function rue(r,e){return fo(r.dom,new iue(r,e),!0)}function ZG(r,e){for(var t=e,i=!1;t&&t.nodeType!==9&&!(i=t.domBelongToZr||t!==e&&t===r.painterRoot);)t=t.parentNode;return i}var iue=function(){function r(e,t){this.stopPropagation=zr,this.stopImmediatePropagation=zr,this.preventDefault=zr,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return r}(),xl={mousedown:function(r){r=fo(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=fo(this.dom,r);var e=this.__mayPointerCapture;e&&(r.zrX!==e[0]||r.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=fo(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=fo(this.dom,r);var e=r.toElement||r.relatedTarget;ZG(this,e)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){YG=!0,r=fo(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){YG||(r=fo(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=fo(this.dom,r),E2(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),xl.mousemove.call(this,r),xl.mousedown.call(this,r)},touchmove:function(r){r=fo(this.dom,r),E2(r),this.handler.processGesture(r,"change"),xl.mousemove.call(this,r)},touchend:function(r){r=fo(this.dom,r),E2(r),this.handler.processGesture(r,"end"),xl.mouseup.call(this,r),+new Date-+this.__lastTouchMoment<eue&&xl.click.call(this,r)},pointerdown:function(r){xl.mousedown.call(this,r)},pointermove:function(r){C2(r)||xl.mousemove.call(this,r)},pointerup:function(r){xl.mouseup.call(this,r)},pointerout:function(r){C2(r)||xl.mouseout.call(this,r)}};N(["click","dblclick","contextmenu"],function(r){xl[r]=function(e){e=fo(this.dom,e),this.trigger(r,e)}});var R2={pointermove:function(r){C2(r)||R2.mousemove.call(this,r)},pointerup:function(r){R2.mouseup.call(this,r)},mousemove:function(r){this.trigger("mousemove",r)},mouseup:function(r){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",r),e&&(r.zrEventControl="only_globalout",this.trigger("mouseout",r))}};function nue(r,e){var t=e.domHandlers;Bt.pointerEventsSupported?N(T2.pointer,function(i){Tw(e,i,function(n){t[i].call(r,n)})}):(Bt.touchEventsSupported&&N(T2.touch,function(i){Tw(e,i,function(n){t[i].call(r,n),tue(e)})}),N(T2.mouse,function(i){Tw(e,i,function(n){n=Jb(n),e.touching||t[i].call(r,n)})}))}function aue(r,e){Bt.pointerEventsSupported?N(XG.pointer,t):Bt.touchEventsSupported||N(XG.mouse,t);function t(i){function n(a){a=Jb(a),ZG(r,a.target)||(a=rue(r,a),e.domHandlers[i].call(r,a))}Tw(e,i,n,{capture:!0})}}function Tw(r,e,t,i){r.mounted[e]=t,r.listenerOpts[e]=i,x_(r.domTarget,e,t,i)}function A2(r){var e=r.mounted;for(var t in e)e.hasOwnProperty(t)&&aG(r.domTarget,t,e[t],r.listenerOpts[t]);r.mounted={}}var qG=function(){function r(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t}return r}(),oue=function(r){qt(e,r);function e(t,i){var n=r.call(this)||this;return n.__pointerCapturing=!1,n.dom=t,n.painterRoot=i,n._localHandlerScope=new qG(t,xl),w2&&(n._globalHandlerScope=new qG(document,R2)),nue(n,n._localHandlerScope),n}return e.prototype.dispose=function(){A2(this._localHandlerScope),w2&&A2(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,w2&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var i=this._globalHandlerScope;t?aue(this,i):A2(i)}},e}(Ni),jG=oue;var KG=1;Bt.hasGlobalWindow&&(KG=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var wp=KG,O_=.4,z_="#333",F_="#ccc",JG="#eee";var $G=vh,QG=5e-5;function Tp(r){return r>QG||r<-QG}var Ep=[],Hm=[],L2=Ci(),D2=Math.abs,sue=function(){function r(){}return r.prototype.getLocalTransform=function(e){return r.getLocalTransform(this,e)},r.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},r.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},r.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},r.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},r.prototype.needLocalTransform=function(){return Tp(this.rotation)||Tp(this.x)||Tp(this.y)||Tp(this.scaleX-1)||Tp(this.scaleY-1)||Tp(this.skewX)||Tp(this.skewY)},r.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),i=this.transform;if(!(t||e)){i&&($G(i),this.invTransform=null);return}i=i||Ci(),t?this.getLocalTransform(i):$G(i),e&&(t?mo(i,e,i):S_(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Ep);var i=Ep[0]<0?-1:1,n=Ep[1]<0?-1:1,a=((Ep[0]-i)*t+i)/Ep[0]||0,o=((Ep[1]-n)*t+n)/Ep[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||Ci(),Ls(this.invTransform,e)},r.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},r.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=Math.atan2(e[1],e[0]),a=Math.PI/2+n-Math.atan2(e[3],e[2]);i=Math.sqrt(i)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Ci(),mo(Hm,e.invTransform,t),t=Hm);var i=this.originX,n=this.originY;(i||n)&&(L2[4]=i,L2[5]=n,mo(Hm,t,L2),Hm[4]-=i,Hm[5]-=n,t=Hm),this.setLocalTransform(t)}},r.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},r.prototype.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&mi(i,i,n),i},r.prototype.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&mi(i,i,n),i},r.prototype.getLineScale=function(){var e=this.transform;return e&&D2(e[0]-1)>1e-10&&D2(e[3]-1)>1e-10?Math.sqrt(D2(e[0]*e[3]-e[2]*e[1])):1},r.prototype.copyTransform=function(e){P2(this,e)},r.getLocalTransform=function(e,t){t=t||[];var i=e.originX||0,n=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,c=e.x,h=e.y,f=e.skewX?Math.tan(e.skewX):0,p=e.skewY?Math.tan(-e.skewY):0;if(i||n||s||l){var d=i+s,g=n+l;t[4]=-d*a-f*g*o,t[5]=-g*o-p*d*a}else t[4]=t[5]=0;return t[0]=a,t[3]=o,t[1]=p*a,t[2]=f*o,u&&vo(t,t,u),t[4]+=i+c,t[5]+=n+h,t},r.initDefaultProps=function(){var e=r.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),r}(),ts=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function P2(r,e){for(var t=0;t<ts.length;t++){var i=ts[t];r[i]=e[i]}}var go=sue;var eH={};function yo(r,e){e=e||Jo;var t=eH[e];t||(t=eH[e]=new tc(500));var i=t.get(r);return i==null&&(i=qn.measureText(r,e).width,t.put(r,i)),i}function tH(r,e,t,i){var n=yo(r,e),a=Xm(e),o=Wm(0,n,t),s=Ap(0,a,i),l=new ht(o,s,n,a);return l}function fu(r,e,t,i){var n=((r||"")+"").split(`
  2203. `),a=n.length;if(a===1)return tH(n[0],e,t,i);for(var o=new ht(0,0,0,0),s=0;s<n.length;s++){var l=tH(n[s],e,t,i);s===0?o.copy(l):o.union(l)}return o}function Wm(r,e,t){return t==="right"?r-=e:t==="center"&&(r-=e/2),r}function Ap(r,e,t){return t==="middle"?r-=e/2:t==="bottom"&&(r-=e),r}function Xm(r){return yo("\u56FD",r)}function En(r,e){return typeof r=="string"?r.lastIndexOf("%")>=0?parseFloat(r)/100*e:parseFloat(r):r}function Cp(r,e,t){var i=e.position||"inside",n=e.distance!=null?e.distance:5,a=t.height,o=t.width,s=a/2,l=t.x,u=t.y,c="left",h="top";if(i instanceof Array)l+=En(i[0],t.width),u+=En(i[1],t.height),c=null,h=null;else switch(i){case"left":l-=n,u+=s,c="right",h="middle";break;case"right":l+=n+o,u+=s,h="middle";break;case"top":l+=o/2,u-=n,c="center",h="bottom";break;case"bottom":l+=o/2,u+=a+n,c="center";break;case"inside":l+=o/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=n,u+=s,h="middle";break;case"insideRight":l+=o-n,u+=s,c="right",h="middle";break;case"insideTop":l+=o/2,u+=n,c="center";break;case"insideBottom":l+=o/2,u+=a-n,c="center",h="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,c="right";break;case"insideBottomLeft":l+=n,u+=a-n,h="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,c="right",h="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=c,r.verticalAlign=h,r}var I2="__zr_normal__",N2=ts.concat(["ignore"]),lue=bn(ts,function(r,e){return r[e]=!0,r},{ignore:!1}),Ym={},uue=new ht(0,0,0,0),z2=function(){function r(e){this.id=Wb(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return r.prototype._init=function(e){this.attr(e)},r.prototype.drift=function(e,t,i){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=t,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=t.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(t),i.position!=null){var c=uue;i.layoutRect?c.copy(i.layoutRect):c.copy(this.getBoundingRect()),n||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ym,i,c):Cp(Ym,i,c),a.x=Ym.x,a.y=Ym.y,o=Ym.align,s=Ym.verticalAlign;var h=i.origin;if(h&&i.rotation!=null){var f=void 0,p=void 0;h==="center"?(f=c.width*.5,p=c.height*.5):(f=En(h[0],c.width),p=En(h[1],c.height)),u=!0,a.originX=-a.x+f+(n?0:c.x),a.originY=-a.y+p+(n?0:c.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],u||(a.originX=-d[0],a.originY=-d[1]));var g=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,_=void 0,y=void 0;g&&this.canBeInsideText()?(v=i.insideFill,_=i.insideStroke,(v==null||v==="auto")&&(v=this.getInsideTextFill()),(_==null||_==="auto")&&(_=this.getInsideTextStroke(v),y=!0)):(v=i.outsideFill,_=i.outsideStroke,(v==null||v==="auto")&&(v=this.getOutsideFill()),(_==null||_==="auto")&&(_=this.getOutsideStroke(v),y=!0)),v=v||"#000",(v!==m.fill||_!==m.stroke||y!==m.autoStroke||o!==m.align||s!==m.verticalAlign)&&(l=!0,m.fill=v,m.stroke=_,m.autoStroke=y,m.align=o,m.verticalAlign=s,t.setDefaultTextStyle(m)),t.__dirty|=ki,l&&t.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(e){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?F_:z_},r.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),i=typeof t=="string"&&pn(t);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,Ns(i,"rgba")},r.prototype.traverse=function(e,t){},r.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},he(this.extra,t)):this[e]=t},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(qe(e))for(var i=e,n=At(i),a=0;a<n.length;a++){var o=n[a];this.attrKV(o,e[o])}return this.markRedraw(),this},r.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,i=0;i<this.animators.length;i++){var n=this.animators[i],a=n.__fromStateTransition;if(!(n.getLoop()||a&&a!==I2)){var o=n.targetName,s=o?t[o]:t;n.saveTo(s)}}},r.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,N2)},r.prototype._savePrimaryToNormal=function(e,t,i){for(var n=0;n<i.length;n++){var a=i[n];e[a]!=null&&!(a in t)&&(t[a]=this[a])}},r.prototype.hasState=function(){return this.currentStates.length>0},r.prototype.getState=function(e){return this.states[e]},r.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},r.prototype.clearStates=function(e){this.useState(I2,!1,e)},r.prototype.useState=function(e,t,i,n){var a=e===I2,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(yt(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){up("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||n);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!i&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,f=this._textGuide;return h&&h.useState(e,t,i,c),f&&f.useState(e,t,i,c),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ki),u}}},r.prototype.useStates=function(e,t,i){if(!e.length)this.clearStates();else{var n=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l<o;l++)if(e[l]!==a[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var u=e[l],c=void 0;this.stateProxy&&(c=this.stateProxy(u,e)),c||(c=this.states[u]),c&&n.push(c)}var h=n[o-1],f=!!(h&&h.hoverLayer||i);f&&this._toggleHoverLayerFlag(!0);var p=this._mergeStates(n),d=this.stateTransition;this.saveCurrentToNormalState(p),this._applyStateObj(e.join(","),p,this._normalState,!1,!t&&!this.__inHover&&d&&d.duration>0,d);var g=this._textContent,m=this._textGuide;g&&g.useStates(e,t,f),m&&m.useStates(e,t,f),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ki)}},r.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},r.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},r.prototype.removeState=function(e){var t=yt(this.currentStates,e);if(t>=0){var i=this.currentStates.slice();i.splice(t,1),this.useStates(i)}},r.prototype.replaceState=function(e,t,i){var n=this.currentStates.slice(),a=yt(n,e),o=yt(n,t)>=0;a>=0?o?n.splice(a,1):n[a]=t:i&&!o&&n.push(t),this.useStates(n)},r.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},r.prototype._mergeStates=function(e){for(var t={},i,n=0;n<e.length;n++){var a=e[n];he(t,a),a.textConfig&&(i=i||{},he(i,a.textConfig))}return i&&(t.textConfig=i),t},r.prototype._applyStateObj=function(e,t,i,n,a,o){var s=!(t&&n);t&&t.textConfig?(this.textConfig=he({},n?this.textConfig:i.textConfig),he(this.textConfig,t.textConfig)):s&&i.textConfig&&(this.textConfig=i.textConfig);for(var l={},u=!1,c=0;c<N2.length;c++){var h=N2[c],f=a&&lue[h];t&&t[h]!=null?f?(u=!0,l[h]=t[h]):this[h]=t[h]:s&&i[h]!=null&&(f?(u=!0,l[h]=i[h]):this[h]=i[h])}if(!a)for(var c=0;c<this.animators.length;c++){var p=this.animators[c],d=p.targetName;p.getLoop()||p.__changeFinalValue(d?(t||i)[d]:t||i)}u&&this._transitionState(e,l,o)},r.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},r.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},r.prototype.getClipPath=function(){return this._clipPath},r.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},r.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},r.prototype.getTextContent=function(){return this._textContent},r.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new go,this._attachComponent(e),this._textContent=e,this.markRedraw())},r.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),he(this.textConfig,e),this.markRedraw()},r.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},r.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},r.prototype.getTextGuideLine=function(){return this._textGuide},r.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},r.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},r.prototype.markRedraw=function(){this.__dirty|=ki;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},r.prototype.dirty=function(){this.markRedraw()},r.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,i=this._textGuide;t&&(t.__inHover=e),i&&(i.__inHover=e)},r.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.addAnimator(t[i]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},r.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.removeAnimator(t[i]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},r.prototype.animate=function(e,t,i){var n=e?this[e]:this,a=new U_(n,t,i);return e&&(a.targetName=e),this.addAnimator(a,e),a},r.prototype.addAnimator=function(e,t){var i=this.__zr,n=this;e.during(function(){n.updateDuringAnimation(t)}).done(function(){var a=n.animators,o=yt(a,e);o>=0&&a.splice(o,1)}),this.animators.push(e),i&&i.animation.addAnimator(e),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(e){this.markRedraw()},r.prototype.stopAnimation=function(e,t){for(var i=this.animators,n=i.length,a=[],o=0;o<n;o++){var s=i[o];!e||e===s.scope?s.stop(t):a.push(s)}return this.animators=a,this},r.prototype.animateTo=function(e,t,i){U2(this,e,t,i)},r.prototype.animateFrom=function(e,t,i){U2(this,e,t,i,!0)},r.prototype._transitionState=function(e,t,i,n){for(var a=U2(this,t,i,n),o=0;o<a.length;o++)a[o].__fromStateTransition=e},r.prototype.getBoundingRect=function(){return null},r.prototype.getPaintRect=function(){return null},r.initDefaultProps=function(){var e=r.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=ki;var t={};function i(a,o,s){t[a+o+s]||(console.warn("DEPRECATED: '"+a+"' has been deprecated. use '"+o+"', '"+s+"' instead"),t[a+o+s]=!0)}function n(a,o,s,l){Object.defineProperty(e,a,{get:function(){if(!this[o]){var c=this[o]=[];u(this,c)}return this[o]},set:function(c){this[s]=c[0],this[l]=c[1],this[o]=c,u(this,c)}});function u(c,h){Object.defineProperty(h,0,{get:function(){return c[s]},set:function(f){c[s]=f}}),Object.defineProperty(h,1,{get:function(){return c[l]},set:function(f){c[l]=f}})}}Object.defineProperty&&(n("position","_legacyPos","x","y"),n("scale","_legacyScale","scaleX","scaleY"),n("origin","_legacyOrigin","originX","originY"))}(),r}();Cr(z2,Ni);Cr(z2,go);function U2(r,e,t,i,n){t=t||{};var a=[];rH(r,"",r,e,t,i,a,n);var o=a.length,s=!1,l=t.done,u=t.aborted,c=function(){s=!0,o--,o<=0&&(s?l&&l():u&&u())},h=function(){o--,o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&t.during&&a[0].during(function(d,g){t.during(g)});for(var f=0;f<a.length;f++){var p=a[f];c&&p.done(c),h&&p.aborted(h),t.force&&p.duration(t.duration),p.start(t.easing)}return a}function O2(r,e,t){for(var i=0;i<t;i++)r[i]=e[i]}function cue(r){return di(r[0])}function hue(r,e,t){if(di(e[t]))if(di(r[t])||(r[t]=[]),Ai(e[t])){var i=e[t].length;r[t].length!==i&&(r[t]=new e[t].constructor(i),O2(r[t],e[t],i))}else{var n=e[t],a=r[t],o=n.length;if(cue(n))for(var s=n[0].length,l=0;l<o;l++)a[l]?O2(a[l],n[l],s):a[l]=Array.prototype.slice.call(n[l]);else O2(a,n,o);a.length=n.length}else r[t]=e[t]}function fue(r,e){return r===e||di(r)&&di(e)&&pue(r,e)}function pue(r,e){var t=r.length;if(t!==e.length)return!1;for(var i=0;i<t;i++)if(r[i]!==e[i])return!1;return!0}function rH(r,e,t,i,n,a,o,s){for(var l=At(i),u=n.duration,c=n.delay,h=n.additive,f=n.setToFinal,p=!qe(a),d=r.animators,g=[],m=0;m<l.length;m++){var v=l[m],_=i[v];if(_!=null&&t[v]!=null&&(p||a[v]))if(qe(_)&&!di(_)&&!ph(_)){if(e){s||(t[v]=_,r.updateDuringAnimation(e));continue}rH(r,v,t[v],_,n,a&&a[v],o,s)}else g.push(v);else s||(t[v]=_,r.updateDuringAnimation(e),g.push(v))}var y=g.length;if(!h&&y)for(var x=0;x<d.length;x++){var M=d[x];if(M.targetName===e){var S=M.stopTracks(g);if(S){var w=yt(d,M);d.splice(w,1)}}}if(n.force||(g=Yt(g,function(E){return!fue(i[E],t[E])}),y=g.length),y>0||n.force&&!o.length){var T=void 0,C=void 0,b=void 0;if(s){C={},f&&(T={});for(var x=0;x<y;x++){var v=g[x];C[v]=t[v],f?T[v]=i[v]:t[v]=i[v]}}else if(f){b={};for(var x=0;x<y;x++){var v=g[x];b[v]=Mp(t[v]),hue(t,i,v)}}var M=new U_(t,!1,!1,h?Yt(d,function(I){return I.targetName===e}):null);M.targetName=e,n.scope&&(M.scope=n.scope),f&&T&&M.whenWithKeys(0,T,g),b&&M.whenWithKeys(0,b,g),M.whenWithKeys(u??500,s?C:i,g).delay(c||0),r.addAnimator(M,e),o.push(M)}}var Aw=z2;var iH=function(r){qt(e,r);function e(t){var i=r.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(t),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var i=this._children,n=0;n<i.length;n++)if(i[n].name===t)return i[n]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},e.prototype.addBefore=function(t,i){if(t&&t!==this&&t.parent!==this&&i&&i.parent===this){var n=this._children,a=n.indexOf(i);a>=0&&(n.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,i){var n=yt(this._children,t);return n>=0&&this.replaceAt(i,n),this},e.prototype.replaceAt=function(t,i){var n=this._children,a=n[i];if(t&&t!==this&&t.parent!==this&&t!==a){n[i]=t,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var i=this.__zr;i&&i!==t.__zr&&t.addSelfToZr(i),i&&i.refresh()},e.prototype.remove=function(t){var i=this.__zr,n=this._children,a=yt(n,t);return a<0?this:(n.splice(a,1),t.parent=null,i&&t.removeSelfFromZr(i),i&&i.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,i=this.__zr,n=0;n<t.length;n++){var a=t[n];i&&a.removeSelfFromZr(i),a.parent=null}return t.length=0,this},e.prototype.eachChild=function(t,i){for(var n=this._children,a=0;a<n.length;a++){var o=n[a];t.call(i,o,a)}return this},e.prototype.traverse=function(t,i){for(var n=0;n<this._children.length;n++){var a=this._children[n],o=t.call(i,a);a.isGroup&&!o&&a.traverse(t,i)}return this},e.prototype.addSelfToZr=function(t){r.prototype.addSelfToZr.call(this,t);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.addSelfToZr(t)}},e.prototype.removeSelfFromZr=function(t){r.prototype.removeSelfFromZr.call(this,t);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.removeSelfFromZr(t)}},e.prototype.getBoundingRect=function(t){for(var i=new ht(0,0,0,0),n=t||this._children,a=[],o=null,s=0;s<n.length;s++){var l=n[s];if(!(l.ignore||l.invisible)){var u=l.getBoundingRect(),c=l.getLocalTransform(a);c?(ht.applyTransform(i,u,c),o=o||i.clone(),o.union(i)):(o=o||u.clone(),o.union(u))}}return o||i},e}(Aw);iH.prototype.type="group";var Ze=iH;var Cw={},nH={};function due(r){delete nH[r]}function mue(r){if(!r)return!1;if(typeof r=="string")return Gm(r,1)<O_;if(r.colorStops){for(var e=r.colorStops,t=0,i=e.length,n=0;n<i;n++)t+=Gm(e[n].color,1);return t/=i,t<O_}return!1}var vue=function(){function r(e,t,i){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=t,this.id=e;var a=new _G,o=i.renderer||"canvas";Cw[o]||(o=At(Cw)[0]),i.useDirtyRect=i.useDirtyRect==null?!1:i.useDirtyRect;var s=new Cw[o](t,a,i,e),l=i.ssr||s.ssrOnly;this.storage=a,this.painter=s;var u=!Bt.node&&!Bt.worker&&!l?new jG(s.getViewportRoot(),s.root):null,c=i.useCoarsePointer,h=c==null||c==="auto"?Bt.touchEventsSupported:!!c,f=44,p;h&&(p=mt(i.pointerSize,f)),this.handler=new pG(a,s,u,s.root,p),this.animation=new WG({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return r.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},r.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},r.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},r.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=mue(e))},r.prototype.getBackgroundColor=function(){return this._backgroundColor},r.prototype.setDarkMode=function(e){this._darkMode=e},r.prototype.isDarkMode=function(){return this._darkMode},r.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},r.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},r.prototype.flush=function(){this._disposed||this._flush(!1)},r.prototype._flush=function(e){var t,i=bp();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var n=bp();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-i})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},r.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},r.prototype.on=function(e,t,i){return this._disposed||this.handler.on(e,t,i),this},r.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},r.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},r.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Ze&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},r.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,due(this.id))},r}();function B2(r,e){var t=new vue(Wb(),r,e);return nH[t.id]=t,t}function aH(r,e){Cw[r]=e}var F2;function oH(r){if(typeof F2=="function")return F2(r)}function sH(r){F2=r}var lH=1e-4,uH=20;function yue(r){return r.replace(/^\s+|\s+$/g,"")}function ar(r,e,t,i){var n=e[0],a=e[1],o=t[0],s=t[1],l=a-n,u=s-o;if(l===0)return u===0?o:(o+s)/2;if(i)if(l>0){if(r<=n)return o;if(r>=a)return s}else{if(r>=n)return o;if(r<=a)return s}else{if(r===n)return o;if(r===a)return s}return(r-n)/l*u+o}function ze(r,e){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return Ce(r)?yue(r).match(/%$/)?parseFloat(r)/100*e:parseFloat(r):r==null?NaN:+r}function Pr(r,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),uH),r=(+r).toFixed(e),t?r:+r}function Ri(r){return r.sort(function(e,t){return e-t}),r}function An(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(r*e)/e===r)return t}return k2(r)}function k2(r){var e=r.toString().toLowerCase(),t=e.indexOf("e"),i=t>0?+e.slice(t+1):0,n=t>0?t:e.length,a=e.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function qm(r,e){var t=Math.log,i=Math.LN10,n=Math.floor(t(r[1]-r[0])/i),a=Math.round(t(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function cH(r,e,t){if(!r[e])return 0;var i=V2(r,t);return i[e]||0}function V2(r,e){var t=bn(r,function(p,d){return p+(isNaN(d)?0:d)},0);if(t===0)return[];for(var i=Math.pow(10,e),n=de(r,function(p){return(isNaN(p)?0:p)/t*i*100}),a=i*100,o=de(n,function(p){return Math.floor(p)}),s=bn(o,function(p,d){return p+d},0),l=de(n,function(p,d){return p-o[d]});s<a;){for(var u=Number.NEGATIVE_INFINITY,c=null,h=0,f=l.length;h<f;++h)l[h]>u&&(u=l[h],c=h);++o[c],l[c]=0,++s}return de(o,function(p){return p/i})}function hH(r,e){var t=Math.max(An(r),An(e)),i=r+e;return t>uH?i:Pr(i,t)}var B_=9007199254740991;function k_(r){var e=Math.PI*2;return(r%e+e)%e}function ic(r){return r>-lH&&r<lH}var _ue=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Cn(r){if(r instanceof Date)return r;if(Ce(r)){var e=_ue.exec(r);if(!e)return new Date(NaN);if(e[8]){var t=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(t-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,t,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}else return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}else if(r==null)return new Date(NaN);return new Date(Math.round(r))}function Rw(r){return Math.pow(10,Zm(r))}function Zm(r){if(r===0)return 0;var e=Math.floor(Math.log(r)/Math.LN10);return r/Math.pow(10,e)>=10&&e++,e}function jm(r,e){var t=Zm(r),i=Math.pow(10,t),n=r/i,a;return e?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,r=a*i,t>=-20?+r.toFixed(t<0?-t:0):r}function Km(r,e){var t=(r.length-1)*e+1,i=Math.floor(t),n=+r[i-1],a=t-i;return a?n+a*(r[i]-n):n}function V_(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,t=1,i=0;i<r.length;){for(var n=r[i].interval,a=r[i].close,o=0;o<2;o++)n[o]<=e&&(n[o]=e,a[o]=o?1:1-t),e=n[o],t=a[o];n[0]===n[1]&&a[0]*a[1]!==1?r.splice(i,1):i++}return r;function s(l,u,c){return l.interval[c]<u.interval[c]||l.interval[c]===u.interval[c]&&(l.close[c]-u.close[c]===(c?-1:1)||!c&&s(l,u,1))}}function _o(r){var e=parseFloat(r);return e==r&&(e!==0||!Ce(r)||r.indexOf("x")<=0)?e:NaN}function Rp(r){return!isNaN(_o(r))}function Lw(){return Math.round(Math.random()*9)}function fH(r,e){return e===0?r:fH(e,r%e)}function G2(r,e){return r==null?e:e==null?r:r*e/fH(r,e)}var xue="[ECharts] ",pH={},Sue=typeof console<"u"&&console.warn&&console.log;function Mue(r,e,t){if(Sue){if(t){if(pH[e])return;pH[e]=!0}console[r](xue+e)}}function dH(r,e){Mue("warn",r,e)}function hr(r){throw new Error(r)}function mH(r,e,t){return(e-r)*t+r}var vH="series\0",gH="\0_ec_\0";function tr(r){return r instanceof Array?r:r==null?[]:[r]}function rs(r,e,t){if(r){r[e]=r[e]||{},r.emphasis=r.emphasis||{},r.emphasis[e]=r.emphasis[e]||{};for(var i=0,n=t.length;i<n;i++){var a=t[i];!r.emphasis[e].hasOwnProperty(a)&&r[e].hasOwnProperty(a)&&(r.emphasis[e][a]=r[e][a])}}}var H2=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Sl(r){return qe(r)&&!pe(r)&&!(r instanceof Date)?r.value:r}function yH(r){return qe(r)&&!(r instanceof Array)}function Dw(r,e,t){var i=t==="normalMerge",n=t==="replaceMerge",a=t==="replaceAll";r=r||[],e=(e||[]).slice();var o=ke();N(e,function(l,u){if(!qe(l)){e[u]=null;return}});var s=bue(r,o,t);return(i||n)&&wue(s,r,o,e),i&&Tue(s,e),i||n?Eue(s,e,n):a&&Aue(s,e),Cue(s),s}function bue(r,e,t){var i=[];if(t==="replaceAll")return i;for(var n=0;n<r.length;n++){var a=r[n];a&&a.id!=null&&e.set(a.id,n),i.push({existing:t==="replaceMerge"||Jm(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return i}function wue(r,e,t,i){N(i,function(n,a){if(!(!n||n.id==null)){var o=G_(n.id),s=t.get(o);if(s!=null){var l=r[s];Wr(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=n,l.existing=e[s],i[a]=null}}})}function Tue(r,e){N(e,function(t,i){if(!(!t||t.name==null))for(var n=0;n<r.length;n++){var a=r[n].existing;if(!r[n].newOption&&a&&(a.id==null||t.id==null)&&!Jm(t)&&!Jm(a)&&_H("name",a,t)){r[n].newOption=t,e[i]=null;return}}})}function Eue(r,e,t){N(e,function(i){if(i){for(var n,a=0;(n=r[a])&&(n.newOption||Jm(n.existing)||n.existing&&i.id!=null&&!_H("id",i,n.existing));)a++;n?(n.newOption=i,n.brandNew=t):r.push({newOption:i,brandNew:t,existing:null,keyInfo:null}),a++}})}function Aue(r,e){N(e,function(t){r.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})})}function Cue(r){var e=ke();N(r,function(t){var i=t.existing;i&&e.set(i.id,t)}),N(r,function(t){var i=t.newOption;Wr(!i||i.id==null||!e.get(i.id)||e.get(i.id)===t,"id duplicates: "+(i&&i.id)),i&&i.id!=null&&e.set(i.id,t),!t.keyInfo&&(t.keyInfo={})}),N(r,function(t,i){var n=t.existing,a=t.newOption,o=t.keyInfo;if(qe(a)){if(o.name=a.name!=null?G_(a.name):n?n.name:vH+i,n)o.id=G_(n.id);else if(a.id!=null)o.id=G_(a.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(e.get(o.id))}e.set(o.id,t)}})}function _H(r,e,t){var i=Kr(e[r],null),n=Kr(t[r],null);return i!=null&&n!=null&&i===n}function G_(r){return Kr(r,"")}function Kr(r,e){return r==null?e:Ce(r)?r:Dt(r)||y_(r)?r+"":e}function $m(r){var e=r.name;return!!(e&&e.indexOf(vH))}function Jm(r){return r&&r.id!=null&&G_(r.id).indexOf(gH)===0}function xH(r){return gH+r}function SH(r,e,t){N(r,function(i){var n=i.newOption;qe(n)&&(i.keyInfo.mainType=e,i.keyInfo.subType=Rue(e,n,i.existing,t))})}function Rue(r,e,t,i){var n=e.type?e.type:t?t.subType:i.determineSubType(r,e);return n}function MH(r,e){var t={},i={};return n(r||[],t),n(e||[],i,t),[a(t),a(i)];function n(o,s,l){for(var u=0,c=o.length;u<c;u++){var h=Kr(o[u].seriesId,null);if(h==null)return;for(var f=tr(o[u].dataIndex),p=l&&l[h],d=0,g=f.length;d<g;d++){var m=f[d];p&&p[m]?p[m]=null:(s[h]||(s[h]={}))[m]=1}}}function a(o,s){var l=[];for(var u in o)if(o.hasOwnProperty(u)&&o[u]!=null)if(s)l.push(+u);else{var c=a(o[u],!0);c.length&&l.push({seriesId:u,dataIndex:c})}return l}}function Us(r,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return pe(e.dataIndex)?de(e.dataIndex,function(t){return r.indexOfRawIndex(t)}):r.indexOfRawIndex(e.dataIndex);if(e.name!=null)return pe(e.name)?de(e.name,function(t){return r.indexOfName(t)}):r.indexOfName(e.name)}function xt(){var r="__ec_inner_"+Lue++;return function(e){return e[r]||(e[r]={})}}var Lue=Lw();function bh(r,e,t){var i=H_(e,t),n=i.mainTypeSpecified,a=i.queryOptionMap,o=i.others,s=o,l=t?t.defaultMainType:null;return!n&&l&&a.set(l,{}),a.each(function(u,c){var h=wh(r,c,u,{useDefault:l===c,enableAll:t&&t.enableAll!=null?t.enableAll:!0,enableNone:t&&t.enableNone!=null?t.enableNone:!0});s[c+"Models"]=h.models,s[c+"Model"]=h.models[0]}),s}function H_(r,e){var t;if(Ce(r)){var i={};i[r+"Index"]=0,t=i}else t=r;var n=ke(),a={},o=!1;return N(t,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){a[l]=s;return}var u=l.match(/^(\w+)(Index|Id|Name)$/)||[],c=u[1],h=(u[2]||"").toLowerCase();if(!(!c||!h||e&&e.includeMainTypes&&yt(e.includeMainTypes,c)<0)){o=o||!!c;var f=n.get(c)||n.set(c,{});f[h]=s}}),{mainTypeSpecified:o,queryOptionMap:n,others:a}}var Ir={useDefault:!0,enableAll:!1,enableNone:!1},bH={useDefault:!1,enableAll:!0,enableNone:!0};function wh(r,e,t,i){i=i||Ir;var n=t.index,a=t.id,o=t.name,s={models:null,specified:n!=null||a!=null||o!=null};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=r.getComponent(e))?[l]:[],s}return n==="none"||n===!1?(Wr(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(n==="all"&&(Wr(i.enableAll,'`"all"` is not a valid value on index option.'),n=a=o=null),s.models=r.queryComponents({mainType:e,index:n,id:a,name:o}),s)}function W2(r,e,t){r.setAttribute?r.setAttribute(e,t):r[e]=t}function wH(r,e){return r.getAttribute?r.getAttribute(e):r[e]}function TH(r){return r==="auto"?Bt.domSupported?"html":"richText":r||"html"}function W_(r,e){var t=ke(),i=[];return N(r,function(n){var a=e(n);(t.get(a)||(i.push(a),t.set(a,[]))).push(n)}),{keys:i,buckets:t}}function Pw(r,e,t,i,n){var a=e==null||e==="auto";if(i==null)return i;if(Dt(i)){var o=mH(t||0,i,n);return Pr(o,a?Math.max(An(t||0),An(i)):e)}else{if(Ce(i))return n<1?t:i;for(var s=[],l=t,u=i,c=Math.max(l?l.length:0,u.length),h=0;h<c;++h){var f=r.getDimensionInfo(h);if(f&&f.type==="ordinal")s[h]=(n<1&&l?l:u)[h];else{var p=l&&l[h]?l[h]:0,d=u[h],o=mH(p,d,n);s[h]=Pr(o,a?Math.max(An(p),An(d)):e)}}return s}}var Due=".",Lp="___EC__COMPONENT__CONTAINER___",EH="___EC__EXTENDED_CLASS___";function So(r){var e={main:"",sub:""};if(r){var t=r.split(Due);e.main=t[0]||"",e.sub=t[1]||""}return e}function Pue(r){Wr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(r),'componentType "'+r+'" illegal')}function AH(r){return!!(r&&r[EH])}function Qm(r,e){r.$constructor=r,r.extend=function(t){var i=this,n;return Iue(i)?n=function(a){Z(o,a);function o(){return a.apply(this,arguments)||this}return o}(i):(n=function(){(t.$constructor||i).apply(this,arguments)},ZV(n,this)),he(n.prototype,t),n[EH]=!0,n.extend=this.extend,n.superCall=Uue,n.superApply=Oue,n.superClass=i,n}}function Iue(r){return He(r)&&/^class\s/.test(Function.prototype.toString.call(r))}function Iw(r,e){r.extend=e.extend}var Nue=Math.round(Math.random()*10);function CH(r){var e=["__\0is_clz",Nue++].join("_");r.prototype[e]=!0,r.isInstance=function(t){return!!(t&&t[e])}}function Uue(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return this.superClass.prototype[e].apply(r,t)}function Oue(r,e,t){return this.superClass.prototype[e].apply(r,t)}function Th(r){var e={};r.registerClass=function(i){var n=i.type||i.prototype.type;if(n){Pue(n),i.prototype.type=n;var a=So(n);if(!a.sub)e[a.main]=i;else if(a.sub!==Lp){var o=t(a);o[a.sub]=i}}return i},r.getClass=function(i,n,a){var o=e[i];if(o&&o[Lp]&&(o=n?o[n]:null),a&&!o)throw new Error(n?"Component "+i+"."+(n||"")+" is used but not imported.":i+".type should be specified.");return o},r.getClassesByMainType=function(i){var n=So(i),a=[],o=e[n.main];return o&&o[Lp]?N(o,function(s,l){l!==Lp&&a.push(s)}):a.push(o),a},r.hasClass=function(i){var n=So(i);return!!e[n.main]},r.getAllClassMainTypes=function(){var i=[];return N(e,function(n,a){i.push(a)}),i},r.hasSubTypes=function(i){var n=So(i),a=e[n.main];return a&&a[Lp]};function t(i){var n=e[i.main];return(!n||!n[Lp])&&(n=e[i.main]={},n[Lp]=!0),n}}function Mo(r,e){for(var t=0;t<r.length;t++)r[t][1]||(r[t][1]=r[t][0]);return e=e||!1,function(i,n,a){for(var o={},s=0;s<r.length;s++){var l=r[s][1];if(!(n&&yt(n,l)>=0||a&&yt(a,l)<0)){var u=i.getShallow(l,e);u!=null&&(o[r[s][0]]=u)}}return o}}var zue=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Fue=Mo(zue),RH=function(){function r(){}return r.prototype.getAreaStyle=function(e,t){return Fue(this,e,t)},r}();var Y2=new tc(50);function DH(r){if(typeof r=="string"){var e=Y2.get(r);return e&&e.image}else return r}function X_(r,e,t,i,n){if(r)if(typeof r=="string"){if(e&&e.__zrImageSrc===r||!t)return e;var a=Y2.get(r),o={hostEl:t,cb:i,cbPayload:n};return a?(e=a.image,!ev(e)&&a.pending.push(o)):(e=qn.loadImage(r,LH,LH),e.__zrImageSrc=r,Y2.put(r,e.__cachedImgObj={image:e,pending:[o]})),e}else return r;else return e}function LH(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<r.pending.length;e++){var t=r.pending[e],i=t.cb;i&&i(this,t.cbPayload),t.hostEl.dirty()}r.pending.length=0}function ev(r){return r&&r.width&&r.height}var q2=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function kue(r,e,t,i,n){if(!e)return"";var a=(r+"").split(`
  2204. `);n=IH(e,t,i,n);for(var o=0,s=a.length;o<s;o++)a[o]=NH(a[o],n);return a.join(`
  2205. `)}function IH(r,e,t,i){i=i||{};var n=he({},i);n.font=e,t=mt(t,"..."),n.maxIterations=mt(i.maxIterations,2);var a=n.minChar=mt(i.minChar,0);n.cnCharWidth=yo("\u56FD",e);var o=n.ascCharWidth=yo("a",e);n.placeholder=mt(i.placeholder,"");for(var s=r=Math.max(0,r-1),l=0;l<a&&s>=o;l++)s-=o;var u=yo(t,e);return u>s&&(t="",u=0),s=r-u,n.ellipsis=t,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=r,n}function NH(r,e){var t=e.containerWidth,i=e.font,n=e.contentWidth;if(!t)return"";var a=yo(r,i);if(a<=t)return r;for(var o=0;;o++){if(a<=n||o>=e.maxIterations){r+=e.ellipsis;break}var s=o===0?Vue(r,n,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(r.length*n/a):0;r=r.substr(0,s),a=yo(r,i)}return r===""&&(r=e.placeholder),r}function Vue(r,e,t,i){for(var n=0,a=0,o=r.length;a<o&&n<e;a++){var s=r.charCodeAt(a);n+=0<=s&&s<=127?t:i}return a}function UH(r,e){r!=null&&(r+="");var t=e.overflow,i=e.padding,n=e.font,a=t==="truncate",o=Xm(n),s=mt(e.lineHeight,o),l=!!e.backgroundColor,u=e.lineOverflow==="truncate",c=e.width,h;c!=null&&(t==="break"||t==="breakAll")?h=r?zH(r,e.font,c,t==="breakAll",0).lines:[]:h=r?r.split(`
  2206. `):[];var f=h.length*s,p=mt(e.height,f);if(f>p&&u){var d=Math.floor(p/s);h=h.slice(0,d)}if(r&&a&&c!=null)for(var g=IH(c,n,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),m=0;m<h.length;m++)h[m]=NH(h[m],g);for(var v=p,_=0,m=0;m<h.length;m++)_=Math.max(yo(h[m],n),_);c==null&&(c=_);var y=_;return i&&(v+=i[0]+i[2],y+=i[1]+i[3],c+=i[1]+i[3]),l&&(y=c),{lines:h,height:p,outerWidth:y,outerHeight:v,lineHeight:s,calculatedLineHeight:o,contentWidth:_,contentHeight:f,width:c}}var Gue=function(){function r(){}return r}(),PH=function(){function r(e){this.tokens=[],e&&(this.tokens=e)}return r}(),Hue=function(){function r(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]}return r}();function OH(r,e){var t=new Hue;if(r!=null&&(r+=""),!r)return t;for(var i=e.width,n=e.height,a=e.overflow,o=(a==="break"||a==="breakAll")&&i!=null?{width:i,accumWidth:0,breakAll:a==="breakAll"}:null,s=q2.lastIndex=0,l;(l=q2.exec(r))!=null;){var u=l.index;u>s&&Z2(t,r.substring(s,u),e,o),Z2(t,l[2],e,o,l[1]),s=q2.lastIndex}s<r.length&&Z2(t,r.substring(s,r.length),e,o);var c=[],h=0,f=0,p=e.padding,d=a==="truncate",g=e.lineOverflow==="truncate";function m(z,k,G){z.width=k,z.lineHeight=G,h+=G,f=Math.max(f,k)}e:for(var v=0;v<t.lines.length;v++){for(var _=t.lines[v],y=0,x=0,M=0;M<_.tokens.length;M++){var S=_.tokens[M],w=S.styleName&&e.rich[S.styleName]||{},T=S.textPadding=w.padding,C=T?T[1]+T[3]:0,b=S.font=w.font||e.font;S.contentHeight=Xm(b);var E=mt(w.height,S.contentHeight);if(S.innerHeight=E,T&&(E+=T[0]+T[2]),S.height=E,S.lineHeight=qi(w.lineHeight,e.lineHeight,E),S.align=w&&w.align||e.align,S.verticalAlign=w&&w.verticalAlign||"middle",g&&n!=null&&h+S.lineHeight>n){M>0?(_.tokens=_.tokens.slice(0,M),m(_,x,y),t.lines=t.lines.slice(0,v+1)):t.lines=t.lines.slice(0,v);break e}var I=w.width,R=I==null||I==="auto";if(typeof I=="string"&&I.charAt(I.length-1)==="%")S.percentWidth=I,c.push(S),S.contentWidth=yo(S.text,b);else{if(R){var A=w.backgroundColor,P=A&&A.image;P&&(P=DH(P),ev(P)&&(S.width=Math.max(S.width,P.width*E/P.height)))}var U=d&&i!=null?i-x:null;U!=null&&U<S.width?!R||U<C?(S.text="",S.width=S.contentWidth=0):(S.text=kue(S.text,U-C,b,e.ellipsis,{minChar:e.truncateMinChar}),S.width=S.contentWidth=yo(S.text,b)):S.contentWidth=yo(S.text,b)}S.width+=C,x+=S.width,w&&(y=Math.max(y,S.lineHeight))}m(_,x,y)}t.outerWidth=t.width=mt(i,f),t.outerHeight=t.height=mt(n,h),t.contentHeight=h,t.contentWidth=f,p&&(t.outerWidth+=p[1]+p[3],t.outerHeight+=p[0]+p[2]);for(var v=0;v<c.length;v++){var S=c[v],B=S.percentWidth;S.width=parseInt(B,10)/100*t.width}return t}function Z2(r,e,t,i,n){var a=e==="",o=n&&t.rich[n]||{},s=r.lines,l=o.font||t.font,u=!1,c,h;if(i){var f=o.padding,p=f?f[1]+f[3]:0;if(o.width!=null&&o.width!=="auto"){var d=En(o.width,i.width)+p;s.length>0&&d+i.accumWidth>i.width&&(c=e.split(`
  2207. `),u=!0),i.accumWidth=d}else{var g=zH(e,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,h=g.linesWidths,c=g.lines}}else c=e.split(`
  2208. `);for(var m=0;m<c.length;m++){var v=c[m],_=new Gue;if(_.styleName=n,_.text=v,_.isLineHolder=!v&&!a,typeof o.width=="number"?_.width=o.width:_.width=h?h[m]:yo(v,l),!m&&!u){var y=(s[s.length-1]||(s[0]=new PH)).tokens,x=y.length;x===1&&y[0].isLineHolder?y[0]=_:(v||!x||a)&&y.push(_)}else s.push(new PH([_]))}}function Wue(r){var e=r.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var Xue=bn(",&?/;] ".split(""),function(r,e){return r[e]=!0,r},{});function Yue(r){return Wue(r)?!!Xue[r]:!0}function zH(r,e,t,i,n){for(var a=[],o=[],s="",l="",u=0,c=0,h=0;h<r.length;h++){var f=r.charAt(h);if(f===`
  2209. `){l&&(s+=l,c+=u),a.push(s),o.push(c),s="",l="",u=0,c=0;continue}var p=yo(f,e),d=i?!1:!Yue(f);if(a.length?c+p>t:n+c+p>t){c?(s||l)&&(d?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=f,u+=p,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=f,c=p)):d?(a.push(l),o.push(u),l=f,u=p):(a.push(f),o.push(p));continue}c+=p,d?(l+=f,u+=p):(l&&(s+=l,l="",u=0),s+=f)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=n),{accumWidth:c,lines:a,linesWidths:o}}var J2="__zr_style_"+Math.round(Math.random()*10),pu={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Dp={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};pu[J2]=!0;var FH=["z","z2","invisible"],que=["invisible"],Zue=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype._init=function(t){for(var i=At(t),n=0;n<i.length;n++){var a=i[n];a==="style"?this.useStyle(t[a]):r.prototype.attrKV.call(this,a,t[a])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,i,n,a){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&jue(this,t,i)||o&&!o[0]&&!o[3])return!1;if(n&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(a&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(t,i){return this.rectContain(t,i)},e.prototype.traverse=function(t,i){t.call(i,this)},e.prototype.rectContain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect();return a.contain(n[0],n[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var i=this.transform,n=this.getBoundingRect(),a=this.style,o=a.shadowBlur||0,s=a.shadowOffsetX||0,l=a.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new ht(0,0,0,0)),i?ht.applyTransform(t,n,i):t.copy(n),(o||s||l)&&(t.width+=o*2+Math.abs(s),t.height+=o*2+Math.abs(l),t.x=Math.min(t.x,t.x+s-o),t.y=Math.min(t.y,t.y+l-o));var u=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-u),t.y=Math.floor(t.y-u),t.width=Math.ceil(t.width+1+u*2),t.height=Math.ceil(t.height+1+u*2))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new ht(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(t,i){t!=="style"?r.prototype.attrKV.call(this,t,i):this.style?this.setStyle(i):this.useStyle(i)},e.prototype.setStyle=function(t,i){return typeof t=="string"?this.style[t]=i:he(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=gp,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&gp)},e.prototype.styleUpdated=function(){this.__dirty&=~gp},e.prototype.createStyle=function(t){return mh(pu,t)},e.prototype.useStyle=function(t){t[J2]||(t=this.createStyle(t)),this.__inHover?this.__hoverStyle=t:this.style=t,this.dirtyStyle()},e.prototype.isStyleObject=function(t){return t[J2]},e.prototype._innerSaveToNormal=function(t){r.prototype._innerSaveToNormal.call(this,t);var i=this._normalState;t.style&&!i.style&&(i.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,i,FH)},e.prototype._applyStateObj=function(t,i,n,a,o,s){r.prototype._applyStateObj.call(this,t,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.style?o?a?u=i.style:(u=this._mergeStyle(this.createStyle(),n.style),this._mergeStyle(u,i.style)):(u=this._mergeStyle(this.createStyle(),a?this.style:n.style),this._mergeStyle(u,i.style)):l&&(u=n.style),u)if(o){var c=this.style;if(this.style=this.createStyle(l?{}:c),l)for(var h=At(c),f=0;f<h.length;f++){var p=h[f];p in u&&(u[p]=u[p],this.style[p]=c[p])}for(var d=At(u),f=0;f<d.length;f++){var p=d[f];this.style[p]=this.style[p]}this._transitionState(t,{style:u},s,this.getAnimationStyleProps())}else this.useStyle(u);for(var g=this.__inHover?que:FH,f=0;f<g.length;f++){var p=g[f];i&&i[p]!=null?this[p]=i[p]:l&&n[p]!=null&&(this[p]=n[p])}},e.prototype._mergeStates=function(t){for(var i=r.prototype._mergeStates.call(this,t),n,a=0;a<t.length;a++){var o=t[a];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(i.style=n),i},e.prototype._mergeStyle=function(t,i){return he(t,i),t},e.prototype.getAnimationStyleProps=function(){return Dp},e.initDefaultProps=function(){var t=e.prototype;t.type="displayable",t.invisible=!1,t.z=0,t.z2=0,t.zlevel=0,t.culling=!1,t.cursor="pointer",t.rectHover=!1,t.incremental=!1,t._rect=null,t.dirtyRectTolerance=0,t.__dirty=ki|gp}(),e}(Aw),j2=new ht(0,0,0,0),K2=new ht(0,0,0,0);function jue(r,e,t){return j2.copy(r.getBoundingRect()),r.transform&&j2.applyTransform(r.transform),K2.width=e,K2.height=t,!j2.intersect(K2)}var Si=Zue;var bo=Math.min,wo=Math.max,$2=Math.sin,Q2=Math.cos,Pp=Math.PI*2,Nw=uu(),Uw=uu(),Ow=uu();function Ip(r,e,t){if(r.length!==0){for(var i=r[0],n=i[0],a=i[0],o=i[1],s=i[1],l=1;l<r.length;l++)i=r[l],n=bo(n,i[0]),a=wo(a,i[0]),o=bo(o,i[1]),s=wo(s,i[1]);e[0]=n,e[1]=o,t[0]=a,t[1]=s}}function eD(r,e,t,i,n,a){n[0]=bo(r,t),n[1]=bo(e,i),a[0]=wo(r,t),a[1]=wo(e,i)}var BH=[],kH=[];function VH(r,e,t,i,n,a,o,s,l,u){var c=aw,h=vi,f=c(r,t,n,o,BH);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p<f;p++){var d=h(r,t,n,o,BH[p]);l[0]=bo(d,l[0]),u[0]=wo(d,u[0])}f=c(e,i,a,s,kH);for(var p=0;p<f;p++){var g=h(e,i,a,s,kH[p]);l[1]=bo(g,l[1]),u[1]=wo(g,u[1])}l[0]=bo(r,l[0]),u[0]=wo(r,u[0]),l[0]=bo(o,l[0]),u[0]=wo(o,u[0]),l[1]=bo(e,l[1]),u[1]=wo(e,u[1]),l[1]=bo(s,l[1]),u[1]=wo(s,u[1])}function GH(r,e,t,i,n,a,o,s){var l=sw,u=xi,c=wo(bo(l(r,t,n),1),0),h=wo(bo(l(e,i,a),1),0),f=u(r,t,n,c),p=u(e,i,a,h);o[0]=bo(r,n,f),o[1]=bo(e,a,p),s[0]=wo(r,n,f),s[1]=wo(e,a,p)}function HH(r,e,t,i,n,a,o,s,l){var u=$o,c=Qo,h=Math.abs(n-a);if(h%Pp<1e-4&&h>1e-4){s[0]=r-t,s[1]=e-i,l[0]=r+t,l[1]=e+i;return}if(Nw[0]=Q2(n)*t+r,Nw[1]=$2(n)*i+e,Uw[0]=Q2(a)*t+r,Uw[1]=$2(a)*i+e,u(s,Nw,Uw),c(l,Nw,Uw),n=n%Pp,n<0&&(n=n+Pp),a=a%Pp,a<0&&(a=a+Pp),n>a&&!o?a+=Pp:n<a&&o&&(n+=Pp),o){var f=a;a=n,n=f}for(var p=0;p<a;p+=Math.PI/2)p>n&&(Ow[0]=Q2(p)*t+r,Ow[1]=$2(p)*i+e,u(s,Ow,s),c(l,Ow,l))}var Xr={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Np=[],Up=[],du=[],Eh=[],mu=[],vu=[],tD=Math.min,rD=Math.max,Op=Math.cos,zp=Math.sin,nc=Math.abs,aD=Math.PI,Ah=aD*2,iD=typeof Float32Array<"u",Y_=[];function nD(r){var e=Math.round(r/aD*1e8)/1e8;return e%2*aD}function q_(r,e){var t=nD(r[0]);t<0&&(t+=Ah);var i=t-r[0],n=r[1];n+=i,!e&&n-t>=Ah?n=t+Ah:e&&t-n>=Ah?n=t-Ah:!e&&t>n?n=t+(Ah-nD(t-n)):e&&t<n&&(n=t-(Ah-nD(n-t))),r[0]=t,r[1]=n}var Kue=function(){function r(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return r.prototype.increaseVersion=function(){this._version++},r.prototype.getVersion=function(){return this._version},r.prototype.setScale=function(e,t,i){i=i||0,i>0&&(this._ux=nc(i/wp/e)||0,this._uy=nc(i/wp/t)||0)},r.prototype.setDPR=function(e){this.dpr=e},r.prototype.setContext=function(e){this._ctx=e},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Xr.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},r.prototype.lineTo=function(e,t){var i=nc(e-this._xi),n=nc(t-this._yi),a=i>this._ux||n>this._uy;if(this.addData(Xr.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(e,t,i,n,a,o){return this._drawPendingPt(),this.addData(Xr.C,e,t,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(e,t,i,n,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(e,t,i,n){return this._drawPendingPt(),this.addData(Xr.Q,e,t,i,n),this._ctx&&this._ctx.quadraticCurveTo(e,t,i,n),this._xi=i,this._yi=n,this},r.prototype.arc=function(e,t,i,n,a,o){this._drawPendingPt(),Y_[0]=n,Y_[1]=a,q_(Y_,o),n=Y_[0],a=Y_[1];var s=a-n;return this.addData(Xr.A,e,t,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(e,t,i,n,a,o),this._xi=Op(a)*i+e,this._yi=zp(a)*i+t,this},r.prototype.arcTo=function(e,t,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,i,n,a),this},r.prototype.rect=function(e,t,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,i,n),this.addData(Xr.R,e,t,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(Xr.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&e.closePath(),this._xi=t,this._yi=i,this},r.prototype.fill=function(e){e&&e.fill(),this.toStatic()},r.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&iD&&(this.data=new Float32Array(t));for(var i=0;i<t;i++)this.data[i]=e[i];this._len=t},r.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var t=e.length,i=0,n=this._len,a=0;a<t;a++)i+=e[a].len();iD&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(var a=0;a<t;a++)for(var o=e[a].data,s=0;s<o.length;s++)this.data[n++]=o[s];this._len=n},r.prototype.addData=function(e,t,i,n,a,o,s,l,u){if(this._saveData){var c=this.data;this._len+arguments.length>c.length&&(this._expandData(),c=this.data);for(var h=0;h<arguments.length;h++)c[this._len++]=arguments[h]}},r.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},r.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,iD&&this._len>11&&(this.data=new Float32Array(e)))}},r.prototype.getBoundingRect=function(){du[0]=du[1]=mu[0]=mu[1]=Number.MAX_VALUE,Eh[0]=Eh[1]=vu[0]=vu[1]=-Number.MAX_VALUE;var e=this.data,t=0,i=0,n=0,a=0,o;for(o=0;o<this._len;){var s=e[o++],l=o===1;switch(l&&(t=e[o],i=e[o+1],n=t,a=i),s){case Xr.M:t=n=e[o++],i=a=e[o++],mu[0]=n,mu[1]=a,vu[0]=n,vu[1]=a;break;case Xr.L:eD(t,i,e[o],e[o+1],mu,vu),t=e[o++],i=e[o++];break;case Xr.C:VH(t,i,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],mu,vu),t=e[o++],i=e[o++];break;case Xr.Q:GH(t,i,e[o++],e[o++],e[o],e[o+1],mu,vu),t=e[o++],i=e[o++];break;case Xr.A:var u=e[o++],c=e[o++],h=e[o++],f=e[o++],p=e[o++],d=e[o++]+p;o+=1;var g=!e[o++];l&&(n=Op(p)*h+u,a=zp(p)*f+c),HH(u,c,h,f,p,d,g,mu,vu),t=Op(d)*h+u,i=zp(d)*f+c;break;case Xr.R:n=t=e[o++],a=i=e[o++];var m=e[o++],v=e[o++];eD(n,a,n+m,a+v,mu,vu);break;case Xr.Z:t=n,i=a;break}$o(du,du,mu),Qo(Eh,Eh,vu)}return o===0&&(du[0]=du[1]=Eh[0]=Eh[1]=0),new ht(du[0],du[1],Eh[0]-du[0],Eh[1]-du[1])},r.prototype._calculateLength=function(){var e=this.data,t=this._len,i=this._ux,n=this._uy,a=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var u=this._pathSegLen,c=0,h=0,f=0;f<t;){var p=e[f++],d=f===1;d&&(a=e[f],o=e[f+1],s=a,l=o);var g=-1;switch(p){case Xr.M:a=s=e[f++],o=l=e[f++];break;case Xr.L:{var m=e[f++],v=e[f++],_=m-a,y=v-o;(nc(_)>i||nc(y)>n||f===t-1)&&(g=Math.sqrt(_*_+y*y),a=m,o=v);break}case Xr.C:{var x=e[f++],M=e[f++],m=e[f++],v=e[f++],S=e[f++],w=e[f++];g=wG(a,o,x,M,m,v,S,w,10),a=S,o=w;break}case Xr.Q:{var x=e[f++],M=e[f++],m=e[f++],v=e[f++];g=EG(a,o,x,M,m,v,10),a=m,o=v;break}case Xr.A:var T=e[f++],C=e[f++],b=e[f++],E=e[f++],I=e[f++],R=e[f++],A=R+I;f+=1,d&&(s=Op(I)*b+T,l=zp(I)*E+C),g=rD(b,E)*tD(Ah,Math.abs(R)),a=Op(A)*b+T,o=zp(A)*E+C;break;case Xr.R:{s=a=e[f++],l=o=e[f++];var P=e[f++],U=e[f++];g=P*2+U*2;break}case Xr.Z:{var _=s-a,y=l-o;g=Math.sqrt(_*_+y*y),a=s,o=l;break}}g>=0&&(u[h++]=g,c+=g)}return this._pathLen=c,c},r.prototype.rebuildPath=function(e,t){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,c,h,f,p=t<1,d,g,m=0,v=0,_,y=0,x,M;if(!(p&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,g=this._pathLen,_=t*g,!_)))e:for(var S=0;S<o;){var w=i[S++],T=S===1;switch(T&&(u=i[S],c=i[S+1],s=u,l=c),w!==Xr.L&&y>0&&(e.lineTo(x,M),y=0),w){case Xr.M:s=u=i[S++],l=c=i[S++],e.moveTo(u,c);break;case Xr.L:{h=i[S++],f=i[S++];var C=nc(h-u),b=nc(f-c);if(C>n||b>a){if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;e.lineTo(u*(1-I)+h*I,c*(1-I)+f*I);break e}m+=E}e.lineTo(h,f),u=h,c=f,y=0}else{var R=C*C+b*b;R>y&&(x=h,M=f,y=R)}break}case Xr.C:{var A=i[S++],P=i[S++],U=i[S++],B=i[S++],z=i[S++],k=i[S++];if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;Ps(u,A,U,z,I,Np),Ps(c,P,B,k,I,Up),e.bezierCurveTo(Np[1],Up[1],Np[2],Up[2],Np[3],Up[3]);break e}m+=E}e.bezierCurveTo(A,P,U,B,z,k),u=z,c=k;break}case Xr.Q:{var A=i[S++],P=i[S++],U=i[S++],B=i[S++];if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;xh(u,A,U,I,Np),xh(c,P,B,I,Up),e.quadraticCurveTo(Np[1],Up[1],Np[2],Up[2]);break e}m+=E}e.quadraticCurveTo(A,P,U,B),u=U,c=B;break}case Xr.A:var G=i[S++],Y=i[S++],J=i[S++],Q=i[S++],V=i[S++],K=i[S++],ae=i[S++],ve=!i[S++],ue=J>Q?J:Q,se=nc(J-Q)>.001,Ee=V+K,q=!1;if(p){var E=d[v++];m+E>_&&(Ee=V+K*(_-m)/E,q=!0),m+=E}if(se&&e.ellipse?e.ellipse(G,Y,J,Q,ae,V,Ee,ve):e.arc(G,Y,ue,V,Ee,ve),q)break e;T&&(s=Op(V)*J+G,l=zp(V)*Q+Y),u=Op(Ee)*J+G,c=zp(Ee)*Q+Y;break;case Xr.R:s=u=i[S],l=c=i[S+1],h=i[S++],f=i[S++];var H=i[S++],We=i[S++];if(p){var E=d[v++];if(m+E>_){var _e=_-m;e.moveTo(h,f),e.lineTo(h+tD(_e,H),f),_e-=H,_e>0&&e.lineTo(h+H,f+tD(_e,We)),_e-=We,_e>0&&e.lineTo(h+rD(H-_e,0),f+We),_e-=H,_e>0&&e.lineTo(h,f+rD(We-_e,0));break e}m+=E}e.rect(h,f,H,We);break;case Xr.Z:if(p){var E=d[v++];if(m+E>_){var I=(_-m)/E;e.lineTo(u*(1-I)+s*I,c*(1-I)+l*I);break e}m+=E}e.closePath(),u=s,c=l}}},r.prototype.clone=function(){var e=new r,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},r.CMD=Xr,r.initDefaultProps=function(){var e=r.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),r}(),$i=Kue;function gu(r,e,t,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=r;if(o>e+s&&o>i+s||o<e-s&&o<i-s||a>r+s&&a>t+s||a<r-s&&a<t-s)return!1;if(r!==t)l=(e-i)/(r-t),u=(r*i-t*e)/(r-t);else return Math.abs(a-r)<=s/2;var c=l*a-o+u,h=c*c/(l*l+1);return h<=s/2*s/2}function YH(r,e,t,i,n,a,o,s,l,u,c){if(l===0)return!1;var h=l;if(c>e+h&&c>i+h&&c>a+h&&c>s+h||c<e-h&&c<i-h&&c<a-h&&c<s-h||u>r+h&&u>t+h&&u>n+h&&u>o+h||u<r-h&&u<t-h&&u<n-h&&u<o-h)return!1;var f=ow(r,e,t,i,n,a,o,s,u,c,null);return f<=h/2}function zw(r,e,t,i,n,a,o,s,l){if(o===0)return!1;var u=o;if(l>e+u&&l>i+u&&l>a+u||l<e-u&&l<i-u&&l<a-u||s>r+u&&s>t+u&&s>n+u||s<r-u&&s<t-u&&s<n-u)return!1;var c=lw(r,e,t,i,n,a,s,l,null);return c<=u/2}var ZH=Math.PI*2;function Rn(r){return r%=ZH,r<0&&(r+=ZH),r}var Z_=Math.PI*2;function jH(r,e,t,i,n,a,o,s,l){if(o===0)return!1;var u=o;s-=r,l-=e;var c=Math.sqrt(s*s+l*l);if(c-u>t||c+u<t)return!1;if(Math.abs(i-n)%Z_<1e-4)return!0;if(a){var h=i;i=Rn(n),n=Rn(h)}else i=Rn(i),n=Rn(n);i>n&&(n+=Z_);var f=Math.atan2(l,s);return f<0&&(f+=Z_),f>=i&&f<=n||f+Z_>=i&&f+Z_<=n}function Os(r,e,t,i,n,a){if(a>e&&a>i||a<e&&a<i||i===e)return 0;var o=(a-e)/(i-e),s=i<e?1:-1;(o===1||o===0)&&(s=i<e?.5:-.5);var l=o*(t-r)+r;return l===n?1/0:l>n?s:0}var Ch=$i.CMD,Fp=Math.PI*2,Que=1e-4;function ece(r,e){return Math.abs(r-e)<Que}var va=[-1,-1,-1],zs=[-1,-1];function tce(){var r=zs[0];zs[0]=zs[1],zs[1]=r}function rce(r,e,t,i,n,a,o,s,l,u){if(u>e&&u>i&&u>a&&u>s||u<e&&u<i&&u<a&&u<s)return 0;var c=yp(e,i,a,s,u,va);if(c===0)return 0;for(var h=0,f=-1,p=void 0,d=void 0,g=0;g<c;g++){var m=va[g],v=m===0||m===1?.5:1,_=vi(r,t,n,o,m);_<l||(f<0&&(f=aw(e,i,a,s,zs),zs[1]<zs[0]&&f>1&&tce(),p=vi(e,i,a,s,zs[0]),f>1&&(d=vi(e,i,a,s,zs[1]))),f===2?m<zs[0]?h+=p<e?v:-v:m<zs[1]?h+=d<p?v:-v:h+=s<d?v:-v:m<zs[0]?h+=p<e?v:-v:h+=s<p?v:-v)}return h}function ice(r,e,t,i,n,a,o,s){if(s>e&&s>i&&s>a||s<e&&s<i&&s<a)return 0;var l=TG(e,i,a,s,va);if(l===0)return 0;var u=sw(e,i,a);if(u>=0&&u<=1){for(var c=0,h=xi(e,i,a,u),f=0;f<l;f++){var p=va[f]===0||va[f]===1?.5:1,d=xi(r,t,n,va[f]);d<o||(va[f]<u?c+=h<e?p:-p:c+=a<h?p:-p)}return c}else{var p=va[0]===0||va[0]===1?.5:1,d=xi(r,t,n,va[0]);return d<o?0:a<e?p:-p}}function nce(r,e,t,i,n,a,o,s){if(s-=e,s>t||s<-t)return 0;var l=Math.sqrt(t*t-s*s);va[0]=-l,va[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=Fp-1e-4){i=0,n=Fp;var c=a?1:-1;return o>=va[0]+r&&o<=va[1]+r?c:0}if(i>n){var h=i;i=n,n=h}i<0&&(i+=Fp,n+=Fp);for(var f=0,p=0;p<2;p++){var d=va[p];if(d+r>o){var g=Math.atan2(s,d),c=a?1:-1;g<0&&(g=Fp+g),(g>=i&&g<=n||g+Fp>=i&&g+Fp<=n)&&(g>Math.PI/2&&g<Math.PI*1.5&&(c=-c),f+=c)}}return f}function KH(r,e,t,i,n){for(var a=r.data,o=r.len(),s=0,l=0,u=0,c=0,h=0,f,p,d=0;d<o;){var g=a[d++],m=d===1;switch(g===Ch.M&&d>1&&(t||(s+=Os(l,u,c,h,i,n))),m&&(l=a[d],u=a[d+1],c=l,h=u),g){case Ch.M:c=a[d++],h=a[d++],l=c,u=h;break;case Ch.L:if(t){if(gu(l,u,a[d],a[d+1],e,i,n))return!0}else s+=Os(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Ch.C:if(t){if(YH(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=rce(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Ch.Q:if(t){if(zw(l,u,a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=ice(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Ch.A:var v=a[d++],_=a[d++],y=a[d++],x=a[d++],M=a[d++],S=a[d++];d+=1;var w=!!(1-a[d++]);f=Math.cos(M)*y+v,p=Math.sin(M)*x+_,m?(c=f,h=p):s+=Os(l,u,f,p,i,n);var T=(i-v)*x/y+v;if(t){if(jH(v,_,x,M,M+S,w,e,T,n))return!0}else s+=nce(v,_,x,M,M+S,w,T,n);l=Math.cos(M+S)*y+v,u=Math.sin(M+S)*x+_;break;case Ch.R:c=l=a[d++],h=u=a[d++];var C=a[d++],b=a[d++];if(f=c+C,p=h+b,t){if(gu(c,h,f,h,e,i,n)||gu(f,h,f,p,e,i,n)||gu(f,p,c,p,e,i,n)||gu(c,p,c,h,e,i,n))return!0}else s+=Os(f,h,f,p,i,n),s+=Os(c,p,c,h,i,n);break;case Ch.Z:if(t){if(gu(l,u,c,h,e,i,n))return!0}else s+=Os(l,u,c,h,i,n);l=c,u=h;break}}return!t&&!ece(u,h)&&(s+=Os(l,u,c,h,i,n)||0),s!==0}function JH(r,e,t){return KH(r,0,!1,e,t)}function $H(r,e,t,i){return KH(r,e,!0,t,i)}var tv=Ye({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},pu),oce={style:Ye({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Dp.style)},oD=ts.concat(["invisible","culling","z","z2","zlevel","parent"]),sce=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.update=function(){var t=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new e;n.buildPath===e.prototype.buildPath&&(n.buildPath=function(l){t.buildPath(l,t.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s<oD.length;++s)n[oD[s]]=this[oD[s]];n.__dirty|=ki}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(t){var i=At(t);this.shape=this.getDefaultShape();var n=this.getDefaultStyle();n&&this.useStyle(n);for(var a=0;a<i.length;a++){var o=i[a],s=t[o];o==="style"?this.style?he(this.style,s):this.useStyle(s):o==="shape"?he(this.shape,s):r.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var t=this.style.fill;if(t!=="none"){if(Ce(t)){var i=Gm(t,0);return i>.5?z_:i>.2?JG:F_}else if(t)return F_}return z_},e.prototype.getInsideTextStroke=function(t){var i=this.style.fill;if(Ce(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Gm(t,0)<O_;if(a===o)return i}},e.prototype.buildPath=function(t,i,n){},e.prototype.pathUpdated=function(){this.__dirty&=~gh},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new $i(!1)},e.prototype.hasStroke=function(){var t=this.style,i=t.stroke;return!(i==null||i==="none"||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style,i=t.fill;return i!=null&&i!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,i=this.style,n=!t;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&gh)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){s.copy(t);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect(),o=this.style;if(t=n[0],i=n[1],a.contain(t,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),$H(s,l/u,t,i)))return!0}if(this.hasFill())return JH(s,t,i)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=gh,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,i){t==="shape"?this.setShape(i):r.prototype.attrKV.call(this,t,i)},e.prototype.setShape=function(t,i){var n=this.shape;return n||(n=this.shape={}),typeof t=="string"?n[t]=i:he(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&gh)},e.prototype.createStyle=function(t){return mh(tv,t)},e.prototype._innerSaveToNormal=function(t){r.prototype._innerSaveToNormal.call(this,t);var i=this._normalState;t.shape&&!i.shape&&(i.shape=he({},this.shape))},e.prototype._applyStateObj=function(t,i,n,a,o,s){r.prototype._applyStateObj.call(this,t,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=he({},n.shape),he(u,i.shape)):(u=he({},a?this.shape:n.shape),he(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=he({},this.shape);for(var c={},h=At(u),f=0;f<h.length;f++){var p=h[f];typeof u[p]=="object"?this.shape[p]=u[p]:c[p]=u[p]}this._transitionState(t,{shape:c},s)}else this.shape=u,this.dirtyShape()},e.prototype._mergeStates=function(t){for(var i=r.prototype._mergeStates.call(this,t),n,a=0;a<t.length;a++){var o=t[a];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(i.shape=n),i},e.prototype.getAnimationStyleProps=function(){return oce},e.prototype.isZeroArea=function(){return!1},e.extend=function(t){var i=function(a){qt(o,a);function o(s){var l=a.call(this,s)||this;return t.init&&t.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return Qe(t.style)},o.prototype.getDefaultShape=function(){return Qe(t.shape)},o}(e);for(var n in t)typeof t[n]=="function"&&(i.prototype[n]=t[n]);return i},e.initDefaultProps=function(){var t=e.prototype;t.type="path",t.strokeContainThreshold=5,t.segmentIgnoreThreshold=0,t.subPixelOptimize=!1,t.autoBatch=!1,t.__dirty=ki|gp|gh}(),e}(Si),pt=sce;var lce=Ye({strokeFirst:!0,font:Jo,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},tv),QH=function(r){qt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var t=this.style,i=t.stroke;return i!=null&&i!=="none"&&t.lineWidth>0},e.prototype.hasFill=function(){var t=this.style,i=t.fill;return i!=null&&i!=="none"},e.prototype.createStyle=function(t){return mh(lce,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var i=t.text;i!=null?i+="":i="";var n=fu(i,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var a=t.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(Si);QH.prototype.type="tspan";var ac=QH;var uce=Ye({x:0,y:0},pu),cce={style:Ye({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Dp.style)};function hce(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var e4=function(r){qt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return mh(uce,t)},e.prototype._getSize=function(t){var i=this.style,n=i[t];if(n!=null)return n;var a=hce(i.image)?i.image:this.__image;if(!a)return 0;var o=t==="width"?"height":"width",s=i[o];return s==null?a[t]:a[t]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return cce},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new ht(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Si);e4.prototype.type="image";var Br=e4;function t4(r,e){var t=e.x,i=e.y,n=e.width,a=e.height,o=e.r,s,l,u,c;n<0&&(t=t+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=c=o:o instanceof Array?o.length===1?s=l=u=c=o[0]:o.length===2?(s=u=o[0],l=c=o[1]):o.length===3?(s=o[0],l=c=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],c=o[3]):s=l=u=c=0;var h;s+l>n&&(h=s+l,s*=n/h,l*=n/h),u+c>n&&(h=u+c,u*=n/h,c*=n/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+c>a&&(h=s+c,s*=a/h,c*=a/h),r.moveTo(t+s,i),r.lineTo(t+n-l,i),l!==0&&r.arc(t+n-l,i+l,l,-Math.PI/2,0),r.lineTo(t+n,i+a-u),u!==0&&r.arc(t+n-u,i+a-u,u,0,Math.PI/2),r.lineTo(t+c,i+a),c!==0&&r.arc(t+c,i+a-c,c,Math.PI/2,Math.PI),r.lineTo(t,i+s),s!==0&&r.arc(t+s,i+s,s,Math.PI,Math.PI*1.5)}var rv=Math.round;function Fw(r,e,t){if(e){var i=e.x1,n=e.x2,a=e.y1,o=e.y2;r.x1=i,r.x2=n,r.y1=a,r.y2=o;var s=t&&t.lineWidth;return s&&(rv(i*2)===rv(n*2)&&(r.x1=r.x2=Rh(i,s,!0)),rv(a*2)===rv(o*2)&&(r.y1=r.y2=Rh(a,s,!0))),r}}function Bw(r,e,t){if(e){var i=e.x,n=e.y,a=e.width,o=e.height;r.x=i,r.y=n,r.width=a,r.height=o;var s=t&&t.lineWidth;return s&&(r.x=Rh(i,s,!0),r.y=Rh(n,s,!0),r.width=Math.max(Rh(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(Rh(n+o,s,!1)-r.y,o===0?0:1)),r}}function Rh(r,e,t){if(!e)return r;var i=rv(r*2);return(i+rv(e))%2===0?i/2:(i+(t?1:-1))/2}var dce=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}();var mce={},r4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new dce},e.prototype.buildPath=function(t,i){var n,a,o,s;if(this.subPixelOptimize){var l=Bw(mce,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?t4(t,i):t.rect(n,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(pt);r4.prototype.type="rect";var Rt=r4;var i4={fill:"#000"},n4=2,vce={style:Ye({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Dp.style)},f4=function(r){qt(e,r);function e(t){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=i4,i.attr(t),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var i=this._children[t];i.zlevel=this.zlevel,i.z=this.z,i.z2=this.z2,i.culling=this.culling,i.cursor=this.cursor,i.invisible=this.invisible}},e.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):r.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(t){var i=this.innerTransformable;return i?i.getLocalTransform(t):r.prototype.getLocalTransform.call(this,t)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),r.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,_ce(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(t){r.prototype.addSelfToZr.call(this,t);for(var i=0;i<this._children.length;i++)this._children[i].__zr=t},e.prototype.removeSelfFromZr=function(t){r.prototype.removeSelfFromZr.call(this,t);for(var i=0;i<this._children.length;i++)this._children[i].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new ht(0,0,0,0),i=this._children,n=[],a=null,o=0;o<i.length;o++){var s=i[o],l=s.getBoundingRect(),u=s.getLocalTransform(n);u?(t.copy(l),t.applyTransform(u),a=a||t.clone(),a.union(t)):(a=a||l.clone(),a.union(l))}this._rect=a||t}return this._rect},e.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||i4},e.prototype.setTextContent=function(t){},e.prototype._mergeStyle=function(t,i){if(!i)return t;var n=i.rich,a=t.rich||n&&{};return he(t,i),n&&a?(this._mergeRich(a,n),t.rich=a):a&&(t.rich=a),t},e.prototype._mergeRich=function(t,i){for(var n=At(i),a=0;a<n.length;a++){var o=n[a];t[o]=t[o]||{},he(t[o],i[o])}},e.prototype.getAnimationStyleProps=function(){return vce},e.prototype._getOrCreateChild=function(t){var i=this._children[this._childCursor];return(!i||!(i instanceof t))&&(i=new t),this._children[this._childCursor++]=i,i.__zr=this.__zr,i.parent=this,i},e.prototype._updatePlainTexts=function(){var t=this.style,i=t.font||Jo,n=t.padding,a=h4(t),o=UH(a,t),s=sD(t),l=!!t.backgroundColor,u=o.outerHeight,c=o.outerWidth,h=o.contentWidth,f=o.lines,p=o.lineHeight,d=this._defaultStyle,g=t.x||0,m=t.y||0,v=t.align||d.align||"left",_=t.verticalAlign||d.verticalAlign||"top",y=g,x=Ap(m,o.contentHeight,_);if(s||n){var M=Wm(g,c,v),S=Ap(m,u,_);s&&this._renderBackground(t,t,M,S,c,u)}x+=p/2,n&&(y=c4(g,v,n),_==="top"?x+=n[0]:_==="bottom"&&(x-=n[2]));for(var w=0,T=!1,C=u4("fill"in t?t.fill:(T=!0,d.fill)),b=l4("stroke"in t?t.stroke:!l&&(!d.autoStroke||T)?(w=n4,d.stroke):null),E=t.textShadowBlur>0,I=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),R=o.calculatedLineHeight,A=0;A<f.length;A++){var P=this._getOrCreateChild(ac),U=P.createStyle();P.useStyle(U),U.text=f[A],U.x=y,U.y=x,v&&(U.textAlign=v),U.textBaseline="middle",U.opacity=t.opacity,U.strokeFirst=!0,E&&(U.shadowBlur=t.textShadowBlur||0,U.shadowColor=t.textShadowColor||"transparent",U.shadowOffsetX=t.textShadowOffsetX||0,U.shadowOffsetY=t.textShadowOffsetY||0),U.stroke=b,U.fill=C,b&&(U.lineWidth=t.lineWidth||w,U.lineDash=t.lineDash,U.lineDashOffset=t.lineDashOffset||0),U.font=i,o4(U,t),x+=p,I&&P.setBoundingRect(new ht(Wm(U.x,t.width,U.textAlign),Ap(U.y,R,U.textBaseline),h,R))}},e.prototype._updateRichTexts=function(){var t=this.style,i=h4(t),n=OH(i,t),a=n.width,o=n.outerWidth,s=n.outerHeight,l=t.padding,u=t.x||0,c=t.y||0,h=this._defaultStyle,f=t.align||h.align,p=t.verticalAlign||h.verticalAlign,d=Wm(u,o,f),g=Ap(c,s,p),m=d,v=g;l&&(m+=l[3],v+=l[0]);var _=m+a;sD(t)&&this._renderBackground(t,t,d,g,o,s);for(var y=!!t.backgroundColor,x=0;x<n.lines.length;x++){for(var M=n.lines[x],S=M.tokens,w=S.length,T=M.lineHeight,C=M.width,b=0,E=m,I=_,R=w-1,A=void 0;b<w&&(A=S[b],!A.align||A.align==="left");)this._placeToken(A,t,T,v,E,"left",y),C-=A.width,E+=A.width,b++;for(;R>=0&&(A=S[R],A.align==="right");)this._placeToken(A,t,T,v,I,"right",y),C-=A.width,I-=A.width,R--;for(E+=(a-(E-m)-(_-I)-C)/2;b<=R;)A=S[b],this._placeToken(A,t,T,v,E+A.width/2,"center",y),E+=A.width,b++;v+=T}},e.prototype._placeToken=function(t,i,n,a,o,s,l){var u=i.rich[t.styleName]||{};u.text=t.text;var c=t.verticalAlign,h=a+n/2;c==="top"?h=a+t.height/2:c==="bottom"&&(h=a+n-t.height/2);var f=!t.isLineHolder&&sD(u);f&&this._renderBackground(u,i,s==="right"?o-t.width:s==="center"?o-t.width/2:o,h-t.height/2,t.width,t.height);var p=!!u.backgroundColor,d=t.textPadding;d&&(o=c4(o,s,d),h-=t.height/2-d[0]-t.innerHeight/2);var g=this._getOrCreateChild(ac),m=g.createStyle();g.useStyle(m);var v=this._defaultStyle,_=!1,y=0,x=u4("fill"in u?u.fill:"fill"in i?i.fill:(_=!0,v.fill)),M=l4("stroke"in u?u.stroke:"stroke"in i?i.stroke:!p&&!l&&(!v.autoStroke||_)?(y=n4,v.stroke):null),S=u.textShadowBlur>0||i.textShadowBlur>0;m.text=t.text,m.x=o,m.y=h,S&&(m.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,m.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",m.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,m.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),m.textAlign=s,m.textBaseline="middle",m.font=t.font||Jo,m.opacity=qi(u.opacity,i.opacity,1),o4(m,u),M&&(m.lineWidth=qi(u.lineWidth,i.lineWidth,y),m.lineDash=mt(u.lineDash,i.lineDash),m.lineDashOffset=i.lineDashOffset||0,m.stroke=M),x&&(m.fill=x);var w=t.contentWidth,T=t.contentHeight;g.setBoundingRect(new ht(Wm(m.x,w,m.textAlign),Ap(m.y,T,m.textBaseline),w,T))},e.prototype._renderBackground=function(t,i,n,a,o,s){var l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,h=l&&l.image,f=l&&!h,p=t.borderRadius,d=this,g,m;if(f||t.lineHeight||u&&c){g=this._getOrCreateChild(Rt),g.useStyle(g.createStyle()),g.style.fill=null;var v=g.shape;v.x=n,v.y=a,v.width=o,v.height=s,v.r=p,g.dirtyShape()}if(f){var _=g.style;_.fill=l||null,_.fillOpacity=mt(t.fillOpacity,1)}else if(h){m=this._getOrCreateChild(Br),m.onload=function(){d.dirtyStyle()};var y=m.style;y.image=l.image,y.x=n,y.y=a,y.width=o,y.height=s}if(u&&c){var _=g.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=mt(t.strokeOpacity,1),_.lineDash=t.borderDash,_.lineDashOffset=t.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var x=(g||m).style;x.shadowBlur=t.shadowBlur||0,x.shadowColor=t.shadowColor||"transparent",x.shadowOffsetX=t.shadowOffsetX||0,x.shadowOffsetY=t.shadowOffsetY||0,x.opacity=qi(t.opacity,i.opacity,1)},e.makeFont=function(t){var i="";return uD(t)&&(i=[t.fontStyle,t.fontWeight,lD(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),i&&Zi(i)||t.textFont||t.font},e}(Si),gce={left:!0,right:1,center:1},yce={top:1,bottom:1,middle:1},a4=["fontStyle","fontWeight","fontSize","fontFamily"];function lD(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?Vb+"px":r+"px"}function o4(r,e){for(var t=0;t<a4.length;t++){var i=a4[t],n=e[i];n!=null&&(r[i]=n)}}function uD(r){return r.fontSize!=null||r.fontFamily||r.fontWeight}function _ce(r){return s4(r),N(r.rich,s4),r}function s4(r){if(r){r.font=f4.makeFont(r);var e=r.align;e==="middle"&&(e="center"),r.align=e==null||gce[e]?e:"left";var t=r.verticalAlign;t==="center"&&(t="middle"),r.verticalAlign=t==null||yce[t]?t:"top";var i=r.padding;i&&(r.padding=Pm(r.padding))}}function l4(r,e){return r==null||e<=0||r==="transparent"||r==="none"?null:r.image||r.colorStops?"#000":r}function u4(r){return r==null||r==="none"?null:r.image||r.colorStops?"#000":r}function c4(r,e,t){return e==="right"?r-t[1]:e==="center"?r+t[3]/2-t[1]/2:r+t[3]}function h4(r){var e=r.text;return e!=null&&(e+=""),e}function sD(r){return!!(r.backgroundColor||r.lineHeight||r.borderWidth&&r.borderColor)}var It=f4;var it=xt(),j_=function(r,e,t,i){if(i){var n=it(i);n.dataIndex=t,n.dataType=e,n.seriesIndex=r,n.ssrType="chart",i.type==="group"&&i.traverse(function(a){var o=it(a);o.seriesIndex=r,o.dataIndex=t,o.dataType=e,o.ssrType="chart"})}};var p4=1,d4={},_4=xt(),fD=xt(),pD=0,Bp=1,K_=2,Vi=["emphasis","blur","select"],Lh=["normal","emphasis","blur","select"],oc=10,xce=9,Dh="highlight",J_="downplay",nv="select",$_="unselect",av="toggleSelect";function iv(r){return r!=null&&r!=="none"}function Vw(r,e,t){r.onHoverStateChange&&(r.hoverState||0)!==t&&r.onHoverStateChange(e),r.hoverState=t}function x4(r){Vw(r,"emphasis",K_)}function S4(r){r.hoverState===K_&&Vw(r,"normal",pD)}function dD(r){Vw(r,"blur",Bp)}function M4(r){r.hoverState===Bp&&Vw(r,"normal",pD)}function Sce(r){r.selected=!0}function Mce(r){r.selected=!1}function m4(r,e,t){e(r,t)}function sc(r,e,t){m4(r,e,t),r.isGroup&&r.traverse(function(i){m4(i,e,t)})}function kp(r,e){switch(e){case"emphasis":r.hoverState=K_;break;case"normal":r.hoverState=pD;break;case"blur":r.hoverState=Bp;break;case"select":r.selected=!0}}function bce(r,e,t,i){for(var n=r.style,a={},o=0;o<e.length;o++){var s=e[o],l=n[s];a[s]=l??(i&&i[s])}for(var o=0;o<r.animators.length;o++){var u=r.animators[o];u.__fromStateTransition&&u.__fromStateTransition.indexOf(t)<0&&u.targetName==="style"&&u.saveTo(a,e)}return a}function wce(r,e,t,i){var n=t&&yt(t,"select")>=0,a=!1;if(r instanceof pt){var o=_4(r),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(iv(s)||iv(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=he({},i),u=he({},u),u.fill=s):!iv(u.fill)&&iv(s)?(a=!0,i=he({},i),u=he({},u),u.fill=L_(s)):!iv(u.stroke)&&iv(l)&&(a||(i=he({},i),u=he({},u)),u.stroke=L_(l)),i.style=u}}if(i&&i.z2==null){a||(i=he({},i));var c=r.z2EmphasisLift;i.z2=r.z2+(c??oc)}return i}function Tce(r,e,t){if(t&&t.z2==null){t=he({},t);var i=r.z2SelectLift;t.z2=r.z2+(i??xce)}return t}function Ece(r,e,t){var i=yt(r.currentStates,e)>=0,n=r.style.opacity,a=i?null:bce(r,["opacity"],e,{opacity:1});t=t||{};var o=t.style||{};return o.opacity==null&&(t=he({},t),o=he({opacity:i?n:a.opacity*.1},o),t.style=o),t}function cD(r,e){var t=this.states[r];if(this.style){if(r==="emphasis")return wce(this,r,e,t);if(r==="blur")return Ece(this,r,t);if(r==="select")return Tce(this,r,t)}return t}function Ml(r){r.stateProxy=cD;var e=r.getTextContent(),t=r.getTextGuideLine();e&&(e.stateProxy=cD),t&&(t.stateProxy=cD)}function v4(r,e){!b4(r,e)&&!r.__highByOuter&&sc(r,x4)}function g4(r,e){!b4(r,e)&&!r.__highByOuter&&sc(r,S4)}function Zn(r,e){r.__highByOuter|=1<<(e||0),sc(r,x4)}function jn(r,e){!(r.__highByOuter&=~(1<<(e||0)))&&sc(r,S4)}function Gw(r){sc(r,dD)}function Q_(r){sc(r,M4)}function mD(r){sc(r,Sce)}function vD(r){sc(r,Mce)}function b4(r,e){return r.__highDownSilentOnTouch&&e.zrByTouch}function gD(r){var e=r.getModel(),t=[],i=[];e.eachComponent(function(n,a){var o=fD(a),s=n==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){M4(u)}),s&&t.push(a)),o.isBlured=!1}),N(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(t,!1,e)})}function hD(r,e,t,i){var n=i.getModel();t=t||"coordinateSystem";function a(u,c){for(var h=0;h<c.length;h++){var f=u.getItemGraphicEl(c[h]);f&&Q_(f)}}if(r!=null&&!(!e||e==="none")){var o=n.getSeriesByIndex(r),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];n.eachSeries(function(u){var c=o===u,h=u.coordinateSystem;h&&h.master&&(h=h.master);var f=h&&s?h===s:c;if(!(t==="series"&&!c||t==="coordinateSystem"&&!f||e==="series"&&c)){var p=i.getViewOfSeriesModel(u);if(p.group.traverse(function(m){m.__highByOuter&&c&&e==="self"||dD(m)}),di(e))a(u.getData(),e);else if(qe(e))for(var d=At(e),g=0;g<d.length;g++)a(u.getData(d[g]),e[d[g]]);l.push(u),fD(u).isBlured=!0}}),n.eachComponent(function(u,c){if(u!=="series"){var h=i.getViewOfComponentModel(c);h&&h.toggleBlurSeries&&h.toggleBlurSeries(l,!0,n)}})}}function kw(r,e,t){if(!(r==null||e==null)){var i=t.getModel().getComponent(r,e);if(i){fD(i).isBlured=!0;var n=t.getViewOfComponentModel(i);!n||!n.focusBlurEnabled||n.group.traverse(function(a){dD(a)})}}}function w4(r,e,t){var i=r.seriesIndex,n=r.getData(e.dataType);if(n){var a=Us(n,e);a=(pe(a)?a[0]:a)||0;var o=n.getItemGraphicEl(a);if(!o)for(var s=n.count(),l=0;!o&&l<s;)o=n.getItemGraphicEl(l++);if(o){var u=it(o);hD(i,u.focus,u.blurScope,t)}else{var c=r.get(["emphasis","focus"]),h=r.get(["emphasis","blurScope"]);c!=null&&hD(i,c,h,t)}}}function Hw(r,e,t,i){var n={focusSelf:!1,dispatchers:null};if(r==null||r==="series"||e==null||t==null)return n;var a=i.getModel().getComponent(r,e);if(!a)return n;var o=i.getViewOfComponentModel(a);if(!o||!o.findHighDownDispatchers)return n;for(var s=o.findHighDownDispatchers(t),l,u=0;u<s.length;u++)if(it(s[u]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function T4(r,e,t){var i=it(r),n=Hw(i.componentMainType,i.componentIndex,i.componentHighDownName,t),a=n.dispatchers,o=n.focusSelf;a?(o&&kw(i.componentMainType,i.componentIndex,t),N(a,function(s){return v4(s,e)})):(hD(i.seriesIndex,i.focus,i.blurScope,t),i.focus==="self"&&kw(i.componentMainType,i.componentIndex,t),v4(r,e))}function E4(r,e,t){gD(t);var i=it(r),n=Hw(i.componentMainType,i.componentIndex,i.componentHighDownName,t).dispatchers;n?N(n,function(a){return g4(a,e)}):g4(r,e)}function A4(r,e,t){if(Xw(e)){var i=e.dataType,n=r.getData(i),a=Us(n,e);pe(a)||(a=[a]),r[e.type===av?"toggleSelect":e.type===nv?"select":"unselect"](a,i)}}function yD(r){var e=r.getAllData();N(e,function(t){var i=t.data,n=t.type;i.eachItemGraphicEl(function(a,o){r.isSelected(o,n)?mD(a):vD(a)})})}function C4(r){var e=[];return r.eachSeries(function(t){var i=t.getAllData();N(i,function(n){var a=n.data,o=n.type,s=t.getSelectedDataIndices();if(s.length>0){var l={dataIndex:s,seriesIndex:t.seriesIndex};o!=null&&(l.dataType=o),e.push(l)}})}),e}function yu(r,e,t){lc(r,!0),sc(r,Ml),Ww(r,e,t)}function Ace(r){lc(r,!1)}function sr(r,e,t,i){i?Ace(r):yu(r,e,t)}function Ww(r,e,t){var i=it(r);e!=null?(i.focus=e,i.blurScope=t):i.focus&&(i.focus=null)}var y4=["emphasis","blur","select"],Cce={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Yr(r,e,t,i){t=t||"itemStyle";for(var n=0;n<y4.length;n++){var a=y4[n],o=e.getModel([a,t]),s=r.ensureState(a);s.style=i?i(o):o[Cce[t]]()}}function lc(r,e){var t=e===!1,i=r;r.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=r.highDownSilentOnTouch),(!t||i.__highDownDispatcher)&&(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!t)}function Ph(r){return!!(r&&r.__highDownDispatcher)}function R4(r,e,t){var i=it(r);i.componentMainType=e.mainType,i.componentIndex=e.componentIndex,i.componentHighDownName=t}function L4(r){var e=d4[r];return e==null&&p4<=32&&(e=d4[r]=p4++),e}function Xw(r){var e=r.type;return e===nv||e===$_||e===av}function _D(r){var e=r.type;return e===Dh||e===J_}function D4(r){var e=_4(r);e.normalFill=r.style.fill,e.normalStroke=r.style.stroke;var t=r.states.select||{};e.selectFill=t.style&&t.style.fill||null,e.selectStroke=t.style&&t.style.stroke||null}var Pt={};UL(Pt,{Arc:()=>nx,BezierCurve:()=>Hp,BoundingRect:()=>ht,Circle:()=>ga,CompoundPath:()=>uv,Ellipse:()=>tx,Group:()=>Ze,Image:()=>Br,IncrementalDisplayable:()=>t5,Line:()=>ei,LinearGradient:()=>xu,OrientedBoundingRect:()=>cv,Path:()=>pt,Point:()=>zt,Polygon:()=>ai,Polyline:()=>ri,RadialGradient:()=>Qw,Rect:()=>Rt,Ring:()=>Gp,Sector:()=>Mi,Text:()=>It,applyTransform:()=>Ln,clipPointsByRect:()=>CD,clipRectByRect:()=>she,createIcon:()=>pc,extendPath:()=>nhe,extendShape:()=>rhe,getShapeClass:()=>ax,getTransform:()=>Tl,groupTransition:()=>fc,initProps:()=>lr,isElementRemoved:()=>uc,lineLineIntersect:()=>u5,linePolygonIntersect:()=>fv,makeImage:()=>AD,makePath:()=>hv,mergePath:()=>Jn,registerShape:()=>wl,removeElement:()=>Fs,removeElementWithFadeOut:()=>cc,resizePath:()=>l5,setTooltipConfig:()=>El,subPixelOptimize:()=>ox,subPixelOptimizeLine:()=>hc,subPixelOptimizeRect:()=>ahe,transformDirection:()=>Yp,traverseElements:()=>ya,updateProps:()=>Ut});var ov=$i.CMD,Rce=[[],[],[]],P4=Math.sqrt,Lce=Math.atan2;function Yw(r,e){if(e){var t=r.data,i=r.len(),n,a,o,s,l,u,c=ov.M,h=ov.C,f=ov.L,p=ov.R,d=ov.A,g=ov.Q;for(o=0,s=0;o<i;){switch(n=t[o++],s=o,a=0,n){case c:a=1;break;case f:a=1;break;case h:a=3;break;case g:a=2;break;case d:var m=e[4],v=e[5],_=P4(e[0]*e[0]+e[1]*e[1]),y=P4(e[2]*e[2]+e[3]*e[3]),x=Lce(-e[1]/y,e[0]/_);t[o]*=_,t[o++]+=m,t[o]*=y,t[o++]+=v,t[o++]*=_,t[o++]*=y,t[o++]+=x,t[o++]+=x,o+=2,s=o;break;case p:u[0]=t[o++],u[1]=t[o++],mi(u,u,e),t[s++]=u[0],t[s++]=u[1],u[0]+=t[o++],u[1]+=t[o++],mi(u,u,e),t[s++]=u[0],t[s++]=u[1]}for(l=0;l<a;l++){var M=Rce[l];M[0]=t[o++],M[1]=t[o++],mi(M,M,e),t[s++]=M[0],t[s++]=M[1]}}r.increaseVersion()}}var xD=Math.sqrt,qw=Math.sin,Zw=Math.cos,ex=Math.PI;function I4(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function SD(r,e){return(r[0]*e[0]+r[1]*e[1])/(I4(r)*I4(e))}function N4(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(SD(r,e))}function U4(r,e,t,i,n,a,o,s,l,u,c){var h=l*(ex/180),f=Zw(h)*(r-t)/2+qw(h)*(e-i)/2,p=-1*qw(h)*(r-t)/2+Zw(h)*(e-i)/2,d=f*f/(o*o)+p*p/(s*s);d>1&&(o*=xD(d),s*=xD(d));var g=(n===a?-1:1)*xD((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,m=g*o*p/s,v=g*-s*f/o,_=(r+t)/2+Zw(h)*m-qw(h)*v,y=(e+i)/2+qw(h)*m+Zw(h)*v,x=N4([1,0],[(f-m)/o,(p-v)/s]),M=[(f-m)/o,(p-v)/s],S=[(-1*f-m)/o,(-1*p-v)/s],w=N4(M,S);if(SD(M,S)<=-1&&(w=ex),SD(M,S)>=1&&(w=0),w<0){var T=Math.round(w/ex*1e6)/1e6;w=ex*2+T%2*ex}c.addData(u,_,y,o,s,x,w,h,a)}var Dce=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Pce=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Ice(r){var e=new $i;if(!r)return e;var t=0,i=0,n=t,a=i,o,s=$i.CMD,l=r.match(Dce);if(!l)return e;for(var u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),f=void 0,p=c.match(Pce)||[],d=p.length,g=0;g<d;g++)p[g]=parseFloat(p[g]);for(var m=0;m<d;){var v=void 0,_=void 0,y=void 0,x=void 0,M=void 0,S=void 0,w=void 0,T=t,C=i,b=void 0,E=void 0;switch(h){case"l":t+=p[m++],i+=p[m++],f=s.L,e.addData(f,t,i);break;case"L":t=p[m++],i=p[m++],f=s.L,e.addData(f,t,i);break;case"m":t+=p[m++],i+=p[m++],f=s.M,e.addData(f,t,i),n=t,a=i,h="l";break;case"M":t=p[m++],i=p[m++],f=s.M,e.addData(f,t,i),n=t,a=i,h="L";break;case"h":t+=p[m++],f=s.L,e.addData(f,t,i);break;case"H":t=p[m++],f=s.L,e.addData(f,t,i);break;case"v":i+=p[m++],f=s.L,e.addData(f,t,i);break;case"V":i=p[m++],f=s.L,e.addData(f,t,i);break;case"C":f=s.C,e.addData(f,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),t=p[m-2],i=p[m-1];break;case"c":f=s.C,e.addData(f,p[m++]+t,p[m++]+i,p[m++]+t,p[m++]+i,p[m++]+t,p[m++]+i),t+=p[m-2],i+=p[m-1];break;case"S":v=t,_=i,b=e.len(),E=e.data,o===s.C&&(v+=t-E[b-4],_+=i-E[b-3]),f=s.C,T=p[m++],C=p[m++],t=p[m++],i=p[m++],e.addData(f,v,_,T,C,t,i);break;case"s":v=t,_=i,b=e.len(),E=e.data,o===s.C&&(v+=t-E[b-4],_+=i-E[b-3]),f=s.C,T=t+p[m++],C=i+p[m++],t+=p[m++],i+=p[m++],e.addData(f,v,_,T,C,t,i);break;case"Q":T=p[m++],C=p[m++],t=p[m++],i=p[m++],f=s.Q,e.addData(f,T,C,t,i);break;case"q":T=p[m++]+t,C=p[m++]+i,t+=p[m++],i+=p[m++],f=s.Q,e.addData(f,T,C,t,i);break;case"T":v=t,_=i,b=e.len(),E=e.data,o===s.Q&&(v+=t-E[b-4],_+=i-E[b-3]),t=p[m++],i=p[m++],f=s.Q,e.addData(f,v,_,t,i);break;case"t":v=t,_=i,b=e.len(),E=e.data,o===s.Q&&(v+=t-E[b-4],_+=i-E[b-3]),t+=p[m++],i+=p[m++],f=s.Q,e.addData(f,v,_,t,i);break;case"A":y=p[m++],x=p[m++],M=p[m++],S=p[m++],w=p[m++],T=t,C=i,t=p[m++],i=p[m++],f=s.A,U4(T,C,t,i,S,w,y,x,M,f,e);break;case"a":y=p[m++],x=p[m++],M=p[m++],S=p[m++],w=p[m++],T=t,C=i,t+=p[m++],i+=p[m++],f=s.A,U4(T,C,t,i,S,w,y,x,M,f,e);break}}(h==="z"||h==="Z")&&(f=s.Z,e.addData(f),t=n,i=a),o=f}return e.toStatic(),e}var O4=function(r){qt(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.applyTransform=function(t){},e}(pt);function z4(r){return r.setData!=null}function F4(r,e){var t=Ice(r),i=he({},e);return i.buildPath=function(n){if(z4(n)){n.setData(t.data);var a=n.getContext();a&&n.rebuildPath(a,1)}else{var a=n;t.rebuildPath(a,1)}},i.applyTransform=function(n){Yw(t,n),this.dirtyShape()},i}function jw(r,e){return new O4(F4(r,e))}function B4(r,e){var t=F4(r,e),i=function(n){qt(a,n);function a(o){var s=n.call(this,o)||this;return s.applyTransform=t.applyTransform,s.buildPath=t.buildPath,s}return a}(O4);return i}function k4(r,e){for(var t=[],i=r.length,n=0;n<i;n++){var a=r[n];t.push(a.getUpdatedPathProxy(!0))}var o=new pt(e);return o.createPathProxy(),o.buildPath=function(s){if(z4(s)){s.appendPath(t);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}function sv(r,e){e=e||{};var t=new pt;return r.shape&&t.setShape(r.shape),t.setStyle(r.style),e.bakeTransform?Yw(t.path,r.getComputedTransform()):e.toLocal?t.setLocalTransform(r.getComputedTransform()):t.copyTransform(r),t.buildPath=r.buildPath,t.applyTransform=t.applyTransform,t.z=r.z,t.z2=r.z2,t.zlevel=r.zlevel,t}var Uce=function(){function r(){this.cx=0,this.cy=0,this.r=0}return r}();var V4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Uce},e.prototype.buildPath=function(t,i){t.moveTo(i.cx+i.r,i.cy),t.arc(i.cx,i.cy,i.r,0,Math.PI*2)},e}(pt);V4.prototype.type="circle";var ga=V4;var Oce=function(){function r(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return r}();var G4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Oce},e.prototype.buildPath=function(t,i){var n=.5522848,a=i.cx,o=i.cy,s=i.rx,l=i.ry,u=s*n,c=l*n;t.moveTo(a-s,o),t.bezierCurveTo(a-s,o-c,a-u,o-l,a,o-l),t.bezierCurveTo(a+u,o-l,a+s,o-c,a+s,o),t.bezierCurveTo(a+s,o+c,a+u,o+l,a,o+l),t.bezierCurveTo(a-u,o+l,a-s,o+c,a-s,o),t.closePath()},e}(pt);G4.prototype.type="ellipse";var tx=G4;var W4=Math.PI,MD=W4*2,Vp=Math.sin,lv=Math.cos,zce=Math.acos,Kn=Math.atan2,H4=Math.abs,ix=Math.sqrt,rx=Math.max,_u=Math.min,bl=1e-4;function Fce(r,e,t,i,n,a,o,s){var l=t-r,u=i-e,c=o-n,h=s-a,f=h*l-c*u;if(!(f*f<bl))return f=(c*(e-a)-h*(r-n))/f,[r+f*l,e+f*u]}function Kw(r,e,t,i,n,a,o){var s=r-t,l=e-i,u=(o?a:-a)/ix(s*s+l*l),c=u*l,h=-u*s,f=r+c,p=e+h,d=t+c,g=i+h,m=(f+d)/2,v=(p+g)/2,_=d-f,y=g-p,x=_*_+y*y,M=n-a,S=f*g-d*p,w=(y<0?-1:1)*ix(rx(0,M*M*x-S*S)),T=(S*y-_*w)/x,C=(-S*_-y*w)/x,b=(S*y+_*w)/x,E=(-S*_+y*w)/x,I=T-m,R=C-v,A=b-m,P=E-v;return I*I+R*R>A*A+P*P&&(T=b,C=E),{cx:T,cy:C,x0:-c,y0:-h,x1:T*(n/M-1),y1:C*(n/M-1)}}function Bce(r){var e;if(pe(r)){var t=r.length;if(!t)return r;t===1?e=[r[0],r[0],0,0]:t===2?e=[r[0],r[0],r[1],r[1]]:t===3?e=r.concat(r[2]):e=r}else e=[r,r,r,r];return e}function X4(r,e){var t,i=rx(e.r,0),n=rx(e.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var c=e.cx,h=e.cy,f=!!e.clockwise,p=H4(u-l),d=p>MD&&p%MD;if(d>bl&&(p=d),!(i>bl))r.moveTo(c,h);else if(p>MD-bl)r.moveTo(c+i*lv(l),h+i*Vp(l)),r.arc(c,h,i,l,u,!f),n>bl&&(r.moveTo(c+n*lv(u),h+n*Vp(u)),r.arc(c,h,n,u,l,f));else{var g=void 0,m=void 0,v=void 0,_=void 0,y=void 0,x=void 0,M=void 0,S=void 0,w=void 0,T=void 0,C=void 0,b=void 0,E=void 0,I=void 0,R=void 0,A=void 0,P=i*lv(l),U=i*Vp(l),B=n*lv(u),z=n*Vp(u),k=p>bl;if(k){var G=e.cornerRadius;G&&(t=Bce(G),g=t[0],m=t[1],v=t[2],_=t[3]);var Y=H4(i-n)/2;if(y=_u(Y,v),x=_u(Y,_),M=_u(Y,g),S=_u(Y,m),C=w=rx(y,x),b=T=rx(M,S),(w>bl||T>bl)&&(E=i*lv(u),I=i*Vp(u),R=n*lv(l),A=n*Vp(l),p<W4)){var J=Fce(P,U,R,A,E,I,B,z);if(J){var Q=P-J[0],V=U-J[1],K=E-J[0],ae=I-J[1],ve=1/Vp(zce((Q*K+V*ae)/(ix(Q*Q+V*V)*ix(K*K+ae*ae)))/2),ue=ix(J[0]*J[0]+J[1]*J[1]);C=_u(w,(i-ue)/(ve+1)),b=_u(T,(n-ue)/(ve-1))}}}if(!k)r.moveTo(c+P,h+U);else if(C>bl){var se=_u(v,C),Ee=_u(_,C),q=Kw(R,A,P,U,i,se,f),H=Kw(E,I,B,z,i,Ee,f);r.moveTo(c+q.cx+q.x0,h+q.cy+q.y0),C<w&&se===Ee?r.arc(c+q.cx,h+q.cy,C,Kn(q.y0,q.x0),Kn(H.y0,H.x0),!f):(se>0&&r.arc(c+q.cx,h+q.cy,se,Kn(q.y0,q.x0),Kn(q.y1,q.x1),!f),r.arc(c,h,i,Kn(q.cy+q.y1,q.cx+q.x1),Kn(H.cy+H.y1,H.cx+H.x1),!f),Ee>0&&r.arc(c+H.cx,h+H.cy,Ee,Kn(H.y1,H.x1),Kn(H.y0,H.x0),!f))}else r.moveTo(c+P,h+U),r.arc(c,h,i,l,u,!f);if(!(n>bl)||!k)r.lineTo(c+B,h+z);else if(b>bl){var se=_u(g,b),Ee=_u(m,b),q=Kw(B,z,E,I,n,-Ee,f),H=Kw(P,U,R,A,n,-se,f);r.lineTo(c+q.cx+q.x0,h+q.cy+q.y0),b<T&&se===Ee?r.arc(c+q.cx,h+q.cy,b,Kn(q.y0,q.x0),Kn(H.y0,H.x0),!f):(Ee>0&&r.arc(c+q.cx,h+q.cy,Ee,Kn(q.y0,q.x0),Kn(q.y1,q.x1),!f),r.arc(c,h,n,Kn(q.cy+q.y1,q.cx+q.x1),Kn(H.cy+H.y1,H.cx+H.x1),f),se>0&&r.arc(c+H.cx,h+H.cy,se,Kn(H.y1,H.x1),Kn(H.y0,H.x0),!f))}else r.lineTo(c+B,h+z),r.arc(c,h,n,u,l,f)}r.closePath()}}}var Vce=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}();var Y4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Vce},e.prototype.buildPath=function(t,i){X4(t,i)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(pt);Y4.prototype.type="sector";var Mi=Y4;var Gce=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}();var q4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Gce},e.prototype.buildPath=function(t,i){var n=i.cx,a=i.cy,o=Math.PI*2;t.moveTo(n+i.r,a),t.arc(n,a,i.r,0,o,!1),t.moveTo(n+i.r0,a),t.arc(n,a,i.r0,0,o,!0)},e}(pt);q4.prototype.type="ring";var Gp=q4;function bD(r,e,t,i){var n=[],a=[],o=[],s=[],l,u,c,h;if(i){c=[1/0,1/0],h=[-1/0,-1/0];for(var f=0,p=r.length;f<p;f++)$o(c,c,r[f]),Qo(h,h,r[f]);$o(c,c,i[0]),Qo(h,h,i[1])}for(var f=0,p=r.length;f<p;f++){var d=r[f];if(t)l=r[f?f-1:p-1],u=r[(f+1)%p];else if(f===0||f===p-1){n.push(ho(r[f]));continue}else l=r[f-1],u=r[f+1];yl(a,u,l),Nm(a,a,e);var g=Zb(d,l),m=Zb(d,u),v=g+m;v!==0&&(g/=v,m/=v),Nm(o,a,-g),Nm(s,a,m);var _=t2([],d,o),y=t2([],d,s);i&&(Qo(_,_,c),$o(_,_,h),Qo(y,y,c),$o(y,y,h)),n.push(_),n.push(y)}return t&&n.push(n.shift()),n}function Jw(r,e,t){var i=e.smooth,n=e.points;if(n&&n.length>=2){if(i){var a=bD(n,i,t,e.smoothConstraint);r.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(t?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=n[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{r.moveTo(n[0][0],n[0][1]);for(var s=1,h=n.length;s<h;s++)r.lineTo(n[s][0],n[s][1])}t&&r.closePath()}}var Hce=function(){function r(){this.points=null,this.smooth=0,this.smoothConstraint=null}return r}();var j4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Hce},e.prototype.buildPath=function(t,i){Jw(t,i,!0)},e}(pt);j4.prototype.type="polygon";var ai=j4;var Wce=function(){function r(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return r}();var K4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Wce},e.prototype.buildPath=function(t,i){Jw(t,i,!1)},e}(pt);K4.prototype.type="polyline";var ri=K4;var Xce={},Yce=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return r}();var J4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Yce},e.prototype.buildPath=function(t,i){var n,a,o,s;if(this.subPixelOptimize){var l=Fw(Xce,i,this.style);n=l.x1,a=l.y1,o=l.x2,s=l.y2}else n=i.x1,a=i.y1,o=i.x2,s=i.y2;var u=i.percent;u!==0&&(t.moveTo(n,a),u<1&&(o=n*(1-u)+o*u,s=a*(1-u)+s*u),t.lineTo(o,s))},e.prototype.pointAt=function(t){var i=this.shape;return[i.x1*(1-t)+i.x2*t,i.y1*(1-t)+i.y2*t]},e}(pt);J4.prototype.type="line";var ei=J4;var To=[],qce=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return r}();function $4(r,e,t){var i=r.cpx2,n=r.cpy2;return i!=null||n!=null?[(t?p2:vi)(r.x1,r.cpx1,r.cpx2,r.x2,e),(t?p2:vi)(r.y1,r.cpy1,r.cpy2,r.y2,e)]:[(t?A_:xi)(r.x1,r.cpx1,r.x2,e),(t?A_:xi)(r.y1,r.cpy1,r.y2,e)]}var Q4=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new qce},e.prototype.buildPath=function(t,i){var n=i.x1,a=i.y1,o=i.x2,s=i.y2,l=i.cpx1,u=i.cpy1,c=i.cpx2,h=i.cpy2,f=i.percent;f!==0&&(t.moveTo(n,a),c==null||h==null?(f<1&&(xh(n,l,o,f,To),l=To[1],o=To[2],xh(a,u,s,f,To),u=To[1],s=To[2]),t.quadraticCurveTo(l,u,o,s)):(f<1&&(Ps(n,l,c,o,f,To),l=To[1],c=To[2],o=To[3],Ps(a,u,h,s,f,To),u=To[1],h=To[2],s=To[3]),t.bezierCurveTo(l,u,c,h,o,s)))},e.prototype.pointAt=function(t){return $4(this.shape,t,!1)},e.prototype.tangentAt=function(t){var i=$4(this.shape,t,!0);return Cs(i,i)},e}(pt);Q4.prototype.type="bezier-curve";var Hp=Q4;var Zce=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}();var e5=function(r){qt(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Zce},e.prototype.buildPath=function(t,i){var n=i.cx,a=i.cy,o=Math.max(i.r,0),s=i.startAngle,l=i.endAngle,u=i.clockwise,c=Math.cos(s),h=Math.sin(s);t.moveTo(c*o+n,h*o+a),t.arc(n,a,o,s,l,!u)},e}(pt);e5.prototype.type="arc";var nx=e5;var jce=function(r){qt(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="compound",t}return e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,i=this.shapeChanged(),n=0;n<t.length;n++)i=i||t[n].shapeChanged();i&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],i=this.getGlobalScale(),n=0;n<t.length;n++)t[n].path||t[n].createPathProxy(),t[n].path.setScale(i[0],i[1],t[n].segmentIgnoreThreshold)},e.prototype.buildPath=function(t,i){for(var n=i.paths||[],a=0;a<n.length;a++)n[a].buildPath(t,n[a].shape,!0)},e.prototype.afterBrush=function(){for(var t=this.shape.paths||[],i=0;i<t.length;i++)t[i].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),pt.prototype.getBoundingRect.call(this)},e}(pt),uv=jce;var Kce=function(){function r(e){this.colorStops=e||[]}return r.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},r}(),$w=Kce;var Jce=function(r){qt(e,r);function e(t,i,n,a,o,s){var l=r.call(this,o)||this;return l.x=t??0,l.y=i??0,l.x2=n??1,l.y2=a??0,l.type="linear",l.global=s||!1,l}return e}($w),xu=Jce;var $ce=function(r){qt(e,r);function e(t,i,n,a,o){var s=r.call(this,a)||this;return s.x=t??.5,s.y=i??.5,s.r=n??.5,s.type="radial",s.global=o||!1,s}return e}($w),Qw=$ce;var Wp=[0,0],Xp=[0,0],e1=new zt,t1=new zt,Qce=function(){function r(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var i=0;i<4;i++)this._corners[i]=new zt;for(var i=0;i<2;i++)this._axes[i]=new zt;e&&this.fromBoundingRect(e,t)}return r.prototype.fromBoundingRect=function(e,t){var i=this._corners,n=this._axes,a=e.x,o=e.y,s=a+e.width,l=o+e.height;if(i[0].set(a,o),i[1].set(s,o),i[2].set(s,l),i[3].set(a,l),t)for(var u=0;u<4;u++)i[u].transform(t);zt.sub(n[0],i[1],i[0]),zt.sub(n[1],i[3],i[0]),n[0].normalize(),n[1].normalize();for(var u=0;u<2;u++)this._origin[u]=n[u].dot(i[0])},r.prototype.intersect=function(e,t){var i=!0,n=!t;return e1.set(1/0,1/0),t1.set(0,0),!this._intersectCheckOneSide(this,e,e1,t1,n,1)&&(i=!1,n)||!this._intersectCheckOneSide(e,this,e1,t1,n,-1)&&(i=!1,n)||n||zt.copy(t,i?e1:t1),i},r.prototype._intersectCheckOneSide=function(e,t,i,n,a,o){for(var s=!0,l=0;l<2;l++){var u=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,Wp),this._getProjMinMaxOnAxis(l,t._corners,Xp),Wp[1]<Xp[0]||Wp[0]>Xp[1]){if(s=!1,a)return s;var c=Math.abs(Xp[0]-Wp[1]),h=Math.abs(Wp[0]-Xp[1]);Math.min(c,h)>n.len()&&(c<h?zt.scale(n,u,-c*o):zt.scale(n,u,h*o))}else if(i){var c=Math.abs(Xp[0]-Wp[1]),h=Math.abs(Wp[0]-Xp[1]);Math.min(c,h)<i.len()&&(c<h?zt.scale(i,u,c*o):zt.scale(i,u,-h*o))}}return s},r.prototype._getProjMinMaxOnAxis=function(e,t,i){for(var n=this._axes[e],a=this._origin,o=t[0].dot(n)+a[e],s=o,l=o,u=1;u<t.length;u++){var c=t[u].dot(n)+a[e];s=Math.min(c,s),l=Math.max(c,l)}i[0]=s,i[1]=l},r}(),cv=Qce;var ehe=[],the=function(r){qt(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return e.prototype.traverse=function(t,i){t.call(i,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(t,i){i?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},e.prototype.addDisplayables=function(t,i){i=i||!1;for(var n=0;n<t.length;n++)this.addDisplayable(t[n],i)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(t){for(var i=this._cursor;i<this._displayables.length;i++)t&&t(this._displayables[i]);for(var i=0;i<this._temporaryDisplayables.length;i++)t&&t(this._temporaryDisplayables[i])},e.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){var i=this._displayables[t];i.parent=this,i.update(),i.parent=null}for(var t=0;t<this._temporaryDisplayables.length;t++){var i=this._temporaryDisplayables[t];i.parent=this,i.update(),i.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new ht(1/0,1/0,-1/0,-1/0),i=0;i<this._displayables.length;i++){var n=this._displayables[i],a=n.getBoundingRect().clone();n.needLocalTransform()&&a.applyTransform(n.getLocalTransform(ehe)),t.union(a)}this._rect=t}return this._rect},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect();if(a.contain(n[0],n[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(t,i))return!0}return!1},e}(Si),t5=the;var i5=xt();function Su(r,e,t,i,n){var a;if(e&&e.ecModel){var o=e.ecModel.getUpdatePayload();a=o&&o.animation}var s=e&&e.isAnimationEnabled(),l=r==="update";if(s){var u=void 0,c=void 0,h=void 0;i?(u=mt(i.duration,200),c=mt(i.easing,"cubicOut"),h=0):(u=e.getShallow(l?"animationDurationUpdate":"animationDuration"),c=e.getShallow(l?"animationEasingUpdate":"animationEasing"),h=e.getShallow(l?"animationDelayUpdate":"animationDelay")),a&&(a.duration!=null&&(u=a.duration),a.easing!=null&&(c=a.easing),a.delay!=null&&(h=a.delay)),He(h)&&(h=h(t,n)),He(u)&&(u=u(t));var f={duration:u||0,delay:h,easing:c};return f}else return null}function wD(r,e,t,i,n,a,o){var s=!1,l;He(n)?(o=a,a=n,n=null):qe(n)&&(a=n.cb,o=n.during,s=n.isFrom,l=n.removeOpt,n=n.dataIndex);var u=r==="leave";u||e.stopAnimation("leave");var c=Su(r,i,n,u?l||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(e,n):null);if(c&&c.duration>0){var h=c.duration,f=c.delay,p=c.easing,d={duration:h,delay:f||0,easing:p,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?e.animateFrom(t,d):e.animateTo(t,d)}else e.stopAnimation(),!s&&e.attr(t),o&&o(1),a&&a()}function Ut(r,e,t,i,n,a){wD("update",r,e,t,i,n,a)}function lr(r,e,t,i,n,a){wD("enter",r,e,t,i,n,a)}function uc(r){if(!r.__zr)return!0;for(var e=0;e<r.animators.length;e++){var t=r.animators[e];if(t.scope==="leave")return!0}return!1}function Fs(r,e,t,i,n,a){uc(r)||wD("leave",r,e,t,i,n,a)}function r5(r,e,t,i){r.removeTextContent(),r.removeTextGuideLine(),Fs(r,{style:{opacity:0}},e,t,i)}function cc(r,e,t){function i(){r.parent&&r.parent.remove(r)}r.isGroup?r.traverse(function(n){n.isGroup||r5(n,e,t,i)}):r5(r,e,t,i)}function Ui(r){i5(r).oldStyle=r.style}function n5(r){return i5(r).oldStyle}var r1=Math.max,i1=Math.min,ED={};function rhe(r){return pt.extend(r)}var ihe=B4;function nhe(r,e){return ihe(r,e)}function wl(r,e){ED[r]=e}function ax(r){if(ED.hasOwnProperty(r))return ED[r]}function hv(r,e,t,i){var n=jw(r,e);return t&&(i==="center"&&(t=s5(t,n.getBoundingRect())),l5(n,t)),n}function AD(r,e,t){var i=new Br({style:{image:r,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(n){if(t==="center"){var a={width:n.width,height:n.height};i.setStyle(s5(e,a))}}});return i}function s5(r,e){var t=e.width/e.height,i=r.height*t,n;i<=r.width?n=r.height:(i=r.width,n=i/t);var a=r.x+r.width/2,o=r.y+r.height/2;return{x:a-i/2,y:o-n/2,width:i,height:n}}var Jn=k4;function l5(r,e){if(r.applyTransform){var t=r.getBoundingRect(),i=t.calculateTransform(e);r.applyTransform(i)}}function hc(r,e){return Fw(r,r,{lineWidth:e}),r}function ahe(r){return Bw(r.shape,r.shape,r.style),r}var ox=Rh;function Tl(r,e){for(var t=vh([]);r&&r!==e;)mo(t,r.getLocalTransform(),t),r=r.parent;return t}function Ln(r,e,t){return e&&!di(e)&&(e=go.getLocalTransform(e)),t&&(e=Ls([],e)),mi([],r,e)}function Yp(r,e,t){var i=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),n=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),a=[r==="left"?-i:r==="right"?i:0,r==="top"?-n:r==="bottom"?n:0];return a=Ln(a,e,t),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function a5(r){return!r.isGroup}function ohe(r){return r.shape!=null}function fc(r,e,t){if(!r||!e)return;function i(o){var s={};return o.traverse(function(l){a5(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return ohe(o)&&(s.shape=he({},o.shape)),s}var a=i(r);e.traverse(function(o){if(a5(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Ut(o,l,t,it(o).dataIndex)}}})}function CD(r,e){return de(r,function(t){var i=t[0];i=r1(i,e.x),i=i1(i,e.x+e.width);var n=t[1];return n=r1(n,e.y),n=i1(n,e.y+e.height),[i,n]})}function she(r,e){var t=r1(r.x,e.x),i=i1(r.x+r.width,e.x+e.width),n=r1(r.y,e.y),a=i1(r.y+r.height,e.y+e.height);if(i>=t&&a>=n)return{x:t,y:n,width:i-t,height:a-n}}function pc(r,e,t){var i=he({rectHover:!0},e),n=i.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(n.image=r.slice(8),Ye(n,t),new Br(i)):hv(r.replace("path://",""),i,t,"center")}function fv(r,e,t,i,n){for(var a=0,o=n[n.length-1];a<n.length;a++){var s=n[a];if(u5(r,e,t,i,s[0],s[1],o[0],o[1]))return!0;o=s}}function u5(r,e,t,i,n,a,o,s){var l=t-r,u=i-e,c=o-n,h=s-a,f=TD(c,h,l,u);if(lhe(f))return!1;var p=r-n,d=e-a,g=TD(p,d,l,u)/f;if(g<0||g>1)return!1;var m=TD(p,d,c,h)/f;return!(m<0||m>1)}function TD(r,e,t,i){return r*i-t*e}function lhe(r){return r<=1e-6&&r>=-1e-6}function El(r){var e=r.itemTooltipOption,t=r.componentModel,i=r.itemName,n=Ce(e)?{formatter:e}:e,a=t.mainType,o=t.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&N(At(l),function(c){tt(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=it(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:Ye({content:i,formatterParams:s},n)}}function o5(r,e){var t;r.isGroup&&(t=e(r)),t||r.traverse(e)}function ya(r,e){if(r)if(pe(r))for(var t=0;t<r.length;t++)o5(r[t],e);else o5(r,e)}wl("circle",ga);wl("ellipse",tx);wl("sector",Mi);wl("ring",Gp);wl("polygon",ai);wl("polyline",ri);wl("rect",Rt);wl("line",ei);wl("bezierCurve",Hp);wl("arc",nx);var n1={};function d5(r,e){for(var t=0;t<Vi.length;t++){var i=Vi[t],n=e[i],a=r.ensureState(i);a.style=a.style||{},a.style.text=n}var o=r.currentStates.slice();r.clearStates(!0),r.setStyle({text:e.normal}),r.useStates(o,!0)}function RD(r,e,t){var i=r.labelFetcher,n=r.labelDataIndex,a=r.labelDimIndex,o=e.normal,s;i&&(s=i.getFormattedLabel(n,"normal",null,a,o&&o.get("formatter"),t!=null?{interpolatedValue:t}:null)),s==null&&(s=He(r.defaultText)?r.defaultText(n,r,t):r.defaultText);for(var l={normal:s},u=0;u<Vi.length;u++){var c=Vi[u],h=e[c];l[c]=mt(i?i.getFormattedLabel(n,c,null,a,h&&h.get("formatter")):null,s)}return l}function Fr(r,e,t,i){t=t||n1;for(var n=r instanceof It,a=!1,o=0;o<Lh.length;o++){var s=e[Lh[o]];if(s&&s.getShallow("show")){a=!0;break}}var l=n?r:r.getTextContent();if(a){n||(l||(l=new It,r.setTextContent(l)),r.stateProxy&&(l.stateProxy=r.stateProxy));var u=RD(t,e),c=e.normal,h=!!c.getShallow("show"),f=pr(c,i&&i.normal,t,!1,!n);f.text=u.normal,n||r.setTextConfig(sx(c,t,!1));for(var o=0;o<Vi.length;o++){var p=Vi[o],s=e[p];if(s){var d=l.ensureState(p),g=!!mt(s.getShallow("show"),h);if(g!==h&&(d.ignore=!g),d.style=pr(s,i&&i[p],t,!0,!n),d.style.text=u[p],!n){var m=r.ensureState(p);m.textConfig=sx(s,t,!0)}}}l.silent=!!c.getShallow("silent"),l.style.x!=null&&(f.x=l.style.x),l.style.y!=null&&(f.y=l.style.y),l.ignore=!h,l.useStyle(f),l.dirty(),t.enableTextSetter&&(dc(l).setLabelText=function(v){var _=RD(t,e,v);d5(l,_)})}else l&&(l.ignore=!0);r.dirty()}function Rr(r,e){e=e||"label";for(var t={normal:r.getModel(e)},i=0;i<Vi.length;i++){var n=Vi[i];t[n]=r.getModel([n,e])}return t}function pr(r,e,t,i,n){var a={};return uhe(a,r,t,i,n),e&&he(a,e),a}function sx(r,e,t){e=e||{};var i={},n,a=r.getShallow("rotate"),o=mt(r.getShallow("distance"),t?null:5),s=r.getShallow("offset");return n=r.getShallow("position")||(t?null:"inside"),n==="outside"&&(n=e.defaultOutsidePosition||"top"),n!=null&&(i.position=n),s!=null&&(i.offset=s),a!=null&&(a*=Math.PI/180,i.rotation=a),o!=null&&(i.distance=o),i.outsideFill=r.get("color")==="inherit"?e.inheritColor||null:"auto",i}function uhe(r,e,t,i,n){t=t||n1;var a=e.ecModel,o=a&&a.option.textStyle,s=che(e),l;if(s){l={};for(var u in s)if(s.hasOwnProperty(u)){var c=e.getModel(["rich",u]);p5(l[u]={},c,o,t,i,n,!1,!0)}}l&&(r.rich=l);var h=e.get("overflow");h&&(r.overflow=h);var f=e.get("minMargin");f!=null&&(r.margin=f),p5(r,e,o,t,i,n,!0,!1)}function che(r){for(var e;r&&r!==r.ecModel;){var t=(r.option||n1).rich;if(t){e=e||{};for(var i=At(t),n=0;n<i.length;n++){var a=i[n];e[a]=1}}r=r.parentModel}return e}var c5=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],h5=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],f5=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function p5(r,e,t,i,n,a,o,s){t=!n&&t||n1;var l=i&&i.inheritColor,u=e.getShallow("color"),c=e.getShallow("textBorderColor"),h=mt(e.getShallow("opacity"),t.opacity);(u==="inherit"||u==="auto")&&(l?u=l:u=null),(c==="inherit"||c==="auto")&&(l?c=l:c=null),a||(u=u||t.color,c=c||t.textBorderColor),u!=null&&(r.fill=u),c!=null&&(r.stroke=c);var f=mt(e.getShallow("textBorderWidth"),t.textBorderWidth);f!=null&&(r.lineWidth=f);var p=mt(e.getShallow("textBorderType"),t.textBorderType);p!=null&&(r.lineDash=p);var d=mt(e.getShallow("textBorderDashOffset"),t.textBorderDashOffset);d!=null&&(r.lineDashOffset=d),!n&&h==null&&!s&&(h=i&&i.defaultOpacity),h!=null&&(r.opacity=h),!n&&!a&&r.fill==null&&i.inheritColor&&(r.fill=i.inheritColor);for(var g=0;g<c5.length;g++){var m=c5[g],v=mt(e.getShallow(m),t[m]);v!=null&&(r[m]=v)}for(var g=0;g<h5.length;g++){var m=h5[g],v=e.getShallow(m);v!=null&&(r[m]=v)}if(r.verticalAlign==null){var _=e.getShallow("baseline");_!=null&&(r.verticalAlign=_)}if(!o||!i.disableBox){for(var g=0;g<f5.length;g++){var m=f5[g],v=e.getShallow(m);v!=null&&(r[m]=v)}var y=e.getShallow("borderType");y!=null&&(r.borderDash=y),(r.backgroundColor==="auto"||r.backgroundColor==="inherit")&&l&&(r.backgroundColor=l),(r.borderColor==="auto"||r.borderColor==="inherit")&&l&&(r.borderColor=l)}}function pv(r,e){var t=e&&e.getModel("textStyle");return Zi([r.fontStyle||t&&t.getShallow("fontStyle")||"",r.fontWeight||t&&t.getShallow("fontWeight")||"",(r.fontSize||t&&t.getShallow("fontSize")||12)+"px",r.fontFamily||t&&t.getShallow("fontFamily")||"sans-serif"].join(" "))}var dc=xt();function a1(r,e,t,i){if(r){var n=dc(r);n.prevValue=n.value,n.value=t;var a=e.normal;n.valueAnimation=a.get("valueAnimation"),n.valueAnimation&&(n.precision=a.get("precision"),n.defaultInterpolatedText=i,n.statesModels=e)}}function o1(r,e,t,i,n){var a=dc(r);if(!a.valueAnimation||a.prevValue===a.value)return;var o=a.defaultInterpolatedText,s=mt(a.interpolatedValue,a.prevValue),l=a.value;function u(c){var h=Pw(t,a.precision,s,l,c);a.interpolatedValue=c===1?null:h;var f=RD({labelDataIndex:e,labelFetcher:n,defaultText:o?o(h):h+""},a.statesModels,h);d5(r,f)}r.percent=0,(a.prevValue==null?lr:Ut)(r,{percent:1},i,e,null,u)}var fhe=["textStyle","color"],LD=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],DD=new It,phe=function(){function r(){}return r.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(fhe):null)},r.prototype.getFont=function(){return pv({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},r.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},i=0;i<LD.length;i++)t[LD[i]]=this.getShallow(LD[i]);return DD.useStyle(t),DD.update(),DD.getBoundingRect()},r}(),m5=phe;var PD=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],dhe=Mo(PD),v5=function(){function r(){}return r.prototype.getLineStyle=function(e){return dhe(this,e)},r}();var ID=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],mhe=Mo(ID),g5=function(){function r(){}return r.prototype.getItemStyle=function(e,t){return mhe(this,e,t)},r}();var qp=function(){function r(e,t,i){this.parentModel=t,this.ecModel=i,this.option=e}return r.prototype.init=function(e,t,i){for(var n=[],a=3;a<arguments.length;a++)n[a-3]=arguments[a]},r.prototype.mergeOption=function(e,t){bt(this.option,e,!0)},r.prototype.get=function(e,t){return e==null?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},r.prototype.getShallow=function(e,t){var i=this.option,n=i==null?i:i[e];if(n==null&&!t){var a=this.parentModel;a&&(n=a.getShallow(e))}return n},r.prototype.getModel=function(e,t){var i=e!=null,n=i?this.parsePath(e):null,a=i?this._doGet(n):this.option;return t=t||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(n)),new r(a,t,this.ecModel)},r.prototype.isEmpty=function(){return this.option==null},r.prototype.restoreData=function(){},r.prototype.clone=function(){var e=this.constructor;return new e(Qe(this.option))},r.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},r.prototype.resolveParentPath=function(e){return e},r.prototype.isAnimationEnabled=function(){if(!Bt.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},r.prototype._doGet=function(e,t){var i=this.option;if(!e)return i;for(var n=0;n<e.length&&!(e[n]&&(i=i&&typeof i=="object"?i[e[n]]:null,i==null));n++);return i==null&&t&&(i=t._doGet(this.resolveParentPath(e),t.parentModel)),i},r}();Qm(qp);CH(qp);Cr(qp,v5);Cr(qp,g5);Cr(qp,RH);Cr(qp,m5);var Jt=qp;var vhe=Math.round(Math.random()*10);function Bs(r){return[r||"",vhe++].join("_")}function y5(r){var e={};r.registerSubTypeDefaulter=function(t,i){var n=So(t);e[n.main]=i},r.determineSubType=function(t,i){var n=i.type;if(!n){var a=So(t).main;r.hasSubTypes(t)&&e[a]&&(n=e[a](i))}return n}}function _5(r,e){r.topologicalTravel=function(a,o,s,l){if(!a.length)return;var u=t(o),c=u.graph,h=u.noEntryList,f={};for(N(a,function(_){f[_]=!0});h.length;){var p=h.pop(),d=c[p],g=!!f[p];g&&(s.call(l,p,d.originalDeps.slice()),delete f[p]),N(d.successor,g?v:m)}N(f,function(){var _="";throw new Error(_)});function m(_){c[_].entryCount--,c[_].entryCount===0&&h.push(_)}function v(_){f[_]=!0,m(_)}};function t(a){var o={},s=[];return N(a,function(l){var u=i(o,l),c=u.originalDeps=e(l),h=n(c,a);u.entryCount=h.length,u.entryCount===0&&s.push(l),N(h,function(f){yt(u.predecessor,f)<0&&u.predecessor.push(f);var p=i(o,f);yt(p.successor,f)<0&&p.successor.push(l)})}),{graph:o,noEntryList:s}}function i(a,o){return a[o]||(a[o]={predecessor:[],successor:[]}),a[o]}function n(a,o){var s=[];return N(a,function(l){yt(o,l)>=0&&s.push(l)}),s}}function $n(r,e){return bt(bt({},r,!0),e,!0)}var x5={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}};var S5={time:{month:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],dayOfWeekAbbr:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53CD\u9009"}},toolbox:{brush:{title:{rect:"\u77E9\u5F62\u9009\u62E9",polygon:"\u5708\u9009",lineX:"\u6A2A\u5411\u9009\u62E9",lineY:"\u7EB5\u5411\u9009\u62E9",keep:"\u4FDD\u6301\u9009\u62E9",clear:"\u6E05\u9664\u9009\u62E9"}},dataView:{title:"\u6570\u636E\u89C6\u56FE",lang:["\u6570\u636E\u89C6\u56FE","\u5173\u95ED","\u5237\u65B0"]},dataZoom:{title:{zoom:"\u533A\u57DF\u7F29\u653E",back:"\u533A\u57DF\u7F29\u653E\u8FD8\u539F"}},magicType:{title:{line:"\u5207\u6362\u4E3A\u6298\u7EBF\u56FE",bar:"\u5207\u6362\u4E3A\u67F1\u72B6\u56FE",stack:"\u5207\u6362\u4E3A\u5806\u53E0",tiled:"\u5207\u6362\u4E3A\u5E73\u94FA"}},restore:{title:"\u8FD8\u539F"},saveAsImage:{title:"\u4FDD\u5B58\u4E3A\u56FE\u7247",lang:["\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247"]}},series:{typeNames:{pie:"\u997C\u56FE",bar:"\u67F1\u72B6\u56FE",line:"\u6298\u7EBF\u56FE",scatter:"\u6563\u70B9\u56FE",effectScatter:"\u6D9F\u6F2A\u6563\u70B9\u56FE",radar:"\u96F7\u8FBE\u56FE",tree:"\u6811\u56FE",treemap:"\u77E9\u5F62\u6811\u56FE",boxplot:"\u7BB1\u578B\u56FE",candlestick:"K\u7EBF\u56FE",k:"K\u7EBF\u56FE",heatmap:"\u70ED\u529B\u56FE",map:"\u5730\u56FE",parallel:"\u5E73\u884C\u5750\u6807\u56FE",lines:"\u7EBF\u56FE",graph:"\u5173\u7CFB\u56FE",sankey:"\u6851\u57FA\u56FE",funnel:"\u6F0F\u6597\u56FE",gauge:"\u4EEA\u8868\u76D8\u56FE",pictorialBar:"\u8C61\u5F62\u67F1\u56FE",themeRiver:"\u4E3B\u9898\u6CB3\u6D41\u56FE",sunburst:"\u65ED\u65E5\u56FE",custom:"\u81EA\u5B9A\u4E49\u56FE\u8868",chart:"\u56FE\u8868"}},aria:{general:{withTitle:"\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002",withoutTitle:"\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C"},series:{single:{prefix:"",withName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002",withoutName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002"},multiple:{prefix:"\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002",withName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C",withoutName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C",separator:{middle:"\uFF1B",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636E\u662F\u2014\u2014",partialData:"\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014",withName:"{name}\u7684\u6570\u636E\u662F{value}",withoutName:"{value}",separator:{middle:"\uFF0C",end:""}}}};var l1="ZH",UD="EN",dv=UD,s1={},OD={},u1=Bt.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||dv).toUpperCase();return r.indexOf(l1)>-1?l1:dv}():dv;function M5(r,e){r=r.toUpperCase(),OD[r]=new Jt(e),s1[r]=e}function b5(r){if(Ce(r)){var e=s1[r.toUpperCase()]||{};return r===l1||r===UD?Qe(e):bt(Qe(e),Qe(s1[dv]),!1)}else return bt(Qe(r),Qe(s1[dv]),!1)}function lx(r){return OD[r]}function w5(){return OD[dv]}M5(UD,x5);M5(l1,S5);var h1=1e3,f1=h1*60,vv=f1*60,is=vv*24,FD=is*365,ux={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},c1="{yyyy}-{MM}-{dd}",BD={year:"{yyyy}",month:"{yyyy}-{MM}",day:c1,hour:c1+" "+ux.hour,minute:c1+" "+ux.minute,second:c1+" "+ux.second,millisecond:ux.none},zD=["year","month","day","hour","minute","second","millisecond"],kD=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function mc(r,e){return r+="","0000".substr(0,e-r.length)+r}function jp(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function T5(r){return r===jp(r)}function E5(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Kp(r,e,t,i){var n=Cn(r),a=n[p1(t)](),o=n[Zp(t)]()+1,s=Math.floor((o-1)/3)+1,l=n[cx(t)](),u=n["get"+(t?"UTC":"")+"Day"](),c=n[mv(t)](),h=(c-1)%12+1,f=n[hx(t)](),p=n[fx(t)](),d=n[px(t)](),g=i instanceof Jt?i:lx(i||u1)||w5(),m=g.getModel("time"),v=m.get("month"),_=m.get("monthAbbr"),y=m.get("dayOfWeek"),x=m.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,mc(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,_[o-1]).replace(/{MM}/g,mc(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,mc(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,mc(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,mc(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,mc(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,mc(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,mc(d,3)).replace(/{S}/g,d+"")}function A5(r,e,t,i,n){var a=null;if(Ce(t))a=t;else if(He(t))a=t(r.value,e,{level:r.level});else{var o=he({},ux);if(r.level>0)for(var s=0;s<zD.length;++s)o[zD[s]]="{primary|"+o[zD[s]]+"}";var l=t?t.inherit===!1?t:Ye(t,o):o,u=C5(r.value,n);if(l[u])a=l[u];else if(l.inherit){for(var c=kD.indexOf(u),s=c-1;s>=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(pe(a)){var h=r.level==null?0:r.level>=0?r.level:a.length+r.level;h=Math.min(h,a.length-1),a=a[h]}}return Kp(new Date(r.value),a,n,i)}function C5(r,e){var t=Cn(r),i=t[Zp(e)]()+1,n=t[cx(e)](),a=t[mv(e)](),o=t[hx(e)](),s=t[fx(e)](),l=t[px(e)](),u=l===0,c=u&&s===0,h=c&&o===0,f=h&&a===0,p=f&&n===1,d=p&&i===1;return d?"year":p?"month":f?"day":h?"hour":c?"minute":u?"second":"millisecond"}function VD(r,e,t){var i=Dt(r)?Cn(r):r;switch(e=e||C5(r,t),e){case"year":return i[p1(t)]();case"half-year":return i[Zp(t)]()>=6?1:0;case"quarter":return Math.floor((i[Zp(t)]()+1)/4);case"month":return i[Zp(t)]();case"day":return i[cx(t)]();case"half-day":return i[mv(t)]()/24;case"hour":return i[mv(t)]();case"minute":return i[hx(t)]();case"second":return i[fx(t)]();case"millisecond":return i[px(t)]()}}function p1(r){return r?"getUTCFullYear":"getFullYear"}function Zp(r){return r?"getUTCMonth":"getMonth"}function cx(r){return r?"getUTCDate":"getDate"}function mv(r){return r?"getUTCHours":"getHours"}function hx(r){return r?"getUTCMinutes":"getMinutes"}function fx(r){return r?"getUTCSeconds":"getSeconds"}function px(r){return r?"getUTCMilliseconds":"getMilliseconds"}function R5(r){return r?"setUTCFullYear":"setFullYear"}function GD(r){return r?"setUTCMonth":"setMonth"}function HD(r){return r?"setUTCDate":"setDate"}function WD(r){return r?"setUTCHours":"setHours"}function XD(r){return r?"setUTCMinutes":"setMinutes"}function YD(r){return r?"setUTCSeconds":"setSeconds"}function qD(r){return r?"setUTCMilliseconds":"setMilliseconds"}function jD(r){if(!Rp(r))return Ce(r)?r:"-";var e=(r+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function d1(r,e){return r=(r||"").toLowerCase().replace(/-(.)/g,function(t,i){return i.toUpperCase()}),e&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var Al=Pm;function m1(r,e,t){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(c){return c&&Zi(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var o=e==="time",s=r instanceof Date;if(o||s){var l=o?Cn(r):r;if(isNaN(+l)){if(s)return"-"}else return Kp(l,i,t)}if(e==="ordinal")return y_(r)?n(r):Dt(r)&&a(r)?r+"":"-";var u=_o(r);return a(u)?jD(u):y_(r)?n(r):typeof r=="boolean"?r+"":"-"}var L5=["a","b","c","d","e","f","g"],ZD=function(r,e){return"{"+r+(e??"")+"}"};function v1(r,e,t){pe(e)||(e=[e]);var i=e.length;if(!i)return"";for(var n=e[0].$vars||[],a=0;a<n.length;a++){var o=L5[a];r=r.replace(ZD(o),ZD(o,0))}for(var s=0;s<i;s++)for(var l=0;l<n.length;l++){var u=e[s][n[l]];r=r.replace(ZD(L5[l],s),t?wn(u):u)}return r}function D5(r,e,t){return N(e,function(i,n){r=r.replace("{"+n+"}",t?wn(i):i)}),r}function P5(r,e){var t=Ce(r)?{color:r,extraCssText:e}:r||{},i=t.color,n=t.type;e=t.extraCssText;var a=t.renderMode||"html";if(!i)return"";if(a==="html")return n==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+wn(i)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+wn(i)+";"+(e||"")+'"></span>';var o=t.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function Cl(r,e){return e=e||"transparent",Ce(r)?r:qe(r)&&r.colorStops&&(r.colorStops[0]||{}).color||e}function Jp(r,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=r}else window.open(r,e)}var g1=N,KD=["left","right","top","bottom","width","height"],$p=[["width","left","right"],["height","top","bottom"]];function JD(r,e,t,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;e.eachChild(function(l,u){var c=l.getBoundingRect(),h=e.childAt(u+1),f=h&&h.getBoundingRect(),p,d;if(r==="horizontal"){var g=c.width+(f?-f.x+c.x:0);p=a+g,p>i||l.newline?(a=0,p=g,o+=s+t,s=c.height):s=Math.max(s,c.height)}else{var m=c.height+(f?-f.y+c.y:0);d=o+m,d>n||l.newline?(a+=s+t,o=0,d=m,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=p+t:o=d+t)})}var Rl=JD,qVe=ut(JD,"vertical"),ZVe=ut(JD,"horizontal");function I5(r,e,t){var i=e.width,n=e.height,a=ze(r.left,i),o=ze(r.top,n),s=ze(r.right,i),l=ze(r.bottom,n);return(isNaN(a)||isNaN(parseFloat(r.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(r.right)))&&(s=i),(isNaN(o)||isNaN(parseFloat(r.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(r.bottom)))&&(l=n),t=Al(t||0),{width:Math.max(s-a-t[1]-t[3],0),height:Math.max(l-o-t[0]-t[2],0)}}function br(r,e,t){t=Al(t||0);var i=e.width,n=e.height,a=ze(r.left,i),o=ze(r.top,n),s=ze(r.right,i),l=ze(r.bottom,n),u=ze(r.width,i),c=ze(r.height,n),h=t[2]+t[0],f=t[1]+t[3],p=r.aspect;switch(isNaN(u)&&(u=i-s-f-a),isNaN(c)&&(c=n-l-h-o),p!=null&&(isNaN(u)&&isNaN(c)&&(p>i/n?u=i*.8:c=n*.8),isNaN(u)&&(u=p*c),isNaN(c)&&(c=u/p)),isNaN(a)&&(a=i-s-u-f),isNaN(o)&&(o=n-l-c-h),r.left||r.right){case"center":a=i/2-u/2-t[3];break;case"right":a=i-u-f;break}switch(r.top||r.bottom){case"middle":case"center":o=n/2-c/2-t[0];break;case"bottom":o=n-c-h;break}a=a||0,o=o||0,isNaN(u)&&(u=i-f-a-(s||0)),isNaN(c)&&(c=n-h-o-(l||0));var d=new ht(a+t[3],o+t[0],u,c);return d.margin=t,d}function Ih(r,e,t,i,n,a){var o=!n||!n.hv||n.hv[0],s=!n||!n.hv||n.hv[1],l=n&&n.boundingMode||"all";if(a=a||r,a.x=r.x,a.y=r.y,!o&&!s)return!1;var u;if(l==="raw")u=r.type==="group"?new ht(0,0,+e.width||0,+e.height||0):r.getBoundingRect();else if(u=r.getBoundingRect(),r.needLocalTransform()){var c=r.getLocalTransform();u=u.clone(),u.applyTransform(c)}var h=br(Ye({width:u.width,height:u.height},e),t,i),f=o?h.x-u.x:0,p=s?h.y-u.y:0;return l==="raw"?(a.x=f,a.y=p):(a.x+=f,a.y+=p),a===r&&r.markRedraw(),!0}function N5(r,e){return r[$p[e][0]]!=null||r[$p[e][1]]!=null&&r[$p[e][2]]!=null}function Nh(r){var e=r.layoutMode||r.constructor.layoutMode;return qe(e)?e:e?{type:e}:null}function Eo(r,e,t){var i=t&&t.ignoreSize;!pe(i)&&(i=[i,i]);var n=o($p[0],0),a=o($p[1],1);u($p[0],r,n),u($p[1],r,a);function o(c,h){var f={},p=0,d={},g=0,m=2;if(g1(c,function(y){d[y]=r[y]}),g1(c,function(y){s(e,y)&&(f[y]=d[y]=e[y]),l(f,y)&&p++,l(d,y)&&g++}),i[h])return l(e,c[1])?d[c[2]]=null:l(e,c[2])&&(d[c[1]]=null),d;if(g===m||!p)return d;if(p>=m)return f;for(var v=0;v<c.length;v++){var _=c[v];if(!s(f,_)&&s(r,_)){f[_]=r[_];break}}return f}function s(c,h){return c.hasOwnProperty(h)}function l(c,h){return c[h]!=null&&c[h]!=="auto"}function u(c,h,f){g1(c,function(p){h[p]=f[p]})}}function ks(r){return $D({},r)}function $D(r,e){return e&&r&&g1(KD,function(t){e.hasOwnProperty(t)&&(r[t]=e[t])}),r}var ghe=xt(),gv=function(r){Z(e,r);function e(t,i,n){var a=r.call(this,t,i,n)||this;return a.uid=Bs("ec_cpt_model"),a}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n)},e.prototype.mergeDefaultAndTheme=function(t,i){var n=Nh(this),a=n?ks(t):{},o=i.getTheme();bt(t,o.get(this.mainType)),bt(t,this.getDefaultOption()),n&&Eo(t,a,n)},e.prototype.mergeOption=function(t,i){bt(this.option,t,!0);var n=Nh(this);n&&Eo(this.option,t,n)},e.prototype.optionUpdated=function(t,i){},e.prototype.getDefaultOption=function(){var t=this.constructor;if(!AH(t))return t.defaultOption;var i=ghe(this);if(!i.defaultOption){for(var n=[],a=t;a;){var o=a.prototype.defaultOption;o&&n.push(o),a=a.superClass}for(var s={},l=n.length-1;l>=0;l--)s=bt(s,n[l],!0);i.defaultOption=s}return i.defaultOption},e.prototype.getReferringComponents=function(t,i){var n=t+"Index",a=t+"Id";return wh(this.ecModel,t,{index:this.get(n,!0),id:this.get(a,!0)},i)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(Jt);Iw(gv,Jt);Th(gv);y5(gv);_5(gv,yhe);function yhe(r){var e=[];return N(gv.getClassesByMainType(r),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=de(e,function(t){return So(t).main}),r!=="dataset"&&yt(e,"dataset")<=0&&e.unshift("dataset"),e}var Nt=gv;var U5="";typeof navigator<"u"&&(U5=navigator.platform||"");var yv="rgba(0, 0, 0, 0.2)",O5={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:yv,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:yv,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:yv,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:yv,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:yv,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:yv,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:U5.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var y1=ke(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),dn="original",Li="arrayRows",Pn="objectRows",ns="keyedColumns",as="typedArray",QD="unknown",Ao="column",vc="row";var Qi={Must:1,Might:2,Not:3},z5=xt();function F5(r){z5(r).datasetMap=ke()}function _1(r,e,t){var i={},n=x1(e);if(!n||!r)return i;var a=[],o=[],s=e.ecModel,l=z5(s).datasetMap,u=n.uid+"_"+t.seriesLayoutBy,c,h;r=r.slice(),N(r,function(g,m){var v=qe(g)?g:r[m]={name:g};v.type==="ordinal"&&c==null&&(c=m,h=d(v)),i[v.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});N(r,function(g,m){var v=g.name,_=d(g);if(c==null){var y=f.valueWayDim;p(i[v],y,_),p(o,y,_),f.valueWayDim+=_}else if(c===m)p(i[v],0,_),p(a,0,_);else{var y=f.categoryWayDim;p(i[v],y,_),p(o,y,_),f.categoryWayDim+=_}});function p(g,m,v){for(var _=0;_<v;_++)g.push(m+_)}function d(g){var m=g.dimsDef;return m?m.length:1}return a.length&&(i.itemName=a),o.length&&(i.seriesName=o),i}function _v(r,e,t){var i={},n=x1(r);if(!n)return i;var a=e.sourceFormat,o=e.dimensionsDefine,s;(a===Pn||a===ns)&&N(o,function(c,h){(qe(c)?c.name:c)==="name"&&(s=h)});var l=function(){for(var c={},h={},f=[],p=0,d=Math.min(5,t);p<d;p++){var g=k5(e.data,a,e.seriesLayoutBy,o,e.startIndex,p);f.push(g);var m=g===Qi.Not;if(m&&c.v==null&&p!==s&&(c.v=p),(c.n==null||c.n===c.v||!m&&f[c.n]===Qi.Not)&&(c.n=p),v(c)&&f[c.n]!==Qi.Not)return c;m||(g===Qi.Might&&h.v==null&&p!==s&&(h.v=p),(h.n==null||h.n===h.v)&&(h.n=p))}function v(_){return _.v!=null&&_.n!=null}return v(c)?c:v(h)?h:null}();if(l){i.value=[l.v];var u=s??l.n;i.itemName=[u],i.seriesName=[u]}return i}function x1(r){var e=r.get("data",!0);if(!e)return wh(r.ecModel,"dataset",{index:r.get("datasetIndex",!0),id:r.get("datasetId",!0)},Ir).models[0]}function B5(r){return!r.get("transform",!0)&&!r.get("fromTransformResult",!0)?[]:wh(r.ecModel,"dataset",{index:r.get("fromDatasetIndex",!0),id:r.get("fromDatasetId",!0)},Ir).models}function S1(r,e){return k5(r.data,r.sourceFormat,r.seriesLayoutBy,r.dimensionsDefine,r.startIndex,e)}function k5(r,e,t,i,n,a){var o,s=5;if(Ai(r))return Qi.Not;var l,u;if(i){var c=i[a];qe(c)?(l=c.name,u=c.type):Ce(c)&&(l=c)}if(u!=null)return u==="ordinal"?Qi.Must:Qi.Not;if(e===Li){var h=r;if(t===vc){for(var f=h[a],p=0;p<(f||[]).length&&p<s;p++)if((o=x(f[n+p]))!=null)return o}else for(var p=0;p<h.length&&p<s;p++){var d=h[n+p];if(d&&(o=x(d[a]))!=null)return o}}else if(e===Pn){var g=r;if(!l)return Qi.Not;for(var p=0;p<g.length&&p<s;p++){var m=g[p];if(m&&(o=x(m[l]))!=null)return o}}else if(e===ns){var v=r;if(!l)return Qi.Not;var f=v[l];if(!f||Ai(f))return Qi.Not;for(var p=0;p<f.length&&p<s;p++)if((o=x(f[p]))!=null)return o}else if(e===dn)for(var _=r,p=0;p<_.length&&p<s;p++){var m=_[p],y=Sl(m);if(!pe(y))return Qi.Not;if((o=x(y[a]))!=null)return o}function x(M){var S=Ce(M);if(M!=null&&isFinite(M)&&M!=="")return S?Qi.Might:Qi.Not;if(S&&M!=="-")return Qi.Must}return Qi.Not}var eP=ke();function V5(r,e){Wr(eP.get(r)==null&&e),eP.set(r,e)}function G5(r,e,t){var i=eP.get(e);if(!i)return t;var n=i(r);if(!n)return t;if(0)for(var a;a<n.length;a++);return t.concat(n)}var H5=xt(),_he=xt(),mx=function(){function r(){}return r.prototype.getColorFromPalette=function(e,t,i){var n=tr(this.get("color",!0)),a=this.get("colorLayer",!0);return W5(this,H5,n,a,e,t,i)},r.prototype.clearColorPalette=function(){She(this,H5)},r}();function vx(r,e,t,i){var n=tr(r.get(["aria","decal","decals"]));return W5(r,_he,n,null,e,t,i)}function xhe(r,e){for(var t=r.length,i=0;i<t;i++)if(r[i].length>e)return r[i];return r[t-1]}function W5(r,e,t,i,n,a,o){a=a||r;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var c=o==null||!i?t:xhe(i,o);if(c=c||t,!(!c||!c.length)){var h=c[l];return n&&(u[n]=h),s.paletteIdx=(l+1)%c.length,h}}function She(r,e){e(r).paletteIdx=0,e(r).paletteNameMap={}}var M1,gx,X5,Y5="\0_ec_inner",Mhe=1;var K5=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Jt(a),this._locale=new Jt(o),this._optionManager=s},e.prototype.setOption=function(t,i,n){var a=j5(i);this._optionManager.setOption(t,n,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,i){return this._resetOption(t,j5(i))},e.prototype._resetOption=function(t,i){var n=!1,a=this._optionManager;if(!t||t==="recreate"){var o=a.mountOption(t==="recreate");!this.option||t==="recreate"?X5(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&N(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=ke(),u=i&&i.replaceMergeMainTypeMap;F5(this),N(t,function(h,f){h!=null&&(Nt.hasClass(f)?f&&(s.push(f),l.set(f,!0)):n[f]=n[f]==null?Qe(h):bt(n[f],h,!0))}),u&&u.each(function(h,f){Nt.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),Nt.topologicalTravel(s,Nt.getAllClassMainTypes(),c,this);function c(h){var f=G5(this,h,tr(t[h])),p=a.get(h),d=p?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",g=Dw(p,f,d);SH(g,h,Nt),n[h]=null,a.set(h,null),o.set(h,0);var m=[],v=[],_=0,y,x;N(g,function(M,S){var w=M.existing,T=M.newOption;if(!T)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var C=h==="series",b=Nt.getClass(h,M.keyInfo.subType,!C);if(!b){if(0)var E,I;return}if(h==="tooltip"){if(y)return;y=!0}if(w&&w.constructor===b)w.name=M.keyInfo.name,w.mergeOption(T,this),w.optionUpdated(T,!1);else{var R=he({componentIndex:S},M.keyInfo);w=new b(T,this,this,R),he(w,R),M.brandNew&&(w.__requireNewView=!0),w.init(T,this,this),w.optionUpdated(null,!0)}}w?(m.push(w.option),v.push(w),_++):(m.push(void 0),v.push(void 0))},this),n[h]=m,a.set(h,v),o.set(h,_),h==="series"&&M1(this)}this._seriesIndices||M1(this)},e.prototype.getOption=function(){var t=Qe(this.option);return N(t,function(i,n){if(Nt.hasClass(n)){for(var a=tr(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Jm(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,t[n]=a}}),delete t[Y5],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,i){var n=this._componentsMap.get(t);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o<n.length;o++)if(n[o])return n[o]}}},e.prototype.queryComponents=function(t){var i=t.mainType;if(!i)return[];var n=t.index,a=t.id,o=t.name,s=this._componentsMap.get(i);if(!s||!s.length)return[];var l;return n!=null?(l=[],N(tr(n),function(u){s[u]&&l.push(s[u])})):a!=null?l=q5("id",a,s):o!=null?l=q5("name",o,s):l=Yt(s,function(u){return!!u}),Z5(l,t)},e.prototype.findComponents=function(t){var i=t.query,n=t.mainType,a=s(i),o=a?this.queryComponents(a):Yt(this._componentsMap.get(n),function(u){return!!u});return l(Z5(o,t));function s(u){var c=n+"Index",h=n+"Id",f=n+"Name";return u&&(u[c]!=null||u[h]!=null||u[f]!=null)?{mainType:n,index:u[c],id:u[h],name:u[f]}:null}function l(u){return t.filter?Yt(u,t.filter):u}},e.prototype.eachComponent=function(t,i,n){var a=this._componentsMap;if(He(t)){var o=i,s=t;a.each(function(h,f){for(var p=0;h&&p<h.length;p++){var d=h[p];d&&s.call(o,f,d,d.componentIndex)}})}else for(var l=Ce(t)?a.get(t):qe(t)?this.findComponents(t):null,u=0;l&&u<l.length;u++){var c=l[u];c&&i.call(n,c,c.componentIndex)}},e.prototype.getSeriesByName=function(t){var i=Kr(t,null);return Yt(this._componentsMap.get("series"),function(n){return!!n&&i!=null&&n.name===i})},e.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},e.prototype.getSeriesByType=function(t){return Yt(this._componentsMap.get("series"),function(i){return!!i&&i.subType===t})},e.prototype.getSeries=function(){return Yt(this._componentsMap.get("series"),function(t){return!!t})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(t,i){gx(this),N(this._seriesIndices,function(n){var a=this._componentsMap.get("series")[n];t.call(i,a,n)},this)},e.prototype.eachRawSeries=function(t,i){N(this._componentsMap.get("series"),function(n){n&&t.call(i,n,n.componentIndex)})},e.prototype.eachSeriesByType=function(t,i,n){gx(this),N(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];o.subType===t&&i.call(n,o,a)},this)},e.prototype.eachRawSeriesByType=function(t,i,n){return N(this.getSeriesByType(t),i,n)},e.prototype.isSeriesFiltered=function(t){return gx(this),this._seriesIndicesMap.get(t.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(t,i){gx(this);var n=[];N(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];t.call(i,o,a)&&n.push(a)},this),this._seriesIndices=n,this._seriesIndicesMap=ke(n)},e.prototype.restoreData=function(t){M1(this);var i=this._componentsMap,n=[];i.each(function(a,o){Nt.hasClass(o)&&n.push(o)}),Nt.topologicalTravel(n,Nt.getAllClassMainTypes(),function(a){N(i.get(a),function(o){o&&(a!=="series"||!bhe(o,t))&&o.restoreData()})})},e.internalField=function(){M1=function(t){var i=t._seriesIndices=[];N(t._componentsMap.get("series"),function(n){n&&i.push(n.componentIndex)}),t._seriesIndicesMap=ke(i)},gx=function(t){},X5=function(t,i){t.option={},t.option[Y5]=Mhe,t._componentsMap=ke({series:[]}),t._componentsCount=ke();var n=i.aria;qe(n)&&n.enabled==null&&(n.enabled=!0),whe(i,t._theme.option),bt(i,O5,!1),t._mergeOption(i,null)}}(),e}(Jt);function bhe(r,e){if(e){var t=e.seriesIndex,i=e.seriesId,n=e.seriesName;return t!=null&&r.componentIndex!==t||i!=null&&r.id!==i||n!=null&&r.name!==n}}function whe(r,e){var t=r.color&&!r.colorLayer;N(e,function(i,n){n==="colorLayer"&&t||Nt.hasClass(n)||(typeof i=="object"?r[n]=r[n]?bt(r[n],i,!1):Qe(i):r[n]==null&&(r[n]=i))})}function q5(r,e,t){if(pe(e)){var i=ke();return N(e,function(a){if(a!=null){var o=Kr(a,null);o!=null&&i.set(a,!0)}}),Yt(t,function(a){return a&&i.get(a[r])})}else{var n=Kr(e,null);return Yt(t,function(a){return a&&n!=null&&a[r]===n})}}function Z5(r,e){return e.hasOwnProperty("subType")?Yt(r,function(t){return t&&t.subType===e.subType}):r}function j5(r){var e=ke();return r&&N(tr(r.replaceMerge),function(t){e.set(t,!0)}),{replaceMergeMainTypeMap:e}}Cr(K5,mx);var b1=K5;var The=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],Ehe=function(){function r(e){N(The,function(t){this[t]=Be(e[t],e)},this)}return r}(),w1=Ehe;var tP={},Ahe=function(){function r(){this._coordinateSystems=[]}return r.prototype.create=function(e,t){var i=[];N(tP,function(n,a){var o=n.create(e,t);i=i.concat(o||[])}),this._coordinateSystems=i},r.prototype.update=function(e,t){N(this._coordinateSystems,function(i){i.update&&i.update(e,t)})},r.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},r.register=function(e,t){tP[e]=t},r.get=function(e){return tP[e]},r}(),gc=Ahe;var Che=/^(min|max)?(.+)$/,Rhe=function(){function r(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return r.prototype.setOption=function(e,t,i){e&&(N(tr(e.series),function(o){o&&o.data&&Ai(o.data)&&cp(o.data)}),N(tr(e.dataset),function(o){o&&o.source&&Ai(o.source)&&cp(o.source)})),e=Qe(e);var n=this._optionBackup,a=Lhe(e,t,!n);this._newBaseOption=a.baseOption,n?(a.timelineOptions.length&&(n.timelineOptions=a.timelineOptions),a.mediaList.length&&(n.mediaList=a.mediaList),a.mediaDefault&&(n.mediaDefault=a.mediaDefault)):this._optionBackup=a},r.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],Qe(e?t.baseOption:this._newBaseOption)},r.prototype.getTimelineOption=function(e){var t,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(t=Qe(i[n.getCurrentIndex()]))}return t},r.prototype.getMediaOption=function(e){var t=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,a=this._mediaDefault,o=[],s=[];if(!n.length&&!a)return s;for(var l=0,u=n.length;l<u;l++)Dhe(n[l].query,t,i)&&o.push(l);return!o.length&&a&&(o=[-1]),o.length&&!Ihe(o,this._currentMediaIndices)&&(s=de(o,function(c){return Qe(c===-1?a.option:n[c].option)})),this._currentMediaIndices=o,s},r}();function Lhe(r,e,t){var i=[],n,a,o=r.baseOption,s=r.timeline,l=r.options,u=r.media,c=!!r.media,h=!!(l||s||o&&o.timeline);o?(a=o,a.timeline||(a.timeline=s)):((h||c)&&(r.options=r.media=null),a=r),c&&pe(u)&&N(u,function(p){p&&p.option&&(p.query?i.push(p):n||(n=p))}),f(a),N(l,function(p){return f(p)}),N(i,function(p){return f(p.option)});function f(p){N(e,function(d){d(p,t)})}return{baseOption:a,timelineOptions:l||[],mediaDefault:n,mediaList:i}}function Dhe(r,e,t){var i={width:e,height:t,aspectratio:e/t},n=!0;return N(r,function(a,o){var s=o.match(Che);if(!(!s||!s[1]||!s[2])){var l=s[1],u=s[2].toLowerCase();Phe(i[u],a,l)||(n=!1)}}),n}function Phe(r,e,t){return t==="min"?r>=e:t==="max"?r<=e:r===e}function Ihe(r,e){return r.join(",")===e.join(",")}var J5=Rhe;var Ll=N,_x=qe,$5=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function rP(r){var e=r&&r.itemStyle;if(e)for(var t=0,i=$5.length;t<i;t++){var n=$5[t],a=e.normal,o=e.emphasis;a&&a[n]&&(r[n]=r[n]||{},r[n].normal?bt(r[n].normal,a[n]):r[n].normal=a[n],a[n]=null),o&&o[n]&&(r[n]=r[n]||{},r[n].emphasis?bt(r[n].emphasis,o[n]):r[n].emphasis=o[n],o[n]=null)}}function Qn(r,e,t){if(r&&r[e]&&(r[e].normal||r[e].emphasis)){var i=r[e].normal,n=r[e].emphasis;i&&(t?(r[e].normal=r[e].emphasis=null,Ye(r[e],i)):r[e]=i),n&&(r.emphasis=r.emphasis||{},r.emphasis[e]=n,n.focus&&(r.emphasis.focus=n.focus),n.blurScope&&(r.emphasis.blurScope=n.blurScope))}}function yx(r){Qn(r,"itemStyle"),Qn(r,"lineStyle"),Qn(r,"areaStyle"),Qn(r,"label"),Qn(r,"labelLine"),Qn(r,"upperLabel"),Qn(r,"edgeLabel")}function Oi(r,e){var t=_x(r)&&r[e],i=_x(t)&&t.textStyle;if(i)for(var n=0,a=H2.length;n<a;n++){var o=H2[n];i.hasOwnProperty(o)&&(t[o]=i[o])}}function Vs(r){r&&(yx(r),Oi(r,"label"),r.emphasis&&Oi(r.emphasis,"label"))}function Nhe(r){if(_x(r)){rP(r),yx(r),Oi(r,"label"),Oi(r,"upperLabel"),Oi(r,"edgeLabel"),r.emphasis&&(Oi(r.emphasis,"label"),Oi(r.emphasis,"upperLabel"),Oi(r.emphasis,"edgeLabel"));var e=r.markPoint;e&&(rP(e),Vs(e));var t=r.markLine;t&&(rP(t),Vs(t));var i=r.markArea;i&&Vs(i);var n=r.data;if(r.type==="graph"){n=n||r.nodes;var a=r.links||r.edges;if(a&&!Ai(a))for(var o=0;o<a.length;o++)Vs(a[o]);N(r.categories,function(u){yx(u)})}if(n&&!Ai(n))for(var o=0;o<n.length;o++)Vs(n[o]);if(e=r.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)Vs(s[o]);if(t=r.markLine,t&&t.data)for(var l=t.data,o=0;o<l.length;o++)pe(l[o])?(Vs(l[o][0]),Vs(l[o][1])):Vs(l[o]);r.type==="gauge"?(Oi(r,"axisLabel"),Oi(r,"title"),Oi(r,"detail")):r.type==="treemap"?(Qn(r.breadcrumb,"itemStyle"),N(r.levels,function(u){yx(u)})):r.type==="tree"&&yx(r.leaves)}}function yc(r){return pe(r)?r:r?[r]:[]}function Q5(r){return(pe(r)?r[0]:r)||{}}function iP(r,e){Ll(yc(r.series),function(i){_x(i)&&Nhe(i)});var t=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&t.push("valueAxis","categoryAxis","logAxis","timeAxis"),Ll(t,function(i){Ll(yc(r[i]),function(n){n&&(Oi(n,"axisLabel"),Oi(n.axisPointer,"label"))})}),Ll(yc(r.parallel),function(i){var n=i&&i.parallelAxisDefault;Oi(n,"axisLabel"),Oi(n&&n.axisPointer,"label")}),Ll(yc(r.calendar),function(i){Qn(i,"itemStyle"),Oi(i,"dayLabel"),Oi(i,"monthLabel"),Oi(i,"yearLabel")}),Ll(yc(r.radar),function(i){Oi(i,"name"),i.name&&i.axisName==null&&(i.axisName=i.name,delete i.name),i.nameGap!=null&&i.axisNameGap==null&&(i.axisNameGap=i.nameGap,delete i.nameGap)}),Ll(yc(r.geo),function(i){_x(i)&&(Vs(i),Ll(yc(i.regions),function(n){Vs(n)}))}),Ll(yc(r.timeline),function(i){Vs(i),Qn(i,"label"),Qn(i,"itemStyle"),Qn(i,"controlStyle",!0);var n=i.data;pe(n)&&N(n,function(a){qe(a)&&(Qn(a,"label"),Qn(a,"itemStyle"))})}),Ll(yc(r.toolbox),function(i){Qn(i,"iconStyle"),Ll(i.feature,function(n){Qn(n,"iconStyle")})}),Oi(Q5(r.axisPointer),"label"),Oi(Q5(r.tooltip).axisPointer,"label")}function Uhe(r,e){for(var t=e.split(","),i=r,n=0;n<t.length&&(i=i&&i[t[n]],i!=null);n++);return i}function Ohe(r,e,t,i){for(var n=e.split(","),a=r,o,s=0;s<n.length-1;s++)o=n[s],a[o]==null&&(a[o]={}),a=a[o];(i||a[n[s]]==null)&&(a[n[s]]=t)}function eW(r){r&&N(zhe,function(e){e[0]in r&&!(e[1]in r)&&(r[e[1]]=r[e[0]])})}var zhe=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Fhe=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],nP=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function xx(r){var e=r&&r.itemStyle;if(e)for(var t=0;t<nP.length;t++){var i=nP[t][1],n=nP[t][0];e[i]!=null&&(e[n]=e[i])}}function tW(r){r&&r.alignTo==="edge"&&r.margin!=null&&r.edgeDistance==null&&(r.edgeDistance=r.margin)}function rW(r){r&&r.downplay&&!r.blur&&(r.blur=r.downplay)}function Bhe(r){r&&r.focusNodeAdjacency!=null&&(r.emphasis=r.emphasis||{},r.emphasis.focus==null&&(r.emphasis.focus="adjacency"))}function iW(r,e){if(r)for(var t=0;t<r.length;t++)e(r[t]),r[t]&&iW(r[t].children,e)}function T1(r,e){iP(r,e),r.series=tr(r.series),N(r.series,function(t){if(qe(t)){var i=t.type;if(i==="line")t.clipOverflow!=null&&(t.clip=t.clipOverflow);else if(i==="pie"||i==="gauge"){t.clockWise!=null&&(t.clockwise=t.clockWise),tW(t.label);var n=t.data;if(n&&!Ai(n))for(var a=0;a<n.length;a++)tW(n[a]);t.hoverOffset!=null&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&(t.emphasis.scaleSize=t.hoverOffset))}else if(i==="gauge"){var o=Uhe(t,"pointer.color");o!=null&&Ohe(t,"itemStyle.color",o)}else if(i==="bar"){xx(t),xx(t.backgroundStyle),xx(t.emphasis);var n=t.data;if(n&&!Ai(n))for(var a=0;a<n.length;a++)typeof n[a]=="object"&&(xx(n[a]),xx(n[a]&&n[a].emphasis))}else if(i==="sunburst"){var s=t.highlightPolicy;s&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=s)),rW(t),iW(t.data,rW)}else i==="graph"||i==="sankey"?Bhe(t):i==="map"&&(t.mapType&&!t.map&&(t.map=t.mapType),t.mapLocation&&Ye(t,t.mapLocation));t.hoverAnimation!=null&&(t.emphasis=t.emphasis||{},t.emphasis&&t.emphasis.scale==null&&(t.emphasis.scale=t.hoverAnimation)),eW(t)}}),r.dataRange&&(r.visualMap=r.dataRange),N(Fhe,function(t){var i=r[t];i&&(pe(i)||(i=[i]),N(i,function(n){eW(n)}))})}function aP(r){var e=ke();r.eachSeries(function(t){var i=t.get("stack");if(i){var n=e.get(i)||e.set(i,[]),a=t.getData(),o={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:t};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;n.length&&a.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(o)}}),e.each(khe)}function khe(r){N(r,function(e,t){var i=[],n=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,c,h){var f=o.get(e.stackedDimension,h);if(isNaN(f))return n;var p,d;s?d=o.getRawIndex(h):p=o.get(e.stackedByDimension,h);for(var g=NaN,m=t-1;m>=0;m--){var v=r[m];if(s||(d=v.data.rawIndexOf(v.stackedByDimension,p)),d>=0){var _=v.data.getByRawIndex(v.stackResultDimension,d);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&f>=0&&_>0||l==="samesign"&&f<=0&&_<0){f=hH(f,_),g=_;break}}}return i[0]=f,i[1]=g,i})})}var E1=function(){function r(e){this.data=e.data||(e.sourceFormat===ns?{}:[]),this.sourceFormat=e.sourceFormat||QD,this.seriesLayoutBy=e.seriesLayoutBy||Ao,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var i=0;i<t.length;i++){var n=t[i];n.type==null&&S1(this,i)===Qi.Must&&(n.type="ordinal")}}return r}();function xv(r){return r instanceof E1}function Sx(r,e,t){t=t||oP(r);var i=e.seriesLayoutBy,n=Vhe(r,t,i,e.sourceHeader,e.dimensions),a=new E1({data:r,sourceFormat:t,seriesLayoutBy:i,dimensionsDefine:n.dimensionsDefine,startIndex:n.startIndex,dimensionsDetectedCount:n.dimensionsDetectedCount,metaRawOption:Qe(e)});return a}function Sv(r){return new E1({data:r,sourceFormat:Ai(r)?as:dn})}function oW(r){return new E1({data:r.data,sourceFormat:r.sourceFormat,seriesLayoutBy:r.seriesLayoutBy,dimensionsDefine:Qe(r.dimensionsDefine),startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount})}function oP(r){var e=QD;if(Ai(r))e=as;else if(pe(r)){r.length===0&&(e=Li);for(var t=0,i=r.length;t<i;t++){var n=r[t];if(n!=null){if(pe(n)||Ai(n)){e=Li;break}else if(qe(n)){e=Pn;break}}}}else if(qe(r)){for(var a in r)if(tt(r,a)&&di(r[a])){e=ns;break}}return e}function Vhe(r,e,t,i,n){var a,o;if(!r)return{dimensionsDefine:nW(n),startIndex:o,dimensionsDetectedCount:a};if(e===Li){var s=r;i==="auto"||i==null?aW(function(u){u!=null&&u!=="-"&&(Ce(u)?o==null&&(o=1):o=0)},t,s,10):o=Dt(i)?i:i?1:0,!n&&o===1&&(n=[],aW(function(u,c){n[c]=u!=null?u+"":""},t,s,1/0)),a=n?n.length:t===vc?s.length:s[0]?s[0].length:null}else if(e===Pn)n||(n=Ghe(r));else if(e===ns)n||(n=[],N(r,function(u,c){n.push(c)}));else if(e===dn){var l=Sl(r[0]);a=pe(l)&&l.length||1}return{startIndex:o,dimensionsDefine:nW(n),dimensionsDetectedCount:a}}function Ghe(r){for(var e=0,t;e<r.length&&!(t=r[e++]););if(t)return At(t)}function nW(r){if(r){var e=ke();return de(r,function(t,i){t=qe(t)?t:{name:t};var n={name:t.name,displayName:t.displayName,type:t.type};if(n.name==null)return n;n.name+="",n.displayName==null&&(n.displayName=n.name);var a=e.get(n.name);return a?n.name+="-"+a.count++:e.set(n.name,{count:1}),n})}}function aW(r,e,t,i){if(e===vc)for(var n=0;n<t.length&&n<i;n++)r(t[n]?t[n][0]:null,n);else for(var a=t[0]||[],n=0;n<a.length&&n<i;n++)r(a[n],n)}function A1(r){var e=r.sourceFormat;return e===Pn||e===ns}var Qp,ed,td,sW,lW,C1=function(){function r(e,t){var i=xv(e)?e:Sv(e);this._source=i;var n=this._data=i.data;i.sourceFormat===as&&(this._offset=0,this._dimSize=t,this._data=n),lW(this,n,i)}return r.prototype.getSource=function(){return this._source},r.prototype.count=function(){return 0},r.prototype.getItem=function(e,t){},r.prototype.appendData=function(e){},r.prototype.clean=function(){},r.protoInitialize=function(){var e=r.prototype;e.pure=!1,e.persistent=!0}(),r.internalField=function(){var e;lW=function(o,s,l){var u=l.sourceFormat,c=l.seriesLayoutBy,h=l.startIndex,f=l.dimensionsDefine,p=sW[hP(u,c)];if(he(o,p),u===as)o.getItem=t,o.count=n,o.fillStorage=i;else{var d=lP(u,c);o.getItem=Be(d,null,s,h,f);var g=uP(u,c);o.count=Be(g,null,s,h,f)}};var t=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,u=this._dimSize,c=u*o,h=0;h<u;h++)s[h]=l[c+h];return s},i=function(o,s,l,u){for(var c=this._data,h=this._dimSize,f=0;f<h;f++){for(var p=u[f],d=p[0]==null?1/0:p[0],g=p[1]==null?-1/0:p[1],m=s-o,v=l[f],_=0;_<m;_++){var y=c[_*h+f];v[o+_]=y,y<d&&(d=y),y>g&&(g=y)}p[0]=d,p[1]=g}},n=function(){return this._data?this._data.length/this._dimSize:0};sW=(e={},e[Li+"_"+Ao]={pure:!0,appendData:a},e[Li+"_"+vc]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Pn]={pure:!0,appendData:a},e[ns]={pure:!0,appendData:function(o){var s=this._data;N(o,function(l,u){for(var c=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)c.push(l[h])})}},e[dn]={appendData:a},e[as]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}}(),r}();var uW=function(r,e,t,i){return r[i]},Hhe=(Qp={},Qp[Li+"_"+Ao]=function(r,e,t,i){return r[i+e]},Qp[Li+"_"+vc]=function(r,e,t,i,n){i+=e;for(var a=n||[],o=r,s=0;s<o.length;s++){var l=o[s];a[s]=l?l[i]:null}return a},Qp[Pn]=uW,Qp[ns]=function(r,e,t,i,n){for(var a=n||[],o=0;o<t.length;o++){var s=t[o].name,l=r[s];a[o]=l?l[i]:null}return a},Qp[dn]=uW,Qp);function lP(r,e){var t=Hhe[hP(r,e)];return t}var cW=function(r,e,t){return r.length},Whe=(ed={},ed[Li+"_"+Ao]=function(r,e,t){return Math.max(0,r.length-e)},ed[Li+"_"+vc]=function(r,e,t){var i=r[0];return i?Math.max(0,i.length-e):0},ed[Pn]=cW,ed[ns]=function(r,e,t){var i=t[0].name,n=r[i];return n?n.length:0},ed[dn]=cW,ed);function uP(r,e){var t=Whe[hP(r,e)];return t}var sP=function(r,e,t){return r[e]},Xhe=(td={},td[Li]=sP,td[Pn]=function(r,e,t){return r[t]},td[ns]=sP,td[dn]=function(r,e,t){var i=Sl(r);return i instanceof Array?i[e]:i},td[as]=sP,td);function cP(r){var e=Xhe[r];return e}function hP(r,e){return r===Li?r+"_"+e:r}function _c(r,e,t){if(r){var i=r.getRawDataItem(e);if(i!=null){var n=r.getStore(),a=n.getSource().sourceFormat;if(t!=null){var o=r.getDimensionIndex(t),s=n.getDimensionProperty(o);return cP(a)(i,o,s)}else{var l=i;return a===dn&&(l=Sl(i)),l}}}}var Yhe=/\{@(.+?)\}/g,Mv=function(){function r(){}return r.prototype.getDataParams=function(e,t){var i=this.getData(t),n=this.getRawValue(e,t),a=i.getRawIndex(e),o=i.getName(e),s=i.getRawDataItem(e),l=i.getItemVisual(e,"style"),u=l&&l[i.getItemVisual(e,"drawType")||"fill"],c=l&&l.stroke,h=this.mainType,f=h==="series",p=i.userOutput&&i.userOutput.get();return{componentType:h,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:f?this.subType:null,seriesIndex:this.seriesIndex,seriesId:f?this.id:null,seriesName:f?this.name:null,name:o,dataIndex:a,data:s,dataType:t,value:n,color:u,borderColor:c,dimensionNames:p?p.fullDimensions:null,encode:p?p.encode:null,$vars:["seriesName","name","value"]}},r.prototype.getFormattedLabel=function(e,t,i,n,a,o){t=t||"normal";var s=this.getData(i),l=this.getDataParams(e,i);if(o&&(l.value=o.interpolatedValue),n!=null&&pe(l.value)&&(l.value=l.value[n]),!a){var u=s.getItemModel(e);a=u.get(t==="normal"?["label","formatter"]:[t,"label","formatter"])}if(He(a))return l.status=t,l.dimensionIndex=n,a(l);if(Ce(a)){var c=v1(a,l);return c.replace(Yhe,function(h,f){var p=f.length,d=f;d.charAt(0)==="["&&d.charAt(p-1)==="]"&&(d=+d.slice(1,p-1));var g=_c(s,e,d);if(o&&pe(o.interpolatedValue)){var m=s.getDimensionIndex(d);m>=0&&(g=o.interpolatedValue[m])}return g!=null?g+"":""})}},r.prototype.getRawValue=function(e,t){return _c(this.getData(t),e)},r.prototype.formatTooltip=function(e,t,i){},r}();function fP(r){var e,t;return qe(r)?r.type&&(t=r):e=r,{text:e,frag:t}}function Uh(r){return new qhe(r)}var qhe=function(){function r(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return r.prototype.perform=function(e){var t=this._upstream,i=e&&e.skip;if(this._dirty&&t){var n=this.context;n.data=n.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(_){return!(_>=1)&&(_=1),_}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(i)),this._modBy=l,this._modDataCount=u;var f=e&&e.step;if(t?this._dueEnd=t._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var p=this._dueIndex,d=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!i&&(h||p<d)){var g=this._progress;if(pe(g))for(var m=0;m<g.length;m++)this._doProgress(g[m],p,d,l,u);else this._doProgress(g,p,d,l,u)}this._dueIndex=d;var v=this._settedOutputEnd!=null?this._settedOutputEnd:d;this._outputDueEnd=v}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},r.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},r.prototype._doProgress=function(e,t,i,n,a){hW.reset(t,i,n,a),this._callingProgress=e,this._callingProgress({start:t,end:i,count:i-t,next:hW.next},this.context)},r.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var t,i;!e&&this._reset&&(t=this._reset(this.context),t&&t.progress&&(i=t.forceFirstProgress,t=t.progress),pe(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var n=this._downstream;return n&&n.dirty(),i},r.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},r.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},r.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},r.prototype.getUpstream=function(){return this._upstream},r.prototype.getDownstream=function(){return this._downstream},r.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},r}();var hW=function(){var r,e,t,i,n,a={reset:function(l,u,c,h){e=l,r=u,t=c,i=h,n=Math.ceil(i/t),a.next=t>1&&i>0?s:o}};return a;function o(){return e<r?e++:null}function s(){var l=e%n*t+Math.ceil(e/n),u=e>=r?null:l<i?l:e;return e++,u}}();function Gs(r,e){var t=e&&e.type;return t==="ordinal"?r:(t==="time"&&!Dt(r)&&r!=null&&r!=="-"&&(r=+Cn(r)),r==null||r===""?NaN:+r)}var Zhe=ke({number:function(r){return parseFloat(r)},time:function(r){return+Cn(r)},trim:function(r){return Ce(r)?Zi(r):r}});function R1(r){return Zhe.get(r)}var fW={lt:function(r,e){return r<e},lte:function(r,e){return r<=e},gt:function(r,e){return r>e},gte:function(r,e){return r>=e}},jhe=function(){function r(e,t){if(!Dt(t)){var i="";hr(i)}this._opFn=fW[e],this._rvalFloat=_o(t)}return r.prototype.evaluate=function(e){return Dt(e)?this._opFn(e,this._rvalFloat):this._opFn(_o(e),this._rvalFloat)},r}(),L1=function(){function r(e,t){var i=e==="desc";this._resultLT=i?1:-1,t==null&&(t=i?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return r.prototype.evaluate=function(e,t){var i=Dt(e)?e:_o(e),n=Dt(t)?t:_o(t),a=isNaN(i),o=isNaN(n);if(a&&(i=this._incomparable),o&&(n=this._incomparable),a&&o){var s=Ce(e),l=Ce(t);s&&(i=l?e:0),l&&(n=s?t:0)}return i<n?this._resultLT:i>n?-this._resultLT:0},r}();var Khe=function(){function r(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=_o(t)}return r.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var i=typeof e;i!==this._rvalTypeof&&(i==="number"||this._rvalTypeof==="number")&&(t=_o(e)===this._rvalFloat)}return this._isEQ?t:!t},r}();function pW(r,e){return r==="eq"||r==="ne"?new Khe(r==="eq",e):tt(fW,r)?new jhe(r,e):null}var Jhe=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(e){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(e){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(e,t){},r.prototype.retrieveValueFromItem=function(e,t){},r.prototype.convertValue=function(e,t){return Gs(e,t)},r}();function $he(r,e){var t=new Jhe,i=r.data,n=t.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==Ao&&hr(o);var s=[],l={},u=r.dimensionsDefine;if(u)N(u,function(g,m){var v=g.name,_={index:m,name:v,displayName:g.displayName};if(s.push(_),v!=null){var y="";tt(l,v)&&hr(y),l[v]=_}});else for(var c=0;c<r.dimensionsDetectedCount;c++)s.push({index:c});var h=lP(n,Ao);e.__isBuiltIn&&(t.getRawDataItem=function(g){return h(i,a,s,g)},t.getRawData=Be(Qhe,null,r)),t.cloneRawData=Be(efe,null,r);var f=uP(n,Ao);t.count=Be(f,null,i,a,s);var p=cP(n);t.retrieveValue=function(g,m){var v=h(i,a,s,g);return d(v,m)};var d=t.retrieveValueFromItem=function(g,m){if(g!=null){var v=s[m];if(v)return p(g,m,v.name)}};return t.getDimensionInfo=Be(tfe,null,s,l),t.cloneAllDimensionInfo=Be(rfe,null,s),t}function Qhe(r){var e=r.sourceFormat;if(!pP(e)){var t="";hr(t)}return r.data}function efe(r){var e=r.sourceFormat,t=r.data;if(!pP(e)){var i="";hr(i)}if(e===Li){for(var n=[],a=0,o=t.length;a<o;a++)n.push(t[a].slice());return n}else if(e===Pn){for(var n=[],a=0,o=t.length;a<o;a++)n.push(he({},t[a]));return n}}function tfe(r,e,t){if(t!=null){if(Dt(t)||!isNaN(t)&&!tt(e,t))return r[t];if(tt(e,t))return e[t]}}function rfe(r){return Qe(r)}var dW=ke();function mW(r){r=Qe(r);var e=r.type,t="";e||hr(t);var i=e.split(":");i.length!==2&&hr(t);var n=!1;i[0]==="echarts"&&(e=i[1],n=!0),r.__isBuiltIn=n,dW.set(e,r)}function vW(r,e,t){var i=tr(r),n=i.length,a="";n||hr(a);for(var o=0,s=n;o<s;o++){var l=i[o];e=ife(l,e,t,n===1?null:o),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function ife(r,e,t,i){var n="";e.length||hr(n),qe(r)||hr(n);var a=r.type,o=dW.get(a);o||hr(n);var s=de(e,function(c){return $he(c,o)}),l=tr(o.transform({upstream:s[0],upstreamList:s,config:Qe(r.config)}));if(0&&r.print)var u;return de(l,function(c,h){var f="";qe(c)||hr(f),c.data||hr(f);var p=oP(c.data);pP(p)||hr(f);var d,g=e[0];if(g&&h===0&&!c.dimensions){var m=g.startIndex;m&&(c.data=g.data.slice(0,m).concat(c.data)),d={seriesLayoutBy:Ao,sourceHeader:m,dimensions:g.metaRawOption.dimensions}}else d={seriesLayoutBy:Ao,sourceHeader:0,dimensions:c.dimensions};return Sx(c.data,d,null)})}function pP(r){return r===Li||r===Pn}var D1="undefined",nfe=typeof Uint32Array===D1?Array:Uint32Array,afe=typeof Uint16Array===D1?Array:Uint16Array,mP=typeof Int32Array===D1?Array:Int32Array,gW=typeof Float64Array===D1?Array:Float64Array,_W={float:gW,int:mP,ordinal:Array,number:Array,time:gW},dP;function Mx(r){return r>65535?nfe:afe}function bv(){return[1/0,-1/0]}function ofe(r){var e=r.constructor;return e===Array?r.slice():new e(r)}function yW(r,e,t,i,n){var a=_W[t||"float"];if(n){var o=r[e],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;u<s;u++)l[u]=o[u];r[e]=l}}else r[e]=new a(i)}var sfe=function(){function r(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=ke()}return r.prototype.initData=function(e,t,i){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var n=e.getSource(),a=this.defaultDimValueGetter=dP[n.sourceFormat];this._dimValueGetter=i||a,this._rawExtent=[];var o=A1(n);this._dimensions=de(t,function(s){return{type:s.type,property:s.property}}),this._initDataFromProvider(0,e.count())},r.prototype.getProvider=function(){return this._provider},r.prototype.getSource=function(){return this._provider.getSource()},r.prototype.ensureCalculationDimension=function(e,t){var i=this._calcDimNameToIdx,n=this._dimensions,a=i.get(e);if(a!=null){if(n[a].type===t)return a}else a=n.length;return n[a]={type:t},i.set(e,a),this._chunks[a]=new _W[t||"float"](this._rawCount),this._rawExtent[a]=bv(),a},r.prototype.collectOrdinalMeta=function(e,t){var i=this._chunks[e],n=this._dimensions[e],a=this._rawExtent,o=n.ordinalOffset||0,s=i.length;o===0&&(a[e]=bv());for(var l=a[e],u=o;u<s;u++){var c=i[u]=t.parseAndCollect(i[u]);isNaN(c)||(l[0]=Math.min(c,l[0]),l[1]=Math.max(c,l[1]))}n.ordinalMeta=t,n.ordinalOffset=s,n.type="ordinal"},r.prototype.getOrdinalMeta=function(e){var t=this._dimensions[e],i=t.ordinalMeta;return i},r.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},r.prototype.appendData=function(e){var t=this._provider,i=this.count();t.appendData(e);var n=t.count();return t.persistent||(n+=i),i<n&&this._initDataFromProvider(i,n,!0),[i,n]},r.prototype.appendValues=function(e,t){for(var i=this._chunks,n=this._dimensions,a=n.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,t||0),u=0;u<a;u++){var c=n[u];yW(i,u,c.type,l,!0)}for(var h=[],f=s;f<l;f++)for(var p=f-s,d=0;d<a;d++){var c=n[d],g=dP.arrayRows.call(this,e[p]||h,c.property,p,d);i[d][f]=g;var m=o[d];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(e,t,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=de(o,function(_){return _.property}),c=0;c<s;c++){var h=o[c];l[c]||(l[c]=bv()),yW(a,c,h.type,t,i)}if(n.fillStorage)n.fillStorage(e,t,a,l);else for(var f=[],p=e;p<t;p++){f=n.getItem(p,f);for(var d=0;d<s;d++){var g=a[d],m=this._dimValueGetter(f,u[d],p,d);g[p]=m;var v=l[d];m<v[0]&&(v[0]=m),m>v[1]&&(v[1]=m)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=t,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var i=this._chunks[e];return i?i[this.getRawIndex(t)]:NaN},r.prototype.getValues=function(e,t){var i=[],n=[];if(t==null){t=e,e=[];for(var a=0;a<this._dimensions.length;a++)n.push(a)}else n=e;for(var a=0,o=n.length;a<o;a++)i.push(this.get(n[a],t));return i},r.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var i=this._chunks[e];return i?i[t]:NaN},r.prototype.getSum=function(e){var t=this._chunks[e],i=0;if(t)for(var n=0,a=this.count();n<a;n++){var o=this.get(e,n);isNaN(o)||(i+=o)}return i},r.prototype.getMedian=function(e){var t=[];this.each([e],function(a){isNaN(a)||t.push(a)});var i=t.sort(function(a,o){return a-o}),n=this.count();return n===0?0:n%2===1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},r.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(i!=null&&i<this._count&&i===e)return e;for(var n=0,a=this._count-1;n<=a;){var o=(n+a)/2|0;if(t[o]<e)n=o+1;else if(t[o]>e)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(e,t,i){var n=this._chunks,a=n[e],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,c=0,h=this.count();c<h;c++){var f=this.getRawIndex(c),p=t-a[f],d=Math.abs(p);d<=i&&((d<s||d===s&&p>=0&&l<0)&&(s=d,l=p,u=0),p===l&&(o[u++]=c))}return o.length=u,o},r.prototype.getIndices=function(){var e,t=this._indices;if(t){var i=t.constructor,n=this._count;if(i===Array){e=new i(n);for(var a=0;a<n;a++)e[a]=t[a]}else e=new i(t.buffer,0,n)}else{var i=Mx(this._rawCount);e=new i(this.count());for(var a=0;a<e.length;a++)e[a]=a}return e},r.prototype.filter=function(e,t){if(!this._count)return this;for(var i=this.clone(),n=i.count(),a=Mx(i._rawCount),o=new a(n),s=[],l=e.length,u=0,c=e[0],h=i._chunks,f=0;f<n;f++){var p=void 0,d=i.getRawIndex(f);if(l===0)p=t(f);else if(l===1){var g=h[c][d];p=t(g,f)}else{for(var m=0;m<l;m++)s[m]=h[e[m]][d];s[m]=f,p=t.apply(null,s)}p&&(o[u++]=d)}return u<n&&(i._indices=o),i._count=u,i._extent=[],i._updateGetRawIdx(),i},r.prototype.selectRange=function(e){var t=this.clone(),i=t._count;if(!i)return this;var n=At(e),a=n.length;if(!a)return this;var o=t.count(),s=Mx(t._rawCount),l=new s(o),u=0,c=n[0],h=e[c][0],f=e[c][1],p=t._chunks,d=!1;if(!t._indices){var g=0;if(a===1){for(var m=p[n[0]],v=0;v<i;v++){var _=m[v];(_>=h&&_<=f||isNaN(_))&&(l[u++]=g),g++}d=!0}else if(a===2){for(var m=p[n[0]],y=p[n[1]],x=e[n[1]][0],M=e[n[1]][1],v=0;v<i;v++){var _=m[v],S=y[v];(_>=h&&_<=f||isNaN(_))&&(S>=x&&S<=M||isNaN(S))&&(l[u++]=g),g++}d=!0}}if(!d)if(a===1)for(var v=0;v<o;v++){var w=t.getRawIndex(v),_=p[n[0]][w];(_>=h&&_<=f||isNaN(_))&&(l[u++]=w)}else for(var v=0;v<o;v++){for(var T=!0,w=t.getRawIndex(v),C=0;C<a;C++){var b=n[C],_=p[b][w];(_<e[b][0]||_>e[b][1])&&(T=!1)}T&&(l[u++]=t.getRawIndex(v))}return u<o&&(t._indices=l),t._count=u,t._extent=[],t._updateGetRawIdx(),t},r.prototype.map=function(e,t){var i=this.clone(e);return this._updateDims(i,e,t),i},r.prototype.modify=function(e,t){this._updateDims(this,e,t)},r.prototype._updateDims=function(e,t,i){for(var n=e._chunks,a=[],o=t.length,s=e.count(),l=[],u=e._rawExtent,c=0;c<t.length;c++)u[t[c]]=bv();for(var h=0;h<s;h++){for(var f=e.getRawIndex(h),p=0;p<o;p++)l[p]=n[t[p]][f];l[o]=h;var d=i&&i.apply(null,l);if(d!=null){typeof d!="object"&&(a[0]=d,d=a);for(var c=0;c<d.length;c++){var g=t[c],m=d[c],v=u[g],_=n[g];_&&(_[f]=m),m<v[0]&&(v[0]=m),m>v[1]&&(v[1]=m)}}}},r.prototype.lttbDownSample=function(e,t){var i=this.clone([e],!0),n=i._chunks,a=n[e],o=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),c,h,f,p=new(Mx(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));p[s++]=u;for(var d=1;d<o-1;d+=l){for(var g=Math.min(d+l,o-1),m=Math.min(d+l*2,o),v=(m+g)/2,_=0,y=g;y<m;y++){var x=this.getRawIndex(y),M=a[x];isNaN(M)||(_+=M)}_/=m-g;var S=d,w=Math.min(d+l,o),T=d-1,C=a[u];c=-1,f=S;for(var b=-1,E=0,y=S;y<w;y++){var x=this.getRawIndex(y),M=a[x];if(isNaN(M)){E++,b<0&&(b=x);continue}h=Math.abs((T-v)*(M-C)-(T-y)*(_-C)),h>c&&(c=h,f=x)}E>0&&E<w-S&&(p[s++]=Math.min(b,f),f=Math.max(b,f)),p[s++]=f,u=f}return p[s++]=this.getRawIndex(o-1),i._count=s,i._indices=p,i.getRawIndex=this._getRawIdx,i},r.prototype.downSample=function(e,t,i,n){for(var a=this.clone([e],!0),o=a._chunks,s=[],l=Math.floor(1/t),u=o[e],c=this.count(),h=a._rawExtent[e]=bv(),f=new(Mx(this._rawCount))(Math.ceil(c/l)),p=0,d=0;d<c;d+=l){l>c-d&&(l=c-d,s.length=l);for(var g=0;g<l;g++){var m=this.getRawIndex(d+g);s[g]=u[m]}var v=i(s),_=this.getRawIndex(Math.min(d+n(s,v)||0,c-1));u[_]=v,v<h[0]&&(h[0]=v),v>h[1]&&(h[1]=v),f[p++]=_}return a._count=p,a._indices=f,a._updateGetRawIdx(),a},r.prototype.each=function(e,t){if(this._count)for(var i=e.length,n=this._chunks,a=0,o=this.count();a<o;a++){var s=this.getRawIndex(a);switch(i){case 0:t(a);break;case 1:t(n[e[0]][s],a);break;case 2:t(n[e[0]][s],n[e[1]][s],a);break;default:for(var l=0,u=[];l<i;l++)u[l]=n[e[l]][s];u[l]=a,t.apply(null,u)}}},r.prototype.getDataExtent=function(e){var t=this._chunks[e],i=bv();if(!t)return i;var n=this.count(),a=!this._indices,o;if(a)return this._rawExtent[e].slice();if(o=this._extent[e],o)return o.slice();o=i;for(var s=o[0],l=o[1],u=0;u<n;u++){var c=this.getRawIndex(u),h=t[c];h<s&&(s=h),h>l&&(l=h)}return o=[s,l],this._extent[e]=o,o},r.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var i=[],n=this._chunks,a=0;a<n.length;a++)i.push(n[a][t]);return i},r.prototype.clone=function(e,t){var i=new r,n=this._chunks,a=e&&bn(e,function(s,l){return s[l]=!0,s},{});if(a)for(var o=0;o<n.length;o++)i._chunks[o]=a[o]?ofe(n[o]):n[o];else i._chunks=n;return this._copyCommonProps(i),t||(i._indices=this._cloneIndices()),i._updateGetRawIdx(),i},r.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=Qe(this._extent),e._rawExtent=Qe(this._rawExtent)},r.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var i=this._indices.length;t=new e(i);for(var n=0;n<i;n++)t[n]=this._indices[n]}else t=new e(this._indices);return t}return null},r.prototype._getRawIdxIdentity=function(e){return e},r.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function e(t,i,n,a){return Gs(t[a],this._dimensions[a])}dP={arrayRows:e,objectRows:function(t,i,n,a){return Gs(t[i],this._dimensions[a])},keyedColumns:e,original:function(t,i,n,a){var o=t&&(t.value==null?t:t.value);return Gs(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(t,i,n,a){return t[a]}}}(),r}(),bx=sfe;var I1=function(){function r(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),i=!!t.length,n,a;if(P1(e)){var o=e,s=void 0,l=void 0,u=void 0;if(i){var c=t[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=Ai(s)?as:dn,a=[];var h=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},p=mt(h.seriesLayoutBy,f.seriesLayoutBy)||null,d=mt(h.sourceHeader,f.sourceHeader),g=mt(h.dimensions,f.dimensions),m=p!==f.seriesLayoutBy||!!d!=!!f.sourceHeader||g;n=m?[Sx(s,{seriesLayoutBy:p,sourceHeader:d,dimensions:g},l)]:[]}else{var v=e;if(i){var _=this._applyTransform(t);n=_.sourceList,a=_.upstreamSignList}else{var y=v.get("source",!0);n=[Sx(y,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},r.prototype._applyTransform=function(e){var t=this._sourceHost,i=t.get("transform",!0),n=t.get("fromTransformResult",!0);if(n!=null){var a="";e.length!==1&&xW(a)}var o,s=[],l=[];return N(e,function(u){u.prepareSource();var c=u.getSource(n||0),h="";n!=null&&!c&&xW(h),s.push(c),l.push(u._getVersionSign())}),i?o=vW(i,s,{datasetIndex:t.componentIndex}):n!=null&&(o=[oW(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var i=e[t];if(i._isDirty()||this._upstreamSignList[t]!==i._getVersionSign())return!0}},r.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var i=this._getUpstreamSourceManagers();return i[0]&&i[0].getSource(e)}return t},r.prototype.getSharedDataStore=function(e){var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},r.prototype._innerGetDataStore=function(e,t,i){var n=0,a=this._storeList,o=a[n];o||(o=a[n]={});var s=o[i];if(!s){var l=this._getUpstreamSourceManagers()[0];P1(this._sourceHost)&&l?s=l._innerGetDataStore(e,t,i):(s=new bx,s.initData(new C1(t,e.length),e)),o[i]=s}return s},r.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(P1(e)){var t=x1(e);return t?[t.getSourceManager()]:[]}else return de(B5(e),function(i){return i.getSourceManager()})},r.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,t,i,n;if(P1(e))t=e.get("seriesLayoutBy",!0),i=e.get("sourceHeader",!0),n=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var a=e;t=a.get("seriesLayoutBy",!0),i=a.get("sourceHeader",!0),n=a.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:i,dimensions:n}},r}();function vP(r){var e=r.option.transform;e&&cp(r.option.transform)}function P1(r){return r.mainType==="series"}function xW(r){throw new Error(r)}var SW="line-height:1";function MW(r,e){var t=r.color||"#6e7079",i=r.fontSize||12,n=r.fontWeight||"400",a=r.color||"#464646",o=r.fontSize||14,s=r.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+wn(i+"")+"px;color:"+wn(t)+";font-weight:"+wn(n+""),valueStyle:"font-size:"+wn(o+"")+"px;color:"+wn(a)+";font-weight:"+wn(s+"")}:{nameStyle:{fontSize:i,fill:t,fontWeight:n},valueStyle:{fontSize:o,fill:a,fontWeight:s}}}var lfe=[0,10,20,30],ufe=["",`
  2210. `,`
  2211. `,`
  2212. `];function kr(r,e){return e.type=r,e}function gP(r){return r.type==="section"}function bW(r){return gP(r)?cfe:hfe}function wW(r){if(gP(r)){var e=0,t=r.blocks.length,i=t>1||t>0&&!r.noHeader;return N(r.blocks,function(n){var a=wW(n);a>=e&&(e=a+ +(i&&(!a||gP(n)&&!n.noHeader)))}),e}return 0}function cfe(r,e,t,i){var n=e.noHeader,a=ffe(wW(e)),o=[],s=e.blocks||[];Wr(!s||pe(s)),s=s||[];var l=r.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(tt(u,l)){var c=new L1(u[l],null);s.sort(function(d,g){return c.evaluate(d.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}N(s,function(d,g){var m=e.valueFormatter,v=bW(d)(m?he(he({},r),{valueFormatter:m}):r,d,g>0?a.html:0,i);v!=null&&o.push(v)});var h=r.renderMode==="richText"?o.join(a.richText):yP(o.join(""),n?t:a.html);if(n)return h;var f=m1(e.header,"ordinal",r.useUTC),p=MW(i,r.renderMode).nameStyle;return r.renderMode==="richText"?TW(r,f,p)+a.richText+h:yP('<div style="'+p+";"+SW+';">'+wn(f)+"</div>"+h,t)}function hfe(r,e,t,i){var n=r.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=r.useUTC,c=e.valueFormatter||r.valueFormatter||function(x){return x=pe(x)?x:[x],de(x,function(M,S){return m1(M,pe(p)?p[S]:p,u)})};if(!(a&&o)){var h=s?"":r.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",n),f=a?"":m1(l,"ordinal",u),p=e.valueType,d=o?[]:c(e.value,e.dataIndex),g=!s||!a,m=!s&&a,v=MW(i,n),_=v.nameStyle,y=v.valueStyle;return n==="richText"?(s?"":h)+(a?"":TW(r,f,_))+(o?"":mfe(r,d,g,m,y)):yP((s?"":h)+(a?"":pfe(f,!s,_))+(o?"":dfe(d,g,m,y)),t)}}function _P(r,e,t,i,n,a){if(r){var o=bW(r),s={useUTC:n,renderMode:t,orderMode:i,markupStyleCreator:e,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function ffe(r){return{html:lfe[r],richText:ufe[r]}}function yP(r,e){var t='<div style="clear:both"></div>',i="margin: "+e+"px 0 0";return'<div style="'+i+";"+SW+';">'+r+t+"</div>"}function pfe(r,e,t){var i=e?"margin-left:2px":"";return'<span style="'+t+";"+i+'">'+wn(r)+"</span>"}function dfe(r,e,t,i){var n=t?"10px":"20px",a=e?"float:right;margin-left:"+n:"";return r=pe(r)?r:[r],'<span style="'+a+";"+i+'">'+de(r,function(o){return wn(o)}).join("&nbsp;&nbsp;")+"</span>"}function TW(r,e,t){return r.markupStyleCreator.wrapRichTextStyle(e,t)}function mfe(r,e,t,i,n){var a=[n],o=i?10:20;return t&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(pe(e)?e.join(" "):e,a)}function N1(r,e){var t=r.getData().getItemVisual(e,"style"),i=t[r.visualDrawType];return Cl(i)}function U1(r,e){var t=r.get("padding");return t??(e==="richText"?[8,10]:10)}var O1=function(){function r(){this.richTextStyles={},this._nextStyleNameId=Lw()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(e,t,i){var n=i==="richText"?this._generateStyleName():null,a=P5({color:t,type:e,renderMode:i,markerId:n});return Ce(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(e,t){var i={};pe(t)?N(t,function(a){return he(i,a)}):he(i,t);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+e+"}"},r}();function z1(r){var e=r.series,t=r.dataIndex,i=r.multipleSeries,n=e.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(t),l=pe(s),u=N1(e,t),c,h,f,p;if(o>1||l&&!o){var d=vfe(s,e,t,a,u);c=d.inlineValues,h=d.inlineValueTypes,f=d.blocks,p=d.inlineValues[0]}else if(o){var g=n.getDimensionInfo(a[0]);p=c=_c(n,t,a[0]),h=g.type}else p=c=l?s[0]:s;var m=$m(e),v=m&&e.name||"",_=n.getName(t),y=i?v:_;return kr("section",{header:v,noHeader:i||!m,sortParam:p,blocks:[kr("nameValue",{markerType:"item",markerColor:u,name:y,noName:!Zi(y),value:c,valueType:h,dataIndex:t})].concat(f||[])})}function vfe(r,e,t,i,n){var a=e.getData(),o=bn(r,function(h,f,p){var d=a.getDimensionInfo(p);return h=h||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];i.length?N(i,function(h){c(_c(a,t,h),h)}):N(r,c);function c(h,f){var p=a.getDimensionInfo(f);!p||p.otherDims.tooltip===!1||(o?u.push(kr("nameValue",{markerType:"subItem",markerColor:n,name:p.displayName,value:h,valueType:p.type})):(s.push(h),l.push(p.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Oh=xt();function F1(r,e){return r.getName(e)||r.getId(e)}var Tx="__universalTransitionEnabled",B1=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Uh({count:yfe,reset:_fe}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n);var a=Oh(this).sourceManager=new I1(this);a.prepareSource();var o=this.getInitialData(t,n);AW(o,this),this.dataTask.context.data=o,Oh(this).dataBeforeProcessed=o,EW(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(t,i){var n=Nh(this),a=n?ks(t):{},o=this.subType;Nt.hasClass(o)&&(o+="Series"),bt(t,i.getTheme().get(this.subType)),bt(t,this.getDefaultOption()),rs(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Eo(t,a,n)},e.prototype.mergeOption=function(t,i){t=bt(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Nh(this);n&&Eo(this.option,t,n);var a=Oh(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(t,i);AW(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Oh(this).dataBeforeProcessed=o,EW(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){if(t&&!Ai(t))for(var i=["show"],n=0;n<t.length;n++)t[n]&&t[n].label&&rs(t[n],"label",i)},e.prototype.getInitialData=function(t,i){},e.prototype.appendData=function(t){var i=this.getRawData();i.appendData(t.data)},e.prototype.getData=function(t){var i=xP(this);if(i){var n=i.context.data;return t==null?n:n.getLinkedData(t)}else return Oh(this).data},e.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},e.prototype.setData=function(t){var i=xP(this);if(i){var n=i.context;n.outputData=t,i!==this.dataTask&&(n.data=t)}Oh(this).data=t},e.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return ke(t)},e.prototype.getSourceManager=function(){return Oh(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return Oh(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var t=this.get("colorBy");return t||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},e.prototype.formatTooltip=function(t,i,n){return z1({series:this,dataIndex:t,multipleSeries:i})},e.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(Bt.node&&!(t&&t.ssr))return!1;var i=this.getShallow("animation");return i&&this.getData().count()>this.getShallow("animationThreshold")&&(i=!1),!!i},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,i,n){var a=this.ecModel,o=mx.prototype.getColorFromPalette.call(this,t,i,n);return o||(o=a.getColorFromPalette(t,i,n)),o},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,i){this._innerSelect(this.getData(i),t)},e.prototype.unselect=function(t,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<t.length;s++){var l=t[s],u=F1(o,l);n[u]=!1,this._selectedDataIndicesMap[u]=-1}}},e.prototype.toggleSelect=function(t,i){for(var n=[],a=0;a<t.length;a++)n[0]=t[a],this.isSelected(t[a],i)?this.unselect(n,i):this.select(n,i)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,i=At(t),n=[],a=0;a<i.length;a++){var o=t[i[a]];o>=0&&n.push(o)}return n},e.prototype.isSelected=function(t,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[F1(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[Tx])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){qe(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c<l;c++){var h=i[c],f=F1(t,h);u[f]=!0,this._selectedDataIndicesMap[f]=t.getRawIndex(h)}}else if(s==="single"||s===!0){var p=i[l-1],f=F1(t,p);o.selectedMap=(n={},n[f]=!0,n),this._selectedDataIndicesMap=(a={},a[f]=t.getRawIndex(p),a)}}},e.prototype._initSelectedMapFromData=function(t){if(!this.option.selectedMap){var i=[];t.hasItemOption&&t.each(function(n){var a=t.getRawDataItem(n);a&&a.selected&&i.push(n)}),i.length>0&&this._innerSelect(t,i)}},e.registerClass=function(t){return Nt.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Nt);Cr(B1,Mv);Cr(B1,mx);Iw(B1,Nt);function EW(r){var e=r.name;$m(r)||(r.name=gfe(r)||e)}function gfe(r){var e=r.getRawData(),t=e.mapDimensionsAll("seriesName"),i=[];return N(t,function(n){var a=e.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function yfe(r){return r.model.getRawData().count()}function _fe(r){var e=r.model;return e.setData(e.getRawData().cloneShallow()),xfe}function xfe(r,e){e.outputData&&r.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function AW(r,e){N(hp(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(t){r.wrapMethod(t,ut(Sfe,e))})}function Sfe(r,e){var t=xP(r);return t&&t.setOutputEnd((e||this).count()),e}function xP(r){var e=(r.ecModel||{}).scheduler,t=e&&e.getPipeline(r.uid);if(t){var i=t.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(r.uid))}return i}}var $t=B1;var SP=function(){function r(){this.group=new Ze,this.uid=Bs("viewComponent")}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,i,n){},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,i,n){},r.prototype.updateLayout=function(e,t,i,n){},r.prototype.updateVisual=function(e,t,i,n){},r.prototype.toggleBlurSeries=function(e,t,i){},r.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},r}();Qm(SP);Th(SP);var ir=SP;function os(){var r=xt();return function(e){var t=r(e),i=e.pipelineContext,n=!!t.large,a=!!t.progressiveRender,o=t.large=!!(i&&i.large),s=t.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var LW=xt(),Mfe=os(),MP=function(){function r(){this.group=new Ze,this.uid=Bs("viewChart"),this.renderTask=Uh({plan:bfe,reset:wfe}),this.renderTask.context={view:this}}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,i,n){},r.prototype.highlight=function(e,t,i,n){var a=e.getData(n&&n.dataType);a&&RW(a,n,"emphasis")},r.prototype.downplay=function(e,t,i,n){var a=e.getData(n&&n.dataType);a&&RW(a,n,"normal")},r.prototype.remove=function(e,t){this.group.removeAll()},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.updateLayout=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.updateVisual=function(e,t,i,n){this.render(e,t,i,n)},r.prototype.eachRendered=function(e){ya(this.group,e)},r.markUpdateMethod=function(e,t){LW(e).updateMethod=t},r.protoInitialize=function(){var e=r.prototype;e.type="chart"}(),r}();function CW(r,e,t){r&&Ph(r)&&(e==="emphasis"?Zn:jn)(r,t)}function RW(r,e,t){var i=Us(r,e),n=e&&e.highlightKey!=null?L4(e.highlightKey):null;i!=null?N(tr(i),function(a){CW(r.getItemGraphicEl(a),t,n)}):r.eachItemGraphicEl(function(a){CW(a,t,n)})}Qm(MP,["dispose"]);Th(MP);function bfe(r){return Mfe(r.model)}function wfe(r){var e=r.model,t=r.ecModel,i=r.api,n=r.payload,a=e.pipelineContext.progressiveRender,o=r.view,s=n&&LW(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,t,i,n),Tfe[l]}var Tfe={incrementalPrepareRender:{progress:function(r,e){e.view.incrementalRender(r,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(r,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Zt=MP;var k1="\0__throttleOriginMethod",DW="\0__throttleRate",PW="\0__throttleType";function Ex(r,e,t){var i,n=0,a=0,o=null,s,l,u,c;e=e||0;function h(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var f=function(){for(var p=[],d=0;d<arguments.length;d++)p[d]=arguments[d];i=new Date().getTime(),l=this,u=p;var g=c||e,m=c||t;c=null,s=i-(m?n:a)-g,clearTimeout(o),m?o=setTimeout(h,g):s>=0?h():o=setTimeout(h,-s),n=i};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(p){c=p},f}function Hs(r,e,t,i){var n=r[e];if(n){var a=n[k1]||n,o=n[PW],s=n[DW];if(s!==t||o!==i){if(t==null||!i)return r[e]=a;n=r[e]=Ex(a,t,i==="debounce"),n[k1]=a,n[PW]=i,n[DW]=t}return n}}function xc(r,e){var t=r[e];t&&t[k1]&&(t.clear&&t.clear(),r[e]=t[k1])}var IW=xt(),NW={itemStyle:Mo(ID,!0),lineStyle:Mo(PD,!0)},Efe={lineStyle:"stroke",itemStyle:"fill"};function UW(r,e){var t=r.visualStyleMapper||NW[e];return t||(console.warn("Unknown style type '"+e+"'."),NW.itemStyle)}function OW(r,e){var t=r.visualDrawType||Efe[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var zW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=r.getModel(i),a=UW(r,i),o=a(n),s=n.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=OW(r,i),u=o[l],c=He(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||h){var f=r.getColorFromPalette(r.name,null,e.getSeriesCount());o[l]||(o[l]=f,t.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||He(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||He(o.stroke)?f:o.stroke}if(t.setVisual("style",o),t.setVisual("drawType",l),!e.isSeriesFiltered(r)&&c)return t.setVisual("colorFromPalette",!1),{dataEach:function(p,d){var g=r.getDataParams(d),m=he({},o);m[l]=c(g),p.setItemVisual(d,"style",m)}}}},Ax=new Jt,FW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){if(!(r.ignoreStyleOnData||e.isSeriesFiltered(r))){var t=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=UW(r,i),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){Ax.option=l[i];var u=n(Ax),c=o.ensureUniqueItemVisual(s,"style");he(c,u),Ax.option.decal&&(o.setItemVisual(s,"decal",Ax.option.decal),Ax.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},BW={performRawSeries:!0,overallReset:function(r){var e=ke();r.eachSeries(function(t){var i=t.getColorBy();if(!t.isColorBySeries()){var n=t.type+"-"+i,a=e.get(n);a||(a={},e.set(n,a)),IW(t).scope=a}}),r.eachSeries(function(t){if(!(t.isColorBySeries()||r.isSeriesFiltered(t))){var i=t.getRawData(),n={},a=t.getData(),o=IW(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=OW(t,s);a.each(function(u){var c=a.getRawIndex(u);n[c]=u}),i.each(function(u){var c=n[u],h=a.getItemVisual(c,"colorFromPalette");if(h){var f=a.ensureUniqueItemVisual(c,"style"),p=i.getName(u)||u+"",d=i.count();f[l]=t.getColorFromPalette(p,o,d)}})}})}};var G1=Math.PI;function bP(r,e){e=e||{},Ye(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var t=new Ze,i=new Rt({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(i);var n=new It({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Rt({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var o;return e.showSpinner&&(o=new nx({shape:{startAngle:-G1/2,endAngle:-G1/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:G1*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:G1*3/2}).delay(300).start("circularInOut"),t.add(o)),t.resize=function(){var s=n.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(r.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),c=r.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},t.resize(),t}var Afe=function(){function r(e,t,i,n){this._stageTaskMap=ke(),this.ecInstance=e,this.api=t,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return r.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},r.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,a=!t&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},r.prototype.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),n=e.getData(),a=n.count(),o=i.progressiveEnabled&&t.incrementalPrepareRender&&a>=i.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(e){var t=this,i=t._pipelineMap=ke();e.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),t._pipe(n,n.dataTask)})},r.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),i=this.api;N(this._allHandlers,function(n){var a=e.get(n.uid)||e.set(n.uid,{}),o="";Wr(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,t,i),n.overallReset&&this._createOverallStageTask(n,a,t,i)},this)},r.prototype.prepareView=function(e,t,i,n){var a=e.renderTask,o=a.context;o.model=t,o.ecModel=i,o.api=n,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},r.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},r.prototype.performVisualTasks=function(e,t,i){this._performStageTasks(this._visualHandlers,e,t,i)},r.prototype._performStageTasks=function(e,t,i,n){n=n||{};var a=!1,o=this;N(e,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),h=c.seriesTaskMap,f=c.overallTask;if(f){var p,d=f.agentStubMap;d.each(function(m){s(n,m)&&(m.dirty(),p=!0)}),p&&f.dirty(),o.updatePayload(f,i);var g=o.getPerformArgs(f,n.block);d.each(function(m){m.perform(g)}),f.perform(g)&&(a=!0)}else h&&h.each(function(m,v){s(n,m)&&m.dirty();var _=o.getPerformArgs(m,n.block);_.skip=!l.performRawSeries&&t.isSeriesFiltered(m.context.model),o.updatePayload(m,i),m.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(i){t=i.dataTask.perform()||t}),this.unfinished=t||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},r.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},r.prototype._createSeriesStageTask=function(e,t,i,n){var a=this,o=t.seriesTaskMap,s=t.seriesTaskMap=ke(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?i.eachRawSeries(c):l?i.eachRawSeriesByType(l,c):u&&u(i,n).each(c);function c(h){var f=h.uid,p=s.set(f,o&&o.get(f)||Uh({plan:Pfe,reset:Ife,count:Ufe}));p.context={model:h,ecModel:i,api:n,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(h,p)}},r.prototype._createOverallStageTask=function(e,t,i,n){var a=this,o=t.overallTask=t.overallTask||Uh({reset:Cfe});o.context={ecModel:i,api:n,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=ke(),u=e.seriesType,c=e.getTargetSeries,h=!0,f=!1,p="";Wr(!e.createOnAllSeries,p),u?i.eachRawSeriesByType(u,d):c?c(i,n).each(d):(h=!1,N(i.getSeries(),d));function d(g){var m=g.uid,v=l.set(m,s&&s.get(m)||(f=!0,Uh({reset:Rfe,onDirty:Dfe})));v.context={model:g,overallProgress:h},v.agent=o,v.__block=h,a._pipe(g,v)}f&&o.dirty()},r.prototype._pipe=function(e,t){var i=e.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=t),n.tail&&n.tail.pipe(t),n.tail=t,t.__idxInPipeline=n.count++,t.__pipeline=n},r.wrapStageHandler=function(e,t){return He(e)&&(e={overallReset:e,seriesType:Ofe(e)}),e.uid=Bs("stageHandler"),t&&(e.visualType=t),e},r}();function Cfe(r){r.overallReset(r.ecModel,r.api,r.payload)}function Rfe(r){return r.overallProgress&&Lfe}function Lfe(){this.agent.dirty(),this.getDownstream().dirty()}function Dfe(){this.agent&&this.agent.dirty()}function Pfe(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function Ife(r){r.useClearVisual&&r.data.clearAllVisual();var e=r.resetDefines=tr(r.reset(r.model,r.ecModel,r.api,r.payload));return e.length>1?de(e,function(t,i){return kW(i)}):Nfe}var Nfe=kW(0);function kW(r){return function(e,t){var i=t.data,n=t.resetDefines[r];if(n&&n.dataEach)for(var a=e.start;a<e.end;a++)n.dataEach(i,a);else n&&n.progress&&n.progress(e,i)}}function Ufe(r){return r.data.count()}function Ofe(r){H1=null;try{r(Cx,VW)}catch{}return H1}var Cx={},VW={},H1;GW(Cx,b1);GW(VW,w1);Cx.eachSeriesByType=Cx.eachRawSeriesByType=function(r){H1=r};Cx.eachComponent=function(r){r.mainType==="series"&&r.subType&&(H1=r.subType)};function GW(r,e){for(var t in e.prototype)r[t]=zr}var wP=Afe;var HW=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],WW={color:HW,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],HW]};var _a="#B9B8CE",XW="#100C2A",W1=function(){return{axisLine:{lineStyle:{color:_a}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},YW=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],qW={darkMode:!0,color:YW,backgroundColor:XW,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:_a}},textStyle:{color:_a},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:_a}},dataZoom:{borderColor:"#71708A",textStyle:{color:_a},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:_a}},timeline:{lineStyle:{color:_a},label:{color:_a},controlStyle:{color:_a,borderColor:_a}},calendar:{itemStyle:{color:XW},dayLabel:{color:_a},monthLabel:{color:_a},yearLabel:{color:_a}},timeAxis:W1(),logAxis:W1(),valueAxis:W1(),categoryAxis:W1(),line:{symbol:"circle"},graph:{color:YW},gauge:{title:{color:_a},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:_a},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};qW.categoryAxis.splitLine.show=!1;var ZW=qW;var jW=function(){function r(){}return r.prototype.normalizeQuery=function(e){var t={},i={},n={};if(Ce(e)){var a=So(e);t.mainType=a.main||null,t.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};N(e,function(l,u){for(var c=!1,h=0;h<o.length;h++){var f=o[h],p=u.lastIndexOf(f);if(p>0&&p===u.length-f.length){var d=u.slice(0,p);d!=="data"&&(t.mainType=d,t[f.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(i[u]=l,c=!0),c||(n[u]=l)})}return{cptQuery:t,dataQuery:i,otherQuery:n}},r.prototype.filter=function(e,t){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,n,a));function c(h,f,p,d){return h[p]==null||f[d||p]===h[p]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}();var TP=["symbol","symbolSize","symbolRotate","symbolOffset"],KW=TP.concat(["symbolKeepAspect"]),JW={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData();if(r.legendIcon&&t.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o<TP.length;o++){var s=TP[o],l=r.get(s);He(l)?(a=!0,n[s]=l):i[s]=l}if(i.symbol=i.symbol||r.defaultSymbol,t.setVisual(he({legendIcon:r.legendIcon||i.symbol,symbolKeepAspect:r.get("symbolKeepAspect")},i)),e.isSeriesFiltered(r))return;var u=At(n);function c(h,f){for(var p=r.getRawValue(f),d=r.getDataParams(f),g=0;g<u.length;g++){var m=u[g];h.setItemVisual(f,m,n[m](p,d))}}return{dataEach:a?c:null}}},$W={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){if(!r.hasSymbolVisual||e.isSeriesFiltered(r))return;var t=r.getData();function i(n,a){for(var o=n.getItemModel(a),s=0;s<KW.length;s++){var l=KW[s],u=o.getShallow(l,!0);u!=null&&n.setItemVisual(a,l,u)}}return{dataEach:t.hasItemOption?i:null}}};function Rx(r,e,t){switch(t){case"color":var i=r.getItemVisual(e,"style");return i[r.getVisual("drawType")];case"opacity":return r.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return r.getItemVisual(e,t);default:}}function Mu(r,e){switch(e){case"color":var t=r.getVisual("style");return t[r.getVisual("drawType")];case"opacity":return r.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return r.getVisual(e);default:}}function EP(r,e,t,i){switch(t){case"color":var n=r.ensureUniqueItemVisual(e,"style");n[r.getVisual("drawType")]=i,r.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":r.ensureUniqueItemVisual(e,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":r.setItemVisual(e,t,i);break;default:}}function X1(r,e){function t(i,n){var a=[];return i.eachComponent({mainType:"series",subType:r,query:n},function(o){a.push(o.seriesIndex)}),a}N([[r+"ToggleSelect","toggleSelect"],[r+"Select","select"],[r+"UnSelect","unselect"]],function(i){e(i[0],function(n,a,o){n=he({},n),o.dispatchAction(he(n,{type:i[1],seriesIndex:t(a,n)}))})})}function wv(r,e,t,i,n){var a=r+e;t.isSilent(a)||i.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,u=n.selected,c=0;c<u.length;c++)if(u[c].seriesIndex===s){var h=o.getData(),f=Us(h,n.fromActionPayload);t.trigger(a,{type:a,seriesId:o.id,name:pe(f)?h.getName(f[0]):h.getName(f),selected:Ce(l)?l:he({},l)})}})}function QW(r,e,t){r.on("selectchanged",function(i){var n=t.getModel();i.isFromClick?(wv("map","selectchanged",e,n,i),wv("pie","selectchanged",e,n,i)):i.fromAction==="select"?(wv("map","selected",e,n,i),wv("pie","selected",e,n,i)):i.fromAction==="unselect"&&(wv("map","unselected",e,n,i),wv("pie","unselected",e,n,i))})}function Dl(r,e,t){for(var i;r&&!(e(r)&&(i=r,t));)r=r.__hostTarget||r.parent;return i}var zfe=Math.round(Math.random()*9),Ffe=typeof Object.defineProperty=="function",Bfe=function(){function r(){this._id="__ec_inner_"+zfe++}return r.prototype.get=function(e){return this._guard(e)[this._id]},r.prototype.set=function(e,t){var i=this._guard(e);return Ffe?Object.defineProperty(i,this._id,{value:t,enumerable:!1,configurable:!0}):i[this._id]=t,this},r.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},r.prototype.has=function(e){return!!this._guard(e)[this._id]},r.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},r}(),e6=Bfe;var kfe=pt.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(r,e){var t=e.cx,i=e.cy,n=e.width/2,a=e.height/2;r.moveTo(t,i-a),r.lineTo(t+n,i+a),r.lineTo(t-n,i+a),r.closePath()}}),Vfe=pt.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(r,e){var t=e.cx,i=e.cy,n=e.width/2,a=e.height/2;r.moveTo(t,i-a),r.lineTo(t+n,i),r.lineTo(t,i+a),r.lineTo(t-n,i),r.closePath()}}),Gfe=pt.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(r,e){var t=e.x,i=e.y,n=e.width/5*3,a=Math.max(n,e.height),o=n/2,s=o*o/(a-o),l=i-a+o+s,u=Math.asin(s/o),c=Math.cos(u)*o,h=Math.sin(u),f=Math.cos(u),p=o*.6,d=o*.7;r.moveTo(t-c,l+s),r.arc(t,l,o,Math.PI-u,Math.PI*2+u),r.bezierCurveTo(t+c-h*p,l+s+f*p,t,i-d,t,i),r.bezierCurveTo(t,i-d,t-c+h*p,l+s+f*p,t-c,l+s),r.closePath()}}),Hfe=pt.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(r,e){var t=e.height,i=e.width,n=e.x,a=e.y,o=i/3*2;r.moveTo(n,a),r.lineTo(n+o,a+t),r.lineTo(n,a+t/4*3),r.lineTo(n-o,a+t),r.lineTo(n,a),r.closePath()}}),Wfe={line:ei,rect:Rt,roundRect:Rt,square:Rt,circle:ga,diamond:Vfe,pin:Gfe,arrow:Hfe,triangle:kfe},Xfe={line:function(r,e,t,i,n){n.x1=r,n.y1=e+i/2,n.x2=r+t,n.y2=e+i/2},rect:function(r,e,t,i,n){n.x=r,n.y=e,n.width=t,n.height=i},roundRect:function(r,e,t,i,n){n.x=r,n.y=e,n.width=t,n.height=i,n.r=Math.min(t,i)/4},square:function(r,e,t,i,n){var a=Math.min(t,i);n.x=r,n.y=e,n.width=a,n.height=a},circle:function(r,e,t,i,n){n.cx=r+t/2,n.cy=e+i/2,n.r=Math.min(t,i)/2},diamond:function(r,e,t,i,n){n.cx=r+t/2,n.cy=e+i/2,n.width=t,n.height=i},pin:function(r,e,t,i,n){n.x=r+t/2,n.y=e+i/2,n.width=t,n.height=i},arrow:function(r,e,t,i,n){n.x=r+t/2,n.y=e+i/2,n.width=t,n.height=i},triangle:function(r,e,t,i,n){n.cx=r+t/2,n.cy=e+i/2,n.width=t,n.height=i}},Lx={};N(Wfe,function(r,e){Lx[e]=new r});var Yfe=pt.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(r,e,t){var i=Cp(r,e,t),n=this.shape;return n&&n.symbolType==="pin"&&e.position==="inside"&&(i.y=t.y+t.height*.4),i},buildPath:function(r,e,t){var i=e.symbolType;if(i!=="none"){var n=Lx[i];n||(i="rect",n=Lx[i]),Xfe[i](e.x,e.y,e.width,e.height,n.shape),n.buildPath(r,n.shape,t)}}});function qfe(r,e){if(this.type!=="image"){var t=this.style;this.__isEmptyBrush?(t.stroke=r,t.fill=e||"#fff",t.lineWidth=2):this.shape.symbolType==="line"?t.stroke=r:t.fill=r,this.markRedraw()}}function wr(r,e,t,i,n,a,o){var s=r.indexOf("empty")===0;s&&(r=r.substr(5,1).toLowerCase()+r.substr(6));var l;return r.indexOf("image://")===0?l=AD(r.slice(8),new ht(e,t,i,n),o?"center":"cover"):r.indexOf("path://")===0?l=hv(r.slice(7),{},new ht(e,t,i,n),o?"center":"cover"):l=new Yfe({shape:{symbolType:r,x:e,y:t,width:i,height:n}}),l.__isEmptyBrush=s,l.setColor=qfe,a&&l.setColor(a),l}function Pl(r){return pe(r)||(r=[+r,+r]),[r[0]||0,r[1]||0]}function ss(r,e){if(r!=null)return pe(r)||(r=[r,r]),[ze(r[0],e[0])||0,ze(mt(r[1],r[0]),e[1])||0]}function rd(r){return isFinite(r)}function Zfe(r,e,t){var i=e.x==null?0:e.x,n=e.x2==null?1:e.x2,a=e.y==null?0:e.y,o=e.y2==null?0:e.y2;e.global||(i=i*t.width+t.x,n=n*t.width+t.x,a=a*t.height+t.y,o=o*t.height+t.y),i=rd(i)?i:0,n=rd(n)?n:1,a=rd(a)?a:0,o=rd(o)?o:0;var s=r.createLinearGradient(i,a,n,o);return s}function jfe(r,e,t){var i=t.width,n=t.height,a=Math.min(i,n),o=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(o=o*i+t.x,s=s*n+t.y,l=l*a),o=rd(o)?o:.5,s=rd(s)?s:.5,l=l>=0&&rd(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function Dx(r,e,t){for(var i=e.type==="radial"?jfe(r,e,t):Zfe(r,e,t),n=e.colorStops,a=0;a<n.length;a++)i.addColorStop(n[a].offset,n[a].color);return i}function r6(r,e){if(r===e||!r&&!e)return!1;if(!r||!e||r.length!==e.length)return!0;for(var t=0;t<r.length;t++)if(r[t]!==e[t])return!0;return!1}function Y1(r){return parseInt(r,10)}function zh(r,e,t){var i=["width","height"][e],n=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],o=["paddingRight","paddingBottom"][e];if(t[i]!=null&&t[i]!=="auto")return parseFloat(t[i]);var s=document.defaultView.getComputedStyle(r);return(r[n]||Y1(s[i])||Y1(r.style[i]))-(Y1(s[a])||0)-(Y1(s[o])||0)|0}function Kfe(r,e){return!r||r==="solid"||!(e>0)?null:r==="dashed"?[4*e,2*e]:r==="dotted"?[e]:Dt(r)?[r]:pe(r)?r:null}function Px(r){var e=r.style,t=e.lineDash&&e.lineWidth>0&&Kfe(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(t){var n=e.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(t=de(t,function(a){return a/n}),i/=n)}return[t,i]}var Jfe=new $i(!0);function q1(r){var e=r.stroke;return!(e==null||e==="none"||!(r.lineWidth>0))}function i6(r){return typeof r=="string"&&r!=="none"}function Z1(r){var e=r.fill;return e!=null&&e!=="none"}function n6(r,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.fillOpacity*e.opacity,r.fill(),r.globalAlpha=t}else r.fill()}function a6(r,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.strokeOpacity*e.opacity,r.stroke(),r.globalAlpha=t}else r.stroke()}function j1(r,e,t){var i=X_(e.image,e.__image,t);if(ev(i)){var n=r.createPattern(i,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*Im),a.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(a)}return n}}function $fe(r,e,t,i){var n,a=q1(t),o=Z1(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var c=e.path||Jfe,h=e.__dirty;if(!i){var f=t.fill,p=t.stroke,d=o&&!!f.colorStops,g=a&&!!p.colorStops,m=o&&!!f.image,v=a&&!!p.image,_=void 0,y=void 0,x=void 0,M=void 0,S=void 0;(d||g)&&(S=e.getBoundingRect()),d&&(_=h?Dx(r,f,S):e.__canvasFillGradient,e.__canvasFillGradient=_),g&&(y=h?Dx(r,p,S):e.__canvasStrokeGradient,e.__canvasStrokeGradient=y),m&&(x=h||!e.__canvasFillPattern?j1(r,f,e):e.__canvasFillPattern,e.__canvasFillPattern=x),v&&(M=h||!e.__canvasStrokePattern?j1(r,p,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),d?r.fillStyle=_:m&&(x?r.fillStyle=x:o=!1),g?r.strokeStyle=y:v&&(M?r.strokeStyle=M:a=!1)}var w=e.getGlobalScale();c.setScale(w[0],w[1],e.segmentIgnoreThreshold);var T,C;r.setLineDash&&t.lineDash&&(n=Px(e),T=n[0],C=n[1]);var b=!0;(u||h&gh)&&(c.setDPR(r.dpr),l?c.setContext(null):(c.setContext(r),b=!1),c.reset(),e.buildPath(c,e.shape,i),c.toStatic(),e.pathUpdated()),b&&c.rebuildPath(r,l?s:1),T&&(r.setLineDash(T),r.lineDashOffset=C),i||(t.strokeFirst?(a&&a6(r,t),o&&n6(r,t)):(o&&n6(r,t),a&&a6(r,t))),T&&r.setLineDash([])}function Qfe(r,e,t){var i=e.__image=X_(t.image,e.__image,e,e.onload);if(!(!i||!ev(i))){var n=t.x||0,a=t.y||0,o=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),t.sWidth&&t.sHeight){var u=t.sx||0,c=t.sy||0;r.drawImage(i,u,c,t.sWidth,t.sHeight,n,a,o,s)}else if(t.sx&&t.sy){var u=t.sx,c=t.sy,h=o-u,f=s-c;r.drawImage(i,u,c,h,f,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function epe(r,e,t){var i,n=t.text;if(n!=null&&(n+=""),n){r.font=t.font||Jo,r.textAlign=t.textAlign,r.textBaseline=t.textBaseline;var a=void 0,o=void 0;r.setLineDash&&t.lineDash&&(i=Px(e),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),t.strokeFirst?(q1(t)&&r.strokeText(n,t.x,t.y),Z1(t)&&r.fillText(n,t.x,t.y)):(Z1(t)&&r.fillText(n,t.x,t.y),q1(t)&&r.strokeText(n,t.x,t.y)),a&&r.setLineDash([])}}var o6=["shadowBlur","shadowOffsetX","shadowOffsetY"],s6=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function p6(r,e,t,i,n){var a=!1;if(!i&&(t=t||{},e===t))return!1;if(i||e.opacity!==t.opacity){Co(r,n),a=!0;var o=Math.max(Math.min(e.opacity,1),0);r.globalAlpha=isNaN(o)?pu.opacity:o}(i||e.blend!==t.blend)&&(a||(Co(r,n),a=!0),r.globalCompositeOperation=e.blend||pu.blend);for(var s=0;s<o6.length;s++){var l=o6[s];(i||e[l]!==t[l])&&(a||(Co(r,n),a=!0),r[l]=r.dpr*(e[l]||0))}return(i||e.shadowColor!==t.shadowColor)&&(a||(Co(r,n),a=!0),r.shadowColor=e.shadowColor||pu.shadowColor),a}function l6(r,e,t,i,n){var a=Ix(e,n.inHover),o=i?null:t&&Ix(t,n.inHover)||{};if(a===o)return!1;var s=p6(r,a,o,i,n);if((i||a.fill!==o.fill)&&(s||(Co(r,n),s=!0),i6(a.fill)&&(r.fillStyle=a.fill)),(i||a.stroke!==o.stroke)&&(s||(Co(r,n),s=!0),i6(a.stroke)&&(r.strokeStyle=a.stroke)),(i||a.opacity!==o.opacity)&&(s||(Co(r,n),s=!0),r.globalAlpha=a.opacity==null?1:a.opacity),e.hasStroke()){var l=a.lineWidth,u=l/(a.strokeNoScale&&e.getLineScale?e.getLineScale():1);r.lineWidth!==u&&(s||(Co(r,n),s=!0),r.lineWidth=u)}for(var c=0;c<s6.length;c++){var h=s6[c],f=h[0];(i||a[f]!==o[f])&&(s||(Co(r,n),s=!0),r[f]=a[f]||h[1])}return s}function tpe(r,e,t,i,n){return p6(r,Ix(e,n.inHover),t&&Ix(t,n.inHover),i,n)}function d6(r,e){var t=e.transform,i=r.dpr||1;t?r.setTransform(i*t[0],i*t[1],i*t[2],i*t[3],i*t[4],i*t[5]):r.setTransform(i,0,0,i,0,0)}function rpe(r,e,t){for(var i=!1,n=0;n<r.length;n++){var a=r[n];i=i||a.isZeroArea(),d6(e,a),e.beginPath(),a.buildPath(e,a.shape),e.clip()}t.allClipped=i}function ipe(r,e){return r&&e?r[0]!==e[0]||r[1]!==e[1]||r[2]!==e[2]||r[3]!==e[3]||r[4]!==e[4]||r[5]!==e[5]:!(!r&&!e)}var u6=1,c6=2,h6=3,f6=4;function npe(r){var e=Z1(r),t=q1(r);return!(r.lineDash||!(+e^+t)||e&&typeof r.fill!="string"||t&&typeof r.stroke!="string"||r.strokePercent<1||r.strokeOpacity<1||r.fillOpacity<1)}function Co(r,e){e.batchFill&&r.fill(),e.batchStroke&&r.stroke(),e.batchFill="",e.batchStroke=""}function Ix(r,e){return e&&r.__hoverStyle||r.style}function K1(r,e){Fh(r,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function Fh(r,e,t,i){var n=e.transform;if(!e.shouldBePainted(t.viewWidth,t.viewHeight,!1,!1)){e.__dirty&=~ki,e.__isRendered=!1;return}var a=e.__clipPaths,o=t.prevElClipPaths,s=!1,l=!1;if((!o||r6(a,o))&&(o&&o.length&&(Co(r,t),r.restore(),l=s=!0,t.prevElClipPaths=null,t.allClipped=!1,t.prevEl=null),a&&a.length&&(Co(r,t),r.save(),rpe(a,r,t),s=!0),t.prevElClipPaths=a),t.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var u=t.prevEl;u||(l=s=!0);var c=e instanceof pt&&e.autoBatch&&npe(e.style);s||ipe(n,u.transform)?(Co(r,t),d6(r,e)):c||Co(r,t);var h=Ix(e,t.inHover);e instanceof pt?(t.lastDrawType!==u6&&(l=!0,t.lastDrawType=u6),l6(r,e,u,l,t),(!c||!t.batchFill&&!t.batchStroke)&&r.beginPath(),$fe(r,e,h,c),c&&(t.batchFill=h.fill||"",t.batchStroke=h.stroke||"")):e instanceof ac?(t.lastDrawType!==h6&&(l=!0,t.lastDrawType=h6),l6(r,e,u,l,t),epe(r,e,h)):e instanceof Br?(t.lastDrawType!==c6&&(l=!0,t.lastDrawType=c6),tpe(r,e,u,l,t),Qfe(r,e,h)):e.getTemporalDisplayables&&(t.lastDrawType!==f6&&(l=!0,t.lastDrawType=f6),ape(r,e,t)),c&&i&&Co(r,t),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),t.prevEl=e,e.__dirty=0,e.__isRendered=!0}function ape(r,e,t){var i=e.getDisplayables(),n=e.getTemporalDisplayables();r.save();var a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:t.viewWidth,viewHeight:t.viewHeight,inHover:t.inHover},o,s;for(o=e.getCursor(),s=i.length;o<s;o++){var l=i[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),Fh(r,l,a,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}for(var u=0,c=n.length;u<c;u++){var l=n[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),Fh(r,l,a,u===c-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,r.restore()}var AP=new e6,m6=new tc(100),v6=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Il(r,e){if(r==="none")return null;var t=e.getDevicePixelRatio(),i=e.getZr(),n=i.painter.type==="svg";r.dirty&&AP.delete(r);var a=AP.get(r);if(a)return a;var o=Ye(r,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=n?1:1/t,AP.set(r,s),r.dirty=!1,s;function l(u){for(var c=[t],h=!0,f=0;f<v6.length;++f){var p=o[v6[f]];if(p!=null&&!pe(p)&&!Ce(p)&&!Dt(p)&&typeof p!="boolean"){h=!1;break}c.push(p)}var d;if(h){d=c.join(",")+(n?"-svg":"");var g=m6.get(d);g&&(n?u.svgElement=g:u.image=g)}var m=y6(o.dashArrayX),v=ope(o.dashArrayY),_=g6(o.symbol),y=spe(m),x=_6(v),M=!n&&qn.createCanvas(),S=n&&{tag:"g",attrs:{},key:"dcl",children:[]},w=C(),T;M&&(M.width=w.width*t,M.height=w.height*t,T=M.getContext("2d")),b(),h&&m6.put(d,M||S),u.image=M,u.svgElement=S,u.svgWidth=w.width,u.svgHeight=w.height;function C(){for(var E=1,I=0,R=y.length;I<R;++I)E=G2(E,y[I]);for(var A=1,I=0,R=_.length;I<R;++I)A=G2(A,_[I].length);E*=A;var P=x*y.length*_.length;if(0)var U;return{width:Math.max(1,Math.min(E,o.maxTileWidth)),height:Math.max(1,Math.min(P,o.maxTileHeight))}}function b(){T&&(T.clearRect(0,0,M.width,M.height),o.backgroundColor&&(T.fillStyle=o.backgroundColor,T.fillRect(0,0,M.width,M.height)));for(var E=0,I=0;I<v.length;++I)E+=v[I];if(E<=0)return;for(var R=-x,A=0,P=0,U=0;R<w.height;){if(A%2===0){for(var B=P/2%_.length,z=0,k=0,G=0;z<w.width*2;){for(var Y=0,I=0;I<m[U].length;++I)Y+=m[U][I];if(Y<=0)break;if(k%2===0){var J=(1-o.symbolSize)*.5,Q=z+m[U][k]*J,V=R+v[A]*J,K=m[U][k]*o.symbolSize,ae=v[A]*o.symbolSize,ve=G/2%_[B].length;ue(Q,V,K,ae,_[B][ve])}z+=m[U][k],++G,++k,k===m[U].length&&(k=0)}++U,U===m.length&&(U=0)}R+=v[A],++P,++A,A===v.length&&(A=0)}function ue(se,Ee,q,H,We){var _e=n?1:t,xe=wr(We,se*_e,Ee*_e,q*_e,H*_e,o.color,o.symbolKeepAspect);if(n){var Le=i.painter.renderOneToVNode(xe);Le&&S.children.push(Le)}else K1(T,xe)}}}}function g6(r){if(!r||r.length===0)return[["rect"]];if(Ce(r))return[[r]];for(var e=!0,t=0;t<r.length;++t)if(!Ce(r[t])){e=!1;break}if(e)return g6([r]);for(var i=[],t=0;t<r.length;++t)Ce(r[t])?i.push([r[t]]):i.push(r[t]);return i}function y6(r){if(!r||r.length===0)return[[0,0]];if(Dt(r)){var e=Math.ceil(r);return[[e,e]]}for(var t=!0,i=0;i<r.length;++i)if(!Dt(r[i])){t=!1;break}if(t)return y6([r]);for(var n=[],i=0;i<r.length;++i)if(Dt(r[i])){var e=Math.ceil(r[i]);n.push([e,e])}else{var e=de(r[i],function(s){return Math.ceil(s)});e.length%2===1?n.push(e.concat(e)):n.push(e)}return n}function ope(r){if(!r||typeof r=="object"&&r.length===0)return[0,0];if(Dt(r)){var e=Math.ceil(r);return[e,e]}var t=de(r,function(i){return Math.ceil(i)});return r.length%2?t.concat(t):t}function spe(r){return de(r,function(e){return _6(e)})}function _6(r){for(var e=0,t=0;t<r.length;++t)e+=r[t];return r.length%2===1?e*2:e}function CP(r,e){r.eachRawSeries(function(t){if(!r.isSeriesFiltered(t)){var i=t.getData();i.hasItemVisual()&&i.each(function(o){var s=i.getItemVisual(o,"decal");if(s){var l=i.ensureUniqueItemVisual(o,"style");l.decal=Il(s,e)}});var n=i.getVisual("decal");if(n){var a=i.getVisual("style");a.decal=Il(n,e)}}})}var lpe=new Ni,Ws=lpe;var x6={};function S6(r,e){x6[r]=e}function M6(r){return x6[r]}var upe=1,cpe=800,hpe=900,fpe=1e3,ppe=2e3,dpe=5e3,P6=1e3,mpe=1100,BP=2e3,I6=3e3,vpe=4e3,tT=4500,gpe=4600,ype=5e3,_pe=6e3,N6=7e3,U6={PROCESSOR:{FILTER:fpe,SERIES_FILTER:cpe,STATISTIC:dpe},VISUAL:{LAYOUT:P6,PROGRESSIVE_LAYOUT:mpe,GLOBAL:BP,CHART:I6,POST_CHART_LAYOUT:gpe,COMPONENT:vpe,BRUSH:ype,CHART_ITEM:tT,ARIA:_pe,DECAL:N6}},ea="__flagInMainProcess",Ro="__pendingUpdate",RP="__needsUpdateStatus",b6=/^[a-zA-Z0-9_]+$/,LP="__connectUpdateStatus",w6=0,xpe=1,Spe=2;function O6(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.isDisposed()){this.id;return}return F6(this,r,e)}}function z6(r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return F6(this,r,e)}}function F6(r,e,t){return t[0]=t[0]&&t[0].toLowerCase(),Ni.prototype[e].apply(r,t)}var B6=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ni),k6=B6.prototype;k6.on=z6("on");k6.off=z6("off");var Tv,DP,J1,Bh,PP,IP,NP,Nx,Ux,T6,E6,UP,A6,$1,C6,V6,Xs,R6,G6=function(r){Z(e,r);function e(t,i,n){var a=r.call(this,new jW)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},a._pendingActions=[],n=n||{},Ce(i)&&(i=H6[i]),a._dom=t;var o="canvas",s="auto",l=!1;if(0)var u;n.ssr&&sH(function(p){var d=it(p),g=d.dataIndex;if(g!=null){var m=ke();return m.set("series_index",d.seriesIndex),m.set("data_index",g),d.ssrType&&m.set("ssr_type",d.ssrType),m}});var c=a._zr=B2(t,{renderer:n.renderer||o,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height,ssr:n.ssr,useDirtyRect:mt(n.useDirtyRect,l),useCoarsePointer:mt(n.useCoarsePointer,s),pointerSize:n.pointerSize});a._ssr=n.ssr,a._throttledZrFlush=Ex(Be(c.flush,c),17),i=Qe(i),i&&T1(i,!0),a._theme=i,a._locale=b5(n.locale||u1),a._coordSysMgr=new gc;var h=a._api=C6(a);function f(p,d){return p.__prio-d.__prio}return vp(eT,f),vp(OP,f),a._scheduler=new wP(a,h,OP,eT),a._messageCenter=new B6,a._initEvents(),a.resize=Be(a.resize,a),c.animation.on("frame",a._onframe,a),T6(c,a),E6(c,a),cp(a),a}return e.prototype._onframe=function(){if(!this._disposed){R6(this);var t=this._scheduler;if(this[Ro]){var i=this[Ro].silent;this[ea]=!0;try{Tv(this),Bh.update.call(this,null,this[Ro].updateParams)}catch(l){throw this[ea]=!1,this[Ro]=null,l}this._zr.flush(),this[ea]=!1,this[Ro]=null,Nx.call(this,i),Ux.call(this,i)}else if(t.unfinished){var n=upe,a=this._model,o=this._api;t.unfinished=!1;do{var s=+new Date;t.performSeriesTasks(a),t.performDataProcessorTasks(a),IP(this,a),t.performVisualTasks(a),$1(this,this._model,o,"remain",{}),n-=+new Date-s}while(n>0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,i,n){if(!this[ea]){if(this._disposed){this.id;return}var a,o,s;if(qe(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[ea]=!0,!this._model||i){var l=new J5(this._api),u=this._theme,c=this._model=new b1;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:o},zP);var h={seriesTransition:s,optionChanged:!0};if(n)this[Ro]={silent:a,updateParams:h},this[ea]=!1,this.getZr().wakeUp();else{try{Tv(this),Bh.update.call(this,null,h)}catch(f){throw this[Ro]=null,this[ea]=!1,f}this._ssr||this._zr.flush(),this[Ro]=null,this[ea]=!1,Nx.call(this,a),Ux.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Bt.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var i=this._zr.painter;return i.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(Bt.svgSupported){var t=this._zr,i=t.storage.getDisplayList();return N(i,function(n){n.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var i=t.excludeComponents,n=this._model,a=[],o=this;N(i,function(l){n.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return N(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var i=t.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(L6[n]){var l=s,u=s,c=-s,h=-s,f=[],p=t&&t.pixelRatio||this.getDevicePixelRatio();N(zx,function(y,x){if(y.group===n){var M=i?y.getZr().painter.getSvgDom().innerHTML:y.renderToCanvas(Qe(t)),S=y.getDom().getBoundingClientRect();l=a(S.left,l),u=a(S.top,u),c=o(S.right,c),h=o(S.bottom,h),f.push({dom:M,left:S.left,top:S.top})}}),l*=p,u*=p,c*=p,h*=p;var d=c-l,g=h-u,m=qn.createCanvas(),v=B2(m,{renderer:i?"svg":"canvas"});if(v.resize({width:d,height:g}),i){var _="";return N(f,function(y){var x=y.left-l,M=y.top-u;_+='<g transform="translate('+x+","+M+')">'+y.dom+"</g>"}),v.painter.getSvgRoot().innerHTML=_,t.connectedBackgroundColor&&v.painter.setBackgroundColor(t.connectedBackgroundColor),v.refreshImmediately(),v.painter.toDataURL()}else return t.connectedBackgroundColor&&v.add(new Rt({shape:{x:0,y:0,width:d,height:g},style:{fill:t.connectedBackgroundColor}})),N(f,function(y){var x=new Br({style:{x:y.left*p-l,y:y.top*p-u,image:y.dom}});v.add(x)}),v.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,i){return PP(this,"convertToPixel",t,i)},e.prototype.convertFromPixel=function(t,i){return PP(this,"convertFromPixel",t,i)},e.prototype.containPixel=function(t,i){if(this._disposed){this.id;return}var n=this._model,a,o=bh(n,t);return N(o,function(s,l){l.indexOf("Models")>=0&&N(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(i);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(i,u))}},this)},this),!!a},e.prototype.getVisual=function(t,i){var n=this._model,a=bh(n,t,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?Rx(s,l,i):Mu(s,i)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;N(Mpe,function(i){var n=function(a){var o=t.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&Dl(s,function(d){var g=it(d);if(g&&g.dataIndex!=null){var m=g.dataModel||o.getSeriesByIndex(g.seriesIndex);return l=m&&m.getDataParams(g.dataIndex,g.dataType,s)||{},!0}else if(g.eventData)return l=he({},g.eventData),!0},!0),l){var c=l.componentType,h=l.componentIndex;(c==="markLine"||c==="markPoint"||c==="markArea")&&(c="series",h=l.seriesIndex);var f=c&&h!=null&&o.getComponent(c,h),p=f&&t[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];l.event=a,l.type=i,t._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:f,view:p},t.trigger(i,l)}};n.zrEventfulCallAtLast=!0,t._zr.on(i,n,t)}),N(Ox,function(i,n){t._messageCenter.on(n,function(a){this.trigger(n,a)},t)}),N(["selectchanged"],function(i){t._messageCenter.on(i,function(n){this.trigger(i,n)},t)}),QW(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var t=this.getDom();t&&W2(this.getDom(),VP,"");var i=this,n=i._api,a=i._model;N(i._componentsViews,function(o){o.dispose(a,n)}),N(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete zx[i.id]},e.prototype.resize=function(t){if(!this[ea]){if(this._disposed){this.id;return}this._zr.resize(t);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=t&&t.silent;this[Ro]&&(a==null&&(a=this[Ro].silent),n=!0,this[Ro]=null),this[ea]=!0;try{n&&Tv(this),Bh.update.call(this,{type:"resize",animation:he({duration:0},t&&t.animation)})}catch(o){throw this[ea]=!1,o}this[ea]=!1,Nx.call(this,a),Ux.call(this,a)}}},e.prototype.showLoading=function(t,i){if(this._disposed){this.id;return}if(qe(t)&&(i=t,t=""),t=t||"default",this.hideLoading(),!!FP[t]){var n=FP[t](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var i=he({},t);return i.type=Ox[t.type],i},e.prototype.dispatchAction=function(t,i){if(this._disposed){this.id;return}if(qe(i)||(i={silent:!!i}),!!Q1[t.type]&&this._model){if(this[ea]){this._pendingActions.push(t);return}var n=i.silent;NP.call(this,t,n);var a=i.flush;a?this._zr.flush():a!==!1&&Bt.browser.weChat&&this._throttledZrFlush(),Nx.call(this,n),Ux.call(this,n)}},e.prototype.updateLabelLayout=function(){Ws.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var i=t.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){Tv=function(h){var f=h._scheduler;f.restorePipelines(h._model),f.prepareStageTasks(),DP(h,!0),DP(h,!1),f.plan()},DP=function(h,f){for(var p=h._model,d=h._scheduler,g=f?h._componentsViews:h._chartsViews,m=f?h._componentsMap:h._chartsMap,v=h._zr,_=h._api,y=0;y<g.length;y++)g[y].__alive=!1;f?p.eachComponent(function(S,w){S!=="series"&&x(w)}):p.eachSeries(x);function x(S){var w=S.__requireNewView;S.__requireNewView=!1;var T="_ec_"+S.id+"_"+S.type,C=!w&&m[T];if(!C){var b=So(S.type),E=f?ir.getClass(b.main,b.sub):Zt.getClass(b.sub);C=new E,C.init(p,_),m[T]=C,g.push(C),v.add(C.group)}S.__viewId=C.__id=T,C.__alive=!0,C.__model=S,C.group.__ecComponentInfo={mainType:S.mainType,index:S.componentIndex},!f&&d.prepareView(C,S,p,_)}for(var y=0;y<g.length;){var M=g[y];M.__alive?y++:(!f&&M.renderTask.dispose(),v.remove(M.group),M.dispose(p,_),g.splice(y,1),m[M.__id]===M&&delete m[M.__id],M.__id=M.group.__ecComponentInfo=null)}},J1=function(h,f,p,d,g){var m=h._model;if(m.setUpdatePayload(p),!d){N([].concat(h._componentsViews).concat(h._chartsViews),M);return}var v={};v[d+"Id"]=p[d+"Id"],v[d+"Index"]=p[d+"Index"],v[d+"Name"]=p[d+"Name"];var _={mainType:d,query:v};g&&(_.subType=g);var y=p.excludeSeriesId,x;y!=null&&(x=ke(),N(tr(y),function(S){var w=Kr(S,null);w!=null&&x.set(w,!0)})),m&&m.eachComponent(_,function(S){var w=x&&x.get(S.id)!=null;if(!w)if(_D(p))if(S instanceof $t)p.type===Dh&&!p.notBlur&&!S.get(["emphasis","disabled"])&&w4(S,p,h._api);else{var T=Hw(S.mainType,S.componentIndex,p.name,h._api),C=T.focusSelf,b=T.dispatchers;p.type===Dh&&C&&!p.notBlur&&kw(S.mainType,S.componentIndex,h._api),b&&N(b,function(E){p.type===Dh?Zn(E):jn(E)})}else Xw(p)&&S instanceof $t&&(A4(S,p,h._api),yD(S),Xs(h))},h),m&&m.eachComponent(_,function(S){var w=x&&x.get(S.id)!=null;w||M(h[d==="series"?"_chartsMap":"_componentsMap"][S.__viewId])},h);function M(S){S&&S.__alive&&S[f]&&S[f](S.__model,m,h._api,p)}},Bh={prepareAndUpdate:function(h){Tv(this),Bh.update.call(this,h,{optionChanged:h.newOption!=null})},update:function(h,f){var p=this._model,d=this._api,g=this._zr,m=this._coordSysMgr,v=this._scheduler;if(p){p.setUpdatePayload(h),v.restoreData(p,h),v.performSeriesTasks(p),m.create(p,d),v.performDataProcessorTasks(p,h),IP(this,p),m.update(p,d),t(p),v.performVisualTasks(p,h),UP(this,p,d,h,f);var _=p.get("backgroundColor")||"transparent",y=p.get("darkMode");g.setBackgroundColor(_),y!=null&&y!=="auto"&&g.setDarkMode(y),Ws.trigger("afterupdate",p,d)}},updateTransform:function(h){var f=this,p=this._model,d=this._api;if(p){p.setUpdatePayload(h);var g=[];p.eachComponent(function(v,_){if(v!=="series"){var y=f.getViewOfComponentModel(_);if(y&&y.__alive)if(y.updateTransform){var x=y.updateTransform(_,p,d,h);x&&x.update&&g.push(y)}else g.push(y)}});var m=ke();p.eachSeries(function(v){var _=f._chartsMap[v.__viewId];if(_.updateTransform){var y=_.updateTransform(v,p,d,h);y&&y.update&&m.set(v.uid,1)}else m.set(v.uid,1)}),t(p),this._scheduler.performVisualTasks(p,h,{setDirty:!0,dirtyMap:m}),$1(this,p,d,h,{},m),Ws.trigger("afterupdate",p,d)}},updateView:function(h){var f=this._model;f&&(f.setUpdatePayload(h),Zt.markUpdateMethod(h,"updateView"),t(f),this._scheduler.performVisualTasks(f,h,{setDirty:!0}),UP(this,f,this._api,h,{}),Ws.trigger("afterupdate",f,this._api))},updateVisual:function(h){var f=this,p=this._model;p&&(p.setUpdatePayload(h),p.eachSeries(function(d){d.getData().clearAllVisual()}),Zt.markUpdateMethod(h,"updateVisual"),t(p),this._scheduler.performVisualTasks(p,h,{visualType:"visual",setDirty:!0}),p.eachComponent(function(d,g){if(d!=="series"){var m=f.getViewOfComponentModel(g);m&&m.__alive&&m.updateVisual(g,p,f._api,h)}}),p.eachSeries(function(d){var g=f._chartsMap[d.__viewId];g.updateVisual(d,p,f._api,h)}),Ws.trigger("afterupdate",p,this._api))},updateLayout:function(h){Bh.update.call(this,h)}},PP=function(h,f,p,d){if(h._disposed){h.id;return}for(var g=h._model,m=h._coordSysMgr.getCoordinateSystems(),v,_=bh(g,p),y=0;y<m.length;y++){var x=m[y];if(x[f]&&(v=x[f](g,_,d))!=null)return v}},IP=function(h,f){var p=h._chartsMap,d=h._scheduler;f.eachSeries(function(g){d.updateStreamModes(g,p[g.__viewId])})},NP=function(h,f){var p=this,d=this.getModel(),g=h.type,m=h.escapeConnect,v=Q1[g],_=v.actionInfo,y=(_.update||"update").split(":"),x=y.pop(),M=y[0]!=null&&So(y[0]);this[ea]=!0;var S=[h],w=!1;h.batch&&(w=!0,S=de(h.batch,function(A){return A=Ye(he({},A),h),A.batch=null,A}));var T=[],C,b=Xw(h),E=_D(h);if(E&&gD(this._api),N(S,function(A){if(C=v.action(A,p._model,p._api),C=C||he({},A),C.type=_.event||C.type,T.push(C),E){var P=H_(h),U=P.queryOptionMap,B=P.mainTypeSpecified,z=B?U.keys()[0]:"series";J1(p,x,A,z),Xs(p)}else b?(J1(p,x,A,"series"),Xs(p)):M&&J1(p,x,A,M.main,M.sub)}),x!=="none"&&!E&&!b&&!M)try{this[Ro]?(Tv(this),Bh.update.call(this,h),this[Ro]=null):Bh[x].call(this,h)}catch(A){throw this[ea]=!1,A}if(w?C={type:_.event||g,escapeConnect:m,batch:T}:C=T[0],this[ea]=!1,!f){var I=this._messageCenter;if(I.trigger(C.type,C),b){var R={type:"selectchanged",escapeConnect:m,selected:C4(d),isFromClick:h.isFromClick||!1,fromAction:h.type,fromActionPayload:h};I.trigger(R.type,R)}}},Nx=function(h){for(var f=this._pendingActions;f.length;){var p=f.shift();NP.call(this,p,h)}},Ux=function(h){!h&&this.trigger("updated")},T6=function(h,f){h.on("rendered",function(p){f.trigger("rendered",p),h.animation.isFinished()&&!f[Ro]&&!f._scheduler.unfinished&&!f._pendingActions.length&&f.trigger("finished")})},E6=function(h,f){h.on("mouseover",function(p){var d=p.target,g=Dl(d,Ph);g&&(T4(g,p,f._api),Xs(f))}).on("mouseout",function(p){var d=p.target,g=Dl(d,Ph);g&&(E4(g,p,f._api),Xs(f))}).on("click",function(p){var d=p.target,g=Dl(d,function(_){return it(_).dataIndex!=null},!0);if(g){var m=g.selected?"unselect":"select",v=it(g);f._api.dispatchAction({type:m,dataType:v.dataType,dataIndexInside:v.dataIndex,seriesIndex:v.seriesIndex,isFromClick:!0})}})};function t(h){h.clearColorPalette(),h.eachSeries(function(f){f.clearColorPalette()})}function i(h){var f=[],p=[],d=!1;if(h.eachComponent(function(_,y){var x=y.get("zlevel")||0,M=y.get("z")||0,S=y.getZLevelKey();d=d||!!S,(_==="series"?p:f).push({zlevel:x,z:M,idx:y.componentIndex,type:_,key:S})}),d){var g=f.concat(p),m,v;vp(g,function(_,y){return _.zlevel===y.zlevel?_.z-y.z:_.zlevel-y.zlevel}),N(g,function(_){var y=h.getComponent(_.type,_.idx),x=_.zlevel,M=_.key;m!=null&&(x=Math.max(m,x)),M?(x===m&&M!==v&&x++,v=M):v&&(x===m&&x++,v=""),m=x,y.setZLevel(x)})}}UP=function(h,f,p,d,g){i(f),A6(h,f,p,d,g),N(h._chartsViews,function(m){m.__alive=!1}),$1(h,f,p,d,g),N(h._chartsViews,function(m){m.__alive||m.remove(f,p)})},A6=function(h,f,p,d,g,m){N(m||h._componentsViews,function(v){var _=v.__model;u(_,v),v.render(_,f,p,d),s(_,v),c(_,v)})},$1=function(h,f,p,d,g,m){var v=h._scheduler;g=he(g||{},{updatedSeries:f.getSeries()}),Ws.trigger("series:beforeupdate",f,p,g);var _=!1;f.eachSeries(function(y){var x=h._chartsMap[y.__viewId];x.__alive=!0;var M=x.renderTask;v.updatePayload(M,d),u(y,x),m&&m.get(y.uid)&&M.dirty(),M.perform(v.getPerformArgs(M))&&(_=!0),x.group.silent=!!y.get("silent"),o(y,x),yD(y)}),v.unfinished=_||v.unfinished,Ws.trigger("series:layoutlabels",f,p,g),Ws.trigger("series:transition",f,p,g),f.eachSeries(function(y){var x=h._chartsMap[y.__viewId];s(y,x),c(y,x)}),a(h,f),Ws.trigger("series:afterupdate",f,p,g)},Xs=function(h){h[RP]=!0,h.getZr().wakeUp()},R6=function(h){h[RP]&&(h.getZr().storage.traverse(function(f){uc(f)||n(f)}),h[RP]=!1)};function n(h){for(var f=[],p=h.currentStates,d=0;d<p.length;d++){var g=p[d];g==="emphasis"||g==="blur"||g==="select"||f.push(g)}h.selected&&h.states.select&&f.push("select"),h.hoverState===K_&&h.states.emphasis?f.push("emphasis"):h.hoverState===Bp&&h.states.blur&&f.push("blur"),h.useStates(f)}function a(h,f){var p=h._zr,d=p.storage,g=0;d.traverse(function(m){m.isGroup||g++}),g>f.get("hoverLayerThreshold")&&!Bt.node&&!Bt.worker&&f.eachSeries(function(m){if(!m.preventUsingHoverLayer){var v=h._chartsMap[m.__viewId];v.__alive&&v.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function o(h,f){var p=h.get("blendMode")||null;f.eachRendered(function(d){d.isGroup||(d.style.blend=p)})}function s(h,f){if(!h.preventAutoZ){var p=h.get("z")||0,d=h.get("zlevel")||0;f.eachRendered(function(g){return l(g,p,d,-1/0),!0})}}function l(h,f,p,d){var g=h.getTextContent(),m=h.getTextGuideLine(),v=h.isGroup;if(v)for(var _=h.childrenRef(),y=0;y<_.length;y++)d=Math.max(l(_[y],f,p,d),d);else h.z=f,h.zlevel=p,d=Math.max(h.z2,d);if(g&&(g.z=f,g.zlevel=p,isFinite(d)&&(g.z2=d+2)),m){var x=h.textGuideLineConfig;m.z=f,m.zlevel=p,isFinite(d)&&(m.z2=d+(x&&x.showAbove?1:-1))}return d}function u(h,f){f.eachRendered(function(p){if(!uc(p)){var d=p.getTextContent(),g=p.getTextGuideLine();p.stateTransition&&(p.stateTransition=null),d&&d.stateTransition&&(d.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),p.hasState()?(p.prevStates=p.currentStates,p.clearStates()):p.prevStates&&(p.prevStates=null)}})}function c(h,f){var p=h.getModel("stateAnimation"),d=h.isAnimationEnabled(),g=p.get("duration"),m=g>0?{duration:g,delay:p.get("delay"),easing:p.get("easing")}:null;f.eachRendered(function(v){if(v.states&&v.states.emphasis){if(uc(v))return;if(v instanceof pt&&D4(v),v.__dirty){var _=v.prevStates;_&&v.useStates(_)}if(d){v.stateTransition=m;var y=v.getTextContent(),x=v.getTextGuideLine();y&&(y.stateTransition=m),x&&(x.stateTransition=m)}v.__dirty&&n(v)}})}C6=function(h){return new(function(f){Z(p,f);function p(){return f!==null&&f.apply(this,arguments)||this}return p.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},p.prototype.getComponentByElement=function(d){for(;d;){var g=d.__ecComponentInfo;if(g!=null)return h._model.getComponent(g.mainType,g.index);d=d.parent}},p.prototype.enterEmphasis=function(d,g){Zn(d,g),Xs(h)},p.prototype.leaveEmphasis=function(d,g){jn(d,g),Xs(h)},p.prototype.enterBlur=function(d){Gw(d),Xs(h)},p.prototype.leaveBlur=function(d){Q_(d),Xs(h)},p.prototype.enterSelect=function(d){mD(d),Xs(h)},p.prototype.leaveSelect=function(d){vD(d),Xs(h)},p.prototype.getModel=function(){return h.getModel()},p.prototype.getViewOfComponentModel=function(d){return h.getViewOfComponentModel(d)},p.prototype.getViewOfSeriesModel=function(d){return h.getViewOfSeriesModel(d)},p}(w1))(h)},V6=function(h){function f(p,d){for(var g=0;g<p.length;g++){var m=p[g];m[LP]=d}}N(Ox,function(p,d){h._messageCenter.on(d,function(g){if(L6[h.group]&&h[LP]!==w6){if(g&&g.escapeConnect)return;var m=h.makeActionFromEvent(g),v=[];N(zx,function(_){_!==h&&_.group===h.group&&v.push(_)}),f(v,w6),N(v,function(_){_[LP]!==xpe&&_.dispatchAction(m)}),f(v,Spe)}})})}}(),e}(Ni),kP=G6.prototype;kP.on=O6("on");kP.off=O6("off");kP.one=function(r,e,t){var i=this;function n(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];e&&e.apply&&e.apply(this,a),i.off(r,n)}this.on.call(this,r,n,t)};var Mpe=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var Q1={},Ox={},OP=[],zP=[],eT=[],H6={},FP={},zx={},L6={},bpe=+new Date-0,Z5e=+new Date-0,VP="_echarts_instance_";function Ev(r,e,t){var i=!(t&&t.ssr);if(i){var n=wpe(r);if(n)return n}var a=new G6(r,e,t);return a.id="ec_"+bpe++,zx[a.id]=a,i&&W2(r,VP,a.id),V6(a),Ws.trigger("afterinit",a),a}function wpe(r){return zx[wH(r,VP)]}function W6(r,e){H6[r]=e}function GP(r){yt(zP,r)<0&&zP.push(r)}function HP(r,e){WP(OP,r,e,ppe)}function X6(r){rT("afterinit",r)}function Y6(r){rT("afterupdate",r)}function rT(r,e){Ws.on(r,e)}function xa(r,e,t){He(e)&&(t=e,e="");var i=qe(r)?r.type:[r,r={event:e}][0];r.event=(r.event||i).toLowerCase(),e=r.event,!Ox[e]&&(Wr(b6.test(i)&&b6.test(e)),Q1[i]||(Q1[i]={action:t,actionInfo:r}),Ox[e]=i)}function q6(r,e){gc.register(r,e)}function Z6(r,e){WP(eT,r,e,P6,"layout")}function kh(r,e){WP(eT,r,e,I6,"visual")}var D6=[];function WP(r,e,t,i,n){if((He(e)||qe(e))&&(t=e,e=i),!(yt(D6,t)>=0)){D6.push(t);var a=wP.wrapStageHandler(t,n);a.__prio=e,a.__raw=t,r.push(a)}}function XP(r,e){FP[r]=e}function j6(r,e,t){var i=M6("registerMap");i&&i(r,e,t)}var K6=mW;kh(BP,zW);kh(tT,FW);kh(tT,BW);kh(BP,JW);kh(tT,$W);kh(N6,CP);GP(T1);HP(hpe,aP);XP("default",bP);xa({type:Dh,event:Dh,update:Dh},zr);xa({type:J_,event:J_,update:J_},zr);xa({type:nv,event:nv,update:nv},zr);xa({type:$_,event:$_,update:$_},zr);xa({type:av,event:av,update:av},zr);W6("light",WW);W6("dark",ZW);var J6=[],Tpe={registerPreprocessor:GP,registerProcessor:HP,registerPostInit:X6,registerPostUpdate:Y6,registerUpdateLifecycle:rT,registerAction:xa,registerCoordinateSystem:q6,registerLayout:Z6,registerVisual:kh,registerTransform:K6,registerLoading:XP,registerMap:j6,registerImpl:S6,PRIORITY:U6,ComponentModel:Nt,ComponentView:ir,SeriesModel:$t,ChartView:Zt,registerComponentModel:function(r){Nt.registerClass(r)},registerComponentView:function(r){ir.registerClass(r)},registerSeriesModel:function(r){$t.registerClass(r)},registerChartView:function(r){Zt.registerClass(r)},registerSubTypeDefaulter:function(r,e){Nt.registerSubTypeDefaulter(r,e)},registerPainter:function(r,e){aH(r,e)}};function Ot(r){if(pe(r)){N(r,function(e){Ot(e)});return}yt(J6,r)>=0||(J6.push(r),He(r)&&(r={install:r}),r.install(Tpe))}function Fx(r){return r==null?0:r.length||1}function $6(r){return r}var Epe=function(){function r(e,t,i,n,a,o){this._old=e,this._new=t,this._oldKeyGetter=i||$6,this._newKeyGetter=n||$6,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(e){return this._add=e,this},r.prototype.update=function(e){return this._update=e,this},r.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},r.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},r.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},r.prototype.remove=function(e){return this._remove=e,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var e=this._old,t=this._new,i={},n=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,n,"_oldKeyGetter"),this._initIndexMap(t,i,a,"_newKeyGetter");for(var o=0;o<e.length;o++){var s=n[o],l=i[s],u=Fx(l);if(u>1){var c=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(c,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},r.prototype._executeMultiple=function(){var e=this._old,t=this._new,i={},n={},a=[],o=[];this._initIndexMap(e,i,a,"_oldKeyGetter"),this._initIndexMap(t,n,o,"_newKeyGetter");for(var s=0;s<a.length;s++){var l=a[s],u=i[l],c=n[l],h=Fx(u),f=Fx(c);if(h>1&&f===1)this._updateManyToOne&&this._updateManyToOne(c,u),n[l]=null;else if(h===1&&f>1)this._updateOneToMany&&this._updateOneToMany(c,u),n[l]=null;else if(h===1&&f===1)this._update&&this._update(c,u),n[l]=null;else if(h>1&&f>1)this._updateManyToMany&&this._updateManyToMany(c,u),n[l]=null;else if(h>1)for(var p=0;p<h;p++)this._remove&&this._remove(u[p]);else this._remove&&this._remove(u)}this._performRestAdd(o,n)},r.prototype._performRestAdd=function(e,t){for(var i=0;i<e.length;i++){var n=e[i],a=t[n],o=Fx(a);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(a[s]);else o===1&&this._add&&this._add(a);t[n]=null}},r.prototype._initIndexMap=function(e,t,i,n){for(var a=this._diffModeMultiple,o=0;o<e.length;o++){var s="_ec_"+this[n](e[o],o);if(a||(i[o]=s),!!t){var l=t[s],u=Fx(l);u===0?(t[s]=o,a&&i.push(s)):u===1?t[s]=[l,o]:l.push(o)}}},r}(),In=Epe;var Ape=function(){function r(e,t){this._encode=e,this._schema=t}return r.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},r.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},r}();function Q6(r,e){var t={},i=t.encode={},n=ke(),a=[],o=[],s={};N(r.dimensions,function(f){var p=r.getDimensionInfo(f),d=p.coordDim;if(d){var g=p.coordDimIndex;YP(i,d)[g]=f,p.isExtraCoord||(n.set(d,1),Cpe(p.type)&&(a[0]=f),YP(s,d)[g]=r.getDimensionIndex(p.name)),p.defaultTooltip&&o.push(f)}y1.each(function(m,v){var _=YP(i,v),y=p.otherDims[v];y!=null&&y!==!1&&(_[y]=p.name)})});var l=[],u={};n.each(function(f,p){var d=i[p];u[p]=d[0],l=l.concat(d)}),t.dataDimsOnCoord=l,t.dataDimIndicesOnCoord=de(l,function(f){return r.getDimensionInfo(f).storeDimIndex}),t.encodeFirstDimNotExtra=u;var c=i.label;c&&c.length&&(a=c.slice());var h=i.tooltip;return h&&h.length?o=h.slice():o.length||(o=a.slice()),i.defaultedLabel=a,i.defaultedTooltip=o,t.userOutput=new Ape(s,e),t}function YP(r,e){return r.hasOwnProperty(e)||(r[e]=[]),r[e]}function id(r){return r==="category"?"ordinal":r==="time"?"time":"float"}function Cpe(r){return!(r==="ordinal"||r==="time")}var Rpe=function(){function r(e){this.otherDims={},e!=null&&he(this,e)}return r}(),Av=Rpe;var Lpe=xt(),Dpe={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},qP=function(){function r(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return r.prototype.isDimensionOmitted=function(){return this._dimOmitted},r.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=jP(this.source)))},r.prototype.getSourceDimensionIndex=function(e){return mt(this._dimNameMap.get(e),-1)},r.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},r.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=A1(this.source),i=!KP(e),n="",a=[],o=0,s=0;o<e;o++){var l=void 0,u=void 0,c=void 0,h=this.dimensions[s];if(h&&h.storeDimIndex===o)l=t?h.name:null,u=h.type,c=h.ordinalMeta,s++;else{var f=this.getSourceDimension(o);f&&(l=t?f.name:null,u=f.type)}a.push({property:l,type:u,ordinalMeta:c}),t&&l!=null&&(!h||!h.isCalculationCoord)&&(n+=i?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),n+="$",n+=Dpe[u]||"f",c&&(n+=c.uid),n+="$"}var p=this.source,d=[p.seriesLayoutBy,p.startIndex,n].join("$$");return{dimensions:a,hash:d}},r.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,i=0;t<this._fullDimCount;t++){var n=void 0,a=this.dimensions[i];if(a&&a.storeDimIndex===t)a.isCalculationCoord||(n=a.name),i++;else{var o=this.getSourceDimension(t);o&&(n=o.name)}e.push(n)}return e},r.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},r}();function nT(r){return r instanceof qP}function ZP(r){for(var e=ke(),t=0;t<(r||[]).length;t++){var i=r[t],n=qe(i)?i.name:i;n!=null&&e.get(n)==null&&e.set(n,t)}return e}function jP(r){var e=Lpe(r);return e.dimNameMap||(e.dimNameMap=ZP(r.dimensionsDefine))}function KP(r){return r>30}var Bx=qe,Vh=de,Ppe=typeof Int32Array>"u"?Array:Int32Array,Ipe="e\0\0",e8=-1,Npe=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Upe=["_approximateExtent"],t8,aT,kx,Vx,JP,oT,$P,Ope=function(){function r(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i,n=!1;nT(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(n=!0,i=e),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c<i.length;c++){var h=i[c],f=Ce(h)?new Av({name:h}):h instanceof Av?h:new Av(h),p=f.name;f.type=f.type||"float",f.coordDim||(f.coordDim=p,f.coordDimIndex=0);var d=f.otherDims=f.otherDims||{};o.push(p),a[p]=f,u[p]!=null&&(l=!0),f.createInvertedIndices&&(s[p]=[]),d.itemName===0&&(this._nameDimIdx=c),d.itemId===0&&(this._idDimIdx=c),n&&(f.storeDimIndex=c)}if(this.dimensions=o,this._dimInfos=a,this._initGetDimensionInfo(l),this.hostModel=t,this._invertedIndicesMap=s,this._dimOmitted){var g=this._dimIdxToName=ke();N(o,function(m){g.set(a[m].storeDimIndex,m)})}}return r.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(t==null)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var i=this._dimIdxToName.get(t);if(i!=null)return i;var n=this._schema.getSourceDimension(t);if(n)return n.name},r.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(t!=null)return t;if(e==null)return-1;var i=this._getDimInfo(e);return i?i.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},r.prototype._recognizeDimIndex=function(e){if(Dt(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},r.prototype._getStoreDimIndex=function(e){var t=this.getDimensionIndex(e);return t},r.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},r.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(i){return t.hasOwnProperty(i)?t[i]:void 0}:function(i){return t[i]}},r.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},r.prototype.mapDimension=function(e,t){var i=this._dimSummary;if(t==null)return i.encodeFirstDimNotExtra[e];var n=i.encode[e];return n?n[t]:null},r.prototype.mapDimensionsAll=function(e){var t=this._dimSummary,i=t.encode[e];return(i||[]).slice()},r.prototype.getStore=function(){return this._store},r.prototype.initData=function(e,t,i){var n=this,a;if(e instanceof bx&&(a=e),!a){var o=this.dimensions,s=xv(e)||di(e)?new C1(e,o.length):e;a=new bx;var l=Vh(o,function(u){return{type:n._dimInfos[u].type,property:u}});a.initData(s,l,i)}this._store=a,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,a.count()),this._dimSummary=Q6(this,this._schema),this.userOutput=this._dimSummary.userOutput},r.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},r.prototype.appendValues=function(e,t){var i=this._store.appendValues(e,t.length),n=i.start,a=i.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var s=n;s<a;s++){var l=s-n;this._nameList[s]=t[l],o&&$P(this,s)}},r.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,i=0;i<t.length;i++){var n=this._dimInfos[t[i]];n.ordinalMeta&&e.collectOrdinalMeta(n.storeDimIndex,n.ordinalMeta)}},r.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==as&&!e.fillStorage},r.prototype._doInit=function(e,t){if(!(e>=t)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===dn;if(l&&!n.pure)for(var u=[],c=e;c<t;c++){var h=n.getItem(c,u);if(!this.hasItemOption&&yH(h)&&(this.hasItemOption=!0),h){var f=h.name;a[c]==null&&f!=null&&(a[c]=Kr(f,null));var p=h.id;o[c]==null&&p!=null&&(o[c]=Kr(p,null))}}if(this._shouldMakeIdFromName())for(var c=e;c<t;c++)$P(this,c);t8(this)}},r.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},r.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},r.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},r.prototype.setCalculationInfo=function(e,t){Bx(e)?he(this._calculationInfo,e):this._calculationInfo[e]=t},r.prototype.getName=function(e){var t=this.getRawIndex(e),i=this._nameList[t];return i==null&&this._nameDimIdx!=null&&(i=kx(this,this._nameDimIdx,t)),i==null&&(i=""),i},r.prototype._getCategory=function(e,t){var i=this._store.get(e,t),n=this._store.getOrdinalMeta(e);return n?n.categories[i]:i},r.prototype.getId=function(e){return aT(this,this.getRawIndex(e))},r.prototype.count=function(){return this._store.count()},r.prototype.get=function(e,t){var i=this._store,n=this._dimInfos[e];if(n)return i.get(n.storeDimIndex,t)},r.prototype.getByRawIndex=function(e,t){var i=this._store,n=this._dimInfos[e];if(n)return i.getByRawIndex(n.storeDimIndex,t)},r.prototype.getIndices=function(){return this._store.getIndices()},r.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},r.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},r.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},r.prototype.getValues=function(e,t){var i=this,n=this._store;return pe(e)?n.getValues(Vh(e,function(a){return i._getStoreDimIndex(a)}),t):n.getValues(e)},r.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,i=0,n=t.length;i<n;i++)if(isNaN(this._store.get(t[i],e)))return!1;return!0},r.prototype.indexOfName=function(e){for(var t=0,i=this._store.count();t<i;t++)if(this.getName(t)===e)return t;return-1},r.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},r.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},r.prototype.rawIndexOf=function(e,t){var i=e&&this._invertedIndicesMap[e],n=i[t];return n==null||isNaN(n)?e8:n},r.prototype.indicesOfNearest=function(e,t,i){return this._store.indicesOfNearest(this._getStoreDimIndex(e),t,i)},r.prototype.each=function(e,t,i){"use strict";He(e)&&(i=t,t=e,e=[]);var n=i||this,a=Vh(Vx(e),this._getStoreDimIndex,this);this._store.each(a,n?Be(t,n):t)},r.prototype.filterSelf=function(e,t,i){"use strict";He(e)&&(i=t,t=e,e=[]);var n=i||this,a=Vh(Vx(e),this._getStoreDimIndex,this);return this._store=this._store.filter(a,n?Be(t,n):t),this},r.prototype.selectRange=function(e){"use strict";var t=this,i={},n=At(e),a=[];return N(n,function(o){var s=t._getStoreDimIndex(o);i[s]=e[o],a.push(s)}),this._store=this._store.selectRange(i),this},r.prototype.mapArray=function(e,t,i){"use strict";He(e)&&(i=t,t=e,e=[]),i=i||this;var n=[];return this.each(e,function(){n.push(t&&t.apply(this,arguments))},i),n},r.prototype.map=function(e,t,i,n){"use strict";var a=i||n||this,o=Vh(Vx(e),this._getStoreDimIndex,this),s=oT(this);return s._store=this._store.map(o,a?Be(t,a):t),s},r.prototype.modify=function(e,t,i,n){var a=this,o=i||n||this,s=Vh(Vx(e),this._getStoreDimIndex,this);this._store.modify(s,o?Be(t,o):t)},r.prototype.downSample=function(e,t,i,n){var a=oT(this);return a._store=this._store.downSample(this._getStoreDimIndex(e),t,i,n),a},r.prototype.lttbDownSample=function(e,t){var i=oT(this);return i._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),i},r.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},r.prototype.getItemModel=function(e){var t=this.hostModel,i=this.getRawDataItem(e);return new Jt(i,t,t&&t.ecModel)},r.prototype.diff=function(e){var t=this;return new In(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(i){return aT(e,i)},function(i){return aT(t,i)})},r.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},r.prototype.setVisual=function(e,t){this._visual=this._visual||{},Bx(e)?he(this._visual,e):this._visual[e]=t},r.prototype.getItemVisual=function(e,t){var i=this._itemVisuals[e],n=i&&i[t];return n??this.getVisual(t)},r.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},r.prototype.ensureUniqueItemVisual=function(e,t){var i=this._itemVisuals,n=i[e];n||(n=i[e]={});var a=n[t];return a==null&&(a=this.getVisual(t),pe(a)?a=a.slice():Bx(a)&&(a=he({},a)),n[t]=a),a},r.prototype.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{};this._itemVisuals[e]=n,Bx(t)?he(n,t):n[t]=i},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(e,t){Bx(e)?he(this._layout,e):this._layout[e]=t},r.prototype.getLayout=function(e){return this._layout[e]},r.prototype.getItemLayout=function(e){return this._itemLayouts[e]},r.prototype.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?he(this._itemLayouts[e]||{},t):t},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(e,t){var i=this.hostModel&&this.hostModel.seriesIndex;j_(i,this.dataType,e,t),this._graphicEls[e]=t},r.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},r.prototype.eachItemGraphicEl=function(e,t){N(this._graphicEls,function(i,n){i&&e&&e.call(t,i,n)})},r.prototype.cloneShallow=function(e){return e||(e=new r(this._schema?this._schema:Vh(this.dimensions,this._getDimInfo,this),this.hostModel)),JP(e,this),e._store=this._store,e},r.prototype.wrapMethod=function(e,t){var i=this[e];He(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var n=i.apply(this,arguments);return t.apply(this,[n].concat(Xb(arguments)))})},r.internalField=function(){t8=function(e){var t=e._invertedIndicesMap;N(t,function(i,n){var a=e._dimInfos[n],o=a.ordinalMeta,s=e._store;if(o){i=t[n]=new Ppe(o.categories.length);for(var l=0;l<i.length;l++)i[l]=e8;for(var l=0;l<s.count();l++)i[s.get(a.storeDimIndex,l)]=l}})},kx=function(e,t,i){return Kr(e._getCategory(t,i),null)},aT=function(e,t){var i=e._idList[t];return i==null&&e._idDimIdx!=null&&(i=kx(e,e._idDimIdx,t)),i==null&&(i=Ipe+t),i},Vx=function(e){return pe(e)||(e=e!=null?[e]:[]),e},oT=function(e){var t=new r(e._schema?e._schema:Vh(e.dimensions,e._getDimInfo,e),e.hostModel);return JP(t,e),t},JP=function(e,t){N(Npe.concat(t.__wrappedMethods||[]),function(i){t.hasOwnProperty(i)&&(e[i]=t[i])}),e.__wrappedMethods=t.__wrappedMethods,N(Upe,function(i){e[i]=Qe(t[i])}),e._calculationInfo=he({},t._calculationInfo)},$P=function(e,t){var i=e._nameList,n=e._idList,a=e._nameDimIdx,o=e._idDimIdx,s=i[t],l=n[t];if(s==null&&a!=null&&(i[t]=s=kx(e,a,t)),l==null&&o!=null&&(n[t]=l=kx(e,o,t)),l==null&&s!=null){var u=e._nameRepeatCount,c=u[s]=(u[s]||0)+1;l=s,c>1&&(l+="__ec__"+c),n[t]=l}}}(),r}(),oi=Ope;function Nl(r,e){xv(r)||(r=Sv(r)),e=e||{};var t=e.coordDimensions||[],i=e.dimensionsDefine||r.dimensionsDefine||[],n=ke(),a=[],o=Fpe(r,t,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&KP(o),l=i===r.dimensionsDefine,u=l?jP(r):ZP(i),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(r,o));for(var h=ke(c),f=new mP(o),p=0;p<f.length;p++)f[p]=-1;function d(C){var b=f[C];if(b<0){var E=i[C],I=qe(E)?E:{name:E},R=new Av,A=I.name;A!=null&&u.get(A)!=null&&(R.name=R.displayName=A),I.type!=null&&(R.type=I.type),I.displayName!=null&&(R.displayName=I.displayName);var P=a.length;return f[C]=P,R.storeDimIndex=C,a.push(R),R}return a[b]}if(!s)for(var p=0;p<o;p++)d(p);h.each(function(C,b){var E=tr(C).slice();if(E.length===1&&!Ce(E[0])&&E[0]<0){h.set(b,!1);return}var I=h.set(b,[]);N(E,function(R,A){var P=Ce(R)?u.get(R):R;P!=null&&P<o&&(I[A]=P,m(d(P),b,A))})});var g=0;N(t,function(C){var b,E,I,R;if(Ce(C))b=C,R={};else{R=C,b=R.name;var A=R.ordinalMeta;R.ordinalMeta=null,R=he({},R),R.ordinalMeta=A,E=R.dimsDef,I=R.otherDims,R.name=R.coordDim=R.coordDimIndex=R.dimsDef=R.otherDims=null}var P=h.get(b);if(P!==!1){if(P=tr(P),!P.length)for(var U=0;U<(E&&E.length||1);U++){for(;g<o&&d(g).coordDim!=null;)g++;g<o&&P.push(g++)}N(P,function(B,z){var k=d(B);if(l&&R.type!=null&&(k.type=R.type),m(Ye(k,R),b,z),k.name==null&&E){var G=E[z];!qe(G)&&(G={name:G}),k.name=k.displayName=G.name,k.defaultTooltip=G.defaultTooltip}I&&Ye(k.otherDims,I)})}});function m(C,b,E){y1.get(b)!=null?C.otherDims[b]=E:(C.coordDim=b,C.coordDimIndex=E,n.set(b,!0))}var v=e.generateCoord,_=e.generateCoordCount,y=_!=null;_=v?_||1:0;var x=v||"value";function M(C){C.name==null&&(C.name=C.coordDim)}if(s)N(a,function(C){M(C)}),a.sort(function(C,b){return C.storeDimIndex-b.storeDimIndex});else for(var S=0;S<o;S++){var w=d(S),T=w.coordDim;T==null&&(w.coordDim=Bpe(x,n,y),w.coordDimIndex=0,(!v||_<=0)&&(w.isExtraCoord=!0),_--),M(w),w.type==null&&(S1(r,S)===Qi.Must||w.isExtraCoord&&(w.otherDims.itemName!=null||w.otherDims.seriesName!=null))&&(w.type="ordinal")}return zpe(a),new qP({source:r,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function zpe(r){for(var e=ke(),t=0;t<r.length;t++){var i=r[t],n=i.name,a=e.get(n)||0;a>0&&(i.name=n+(a-1)),a++,e.set(n,a)}}function Fpe(r,e,t,i){var n=Math.max(r.dimensionsDetectedCount||1,e.length,t.length,i||0);return N(e,function(a){var o;qe(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function Bpe(r,e,t){if(t||e.hasKey(r)){for(var i=0;e.hasKey(r+i);)i++;r+=i}return e.set(r,!0),r}var kpe=function(){function r(e){this.coordSysDims=[],this.axisMap=ke(),this.categoryAxisMap=ke(),this.coordSysName=e}return r}();function r8(r){var e=r.get("coordinateSystem"),t=new kpe(e),i=Vpe[e];if(i)return i(r,t,t.axisMap,t.categoryAxisMap),t}var Vpe={cartesian2d:function(r,e,t,i){var n=r.getReferringComponents("xAxis",Ir).models[0],a=r.getReferringComponents("yAxis",Ir).models[0];e.coordSysDims=["x","y"],t.set("x",n),t.set("y",a),Cv(n)&&(i.set("x",n),e.firstCategoryDimIndex=0),Cv(a)&&(i.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(r,e,t,i){var n=r.getReferringComponents("singleAxis",Ir).models[0];e.coordSysDims=["single"],t.set("single",n),Cv(n)&&(i.set("single",n),e.firstCategoryDimIndex=0)},polar:function(r,e,t,i){var n=r.getReferringComponents("polar",Ir).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",o),Cv(a)&&(i.set("radius",a),e.firstCategoryDimIndex=0),Cv(o)&&(i.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(r,e,t,i){e.coordSysDims=["lng","lat"]},parallel:function(r,e,t,i){var n=r.ecModel,a=n.getComponent("parallel",r.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();N(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),c=o[l];t.set(c,u),Cv(u)&&(i.set(c,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function Cv(r){return r.get("type")==="category"}function i8(r,e,t){t=t||{};var i=t.byIndex,n=t.stackedCoordDimension,a,o,s;Gpe(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(r&&r.get("stack")),u,c,h,f;if(N(a,function(_,y){Ce(_)&&(a[y]=_={name:_}),l&&!_.isExtraCoord&&(!i&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!n||n===_.coordDim)&&(c=_))}),c&&!i&&!u&&(i=!0),c){h="__\0ecstackresult_"+r.id,f="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var p=c.coordDim,d=c.type,g=0;N(a,function(_){_.coordDim===p&&g++});var m={name:h,coordDim:p,coordDimIndex:g,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},v={name:f,coordDim:f,coordDimIndex:g+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(m.storeDimIndex=s.ensureCalculationDimension(f,d),v.storeDimIndex=s.ensureCalculationDimension(h,d)),o.appendCalculationDimension(m),o.appendCalculationDimension(v)):(a.push(m),a.push(v))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:f,stackResultDimension:h}}function Gpe(r){return!nT(r.schema)}function ls(r,e){return!!e&&e===r.getCalculationInfo("stackedDimension")}function sT(r,e){return ls(r,e)?r.getCalculationInfo("stackResultDimension"):e}function Hpe(r,e){var t=r.get("coordinateSystem"),i=gc.get(t),n;return e&&e.coordSysDims&&(n=de(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=id(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function Wpe(r,e,t){var i,n;return t&&N(r,function(a,o){var s=a.coordDim,l=t.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(r[i].otherDims.itemName=0),i}function Xpe(r,e,t){t=t||{};var i=e.getSourceManager(),n,a=!1;r?(a=!0,n=Sv(r)):(n=i.getSource(),a=n.sourceFormat===dn);var o=r8(e),s=Hpe(e,o),l=t.useEncodeDefaulter,u=He(l)?l:l?ut(_1,s,e):null,c={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=Nl(n,c),f=Wpe(h.dimensions,t.createInvertedIndices,o),p=a?null:i.getSharedDataStore(h),d=i8(e,{schema:h,store:p}),g=new oi(h,e);g.setCalculationInfo(d);var m=f!=null&&Ype(n)?function(v,_,y,x){return x===f?y:this.defaultDimValueGetter(v,_,y,x)}:null;return g.hasItemOption=!1,g.initData(a?n:p,null,m),g}function Ype(r){if(r.sourceFormat===dn){var e=qpe(r.data||[]);return!pe(Sl(e))}}function qpe(r){for(var e=0;e<r.length&&r[e]==null;)e++;return r[e]}var mn=Xpe;var n8=function(){function r(e){this._setting=e||{},this._extent=[1/0,-1/0]}return r.prototype.getSetting=function(e){return this._setting[e]},r.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},r.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},r.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(e){this._isBlank=e},r}();Th(n8);var Lo=n8;var Zpe=0,jpe=function(){function r(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++Zpe}return r.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&de(i,Kpe);return new r({categories:n,needCollect:!n,deduplication:t.dedplication!==!1})},r.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},r.prototype.parseAndCollect=function(e){var t,i=this._needCollect;if(!Ce(e)&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=this._getOrCreateMap();return t=n.get(e),t==null&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t},r.prototype._getOrCreateMap=function(){return this._map||(this._map=ke(this.categories))},r}();function Kpe(r){return qe(r)&&r.value!=null?r.value:r+""}var Gx=jpe;function Hx(r){return r.type==="interval"||r.type==="log"}function o8(r,e,t,i){var n={},a=r[1]-r[0],o=n.interval=jm(a/e,!0);t!=null&&o<t&&(o=n.interval=t),i!=null&&o>i&&(o=n.interval=i);var s=n.intervalPrecision=QP(o),l=n.niceTickExtent=[Pr(Math.ceil(r[0]/o)*o,s),Pr(Math.floor(r[1]/o)*o,s)];return Jpe(l,r),n}function lT(r){var e=Math.pow(10,Zm(r)),t=r/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,Pr(t*e)}function QP(r){return An(r)+2}function a8(r,e,t){r[e]=Math.max(Math.min(r[e],t[1]),t[0])}function Jpe(r,e){!isFinite(r[0])&&(r[0]=e[0]),!isFinite(r[1])&&(r[1]=e[1]),a8(r,0,e),a8(r,1,e),r[0]>r[1]&&(r[0]=r[1])}function Gh(r,e){return r>=e[0]&&r<=e[1]}function Hh(r,e){return e[1]===e[0]?.5:(r-e[0])/(e[1]-e[0])}function Wh(r,e){return r*(e[1]-e[0])+e[0]}var s8=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new Gx({})),pe(n)&&(n=new Gx({categories:de(n,function(a){return qe(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return e.prototype.parse=function(t){return t==null?NaN:Ce(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),Gh(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),Hh(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(Wh(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],i=this._extent,n=i[0];n<=i[1];)t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o<l;++o){var u=i[o];n[o]=u,a[u]=o}for(var c=0;o<s;++o){for(;a[c]!=null;)c++;n.push(c),a[c]=o}},e.prototype._getTickNumber=function(t){var i=this._ticksByOrdinalNumber;return i&&t>=0&&t<i.length?i[t]:t},e.prototype.getRawOrdinalNumber=function(t){var i=this._ordinalNumbersByTick;return i&&t>=0&&t<i.length?i[t]:t},e.prototype.getLabel=function(t){if(!this.isBlank()){var i=this.getRawOrdinalNumber(t.value),n=this._ordinalMeta.categories[i];return n==null?"":n+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(t,i){this.unionExtent(t.getApproximateExtent(i))},e.prototype.isInExtentRange=function(t){return t=this._getTickNumber(t),this._extent[0]<=t&&this._extent[1]>=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Lo);Lo.registerClass(s8);var Wx=s8;var nd=Pr,l8=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return Gh(t,this._extent)},e.prototype.normalize=function(t){return Hh(t,this._extent)},e.prototype.scale=function(t){return Wh(t,this._extent)},e.prototype.setExtent=function(t,i){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(i)||(n[1]=parseFloat(i))},e.prototype.unionExtent=function(t){var i=this._extent;t[0]<i[0]&&(i[0]=t[0]),t[1]>i[1]&&(i[1]=t[1]),this.setExtent(i[0],i[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=QP(t)},e.prototype.getTicks=function(t){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]<a[0]&&(t?s.push({value:nd(a[0]-i,o)}):s.push({value:n[0]}));for(var u=a[0];u<=a[1]&&(s.push({value:u}),u=nd(u+i,o),u!==s[s.length-1].value);)if(s.length>l)return[];var c=s.length?s[s.length-1].value:a[1];return n[1]>c&&(t?s.push({value:nd(c+i,o)}):s.push({value:n[1]})),s},e.prototype.getMinorTicks=function(t){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;o<i.length;o++){for(var s=i[o],l=i[o-1],u=0,c=[],h=s.value-l.value,f=h/t;u<t-1;){var p=nd(l.value+(u+1)*f);p>a[0]&&p<a[1]&&c.push(p),u++}n.push(c)}return n},e.prototype.getLabel=function(t,i){if(t==null)return"";var n=i&&i.precision;n==null?n=An(t.value)||0:n==="auto"&&(n=this._intervalPrecision);var a=nd(t.value,n,!0);return jD(a)},e.prototype.calcNiceTicks=function(t,i,n){t=t||5;var a=this._extent,o=a[1]-a[0];if(isFinite(o)){o<0&&(o=-o,a.reverse());var s=o8(a,t,i,n);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(t){var i=this._extent;if(i[0]===i[1])if(i[0]!==0){var n=Math.abs(i[0]);t.fixMax||(i[1]+=n/2),i[0]-=n/2}else i[1]=1;var a=i[1]-i[0];isFinite(a)||(i[0]=0,i[1]=1),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var o=this._interval;t.fixMin||(i[0]=nd(Math.floor(i[0]/o)*o)),t.fixMax||(i[1]=nd(Math.ceil(i[1]/o)*o))},e.prototype.setNiceExtent=function(t,i){this._niceExtent=[t,i]},e.type="interval",e}(Lo);Lo.registerClass(l8);var Do=l8;var u8=typeof Float32Array<"u",$pe=u8?Float32Array:Array;function Sa(r){return pe(r)?u8?new Float32Array(r):r:new $pe(r)}var eI="__ec_stack_";function tI(r){return r.get("stack")||eI+r.seriesIndex}function rI(r){return r.dim+r.index}function c8(r){var e=[],t=r.axis,i="axis0";if(t.type==="category"){for(var n=t.getBandWidth(),a=0;a<r.count;a++)e.push(Ye({bandWidth:n,axisKey:i,stackId:eI+a},r));for(var o=h8(e),s=[],a=0;a<r.count;a++){var l=o[i][eI+a];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}function iI(r,e){var t=[];return e.eachSeriesByType(r,function(i){p8(i)&&t.push(i)}),t}function Qpe(r){var e={};N(r,function(l){var u=l.coordinateSystem,c=u.getBaseAxis();if(!(c.type!=="time"&&c.type!=="value"))for(var h=l.getData(),f=c.dim+"_"+c.index,p=h.getDimensionIndex(h.mapDimension(c.dim)),d=h.getStore(),g=0,m=d.count();g<m;++g){var v=d.get(p,g);e[f]?e[f].push(v):e[f]=[v]}});var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n){n.sort(function(l,u){return l-u});for(var a=null,o=1;o<n.length;++o){var s=n[o]-n[o-1];s>0&&(a=a===null?s:Math.min(a,s))}t[i]=a}}return t}function nI(r){var e=Qpe(r),t=[];return N(r,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],c=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),f=Math.abs(h[1]-h[0]);s=u?c/f*u:c}else{var p=i.getData();s=Math.abs(o[1]-o[0])/p.count()}var d=ze(i.get("barWidth"),s),g=ze(i.get("barMaxWidth"),s),m=ze(i.get("barMinWidth")||(d8(i)?.5:1),s),v=i.get("barGap"),_=i.get("barCategoryGap");t.push({bandWidth:s,barWidth:d,barMaxWidth:g,barMinWidth:m,barGap:v,barCategoryGap:_,axisKey:rI(a),stackId:tI(i)})}),h8(t)}function h8(r){var e={};N(r,function(i,n){var a=i.axisKey,o=i.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=i.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var h=i.barMaxWidth;h&&(l[u].maxWidth=h);var f=i.barMinWidth;f&&(l[u].minWidth=f);var p=i.barGap;p!=null&&(s.gap=p);var d=i.barCategoryGap;d!=null&&(s.categoryGap=d)});var t={};return N(e,function(i,n){t[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=At(a).length;s=Math.max(35-l*4,15)+"%"}var u=ze(s,o),c=ze(i.gap,1),h=i.remainedWidth,f=i.autoWidthCount,p=(h-u)/(f+(f-1)*c);p=Math.max(p,0),N(a,function(v){var _=v.maxWidth,y=v.minWidth;if(v.width){var x=v.width;_&&(x=Math.min(x,_)),y&&(x=Math.max(x,y)),v.width=x,h-=x+c*x,f--}else{var x=p;_&&_<x&&(x=Math.min(_,h)),y&&y>x&&(x=y),x!==p&&(v.width=x,h-=x+c*x,f--)}}),p=(h-u)/(f+(f-1)*c),p=Math.max(p,0);var d=0,g;N(a,function(v,_){v.width||(v.width=p),g=v,d+=v.width*(1+c)}),g&&(d-=g.width*c);var m=-d/2;N(a,function(v,_){t[n][_]=t[n][_]||{bandWidth:o,offset:m,width:v.width},m+=v.width*(1+c)})}),t}function f8(r,e,t){if(r&&e){var i=r[rI(e)];return i!=null&&t!=null?i[tI(t)]:i}}function cT(r,e){var t=iI(r,e),i=nI(t);N(t,function(n){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=tI(n),u=i[rI(s)][l],c=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:h})})}function hT(r){return{seriesType:r,plan:os(),reset:function(e){if(p8(e)){var t=e.getData(),i=e.coordinateSystem,n=i.getBaseAxis(),a=i.getOtherAxis(n),o=t.getDimensionIndex(t.mapDimension(a.dim)),s=t.getDimensionIndex(t.mapDimension(n.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),c=t.getCalculationInfo("stackResultDimension"),h=ls(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),p=ede(n,a),d=d8(e),g=e.get("barMinHeight")||0,m=c&&t.getDimensionIndex(c),v=t.getLayout("size"),_=t.getLayout("offset");return{progress:function(y,x){for(var M=y.count,S=d&&Sa(M*3),w=d&&l&&Sa(M*3),T=d&&Sa(M),C=i.master.getRect(),b=f?C.width:C.height,E,I=x.getStore(),R=0;(E=y.next())!=null;){var A=I.get(h?m:o,E),P=I.get(s,E),U=p,B=void 0;h&&(B=+A-I.get(o,E));var z=void 0,k=void 0,G=void 0,Y=void 0;if(f){var J=i.dataToPoint([A,P]);if(h){var Q=i.dataToPoint([B,P]);U=Q[0]}z=U,k=J[1]+_,G=J[0]-U,Y=v,Math.abs(G)<g&&(G=(G<0?-1:1)*g)}else{var J=i.dataToPoint([P,A]);if(h){var Q=i.dataToPoint([P,B]);U=Q[1]}z=J[0]+_,k=U,G=v,Y=J[1]-U,Math.abs(Y)<g&&(Y=(Y<=0?-1:1)*g)}d?(S[R]=z,S[R+1]=k,S[R+2]=f?G:Y,w&&(w[R]=f?C.x:z,w[R+1]=f?k:C.y,w[R+2]=b),T[E]=E):x.setItemLayout(E,{x:z,y:k,width:G,height:Y}),R+=3}d&&x.setLayout({largePoints:S,largeDataIndices:T,largeBackgroundPoints:w,valueAxisHorizontal:f})}}}}}}function p8(r){return r.coordinateSystem&&r.coordinateSystem.type==="cartesian2d"}function d8(r){return r.pipelineContext&&r.pipelineContext.large}function ede(r,e){return e.toGlobalCoord(e.dataToCoord(e.type==="log"?1:0))}var tde=function(r,e,t,i){for(;t<i;){var n=t+i>>>1;r[n][1]<e?t=n+1:i=n}return t},v8=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="time",i}return e.prototype.getLabel=function(t){var i=this.getSetting("useUTC");return Kp(t.value,BD[E5(jp(this._minLevelUnit))]||BD.second,i,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,i,n){var a=this.getSetting("useUTC"),o=this.getSetting("locale");return A5(t,i,n,o,a)},e.prototype.getTicks=function(){var t=this._interval,i=this._extent,n=[];if(!t)return n;n.push({value:i[0],level:0});var a=this.getSetting("useUTC"),o=lde(this._minLevelUnit,this._approxInterval,a,i);return n=n.concat(o),n.push({value:i[1],level:0}),n},e.prototype.calcNiceExtent=function(t){var i=this._extent;if(i[0]===i[1]&&(i[0]-=is,i[1]+=is),i[1]===-1/0&&i[0]===1/0){var n=new Date;i[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),i[0]=i[1]-is}this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval)},e.prototype.calcNiceTicks=function(t,i,n){t=t||10;var a=this._extent,o=a[1]-a[0];this._approxInterval=o/t,i!=null&&this._approxInterval<i&&(this._approxInterval=i),n!=null&&this._approxInterval>n&&(this._approxInterval=n);var s=fT.length,l=Math.min(tde(fT,this._approxInterval,0,s),s-1);this._interval=fT[l][1],this._minLevelUnit=fT[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return Dt(t)?t:+Cn(t)},e.prototype.contain=function(t){return Gh(this.parse(t),this._extent)},e.prototype.normalize=function(t){return Hh(this.parse(t),this._extent)},e.prototype.scale=function(t){return Wh(t,this._extent)},e.type="time",e}(Do),fT=[["second",h1],["minute",f1],["hour",vv],["quarter-day",vv*6],["half-day",vv*12],["day",is*1.2],["half-week",is*3.5],["week",is*7],["month",is*31],["quarter",is*95],["half-year",FD/2],["year",FD]];function rde(r,e,t,i){var n=Cn(e),a=Cn(t),o=function(d){return VD(n,d,i)===VD(a,d,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},h=function(){return c()&&o("minute")},f=function(){return h()&&o("second")},p=function(){return f()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return f();case"millisecond":return p()}}function ide(r,e){return r/=is,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function nde(r){var e=30*is;return r/=e,r>6?6:r>3?3:r>2?2:1}function ade(r){return r/=vv,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function m8(r,e){return r/=e?f1:h1,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function ode(r){return jm(r,!0)}function sde(r,e,t){var i=new Date(r);switch(jp(e)){case"year":case"month":i[GD(t)](0);case"day":i[HD(t)](1);case"hour":i[WD(t)](0);case"minute":i[XD(t)](0);case"second":i[YD(t)](0),i[qD(t)](0)}return i.getTime()}function lde(r,e,t,i){var n=1e4,a=kD,o=0;function s(b,E,I,R,A,P,U){for(var B=new Date(E),z=E,k=B[R]();z<I&&z<=i[1];)U.push({value:z}),k+=b,B[A](k),z=B.getTime();U.push({value:z,notAdd:!0})}function l(b,E,I){var R=[],A=!E.length;if(!rde(jp(b),i[0],i[1],t)){A&&(E=[{value:sde(new Date(i[0]),b,t)},{value:i[1]}]);for(var P=0;P<E.length-1;P++){var U=E[P].value,B=E[P+1].value;if(U!==B){var z=void 0,k=void 0,G=void 0,Y=!1;switch(b){case"year":z=Math.max(1,Math.round(e/is/365)),k=p1(t),G=R5(t);break;case"half-year":case"quarter":case"month":z=nde(e),k=Zp(t),G=GD(t);break;case"week":case"half-week":case"day":z=ide(e,31),k=cx(t),G=HD(t),Y=!0;break;case"half-day":case"quarter-day":case"hour":z=ade(e),k=mv(t),G=WD(t);break;case"minute":z=m8(e,!0),k=hx(t),G=XD(t);break;case"second":z=m8(e,!1),k=fx(t),G=YD(t);break;case"millisecond":z=ode(e),k=px(t),G=qD(t);break}s(z,U,B,k,G,Y,R),b==="year"&&I.length>1&&P===0&&I.unshift({value:I[0].value-z})}}for(var P=0;P<R.length;P++)I.push(R[P]);return R}}for(var u=[],c=[],h=0,f=0,p=0;p<a.length&&o++<n;++p){var d=jp(a[p]);if(T5(a[p])){l(a[p],u[u.length-1]||[],c);var g=a[p+1]?jp(a[p+1]):null;if(d!==g){if(c.length){f=h,c.sort(function(b,E){return b.value-E.value});for(var m=[],v=0;v<c.length;++v){var _=c[v].value;(v===0||c[v-1].value!==_)&&(m.push(c[v]),_>=i[0]&&_<=i[1]&&h++)}var y=(i[1]-i[0])/e;if(h>y*1.5&&f>y/1.5||(u.push(m),h>y||r===a[p]))break}c=[]}}}for(var x=Yt(de(u,function(b){return Yt(b,function(E){return E.value>=i[0]&&E.value<=i[1]&&!E.notAdd})}),function(b){return b.length>0}),M=[],S=x.length-1,p=0;p<x.length;++p)for(var w=x[p],T=0;T<w.length;++T)M.push({value:w[T].value,level:S-p});M.sort(function(b,E){return b.value-E.value});for(var C=[],p=0;p<M.length;++p)(p===0||M[p].value!==M[p-1].value)&&C.push(M[p]);return C}Lo.registerClass(v8);var pT=v8;var g8=Lo.prototype,Xx=Do.prototype,ude=Pr,cde=Math.floor,hde=Math.ceil,dT=Math.pow,Ul=Math.log,aI=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new Do,t._interval=0,t}return e.prototype.getTicks=function(t){var i=this._originalScale,n=this._extent,a=i.getExtent(),o=Xx.getTicks.call(this,t);return de(o,function(s){var l=s.value,u=Pr(dT(this.base,l));return u=l===n[0]&&this._fixMin?mT(u,a[0]):u,u=l===n[1]&&this._fixMax?mT(u,a[1]):u,{value:u}},this)},e.prototype.setExtent=function(t,i){var n=Ul(this.base);t=Ul(Math.max(0,t))/n,i=Ul(Math.max(0,i))/n,Xx.setExtent.call(this,t,i)},e.prototype.getExtent=function(){var t=this.base,i=g8.getExtent.call(this);i[0]=dT(t,i[0]),i[1]=dT(t,i[1]);var n=this._originalScale,a=n.getExtent();return this._fixMin&&(i[0]=mT(i[0],a[0])),this._fixMax&&(i[1]=mT(i[1],a[1])),i},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var i=this.base;t[0]=Ul(t[0])/Ul(i),t[1]=Ul(t[1])/Ul(i),g8.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,i){this.unionExtent(t.getApproximateExtent(i))},e.prototype.calcNiceTicks=function(t){t=t||10;var i=this._extent,n=i[1]-i[0];if(!(n===1/0||n<=0)){var a=Rw(n),o=t/n*a;for(o<=.5&&(a*=10);!isNaN(a)&&Math.abs(a)<1&&Math.abs(a)>0;)a*=10;var s=[Pr(hde(i[0]/a)*a),Pr(cde(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){Xx.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=Ul(t)/Ul(this.base),Gh(t,this._extent)},e.prototype.normalize=function(t){return t=Ul(t)/Ul(this.base),Hh(t,this._extent)},e.prototype.scale=function(t){return t=Wh(t,this._extent),dT(this.base,t)},e.type="log",e}(Lo),y8=aI.prototype;y8.getMinorTicks=Xx.getMinorTicks;y8.getLabel=Xx.getLabel;function mT(r,e){return ude(r,An(e))}Lo.registerClass(aI);var _8=aI;var fde=function(){function r(e,t,i){this._prepareParams(e,t,i)}return r.prototype._prepareParams=function(e,t,i){i[1]<i[0]&&(i=[NaN,NaN]),this._dataMin=i[0],this._dataMax=i[1];var n=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&t.getNeedCrossZero&&t.getNeedCrossZero();var a=this._modelMinRaw=t.get("min",!0);He(a)?this._modelMinNum=vT(e,a({min:i[0],max:i[1]})):a!=="dataMin"&&(this._modelMinNum=vT(e,a));var o=this._modelMaxRaw=t.get("max",!0);if(He(o)?this._modelMaxNum=vT(e,o({min:i[0],max:i[1]})):o!=="dataMax"&&(this._modelMaxNum=vT(e,o)),n)this._axisDataLen=t.getCategories().length;else{var s=t.get("boundaryGap"),l=pe(s)?s:[s||0,s||0];typeof l[0]=="boolean"||typeof l[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[En(l[0],1),En(l[1],1)]}},r.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,i=this._dataMax,n=this._axisDataLen,a=this._boundaryGapInner,o=e?null:i-t||Math.abs(t),s=this._modelMinRaw==="dataMin"?t:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?i:this._modelMaxNum,u=s!=null,c=l!=null;s==null&&(s=e?n?0:NaN:t-a[0]*o),l==null&&(l=e?n?n-1:NaN:i+a[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var h=dh(s)||dh(l)||e&&!n;this._needCrossZero&&(s>0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var f=this._determinedMin,p=this._determinedMax;return f!=null&&(s=f,u=!0),p!=null&&(l=p,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:h}},r.prototype.modifyDataMinMax=function(e,t){this[dde[e]]=t},r.prototype.setDeterminedMinMax=function(e,t){var i=pde[e];this[i]=t},r.prototype.freeze=function(){this.frozen=!0},r}();var pde={min:"_determinedMin",max:"_determinedMax"},dde={min:"_dataMin",max:"_dataMax"};function gT(r,e,t){var i=r.rawExtentInfo;return i||(i=new fde(r,e,t),r.rawExtentInfo=i,i)}function vT(r,e){return e==null?null:dh(e)?NaN:r.parse(e)}function oI(r,e){var t=r.type,i=gT(r,e,r.getExtent()).calculate();r.setBlank(i.isBlank);var n=i.min,a=i.max,o=e.ecModel;if(o&&t==="time"){var s=iI("bar",o),l=!1;if(N(s,function(h){l=l||h.getBaseAxis()===e.axis}),l){var u=nI(s),c=mde(n,a,e,u);n=c.min,a=c.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function mde(r,e,t,i){var n=t.axis.getExtent(),a=n[1]-n[0],o=f8(i,t.axis);if(o===void 0)return{min:r,max:e};var s=1/0;N(o,function(p){s=Math.min(p.offset,s)});var l=-1/0;N(o,function(p){l=Math.max(p.offset+p.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=e-r,h=1-(s+l)/a,f=c/h-c;return e+=f*(l/u),r-=f*(s/u),{min:r,max:e}}function bu(r,e){var t=e,i=oI(r,t),n=i.extent,a=t.get("splitNumber");r instanceof _8&&(r.base=t.get("logBase"));var o=r.type,s=t.get("interval"),l=o==="interval"||o==="time";r.setExtent(n[0],n[1]),r.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function Xh(r,e){if(e=e||r.get("type"),e)switch(e){case"category":return new Wx({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new pT({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(Lo.getClass(e)||Do)}}function x8(r){var e=r.scale.getExtent(),t=e[0],i=e[1];return!(t>0&&i>0||t<0&&i<0)}function Rv(r){var e=r.getLabelModel().get("formatter"),t=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(i){return function(n,a){return r.scale.getFormattedLabel(n,a,i)}}(e):Ce(e)?function(i){return function(n){var a=r.scale.getLabel(n),o=i.replace("{value}",a??"");return o}}(e):He(e)?function(i){return function(n,a){return t!=null&&(a=n.value-t),i(Yx(r,n),a,n.level!=null?{level:n.level}:null)}}(e):function(i){return r.scale.getLabel(i)}}function Yx(r,e){return r.type==="category"?r.scale.getLabel(e):e.value}function S8(r){var e=r.model,t=r.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var i,n,a=t.getExtent();t instanceof Wx?n=t.count():(i=t.getTicks(),n=i.length);var o=r.getLabelModel(),s=Rv(r),l,u=1;n>40&&(u=Math.ceil(n/40));for(var c=0;c<n;c+=u){var h=i?i[c]:{value:a[0]+c},f=s(h,c),p=o.getTextRect(f),d=vde(p,o.get("rotate")||0);l?l.union(d):l=d}return l}}function vde(r,e){var t=e*Math.PI/180,i=r.width,n=r.height,a=i*Math.abs(Math.cos(t))+Math.abs(n*Math.sin(t)),o=i*Math.abs(Math.sin(t))+Math.abs(n*Math.cos(t)),s=new ht(r.x,r.y,a,o);return s}function yT(r){var e=r.get("interval");return e??"auto"}function _T(r){return r.type==="category"&&yT(r.getLabelModel())===0}function Lv(r,e){var t={};return N(r.mapDimensionsAll(e),function(i){t[sT(r,i)]=!0}),At(t)}function M8(r,e,t){e&&N(Lv(e,t),function(i){var n=e.getApproximateExtent(i);n[0]<r[0]&&(r[0]=n[0]),n[1]>r[1]&&(r[1]=n[1])})}var wu=function(){function r(){}return r.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},r.prototype.getCoordSysModel=function(){},r}();var gde=1e-8;function b8(r,e){return Math.abs(r-e)<gde}function Sc(r,e,t){var i=0,n=r[0];if(!n)return!1;for(var a=1;a<r.length;a++){var o=r[a];i+=Os(n[0],n[1],o[0],o[1],e,t),n=o}var s=r[0];return(!b8(n[0],s[0])||!b8(n[1],s[1]))&&(i+=Os(n[0],n[1],s[0],s[1],e,t)),i!==0}var yde=[];function sI(r,e){for(var t=0;t<r.length;t++)mi(r[t],r[t],e)}function T8(r,e,t,i){for(var n=0;n<r.length;n++){var a=r[n];i&&(a=i.project(a)),a&&isFinite(a[0])&&isFinite(a[1])&&($o(e,e,a),Qo(t,t,a))}}function _de(r){for(var e=0,t=0,i=0,n=r.length,a=r[n-1][0],o=r[n-1][1],s=0;s<n;s++){var l=r[s][0],u=r[s][1],c=a*u-l*o;e+=c,t+=(a+l)*c,i+=(o+u)*c,a=l,o=u}return e?[t/e/3,i/e/3,e]:[r[0][0]||0,r[0][1]||0]}var E8=function(){function r(e){this.name=e}return r.prototype.setCenter=function(e){this._center=e},r.prototype.getCenter=function(){var e=this._center;return e||(e=this._center=this.calcCenter()),e},r}();var lI=function(){function r(e,t){this.type="polygon",this.exterior=e,this.interiors=t}return r}();var uI=function(){function r(e){this.type="linestring",this.points=e}return r}();var ST=function(r){Z(e,r);function e(t,i,n){var a=r.call(this,t)||this;return a.type="geoJSON",a.geometries=i,a._center=n&&[n[0],n[1]],a}return e.prototype.calcCenter=function(){for(var t=this.geometries,i,n=0,a=0;a<t.length;a++){var o=t[a],s=o.exterior,l=s&&s.length;l>n&&(i=o,n=l)}if(i)return _de(i.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var i=this._rect;if(i&&!t)return i;var n=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return N(o,function(s){s.type==="polygon"?T8(s.exterior,n,a,t):N(s.points,function(l){T8(l,n,a,t)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(a[0])&&isFinite(a[1])||(n[0]=n[1]=a[0]=a[1]=0),i=new ht(n[0],n[1],a[0]-n[0],a[1]-n[1]),t||(this._rect=i),i},e.prototype.contain=function(t){var i=this.getBoundingRect(),n=this.geometries;if(!i.contain(t[0],t[1]))return!1;e:for(var a=0,o=n.length;a<o;a++){var s=n[a];if(s.type==="polygon"){var l=s.exterior,u=s.interiors;if(Sc(l,t[0],t[1])){for(var c=0;c<(u?u.length:0);c++)if(Sc(u[c],t[0],t[1]))continue e;return!0}}}return!1},e.prototype.transformTo=function(t,i,n,a){var o=this.getBoundingRect(),s=o.width/o.height;n?a||(a=n/s):n=s*a;for(var l=new ht(t,i,n,a),u=o.calculateTransform(l),c=this.geometries,h=0;h<c.length;h++){var f=c[h];f.type==="polygon"?(sI(f.exterior,u),N(f.interiors,function(p){sI(p,u)})):N(f.points,function(p){sI(p,u)})}o=this._rect,o.copy(l),this._center=[o.x+o.width/2,o.y+o.height/2]},e.prototype.cloneShallow=function(t){t==null&&(t=this.name);var i=new e(t,this.geometries,this._center);return i._rect=this._rect,i.transformTo=null,i},e}(E8);var A8=function(r){Z(e,r);function e(t,i){var n=r.call(this,t)||this;return n.type="geoSVG",n._elOnlyForCalculate=i,n}return e.prototype.calcCenter=function(){for(var t=this._elOnlyForCalculate,i=t.getBoundingRect(),n=[i.x+i.width/2,i.y+i.height/2],a=vh(yde),o=t;o&&!o.isGeoSVGGraphicRoot;)mo(a,o.getLocalTransform(),a),o=o.parent;return Ls(a,a),mi(n,n,a),n},e}(E8);function xde(r){if(!r.UTF8Encoding)return r;var e=r,t=e.UTF8Scale;t==null&&(t=1024);var i=e.features;return N(i,function(n){var a=n.geometry,o=a.encodeOffsets,s=a.coordinates;if(o)switch(a.type){case"LineString":a.coordinates=C8(s,o,t);break;case"Polygon":cI(s,o,t);break;case"MultiLineString":cI(s,o,t);break;case"MultiPolygon":N(s,function(l,u){return cI(l,o[u],t)})}}),e.UTF8Encoding=!1,e}function cI(r,e,t){for(var i=0;i<r.length;i++)r[i]=C8(r[i],e[i],t)}function C8(r,e,t){for(var i=[],n=e[0],a=e[1],o=0;o<r.length;o+=2){var s=r.charCodeAt(o)-64,l=r.charCodeAt(o+1)-64;s=s>>1^-(s&1),l=l>>1^-(l&1),s+=n,l+=a,n=s,a=l,i.push([s/t,l/t])}return i}function hI(r,e){return r=xde(r),de(Yt(r.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var i=t.properties,n=t.geometry,a=[];switch(n.type){case"Polygon":var o=n.coordinates;a.push(new lI(o[0],o.slice(1)));break;case"MultiPolygon":N(n.coordinates,function(l){l[0]&&a.push(new lI(l[0],l.slice(1)))});break;case"LineString":a.push(new uI([n.coordinates]));break;case"MultiLineString":a.push(new uI(n.coordinates))}var s=new ST(i[e||"name"],a,i.cp);return s.properties=i,s})}var Dv={};UL(Dv,{MAX_SAFE_INTEGER:()=>B_,asc:()=>Ri,getPercentWithPrecision:()=>cH,getPixelPrecision:()=>qm,getPrecision:()=>An,getPrecisionSafe:()=>k2,isNumeric:()=>Rp,isRadianAroundZero:()=>ic,linearMap:()=>ar,nice:()=>jm,numericToNumber:()=>_o,parseDate:()=>Cn,quantile:()=>Km,quantity:()=>Rw,quantityExponent:()=>Zm,reformIntervals:()=>V_,remRadian:()=>k_,round:()=>Pr});var qx=xt();function R8(r){return r.type==="category"?Sde(r):bde(r)}function L8(r,e){return r.type==="category"?Mde(r,e):{ticks:de(r.scale.getTicks(),function(t){return t.value})}}function Sde(r){var e=r.getLabelModel(),t=D8(r,e);return!e.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function D8(r,e){var t=P8(r,"labels"),i=yT(e),n=I8(t,i);if(n)return n;var a,o;return He(i)?a=z8(r,i):(o=i==="auto"?wde(r):i,a=O8(r,o)),N8(t,i,{labels:a,labelCategoryInterval:o})}function Mde(r,e){var t=P8(r,"ticks"),i=yT(e),n=I8(t,i);if(n)return n;var a,o;if((!e.get("show")||r.scale.isBlank())&&(a=[]),He(i))a=z8(r,i,!0);else if(i==="auto"){var s=D8(r,r.getLabelModel());o=s.labelCategoryInterval,a=de(s.labels,function(l){return l.tickValue})}else o=i,a=O8(r,o,!0);return N8(t,i,{ticks:a,tickCategoryInterval:o})}function bde(r){var e=r.scale.getTicks(),t=Rv(r);return{labels:de(e,function(i,n){return{level:i.level,formattedLabel:t(i,n),rawLabel:r.scale.getLabel(i),tickValue:i.value}})}}function P8(r,e){return qx(r)[e]||(qx(r)[e]=[])}function I8(r,e){for(var t=0;t<r.length;t++)if(r[t].key===e)return r[t].value}function N8(r,e,t){return r.push({key:e,value:t}),t}function wde(r){var e=qx(r).autoInterval;return e??(qx(r).autoInterval=r.calculateCategoryInterval())}function U8(r){var e=Tde(r),t=Rv(r),i=(e.axisRotate-e.labelRotate)/180*Math.PI,n=r.scale,a=n.getExtent(),o=n.count();if(a[1]-a[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),c=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),f=0,p=0;l<=a[1];l+=s){var d=0,g=0,m=fu(t({value:l}),e.font,"center","top");d=m.width*1.3,g=m.height*1.3,f=Math.max(f,d,7),p=Math.max(p,g,7)}var v=f/c,_=p/h;isNaN(v)&&(v=1/0),isNaN(_)&&(_=1/0);var y=Math.max(0,Math.floor(Math.min(v,_))),x=qx(r.model),M=r.getExtent(),S=x.lastAutoInterval,w=x.lastTickCount;return S!=null&&w!=null&&Math.abs(S-y)<=1&&Math.abs(w-o)<=1&&S>y&&x.axisExtent0===M[0]&&x.axisExtent1===M[1]?y=S:(x.lastTickCount=o,x.lastAutoInterval=y,x.axisExtent0=M[0],x.axisExtent1=M[1]),y}function Tde(r){var e=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function O8(r,e,t){var i=Rv(r),n=r.scale,a=n.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],c=n.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=_T(r),f=o.get("showMinLabel")||h,p=o.get("showMaxLabel")||h;f&&u!==a[0]&&g(a[0]);for(var d=u;d<=a[1];d+=l)g(d);p&&d-l!==a[1]&&g(a[1]);function g(m){var v={value:m};s.push(t?m:{formattedLabel:i(v),rawLabel:n.getLabel(v),tickValue:m})}return s}function z8(r,e,t){var i=r.scale,n=Rv(r),a=[];return N(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;e(o.value,s)&&a.push(t?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var F8=[0,1],Ede=function(){function r(e,t,i){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=i||[0,0]}return r.prototype.contain=function(e){var t=this._extent,i=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return e>=i&&e<=n},r.prototype.containData=function(e){return this.scale.contain(e)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(e){return qm(e||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(e,t){var i=this._extent;i[0]=e,i[1]=t},r.prototype.dataToCoord=function(e,t){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&n.type==="ordinal"&&(i=i.slice(),B8(i,n.count())),ar(e,F8,i,t)},r.prototype.coordToData=function(e,t){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),B8(i,n.count()));var a=ar(e,i,F8,t);return this.scale.scale(a)},r.prototype.pointToData=function(e,t){},r.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),i=L8(this,t),n=i.ticks,a=de(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=t.get("alignWithLabel");return Ade(this,a,o,e.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var i=this.scale.getMinorTicks(t),n=de(i,function(a){return de(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},r.prototype.getViewLabels=function(){return R8(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},r.prototype.calculateCategoryInterval=function(){return U8(this)},r}();function B8(r,e){var t=r[1]-r[0],i=e,n=t/i/2;r[0]+=n,r[1]-=n}function Ade(r,e,t,i){var n=e.length;if(!r.onBand||t||!n)return;var a=r.getExtent(),o,s;if(n===1)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[n-1].tickValue-e[0].tickValue,u=(e[n-1].coord-e[0].coord)/l;N(e,function(p){p.coord-=u/2});var c=r.scale.getExtent();s=1+c[1]-e[n-1].tickValue,o={coord:e[n-1].coord+u*s},e.push(o)}var h=a[0]>a[1];f(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift()),i&&f(a[0],e[0].coord)&&e.unshift({coord:a[0]}),f(a[1],o.coord)&&(i?o.coord=a[1]:e.pop()),i&&f(o.coord,a[1])&&e.push({coord:a[1]});function f(p,d){return p=Pr(p),d=Pr(d),h?p>d:p<d}}var vn=Ede;var Zx=Math.PI*2,ad=$i.CMD,Cde=["top","right","bottom","left"];function Rde(r,e,t,i,n){var a=t.width,o=t.height;switch(r){case"top":i.set(t.x+a/2,t.y-e),n.set(0,-1);break;case"bottom":i.set(t.x+a/2,t.y+o+e),n.set(0,1);break;case"left":i.set(t.x-e,t.y+o/2),n.set(-1,0);break;case"right":i.set(t.x+a+e,t.y+o/2),n.set(1,0);break}}function Lde(r,e,t,i,n,a,o,s,l){o-=r,s-=e;var u=Math.sqrt(o*o+s*s);o/=u,s/=u;var c=o*t+r,h=s*t+e;if(Math.abs(i-n)%Zx<1e-4)return l[0]=c,l[1]=h,u-t;if(a){var f=i;i=Rn(n),n=Rn(f)}else i=Rn(i),n=Rn(n);i>n&&(n+=Zx);var p=Math.atan2(s,o);if(p<0&&(p+=Zx),p>=i&&p<=n||p+Zx>=i&&p+Zx<=n)return l[0]=c,l[1]=h,u-t;var d=t*Math.cos(i)+r,g=t*Math.sin(i)+e,m=t*Math.cos(n)+r,v=t*Math.sin(n)+e,_=(d-o)*(d-o)+(g-s)*(g-s),y=(m-o)*(m-o)+(v-s)*(v-s);return _<y?(l[0]=d,l[1]=g,Math.sqrt(_)):(l[0]=m,l[1]=v,Math.sqrt(y))}function MT(r,e,t,i,n,a,o,s){var l=n-r,u=a-e,c=t-r,h=i-e,f=Math.sqrt(c*c+h*h);c/=f,h/=f;var p=l*c+u*h,d=p/f;s&&(d=Math.min(Math.max(d,0),1)),d*=f;var g=o[0]=r+d*c,m=o[1]=e+d*h;return Math.sqrt((g-n)*(g-n)+(m-a)*(m-a))}function k8(r,e,t,i,n,a,o){t<0&&(r=r+t,t=-t),i<0&&(e=e+i,i=-i);var s=r+t,l=e+i,u=o[0]=Math.min(Math.max(n,r),s),c=o[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-n)*(u-n)+(c-a)*(c-a))}var Ol=[];function Dde(r,e,t){var i=k8(e.x,e.y,e.width,e.height,r.x,r.y,Ol);return t.set(Ol[0],Ol[1]),i}function Pde(r,e,t){for(var i=0,n=0,a=0,o=0,s,l,u=1/0,c=e.data,h=r.x,f=r.y,p=0;p<c.length;){var d=c[p++];p===1&&(i=c[p],n=c[p+1],a=i,o=n);var g=u;switch(d){case ad.M:a=c[p++],o=c[p++],i=a,n=o;break;case ad.L:g=MT(i,n,c[p],c[p+1],h,f,Ol,!0),i=c[p++],n=c[p++];break;case ad.C:g=ow(i,n,c[p++],c[p++],c[p++],c[p++],c[p],c[p+1],h,f,Ol),i=c[p++],n=c[p++];break;case ad.Q:g=lw(i,n,c[p++],c[p++],c[p],c[p+1],h,f,Ol),i=c[p++],n=c[p++];break;case ad.A:var m=c[p++],v=c[p++],_=c[p++],y=c[p++],x=c[p++],M=c[p++];p+=1;var S=!!(1-c[p++]);s=Math.cos(x)*_+m,l=Math.sin(x)*y+v,p<=1&&(a=s,o=l);var w=(h-m)*y/_+m;g=Lde(m,v,y,x,x+M,S,w,f,Ol),i=Math.cos(x+M)*_+m,n=Math.sin(x+M)*y+v;break;case ad.R:a=i=c[p++],o=n=c[p++];var T=c[p++],C=c[p++];g=k8(a,o,T,C,h,f,Ol);break;case ad.Z:g=MT(i,n,a,o,h,f,Ol,!0),i=a,n=o;break}g<u&&(u=g,t.set(Ol[0],Ol[1]))}return u}var zl=new zt,Jr=new zt,Di=new zt,Eu=new zt,Tu=new zt;function pI(r,e){if(r){var t=r.getTextGuideLine(),i=r.getTextContent();if(i&&t){var n=r.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],o=n.candidates||Cde,s=i.getBoundingRect().clone();s.applyTransform(i.getComputedTransform());var l=1/0,u=n.anchor,c=r.getComputedTransform(),h=c&&Ls([],c),f=e.get("length2")||0;u&&Di.copy(u);for(var p=0;p<o.length;p++){var d=o[p];Rde(d,0,s,zl,Eu),zt.scaleAndAdd(Jr,zl,Eu,f),Jr.transform(h);var g=r.getBoundingRect(),m=u?u.distance(Jr):r instanceof pt?Pde(Jr,r.path,Di):Dde(Jr,g,Di);m<l&&(l=m,Jr.transform(c),Di.transform(c),Di.toArray(a[0]),Jr.toArray(a[1]),zl.toArray(a[2]))}dI(a,e.get("minTurnAngle")),t.setShape({points:a})}}}var bT=[],Ma=new zt;function dI(r,e){if(e<=180&&e>0){e=e/180*Math.PI,zl.fromArray(r[0]),Jr.fromArray(r[1]),Di.fromArray(r[2]),zt.sub(Eu,zl,Jr),zt.sub(Tu,Di,Jr);var t=Eu.len(),i=Tu.len();if(!(t<.001||i<.001)){Eu.scale(1/t),Tu.scale(1/i);var n=Eu.dot(Tu),a=Math.cos(e);if(a<n){var o=MT(Jr.x,Jr.y,Di.x,Di.y,zl.x,zl.y,bT,!1);Ma.fromArray(bT),Ma.scaleAndAdd(Tu,o/Math.tan(Math.PI-e));var s=Di.x!==Jr.x?(Ma.x-Jr.x)/(Di.x-Jr.x):(Ma.y-Jr.y)/(Di.y-Jr.y);if(isNaN(s))return;s<0?zt.copy(Ma,Jr):s>1&&zt.copy(Ma,Di),Ma.toArray(r[1])}}}}function V8(r,e,t){if(t<=180&&t>0){t=t/180*Math.PI,zl.fromArray(r[0]),Jr.fromArray(r[1]),Di.fromArray(r[2]),zt.sub(Eu,Jr,zl),zt.sub(Tu,Di,Jr);var i=Eu.len(),n=Tu.len();if(!(i<.001||n<.001)){Eu.scale(1/i),Tu.scale(1/n);var a=Eu.dot(e),o=Math.cos(t);if(a<o){var s=MT(Jr.x,Jr.y,Di.x,Di.y,zl.x,zl.y,bT,!1);Ma.fromArray(bT);var l=Math.PI/2,u=Math.acos(Tu.dot(e)),c=l+u-t;if(c>=l)zt.copy(Ma,Di);else{Ma.scaleAndAdd(Tu,s/Math.tan(Math.PI/2-c));var h=Di.x!==Jr.x?(Ma.x-Jr.x)/(Di.x-Jr.x):(Ma.y-Jr.y)/(Di.y-Jr.y);if(isNaN(h))return;h<0?zt.copy(Ma,Jr):h>1&&zt.copy(Ma,Di)}Ma.toArray(r[1])}}}}function fI(r,e,t,i){var n=t==="normal",a=n?r:r.ensureState(t);a.ignore=e;var o=i.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();n?r.useStyle(s):a.style=s}function Ide(r,e){var t=e.smooth,i=e.points;if(i)if(r.moveTo(i[0][0],i[0][1]),t>0&&i.length>=3){var n=Rs(i[0],i[1]),a=Rs(i[1],i[2]);if(!n||!a){r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*t,s=Um([],i[1],i[0],o/n),l=Um([],i[1],i[2],o/a),u=Um([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c<i.length;c++)r.lineTo(i[c][0],i[c][1])}function Pv(r,e,t){var i=r.getTextGuideLine(),n=r.getTextContent();if(!n){i&&r.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),s=n.ignore,l=0;l<Lh.length;l++){var u=Lh[l],c=e[u],h=u==="normal";if(c){var f=c.get("show"),p=h?s:mt(n.states[u]&&n.states[u].ignore,s);if(p||!mt(f,o)){var d=h?i:i&&i.states[u];d&&(d.ignore=!0),i&&fI(i,!0,u,c);continue}i||(i=new ri,r.setTextGuideLine(i),!h&&(s||!o)&&fI(i,!0,"normal",e.normal),r.stateProxy&&(i.stateProxy=r.stateProxy)),fI(i,!1,u,c)}}if(i){Ye(i.style,t),i.style.fill=null;var g=a.get("showAbove"),m=r.textGuideLineConfig=r.textGuideLineConfig||{};m.showAbove=g||!1,i.buildPath=Ide}}function Iv(r,e){e=e||"labelLine";for(var t={normal:r.getModel(e)},i=0;i<Vi.length;i++){var n=Vi[i];t[n]=r.getModel([n,e])}return t}function wT(r){for(var e=[],t=0;t<r.length;t++){var i=r[t];if(!i.defaultAttr.ignore){var n=i.label,a=n.getComputedTransform(),o=n.getBoundingRect(),s=!a||a[1]<1e-5&&a[2]<1e-5,l=n.style.margin||0,u=o.clone();u.applyTransform(a),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new cv(o,a):null;e.push({label:n,labelLine:i.labelLine,rect:u,localRect:o,obb:c,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:a})}}return e}function G8(r,e,t,i,n,a){var o=r.length;if(o<2)return;r.sort(function(C,b){return C.rect[e]-b.rect[e]});for(var s=0,l,u=!1,c=[],h=0,f=0;f<o;f++){var p=r[f],d=p.rect;l=d[e]-s,l<0&&(d[e]-=l,p.label[e]-=l,u=!0);var g=Math.max(-l,0);c.push(g),h+=g,s=d[e]+d[t]}h>0&&a&&S(-h/o,0,o);var m=r[0],v=r[o-1],_,y;x(),_<0&&w(-_,.8),y<0&&w(y,.8),x(),M(_,y,1),M(y,_,-1),x(),_<0&&T(-_),y<0&&T(y);function x(){_=m.rect[e]-i,y=n-v.rect[e]-v.rect[t]}function M(C,b,E){if(C<0){var I=Math.min(b,-C);if(I>0){S(I*E,0,o);var R=I+C;R<0&&w(-R*E,1)}else w(-C*E,1)}}function S(C,b,E){C!==0&&(u=!0);for(var I=b;I<E;I++){var R=r[I],A=R.rect;A[e]+=C,R.label[e]+=C}}function w(C,b){for(var E=[],I=0,R=1;R<o;R++){var A=r[R-1].rect,P=Math.max(r[R].rect[e]-A[e]-A[t],0);E.push(P),I+=P}if(I){var U=Math.min(Math.abs(C)/I,b);if(C>0)for(var R=0;R<o-1;R++){var B=E[R]*U;S(B,0,R+1)}else for(var R=o-1;R>0;R--){var B=E[R-1]*U;S(-B,R,o)}}}function T(C){var b=C<0?-1:1;C=Math.abs(C);for(var E=Math.ceil(C/(o-1)),I=0;I<o-1;I++)if(b>0?S(E,0,I+1):S(-E,o-I-1,o),C-=E,C<=0)return}return u}function H8(r,e,t,i){return G8(r,"x","width",e,t,i)}function TT(r,e,t,i){return G8(r,"y","height",e,t,i)}function ET(r){var e=[];r.sort(function(g,m){return m.priority-g.priority});var t=new ht(0,0,0,0);function i(g){if(!g.ignore){var m=g.ensureState("emphasis");m.ignore==null&&(m.ignore=!1)}g.ignore=!0}for(var n=0;n<r.length;n++){var a=r[n],o=a.axisAligned,s=a.localRect,l=a.transform,u=a.label,c=a.labelLine;t.copy(a.rect),t.width-=.1,t.height-=.1,t.x+=.05,t.y+=.05;for(var h=a.obb,f=!1,p=0;p<e.length;p++){var d=e[p];if(t.intersect(d.rect)){if(o&&d.axisAligned){f=!0;break}if(d.obb||(d.obb=new cv(d.localRect,d.transform)),h||(h=new cv(s,l)),h.intersect(d.obb)){f=!0;break}}}f?(i(u),c&&i(c)):(u.attr("ignore",a.defaultAttr.ignore),c&&c.attr("ignore",a.defaultAttr.labelGuideIgnore),e.push(a))}}function Nde(r){if(r){for(var e=[],t=0;t<r.length;t++)e.push(r[t].slice());return e}}function Ude(r,e){var t=r.label,i=e&&e.getTextGuideLine();return{dataIndex:r.dataIndex,dataType:r.dataType,seriesIndex:r.seriesModel.seriesIndex,text:r.label.style.text,rect:r.hostRect,labelRect:r.rect,align:t.style.align,verticalAlign:t.style.verticalAlign,labelLinePoints:Nde(i&&i.shape.points)}}var W8=["align","verticalAlign","width","height","fontSize"],ba=new go,mI=xt(),Ode=xt();function AT(r,e,t){for(var i=0;i<t.length;i++){var n=t[i];e[n]!=null&&(r[n]=e[n])}}var CT=["x","y","rotation"],zde=function(){function r(){this._labelList=[],this._chartViewList=[]}return r.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},r.prototype._addLabel=function(e,t,i,n,a){var o=n.style,s=n.__hostTarget,l=s.textConfig||{},u=n.getComputedTransform(),c=n.getBoundingRect().plain();ht.applyTransform(c,c,u),u?ba.setLocalTransform(u):(ba.x=ba.y=ba.rotation=ba.originX=ba.originY=0,ba.scaleX=ba.scaleY=1),ba.rotation=Rn(ba.rotation);var h=n.__hostTarget,f;if(h){f=h.getBoundingRect().plain();var p=h.getComputedTransform();ht.applyTransform(f,f,p)}var d=f&&h.getTextGuideLine();this._labelList.push({label:n,labelLine:d,seriesModel:i,dataIndex:e,dataType:t,layoutOption:a,computedLayoutOption:null,rect:c,hostRect:f,priority:f?f.width*f.height:0,defaultAttr:{ignore:n.ignore,labelGuideIgnore:d&&d.ignore,x:ba.x,y:ba.y,scaleX:ba.scaleX,scaleY:ba.scaleY,rotation:ba.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:n.cursor,attachedPos:l.position,attachedRot:l.rotation}})},r.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var i=e.__model,n=i.get("labelLayout");(He(n)||At(n).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=it(a);o&&!o.disableLabelLayout&&t._addLabel(s.dataIndex,s.dataType,i,o,n)})},r.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),i=e.getHeight();function n(y,x){return function(){pI(y,x)}}for(var a=0;a<this._labelList.length;a++){var o=this._labelList[a],s=o.label,l=s.__hostTarget,u=o.defaultAttr,c=void 0;He(o.layoutOption)?c=o.layoutOption(Ude(o,l)):c=o.layoutOption,c=c||{},o.computedLayoutOption=c;var h=Math.PI/180;l&&l.setTextConfig({local:!1,position:c.x!=null||c.y!=null?null:u.attachedPos,rotation:c.rotate!=null?c.rotate*h:u.attachedRot,offset:[c.dx||0,c.dy||0]});var f=!1;if(c.x!=null?(s.x=ze(c.x,t),s.setStyle("x",0),f=!0):(s.x=u.x,s.setStyle("x",u.style.x)),c.y!=null?(s.y=ze(c.y,i),s.setStyle("y",0),f=!0):(s.y=u.y,s.setStyle("y",u.style.y)),c.labelLinePoints){var p=l.getTextGuideLine();p&&(p.setShape({points:c.labelLinePoints}),f=!1)}var d=mI(s);d.needsUpdateLabelLine=f,s.rotation=c.rotate!=null?c.rotate*h:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var g=0;g<W8.length;g++){var m=W8[g];s.setStyle(m,c[m]!=null?c[m]:u.style[m])}if(c.draggable){if(s.draggable=!0,s.cursor="move",l){var v=o.seriesModel;if(o.dataIndex!=null){var _=o.seriesModel.getData(o.dataType);v=_.getItemModel(o.dataIndex)}s.on("drag",n(l,v.getModel("labelLine")))}}else s.off("drag"),s.cursor=u.cursor}},r.prototype.layout=function(e){var t=e.getWidth(),i=e.getHeight(),n=wT(this._labelList),a=Yt(n,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=Yt(n,function(l){return l.layoutOption.moveOverlap==="shiftY"});H8(a,0,t),TT(o,0,i);var s=Yt(n,function(l){return l.layoutOption.hideOverlap});ET(s)},r.prototype.processLabelsOverall=function(){var e=this;N(this._chartViewList,function(t){var i=t.__model,n=t.ignoreLabelLineUpdate,a=i.isAnimationEnabled();t.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var s=!n,l=o.getTextContent();!s&&l&&(s=mI(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,i),a&&e._animateLabels(o,i)})})},r.prototype._updateLabelLine=function(e,t){var i=e.getTextContent(),n=it(e),a=n.dataIndex;if(i&&a!=null){var o=t.getData(n.dataType),s=o.getItemModel(a),l={},u=o.getItemVisual(a,"style");if(u){var c=o.getVisual("drawType");l.stroke=u[c]}var h=s.getModel("labelLine");Pv(e,Iv(s),l),pI(e,h)}},r.prototype._animateLabels=function(e,t){var i=e.getTextContent(),n=e.getTextGuideLine();if(i&&(e.forceLabelAnimation||!i.ignore&&!i.invisible&&!e.disableLabelAnimation&&!uc(e))){var a=mI(i),o=a.oldLayout,s=it(e),l=s.dataIndex,u={x:i.x,y:i.y,rotation:i.rotation},c=t.getData(s.dataType);if(o){i.attr(o);var f=e.prevStates;f&&(yt(f,"select")>=0&&i.attr(a.oldLayoutSelect),yt(f,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),Ut(i,u,t,l)}else if(i.attr(u),!dc(i).valueAnimation){var h=mt(i.style.opacity,1);i.style.opacity=0,lr(i,{style:{opacity:h}},t,l)}if(a.oldLayout=u,i.states.select){var p=a.oldLayoutSelect={};AT(p,u,CT),AT(p,i.states.select,CT)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};AT(d,u,CT),AT(d,i.states.emphasis,CT)}o1(i,l,c,t,t)}if(n&&!n.ignore&&!n.invisible){var a=Ode(n),o=a.oldLayout,g={points:n.shape.points};o?(n.attr({shape:o}),Ut(n,{shape:g},t)):(n.setShape(g),n.style.strokePercent=0,lr(n,{style:{strokePercent:1}},t)),a.oldLayout=g}},r}(),X8=zde;var vI=xt();function gI(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,i){var n=vI(t).labelManager;n||(n=vI(t).labelManager=new X8),n.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(e,t,i){var n=vI(t).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),n.updateLayoutConfig(t),n.layout(t),n.processLabelsOverall()})}var yI=Math.sin,_I=Math.cos,Y8=Math.PI,od=Math.PI*2,Fde=180/Y8,Bde=function(){function r(){}return r.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},r.prototype.moveTo=function(e,t){this._add("M",e,t)},r.prototype.lineTo=function(e,t){this._add("L",e,t)},r.prototype.bezierCurveTo=function(e,t,i,n,a,o){this._add("C",e,t,i,n,a,o)},r.prototype.quadraticCurveTo=function(e,t,i,n){this._add("Q",e,t,i,n)},r.prototype.arc=function(e,t,i,n,a,o){this.ellipse(e,t,i,i,0,n,a,o)},r.prototype.ellipse=function(e,t,i,n,a,o,s,l){var u=s-o,c=!l,h=Math.abs(u),f=hu(h-od)||(c?u>=od:-u>=od),p=u>0?u%od:u%od+od,d=!1;f?d=!0:hu(h)?d=!1:d=p>=Y8==!!c;var g=e+i*_I(o),m=t+n*yI(o);this._start&&this._add("M",g,m);var v=Math.round(a*Fde);if(f){var _=1/this._p,y=(c?1:-1)*(od-_);this._add("A",i,n,v,1,+c,e+i*_I(o+y),t+n*yI(o+y)),_>.01&&this._add("A",i,n,v,0,+c,g,m)}else{var x=e+i*_I(s),M=t+n*yI(s);this._add("A",i,n,v,+d,+c,x,M)}},r.prototype.rect=function(e,t,i,n){this._add("M",e,t),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(e,t,i,n,a,o,s,l,u){for(var c=[],h=this._p,f=1;f<arguments.length;f++){var p=arguments[f];if(isNaN(p)){this._invalid=!0;return}c.push(Math.round(p*h)/h)}this._d.push(e+c.join(" ")),this._start=e==="Z"},r.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},r.prototype.getStr=function(){return this._str},r}(),RT=Bde;var jx="none",kde=Math.round;function Vde(r){var e=r.fill;return e!=null&&e!==jx}function Gde(r){var e=r.stroke;return e!=null&&e!==jx}var xI=["lineCap","miterLimit","lineJoin"],Hde=de(xI,function(r){return"stroke-"+r.toLowerCase()});function SI(r,e,t,i){var n=e.opacity==null?1:e.opacity;if(t instanceof Br){r("opacity",n);return}if(Vde(e)){var a=Mh(e.fill);r("fill",a.color);var o=e.fillOpacity!=null?e.fillOpacity*a.opacity*n:a.opacity*n;(i||o<1)&&r("fill-opacity",o)}else r("fill",jx);if(Gde(e)){var s=Mh(e.stroke);r("stroke",s.color);var l=e.strokeNoScale?t.getLineScale():1,u=l?(e.lineWidth||0)/l:0,c=e.strokeOpacity!=null?e.strokeOpacity*s.opacity*n:s.opacity*n,h=e.strokeFirst;if((i||u!==1)&&r("stroke-width",u),(i||h)&&r("paint-order",h?"stroke":"fill"),(i||c<1)&&r("stroke-opacity",c),e.lineDash){var f=Px(t),p=f[0],d=f[1];p&&(d=kde(d||0),r("stroke-dasharray",p.join(",")),(d||i)&&r("stroke-dashoffset",d))}else i&&r("stroke-dasharray",jx);for(var g=0;g<xI.length;g++){var m=xI[g];if(i||e[m]!==tv[m]){var v=e[m]||tv[m];v&&r(Hde[g],v)}}}else i&&r("stroke",jx)}var q8="http://www.w3.org/2000/svg",MI="http://www.w3.org/1999/xlink",Z8="http://www.w3.org/2000/xmlns/",j8="http://www.w3.org/XML/1998/namespace",bI="ecmeta_";function LT(r){return document.createElementNS(q8,r)}function Pi(r,e,t,i,n){return{tag:r,attrs:t||{},children:i,text:n,key:e}}function Wde(r,e){var t=[];if(e)for(var i in e){var n=e[i],a=i;n!==!1&&(n!==!0&&n!=null&&(a+='="'+n+'"'),t.push(a))}return"<"+r+" "+t.join(" ")+">"}function Xde(r){return"</"+r+">"}function Kx(r,e){e=e||{};var t=e.newline?`
  2213. `:"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return Wde(o,s)+(o!=="style"?wn(l):l||"")+(a?""+t+de(a,function(u){return i(u)}).join(t)+t:"")+Xde(o)}return i(r)}function K8(r,e,t){t=t||{};var i=t.newline?`
  2214. `:"",n=" {"+i,a=i+"}",o=de(At(r),function(l){return l+n+de(At(r[l]),function(u){return u+":"+r[l][u]+";"}).join(i)+a}).join(i),s=de(At(e),function(l){return"@keyframes "+l+n+de(At(e[l]),function(u){return u+n+de(At(e[l][u]),function(c){var h=e[l][u][c];return c==="d"&&(h='path("'+h+'")'),c+":"+h+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":["<![CDATA[",o,s,"]]>"].join(i)}function Jx(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function wI(r,e,t,i){return Pi("svg","root",{width:r,height:e,xmlns:q8,"xmlns:xlink":MI,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+e:!1},t)}var Yde=0;function DT(){return Yde++}var J8={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},sd="transform-origin";function qde(r,e,t){var i=he({},r.shape);he(i,e),r.buildPath(t,i);var n=new RT;return n.reset(yw(r)),t.rebuildPath(n,1),n.generateStr(),n.getStr()}function Zde(r,e){var t=e.originX,i=e.originY;(t||i)&&(r[sd]=t+"px "+i+"px")}var jde={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Q8(r,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=r,t}function Kde(r,e,t){var i=r.shape.paths,n={},a,o;if(N(i,function(l){var u=Jx(t.zrId);u.animation=!0,$x(l,{},u,!0);var c=u.cssAnims,h=u.cssNodes,f=At(c),p=f.length;if(p){o=f[p-1];var d=c[o];for(var g in d){var m=d[g];n[g]=n[g]||{d:""},n[g].d+=m.d||""}for(var v in h){var _=h[v].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){e.d=!1;var s=Q8(n,t);return a.replace(o,s)}}function $8(r){return Ce(r)?J8[r]?"cubic-bezier("+J8[r]+")":km(r)?r:"":""}function $x(r,e,t,i){var n=r.animators,a=n.length,o=[];if(r instanceof uv){var s=Kde(r,e,t);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u<a;u++){var c=n[u],h=[c.getMaxTime()/1e3+"s"],f=$8(c.getClip().easing),p=c.getDelay();f?h.push(f):h.push("linear"),p&&h.push(p/1e3+"s"),c.getLoop()&&h.push("infinite");var d=h.join(" ");l[d]=l[d]||[d,[]],l[d][1].push(c)}function g(_){var y=_[1],x=y.length,M={},S={},w={},T="animation-timing-function";function C(ue,se,Ee){for(var q=ue.getTracks(),H=ue.getMaxTime(),We=0;We<q.length;We++){var _e=q[We];if(_e.needsAnimate()){var xe=_e.keyframes,Le=_e.propName;if(Ee&&(Le=Ee(Le)),Le)for(var Ue=0;Ue<xe.length;Ue++){var Ne=xe[Ue],Ve=Math.round(Ne.time/H*100)+"%",dt=$8(Ne.easing),F=Ne.rawValue;(Ce(F)||Dt(F))&&(se[Ve]=se[Ve]||{},se[Ve][Le]=Ne.rawValue,dt&&(se[Ve][T]=dt))}}}}for(var b=0;b<x;b++){var E=y[b],I=E.targetName;I?I==="shape"&&C(E,S):!i&&C(E,M)}for(var R in M){var A={};P2(A,r),he(A,M[R]);var P=_w(A),U=M[R][T];w[R]=P?{transform:P}:{},Zde(w[R],A),U&&(w[R][T]=U)}var B,z=!0;for(var R in S){w[R]=w[R]||{};var k=!B,U=S[R][T];k&&(B=new $i);var G=B.len();B.reset(),w[R].d=qde(r,S[R],B);var Y=B.len();if(!k&&G!==Y){z=!1;break}U&&(w[R][T]=U)}if(!z)for(var R in w)delete w[R].d;if(!i)for(var b=0;b<x;b++){var E=y[b],I=E.targetName;I==="style"&&C(E,w,function(q){return jde[q]})}for(var J=At(w),Q=!0,V,b=1;b<J.length;b++){var K=J[b-1],ae=J[b];if(w[K][sd]!==w[ae][sd]){Q=!1;break}V=w[K][sd]}if(Q&&V){for(var R in w)w[R][sd]&&delete w[R][sd];e[sd]=V}if(Yt(J,function(ue){return At(w[ue]).length>0}).length){var ve=Q8(w,t);return ve+" "+_[0]+" both"}}for(var m in l){var s=g(l[m]);s&&o.push(s)}if(o.length){var v=t.zrId+"-cls-"+DT();t.cssNodes["."+v]={animation:o.join(",")},e.class=v}}function tX(r,e,t){if(!r.ignore)if(r.isSilent()){var i={"pointer-events":"none"};eX(i,e,t,!0)}else{var n=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=n.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=L_(l))}var u=n.lineWidth;if(u){var c=!n.strokeNoScale&&r.transform?r.transform[0]:1;u=u/c}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),eX(i,e,t,!0)}}function eX(r,e,t,i){var n=JSON.stringify(r),a=t.cssStyleCache[n];a||(a=t.zrId+"-cls-"+DT(),t.cssStyleCache[n]=a,t.cssNodes["."+a+(i?":hover":"")]=r),e.class=e.class?e.class+" "+a:a}var Qx=Math.round;function aX(r){return r&&Ce(r.src)}function oX(r){return r&&He(r.toDataURL)}function TI(r,e,t,i){SI(function(n,a){var o=n==="fill"||n==="stroke";o&&gw(a)?RI(e,r,n,i):o&&D_(a)?LI(t,r,n,i):o&&a==="none"?r[n]="transparent":r[n]=a},e,t,!1),ime(t,r,i)}function EI(r,e){var t=oH(e);t&&(t.each(function(i,n){i!=null&&(r[(bI+n).toLowerCase()]=i+"")}),e.isSilent()&&(r[bI+"silent"]="true"))}function rX(r){return hu(r[0]-1)&&hu(r[1])&&hu(r[2])&&hu(r[3]-1)}function Jde(r){return hu(r[4])&&hu(r[5])}function AI(r,e,t){if(e&&!(Jde(e)&&rX(e))){var i=t?10:1e4;r.transform=rX(e)?"translate("+Qx(e[4]*i)/i+" "+Qx(e[5]*i)/i+")":NG(e)}}function iX(r,e,t){for(var i=r.points,n=[],a=0;a<i.length;a++)n.push(Qx(i[a][0]*t)/t),n.push(Qx(i[a][1]*t)/t);e.points=n.join(" ")}function nX(r){return!r.smooth}function $de(r){var e=de(r,function(t){return typeof t=="string"?[t,t]:t});return function(t,i,n){for(var a=0;a<e.length;a++){var o=e[a],s=t[o[0]];s!=null&&(i[o[1]]=Qx(s*n)/n)}}}var Qde={circle:[$de(["cx","cy","r"])],polyline:[iX,nX],polygon:[iX,nX]};function eme(r){for(var e=r.animators,t=0;t<e.length;t++)if(e[t].targetName==="shape")return!0;return!1}function sX(r,e){var t=r.style,i=r.shape,n=Qde[r.type],a={},o=e.animation,s="path",l=r.style.strokePercent,u=e.compress&&yw(r)||4;if(n&&!e.willUpdate&&!(n[1]&&!n[1](i))&&!(o&&eme(r))&&!(l<1)){s=r.type;var c=Math.pow(10,u);n[0](i,a,c)}else{var h=!r.path||r.shapeChanged();r.path||r.createPathProxy();var f=r.path;h&&(f.beginPath(),r.buildPath(f,r.shape),r.pathUpdated());var p=f.getVersion(),d=r,g=d.__svgPathBuilder;(d.__svgPathVersion!==p||!g||l!==d.__svgPathStrokePercent)&&(g||(g=d.__svgPathBuilder=new RT),g.reset(u),f.rebuildPath(g,l),g.generateStr(),d.__svgPathVersion=p,d.__svgPathStrokePercent=l),a.d=g.getStr()}return AI(a,r.transform),TI(a,t,r,e),EI(a,r),e.animation&&$x(r,a,e),e.emphasis&&tX(r,a,e),Pi(s,r.id+"",a)}function tme(r,e){var t=r.style,i=t.image;if(i&&!Ce(i)&&(aX(i)?i=i.src:oX(i)&&(i=i.toDataURL())),!!i){var n=t.x||0,a=t.y||0,o=t.width,s=t.height,l={href:i,width:o,height:s};return n&&(l.x=n),a&&(l.y=a),AI(l,r.transform),TI(l,t,r,e),EI(l,r),e.animation&&$x(r,l,e),Pi("image",r.id+"",l)}}function rme(r,e){var t=r.style,i=t.text;if(i!=null&&(i+=""),!(!i||isNaN(t.x)||isNaN(t.y))){var n=t.font||Jo,a=t.x||0,o=OG(t.y||0,Xm(n),t.textBaseline),s=UG[t.textAlign]||t.textAlign,l={"dominant-baseline":"central","text-anchor":s};if(uD(t)){var u="",c=t.fontStyle,h=lD(t.fontSize);if(!parseFloat(h))return;var f=t.fontFamily||JL,p=t.fontWeight;u+="font-size:"+h+";font-family:"+f+";",c&&c!=="normal"&&(u+="font-style:"+c+";"),p&&p!=="normal"&&(u+="font-weight:"+p+";"),l.style=u}else l.style="font: "+n;return i.match(/\s/)&&(l["xml:space"]="preserve"),a&&(l.x=a),o&&(l.y=o),AI(l,r.transform),TI(l,t,r,e),EI(l,r),e.animation&&$x(r,l,e),Pi("text",r.id+"",l,void 0,i)}}function CI(r,e){if(r instanceof pt)return sX(r,e);if(r instanceof Br)return tme(r,e);if(r instanceof ac)return rme(r,e)}function ime(r,e,t){var i=r.style;if(zG(i)){var n=FG(r),a=t.shadowCache,o=a[n];if(!o){var s=r.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var c=i.shadowOffsetX||0,h=i.shadowOffsetY||0,f=i.shadowBlur,p=Mh(i.shadowColor),d=p.opacity,g=p.color,m=f/2/l,v=f/2/u,_=m+" "+v;o=t.zrId+"-s"+t.shadowIdx++,t.defs[o]=Pi("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[Pi("feDropShadow","",{dx:c/l,dy:h/u,stdDeviation:_,"flood-color":g,"flood-opacity":d})]),a[n]=o}e.filter=P_(o)}}function RI(r,e,t,i){var n=r[t],a,o={gradientUnits:n.global?"userSpaceOnUse":"objectBoundingBox"};if(mw(n))a="linearGradient",o.x1=n.x,o.y1=n.y,o.x2=n.x2,o.y2=n.y2;else if(vw(n))a="radialGradient",o.cx=mt(n.x,.5),o.cy=mt(n.y,.5),o.r=mt(n.r,.5);else return;for(var s=n.colorStops,l=[],u=0,c=s.length;u<c;++u){var h=dw(s[u].offset)*100+"%",f=s[u].color,p=Mh(f),d=p.color,g=p.opacity,m={offset:h};m["stop-color"]=d,g<1&&(m["stop-opacity"]=g),l.push(Pi("stop",u+"",m))}var v=Pi(a,"",o,l),_=Kx(v),y=i.gradientCache,x=y[_];x||(x=i.zrId+"-g"+i.gradientIdx++,y[_]=x,o.id=x,i.defs[x]=Pi(a,x,o,l)),e[t]=P_(x)}function LI(r,e,t,i){var n=r.style[t],a=r.getBoundingRect(),o={},s=n.repeat,l=s==="no-repeat",u=s==="repeat-x",c=s==="repeat-y",h;if(_2(n)){var f=n.imageWidth,p=n.imageHeight,d=void 0,g=n.image;if(Ce(g)?d=g:aX(g)?d=g.src:oX(g)&&(d=g.toDataURL()),typeof Image>"u"){var m="Image width/height must been given explictly in svg-ssr renderer.";Wr(f,m),Wr(p,m)}else if(f==null||p==null){var v=function(b,E){if(b){var I=b.elm,R=f||E.width,A=p||E.height;b.tag==="pattern"&&(u?(A=1,R/=a.width):c&&(R=1,A/=a.height)),b.attrs.width=R,b.attrs.height=A,I&&(I.setAttribute("width",R),I.setAttribute("height",A))}},_=X_(d,null,r,function(b){l||v(S,b),v(h,b)});_&&_.width&&_.height&&(f=f||_.width,p=p||_.height)}h=Pi("image","img",{href:d,width:f,height:p}),o.width=f,o.height=p}else n.svgElement&&(h=Qe(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(h){var y,x;l?y=x=1:u?(x=1,y=o.width/a.width):c?(y=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",y!=null&&!isNaN(y)&&(o.width=y),x!=null&&!isNaN(x)&&(o.height=x);var M=_w(n);M&&(o.patternTransform=M);var S=Pi("pattern","",o,[h]),w=Kx(S),T=i.patternCache,C=T[w];C||(C=i.zrId+"-p"+i.patternIdx++,T[w]=C,o.id=C,S=i.defs[C]=Pi("pattern",C,o,[h])),e[t]=P_(C)}}function lX(r,e,t){var i=t.clipPathCache,n=t.defs,a=i[r.id];if(!a){a=t.zrId+"-c"+t.clipPathIdx++;var o={id:a};i[r.id]=a,n[a]=Pi("clipPath",a,o,[sX(r,t)])}e["clip-path"]=P_(a)}function DI(r){return document.createTextNode(r)}function Yh(r,e,t){r.insertBefore(e,t)}function PI(r,e){r.removeChild(e)}function II(r,e){r.appendChild(e)}function NI(r){return r.parentNode}function UI(r){return r.nextSibling}function PT(r,e){r.textContent=e}var uX=58,ame=120,ome=Pi("","");function OI(r){return r===void 0}function Au(r){return r!==void 0}function sme(r,e,t){for(var i={},n=e;n<=t;++n){var a=r[n].key;a!==void 0&&(i[a]=n)}return i}function eS(r,e){var t=r.key===e.key,i=r.tag===e.tag;return i&&t}function tS(r){var e,t=r.children,i=r.tag;if(Au(i)){var n=r.elm=LT(i);if(NT(ome,r),pe(t))for(e=0;e<t.length;++e){var a=t[e];a!=null&&II(n,tS(a))}else Au(r.text)&&!qe(r.text)&&II(n,DI(r.text))}else r.elm=DI(r.text);return r.elm}function cX(r,e,t,i,n){for(;i<=n;++i){var a=t[i];a!=null&&Yh(r,tS(a),e)}}function IT(r,e,t,i){for(;t<=i;++t){var n=e[t];if(n!=null)if(Au(n.tag)){var a=NI(n.elm);PI(a,n.elm)}else PI(r,n.elm)}}function NT(r,e){var t,i=e.elm,n=r&&r.attrs||{},a=e.attrs||{};if(n!==a){for(t in a){var o=a[t],s=n[t];s!==o&&(o===!0?i.setAttribute(t,""):o===!1?i.removeAttribute(t):t==="style"?i.style.cssText=o:t.charCodeAt(0)!==ame?i.setAttribute(t,o):t==="xmlns:xlink"||t==="xmlns"?i.setAttributeNS(Z8,t,o):t.charCodeAt(3)===uX?i.setAttributeNS(j8,t,o):t.charCodeAt(5)===uX?i.setAttributeNS(MI,t,o):i.setAttribute(t,o))}for(t in n)t in a||i.removeAttribute(t)}}function lme(r,e,t){for(var i=0,n=0,a=e.length-1,o=e[0],s=e[a],l=t.length-1,u=t[0],c=t[l],h,f,p,d;i<=a&&n<=l;)o==null?o=e[++i]:s==null?s=e[--a]:u==null?u=t[++n]:c==null?c=t[--l]:eS(o,u)?(Nv(o,u),o=e[++i],u=t[++n]):eS(s,c)?(Nv(s,c),s=e[--a],c=t[--l]):eS(o,c)?(Nv(o,c),Yh(r,o.elm,UI(s.elm)),o=e[++i],c=t[--l]):eS(s,u)?(Nv(s,u),Yh(r,s.elm,o.elm),s=e[--a],u=t[++n]):(OI(h)&&(h=sme(e,i,a)),f=h[u.key],OI(f)?Yh(r,tS(u),o.elm):(p=e[f],p.tag!==u.tag?Yh(r,tS(u),o.elm):(Nv(p,u),e[f]=void 0,Yh(r,p.elm,o.elm))),u=t[++n]);(i<=a||n<=l)&&(i>a?(d=t[l+1]==null?null:t[l+1].elm,cX(r,d,t,n,l)):IT(r,e,i,a))}function Nv(r,e){var t=e.elm=r.elm,i=r.children,n=e.children;r!==e&&(NT(r,e),OI(e.text)?Au(i)&&Au(n)?i!==n&&lme(t,i,n):Au(n)?(Au(r.text)&&PT(t,""),cX(t,null,n,0,n.length-1)):Au(i)?IT(t,i,0,i.length-1):Au(r.text)&&PT(t,""):r.text!==e.text&&(Au(i)&&IT(t,i,0,i.length-1),PT(t,e.text)))}function zI(r,e){if(eS(r,e))Nv(r,e);else{var t=r.elm,i=NI(t);tS(e),i!==null&&(Yh(i,e.elm,UI(t)),IT(i,[r],0,0))}return e}var ume=0,cme=function(){function r(e,t,i){if(this.type="svg",this.refreshHover=hX("refreshHover"),this.configLayer=hX("configLayer"),this.storage=t,this._opts=i=he({},i),this.root=e,this._id="zr"+ume++,this._oldVNode=wI(i.width,i.height),e&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=LT("svg");NT(null,this._oldVNode),n.appendChild(a),e.appendChild(n)}this.resize(i.width,i.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",zI(this._oldVNode,e),this._oldVNode=e}},r.prototype.renderOneToVNode=function(e){return CI(e,Jx(this._id))},r.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=Jx(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis;var o=[],s=this._bgVNode=hme(i,n,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=Pi("g","main",{},[]);this._paintList(t,a,l?l.children:o),l&&o.push(l);var u=de(At(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(Pi("defs","defs",{},u)),e.animation){var c=K8(a.cssNodes,a.cssAnims,{newline:!0});if(c){var h=Pi("style","stl",{},[],c);o.push(h)}}return wI(i,n,o,e.useViewBox)},r.prototype.renderToString=function(e){return e=e||{},Kx(this.renderToVNode({animation:mt(e.cssAnimation,!0),emphasis:mt(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:mt(e.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(e,t,i){for(var n=e.length,a=[],o=0,s,l,u=0,c=0;c<n;c++){var h=e[c];if(!h.invisible){var f=h.__clipPaths,p=f&&f.length||0,d=l&&l.length||0,g=void 0;for(g=Math.max(p-1,d-1);g>=0&&!(f&&l&&f[g]===l[g]);g--);for(var m=d-1;m>g;m--)o--,s=a[o-1];for(var v=g+1;v<p;v++){var _={};lX(f[v],_,t);var y=Pi("g","clip-g-"+u++,_,[]);(s?s.children:i).push(y),a[o++]=y,s=y}l=f;var x=CI(h,t);x&&(s?s.children:i).push(x)}}},r.prototype.resize=function(e,t){var i=this._opts,n=this.root,a=this._viewport;if(e!=null&&(i.width=e),t!=null&&(i.height=t),n&&a&&(a.style.display="none",e=zh(n,0,i),t=zh(n,1,i),a.style.display=""),this._width!==e||this._height!==t){if(this._width=e,this._height=t,a){var o=a.style;o.width=e+"px",o.height=t+"px"}if(D_(this._backgroundColor))this.refresh();else{var s=this._svgDom;s&&(s.setAttribute("width",e),s.setAttribute("height",t));var l=this._bgVNode&&this._bgVNode.elm;l&&(l.setAttribute("width",e),l.setAttribute("height",t))}}},r.prototype.getWidth=function(){return this._width},r.prototype.getHeight=function(){return this._height},r.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},r.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},r.prototype.toDataURL=function(e){var t=this.renderToString(),i="data:image/svg+xml;";return e?(t=BG(t),t&&i+"base64,"+t):i+"charset=UTF-8,"+encodeURIComponent(t)},r}();function hX(r){return function(){}}function hme(r,e,t,i){var n;if(t&&t!=="none")if(n=Pi("rect","bg",{width:r,height:e,x:"0",y:"0"}),gw(t))RI({fill:t},n.attrs,"fill",i);else if(D_(t))LI({style:{fill:t},dirty:zr,getBoundingRect:function(){return{width:r,height:e}}},n.attrs,"fill",i);else{var a=Mh(t),o=a.color,s=a.opacity;n.attrs.fill=o,s<1&&(n.attrs["fill-opacity"]=s)}return n}var fX=cme;function FI(r){r.registerPainter("svg",fX)}function pX(r,e,t){var i=qn.createCanvas(),n=e.getWidth(),a=e.getHeight(),o=i.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=n+"px",o.height=a+"px",i.setAttribute("data-zr-dom-id",r)),i.width=n*t,i.height=a*t,i}var fme=function(r){qt(e,r);function e(t,i,n){var a=r.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;n=n||wp,typeof t=="string"?o=pX(t,i,n):qe(t)&&(o=t,t=o.id),a.id=t,a.dom=o;var s=o.style;return s&&(Yb(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=i,a.dpr=n,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=pX("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),t!==1&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,i,n,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new ht(0,0,0,0);function c(_){if(!(!_.isFinite()||_.isZero()))if(o.length===0){var y=new ht(0,0,0,0);y.copy(_),o.push(y)}else{for(var x=!1,M=1/0,S=0,w=0;w<o.length;++w){var T=o[w];if(T.intersect(_)){var C=new ht(0,0,0,0);C.copy(T),C.union(_),o[w]=C,x=!0;break}else if(l){u.copy(_),u.union(T);var b=_.width*_.height,E=T.width*T.height,I=u.width*u.height,R=I-b-E;R<M&&(M=R,S=w)}}if(l&&(o[S].union(_),x=!0),!x){var y=new ht(0,0,0,0);y.copy(_),o.push(y)}l||(l=o.length>=s)}}for(var h=this.__startIndex;h<this.__endIndex;++h){var f=t[h];if(f){var p=f.shouldBePainted(n,a,!0,!0),d=f.__isRendered&&(f.__dirty&ki||!p)?f.getPrevPaintRect():null;d&&c(d);var g=p&&(f.__dirty&ki||!f.__isRendered)?f.getPaintRect():null;g&&c(g)}}for(var h=this.__prevStartIndex;h<this.__prevEndIndex;++h){var f=i[h],p=f&&f.shouldBePainted(n,a,!0,!0);if(f&&(!p||!f.__zr)&&f.__isRendered){var d=f.getPrevPaintRect();d&&c(d)}}var m;do{m=!1;for(var h=0;h<o.length;){if(o[h].isZero()){o.splice(h,1);continue}for(var v=h+1;v<o.length;)o[h].intersect(o[v])?(m=!0,o[h].union(o[v]),o.splice(v,1)):v++;h++}}while(m);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(t,i){var n=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=t+"px",o.height=i+"px"),a.width=t*n,a.height=i*n,s&&(s.width=t*n,s.height=i*n,n!==1&&this.ctxBack.scale(n,n))},e.prototype.clear=function(t,i,n){var a=this.dom,o=this.ctx,s=a.width,l=a.height;i=i||this.clearColor;var u=this.motionBlur&&!t,c=this.lastFrameAlpha,h=this.dpr,f=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/h,l/h));var p=this.domBack;function d(g,m,v,_){if(o.clearRect(g,m,v,_),i&&i!=="transparent"){var y=void 0;if(ph(i)){var x=i.global||i.__width===v&&i.__height===_;y=x&&i.__canvasGradient||Dx(o,i,{x:0,y:0,width:v,height:_}),i.__canvasGradient=y,i.__width=v,i.__height=_}else KV(i)&&(i.scaleX=i.scaleX||h,i.scaleY=i.scaleY||h,y=j1(o,i,{dirty:function(){f.setUnpainted(),f.painter.refresh()}}));o.save(),o.fillStyle=y||i,o.fillRect(g,m,v,_),o.restore()}u&&(o.save(),o.globalAlpha=c,o.drawImage(p,g,m,v,_),o.restore())}!n||u?d(0,0,s,l):n.length&&N(n,function(g){d(g.x*h,g.y*h,g.width*h,g.height*h)})},e}(Ni),UT=fme;var dX=1e5,ld=314159,OT=.01,pme=.001;function dme(r){return r?r.__builtin__?!0:!(typeof r.resize!="function"||typeof r.refresh!="function"):!1}function mme(r,e){var t=document.createElement("div");return t.style.cssText=["position:relative","width:"+r+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",t}var vme=function(){function r(e,t,i,n){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=i=he({},i||{}),this.dpr=i.devicePixelRatio||wp,this._singleCanvas=a,this.root=e;var o=e.style;o&&(Yb(e),e.innerHTML=""),this.storage=t;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var c=e,h=c.width,f=c.height;i.width!=null&&(h=i.width),i.height!=null&&(f=i.height),this.dpr=i.devicePixelRatio||1,c.width=h*this.dpr,c.height=f*this.dpr,this._width=h,this._height=f;var p=new UT(c,this,this.dpr);p.__builtin__=!0,p.initContext(),l[ld]=p,p.zlevel=ld,s.push(ld),this._domRoot=e}else{this._width=zh(e,0,i),this._height=zh(e,1,i);var u=this._domRoot=mme(this._width,this._height);e.appendChild(u)}}return r.prototype.getType=function(){return"canvas"},r.prototype.isSingleCanvas=function(){return this._singleCanvas},r.prototype.getViewportRoot=function(){return this._domRoot},r.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},r.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),i=this._prevDisplayList,n=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,i,e,this._redrawId);for(var a=0;a<n.length;a++){var o=n[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},r.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},r.prototype._paintHoverList=function(e){var t=e.length,i=this._hoverlayer;if(i&&i.clear(),!!t){for(var n={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<t;o++){var s=e[o];s.__inHover&&(i||(i=this._hoverlayer=this.getLayer(dX)),a||(a=i.ctx,a.save()),Fh(a,s,n,o===t-1))}a&&a.restore()}},r.prototype.getHoverLayer=function(){return this.getLayer(dX)},r.prototype.paintOne=function(e,t){K1(e,t)},r.prototype._paintList=function(e,t,i,n){if(this._redrawId===n){i=i||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,t,i),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;E_(function(){l._paintList(e,t,i,n)})}}},r.prototype._compositeManually=function(){var e=this.getLayer(ld).ctx,t=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,t,i),this.eachBuiltinLayer(function(n){n.virtual&&e.drawImage(n.dom,0,0,t,i)})},r.prototype._doPaintList=function(e,t,i){for(var n=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||i)&&a.push(u)}for(var c=!0,h=!1,f=function(g){var m=a[g],v=m.ctx,_=o&&m.createRepaintRects(e,t,p._width,p._height),y=i?m.__startIndex:m.__drawIndex,x=!i&&m.incremental&&Date.now,M=x&&Date.now(),S=m.zlevel===p._zlevelList[0]?p._backgroundColor:null;if(m.__startIndex===m.__endIndex)m.clear(!1,S,_);else if(y===m.__startIndex){var w=e[y];(!w.incremental||!w.notClear||i)&&m.clear(!1,S,_)}y===-1&&(console.error("For some unknown reason. drawIndex is -1"),y=m.__startIndex);var T,C=function(R){var A={inHover:!1,allClipped:!1,prevEl:null,viewWidth:n._width,viewHeight:n._height};for(T=y;T<m.__endIndex;T++){var P=e[T];if(P.__inHover&&(h=!0),n._doPaintEl(P,m,o,R,A,T===m.__endIndex-1),x){var U=Date.now()-M;if(U>15)break}}A.prevElClipPaths&&v.restore()};if(_)if(_.length===0)T=m.__endIndex;else for(var b=p.dpr,E=0;E<_.length;++E){var I=_[E];v.save(),v.beginPath(),v.rect(I.x*b,I.y*b,I.width*b,I.height*b),v.clip(),C(I),v.restore()}else v.save(),C(),v.restore();m.__drawIndex=T,m.__drawIndex<m.__endIndex&&(c=!1)},p=this,d=0;d<a.length;d++)f(d);return Bt.wxa&&N(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:c,needsRefreshHover:h}},r.prototype._doPaintEl=function(e,t,i,n,a,o){var s=t.ctx;if(i){var l=e.getPaintRect();(!n||l&&l.intersect(n))&&(Fh(s,e,a,o),e.setPrevPaintRect(l))}else Fh(s,e,a,o)},r.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=ld);var i=this._layers[e];return i||(i=new UT("zr_"+e,this,this.dpr),i.zlevel=e,i.__builtin__=!0,this._layerConfig[e]?bt(i,this._layerConfig[e],!0):this._layerConfig[e-OT]&&bt(i,this._layerConfig[e-OT],!0),t&&(i.virtual=t),this.insertLayer(e,i),i.initContext()),i},r.prototype.insertLayer=function(e,t){var i=this._layers,n=this._zlevelList,a=n.length,o=this._domRoot,s=null,l=-1;if(!i[e]&&dme(t)){if(a>0&&e>n[0]){for(l=0;l<a-1&&!(n[l]<e&&n[l+1]>e);l++);s=i[n[l]]}if(n.splice(l+1,0,e),i[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(t.dom,u.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}},r.prototype.eachLayer=function(e,t){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n];e.call(t,this._layers[a],a)}},r.prototype.eachBuiltinLayer=function(e,t){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n],o=this._layers[a];o.__builtin__&&e.call(t,o,a)}},r.prototype.eachOtherLayer=function(e,t){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n],o=this._layers[a];o.__builtin__||e.call(t,o,a)}},r.prototype.getLayers=function(){return this._layers},r.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(h,f){h.__dirty=h.__used=!1});function t(h){a&&(a.__endIndex!==h&&(a.__dirty=!0),a.__endIndex=h)}if(this._singleCanvas)for(var i=1;i<e.length;i++){var n=e[i];if(n.zlevel!==e[i-1].zlevel||n.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var n=e[l],u=n.zlevel,c=void 0;s!==u&&(s=u,o=0),n.incremental?(c=this.getLayer(u+pme,this._needsManuallyCompositing),c.incremental=!0,o=1):c=this.getLayer(u+(o>0?OT:0),this._needsManuallyCompositing),c.__builtin__||up("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,t(l),a=c),n.__dirty&ki&&!n.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(h,f){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(e){e.clear()},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e,N(this._layers,function(t){t.setUnpainted()})},r.prototype.configLayer=function(e,t){if(t){var i=this._layerConfig;i[e]?bt(i[e],t,!0):i[e]=t;for(var n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];if(a===e||a===e+OT){var o=this._layers[a];bt(o,i[e],!0)}}}},r.prototype.delLayer=function(e){var t=this._layers,i=this._zlevelList,n=t[e];n&&(n.dom.parentNode.removeChild(n.dom),delete t[e],i.splice(yt(i,e),1))},r.prototype.resize=function(e,t){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var n=this._opts,a=this.root;if(e!=null&&(n.width=e),t!=null&&(n.height=t),e=zh(a,0,n),t=zh(a,1,n),i.style.display="",this._width!==e||t!==this._height){i.style.width=e+"px",i.style.height=t+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this.getLayer(ld).resize(e,t)}return this},r.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},r.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},r.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[ld].dom;var t=new UT("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var i=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var n=t.dom.width,a=t.dom.height;this.eachLayer(function(h){h.__builtin__?i.drawImage(h.dom,0,0,n,a):h.renderToCanvas&&(i.save(),h.renderToCanvas(i),i.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var c=s[l];Fh(i,c,o,l===u-1)}return t.dom},r.prototype.getWidth=function(){return this._width},r.prototype.getHeight=function(){return this._height},r}(),mX=vme;function BI(r){r.registerPainter("canvas",mX)}var gme=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t){if(0)var i;return mn(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var i=new Ze,n=wr("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);i.add(n),n.setStyle(t.lineStyle);var a=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=a==="none"?"circle":a,l=t.itemHeight*.8,u=wr(s,(t.itemWidth-l)/2,(t.itemHeight-l)/2,l,l,t.itemStyle.fill);i.add(u),u.setStyle(t.itemStyle);var c=t.iconRotate==="inherit"?o:t.iconRotate||0;return u.rotation=c*Math.PI/180,u.setOrigin([t.itemWidth/2,t.itemHeight/2]),s.indexOf("empty")>-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}($t),vX=gme;function Fl(r,e){var t=r.mapDimensionsAll("defaultedLabel"),i=t.length;if(i===1){var n=_c(r,e,t[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o<t.length;o++)a.push(_c(r,e,t[o]));return a.join(" ")}}function zT(r,e){var t=r.mapDimensionsAll("defaultedLabel");if(!pe(e))return e+"";for(var i=[],n=0;n<t.length;n++){var a=r.getDimensionIndex(t[n]);a>=0&&i.push(e[a])}return i.join(" ")}var yme=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this)||this;return o.updateData(t,i,n,a),o}return e.prototype._createSymbol=function(t,i,n,a,o){this.removeAll();var s=wr(t,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=_me,this._symbolType=t,this.add(s)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Zn(this.childAt(0))},e.prototype.downplay=function(){jn(this.childAt(0))},e.prototype.setZ=function(t,i){var n=this.childAt(0);n.zlevel=t,n.z=i},e.prototype.setDraggable=function(t,i){var n=this.childAt(0);n.draggable=t,n.cursor=!i&&t?"move":n.cursor},e.prototype.updateData=function(t,i,n,a){this.silent=!1;var o=t.getItemVisual(i,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,i),u=o!==this._symbolType,c=a&&a.disableAnimation;if(u){var h=t.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,t,i,l,h)}else{var f=this.childAt(0);f.silent=!1;var p={scaleX:l[0]/2,scaleY:l[1]/2};c?f.attr(p):Ut(f,p,s,i),Ui(f)}if(this._updateCommon(t,i,l,n,a),u){var f=this.childAt(0);if(!c){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,lr(f,p,s,i)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,i,n,a,o){var s=this.childAt(0),l=t.hostModel,u,c,h,f,p,d,g,m,v;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,h=a.selectItemStyle,f=a.focus,p=a.blurScope,g=a.labelStatesModels,m=a.hoverScale,v=a.cursorStyle,d=a.emphasisDisabled),!a||t.hasItemOption){var _=a&&a.itemModel?a.itemModel:t.getItemModel(i),y=_.getModel("emphasis");u=y.getModel("itemStyle").getItemStyle(),h=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),f=y.get("focus"),p=y.get("blurScope"),d=y.get("disabled"),g=Rr(_),m=y.getShallow("scale"),v=_.getShallow("cursor")}var x=t.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var M=ss(t.getItemVisual(i,"symbolOffset"),n);M&&(s.x=M[0],s.y=M[1]),v&&s.attr("cursor",v);var S=t.getItemVisual(i,"style"),w=S.fill;if(s instanceof Br){var T=s.style;s.useStyle(he({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},S))}else s.__isEmptyBrush?s.useStyle(he({},S)):s.useStyle(S),s.style.decal=null,s.setColor(w,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=t.getItemVisual(i,"liftZ"),b=this._z2;C!=null?b==null&&(this._z2=s.z2,s.z2+=C):b!=null&&(s.z2=b,this._z2=null);var E=o&&o.useNameLabel;Fr(s,g,{labelFetcher:l,labelDataIndex:i,defaultText:I,inheritColor:w,defaultOpacity:S.opacity});function I(P){return E?t.getName(P):Fl(t,P)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var R=s.ensureState("emphasis");R.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=c;var A=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;R.scaleX=this._sizeX*A,R.scaleY=this._sizeY*A,this.setSymbolScale(1),sr(this,f,p,d)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,i,n){var a=this.childAt(0),o=it(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&Fs(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Fs(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:t,removeOpt:s})},e.getSymbolSize=function(t,i){return Pl(t.getItemVisual(i,"symbolSize"))},e}(Ze);function _me(r,e){this.parent.drift(r,e)}var Mc=yme;function kI(r,e,t,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(t))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&r.getItemVisual(t,"symbol")!=="none"}function gX(r){return r!=null&&!qe(r)&&(r={isIgnore:r}),r||{}}function yX(r){var e=r.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:Rr(e),cursorStyle:e.get("cursor")}}var xme=function(){function r(e){this.group=new Ze,this._SymbolCtor=e||Mc}return r.prototype.updateData=function(e,t){this._progressiveEls=null,t=gX(t);var i=this.group,n=e.hostModel,a=this._data,o=this._SymbolCtor,s=t.disableAnimation,l=yX(e),u={disableAnimation:s},c=t.getSymbolPoint||function(h){return e.getItemLayout(h)};a||i.removeAll(),e.diff(a).add(function(h){var f=c(h);if(kI(e,f,h,t)){var p=new o(e,h,l,u);p.setPosition(f),e.setItemGraphicEl(h,p),i.add(p)}}).update(function(h,f){var p=a.getItemGraphicEl(f),d=c(h);if(!kI(e,d,h,t)){i.remove(p);return}var g=e.getItemVisual(h,"symbol")||"circle",m=p&&p.getSymbolType&&p.getSymbolType();if(!p||m&&m!==g)i.remove(p),p=new o(e,h,l,u),p.setPosition(d);else{p.updateData(e,h,l,u);var v={x:d[0],y:d[1]};s?p.attr(v):Ut(p,v,n)}i.add(p),e.setItemGraphicEl(h,p)}).remove(function(h){var f=a.getItemGraphicEl(h);f&&f.fadeOut(function(){i.remove(f)},n)}).execute(),this._getSymbolPoint=c,this._data=e},r.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(i,n){var a=e._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=yX(e),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t,i){this._progressiveEls=[],i=gX(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a<e.end;a++){var o=t.getItemLayout(a);if(kI(t,o,a,i)){var s=new this._SymbolCtor(t,a,this._seriesScope);s.traverse(n),s.setPosition(o),this.group.add(s),t.setItemGraphicEl(a,s),this._progressiveEls.push(s)}}},r.prototype.eachRendered=function(e){ya(this._progressiveEls||this.group,e)},r.prototype.remove=function(e){var t=this.group,i=this._data;i&&e?i.eachItemGraphicEl(function(n){n.fadeOut(function(){t.remove(n)},i.hostModel)}):t.removeAll()},r}(),Cu=xme;function FT(r,e,t){var i=r.getBaseAxis(),n=r.getOtherAxis(i),a=Sme(n,t),o=i.dim,s=n.dim,l=e.mapDimension(s),u=e.mapDimension(o),c=s==="x"||s==="radius"?1:0,h=de(r.dimensions,function(d){return e.mapDimension(d)}),f=!1,p=e.getCalculationInfo("stackResultDimension");return ls(e,h[0])&&(f=!0,h[0]=p),ls(e,h[1])&&(f=!0,h[1]=p),{dataDimsForPoint:h,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!f,valueDim:l,baseDim:u,baseDataOffset:c,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function Sme(r,e){var t=0,i=r.scale.getExtent();return e==="start"?t=i[0]:e==="end"?t=i[1]:Dt(e)&&!isNaN(e)?t=e:i[0]>0?t=i[0]:i[1]<0&&(t=i[1]),t}function BT(r,e,t,i){var n=NaN;r.stacked&&(n=t.get(t.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=t.get(r.baseDim,i),o[1-a]=n,e.dataToPoint(o)}function Mme(r,e){var t=[];return e.diff(r).add(function(i){t.push({cmd:"+",idx:i})}).update(function(i,n){t.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){t.push({cmd:"-",idx:i})}).execute(),t}function VI(r,e,t,i,n,a,o,s){for(var l=Mme(r,e),u=[],c=[],h=[],f=[],p=[],d=[],g=[],m=FT(n,e,o),v=r.getLayout("points")||[],_=e.getLayout("points")||[],y=0;y<l.length;y++){var x=l[y],M=!0,S=void 0,w=void 0;switch(x.cmd){case"=":S=x.idx*2,w=x.idx1*2;var T=v[S],C=v[S+1],b=_[w],E=_[w+1];(isNaN(T)||isNaN(C))&&(T=b,C=E),u.push(T,C),c.push(b,E),h.push(t[S],t[S+1]),f.push(i[w],i[w+1]),g.push(e.getRawIndex(x.idx1));break;case"+":var I=x.idx,R=m.dataDimsForPoint,A=n.dataToPoint([e.get(R[0],I),e.get(R[1],I)]);w=I*2,u.push(A[0],A[1]),c.push(_[w],_[w+1]);var P=BT(m,n,e,I);h.push(P[0],P[1]),f.push(i[w],i[w+1]),g.push(e.getRawIndex(I));break;case"-":M=!1}M&&(p.push(x),d.push(d.length))}d.sort(function(K,ae){return g[K]-g[ae]});for(var U=u.length,B=Sa(U),z=Sa(U),k=Sa(U),G=Sa(U),Y=[],y=0;y<d.length;y++){var J=d[y],Q=y*2,V=J*2;B[Q]=u[V],B[Q+1]=u[V+1],z[Q]=c[V],z[Q+1]=c[V+1],k[Q]=h[V],k[Q+1]=h[V+1],G[Q]=f[V],G[Q+1]=f[V+1],Y[y]=p[J]}return{current:B,next:z,stackedOnCurrent:k,stackedOnNext:G,status:Y}}var qh=Math.min,Zh=Math.max;function ud(r,e){return isNaN(r)||isNaN(e)}function GI(r,e,t,i,n,a,o,s,l){for(var u,c,h,f,p,d,g=t,m=0;m<i;m++){var v=e[g*2],_=e[g*2+1];if(g>=n||g<0)break;if(ud(v,_)){if(l){g+=a;continue}break}if(g===t)r[a>0?"moveTo":"lineTo"](v,_),h=v,f=_;else{var y=v-u,x=_-c;if(y*y+x*x<.5){g+=a;continue}if(o>0){for(var M=g+a,S=e[M*2],w=e[M*2+1];S===v&&w===_&&m<i;)m++,M+=a,g+=a,S=e[M*2],w=e[M*2+1],v=e[g*2],_=e[g*2+1],y=v-u,x=_-c;var T=m+1;if(l)for(;ud(S,w)&&T<i;)T++,M+=a,S=e[M*2],w=e[M*2+1];var C=.5,b=0,E=0,I=void 0,R=void 0;if(T>=i||ud(S,w))p=v,d=_;else{b=S-u,E=w-c;var A=v-u,P=S-v,U=_-c,B=w-_,z=void 0,k=void 0;if(s==="x"){z=Math.abs(A),k=Math.abs(P);var G=b>0?1:-1;p=v-G*z*o,d=_,I=v+G*k*o,R=_}else if(s==="y"){z=Math.abs(U),k=Math.abs(B);var Y=E>0?1:-1;p=v,d=_-Y*z*o,I=v,R=_+Y*k*o}else z=Math.sqrt(A*A+U*U),k=Math.sqrt(P*P+B*B),C=k/(k+z),p=v-b*o*(1-C),d=_-E*o*(1-C),I=v+b*o*C,R=_+E*o*C,I=qh(I,Zh(S,v)),R=qh(R,Zh(w,_)),I=Zh(I,qh(S,v)),R=Zh(R,qh(w,_)),b=I-v,E=R-_,p=v-b*z/k,d=_-E*z/k,p=qh(p,Zh(u,v)),d=qh(d,Zh(c,_)),p=Zh(p,qh(u,v)),d=Zh(d,qh(c,_)),b=v-p,E=_-d,I=v+b*k/z,R=_+E*k/z}r.bezierCurveTo(h,f,p,d,v,_),h=I,f=R}else r.lineTo(v,_)}u=v,c=_,g+=a}return m}var _X=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),xX=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="ec-polyline",i}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new _X},e.prototype.buildPath=function(t,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&ud(n[o*2-2],n[o*2-1]);o--);for(;a<o&&ud(n[a*2],n[a*2+1]);a++);}for(;a<o;)a+=GI(t,n,a,o,o,1,i.smooth,i.smoothMonotone,i.connectNulls)+1},e.prototype.getPointOn=function(t,i){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n=this.path,a=n.data,o=$i.CMD,s,l,u=i==="x",c=[],h=0;h<a.length;){var f=a[h++],p=void 0,d=void 0,g=void 0,m=void 0,v=void 0,_=void 0,y=void 0;switch(f){case o.M:s=a[h++],l=a[h++];break;case o.L:if(p=a[h++],d=a[h++],y=u?(t-s)/(p-s):(t-l)/(d-l),y<=1&&y>=0){var x=u?(d-l)*y+l:(p-s)*y+s;return u?[t,x]:[x,t]}s=p,l=d;break;case o.C:p=a[h++],d=a[h++],g=a[h++],m=a[h++],v=a[h++],_=a[h++];var M=u?yp(s,p,g,v,t,c):yp(l,d,m,_,t,c);if(M>0)for(var S=0;S<M;S++){var w=c[S];if(w<=1&&w>=0){var x=u?vi(l,d,m,_,w):vi(s,p,g,v,w);return u?[t,x]:[x,t]}}s=v,l=_;break}}},e}(pt);var bme=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(_X),kT=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="ec-polygon",i}return e.prototype.getDefaultShape=function(){return new bme},e.prototype.buildPath=function(t,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&ud(n[s*2-2],n[s*2-1]);s--);for(;o<s&&ud(n[o*2],n[o*2+1]);o++);}for(;o<s;){var u=GI(t,n,o,s,s,1,i.smooth,l,i.connectNulls);GI(t,a,o+u-1,u,s,-1,i.stackedOnSmooth,l,i.connectNulls),o+=u+1,t.closePath()}},e}(pt);function HI(r,e,t,i,n){var a=r.getArea(),o=a.x,s=a.y,l=a.width,u=a.height,c=t.get(["lineStyle","width"])||2;o-=c/2,s-=c/2,l+=c,u+=c,l=Math.ceil(l),o!==Math.floor(o)&&(o=Math.floor(o),l++);var h=new Rt({shape:{x:o,y:s,width:l,height:u}});if(e){var f=r.getBaseAxis(),p=f.isHorizontal(),d=f.inverse;p?(d&&(h.shape.x+=l),h.shape.width=0):(d||(h.shape.y+=u),h.shape.height=0);var g=He(n)?function(m){n(m,h)}:null;lr(h,{shape:{width:l,height:u,x:o,y:s}},t,null,i,g)}return h}function WI(r,e,t){var i=r.getArea(),n=Pr(i.r0,1),a=Pr(i.r,1),o=new Mi({shape:{cx:Pr(r.cx,1),cy:Pr(r.cy,1),r0:n,r:a,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});if(e){var s=r.getBaseAxis().dim==="angle";s?o.shape.endAngle=i.startAngle:o.shape.r=n,lr(o,{shape:{endAngle:i.endAngle,r:a}},t)}return o}function Ru(r,e,t,i,n){if(r){if(r.type==="polar")return WI(r,e,t);if(r.type==="cartesian2d")return HI(r,e,t,i,n)}else return null;return null}function Ys(r,e){return r.type===e}function SX(r,e){if(r.length===e.length){for(var t=0;t<r.length;t++)if(r[t]!==e[t])return;return!0}}function MX(r){for(var e=1/0,t=1/0,i=-1/0,n=-1/0,a=0;a<r.length;){var o=r[a++],s=r[a++];isNaN(o)||(e=Math.min(o,e),i=Math.max(o,i)),isNaN(s)||(t=Math.min(s,t),n=Math.max(s,n))}return[[e,t],[i,n]]}function bX(r,e){var t=MX(r),i=t[0],n=t[1],a=MX(e),o=a[0],s=a[1];return Math.max(Math.abs(i[0]-o[0]),Math.abs(i[1]-o[1]),Math.abs(n[0]-s[0]),Math.abs(n[1]-s[1]))}function wX(r){return Dt(r)?r:r?.5:0}function wme(r,e,t){if(!t.valueDim)return[];for(var i=e.count(),n=Sa(i*2),a=0;a<i;a++){var o=BT(t,r,e,a);n[a*2]=o[0],n[a*2+1]=o[1]}return n}function jh(r,e,t,i){var n=e.getBaseAxis(),a=n.dim==="x"||n.dim==="radius"?0:1,o=[],s=0,l=[],u=[],c=[],h=[];if(i){for(s=0;s<r.length;s+=2)!isNaN(r[s])&&!isNaN(r[s+1])&&h.push(r[s],r[s+1]);r=h}for(s=0;s<r.length-2;s+=2)switch(c[0]=r[s+2],c[1]=r[s+3],u[0]=r[s],u[1]=r[s+1],o.push(u[0],u[1]),t){case"end":l[a]=c[a],l[1-a]=u[1-a],o.push(l[0],l[1]);break;case"middle":var f=(u[a]+c[a])/2,p=[];l[a]=p[a]=f,l[1-a]=u[1-a],p[1-a]=c[1-a],o.push(l[0],l[1]),o.push(p[0],p[1]);break;default:l[a]=u[a],l[1-a]=c[1-a],o.push(l[0],l[1])}return o.push(r[s++],r[s++]),o}function Tme(r,e){var t=[],i=r.length,n,a;function o(c,h,f){var p=c.coord,d=(f-p)/(h.coord-p),g=PG(d,[c.color,h.color]);return{coord:f,color:g}}for(var s=0;s<i;s++){var l=r[s],u=l.coord;if(u<0)n=l;else if(u>e){a?t.push(o(a,l,e)):n&&t.push(o(n,l,0),o(n,l,e));break}else n&&(t.push(o(n,l,0)),n=null),t.push(l),a=l}return t}function Eme(r,e,t){var i=r.getVisual("visualMeta");if(!(!i||!i.length||!r.count())&&e.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=r.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=e.getAxis(n),u=de(a.stops,function(y){return{coord:l.toGlobalCoord(l.dataToCoord(y.value)),color:y.color}}),c=u.length,h=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var f=Tme(u,n==="x"?t.getWidth():t.getHeight()),p=f.length;if(!p&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var d=10,g=f[0].coord-d,m=f[p-1].coord+d,v=m-g;if(v<.001)return"transparent";N(f,function(y){y.offset=(y.coord-g)/v}),f.push({offset:p?f[p-1].offset:.5,color:h[1]||"transparent"}),f.unshift({offset:p?f[0].offset:.5,color:h[0]||"transparent"});var _=new xu(0,0,0,0,f,!0);return _[n]=g,_[n+"2"]=m,_}}}function Ame(r,e,t){var i=r.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=t.getAxesByScale("ordinal")[0];if(a&&!(n&&Cme(a,e))){var o=e.mapDimension(a.dim),s={};return N(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function Cme(r,e){var t=r.getExtent(),i=Math.abs(t[1]-t[0])/r.scale.count();isNaN(i)&&(i=0);for(var n=e.count(),a=Math.max(1,Math.round(n/5)),o=0;o<n;o+=a)if(Mc.getSymbolSize(e,o)[r.isHorizontal()?1:0]*1.5>i)return!1;return!0}function Rme(r,e){return isNaN(r)||isNaN(e)}function Lme(r){for(var e=r.length/2;e>0&&Rme(r[e*2-2],r[e*2-1]);e--);return e-1}function TX(r,e){return[r[e*2],r[e*2+1]]}function Dme(r,e,t){for(var i=r.length/2,n=t==="x"?0:1,a,o,s=0,l=-1,u=0;u<i;u++)if(o=r[u*2+n],!(isNaN(o)||isNaN(r[u*2+1-n]))){if(u===0){a=o;continue}if(a<=e&&o>=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function EX(r){if(r.get(["endLabel","show"]))return!0;for(var e=0;e<Vi.length;e++)if(r.get([Vi[e],"endLabel","show"]))return!0;return!1}function XI(r,e,t,i){if(Ys(e,"cartesian2d")){var n=i.getModel("endLabel"),a=n.get("valueAnimation"),o=i.getData(),s={lastFrameIndex:0},l=EX(i)?function(p,d){r._endLabelOnDuring(p,d,o,s,a,n,e)}:null,u=e.getBaseAxis().isHorizontal(),c=HI(e,t,i,function(){var p=r._endLabel;p&&t&&s.originalX!=null&&p.attr({x:s.originalX,y:s.originalY})},l);if(!i.get("clip",!0)){var h=c.shape,f=Math.max(h.width,h.height);u?(h.y-=f,h.height+=f*2):(h.x-=f,h.width+=f*2)}return l&&l(1,c),c}else return WI(e,t,i)}function Pme(r,e){var t=e.getBaseAxis(),i=t.isHorizontal(),n=t.inverse,a=i?n?"right":"left":"center",o=i?"middle":n?"top":"bottom";return{normal:{align:r.get("align")||a,verticalAlign:r.get("verticalAlign")||o}}}var Ime=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(){var t=new Ze,i=new Cu;this.group.add(i.group),this._symbolDraw=i,this._lineGroup=t},e.prototype.render=function(t,i,n){var a=this,o=t.coordinateSystem,s=this.group,l=t.getData(),u=t.getModel("lineStyle"),c=t.getModel("areaStyle"),h=l.getLayout("points")||[],f=o.type==="polar",p=this._coordSys,d=this._symbolDraw,g=this._polyline,m=this._polygon,v=this._lineGroup,_=!i.ssr&&t.get("animation"),y=!c.isEmpty(),x=c.get("origin"),M=FT(o,l,x),S=y&&wme(o,l,M),w=t.get("showSymbol"),T=t.get("connectNulls"),C=w&&!f&&Ame(t,l,o),b=this._data;b&&b.eachItemGraphicEl(function(ae,ve){ae.__temp&&(s.remove(ae),b.setItemGraphicEl(ve,null))}),w||d.remove(),s.add(v);var E=f?!1:t.get("step"),I;o&&o.getArea&&t.get("clip",!0)&&(I=o.getArea(),I.width!=null?(I.x-=.1,I.y-=.1,I.width+=.2,I.height+=.2):I.r0&&(I.r0-=.5,I.r+=.5)),this._clipShapeForSymbol=I;var R=Eme(l,o,n)||l.getVisual("style")[l.getVisual("drawType")];if(!(g&&p.type===o.type&&E===this._step))w&&d.updateData(l,{isIgnore:C,clipShape:I,disableAnimation:!0,getSymbolPoint:function(ae){return[h[ae*2],h[ae*2+1]]}}),_&&this._initSymbolLabelAnimation(l,o,I),E&&(h=jh(h,o,E,T),S&&(S=jh(S,o,E,T))),g=this._newPolyline(h),y?m=this._newPolygon(h,S):m&&(v.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(t,o,Cl(R)),v.setClipPath(XI(this,o,!0,t));else{y&&!m?m=this._newPolygon(h,S):m&&!y&&(v.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(t,o,Cl(R));var A=v.getClipPath();if(A){var P=XI(this,o,!1,t);lr(A,{shape:P.shape},t)}else v.setClipPath(XI(this,o,!0,t));w&&d.updateData(l,{isIgnore:C,clipShape:I,disableAnimation:!0,getSymbolPoint:function(ae){return[h[ae*2],h[ae*2+1]]}}),(!SX(this._stackedOnPoints,S)||!SX(this._points,h))&&(_?this._doUpdateAnimation(l,S,o,n,E,x,T):(E&&(h=jh(h,o,E,T),S&&(S=jh(S,o,E,T))),g.setShape({points:h}),m&&m.setShape({points:h,stackedOnPoints:S})))}var U=t.getModel("emphasis"),B=U.get("focus"),z=U.get("blurScope"),k=U.get("disabled");if(g.useStyle(Ye(u.getLineStyle(),{fill:"none",stroke:R,lineJoin:"bevel"})),Yr(g,t,"lineStyle"),g.style.lineWidth>0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var G=g.getState("emphasis").style;G.lineWidth=+g.style.lineWidth+1}it(g).seriesIndex=t.seriesIndex,sr(g,B,z,k);var Y=wX(t.get("smooth")),J=t.get("smoothMonotone");if(g.setShape({smooth:Y,smoothMonotone:J,connectNulls:T}),m){var Q=l.getCalculationInfo("stackedOnSeries"),V=0;m.useStyle(Ye(c.getAreaStyle(),{fill:R,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),Q&&(V=wX(Q.get("smooth"))),m.setShape({smooth:Y,stackedOnSmooth:V,smoothMonotone:J,connectNulls:T}),Yr(m,t,"areaStyle"),it(m).seriesIndex=t.seriesIndex,sr(m,B,z,k)}var K=function(ae){a._changePolyState(ae)};l.eachItemGraphicEl(function(ae){ae&&(ae.onHoverStateChange=K)}),this._polyline.onHoverStateChange=K,this._data=l,this._coordSys=o,this._stackedOnPoints=S,this._points=h,this._step=E,this._valueOrigin=x,t.get("triggerLineEvent")&&(this.packEventData(t,g),m&&this.packEventData(t,m))},e.prototype.packEventData=function(t,i){it(i).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,i,n,a){var o=t.getData(),s=Us(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],h=l[s*2+1];if(isNaN(c)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,h))return;var f=t.get("zlevel")||0,p=t.get("z")||0;u=new Mc(o,s),u.x=c,u.y=h,u.setZ(f,p);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=f,d.z=p,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Zt.prototype.highlight.call(this,t,i,n,a)},e.prototype.downplay=function(t,i,n,a){var o=t.getData(),s=Us(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Zt.prototype.downplay.call(this,t,i,n,a)},e.prototype._changePolyState=function(t){var i=this._polygon;kp(this._polyline,t),i&&kp(i,t)},e.prototype._newPolyline=function(t){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new xX({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},e.prototype._newPolygon=function(t,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new kT({shape:{points:t,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=t.hostModel,c=u.get("animationDuration");He(c)&&(c=c(null));var h=u.get("animationDelay")||0,f=He(h)?h(null):h;t.eachItemGraphicEl(function(p,d){var g=p;if(g){var m=[p.x,p.y],v=void 0,_=void 0,y=void 0;if(n)if(o){var x=n,M=i.pointToCoord(m);a?(v=x.startAngle,_=x.endAngle,y=-M[1]/180*Math.PI):(v=x.r0,_=x.r,y=M[0])}else{var S=n;a?(v=S.x,_=S.x+S.width,y=p.x):(v=S.y+S.height,_=S.y,y=p.y)}var w=_===v?0:(y-v)/(_-v);l&&(w=1-w);var T=He(h)?h(d):c*w+f,C=g.getSymbolPath(),b=C.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,i,n){var a=t.getModel("endLabel");if(EX(t)){var o=t.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new It({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=Lme(l);c>=0&&(Fr(s,Rr(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:c,defaultText:function(h,f,p){return p!=null?zT(o,p):Fl(o,h)},enableTextSetter:!0},Pme(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,i,n,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=n.getLayout("points"),f=n.hostModel,p=f.get("connectNulls"),d=s.get("precision"),g=s.get("distance")||0,m=l.getBaseAxis(),v=m.isHorizontal(),_=m.inverse,y=i.shape,x=_?v?y.x:y.y+y.height:v?y.x+y.width:y.y,M=(v?g:0)*(_?-1:1),S=(v?0:-g)*(_?-1:1),w=v?"x":"y",T=Dme(h,x,w),C=T.range,b=C[1]-C[0],E=void 0;if(b>=1){if(b>1&&!p){var I=TX(h,C[0]);u.attr({x:I[0]+M,y:I[1]+S}),o&&(E=f.getRawValue(C[0]))}else{var I=c.getPointOn(x,w);I&&u.attr({x:I[0]+M,y:I[1]+S});var R=f.getRawValue(C[0]),A=f.getRawValue(C[1]);o&&(E=Pw(n,d,R,A,T.t))}a.lastFrameIndex=C[0]}else{var P=t===1||a.lastFrameIndex>0?C[0]:0,I=TX(h,P);o&&(E=f.getRawValue(P)),u.attr({x:I[0]+M,y:I[1]+S})}if(o){var U=dc(u);typeof U.setLabelText=="function"&&U.setLabelText(E)}}},e.prototype._doUpdateAnimation=function(t,i,n,a,o,s,l){var u=this._polyline,c=this._polygon,h=t.hostModel,f=VI(this._data,t,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin,s),p=f.current,d=f.stackedOnCurrent,g=f.next,m=f.stackedOnNext;if(o&&(p=jh(f.current,n,o,l),d=jh(f.stackedOnCurrent,n,o,l),g=jh(f.next,n,o,l),m=jh(f.stackedOnNext,n,o,l)),bX(p,g)>3e3||c&&bX(d,m)>3e3){u.stopAnimation(),u.setShape({points:g}),c&&(c.stopAnimation(),c.setShape({points:g,stackedOnPoints:m}));return}u.shape.__points=f.current,u.shape.points=p;var v={shape:{points:g}};f.current!==p&&(v.shape.__points=f.next),u.stopAnimation(),Ut(u,v,h),c&&(c.setShape({points:p,stackedOnPoints:d}),c.stopAnimation(),Ut(c,{shape:{stackedOnPoints:m}},h),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],y=f.status,x=0;x<y.length;x++){var M=y[x].cmd;if(M==="="){var S=t.getItemGraphicEl(y[x].idx1);S&&_.push({el:S,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){c&&c.dirtyShape();for(var w=u.shape.__points,T=0;T<_.length;T++){var C=_[T].el,b=_[T].ptIdx*2;C.x=w[b],C.y=w[b+1],C.markRedraw()}})},e.prototype.remove=function(t){var i=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(a,o){a.__temp&&(i.remove(a),n.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(Zt),AX=Ime;function Bl(r,e){return{seriesType:r,plan:os(),reset:function(t){var i=t.getData(),n=t.coordinateSystem,a=t.pipelineContext,o=e||a.large;if(n){var s=de(n.dimensions,function(p){return i.mapDimension(p)}).slice(0,2),l=s.length,u=i.getCalculationInfo("stackResultDimension");ls(i,s[0])&&(s[0]=u),ls(i,s[1])&&(s[1]=u);var c=i.getStore(),h=i.getDimensionIndex(s[0]),f=i.getDimensionIndex(s[1]);return l&&{progress:function(p,d){for(var g=p.end-p.start,m=o&&Sa(g*l),v=[],_=[],y=p.start,x=0;y<p.end;y++){var M=void 0;if(l===1){var S=c.get(h,y);M=n.dataToPoint(S,null,_)}else v[0]=c.get(h,y),v[1]=c.get(f,y),M=n.dataToPoint(v,null,_);o?(m[x++]=M[0],m[x++]=M[1]):d.setItemLayout(y,M.slice())}o&&d.setLayout("points",m)}}}}}}var Nme={average:function(r){for(var e=0,t=0,i=0;i<r.length;i++)isNaN(r[i])||(e+=r[i],t++);return t===0?NaN:e/t},sum:function(r){for(var e=0,t=0;t<r.length;t++)e+=r[t]||0;return e},max:function(r){for(var e=-1/0,t=0;t<r.length;t++)r[t]>e&&(e=r[t]);return isFinite(e)?e:NaN},min:function(r){for(var e=1/0,t=0;t<r.length;t++)r[t]<e&&(e=r[t]);return isFinite(e)?e:NaN},minmax:function(r){for(var e=-1/0,t=-1/0,i=0;i<r.length;i++){var n=r[i],a=Math.abs(n);a>e&&(e=a,t=n)}return isFinite(t)?t:NaN},nearest:function(r){return r[0]}},Ume=function(r){return Math.round(r.length/2)};function rS(r){return{seriesType:r,reset:function(e,t,i){var n=e.getData(),a=e.get("sampling"),o=e.coordinateSystem,s=n.count();if(s>10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),h=i.getDevicePixelRatio(),f=Math.abs(c[1]-c[0])*(h||1),p=Math.round(s/f);if(isFinite(p)&&p>1){a==="lttb"&&e.setData(n.lttbDownSample(n.mapDimension(u.dim),1/p));var d=void 0;Ce(a)?d=Nme[a]:He(a)&&(d=a),d&&e.setData(n.downSample(n.mapDimension(u.dim),1/p,d,Ume))}}}}}function YI(r){r.registerChartView(AX),r.registerSeriesModel(vX),r.registerLayout(Bl("line",!0)),r.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),i=e.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",i)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,rS("line"))}var CX=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){return mn(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,i,n){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(t),s=a.dataToPoint(o);if(n)N(a.getAxes(),function(f,p){if(f.type==="category"&&i!=null){var d=f.getTicksCoords(),g=f.getTickModel().get("alignWithLabel"),m=o[p],v=i[p]==="x1"||i[p]==="y1";if(v&&!g&&(m+=1),d.length<2)return;if(d.length===2){s[p]=f.toGlobalCoord(f.getExtent()[v?1:0]);return}for(var _=void 0,y=void 0,x=1,M=0;M<d.length;M++){var S=d[M].coord,w=M===d.length-1?d[M-1].tickValue+x:d[M].tickValue;if(w===m){y=S;break}else if(w<m)_=S;else if(_!=null&&w>m){y=(S+_)/2;break}M===1&&(x=w-d[0].tickValue)}y==null&&(_?_&&(y=d[d.length-1].coord):y=d[0].coord),s[p]=f.toGlobalCoord(y)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+c/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}($t);$t.registerClass(CX);var Uv=CX;var Ome=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return mn(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),i=this.get("largeThreshold");return i>t&&(t=i),t},e.prototype.brushSelector=function(t,i,n){return n.rect(i.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=$n(Uv.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(Uv),RX=Ome;var zme=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),Fme=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="sausage",i}return e.prototype.getDefaultShape=function(){return new zme},e.prototype.buildPath=function(t,i){var n=i.cx,a=i.cy,o=Math.max(i.r0||0,0),s=Math.max(i.r,0),l=(s-o)*.5,u=o+l,c=i.startAngle,h=i.endAngle,f=i.clockwise,p=Math.PI*2,d=f?h-c<p:c-h<p;d||(c=h-(f?p:-p));var g=Math.cos(c),m=Math.sin(c),v=Math.cos(h),_=Math.sin(h);d?(t.moveTo(g*o+n,m*o+a),t.arc(g*u+n,m*u+a,l,-Math.PI+c,c,!f)):t.moveTo(g*s+n,m*s+a),t.arc(n,a,s,c,h,!f),t.arc(v*u+n,_*u+a,l,h-Math.PI*2,h-Math.PI,!f),o!==0&&t.arc(n,a,o,h,c,f)},e}(pt),Ov=Fme;function LX(r,e){e=e||{};var t=e.isRoundCap;return function(i,n,a){var o=n.position;if(!o||o instanceof Array)return Cp(i,n,a);var s=r(o),l=n.distance!=null?n.distance:5,u=this.shape,c=u.cx,h=u.cy,f=u.r,p=u.r0,d=(f+p)/2,g=u.startAngle,m=u.endAngle,v=(g+m)/2,_=t?Math.abs(f-p)/2:0,y=Math.cos,x=Math.sin,M=c+f*y(g),S=h+f*x(g),w="left",T="top";switch(s){case"startArc":M=c+(p-l)*y(v),S=h+(p-l)*x(v),w="center",T="top";break;case"insideStartArc":M=c+(p+l)*y(v),S=h+(p+l)*x(v),w="center",T="bottom";break;case"startAngle":M=c+d*y(g)+VT(g,l+_,!1),S=h+d*x(g)+GT(g,l+_,!1),w="right",T="middle";break;case"insideStartAngle":M=c+d*y(g)+VT(g,-l+_,!1),S=h+d*x(g)+GT(g,-l+_,!1),w="left",T="middle";break;case"middle":M=c+d*y(v),S=h+d*x(v),w="center",T="middle";break;case"endArc":M=c+(f+l)*y(v),S=h+(f+l)*x(v),w="center",T="bottom";break;case"insideEndArc":M=c+(f-l)*y(v),S=h+(f-l)*x(v),w="center",T="top";break;case"endAngle":M=c+d*y(m)+VT(m,l+_,!0),S=h+d*x(m)+GT(m,l+_,!0),w="left",T="middle";break;case"insideEndAngle":M=c+d*y(m)+VT(m,-l+_,!0),S=h+d*x(m)+GT(m,-l+_,!0),w="right",T="middle";break;default:return Cp(i,n,a)}return i=i||{},i.x=M,i.y=S,i.align=w,i.verticalAlign=T,i}}function DX(r,e,t,i){if(Dt(i)){r.setTextConfig({rotation:i});return}else if(pe(e)){r.setTextConfig({rotation:0});return}var n=r.shape,a=n.clockwise?n.startAngle:n.endAngle,o=n.clockwise?n.endAngle:n.startAngle,s=(a+o)/2,l,u=t(e);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=s;break;case"startAngle":case"insideStartAngle":l=a;break;case"endAngle":case"insideEndAngle":l=o;break;default:r.setTextConfig({rotation:0});return}var c=Math.PI*1.5-l;u==="middle"&&c>Math.PI/2&&c<Math.PI*1.5&&(c-=Math.PI),r.setTextConfig({rotation:c})}function VT(r,e,t){return e*Math.sin(r)*(t?-1:1)}function GT(r,e,t){return e*Math.cos(r)*(t?1:-1)}function Lu(r,e,t){var i=r.get("borderRadius");if(i==null)return t?{cornerRadius:0}:null;pe(i)||(i=[i,i,i,i]);var n=Math.abs(e.r||0-e.r0||0);return{cornerRadius:de(i,function(a){return En(a,n)})}}var qI=Math.max,ZI=Math.min;function Bme(r,e){var t=r.getArea&&r.getArea();if(Ys(r,"cartesian2d")){var i=r.getBaseAxis();if(i.type!=="category"||!i.onBand){var n=e.getLayout("bandWidth");i.isHorizontal()?(t.x-=n,t.width+=n*2):(t.y-=n,t.height+=n*2)}}return t}var kme=function(r){Z(e,r);function e(){var t=r.call(this)||this;return t.type=e.type,t._isFirstFrame=!0,t}return e.prototype.render=function(t,i,n,a){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var o=t.get("coordinateSystem");(o==="cartesian2d"||o==="polar")&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,i,n):this._renderNormal(t,i,n,a))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,i){this._progressiveEls=[],this._incrementalRenderLarge(t,i)},e.prototype.eachRendered=function(t){ya(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var i=t.pipelineContext.large;(this._isLargeDraw==null||i!==this._isLargeDraw)&&(this._isLargeDraw=i,this._clear())},e.prototype._renderNormal=function(t,i,n,a){var o=this.group,s=t.getData(),l=this._data,u=t.coordinateSystem,c=u.getBaseAxis(),h;u.type==="cartesian2d"?h=c.isHorizontal():u.type==="polar"&&(h=c.dim==="angle");var f=t.isAnimationEnabled()?t:null,p=Vme(t,u);p&&this._enableRealtimeSort(p,s,n);var d=t.get("clip",!0)||p,g=Bme(u,s);o.removeClipPath();var m=t.get("roundCap",!0),v=t.get("showBackground",!0),_=t.getModel("backgroundStyle"),y=_.get("borderRadius")||0,x=[],M=this._backgroundEls,S=a&&a.isInitSort,w=a&&a.type==="changeAxisOrder";function T(E){var I=HT[u.type](s,E),R=Zme(u,h,I);return R.useStyle(_.getItemStyle()),u.type==="cartesian2d"?R.setShape("r",y):R.setShape("cornerRadius",y),x[E]=R,R}s.diff(l).add(function(E){var I=s.getItemModel(E),R=HT[u.type](s,E,I);if(v&&T(E),!(!s.hasValue(E)||!OX[u.type](R))){var A=!1;d&&(A=PX[u.type](g,R));var P=IX[u.type](t,s,E,R,h,f,c.model,!1,m);p&&(P.forceLabelAnimation=!0),zX(P,s,E,I,R,t,h,u.type==="polar"),S?P.attr({shape:R}):p?NX(p,f,P,R,E,h,!1,!1):lr(P,{shape:R},t,E),s.setItemGraphicEl(E,P),o.add(P),P.ignore=A}}).update(function(E,I){var R=s.getItemModel(E),A=HT[u.type](s,E,R);if(v){var P=void 0;M.length===0?P=T(I):(P=M[I],P.useStyle(_.getItemStyle()),u.type==="cartesian2d"?P.setShape("r",y):P.setShape("cornerRadius",y),x[E]=P);var U=HT[u.type](s,E),B=GX(h,U,u);Ut(P,{shape:B},f,E)}var z=l.getItemGraphicEl(I);if(!s.hasValue(E)||!OX[u.type](A)){o.remove(z);return}var k=!1;if(d&&(k=PX[u.type](g,A),k&&o.remove(z)),z?Ui(z):z=IX[u.type](t,s,E,A,h,f,c.model,!!z,m),p&&(z.forceLabelAnimation=!0),w){var G=z.getTextContent();if(G){var Y=dc(G);Y.prevValue!=null&&(Y.prevValue=Y.value)}}else zX(z,s,E,R,A,t,h,u.type==="polar");S?z.attr({shape:A}):p?NX(p,f,z,A,E,h,!0,w):Ut(z,{shape:A},t,E,null),s.setItemGraphicEl(E,z),z.ignore=k,o.add(z)}).remove(function(E){var I=l.getItemGraphicEl(E);I&&cc(I,t,E)}).execute();var C=this._backgroundGroup||(this._backgroundGroup=new Ze);C.removeAll();for(var b=0;b<x.length;++b)C.add(x[b]);o.add(C),this._backgroundEls=x,this._data=s},e.prototype._renderLarge=function(t,i,n){this._clear(),BX(t,this.group),this._updateLargeClip(t)},e.prototype._incrementalRenderLarge=function(t,i){this._removeBackground(),BX(i,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(t){var i=t.get("clip",!0)&&Ru(t.coordinateSystem,!1,t),n=this.group;i?n.setClipPath(i):n.removeClipPath()},e.prototype._enableRealtimeSort=function(t,i,n){var a=this;if(i.count()){var o=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(i,t,n),this._isFirstFrame=!1;else{var s=function(l){var u=i.getItemGraphicEl(l),c=u&&u.shape;return c&&Math.abs(o.isHorizontal()?c.height:c.width)||0};this._onRendered=function(){a._updateSortWithinSameData(i,s,o,n)},n.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(t,i,n){var a=[];return t.each(t.mapDimension(i.dim),function(o,s){var l=n(s);l=l??NaN,a.push({dataIndex:s,mappedValue:l,ordinalNumber:o})}),a.sort(function(o,s){return s.mappedValue-o.mappedValue}),{ordinalNumbers:de(a,function(o){return o.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(t,i,n){for(var a=n.scale,o=t.mapDimension(n.dim),s=Number.MAX_VALUE,l=0,u=a.getOrdinalMeta().categories.length;l<u;++l){var c=t.rawIndexOf(o,a.getRawOrdinalNumber(l)),h=c<0?Number.MIN_VALUE:i(t.indexOfRawIndex(c));if(h>s)return!0;s=h}return!1},e.prototype._isOrderDifferentInView=function(t,i){for(var n=i.scale,a=n.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],n.getOrdinalMeta().categories.length-1);o<=s;++o)if(t.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,i,n,a){if(this._isOrderChangedWithinSameData(t,i,n)){var o=this._dataSort(t,n,i);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,i,n){var a=i.baseAxis,o=this._dataSort(t,a,function(s){return t.get(t.mapDimension(i.otherAxis.dim),s)});n.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(t,i){this._clear(this._model),this._removeOnRenderedListener(i)},e.prototype.dispose=function(t,i){this._removeOnRenderedListener(i)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var i=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(a){cc(a,t,it(a).dataIndex)})):i.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(Zt),PX={cartesian2d:function(r,e){var t=e.width<0?-1:1,i=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var n=r.x+r.width,a=r.y+r.height,o=qI(e.x,r.x),s=ZI(e.x+e.width,n),l=qI(e.y,r.y),u=ZI(e.y+e.height,a),c=s<o,h=u<l;return e.x=c&&o>n?s:o,e.y=h&&l>a?u:l,e.width=c?0:s-o,e.height=h?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),c||h},polar:function(r,e){var t=e.r0<=e.r?1:-1;if(t<0){var i=e.r;e.r=e.r0,e.r0=i}var n=ZI(e.r,r.r),a=qI(e.r0,r.r0);e.r=n,e.r0=a;var o=n-a<0;if(t<0){var i=e.r;e.r=e.r0,e.r0=i}return o}},IX={cartesian2d:function(r,e,t,i,n,a,o,s,l){var u=new Rt({shape:he({},i),z2:1});if(u.__dataIndex=t,u.name="item",a){var c=u.shape,h=n?"height":"width";c[h]=0}return u},polar:function(r,e,t,i,n,a,o,s,l){var u=!n&&l?Ov:Mi,c=new u({shape:i,z2:1});c.name="item";var h=VX(n);if(c.calculateTextPosition=LX(h,{isRoundCap:u===Ov}),a){var f=c.shape,p=n?"r":"endAngle",d={};f[p]=n?i.r0:i.startAngle,d[p]=i[p],(s?Ut:lr)(c,{shape:d},a)}return c}};function Vme(r,e){var t=r.get("realtimeSort",!0),i=e.getBaseAxis();if(t&&i.type==="category"&&e.type==="cartesian2d")return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}function NX(r,e,t,i,n,a,o,s){var l,u;a?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?Ut:lr)(t,{shape:l},e,n,null);var c=e?r.baseAxis.model:null;(o?Ut:lr)(t,{shape:u},c,n)}function UX(r,e){for(var t=0;t<e.length;t++)if(!isFinite(r[e[t]]))return!0;return!1}var Gme=["x","y","width","height"],Hme=["cx","cy","r","startAngle","endAngle"],OX={cartesian2d:function(r){return!UX(r,Gme)},polar:function(r){return!UX(r,Hme)}},HT={cartesian2d:function(r,e,t){var i=r.getItemLayout(e),n=t?Xme(t,i):0,a=i.width>0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*n/2,y:i.y+o*n/2,width:i.width-a*n,height:i.height-o*n}},polar:function(r,e,t){var i=r.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function Wme(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function VX(r){return function(e){var t=e?"Arc":"Angle";return function(i){switch(i){case"start":case"insideStart":case"end":case"insideEnd":return i+t;default:return i}}}(r)}function zX(r,e,t,i,n,a,o,s){var l=e.getItemVisual(t,"style");if(s){if(!a.get("roundCap")){var c=r.shape,h=Lu(i.getModel("itemStyle"),c,!0);he(c,h),r.setShape(c)}}else{var u=i.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var f=i.getShallow("cursor");f&&r.attr("cursor",f);var p=s?o?n.r>=n.r0?"endArc":"startArc":n.endAngle>=n.startAngle?"endAngle":"startAngle":o?n.height>=0?"bottom":"top":n.width>=0?"right":"left",d=Rr(i);Fr(r,d,{labelFetcher:a,labelDataIndex:t,defaultText:Fl(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var g=r.getTextContent();if(s&&g){var m=i.get(["label","position"]);r.textConfig.inside=m==="middle"?!0:null,DX(r,m==="outside"?p:m,VX(o),i.get(["label","rotate"]))}a1(g,d,a.getRawValue(t),function(_){return zT(e,_)});var v=i.getModel(["emphasis"]);sr(r,v.get("focus"),v.get("blurScope"),v.get("disabled")),Yr(r,i),Wme(n)&&(r.style.fill="none",r.style.stroke="none",N(r.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function Xme(r,e){var t=r.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var i=r.get(["itemStyle","borderWidth"])||0,n=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(i,n,a)}var Yme=function(){function r(){}return r}(),FX=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="largeBar",i}return e.prototype.getDefaultShape=function(){return new Yme},e.prototype.buildPath=function(t,i){for(var n=i.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c<n.length;c+=3)l[a]=u,l[o]=n[c+2],s[a]=n[c+a],s[o]=n[c+o],t.rect(s[0],s[1],l[0],l[1])},e}(pt);function BX(r,e,t,i){var n=r.getData(),a=n.getLayout("valueAxisHorizontal")?1:0,o=n.getLayout("largeDataIndices"),s=n.getLayout("size"),l=r.getModel("backgroundStyle"),u=n.getLayout("largeBackgroundPoints");if(u){var c=new FX({shape:{points:u},incremental:!!i,silent:!0,z2:0});c.baseDimIdx=a,c.largeDataIndices=o,c.barWidth=s,c.useStyle(l.getItemStyle()),e.add(c),t&&t.push(c)}var h=new FX({shape:{points:n.getLayout("largePoints")},incremental:!!i,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=a,h.largeDataIndices=o,h.barWidth=s,e.add(h),h.useStyle(n.getVisual("style")),it(h).seriesIndex=r.seriesIndex,r.get("silent")||(h.on("mousedown",kX),h.on("mousemove",kX)),t&&t.push(h)}var kX=Ex(function(r){var e=this,t=qme(e,r.offsetX,r.offsetY);it(e).dataIndex=t>=0?t:null},30,!1);function qme(r,e,t){for(var i=r.baseDimIdx,n=1-i,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,c=0,h=a.length/3;c<h;c++){var f=c*3;if(l[i]=u,l[n]=a[f+2],s[i]=a[f+i],s[n]=a[f+n],l[n]<0&&(s[n]+=l[n],l[n]=-l[n]),e>=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return o[c]}return-1}function GX(r,e,t){if(Ys(t,"cartesian2d")){var i=e,n=t.getArea();return{x:r?i.x:n.x,y:r?n.y:i.y,width:r?i.width:n.width,height:r?n.height:i.height}}else{var n=t.getArea(),a=e;return{cx:n.cx,cy:n.cy,r0:r?n.r0:a.r0,r:r?n.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function Zme(r,e,t){var i=r.type==="polar"?Mi:Rt;return new i({shape:GX(e,t,r),silent:!0,z2:0})}var HX=kme;function jI(r){r.registerChartView(HX),r.registerSeriesModel(RX),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ut(cT,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,hT("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,rS("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},function(n){e.sortInfo&&n.axis.setCategorySortInfo(e.sortInfo)})})}var WX=Math.PI*2,WT=Math.PI/180;function XX(r,e){return br(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function KI(r,e){var t=XX(r,e),i=r.get("center"),n=r.get("radius");pe(n)||(n=[0,n]);var a=ze(t.width,e.getWidth()),o=ze(t.height,e.getHeight()),s=Math.min(a,o),l=ze(n[0],s/2),u=ze(n[1],s/2),c,h,f=r.coordinateSystem;if(f){var p=f.dataToPoint(i);c=p[0]||0,h=p[1]||0}else pe(i)||(i=[i,i]),c=ze(i[0],a)+t.x,h=ze(i[1],o)+t.y;return{cx:c,cy:h,r0:l,r:u}}function JI(r,e,t){e.eachSeriesByType(r,function(i){var n=i.getData(),a=n.mapDimension("value"),o=XX(i,t),s=KI(i,t),l=s.cx,u=s.cy,c=s.r,h=s.r0,f=-i.get("startAngle")*WT,p=i.get("endAngle"),d=i.get("padAngle")*WT;p=p==="auto"?f-WX:-p*WT;var g=i.get("minAngle")*WT,m=g+d,v=0;n.each(a,function(U){!isNaN(U)&&v++});var _=n.getSum(a),y=Math.PI/(_||v)*2,x=i.get("clockwise"),M=i.get("roseType"),S=i.get("stillShowZeroSum"),w=n.getDataExtent(a);w[0]=0;var T=x?1:-1,C=[f,p],b=T*d/2;q_(C,!x),f=C[0],p=C[1];var E=Math.abs(p-f),I=E,R=0,A=f;if(n.setLayout({viewRect:o,r:c}),n.each(a,function(U,B){var z;if(isNaN(U)){n.setItemLayout(B,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:l,cy:u,r0:h,r:M?NaN:c});return}M!=="area"?z=_===0&&S?y:U*y:z=E/v,z<m?(z=m,I-=m):R+=U;var k=A+T*z,G=0,Y=0;d>z?(G=A+T*z/2,Y=G):(G=A+b,Y=k-b),n.setItemLayout(B,{angle:z,startAngle:G,endAngle:Y,clockwise:x,cx:l,cy:u,r0:h,r:M?ar(U,w,[h,c]):c}),A=k}),I<WX&&v)if(I<=.001){var P=E/v;n.each(a,function(U,B){if(!isNaN(U)){var z=n.getItemLayout(B);z.angle=P;var k=0,G=0;P<d?(k=f+T*(B+1/2)*P,G=k):(k=f+T*B*P+b,G=f+T*(B+1)*P-b),z.startAngle=k,z.endAngle=G}})}else y=I/R,A=f,n.each(a,function(U,B){if(!isNaN(U)){var z=n.getItemLayout(B),k=z.angle===m?m:U*y,G=0,Y=0;k<d?(G=A+T*k/2,Y=G):(G=A+b,Y=A+T*k-b),z.startAngle=G,z.endAngle=Y,A+=T*k}})})}function kl(r){return{seriesType:r,reset:function(e,t){var i=t.findComponents({mainType:"legend"});if(!(!i||!i.length)){var n=e.getData();n.filterSelf(function(a){for(var o=n.getName(a),s=0;s<i.length;s++)if(!i[s].isSelected(o))return!1;return!0})}}}}var jme=Math.PI/180;function YX(r,e,t,i,n,a,o,s,l,u){if(r.length<2)return;function c(g){for(var m=g.rB,v=m*m,_=0;_<g.list.length;_++){var y=g.list[_],x=Math.abs(y.label.y-t),M=i+y.len,S=M*M,w=Math.sqrt((1-Math.abs(x*x/v))*S),T=e+(w+y.len2)*n,C=T-y.label.x,b=y.targetTextWidth-C*n;qX(y,b,!0),y.label.x=T}}function h(g){for(var m={list:[],maxY:0},v={list:[],maxY:0},_=0;_<g.length;_++)if(g[_].labelAlignTo==="none"){var y=g[_],x=y.label.y>t?v:m,M=Math.abs(y.label.y-t);if(M>=x.maxY){var S=y.label.x-e-y.len2*n,w=i+y.len,T=Math.abs(S)<w?Math.sqrt(M*M/(1-S*S/w/w)):w;x.rB=T,x.maxY=M}x.list.push(y)}c(m),c(v)}for(var f=r.length,p=0;p<f;p++)if(r[p].position==="outer"&&r[p].labelAlignTo==="labelLine"){var d=r[p].label.x-u;r[p].linePoints[1][0]+=d,r[p].label.x=u}TT(r,l,l+o)&&h(r)}function Kme(r,e,t,i,n,a,o,s){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,f=0;f<r.length;f++){var p=r[f].label;$I(r[f])||(p.x<e?(c=Math.min(c,p.x),l.push(r[f])):(h=Math.max(h,p.x),u.push(r[f])))}for(var f=0;f<r.length;f++){var d=r[f];if(!$I(d)&&d.linePoints){if(d.labelStyleWidth!=null)continue;var p=d.label,g=d.linePoints,m=void 0;d.labelAlignTo==="edge"?p.x<e?m=g[2][0]-d.labelDistance-o-d.edgeDistance:m=o+n-d.edgeDistance-g[2][0]-d.labelDistance:d.labelAlignTo==="labelLine"?p.x<e?m=c-o-d.bleedMargin:m=o+n-h-d.bleedMargin:p.x<e?m=p.x-o-d.bleedMargin:m=o+n-p.x-d.bleedMargin,d.targetTextWidth=m,qX(d,m)}}YX(u,e,t,i,1,n,a,o,s,h),YX(l,e,t,i,-1,n,a,o,s,c);for(var f=0;f<r.length;f++){var d=r[f];if(!$I(d)&&d.linePoints){var p=d.label,g=d.linePoints,v=d.labelAlignTo==="edge",_=p.style.padding,y=_?_[1]+_[3]:0,x=p.style.backgroundColor?0:y,M=d.rect.width+x,S=g[1][0]-g[2][0];v?p.x<e?g[2][0]=o+d.edgeDistance+M+d.labelDistance:g[2][0]=o+n-d.edgeDistance-M-d.labelDistance:(p.x<e?g[2][0]=p.x+d.labelDistance:g[2][0]=p.x-d.labelDistance,g[1][0]=g[2][0]+S),g[1][1]=g[2][1]=p.y}}}function qX(r,e,t){if(t===void 0&&(t=!1),r.labelStyleWidth==null){var i=r.label,n=i.style,a=r.rect,o=n.backgroundColor,s=n.padding,l=s?s[1]+s[3]:0,u=n.overflow,c=a.width+(o?0:l);if(e<c||t){var h=a.height;if(u&&u.match("break")){i.setStyle("backgroundColor",null),i.setStyle("width",e-l);var f=i.getBoundingRect();i.setStyle("width",Math.ceil(f.width)),i.setStyle("backgroundColor",o)}else{var p=e-l,d=e<c?p:t?p>r.unconstrainedWidth?null:p:null;i.setStyle("width",d)}var g=i.getBoundingRect();a.width=g.width;var m=(i.style.margin||0)+2.1;a.height=g.height+m,a.y-=(a.height-h)/2}}}function $I(r){return r.position==="center"}function QI(r){var e=r.getData(),t=[],i,n,a=!1,o=(r.get("minShowLabelAngle")||0)*jme,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,c=s.x,h=s.y,f=s.height;function p(S){S.ignore=!0}function d(S){if(!S.ignore)return!0;for(var w in S.states)if(S.states[w].ignore===!1)return!0;return!1}e.each(function(S){var w=e.getItemGraphicEl(S),T=w.shape,C=w.getTextContent(),b=w.getTextGuideLine(),E=e.getItemModel(S),I=E.getModel("label"),R=I.get("position")||E.get(["emphasis","label","position"]),A=I.get("distanceToLabelLine"),P=I.get("alignTo"),U=ze(I.get("edgeDistance"),u),B=I.get("bleedMargin"),z=E.getModel("labelLine"),k=z.get("length");k=ze(k,u);var G=z.get("length2");if(G=ze(G,u),Math.abs(T.endAngle-T.startAngle)<o){N(C.states,p),C.ignore=!0,b&&(N(b.states,p),b.ignore=!0);return}if(d(C)){var Y=(T.startAngle+T.endAngle)/2,J=Math.cos(Y),Q=Math.sin(Y),V,K,ae,ve;i=T.cx,n=T.cy;var ue=R==="inside"||R==="inner";if(R==="center")V=T.cx,K=T.cy,ve="center";else{var se=(ue?(T.r+T.r0)/2*J:T.r*J)+i,Ee=(ue?(T.r+T.r0)/2*Q:T.r*Q)+n;if(V=se+J*3,K=Ee+Q*3,!ue){var q=se+J*(k+l-T.r),H=Ee+Q*(k+l-T.r),We=q+(J<0?-1:1)*G,_e=H;P==="edge"?V=J<0?c+U:c+u-U:V=We+(J<0?-A:A),K=_e,ae=[[se,Ee],[q,H],[We,_e]]}ve=ue?"center":P==="edge"?J>0?"right":"left":J>0?"left":"right"}var xe=Math.PI,Le=0,Ue=I.get("rotate");if(Dt(Ue))Le=Ue*(xe/180);else if(R==="center")Le=0;else if(Ue==="radial"||Ue===!0){var Ne=J<0?-Y+xe:-Y;Le=Ne}else if(Ue==="tangential"&&R!=="outside"&&R!=="outer"){var Ve=Math.atan2(J,Q);Ve<0&&(Ve=xe*2+Ve);var dt=Q>0;dt&&(Ve=xe+Ve),Le=Ve-xe}if(a=!!Le,C.x=V,C.y=K,C.rotation=Le,C.setStyle({verticalAlign:"middle"}),ue){C.setStyle({align:ve});var ne=C.states.select;ne&&(ne.x+=C.x,ne.y+=C.y)}else{var F=C.getBoundingRect().clone();F.applyTransform(C.getComputedTransform());var L=(C.style.margin||0)+2.1;F.y-=L/2,F.height+=L,t.push({label:C,labelLine:b,position:R,len:k,len2:G,minTurnAngle:z.get("minTurnAngle"),maxSurfaceAngle:z.get("maxSurfaceAngle"),surfaceNormal:new zt(J,Q),linePoints:ae,textAlign:ve,labelDistance:A,labelAlignTo:P,edgeDistance:U,bleedMargin:B,rect:F,unconstrainedWidth:F.width,labelStyleWidth:C.style.width})}w.setTextConfig({inside:ue})}}),!a&&r.get("avoidLabelOverlap")&&Kme(t,i,n,l,u,f,c,h);for(var g=0;g<t.length;g++){var m=t[g],v=m.label,_=m.labelLine,y=isNaN(v.x)||isNaN(v.y);if(v){v.setStyle({align:m.textAlign}),y&&(N(v.states,p),v.ignore=!0);var x=v.states.select;x&&(x.x+=v.x,x.y+=v.y)}if(_){var M=m.linePoints;y||!M?(N(_.states,p),_.ignore=!0):(dI(M,m.minTurnAngle),V8(M,m.surfaceNormal,m.maxSurfaceAngle),_.setShape({points:M}),v.__hostTarget.textGuideLineConfig={anchor:new zt(M[0][0],M[0][1])})}}}var Jme=function(r){Z(e,r);function e(t,i,n){var a=r.call(this)||this;a.z2=2;var o=new It;return a.setTextContent(o),a.updateData(t,i,n,!0),a}return e.prototype.updateData=function(t,i,n,a){var o=this,s=t.hostModel,l=t.getItemModel(i),u=l.getModel("emphasis"),c=t.getItemLayout(i),h=he(Lu(l.getModel("itemStyle"),c,!0),c);if(isNaN(h.startAngle)){o.setShape(h);return}if(a){o.setShape(h);var f=s.getShallow("animationType");s.ecModel.ssr?(lr(o,{scaleX:0,scaleY:0},s,{dataIndex:i,isFrom:!0}),o.originX=h.cx,o.originY=h.cy):f==="scale"?(o.shape.r=c.r0,lr(o,{shape:{r:c.r}},s,i)):n!=null?(o.setShape({startAngle:n,endAngle:n}),lr(o,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},s,i)):(o.shape.endAngle=c.startAngle,Ut(o,{shape:{endAngle:c.endAngle}},s,i))}else Ui(o),Ut(o,{shape:h},s,i);o.useStyle(t.getItemVisual(i,"style")),Yr(o,l);var p=(c.startAngle+c.endAngle)/2,d=s.get("selectedOffset"),g=Math.cos(p)*d,m=Math.sin(p)*d,v=l.getShallow("cursor");v&&o.attr("cursor",v),this._updateLabel(s,t,i),o.ensureState("emphasis").shape=he({r:c.r+(u.get("scale")&&u.get("scaleSize")||0)},Lu(u.getModel("itemStyle"),c)),he(o.ensureState("select"),{x:g,y:m,shape:Lu(l.getModel(["select","itemStyle"]),c)}),he(o.ensureState("blur"),{shape:Lu(l.getModel(["blur","itemStyle"]),c)});var _=o.getTextGuideLine(),y=o.getTextContent();_&&he(_.ensureState("select"),{x:g,y:m}),he(y.ensureState("select"),{x:g,y:m}),sr(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,i,n){var a=this,o=i.getItemModel(n),s=o.getModel("labelLine"),l=i.getItemVisual(n,"style"),u=l&&l.fill,c=l&&l.opacity;Fr(a,Rr(o),{labelFetcher:i.hostModel,labelDataIndex:n,inheritColor:u,defaultOpacity:c,defaultText:t.getFormattedLabel(n,"normal")||i.getName(n)});var h=a.getTextContent();a.setTextConfig({position:null,rotation:null}),h.attr({z2:10});var f=t.get(["label","position"]);if(f!=="outside"&&f!=="outer")a.removeTextGuideLine();else{var p=this.getTextGuideLine();p||(p=new ri,this.setTextGuideLine(p)),Pv(this,Iv(o),{stroke:u,opacity:qi(s.get(["lineStyle","opacity"]),c,1)})}},e}(Mi),$me=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,i,n,a){var o=t.getData(),s=this._data,l=this.group,u;if(!s&&o.count()>0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h<o.count();++h)c=o.getItemLayout(h);c&&(u=c.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),o.count()===0&&t.get("showEmptyCircle")){var f=new Mi({shape:KI(t,n)});f.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=f,l.add(f)}o.diff(s).add(function(p){var d=new Jme(o,p,u);o.setItemGraphicEl(p,d),l.add(d)}).update(function(p,d){var g=s.getItemGraphicEl(d);g.updateData(o,p,u),g.off("click"),l.add(g),o.setItemGraphicEl(p,g)}).remove(function(p){var d=s.getItemGraphicEl(p);cc(d,t,p)}).execute(),QI(t),t.get("animationTypeUpdate")!=="expansion"&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,i){var n=i.getData(),a=n.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="pie",e}(Zt),ZX=$me;function us(r,e,t){e=pe(e)&&{coordDimensions:e}||he({encodeDefine:r.getEncode()},e);var i=r.getSource(),n=Nl(i,e).dimensions,a=new oi(n,r);return a.initData(i,t),a}var Qme=function(){function r(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return r.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},r.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},r.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},r.prototype.getItemVisual=function(e,t){var i=this._getDataWithEncodedVisual();return i.getItemVisual(e,t)},r}(),Du=Qme;var eve=xt(),tve=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Du(Be(this.getData,this),Be(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return us(this,{coordDimensions:["value"],encodeDefaulter:ut(_v,this)})},e.prototype.getDataParams=function(t){var i=this.getData(),n=eve(i),a=n.seats;if(!a){var o=[];i.each(i.mapDimension("value"),function(l){o.push(l)}),a=n.seats=V2(o,i.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,t);return s.percent=a[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){rs(t,"labelLine",["show"]);var i=t.labelLine,n=t.emphasis.labelLine;i.show=i.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}($t),jX=tve;function eN(r){return{seriesType:r,reset:function(e,t){var i=e.getData();i.filterSelf(function(n){var a=i.mapDimension("value"),o=i.get(a,n);return!(Dt(o)&&!isNaN(o)&&o<0)})}}}function tN(r){r.registerChartView(ZX),r.registerSeriesModel(jX),X1("pie",r.registerAction),r.registerLayout(ut(JI,"pie")),r.registerProcessor(kl("pie")),r.registerProcessor(eN("pie"))}var rve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,i){return mn(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(t,i,n){return n.point(i.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}($t),KX=rve;var JX=4,ive=function(){function r(){}return r}(),nve=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i._off=0,i.hoverDataIdx=-1,i}return e.prototype.getDefaultShape=function(){return new ive},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,i){var n=i.points,a=i.size,o=this.symbolProxy,s=o.shape,l=t.getContext?t.getContext():t,u=l&&a[0]<JX,c=this.softClipShape,h;if(u){this._ctx=l;return}for(this._ctx=null,h=this._off;h<n.length;){var f=n[h++],p=n[h++];isNaN(f)||isNaN(p)||c&&!c.contain(f,p)||(s.x=f-a[0]/2,s.y=p-a[1]/2,s.width=a[0],s.height=a[1],o.buildPath(t,s,!0))}this.incremental&&(this._off=h,this.notClear=!0)},e.prototype.afterBrush=function(){var t=this.shape,i=t.points,n=t.size,a=this._ctx,o=this.softClipShape,s;if(a){for(s=this._off;s<i.length;){var l=i[s++],u=i[s++];isNaN(l)||isNaN(u)||o&&!o.contain(l,u)||a.fillRect(l-n[0]/2,u-n[1]/2,n[0],n[1])}this.incremental&&(this._off=s,this.notClear=!0)}},e.prototype.findDataIndex=function(t,i){for(var n=this.shape,a=n.points,o=n.size,s=Math.max(o[0],4),l=Math.max(o[1],4),u=a.length/2-1;u>=0;u--){var c=u*2,h=a[c]-s/2,f=a[c+1]-l/2;if(t>=h&&i>=f&&t<=h+s&&i<=f+l)return u}return-1},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect();if(t=n[0],i=n[1],a.contain(t,i)){var o=this.hoverDataIdx=this.findDataIndex(t,i);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var i=this.shape,n=i.points,a=i.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,f=0;f<n.length;){var p=n[f++],d=n[f++];l=Math.min(p,l),c=Math.max(p,c),u=Math.min(d,u),h=Math.max(d,h)}t=this._rect=new ht(l-o/2,u-s/2,c-l+o,h-u+s)}return t},e}(pt),ave=function(){function r(){this.group=new Ze}return r.prototype.updateData=function(e,t){this._clear();var i=this._create();i.setShape({points:e.getLayout("points")}),this._setCommon(i,e,t)},r.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild(function(i){if(i.startIndex!=null){var n=(i.endIndex-i.startIndex)*2,a=i.startIndex*4*2;t=new Float32Array(t.buffer,a,n)}i.setShape("points",t),i.reset()})},r.prototype.incrementalPrepareUpdate=function(e){this._clear()},r.prototype.incrementalUpdate=function(e,t,i){var n=this._newAdded[0],a=t.getLayout("points"),o=n&&n.shape.points;if(o&&o.length<2e4){var s=o.length,l=new Float32Array(s+a.length);l.set(o),l.set(a,s),n.endIndex=e.end,n.setShape({points:l})}else{this._newAdded=[];var u=this._create();u.startIndex=e.start,u.endIndex=e.end,u.incremental=!0,u.setShape({points:a}),this._setCommon(u,t,i)}},r.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},r.prototype._create=function(){var e=new nve({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},r.prototype._setCommon=function(e,t,i){var n=t.hostModel;i=i||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=i.clipShape||null,e.symbolProxy=wr(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<JX;e.useStyle(n.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("style"),l=s&&s.fill;l&&e.setColor(l);var u=it(e);u.seriesIndex=n.seriesIndex,e.on("mousemove",function(c){u.dataIndex=null;var h=e.hoverDataIdx;h>=0&&(u.dataIndex=h+(e.startIndex||0))})},r.prototype.remove=function(){this._clear()},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),$X=ave;var ove=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,i,n){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,i,n){this._symbolDraw.incrementalUpdate(t,i.getData(),{clipShape:this._getClipShape(i)}),this._finished=t.end===i.getData().count()},e.prototype.updateTransform=function(t,i,n){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=Bl("").reset(t,i,n);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var i=t.coordinateSystem;return i&&i.getArea&&i.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,i){var n=this._symbolDraw,a=i.pipelineContext,o=a.large;return(!n||o!==this._isLargeDraw)&&(n&&n.remove(),n=this._symbolDraw=o?new $X:new Cu,this._isLargeDraw=o,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,i){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Zt),QX=ove;var sve=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Nt),e9=sve;var XT=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ir).models[0]},e.type="cartesian2dAxis",e}(Nt);Cr(XT,wu);var t9={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},lve=bt({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},t9),rN=bt({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},t9),uve=bt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},rN),cve=Ye({logBase:10},rN),YT={category:lve,value:rN,time:uve,log:cve};var r9={value:1,category:1,time:1,log:1};function Vl(r,e,t,i){N(r9,function(n,a){var o=bt(bt({},YT[a],!0),i,!0),s=function(l){Z(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=e+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,h){var f=Nh(this),p=f?ks(c):{},d=h.getTheme();bt(c,d.get(a+"Axis")),bt(c,this.getDefaultOption()),c.type=i9(c),f&&Eo(c,p,f)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=Gx.createByAxisModel(this))},u.prototype.getCategories=function(c){var h=this.option;if(h.type==="category")return c?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(t);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(e+"Axis",i9)}function i9(r){return r.type||(r.data?"category":"value")}var hve=function(){function r(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return r.prototype.getAxis=function(e){return this._axes[e]},r.prototype.getAxes=function(){return de(this._dimList,function(e){return this._axes[e]},this)},r.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Yt(this.getAxes(),function(t){return t.scale.type===e})},r.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},r}(),n9=hve;var qT=["x","y"];function a9(r){return r.type==="interval"||r.type==="time"}var fve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=qT,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!a9(t)||!a9(i))){var n=t.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,h=(s[1]-o[1])/u,f=o[0]-n[0]*c,p=o[1]-a[0]*h,d=this._transform=[c,0,0,h,f,p];this._invTransform=Ls([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,i){var n=this.dataToPoint(t),a=this.dataToPoint(i),o=this.getArea(),s=new ht(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},e.prototype.dataToPoint=function(t,i,n){n=n||[];var a=t[0],o=t[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return mi(n,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},e.prototype.clampData=function(t,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(t[0]),u=a.parse(t[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},e.prototype.pointToData=function(t,i){var n=[];if(this._invTransform)return mi(n,t,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(t[0]),i),n[1]=o.coordToData(o.toLocalCoord(t[1]),i),n},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-t,o=Math.min(n[0],n[1])-t,s=Math.max(i[0],i[1])-a+t,l=Math.max(n[0],n[1])-o+t;return new ht(a,o,s,l)},e}(n9),o9=fve;var pve=function(r){Z(e,r);function e(t,i,n,a,o){var s=r.call(this,t,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),t&&i[0]>i[1]&&i.reverse(),i},e.prototype.pointToData=function(t,i){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),i)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(vn),s9=pve;function iS(r,e,t){t=t||{};var i=r.coordinateSystem,n=e.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,c=i.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],f={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,d=u==="x"?[h[2]-p,h[3]+p]:[h[0]-p,h[1]+p];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));d[f.onZero]=Math.max(Math.min(g,d[1]),d[0])}a.position=[u==="y"?d[f[l]]:h[0],u==="x"?d[f[l]]:h[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var m={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=m[s],a.labelOffset=o?d[f[s]]-d[f.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),Hr(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var v=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-v:v,a.z2=1,a}function iN(r){return r.get("coordinateSystem")==="cartesian2d"}function nN(r){var e={xAxisModel:null,yAxisModel:null};return N(e,function(t,i){var n=i.replace(/Model$/,""),a=r.getReferringComponents(n,Ir).models[0];e[i]=a}),e}var aN=Math.log;function ZT(r,e,t){var i=Do.prototype,n=i.getTicks.call(t),a=i.getTicks.call(t,!0),o=n.length-1,s=i.getInterval.call(t),l=oI(r,e),u=l.extent,c=l.fixMin,h=l.fixMax;if(r.type==="log"){var f=aN(r.base);u=[aN(u[0])/f,aN(u[1])/f]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:c,fixMax:h});var p=i.getExtent.call(r);c&&(u[0]=p[0]),h&&(u[1]=p[1]);var d=i.getInterval.call(r),g=u[0],m=u[1];if(c&&h)d=(m-g)/o;else if(c)for(m=u[0]+d*o;m<u[1]&&isFinite(m)&&isFinite(u[1]);)d=lT(d),m=u[0]+d*o;else if(h)for(g=u[1]-d*o;g>u[0]&&isFinite(g)&&isFinite(u[0]);)d=lT(d),g=u[1]-d*o;else{var v=r.getTicks().length-1;v>o&&(d=lT(d));var _=d*o;m=Math.ceil(u[1]/d)*d,g=Pr(m-_),g<0&&u[0]>=0?(g=0,m=Pr(_)):m>0&&u[1]<=0&&(m=0,g=-Pr(_))}var y=(n[0].value-a[0].value)/s,x=(n[o].value-a[o].value)/s;if(i.setExtent.call(r,g+d*y,m+d*x),i.setInterval.call(r,d),(y||x)&&i.setNiceExtent.call(r,g+d,m-d),0)var M}var dve=function(){function r(e,t,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=qT,this._initCartesian(e,t,i),this.model=e}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model);function n(o){var s,l=At(o),u=l.length;if(u){for(var c=[],h=u-1;h>=0;h--){var f=+l[h],p=o[f],d=p.model,g=p.scale;Hx(g)&&d.get("alignTicks")&&d.get("interval")==null?c.push(p):(bu(g,d),Hx(g)&&(s=p))}c.length&&(s||(s=c.pop(),bu(s.scale,s.model)),N(c,function(m){ZT(m.scale,m.model,s.scale)}))}}n(i.x),n(i.y);var a={};N(i.x,function(o){u9(i,"y",o,a)}),N(i.y,function(o){u9(i,"x",o,a)}),this.resize(this.model,t)},r.prototype.resize=function(e,t,i){var n=e.getBoxLayoutParams(),a=!i&&e.get("containLabel"),o=br(n,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(N(s,function(u){if(!u.model.get(["axisLabel","inside"])){var c=S8(u);if(c){var h=u.isHorizontal()?"height":"width",f=u.model.get(["axisLabel","margin"]);o[h]-=c[h]+f,u.position==="top"?o.y+=c.height+f:u.position==="left"&&(o.x+=c.width+f)}}}),l()),N(this._coordsList,function(u){u.calcAffineTransform()});function l(){N(s,function(u){var c=u.isHorizontal(),h=c?[0,o.width]:[0,o.height],f=u.inverse?1:0;u.setExtent(h[f],h[1-f]),mve(u,c?o.x:o.y)})}},r.prototype.getAxis=function(e,t){var i=this._axesMap[e];if(i!=null)return i[t||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var i="x"+e+"y"+t;return this._coordsMap[i]}qe(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,a=this._coordsList;n<a.length;n++)if(a[n].getAxis("x").index===e||a[n].getAxis("y").index===t)return a[n]},r.prototype.getCartesians=function(){return this._coordsList.slice()},r.prototype.convertToPixel=function(e,t,i){var n=this._findConvertTarget(t);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},r.prototype.convertFromPixel=function(e,t,i){var n=this._findConvertTarget(t);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},r.prototype._findConvertTarget=function(e){var t=e.seriesModel,i=e.xAxisModel||t&&t.getReferringComponents("xAxis",Ir).models[0],n=e.yAxisModel||t&&t.getReferringComponents("yAxis",Ir).models[0],a=e.gridModel,o=this._coordsList,s,l;if(t)s=t.coordinateSystem,yt(o,s)<0&&(s=null);else if(i&&n)s=this.getCartesian(i.componentIndex,n.componentIndex);else if(i)l=this.getAxis("x",i.componentIndex);else if(n)l=this.getAxis("y",n.componentIndex);else if(a){var u=a.coordinateSystem;u===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},r.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},r.prototype._initCartesian=function(e,t,i){var n=this,a=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(t.eachComponent("xAxis",u("x"),this),t.eachComponent("yAxis",u("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,N(s.x,function(c,h){N(s.y,function(f,p){var d="x"+h+"y"+p,g=new o9(d);g.master=n,g.model=e,n._coordsMap[d]=g,n._coordsList.push(g),g.addAxis(c),g.addAxis(f)})});function u(c){return function(h,f){if(oN(h,e)){var p=h.get("position");c==="x"?p!=="top"&&p!=="bottom"&&(p=o.bottom?"top":"bottom"):p!=="left"&&p!=="right"&&(p=o.left?"right":"left"),o[p]=!0;var d=new s9(c,Xh(h),[0,0],h.get("type"),p),g=d.type==="category";d.onBand=g&&h.get("boundaryGap"),d.inverse=h.get("inverse"),h.axis=d,d.model=h,d.grid=a,d.index=f,a._axesList.push(d),s[c][f]=d,l[c]++}}}},r.prototype._updateScale=function(e,t){N(this._axesList,function(n){if(n.scale.setExtent(1/0,-1/0),n.type==="category"){var a=n.model.get("categorySortInfo");n.scale.setSortInfo(a)}}),e.eachSeries(function(n){if(iN(n)){var a=nN(n),o=a.xAxisModel,s=a.yAxisModel;if(!oN(o,t)||!oN(s,t))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),u=n.getData(),c=l.getAxis("x"),h=l.getAxis("y");i(u,c),i(u,h)}},this);function i(n,a){N(Lv(n,a.dim),function(o){a.scale.unionExtentFromData(n,o)})}},r.prototype.getTooltipAxes=function(e){var t=[],i=[];return N(this.getCartesians(),function(n){var a=e!=null&&e!=="auto"?n.getAxis(e):n.getBaseAxis(),o=n.getOtherAxis(a);yt(t,a)<0&&t.push(a),yt(i,o)<0&&i.push(o)}),{baseAxes:t,otherAxes:i}},r.create=function(e,t){var i=[];return e.eachComponent("grid",function(n,a){var o=new r(n,e,t);o.name="grid_"+a,o.resize(n,t,!0),n.coordinateSystem=o,i.push(o)}),e.eachSeries(function(n){if(iN(n)){var a=nN(n),o=a.xAxisModel,s=a.yAxisModel,l=o.getCoordSysModel(),u=l.coordinateSystem;n.coordinateSystem=u.getCartesian(o.componentIndex,s.componentIndex)}}),i},r.dimensions=qT,r}();function oN(r,e){return r.getCoordSysModel()===e}function u9(r,e,t,i){t.getAxesOnZeroOf=function(){return a?[a]:[]};var n=r[e],a,o=t.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)c9(n[l])&&(a=n[l]);else for(var u in n)if(n.hasOwnProperty(u)&&c9(n[u])&&!i[c(n[u])]){a=n[u];break}a&&(i[c(a)]=!0);function c(h){return h.dim+"_"+h.index}}function c9(r){return r&&r.type!=="category"&&r.type!=="time"&&x8(r)}function mve(r,e){var t=r.getExtent(),i=t[0]+t[1];r.toGlobalCoord=r.dim==="x"?function(n){return n+e}:function(n){return i-n+e},r.toLocalCoord=r.dim==="x"?function(n){return n-e}:function(n){return i-n+e}}var h9=dve;var Kh=Math.PI,cd=function(){function r(e,t){this.group=new Ze,this.opt=t,this.axisModel=e,Ye(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var i=new Ze({x:t.position[0],y:t.position[1],rotation:t.rotation});i.updateTransform(),this._transformGroup=i}return r.prototype.hasBuilder=function(e){return!!f9[e]},r.prototype.add=function(e){f9[e](this.opt,this.axisModel,this.group,this._transformGroup)},r.prototype.getGroup=function(){return this.group},r.innerTextLayout=function(e,t,i){var n=k_(t-e),a,o;return ic(n)?(o=i>0?"top":"bottom",a="center"):ic(n-Kh)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n<Kh?a=i>0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},r.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},r}(),f9={axisLine:function(r,e,t,i){var n=e.get(["axisLine","show"]);if(n==="auto"&&r.handleAutoShown&&(n=r.handleAutoShown("axisLine")),!!n){var a=e.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(mi(s,s,o),mi(l,l,o));var c=he({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new ei({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});hc(h.shape,h.style.lineWidth),h.anid="line",t.add(h);var f=e.get(["axisLine","symbol"]);if(f!=null){var p=e.get(["axisLine","symbolSize"]);Ce(f)&&(f=[f,f]),(Ce(p)||Dt(p))&&(p=[p,p]);var d=ss(e.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];N([{rotate:r.rotation+Math.PI/2,offset:d[0],r:0},{rotate:r.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(v,_){if(f[_]!=="none"&&f[_]!=null){var y=wr(f[_],-g/2,-m/2,g,m,c.stroke,!0),x=v.r+v.offset,M=u?l:s;y.attr({rotation:v.rotate,x:M[0]+x*Math.cos(r.rotation),y:M[1]-x*Math.sin(r.rotation),silent:!0,z2:11}),t.add(y)}})}}},axisTickLabel:function(r,e,t,i){var n=yve(t,i,e,r),a=xve(t,i,e,r);if(gve(e,a,n),_ve(t,i,e,r.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=wT(de(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));ET(o)}},axisName:function(r,e,t,i){var n=Hr(r.axisName,e.get("name"));if(n){var a=e.get("nameLocation"),o=r.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),c=u[0]>u[1]?-1:1,h=[a==="start"?u[0]-c*l:a==="end"?u[1]+c*l:(u[0]+u[1])/2,d9(a)?r.labelOffset+o*l:0],f,p=e.get("nameRotate");p!=null&&(p=p*Kh/180);var d;d9(a)?f=cd.innerTextLayout(r.rotation,p??r.rotation,o):(f=vve(r.rotation,a,p||0,u),d=r.axisNameAvailableWidth,d!=null&&(d=Math.abs(d/Math.sin(f.rotation)),!isFinite(d)&&(d=null)));var g=s.getFont(),m=e.get("nameTruncate",!0)||{},v=m.ellipsis,_=Hr(r.nameTruncateMaxWidth,m.maxWidth,d),y=new It({x:h[0],y:h[1],rotation:f.rotation,silent:cd.isLabelSilent(e),style:pr(s,{text:n,font:g,overflow:"truncate",width:_,ellipsis:v,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||f.textAlign,verticalAlign:s.get("verticalAlign")||f.textVerticalAlign}),z2:1});if(El({el:y,componentModel:e,itemName:n}),y.__fullText=n,y.anid="name",e.get("triggerEvent")){var x=cd.makeAxisEventDataBase(e);x.targetType="axisName",x.name=n,it(y).eventData=x}i.add(y),y.updateTransform(),t.add(y),y.decomposeTransform()}}};function vve(r,e,t,i){var n=k_(t-r),a,o,s=i[0]>i[1],l=e==="start"&&!s||e!=="start"&&s;return ic(n-Kh/2)?(o=l?"bottom":"top",a="center"):ic(n-Kh*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",n<Kh*1.5&&n>Kh/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function gve(r,e,t){if(!_T(r.axis)){var i=r.get(["axisLabel","showMinLabel"]),n=r.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=t[0],c=t[1],h=t[t.length-1],f=t[t.length-2];i===!1?(qs(a),qs(u)):p9(a,o)&&(i?(qs(o),qs(c)):(qs(a),qs(u))),n===!1?(qs(s),qs(h)):p9(l,s)&&(n?(qs(l),qs(f)):(qs(s),qs(h)))}}function qs(r){r&&(r.ignore=!0)}function p9(r,e){var t=r&&r.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(!(!t||!i)){var n=vh([]);return vo(n,n,-r.rotation),t.applyTransform(mo([],n,r.getLocalTransform())),i.applyTransform(mo([],n,e.getLocalTransform())),t.intersect(i)}}function d9(r){return r==="middle"||r==="center"}function m9(r,e,t,i,n){for(var a=[],o=[],s=[],l=0;l<r.length;l++){var u=r[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=t,e&&(mi(o,o,e),mi(s,s,e));var c=new ei({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});hc(c.shape,c.style.lineWidth),c.anid=n+"_"+r[l].tickValue,a.push(c)}return a}function yve(r,e,t,i){var n=t.axis,a=t.getModel("axisTick"),o=a.get("show");if(o==="auto"&&i.handleAutoShown&&(o=i.handleAutoShown("axisTick")),!(!o||n.scale.isBlank())){for(var s=a.getModel("lineStyle"),l=i.tickDirection*a.get("length"),u=n.getTicksCoords(),c=m9(u,e.transform,l,Ye(s.getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;h<c.length;h++)r.add(c[h]);return c}}function _ve(r,e,t,i){var n=t.axis,a=t.getModel("minorTick");if(!(!a.get("show")||n.scale.isBlank())){var o=n.getMinorTicksCoords();if(o.length)for(var s=a.getModel("lineStyle"),l=i*a.get("length"),u=Ye(s.getLineStyle(),Ye(t.getModel("axisTick").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})),c=0;c<o.length;c++)for(var h=m9(o[c],e.transform,l,u,"minorticks_"+c),f=0;f<h.length;f++)r.add(h[f])}}function xve(r,e,t,i){var n=t.axis,a=Hr(i.axisLabelShow,t.get(["axisLabel","show"]));if(!(!a||n.scale.isBlank())){var o=t.getModel("axisLabel"),s=o.get("margin"),l=n.getViewLabels(),u=(Hr(i.labelRotate,o.get("rotate"))||0)*Kh/180,c=cd.innerTextLayout(i.rotation,u,i.labelDirection),h=t.getCategories&&t.getCategories(!0),f=[],p=cd.isLabelSilent(t),d=t.get("triggerEvent");return N(l,function(g,m){var v=n.scale.type==="ordinal"?n.scale.getRawOrdinalNumber(g.tickValue):g.tickValue,_=g.formattedLabel,y=g.rawLabel,x=o;if(h&&h[v]){var M=h[v];qe(M)&&M.textStyle&&(x=new Jt(M.textStyle,o,t.ecModel))}var S=x.getTextColor()||t.get(["axisLine","lineStyle","color"]),w=n.dataToCoord(v),T=x.getShallow("align",!0)||c.textAlign,C=mt(x.getShallow("alignMinLabel",!0),T),b=mt(x.getShallow("alignMaxLabel",!0),T),E=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||c.textVerticalAlign,I=mt(x.getShallow("verticalAlignMinLabel",!0),E),R=mt(x.getShallow("verticalAlignMaxLabel",!0),E),A=new It({x:w,y:i.labelOffset+i.labelDirection*s,rotation:c.rotation,silent:p,z2:10+(g.level||0),style:pr(x,{text:_,align:m===0?C:m===l.length-1?b:T,verticalAlign:m===0?I:m===l.length-1?R:E,fill:He(S)?S(n.type==="category"?y:n.type==="value"?v+"":v,m):S})});if(A.anid="label_"+v,d){var P=cd.makeAxisEventDataBase(t);P.targetType="axisLabel",P.value=y,P.tickIndex=m,n.type==="category"&&(P.dataIndex=v),it(A).eventData=P}e.add(A),A.updateTransform(),f.push(A),r.add(A),A.decomposeTransform()}),f}}var Nn=cd;function v9(r,e){var t={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return Sve(t,r,e),t.seriesInvolved&&bve(t,r),t}function Sve(r,e,t){var i=e.getComponent("tooltip"),n=e.getComponent("axisPointer"),a=n.get("link",!0)||[],o=[];N(t.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=zv(s.model),u=r.coordSysAxesInfo[l]={};r.coordSysMap[l]=s;var c=s.model,h=c.getModel("tooltip",i);if(N(s.getAxes(),ut(g,!1,null)),s.getTooltipAxes&&i&&h.get("show")){var f=h.get("trigger")==="axis",p=h.get(["axisPointer","type"])==="cross",d=s.getTooltipAxes(h.get(["axisPointer","axis"]));(f||p)&&N(d.baseAxes,ut(g,p?"cross":!0,f)),p&&N(d.otherAxes,ut(g,"cross",!1))}function g(m,v,_){var y=_.model.getModel("axisPointer",n),x=y.get("show");if(!(!x||x==="auto"&&!m&&!lN(y))){v==null&&(v=y.get("triggerTooltip")),y=m?Mve(_,h,n,e,m,v):y;var M=y.get("snap"),S=y.get("triggerEmphasis"),w=zv(_.model),T=v||M||_.type==="category",C=r.axesInfo[w]={key:w,axis:_,coordSys:s,axisPointerModel:y,triggerTooltip:v,triggerEmphasis:S,involveSeries:T,snap:M,useHandle:lN(y),seriesModels:[],linkGroup:null};u[w]=C,r.seriesInvolved=r.seriesInvolved||T;var b=wve(a,_);if(b!=null){var E=o[b]||(o[b]={axesInfo:{}});E.axesInfo[w]=C,E.mapper=a[b].mapper,C.linkGroup=E}}}})}function Mve(r,e,t,i,n,a){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};N(s,function(f){l[f]=Qe(o.get(f))}),l.snap=r.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),n==="cross"){var c=o.get(["label","show"]);if(u.show=c??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&Ye(u,h.textStyle)}}return r.model.getModel("axisPointer",new Jt(l,t,i))}function bve(r,e){e.eachSeries(function(t){var i=t.coordinateSystem,n=t.get(["tooltip","trigger"],!0),a=t.get(["tooltip","show"],!0);!i||n==="none"||n===!1||n==="item"||a===!1||t.get(["axisPointer","show"],!0)===!1||N(r.coordSysAxesInfo[zv(i.model)],function(o){var s=o.axis;i.getAxis(s.dim)===s&&(o.seriesModels.push(t),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=t.getData().count())})})}function wve(r,e){for(var t=e.model,i=e.dim,n=0;n<r.length;n++){var a=r[n]||{};if(sN(a[i+"AxisId"],t.id)||sN(a[i+"AxisIndex"],t.componentIndex)||sN(a[i+"AxisName"],t.name))return n}}function sN(r,e){return r==="all"||pe(r)&&yt(r,e)>=0||r===e}function g9(r){var e=jT(r);if(e){var t=e.axisPointerModel,i=e.axis.scale,n=t.option,a=t.get("status"),o=t.get("value");o!=null&&(o=i.parse(o));var s=lN(t);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),n.value=o,s&&(n.status=e.axis.scale.isBlank()?"hide":"show")}}function jT(r){var e=(r.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[zv(r)]}function y9(r){var e=jT(r);return e&&e.axisPointerModel}function lN(r){return!!r.get(["handle","show"])}function zv(r){return r.type+"||"+r.id}var _9={},Tve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n,a){this.axisPointerClass&&g9(t),r.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,n,!0)},e.prototype.updateAxisPointer=function(t,i,n,a){this._doUpdateAxisPointerClass(t,n,!1)},e.prototype.remove=function(t,i){var n=this._axisPointer;n&&n.remove(i)},e.prototype.dispose=function(t,i){this._disposeAxisPointer(i),r.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(t,i,n){var a=e.getAxisPointerClass(this.axisPointerClass);if(a){var o=y9(t);o?(this._axisPointer||(this._axisPointer=new a)).render(t,o,i,n):this._disposeAxisPointer(i)}},e.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},e.registerAxisPointerClass=function(t,i){_9[t]=i},e.getAxisPointerClass=function(t){return t&&_9[t]},e.type="axis",e}(ir),Po=Tve;var cN=xt();function KT(r,e,t,i){var n=t.axis;if(!n.scale.isBlank()){var a=t.getModel("splitArea"),o=a.getModel("areaStyle"),s=o.get("color"),l=i.coordinateSystem.getRect(),u=n.getTicksCoords({tickModel:a,clamp:!0});if(u.length){var c=s.length,h=cN(r).splitAreaColors,f=ke(),p=0;if(h)for(var d=0;d<u.length;d++){var g=h.get(u[d].tickValue);if(g!=null){p=(g+(c-1)*d)%c;break}}var m=n.toGlobalCoord(u[0].coord),v=o.getAreaStyle();s=pe(s)?s:[s];for(var d=1;d<u.length;d++){var _=n.toGlobalCoord(u[d].coord),y=void 0,x=void 0,M=void 0,S=void 0;n.isHorizontal()?(y=m,x=l.y,M=_-y,S=l.height,m=y+M):(y=l.x,x=m,M=l.width,S=_-x,m=x+S);var w=u[d-1].tickValue;w!=null&&f.set(w,p),e.add(new Rt({anid:w!=null?"area_"+w:null,shape:{x:y,y:x,width:M,height:S},style:Ye({fill:s[p]},v),autoBatch:!0,silent:!0})),p=(p+1)%c}cN(r).splitAreaColors=f}}}function JT(r){cN(r).splitAreaColors=null}var Eve=["axisLine","axisTickLabel","axisName"],Ave=["splitArea","splitLine","minorSplitLine"],x9=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="CartesianAxisPointer",t}return e.prototype.render=function(t,i,n,a){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ze,this.group.add(this._axisGroup),!!t.get("show")){var s=t.getCoordSysModel(),l=iS(s,t),u=new Nn(t,he({handleAutoShown:function(h){for(var f=s.coordinateSystem.getCartesians(),p=0;p<f.length;p++)if(Hx(f[p].getOtherAxis(t.axis).scale))return!0;return!1}},l));N(Eve,u.add,u),this._axisGroup.add(u.getGroup()),N(Ave,function(h){t.get([h,"show"])&&Cve[h](this,this._axisGroup,t,s)},this);var c=a&&a.type==="changeAxisOrder"&&a.isInitSort;c||fc(o,this._axisGroup,t),r.prototype.render.call(this,t,i,n,a)}},e.prototype.remove=function(){JT(this)},e.type="cartesianAxis",e}(Po),Cve={splitLine:function(r,e,t,i){var n=t.axis;if(!n.scale.isBlank()){var a=t.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=pe(s)?s:[s];for(var l=i.coordinateSystem.getRect(),u=n.isHorizontal(),c=0,h=n.getTicksCoords({tickModel:a}),f=[],p=[],d=o.getLineStyle(),g=0;g<h.length;g++){var m=n.toGlobalCoord(h[g].coord);u?(f[0]=m,f[1]=l.y,p[0]=m,p[1]=l.y+l.height):(f[0]=l.x,f[1]=m,p[0]=l.x+l.width,p[1]=m);var v=c++%s.length,_=h[g].tickValue,y=new ei({anid:_!=null?"line_"+h[g].tickValue:null,autoBatch:!0,shape:{x1:f[0],y1:f[1],x2:p[0],y2:p[1]},style:Ye({stroke:s[v]},d),silent:!0});hc(y.shape,d.lineWidth),e.add(y)}}},minorSplitLine:function(r,e,t,i){var n=t.axis,a=t.getModel("minorSplitLine"),o=a.getModel("lineStyle"),s=i.coordinateSystem.getRect(),l=n.isHorizontal(),u=n.getMinorTicksCoords();if(u.length)for(var c=[],h=[],f=o.getLineStyle(),p=0;p<u.length;p++)for(var d=0;d<u[p].length;d++){var g=n.toGlobalCoord(u[p][d].coord);l?(c[0]=g,c[1]=s.y,h[0]=g,h[1]=s.y+s.height):(c[0]=s.x,c[1]=g,h[0]=s.x+s.width,h[1]=g);var m=new ei({anid:"minor_line_"+u[p][d].tickValue,autoBatch:!0,shape:{x1:c[0],y1:c[1],x2:h[0],y2:h[1]},style:f,silent:!0});hc(m.shape,f.lineWidth),e.add(m)}},splitArea:function(r,e,t,i){KT(r,e,t,i)}},hN=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="xAxis",e}(x9);var S9=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=hN.type,t}return e.type="yAxis",e}(x9);var Rve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="grid",t}return e.prototype.render=function(t,i){this.group.removeAll(),t.get("show")&&this.group.add(new Rt({shape:t.coordinateSystem.getRect(),style:Ye({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(ir),M9={offset:0};function $T(r){r.registerComponentView(Rve),r.registerComponentModel(e9),r.registerCoordinateSystem("cartesian2d",h9),Vl(r,"x",XT,M9),Vl(r,"y",XT,M9),r.registerComponentView(hN),r.registerComponentView(S9),r.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}function fN(r){Ot($T),r.registerSeriesModel(KX),r.registerChartView(QX),r.registerLayout(Bl("scatter"))}function pN(r){r.eachSeriesByType("radar",function(e){var t=e.getData(),i=[],n=e.coordinateSystem;if(n){var a=n.getIndicatorAxes();N(a,function(o,s){t.each(t.mapDimension(a[s].dim),function(l,u){i[u]=i[u]||[];var c=n.dataToPoint(l,s);i[u][s]=b9(c)?c:w9(n)})}),t.each(function(o){var s=jV(i[o],function(l){return b9(l)})||w9(n);i[o].push(s.slice()),t.setItemLayout(o,i[o])})}})}function b9(r){return!isNaN(r[0])&&!isNaN(r[1])}function w9(r){return[r.cx,r.cy]}function dN(r){var e=r.polar;if(e){pe(e)||(e=[e]);var t=[];N(e,function(i,n){i.indicator?(i.type&&!i.shape&&(i.shape=i.type),r.radar=r.radar||[],pe(r.radar)||(r.radar=[r.radar]),r.radar.push(i)):t.push(i)}),r.polar=t}N(r.series,function(i){i&&i.type==="radar"&&i.polarIndex&&(i.radarIndex=i.polarIndex)})}var Lve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=t.coordinateSystem,o=this.group,s=t.getData(),l=this._data;function u(f,p){var d=f.getItemVisual(p,"symbol")||"circle";if(d!=="none"){var g=Pl(f.getItemVisual(p,"symbolSize")),m=wr(d,-1,-1,2,2),v=f.getItemVisual(p,"symbolRotate")||0;return m.attr({style:{strokeNoScale:!0},z2:100,scaleX:g[0]/2,scaleY:g[1]/2,rotation:v*Math.PI/180||0}),m}}function c(f,p,d,g,m,v){d.removeAll();for(var _=0;_<p.length-1;_++){var y=u(g,m);y&&(y.__dimIdx=_,f[_]?(y.setPosition(f[_]),Pt[v?"initProps":"updateProps"](y,{x:p[_][0],y:p[_][1]},t,m)):y.setPosition(p[_]),d.add(y))}}function h(f){return de(f,function(p){return[a.cx,a.cy]})}s.diff(l).add(function(f){var p=s.getItemLayout(f);if(p){var d=new ai,g=new ri,m={shape:{points:p}};d.shape.points=h(p),g.shape.points=h(p),lr(d,m,t,f),lr(g,m,t,f);var v=new Ze,_=new Ze;v.add(g),v.add(d),v.add(_),c(g.shape.points,p,_,s,f,!0),s.setItemGraphicEl(f,v)}}).update(function(f,p){var d=l.getItemGraphicEl(p),g=d.childAt(0),m=d.childAt(1),v=d.childAt(2),_={shape:{points:s.getItemLayout(f)}};_.shape.points&&(c(g.shape.points,_.shape.points,v,s,f,!1),Ui(m),Ui(g),Ut(g,_,t),Ut(m,_,t),s.setItemGraphicEl(f,d))}).remove(function(f){o.remove(l.getItemGraphicEl(f))}).execute(),s.eachItemGraphicEl(function(f,p){var d=s.getItemModel(p),g=f.childAt(0),m=f.childAt(1),v=f.childAt(2),_=s.getItemVisual(p,"style"),y=_.fill;o.add(f),g.useStyle(Ye(d.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:y})),Yr(g,d,"lineStyle"),Yr(m,d,"areaStyle");var x=d.getModel("areaStyle"),M=x.isEmpty()&&x.parentModel.isEmpty();m.ignore=M,N(["emphasis","select","blur"],function(T){var C=d.getModel([T,"areaStyle"]),b=C.isEmpty()&&C.parentModel.isEmpty();m.ensureState(T).ignore=b&&M}),m.useStyle(Ye(x.getAreaStyle(),{fill:y,opacity:.7,decal:_.decal}));var S=d.getModel("emphasis"),w=S.getModel("itemStyle").getItemStyle();v.eachChild(function(T){if(T instanceof Br){var C=T.style;T.useStyle(he({image:C.image,x:C.x,y:C.y,width:C.width,height:C.height},_))}else T.useStyle(_),T.setColor(y),T.style.strokeNoScale=!0;var b=T.ensureState("emphasis");b.style=Qe(w);var E=s.getStore().get(s.getDimensionIndex(T.__dimIdx),p);(E==null||isNaN(E))&&(E=""),Fr(T,Rr(d),{labelFetcher:s.hostModel,labelDataIndex:p,labelDimIndex:T.__dimIdx,defaultText:E,inheritColor:y,defaultOpacity:_.opacity})}),sr(f,S.get("focus"),S.get("blurScope"),S.get("disabled"))}),this._data=s},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.type="radar",e}(Zt),T9=Lve;var Dve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Du(Be(this.getData,this),Be(this.getRawData,this))},e.prototype.getInitialData=function(t,i){return us(this,{generateCoord:"indicator_",generateCoordCount:1/0})},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=this.coordinateSystem,s=o.getIndicatorAxes(),l=this.getData().getName(t),u=l===""?this.name:l,c=N1(this,t);return kr("section",{header:u,sortBlocks:!0,blocks:de(s,function(h){var f=a.get(a.mapDimension(h.dim),t);return kr("nameValue",{markerType:"subItem",markerColor:c,name:h.name,value:f,sortParam:f})})})},e.prototype.getTooltipPosition=function(t){if(t!=null){for(var i=this.getData(),n=this.coordinateSystem,a=i.getValues(de(n.dimensions,function(u){return i.mapDimension(u)}),t),o=0,s=a.length;o<s;o++)if(!isNaN(a[o])){var l=n.getIndicatorAxes();return n.coordToPoint(l[o].dataToCoord(a[o]),o)}}},e.type="series.radar",e.dependencies=["radar"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},e}($t),E9=Dve;var nS=YT.value;function QT(r,e){return Ye({show:e},r)}var Pve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){var t=this.get("boundaryGap"),i=this.get("splitNumber"),n=this.get("scale"),a=this.get("axisLine"),o=this.get("axisTick"),s=this.get("axisLabel"),l=this.get("axisName"),u=this.get(["axisName","show"]),c=this.get(["axisName","formatter"]),h=this.get("axisNameGap"),f=this.get("triggerEvent"),p=de(this.get("indicator")||[],function(d){d.max!=null&&d.max>0&&!d.min?d.min=0:d.min!=null&&d.min<0&&!d.max&&(d.max=0);var g=l;d.color!=null&&(g=Ye({color:d.color},l));var m=bt(Qe(d),{boundaryGap:t,splitNumber:i,scale:n,axisLine:a,axisTick:o,axisLabel:s,name:d.text,showName:u,nameLocation:"end",nameGap:h,nameTextStyle:g,triggerEvent:f},!1);if(Ce(c)){var v=m.name;m.name=c.replace("{value}",v??"")}else He(c)&&(m.name=c(m.name,m));var _=new Jt(m,null,this.ecModel);return Cr(_,wu.prototype),_.mainType="radar",_.componentIndex=this.componentIndex,_},this);this._indicatorModels=p},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:bt({lineStyle:{color:"#bbb"}},nS.axisLine),axisLabel:QT(nS.axisLabel,!1),axisTick:QT(nS.axisTick,!1),splitLine:QT(nS.splitLine,!0),splitArea:QT(nS.splitArea,!0),indicator:[]},e}(Nt),A9=Pve;var Ive=["axisLine","axisTickLabel","axisName"],Nve=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var i=t.coordinateSystem,n=i.getIndicatorAxes(),a=de(n,function(o){var s=o.model.get("showName")?o.name:"",l=new Nn(o.model,{axisName:s,position:[i.cx,i.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});N(a,function(o){N(Ive,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var i=t.coordinateSystem,n=i.getIndicatorAxes();if(!n.length)return;var a=t.get("shape"),o=t.getModel("splitLine"),s=t.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),h=s.get("show"),f=l.get("color"),p=u.get("color"),d=pe(f)?f:[f],g=pe(p)?p:[p],m=[],v=[];function _(P,U,B){var z=B%U.length;return P[z]=P[z]||[],z}if(a==="circle")for(var y=n[0].getTicksCoords(),x=i.cx,M=i.cy,S=0;S<y.length;S++){if(c){var w=_(m,d,S);m[w].push(new ga({shape:{cx:x,cy:M,r:y[S].coord}}))}if(h&&S<y.length-1){var w=_(v,g,S);v[w].push(new Gp({shape:{cx:x,cy:M,r0:y[S].coord,r:y[S+1].coord}}))}}else for(var T,C=de(n,function(P,U){var B=P.getTicksCoords();return T=T==null?B.length-1:Math.min(B.length-1,T),de(B,function(z){return i.coordToPoint(z.coord,U)})}),b=[],S=0;S<=T;S++){for(var E=[],I=0;I<n.length;I++)E.push(C[I][S]);if(E[0]&&E.push(E[0].slice()),c){var w=_(m,d,S);m[w].push(new ri({shape:{points:E}}))}if(h&&b){var w=_(v,g,S-1);v[w].push(new ai({shape:{points:E.concat(b)}}))}b=E.slice().reverse()}var R=l.getLineStyle(),A=u.getAreaStyle();N(v,function(P,U){this.group.add(Jn(P,{style:Ye({stroke:"none",fill:g[U%g.length]},A),silent:!0}))},this),N(m,function(P,U){this.group.add(Jn(P,{style:Ye({fill:"none",stroke:d[U%d.length]},R),silent:!0}))},this)},e.type="radar",e}(ir),C9=Nve;var Uve=function(r){Z(e,r);function e(t,i,n){var a=r.call(this,t,i,n)||this;return a.type="value",a.angle=0,a.name="",a}return e}(vn),R9=Uve;var Ove=function(){function r(e,t,i){this.dimensions=[],this._model=e,this._indicatorAxes=de(e.getIndicatorModels(),function(n,a){var o="indicator_"+a,s=new R9(o,new Do);return s.name=n.get("name"),s.model=n,n.axis=s,this.dimensions.push(o),s},this),this.resize(e,i)}return r.prototype.getIndicatorAxes=function(){return this._indicatorAxes},r.prototype.dataToPoint=function(e,t){var i=this._indicatorAxes[t];return this.coordToPoint(i.dataToCoord(e),t)},r.prototype.coordToPoint=function(e,t){var i=this._indicatorAxes[t],n=i.angle,a=this.cx+e*Math.cos(n),o=this.cy-e*Math.sin(n);return[a,o]},r.prototype.pointToData=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=Math.sqrt(t*t+i*i);t/=n,i/=n;for(var a=Math.atan2(-i,t),o=1/0,s,l=-1,u=0;u<this._indicatorAxes.length;u++){var c=this._indicatorAxes[u],h=Math.abs(a-c.angle);h<o&&(s=c,l=u,o=h)}return[l,+(s&&s.coordToData(n))]},r.prototype.resize=function(e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight(),o=Math.min(n,a)/2;this.cx=ze(i[0],n),this.cy=ze(i[1],a),this.startAngle=e.get("startAngle")*Math.PI/180;var s=e.get("radius");(Ce(s)||Dt(s))&&(s=[0,s]),this.r0=ze(s[0],o),this.r=ze(s[1],o),N(this._indicatorAxes,function(l,u){l.setExtent(this.r0,this.r);var c=this.startAngle+u*Math.PI*2/this._indicatorAxes.length;c=Math.atan2(Math.sin(c),Math.cos(c)),l.angle=c},this)},r.prototype.update=function(e,t){var i=this._indicatorAxes,n=this._model;N(i,function(s){s.scale.setExtent(1/0,-1/0)}),e.eachSeriesByType("radar",function(s,l){if(!(s.get("coordinateSystem")!=="radar"||e.getComponent("radar",s.get("radarIndex"))!==n)){var u=s.getData();N(i,function(c){c.scale.unionExtentFromData(u,u.mapDimension(c.dim))})}},this);var a=n.get("splitNumber"),o=new Do;o.setExtent(0,a),o.setInterval(1),N(i,function(s,l){ZT(s.scale,s.model,o)})},r.prototype.convertToPixel=function(e,t,i){return console.warn("Not implemented."),null},r.prototype.convertFromPixel=function(e,t,i){return console.warn("Not implemented."),null},r.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},r.create=function(e,t){var i=[];return e.eachComponent("radar",function(n){var a=new r(n,e,t);i.push(a),n.coordinateSystem=a}),e.eachSeriesByType("radar",function(n){n.get("coordinateSystem")==="radar"&&(n.coordinateSystem=i[n.get("radarIndex")||0])}),i},r.dimensions=[],r}(),L9=Ove;function D9(r){r.registerCoordinateSystem("radar",L9),r.registerComponentModel(A9),r.registerComponentView(C9),r.registerVisual({seriesType:"radar",reset:function(e){var t=e.getData();t.each(function(i){t.setItemVisual(i,"legendIcon","roundRect")}),t.setVisual("legendIcon","roundRect")}})}function mN(r){Ot(D9),r.registerChartView(T9),r.registerSeriesModel(E9),r.registerLayout(pN),r.registerProcessor(kl("radar")),r.registerPreprocessor(dN)}var P9="\0_ec_interaction_mutex";function I9(r,e,t){var i=gN(r);i[e]=t}function N9(r,e,t){var i=gN(r),n=i[e];n===t&&(i[e]=null)}function vN(r,e){return!!gN(r)[e]}function gN(r){return r[P9]||(r[P9]={})}xa({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},zr);var zve=function(r){Z(e,r);function e(t){var i=r.call(this)||this;i._zr=t;var n=Be(i._mousedownHandler,i),a=Be(i._mousemoveHandler,i),o=Be(i._mouseupHandler,i),s=Be(i._mousewheelHandler,i),l=Be(i._pinchHandler,i);return i.enable=function(u,c){this.disable(),this._opt=Ye(Qe(c)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),u==null&&(u=!0),(u===!0||u==="move"||u==="pan")&&(t.on("mousedown",n),t.on("mousemove",a),t.on("mouseup",o)),(u===!0||u==="scale"||u==="zoom")&&(t.on("mousewheel",s),t.on("pinch",l))},i.disable=function(){t.off("mousedown",n),t.off("mousemove",a),t.off("mouseup",o),t.off("mousewheel",s),t.off("pinch",l)},i}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!s2(t)){for(var i=t.target;i;){if(i.draggable)return;i=i.__hostTarget||i.parent}var n=t.offsetX,a=t.offsetY;this.pointerChecker&&this.pointerChecker(t,n,a)&&(this._x=n,this._y=a,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(!(!this._dragging||!eE("moveOnMouseMove",t,this._opt)||t.gestureEvent==="pinch"||vN(this._zr,"globalPan"))){var i=t.offsetX,n=t.offsetY,a=this._x,o=this._y,s=i-a,l=n-o;this._x=i,this._y=n,this._opt.preventDefaultMouseMove&&po(t.event),O9(this,"pan","moveOnMouseMove",t,{dx:s,dy:l,oldX:a,oldY:o,newX:i,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){s2(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var i=eE("zoomOnMouseWheel",t,this._opt),n=eE("moveOnMouseWheel",t,this._opt),a=t.wheelDelta,o=Math.abs(a),s=t.offsetX,l=t.offsetY;if(!(a===0||!i&&!n)){if(i){var u=o>3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;yN(this,"zoom","zoomOnMouseWheel",t,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(n){var h=Math.abs(a),f=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);yN(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!vN(this._zr,"globalPan")){var i=t.pinchScale>1?1.1:1/1.1;yN(this,"zoom",null,t,{scale:i,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(Ni);function yN(r,e,t,i,n){r.pointerChecker&&r.pointerChecker(i,n.originX,n.originY)&&(po(i.event),O9(r,e,t,i,n))}function O9(r,e,t,i,n){n.isAvailableBehavior=Be(eE,null,t,i),r.trigger(e,n)}function eE(r,e,t){var i=t[r];return!r||i&&(!Ce(i)||e.event[i+"Key"])}var Pu=zve;function Fv(r,e,t){var i=r.target;i.x+=e,i.y+=t,i.dirty()}function Bv(r,e,t,i){var n=r.target,a=r.zoomLimit,o=r.zoom=r.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/r.zoom;r.zoom=o,n.x-=(t-n.x)*(u-1),n.y-=(i-n.y)*(u-1),n.scaleX*=u,n.scaleY*=u,n.dirty()}var Fve={axisPointer:1,tooltip:1,brush:1};function Jh(r,e,t){var i=e.getComponentByElement(r.topTarget),n=i&&i.coordinateSystem;return i&&i!==t&&!Fve.hasOwnProperty(i.mainType)&&n&&n.model!==t}function tE(r){if(Ce(r)){var e=new DOMParser;r=e.parseFromString(r,"text/xml")}var t=r;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var xN,rE={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},z9=At(rE),iE={"alignment-baseline":"textBaseline","stop-color":"stopColor"},F9=At(iE),Bve=function(){function r(){this._defs={},this._root=null}return r.prototype.parse=function(e,t){t=t||{};var i=tE(e);this._defsUsePending=[];var n=new Ze;this._root=n;var a=[],o=i.getAttribute("viewBox")||"",s=parseFloat(i.getAttribute("width")||t.width),l=parseFloat(i.getAttribute("height")||t.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),cs(i,n,null,!0,!1);for(var u=i.firstChild;u;)this._parseNode(u,n,a,null,!1,!1),u=u.nextSibling;Gve(this._defs,this._defsUsePending),this._defsUsePending=[];var c,h;if(o){var f=nE(o);f.length>=4&&(c={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(c&&s!=null&&l!=null&&(h=MN(c,{x:0,y:0,width:s,height:l}),!t.ignoreViewBox)){var p=n;n=new Ze,n.add(p),p.scaleX=p.scaleY=h.scale,p.x=h.x,p.y=h.y}return!t.ignoreRootClip&&s!=null&&l!=null&&n.setClipPath(new Rt({shape:{x:0,y:0,width:s,height:l}})),{root:n,width:s,height:l,viewBoxRect:c,viewBoxTransform:h,named:a}},r.prototype._parseNode=function(e,t,i,n,a,o){var s=e.nodeName.toLowerCase(),l,u=n;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=t;else{if(!a){var c=xN[s];if(c&&tt(xN,s)){l=c.call(this,e,t);var h=e.getAttribute("name");if(h){var f={name:h,namedFrom:null,svgNodeTagLower:s,el:l};i.push(f),s==="g"&&(u=f)}else n&&i.push({name:n.name,namedFrom:n,svgNodeTagLower:s,el:l});t.add(l)}}var p=B9[s];if(p&&tt(B9,s)){var d=p.call(this,e),g=e.getAttribute("id");g&&(this._defs[g]=d)}}if(l&&l.isGroup)for(var m=e.firstChild;m;)m.nodeType===1?this._parseNode(m,l,i,u,a,o):m.nodeType===3&&o&&this._parseText(m,l),m=m.nextSibling},r.prototype._parseText=function(e,t){var i=new ac({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Zs(t,i),cs(e,i,this._defsUsePending,!1,!1),kve(i,t);var n=i.style,a=n.fontSize;a&&a<9&&(n.fontSize=9,i.scaleX*=a/9,i.scaleY*=a/9);var o=(n.fontSize||n.fontFamily)&&[n.fontStyle,n.fontWeight,(n.fontSize||12)+"px",n.fontFamily||"sans-serif"].join(" ");n.font=o;var s=i.getBoundingRect();return this._textX+=s.width,t.add(i),i},r.internalField=function(){xN={g:function(e,t){var i=new Ze;return Zs(t,i),cs(e,i,this._defsUsePending,!1,!1),i},rect:function(e,t){var i=new Rt;return Zs(t,i),cs(e,i,this._defsUsePending,!1,!1),i.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),i.silent=!0,i},circle:function(e,t){var i=new ga;return Zs(t,i),cs(e,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),i.silent=!0,i},line:function(e,t){var i=new ei;return Zs(t,i),cs(e,i,this._defsUsePending,!1,!1),i.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),i.silent=!0,i},ellipse:function(e,t){var i=new tx;return Zs(t,i),cs(e,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),i.silent=!0,i},polygon:function(e,t){var i=e.getAttribute("points"),n;i&&(n=G9(i));var a=new ai({shape:{points:n||[]},silent:!0});return Zs(t,a),cs(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var i=e.getAttribute("points"),n;i&&(n=G9(i));var a=new ri({shape:{points:n||[]},silent:!0});return Zs(t,a),cs(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var i=new Br;return Zs(t,i),cs(e,i,this._defsUsePending,!1,!1),i.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),i.silent=!0,i},text:function(e,t){var i=e.getAttribute("x")||"0",n=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(i)+parseFloat(a),this._textY=parseFloat(n)+parseFloat(o);var s=new Ze;return Zs(t,s),cs(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,t){var i=e.getAttribute("x"),n=e.getAttribute("y");i!=null&&(this._textX=parseFloat(i)),n!=null&&(this._textY=parseFloat(n));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new Ze;return Zs(t,s),cs(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,t){var i=e.getAttribute("d")||"",n=jw(i);return Zs(t,n),cs(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}}(),r}(),B9={lineargradient:function(r){var e=parseInt(r.getAttribute("x1")||"0",10),t=parseInt(r.getAttribute("y1")||"0",10),i=parseInt(r.getAttribute("x2")||"10",10),n=parseInt(r.getAttribute("y2")||"0",10),a=new xu(e,t,i,n);return k9(r,a),V9(r,a),a},radialgradient:function(r){var e=parseInt(r.getAttribute("cx")||"0",10),t=parseInt(r.getAttribute("cy")||"0",10),i=parseInt(r.getAttribute("r")||"0",10),n=new Qw(e,t,i);return k9(r,n),V9(r,n),n}};function k9(r,e){var t=r.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function V9(r,e){for(var t=r.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var i=t.getAttribute("offset"),n=void 0;i&&i.indexOf("%")>0?n=parseInt(i,10)/100:i?n=parseFloat(i):n=0;var a={};X9(t,a,a);var o=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:n,color:o})}t=t.nextSibling}}function Zs(r,e){r&&r.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),Ye(e.__inheritedStyle,r.__inheritedStyle))}function G9(r){for(var e=nE(r),t=[],i=0;i<e.length;i+=2){var n=parseFloat(e[i]),a=parseFloat(e[i+1]);t.push([n,a])}return t}function cs(r,e,t,i,n){var a=e,o=a.__inheritedStyle=a.__inheritedStyle||{},s={};r.nodeType===1&&(Xve(r,e),X9(r,o,s),i||Yve(r,o,s)),a.style=a.style||{},o.fill!=null&&(a.style.fill=H9(a,"fill",o.fill,t)),o.stroke!=null&&(a.style.stroke=H9(a,"stroke",o.stroke,t)),N(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(l){o[l]!=null&&(a.style[l]=parseFloat(o[l]))}),N(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],function(l){o[l]!=null&&(a.style[l]=o[l])}),n&&(a.__selfStyle=s),o.lineDash&&(a.style.lineDash=de(nE(o.lineDash),function(l){return parseFloat(l)})),(o.visibility==="hidden"||o.visibility==="collapse")&&(a.invisible=!0),o.display==="none"&&(a.ignore=!0)}function kve(r,e){var t=e.__selfStyle;if(t){var i=t.textBaseline,n=i;!i||i==="auto"||i==="baseline"?n="alphabetic":i==="before-edge"||i==="text-before-edge"?n="top":i==="after-edge"||i==="text-after-edge"?n="bottom":(i==="central"||i==="mathematical")&&(n="middle"),r.style.textBaseline=n}var a=e.__inheritedStyle;if(a){var o=a.textAlign,s=o;o&&(o==="middle"&&(s="center"),r.style.textAlign=s)}}var Vve=/^url\(\s*#(.*?)\)/;function H9(r,e,t,i){var n=t&&t.match(Vve);if(n){var a=Zi(n[1]);i.push([r,e,a]);return}return t==="none"&&(t=null),t}function Gve(r,e){for(var t=0;t<e.length;t++){var i=e[t];i[0].style[i[1]]=r[i[2]]}}var Hve=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function nE(r){return r.match(Hve)||[]}var Wve=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,SN=Math.PI/180;function Xve(r,e){var t=r.getAttribute("transform");if(t){t=t.replace(/,/g," ");var i=[],n=null;t.replace(Wve,function(h,f,p){return i.push(f,p),""});for(var a=i.length-1;a>0;a-=2){var o=i[a],s=i[a-1],l=nE(o);switch(n=n||Ci(),s){case"translate":Tn(n,n,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Fm(n,n,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":vo(n,n,-parseFloat(l[0])*SN,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*SN);mo(n,[1,0,u,1,0,0],n);break;case"skewY":var c=Math.tan(parseFloat(l[0])*SN);mo(n,[1,c,0,1,0,0],n);break;case"matrix":n[0]=parseFloat(l[0]),n[1]=parseFloat(l[1]),n[2]=parseFloat(l[2]),n[3]=parseFloat(l[3]),n[4]=parseFloat(l[4]),n[5]=parseFloat(l[5]);break}}e.setLocalTransform(n)}}var W9=/([^\s:;]+)\s*:\s*([^:;]+)/g;function X9(r,e,t){var i=r.getAttribute("style");if(i){W9.lastIndex=0;for(var n;(n=W9.exec(i))!=null;){var a=n[1],o=tt(rE,a)?rE[a]:null;o&&(e[o]=n[2]);var s=tt(iE,a)?iE[a]:null;s&&(t[s]=n[2])}}}function Yve(r,e,t){for(var i=0;i<z9.length;i++){var n=z9[i],a=r.getAttribute(n);a!=null&&(e[rE[n]]=a)}for(var i=0;i<F9.length;i++){var n=F9[i],a=r.getAttribute(n);a!=null&&(t[iE[n]]=a)}}function MN(r,e){var t=e.width/r.width,i=e.height/r.height,n=Math.min(t,i);return{scale:n,x:-(r.x+r.width/2)*n+(e.x+e.width/2),y:-(r.y+r.height/2)*n+(e.y+e.height/2)}}function Y9(r,e){var t=new Bve;return t.parse(r,e)}var qve=ke(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),q9=function(){function r(e,t){this.type="geoSVG",this._usedGraphicMap=ke(),this._freedGraphics=[],this._mapName=e,this._parsedXML=tE(t)}return r.prototype.load=function(){var e=this._firstGraphic;if(!e){e=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(e),this._boundingRect=this._firstGraphic.boundingRect.clone();var t=jve(e.named),i=t.regions,n=t.regionsMap;this._regions=i,this._regionsMap=n}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},r.prototype._buildGraphic=function(e){var t,i;try{t=e&&Y9(e,{ignoreViewBox:!0,ignoreRootClip:!0})||{},i=t.root,Wr(i!=null)}catch(m){throw new Error(`Invalid svg format
  2215. `+m.message)}var n=new Ze;n.add(i),n.isGeoSVGGraphicRoot=!0;var a=t.width,o=t.height,s=t.viewBoxRect,l=this._boundingRect;if(!l){var u=void 0,c=void 0,h=void 0,f=void 0;if(a!=null?(u=0,h=a):s&&(u=s.x,h=s.width),o!=null?(c=0,f=o):s&&(c=s.y,f=s.height),u==null||c==null){var p=i.getBoundingRect();u==null&&(u=p.x,h=p.width),c==null&&(c=p.y,f=p.height)}l=this._boundingRect=new ht(u,c,h,f)}if(s){var d=MN(s,l);i.scaleX=i.scaleY=d.scale,i.x=d.x,i.y=d.y}n.setClipPath(new Rt({shape:l.plain()}));var g=[];return N(t.named,function(m){qve.get(m.svgNodeTagLower)!=null&&(g.push(m),Zve(m.el))}),{root:n,boundingRect:l,named:g}},r.prototype.useGraphic=function(e){var t=this._usedGraphicMap,i=t.get(e);return i||(i=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,i),i)},r.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,i=t.get(e);i&&(t.removeKey(e),this._freedGraphics.push(i))},r}();function Zve(r){r.silent=!1,r.isGroup&&r.traverse(function(e){e.silent=!1})}function jve(r){var e=[],t=ke();return N(r,function(i){if(i.namedFrom==null){var n=new A8(i.name,i.el);e.push(n),t.set(i.name,n)}}),{regions:e,regionsMap:t}}var bN=[126,25],Z9="\u5357\u6D77\u8BF8\u5C9B",fd=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]];for($h=0;$h<fd.length;$h++)for(hd=0;hd<fd[$h].length;hd++)fd[$h][hd][0]/=10.5,fd[$h][hd][1]/=-10.5/.75,fd[$h][hd][0]+=bN[0],fd[$h][hd][1]+=bN[1];var hd,$h;function wN(r,e){if(r==="china"){for(var t=0;t<e.length;t++)if(e[t].name===Z9)return;e.push(new ST(Z9,de(fd,function(i){return{type:"polygon",exterior:i}}),bN))}}var Kve={\u5357\u6D77\u8BF8\u5C9B:[32,80],\u5E7F\u4E1C:[0,-10],\u9999\u6E2F:[10,5],\u6FB3\u95E8:[-10,10],\u5929\u6D25:[5,5]};function TN(r,e){if(r==="china"){var t=Kve[e.name];if(t){var i=e.getCenter();i[0]+=t[0]/10.5,i[1]+=-t[1]/(10.5/.75),e.setCenter(i)}}}var Jve=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];function EN(r,e){r==="china"&&e.name==="\u53F0\u6E7E"&&e.geometries.push({type:"polygon",exterior:Jve[0]})}var $ve="name",j9=function(){function r(e,t,i){this.type="geoJSON",this._parsedMap=ke(),this._mapName=e,this._specialAreas=i,this._geoJSON=ege(t)}return r.prototype.load=function(e,t){t=t||$ve;var i=this._parsedMap.get(t);if(!i){var n=this._parseToRegions(t);i=this._parsedMap.set(t,{regions:n,boundingRect:Qve(n)})}var a=ke(),o=[];return N(i.regions,function(s){var l=s.name;e&&tt(e,l)&&(s=s.cloneShallow(l=e[l])),o.push(s),a.set(l,s)}),{regions:o,boundingRect:i.boundingRect||new ht(0,0,0,0),regionsMap:a}},r.prototype._parseToRegions=function(e){var t=this._mapName,i=this._geoJSON,n;try{n=i?hI(i,e):[]}catch(a){throw new Error(`Invalid geoJson format
  2216. `+a.message)}return wN(t,n),N(n,function(a){var o=a.name;TN(t,a),EN(t,a);var s=this._specialAreas&&this._specialAreas[o];s&&a.transformTo(s.left,s.top,s.width,s.height)},this),n},r.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},r}();function Qve(r){for(var e,t=0;t<r.length;t++){var i=r[t].getBoundingRect();e=e||i.clone(),e.union(i)}return e}function ege(r){return Ce(r)?typeof JSON<"u"&&JSON.parse?JSON.parse(r):new Function("return ("+r+");")():r}var aS=ke(),wa={registerMap:function(r,e,t){if(e.svg){var i=new q9(r,e.svg);aS.set(r,i)}else{var n=e.geoJson||e.geoJSON;n&&!e.features?t=e.specialAreas:n=e;var i=new j9(r,n,t);aS.set(r,i)}},getGeoResource:function(r){return aS.get(r)},getMapForUser:function(r){var e=aS.get(r);return e&&e.type==="geoJSON"&&e.getMapForUser()},load:function(r,e,t){var i=aS.get(r);if(i)return i.load(e,t)}};var AN=["rect","circle","line","ellipse","polygon","polyline","path"],tge=ke(AN),rge=ke(AN.concat(["g"])),ige=ke(AN.concat(["g"])),i7=xt();function aE(r){var e=r.getItemStyle(),t=r.get("areaColor");return t!=null&&(e.fill=t),e}function K9(r){var e=r.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var nge=function(){function r(e){var t=new Ze;this.uid=Bs("ec_map_draw"),this._controller=new Pu(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new Ze),t.add(this._svgGroup=new Ze)}return r.prototype.draw=function(e,t,i,n,a){var o=e.mainType==="geo",s=e.getData&&e.getData();o&&t.eachComponent({mainType:"series",subType:"map"},function(v){!s&&v.getHostGeoModel()===e&&(s=v.getData())});var l=e.coordinateSystem,u=this._regionsGroup,c=this.group,h=l.getTransformInfo(),f=h.raw,p=h.roam,d=!u.childAt(0)||a;d?(c.x=p.x,c.y=p.y,c.scaleX=p.scaleX,c.scaleY=p.scaleY,c.dirty()):Ut(c,p,e);var g=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0,m={api:i,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:g,isGeo:o,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(m):l.resourceType==="geoSVG"&&this._buildSVG(m),this._updateController(e,t,i),this._updateMapSelectHandler(e,u,i,n)},r.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=ke(),i=ke(),n=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function c(p,d){return d&&(p=d(p)),p&&[p[0]*a.scaleX+a.x,p[1]*a.scaleY+a.y]}function h(p){for(var d=[],g=!u&&l&&l.project,m=0;m<p.length;++m){var v=c(p[m],g);v&&d.push(v)}return d}function f(p){return{shape:{points:h(p)}}}n.removeAll(),N(e.geo.regions,function(p){var d=p.name,g=t.get(d),m=i.get(d)||{},v=m.dataIdx,_=m.regionModel;g||(g=t.set(d,new Ze),n.add(g),v=s?s.indexOfName(d):null,_=e.isGeo?o.getRegionModel(d):s?s.getItemModel(v):null,i.set(d,{dataIdx:v,regionModel:_}));var y=[],x=[];N(p.geometries,function(w){if(w.type==="polygon"){var T=[w.exterior].concat(w.interiors||[]);u&&(T=r7(T,u)),N(T,function(b){y.push(new ai(f(b)))})}else{var C=w.points;u&&(C=r7(C,u,!0)),N(C,function(b){x.push(new ri(f(b)))})}});var M=c(p.getCenter(),l&&l.project);function S(w,T){if(w.length){var C=new uv({culling:!0,segmentIgnoreThreshold:1,shape:{paths:w}});g.add(C),J9(e,C,v,_),$9(e,C,d,_,o,v,M),T&&(K9(C),N(C.states,K9))}}S(y),S(x,!0)}),t.each(function(p,d){var g=i.get(d),m=g.dataIdx,v=g.regionModel;Q9(e,p,d,v,o,m),e7(e,p,d,v,o),t7(e,p,d,v,o)},this)},r.prototype._buildSVG=function(e){var t=e.geo.map,i=e.transformInfoRaw;this._svgGroup.x=i.x,this._svgGroup.y=i.y,this._svgGroup.scaleX=i.scaleX,this._svgGroup.scaleY=i.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var n=this._svgDispatcherMap=ke(),a=!1;N(this._svgGraphicRecord.named,function(o){var s=o.name,l=e.mapOrGeoModel,u=e.data,c=o.svgNodeTagLower,h=o.el,f=u?u.indexOfName(s):null,p=l.getRegionModel(s);if(tge.get(c)!=null&&h instanceof Si&&J9(e,h,f,p),h instanceof Si&&(h.culling=!0),h.z2EmphasisLift=0,!o.namedFrom&&(ige.get(c)!=null&&$9(e,h,s,p,l,f,null),Q9(e,h,s,p,l,f),e7(e,h,s,p,l),rge.get(c)!=null)){var d=t7(e,h,s,p,l);d==="self"&&(a=!0);var g=n.get(s)||n.set(s,[]);g.push(h)}},this),this._enableBlurEntireSVG(a,e)},r.prototype._enableBlurEntireSVG=function(e,t){if(e&&t.isGeo){var i=t.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle(),n=i.opacity;this._svgGraphicRecord.root.traverse(function(a){if(!a.isGroup){Ml(a);var o=a.ensureState("blur").style||{};o.opacity==null&&n!=null&&(o.opacity=n),a.ensureState("emphasis")}})}},r.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},r.prototype.findHighDownDispatchers=function(e,t){if(e==null)return[];var i=t.coordinateSystem;if(i.resourceType==="geoJSON"){var n=this._regionsGroupByName;if(n){var a=n.get(e);return a?[a]:[]}}else if(i.resourceType==="geoSVG")return this._svgDispatcherMap&&this._svgDispatcherMap.get(e)||[]},r.prototype._svgResourceChanged=function(e){return this._svgMapName!==e},r.prototype._useSVG=function(e){var t=wa.getGeoResource(e);if(t&&t.type==="geoSVG"){var i=t.useGraphic(this.uid);this._svgGroup.add(i.root),this._svgGraphicRecord=i,this._svgMapName=e}},r.prototype._freeSVG=function(){var e=this._svgMapName;if(e!=null){var t=wa.getGeoResource(e);t&&t.type==="geoSVG"&&t.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},r.prototype._updateController=function(e,t,i){var n=e.coordinateSystem,a=this._controller,o=this._controllerHost;o.zoomLimit=e.get("scaleLimit"),o.zoom=n.getZoom(),a.enable(e.get("roam")||!1);var s=e.mainType;function l(){var u={type:"geoRoam",componentType:s};return u[s+"Id"]=e.id,u}a.off("pan").on("pan",function(u){this._mouseDownFlag=!1,Fv(o,u.dx,u.dy),i.dispatchAction(he(l(),{dx:u.dx,dy:u.dy,animation:{duration:0}}))},this),a.off("zoom").on("zoom",function(u){this._mouseDownFlag=!1,Bv(o,u.scale,u.originX,u.originY),i.dispatchAction(he(l(),{zoom:u.scale,originX:u.originX,originY:u.originY,animation:{duration:0}}))},this),a.setPointerChecker(function(u,c,h){return n.containPoint([c,h])&&!Jh(u,i,e)})},r.prototype.resetForLabelLayout=function(){this.group.traverse(function(e){var t=e.getTextContent();t&&(t.ignore=i7(t).ignore)})},r.prototype._updateMapSelectHandler=function(e,t,i,n){var a=this;t.off("mousedown"),t.off("click"),e.get("selectedMode")&&(t.on("mousedown",function(){a._mouseDownFlag=!0}),t.on("click",function(o){a._mouseDownFlag&&(a._mouseDownFlag=!1)}))},r}();function J9(r,e,t,i){var n=i.getModel("itemStyle"),a=i.getModel(["emphasis","itemStyle"]),o=i.getModel(["blur","itemStyle"]),s=i.getModel(["select","itemStyle"]),l=aE(n),u=aE(a),c=aE(s),h=aE(o),f=r.data;if(f){var p=f.getItemVisual(t,"style"),d=f.getItemVisual(t,"decal");r.isVisualEncodedByVisualMap&&p.fill&&(l.fill=p.fill),d&&(l.decal=Il(d,r.api))}e.setStyle(l),e.style.strokeNoScale=!0,e.ensureState("emphasis").style=u,e.ensureState("select").style=c,e.ensureState("blur").style=h,Ml(e)}function $9(r,e,t,i,n,a,o){var s=r.data,l=r.isGeo,u=s&&isNaN(s.get(s.mapDimension("value"),a)),c=s&&s.getItemLayout(a);if(l||u||c&&c.showLabel){var h=l?t:a,f=void 0;(!s||a>=0)&&(f=n);var p=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Fr(e,Rr(i),{labelFetcher:f,labelDataIndex:h,defaultText:t},p);var d=e.getTextContent();if(d&&(i7(d).ignore=d.ignore,e.textConfig&&o)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function Q9(r,e,t,i,n,a){r.data?r.data.setItemGraphicEl(a,e):it(e).eventData={componentType:"geo",componentIndex:n.componentIndex,geoIndex:n.componentIndex,name:t,region:i&&i.option||{}}}function e7(r,e,t,i,n){r.data||El({el:e,componentModel:n,itemName:t,itemTooltipOption:i.get("tooltip")})}function t7(r,e,t,i,n){e.highDownSilentOnTouch=!!n.get("selectedMode");var a=i.getModel("emphasis"),o=a.get("focus");return sr(e,o,a.get("blurScope"),a.get("disabled")),r.isGeo&&R4(e,n,t),o}function r7(r,e,t){var i=[],n;function a(){n=[]}function o(){n.length&&(i.push(n),n=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&n.push([l,u])},sphere:function(){}});return!t&&s.polygonStart(),N(r,function(l){s.lineStart();for(var u=0;u<l.length;u++)s.point(l[u][0],l[u][1]);s.lineEnd()}),!t&&s.polygonEnd(),i}var oE=nge;var age=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var o=this.group;if(o.removeAll(),!t.getHostGeoModel()){if(this._mapDraw&&a&&a.type==="geoRoam"&&this._mapDraw.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===t.id){var s=this._mapDraw;s&&o.add(s.group)}else if(t.needsDrawMap){var s=this._mapDraw||new oE(n);o.add(s.group),s.draw(t,i,n,this,a),this._mapDraw=s}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&i.getComponent("legend")&&this._renderSymbols(t,i,n)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,i,n){var a=t.originalData,o=this.group;a.each(a.mapDimension("value"),function(s,l){if(!isNaN(s)){var u=a.getItemLayout(l);if(!(!u||!u.point)){var c=u.point,h=u.offset,f=new ga({style:{fill:t.getData().getVisual("style").fill},shape:{cx:c[0]+h*9,cy:c[1],r:3},silent:!0,z2:8+(h?0:oc+1)});if(!h){var p=t.mainSeries.getData(),d=a.getName(l),g=p.indexOfName(d),m=a.getItemModel(l),v=m.getModel("label"),_=p.getItemGraphicEl(g);Fr(f,Rr(m),{labelFetcher:{getFormattedLabel:function(y,x){return t.getFormattedLabel(g,x)}},defaultText:d}),f.disableLabelAnimation=!0,v.get("position")||f.setTextConfig({position:"bottom"}),_.onHoverStateChange=function(y){kp(f,y)}}o.add(f)}}})},e.type="map",e}(Zt),n7=age;var oge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.needsDrawMap=!1,t.seriesGroup=[],t.getTooltipPosition=function(i){if(i!=null){var n=this.getData().getName(i),a=this.coordinateSystem,o=a.getRegion(n);return o&&a.dataToPoint(o.getCenter())}},t}return e.prototype.getInitialData=function(t){for(var i=us(this,{coordDimensions:["value"],encodeDefaulter:ut(_v,this)}),n=ke(),a=[],o=0,s=i.count();o<s;o++){var l=i.getName(o);n.set(l,!0)}var u=wa.load(this.getMapType(),this.option.nameMap,this.option.nameProperty);return N(u.regions,function(c){var h=c.name;n.get(h)||a.push(h)}),i.appendValues([],a),i},e.prototype.getHostGeoModel=function(){var t=this.option.geoIndex;return t!=null?this.ecModel.getComponent("geo",t):null},e.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},e.prototype.getRawValue=function(t){var i=this.getData();return i.get(i.mapDimension("value"),t)},e.prototype.getRegionModel=function(t){var i=this.getData();return i.getItemModel(i.indexOfName(t))},e.prototype.formatTooltip=function(t,i,n){for(var a=this.getData(),o=this.getRawValue(t),s=a.getName(t),l=this.seriesGroup,u=[],c=0;c<l.length;c++){var h=l[c].originalData.indexOfName(s),f=a.mapDimension("value");isNaN(l[c].originalData.get(f,h))||u.push(l[c].name)}return kr("section",{header:u.join(", "),noHeader:!u.length,blocks:[kr("nameValue",{name:s,value:o})]})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.getLegendIcon=function(t){var i=t.icon||"roundRect",n=wr(i,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill);return n.setStyle(t.itemStyle),n.style.stroke="none",i.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}($t),a7=oge;function sge(r,e){var t={};return N(r,function(i){i.each(i.mapDimension("value"),function(n,a){var o="ec-"+i.getName(a);t[o]=t[o]||[],isNaN(n)||t[o].push(n)})}),r[0].map(r[0].mapDimension("value"),function(i,n){for(var a="ec-"+r[0].getName(n),o=0,s=1/0,l=-1/0,u=t[a].length,c=0;c<u;c++)s=Math.min(s,t[a][c]),l=Math.max(l,t[a][c]),o+=t[a][c];var h;return e==="min"?h=s:e==="max"?h=l:e==="average"?h=o/u:h=o,u===0?NaN:h})}function CN(r){var e={};r.eachSeriesByType("map",function(t){var i=t.getHostGeoModel(),n=i?"o"+i.id:"i"+t.getMapType();(e[n]=e[n]||[]).push(t)}),N(e,function(t,i){for(var n=sge(de(t,function(o){return o.getData()}),t[0].get("mapValueCalculation")),a=0;a<t.length;a++)t[a].originalData=t[a].getData();for(var a=0;a<t.length;a++)t[a].seriesGroup=t,t[a].needsDrawMap=a===0&&!t[a].getHostGeoModel(),t[a].setData(n.cloneShallow()),t[a].mainSeries=t[0]})}function RN(r){var e={};r.eachSeriesByType("map",function(t){var i=t.getMapType();if(!(t.getHostGeoModel()||e[i])){var n={};N(t.seriesGroup,function(o){var s=o.coordinateSystem,l=o.originalData;o.get("showLegendSymbol")&&r.getComponent("legend")&&l.each(l.mapDimension("value"),function(u,c){var h=l.getName(c),f=s.getRegion(h);if(!(!f||isNaN(u))){var p=n[h]||0,d=s.dataToPoint(f.getCenter());n[h]=p+1,l.setItemLayout(c,{point:d,offset:p})}})});var a=t.getData();a.each(function(o){var s=a.getName(o),l=a.getItemLayout(o)||{};l.showLabel=!n[s],a.setItemLayout(o,l)}),e[i]=!0}})}var o7=mi,lge=function(r){Z(e,r);function e(t){var i=r.call(this)||this;return i.type="view",i.dimensions=["x","y"],i._roamTransformable=new go,i._rawTransformable=new go,i.name=t,i}return e.prototype.setBoundingRect=function(t,i,n,a){return this._rect=new ht(t,i,n,a),this._rect},e.prototype.getBoundingRect=function(){return this._rect},e.prototype.setViewRect=function(t,i,n,a){this._transformTo(t,i,n,a),this._viewRect=new ht(t,i,n,a)},e.prototype._transformTo=function(t,i,n,a){var o=this.getBoundingRect(),s=this._rawTransformable;s.transform=o.calculateTransform(new ht(t,i,n,a));var l=s.parent;s.parent=null,s.decomposeTransform(),s.parent=l,this._updateTransform()},e.prototype.setCenter=function(t,i){t&&(this._center=[ze(t[0],i.getWidth()),ze(t[1],i.getHeight())],this._updateCenterAndZoom())},e.prototype.setZoom=function(t){t=t||1;var i=this.zoomLimit;i&&(i.max!=null&&(t=Math.min(i.max,t)),i.min!=null&&(t=Math.max(i.min,t))),this._zoom=t,this._updateCenterAndZoom()},e.prototype.getDefaultCenter=function(){var t=this.getBoundingRect(),i=t.x+t.width/2,n=t.y+t.height/2;return[i,n]},e.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},e.prototype.getZoom=function(){return this._zoom||1},e.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},e.prototype._updateCenterAndZoom=function(){var t=this._rawTransformable.getLocalTransform(),i=this._roamTransformable,n=this.getDefaultCenter(),a=this.getCenter(),o=this.getZoom();a=mi([],a,t),n=mi([],n,t),i.originX=a[0],i.originY=a[1],i.x=n[0]-a[0],i.y=n[1]-a[1],i.scaleX=i.scaleY=o,this._updateTransform()},e.prototype._updateTransform=function(){var t=this._roamTransformable,i=this._rawTransformable;i.parent=t,t.updateTransform(),i.updateTransform(),S_(this.transform||(this.transform=[]),i.transform||Ci()),this._rawTransform=i.getLocalTransform(),this.invTransform=this.invTransform||[],Ls(this.invTransform,this.transform),this.decomposeTransform()},e.prototype.getTransformInfo=function(){var t=this._rawTransformable,i=this._roamTransformable,n=new go;return n.transform=i.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY}}},e.prototype.getViewRect=function(){return this._viewRect},e.prototype.getViewRectAfterRoam=function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},e.prototype.dataToPoint=function(t,i,n){var a=i?this._rawTransform:this.transform;return n=n||[],a?o7(n,t,a):ji(n,t)},e.prototype.pointToData=function(t){var i=this.invTransform;return i?o7([],t,i):[t[0],t[1]]},e.prototype.convertToPixel=function(t,i,n){var a=s7(i);return a===this?a.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,i,n){var a=s7(i);return a===this?a.pointToData(n):null},e.prototype.containPoint=function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])},e.dimensions=["x","y"],e}(go);function s7(r){var e=r.seriesModel;return e?e.coordinateSystem:null}var bc=lge;var uge={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},LN=["lng","lat"],u7=function(r){Z(e,r);function e(t,i,n){var a=r.call(this,t)||this;a.dimensions=LN,a.type="geo",a._nameCoordMap=ke(),a.map=i;var o=n.projection,s=wa.load(i,n.nameMap,n.nameProperty),l=wa.getGeoResource(i),u=a.resourceType=l?l.type:null,c=a.regions=s.regions,h=uge[l.type];a._regionsMap=s.regionsMap,a.regions=s.regions,a.projection=o;var f;if(o)for(var p=0;p<c.length;p++){var d=c[p].getBoundingRect(o);f=f||d.clone(),f.union(d)}else f=s.boundingRect;return a.setBoundingRect(f.x,f.y,f.width,f.height),a.aspectScale=o?1:mt(n.aspectScale,h.aspectScale),a._invertLongitute=o?!1:h.invertLongitute,a}return e.prototype._transformTo=function(t,i,n,a){var o=this.getBoundingRect(),s=this._invertLongitute;o=o.clone(),s&&(o.y=-o.y-o.height);var l=this._rawTransformable;l.transform=o.calculateTransform(new ht(t,i,n,a));var u=l.parent;l.parent=null,l.decomposeTransform(),l.parent=u,s&&(l.scaleY=-l.scaleY),this._updateTransform()},e.prototype.getRegion=function(t){return this._regionsMap.get(t)},e.prototype.getRegionByCoord=function(t){for(var i=this.regions,n=0;n<i.length;n++){var a=i[n];if(a.type==="geoJSON"&&a.contain(t))return i[n]}},e.prototype.addGeoCoord=function(t,i){this._nameCoordMap.set(t,i)},e.prototype.getGeoCoord=function(t){var i=this._regionsMap.get(t);return this._nameCoordMap.get(t)||i&&i.getCenter()},e.prototype.dataToPoint=function(t,i,n){if(Ce(t)&&(t=this.getGeoCoord(t)),t){var a=this.projection;return a&&(t=a.project(t)),t&&this.projectedToPoint(t,i,n)}},e.prototype.pointToData=function(t){var i=this.projection;return i&&(t=i.unproject(t)),t&&this.pointToProjected(t)},e.prototype.pointToProjected=function(t){return r.prototype.pointToData.call(this,t)},e.prototype.projectedToPoint=function(t,i,n){return r.prototype.dataToPoint.call(this,t,i,n)},e.prototype.convertToPixel=function(t,i,n){var a=l7(i);return a===this?a.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,i,n){var a=l7(i);return a===this?a.pointToData(n):null},e}(bc);Cr(u7,bc);function l7(r){var e=r.geoModel,t=r.seriesModel;return e?e.coordinateSystem:t?t.coordinateSystem||(t.getReferringComponents("geo",Ir).models[0]||{}).coordinateSystem:null}var DN=u7;function c7(r,e){var t=r.get("boundingCoords");if(t!=null){var i=t[0],n=t[1];if(isFinite(i[0])&&isFinite(i[1])&&isFinite(n[0])&&isFinite(n[1])){var a=this.projection;if(a){var o=i[0],s=i[1],l=n[0],u=n[1];i=[1/0,1/0],n=[-1/0,-1/0];var c=function(S,w,T,C){for(var b=T-S,E=C-w,I=0;I<=100;I++){var R=I/100,A=a.project([S+b*R,w+E*R]);$o(i,i,A),Qo(n,n,A)}};c(o,s,l,s),c(l,s,l,u),c(l,u,o,u),c(o,u,l,s)}this.setBoundingRect(i[0],i[1],n[0]-i[0],n[1]-i[1])}}var h=this.getBoundingRect(),f=r.get("layoutCenter"),p=r.get("layoutSize"),d=e.getWidth(),g=e.getHeight(),m=h.width/h.height*this.aspectScale,v=!1,_,y;f&&p&&(_=[ze(f[0],d),ze(f[1],g)],y=ze(p,Math.min(d,g)),!isNaN(_[0])&&!isNaN(_[1])&&!isNaN(y)&&(v=!0));var x;if(v)x={},m>1?(x.width=y,x.height=y/m):(x.height=y,x.width=y*m),x.y=_[1]-x.height/2,x.x=_[0]-x.width/2;else{var M=r.getBoxLayoutParams();M.aspect=m,x=br(M,{width:d,height:g})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(r.get("center"),e),this.setZoom(r.get("zoom"))}function cge(r,e){N(e.get("geoCoord"),function(t,i){r.addGeoCoord(i,t)})}var hge=function(){function r(){this.dimensions=LN}return r.prototype.create=function(e,t){var i=[];function n(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}e.eachComponent("geo",function(o,s){var l=o.get("map"),u=new DN(l+s,l,he({nameMap:o.get("nameMap")},n(o)));u.zoomLimit=o.get("scaleLimit"),i.push(u),o.coordinateSystem=u,u.model=o,u.resize=c7,u.resize(o,t)}),e.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=i[l]}});var a={};return e.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),N(a,function(o,s){var l=de(o,function(c){return c.get("nameMap")}),u=new DN(s,s,he({nameMap:Dm(l)},n(o[0])));u.zoomLimit=Hr.apply(null,de(o,function(c){return c.get("scaleLimit")})),i.push(u),u.resize=c7,u.resize(o[0],t),N(o,function(c){c.coordinateSystem=u,cge(u,c)})}),i},r.prototype.getFilledRegions=function(e,t,i,n){for(var a=(e||[]).slice(),o=ke(),s=0;s<a.length;s++)o.set(a[s].name,a[s]);var l=wa.load(t,i,n);return N(l.regions,function(u){var c=u.name;!o.get(c)&&a.push({name:c})}),a},r}(),fge=new hge,sE=fge;var pge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i,n){var a=wa.getGeoResource(t.map);if(a&&a.type==="geoJSON"){var o=t.itemStyle=t.itemStyle||{};"color"in o||(o.color="#eee")}this.mergeDefaultAndTheme(t,n),rs(t,"label",["show"])},e.prototype.optionUpdated=function(){var t=this,i=this.option;i.regions=sE.getFilledRegions(i.regions,i.map,i.nameMap,i.nameProperty);var n={};this._optionModelMap=bn(i.regions||[],function(a,o){var s=o.name;return s&&(a.set(s,new Jt(o,t,t.ecModel)),o.selected&&(n[s]=!0)),a},ke()),i.selectedMap||(i.selectedMap=n)},e.prototype.getRegionModel=function(t){return this._optionModelMap.get(t)||new Jt(null,this,this.ecModel)},e.prototype.getFormattedLabel=function(t,i){var n=this.getRegionModel(t),a=i==="normal"?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),o={name:t};if(He(a))return o.status=i,a(o);if(Ce(a))return a.replace("{a}",t??"")},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.select=function(t){var i=this.option,n=i.selectedMode;if(n){n!=="multiple"&&(i.selectedMap=null);var a=i.selectedMap||(i.selectedMap={});a[t]=!0}},e.prototype.unSelect=function(t){var i=this.option.selectedMap;i&&(i[t]=!1)},e.prototype.toggleSelected=function(t){this[this.isSelected(t)?"unSelect":"select"](t)},e.prototype.isSelected=function(t){var i=this.option.selectedMap;return!!(i&&i[t])},e.type="geo",e.layoutMode="box",e.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},e}(Nt),h7=pge;function f7(r,e){return r.pointToProjected?r.pointToProjected(e):r.pointToData(e)}function kv(r,e,t,i){var n=r.getZoom(),a=r.getCenter(),o=e.zoom,s=r.projectedToPoint?r.projectedToPoint(a):r.dataToPoint(a);if(e.dx!=null&&e.dy!=null&&(s[0]-=e.dx,s[1]-=e.dy,r.setCenter(f7(r,s),i)),o!=null){if(t){var l=t.min||0,u=t.max||1/0;o=Math.max(Math.min(n*o,u),l)/n}r.scaleX*=o,r.scaleY*=o;var c=(e.originX-r.x)*(o-1),h=(e.originY-r.y)*(o-1);r.x-=c,r.y-=h,r.updateTransform(),r.setCenter(f7(r,s),i),r.setZoom(o*n)}return{center:r.getCenter(),zoom:r.getZoom()}}var dge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.focusBlurEnabled=!0,t}return e.prototype.init=function(t,i){this._api=i},e.prototype.render=function(t,i,n,a){if(this._model=t,!t.get("show")){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;return}this._mapDraw||(this._mapDraw=new oE(n));var o=this._mapDraw;o.draw(t,i,n,this,a),o.group.on("click",this._handleRegionClick,this),o.group.silent=t.get("silent"),this.group.add(o.group),this.updateSelectStatus(t,i,n)},e.prototype._handleRegionClick=function(t){var i;Dl(t.target,function(n){return(i=it(n).eventData)!=null},!0),i&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:i.name})},e.prototype.updateSelectStatus=function(t,i,n){var a=this;this._mapDraw.group.traverse(function(o){var s=it(o).eventData;if(s)return a._model.isSelected(s.name)?n.enterSelect(o):n.leaveSelect(o),!0})},e.prototype.findHighDownDispatchers=function(t){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(t,this._model)},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},e.type="geo",e}(ir),p7=dge;function mge(r,e,t){wa.registerMap(r,e,t)}function oS(r){r.registerCoordinateSystem("geo",sE),r.registerComponentModel(h7),r.registerComponentView(p7),r.registerImpl("registerMap",mge),r.registerImpl("getMap",function(t){return wa.getMapForUser(t)});function e(t,i){i.update="geo:updateSelectStatus",r.registerAction(i,function(n,a){var o={},s=[];return a.eachComponent({mainType:"geo",query:n},function(l){l[t](n.name);var u=l.coordinateSystem;N(u.regions,function(h){o[h.name]=l.isSelected(h.name)||!1});var c=[];N(o,function(h,f){o[f]&&c.push(f)}),s.push({geoIndex:l.componentIndex,name:c})}),{selected:o,allSelected:s,name:n.name}})}e("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),e("select",{type:"geoSelect",event:"geoselected"}),e("unSelect",{type:"geoUnSelect",event:"geounselected"}),r.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,i,n){var a=t.componentType||"series";i.eachComponent({mainType:a,query:t},function(o){var s=o.coordinateSystem;if(s.type==="geo"){var l=kv(s,t,o.get("scaleLimit"),n);o.setCenter&&o.setCenter(l.center),o.setZoom&&o.setZoom(l.zoom),a==="series"&&N(o.seriesGroup,function(u){u.setCenter(l.center),u.setZoom(l.zoom)})}})})}function PN(r){Ot(oS),r.registerChartView(n7),r.registerSeriesModel(a7),r.registerLayout(RN),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,CN),X1("map",r.registerAction)}function d7(r){var e=r;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var t=[e],i,n;i=t.pop();)if(n=i.children,i.isExpand&&n.length)for(var a=n.length,o=a-1;o>=0;o--){var s=n[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},t.push(s)}}function m7(r,e){var t=r.isExpand?r.children:[],i=r.parentNode.children,n=r.hierNode.i?i[r.hierNode.i-1]:null;if(t.length){vge(r);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;n?(r.hierNode.prelim=n.hierNode.prelim+e(r,n),r.hierNode.modifier=r.hierNode.prelim-a):r.hierNode.prelim=a}else n&&(r.hierNode.prelim=n.hierNode.prelim+e(r,n));r.parentNode.hierNode.defaultAncestor=gge(r,n,r.parentNode.hierNode.defaultAncestor||i[0],e)}function v7(r){var e=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:e},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function UN(r){return arguments.length?r:xge}function pd(r,e){return r-=Math.PI/2,{x:e*Math.cos(r),y:e*Math.sin(r)}}function g7(r,e){return br(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function vge(r){for(var e=r.children,t=e.length,i=0,n=0;--t>=0;){var a=e[t];a.hierNode.prelim+=i,a.hierNode.modifier+=i,n+=a.hierNode.change,i+=a.hierNode.shift+n}}function gge(r,e,t,i){if(e){for(var n=r,a=r,o=a.parentNode.children[0],s=e,l=n.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,h=s.hierNode.modifier;s=IN(s),a=NN(a),s&&a;){n=IN(n),o=NN(o),n.hierNode.ancestor=r;var f=s.hierNode.prelim+h-a.hierNode.prelim-u+i(s,a);f>0&&(_ge(yge(s,r,t),r,f),u+=f,l+=f),h+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=n.hierNode.modifier,c+=o.hierNode.modifier}s&&!IN(n)&&(n.hierNode.thread=s,n.hierNode.modifier+=h-l),a&&!NN(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,t=r)}return t}function IN(r){var e=r.children;return e.length&&r.isExpand?e[e.length-1]:r.hierNode.thread}function NN(r){var e=r.children;return e.length&&r.isExpand?e[0]:r.hierNode.thread}function yge(r,e,t){return r.hierNode.ancestor.parentNode===e.parentNode?r.hierNode.ancestor:t}function _ge(r,e,t){var i=t/(e.hierNode.i-r.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,r.hierNode.change+=i}function xge(r,e){return r.parentNode===e.parentNode?1:2}var Sge=function(){function r(){this.parentPoint=[],this.childPoints=[]}return r}(),Mge=function(r){Z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Sge},e.prototype.buildPath=function(t,i){var n=i.childPoints,a=n.length,o=i.parentPoint,s=n[0],l=n[a-1];if(a===1){t.moveTo(o[0],o[1]),t.lineTo(s[0],s[1]);return}var u=i.orient,c=u==="TB"||u==="BT"?0:1,h=1-c,f=ze(i.forkPosition,1),p=[];p[c]=o[c],p[h]=o[h]+(l[h]-o[h])*f,t.moveTo(o[0],o[1]),t.lineTo(p[0],p[1]),t.moveTo(s[0],s[1]),p[c]=s[c],t.lineTo(p[0],p[1]),p[c]=l[c],t.lineTo(p[0],p[1]),t.lineTo(l[0],l[1]);for(var d=1;d<a-1;d++){var g=n[d];t.moveTo(g[0],g[1]),p[c]=g[c],t.lineTo(p[0],p[1])}},e}(pt),bge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._mainGroup=new Ze,t}return e.prototype.init=function(t,i){this._controller=new Pu(i.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},e.prototype.render=function(t,i,n){var a=t.getData(),o=t.layoutInfo,s=this._mainGroup,l=t.get("layout");l==="radial"?(s.x=o.x+o.width/2,s.y=o.y+o.height/2):(s.x=o.x,s.y=o.y),this._updateViewCoordSys(t,n),this._updateController(t,i,n);var u=this._data;a.diff(u).add(function(c){y7(a,c)&&_7(a,c,null,s,t)}).update(function(c,h){var f=u.getItemGraphicEl(h);if(!y7(a,c)){f&&S7(u,h,f,s,t);return}_7(a,c,f,s,t)}).remove(function(c){var h=u.getItemGraphicEl(c);h&&S7(u,c,h,s,t)}).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),t.get("expandAndCollapse")===!0&&a.eachItemGraphicEl(function(c,h){c.off("click").on("click",function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:h})})}),this._data=a},e.prototype._updateViewCoordSys=function(t,i){var n=t.getData(),a=[];n.each(function(h){var f=n.getItemLayout(h);f&&!isNaN(f.x)&&!isNaN(f.y)&&a.push([+f.x,+f.y])});var o=[],s=[];Ip(a,o,s);var l=this._min,u=this._max;s[0]-o[0]===0&&(o[0]=l?l[0]:o[0]-1,s[0]=u?u[0]:s[0]+1),s[1]-o[1]===0&&(o[1]=l?l[1]:o[1]-1,s[1]=u?u[1]:s[1]+1);var c=t.coordinateSystem=new bc;c.zoomLimit=t.get("scaleLimit"),c.setBoundingRect(o[0],o[1],s[0]-o[0],s[1]-o[1]),c.setCenter(t.get("center"),i),c.setZoom(t.get("zoom")),this.group.attr({x:c.x,y:c.y,scaleX:c.scaleX,scaleY:c.scaleY}),this._min=o,this._max=s},e.prototype._updateController=function(t,i,n){var a=this,o=this._controller,s=this._controllerHost,l=this.group;o.setPointerChecker(function(u,c,h){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(c,h)&&!Jh(u,n,t)}),o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){Fv(s,u.dx,u.dy),n.dispatchAction({seriesId:t.id,type:"treeRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){Bv(s,u.scale,u.originX,u.originY),n.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(t),n.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(t){var i=t.getData(),n=this._getNodeGlobalScale(t);i.eachItemGraphicEl(function(a,o){a.setSymbolScale(n)})},e.prototype._getNodeGlobalScale=function(t){var i=t.coordinateSystem;if(i.type!=="view")return 1;var n=this._nodeScaleRatio,a=i.scaleX||1,o=i.getZoom(),s=(o-1)*n+1;return s/a},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},e.type="tree",e}(Zt);function y7(r,e){var t=r.getItemLayout(e);return t&&!isNaN(t.x)&&!isNaN(t.y)}function _7(r,e,t,i,n){var a=!t,o=r.tree.getNodeByDataIndex(e),s=o.getModel(),l=o.getVisual("style").fill,u=o.isExpand===!1&&o.children.length!==0?l:"#fff",c=r.tree.root,h=o.parentNode===c?o:o.parentNode||o,f=r.getItemGraphicEl(h.dataIndex),p=h.getLayout(),d=f?{x:f.__oldX,y:f.__oldY,rawX:f.__radialOldRawX,rawY:f.__radialOldRawY}:p,g=o.getLayout();a?(t=new Mc(r,e,null,{symbolInnerColor:u,useNameLabel:!0}),t.x=d.x,t.y=d.y):t.updateData(r,e,null,{symbolInnerColor:u,useNameLabel:!0}),t.__radialOldRawX=t.__radialRawX,t.__radialOldRawY=t.__radialRawY,t.__radialRawX=g.rawX,t.__radialRawY=g.rawY,i.add(t),r.setItemGraphicEl(e,t),t.__oldX=t.x,t.__oldY=t.y,Ut(t,{x:g.x,y:g.y},n);var m=t.getSymbolPath();if(n.get("layout")==="radial"){var v=c.children[0],_=v.getLayout(),y=v.children.length,x=void 0,M=void 0;if(g.x===_.x&&o.isExpand===!0&&v.children.length){var S={x:(v.children[0].getLayout().x+v.children[y-1].getLayout().x)/2,y:(v.children[0].getLayout().y+v.children[y-1].getLayout().y)/2};x=Math.atan2(S.y-_.y,S.x-_.x),x<0&&(x=Math.PI*2+x),M=S.x<_.x,M&&(x=x-Math.PI)}else x=Math.atan2(g.y-_.y,g.x-_.x),x<0&&(x=Math.PI*2+x),o.children.length===0||o.children.length!==0&&o.isExpand===!1?(M=g.x<_.x,M&&(x=x-Math.PI)):(M=g.x>_.x,M||(x=x-Math.PI));var w=M?"left":"right",T=s.getModel("label"),C=T.get("rotate"),b=C*(Math.PI/180),E=m.getTextContent();E&&(m.setTextConfig({position:T.get("position")||w,rotation:C==null?-x:b,origin:"center"}),E.setStyle("verticalAlign","middle"))}var I=s.get(["emphasis","focus"]),R=I==="relative"?hp(o.getAncestorsIndices(),o.getDescendantIndices()):I==="ancestor"?o.getAncestorsIndices():I==="descendant"?o.getDescendantIndices():null;R&&(it(t).focus=R),wge(n,o,c,t,d,p,g,i),t.__edge&&(t.onHoverStateChange=function(A){if(A!=="blur"){var P=o.parentNode&&r.getItemGraphicEl(o.parentNode.dataIndex);P&&P.hoverState===Bp||kp(t.__edge,A)}})}function wge(r,e,t,i,n,a,o,s){var l=e.getModel(),u=r.get("edgeShape"),c=r.get("layout"),h=r.getOrient(),f=r.get(["lineStyle","curveness"]),p=r.get("edgeForkPosition"),d=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(g||(g=i.__edge=new Hp({shape:ON(c,h,f,n,n)})),Ut(g,{shape:ON(c,h,f,a,o)},r));else if(u==="polyline"&&c==="orthogonal"&&e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var m=e.children,v=[],_=0;_<m.length;_++){var y=m[_].getLayout();v.push([y.x,y.y])}g||(g=i.__edge=new Mge({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:h,forkPosition:p}})),Ut(g,{shape:{parentPoint:[o.x,o.y],childPoints:v}},r)}g&&!(u==="polyline"&&!e.isExpand)&&(g.useStyle(Ye({strokeNoScale:!0,fill:null},d)),Yr(g,l,"lineStyle"),Ml(g),s.add(g))}function x7(r,e,t,i,n){var a=e.tree.root,o=M7(a,r),s=o.source,l=o.sourceLayout,u=e.getItemGraphicEl(r.dataIndex);if(u){var c=e.getItemGraphicEl(s.dataIndex),h=c.__edge,f=u.__edge||(s.isExpand===!1||s.children.length===1?h:void 0),p=i.get("edgeShape"),d=i.get("layout"),g=i.get("orient"),m=i.get(["lineStyle","curveness"]);f&&(p==="curve"?Fs(f,{shape:ON(d,g,m,l,l),style:{opacity:0}},i,{cb:function(){t.remove(f)},removeOpt:n}):p==="polyline"&&i.get("layout")==="orthogonal"&&Fs(f,{shape:{parentPoint:[l.x,l.y],childPoints:[[l.x,l.y]]},style:{opacity:0}},i,{cb:function(){t.remove(f)},removeOpt:n}))}}function M7(r,e){for(var t=e.parentNode===r?e:e.parentNode||e,i;i=t.getLayout(),i==null;)t=t.parentNode===r?t:t.parentNode||t;return{source:t,sourceLayout:i}}function S7(r,e,t,i,n){var a=r.tree.getNodeByDataIndex(e),o=r.tree.root,s=M7(o,a).sourceLayout,l={duration:n.get("animationDurationUpdate"),easing:n.get("animationEasingUpdate")};Fs(t,{x:s.x+1,y:s.y+1},n,{cb:function(){i.remove(t),r.setItemGraphicEl(e,null)},removeOpt:l}),t.fadeOut(null,r.hostModel,{fadeLabel:!0,animation:l}),a.children.forEach(function(u){x7(u,r,i,n,l)}),x7(a,r,i,n,l)}function ON(r,e,t,i,n){var a,o,s,l,u,c,h,f;if(r==="radial"){u=i.rawX,h=i.rawY,c=n.rawX,f=n.rawY;var p=pd(u,h),d=pd(u,h+(f-h)*t),g=pd(c,f+(h-f)*t),m=pd(c,f);return{x1:p.x||0,y1:p.y||0,x2:m.x||0,y2:m.y||0,cpx1:d.x||0,cpy1:d.y||0,cpx2:g.x||0,cpy2:g.y||0}}else u=i.x,h=i.y,c=n.x,f=n.y,(e==="LR"||e==="RL")&&(a=u+(c-u)*t,o=h,s=c+(u-c)*t,l=f),(e==="TB"||e==="BT")&&(a=u,o=h+(f-h)*t,s=c,l=f+(h-f)*t);return{x1:u,y1:h,x2:c,y2:f,cpx1:a,cpy1:o,cpx2:s,cpy2:l}}var b7=bge;var js=xt();function Tge(r){var e=r.mainData,t=r.datas;t||(t={main:e},r.datasAttr={main:"data"}),r.datas=r.mainData=null,w7(e,t,r),N(t,function(i){N(e.TRANSFERABLE_METHODS,function(n){i.wrapMethod(n,ut(Ege,r))})}),e.wrapMethod("cloneShallow",ut(Cge,r)),N(e.CHANGABLE_METHODS,function(i){e.wrapMethod(i,ut(Age,r))}),Wr(t[e.dataType]===e)}function Ege(r,e){if(Dge(this)){var t=he({},js(this).datas);t[this.dataType]=e,w7(e,t,r)}else zN(e,this.dataType,js(this).mainData,r);return e}function Age(r,e){return r.struct&&r.struct.update(),e}function Cge(r,e){return N(js(e).datas,function(t,i){t!==e&&zN(t.cloneShallow(),i,e,r)}),e}function Rge(r){var e=js(this).mainData;return r==null||e==null?e:js(e).datas[r]}function Lge(){var r=js(this).mainData;return r==null?[{data:r}]:de(At(js(r).datas),function(e){return{type:e,data:js(r).datas[e]}})}function Dge(r){return js(r).mainData===r}function w7(r,e,t){js(r).datas={},N(e,function(i,n){zN(i,n,r,t)})}function zN(r,e,t,i){js(t).datas[e]=r,js(r).mainData=t,r.dataType=e,i.struct&&(r[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=r),r.getLinkedData=Rge,r.getLinkedDataAll=Lge}var lE=Tge;var Pge=function(){function r(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||"",this.hostTree=t}return r.prototype.isRemoved=function(){return this.dataIndex<0},r.prototype.eachNode=function(e,t,i){He(e)&&(i=t,t=e,e=null),e=e||{},Ce(e)&&(e={order:e});var n=e.order||"preorder",a=this[e.attr||"children"],o;n==="preorder"&&(o=t.call(i,this));for(var s=0;!o&&s<a.length;s++)a[s].eachNode(e,t,i);n==="postorder"&&t.call(i,this)},r.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(e+1),n.height>t&&(t=n.height)}this.height=t+1},r.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t<n;t++){var a=i[t].getNodeById(e);if(a)return a}},r.prototype.contains=function(e){if(e===this)return!0;for(var t=0,i=this.children,n=i.length;t<n;t++){var a=i[t].contains(e);if(a)return a}},r.prototype.getAncestors=function(e){for(var t=[],i=e?this:this.parentNode;i;)t.push(i),i=i.parentNode;return t.reverse(),t},r.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},r.prototype.getDescendantIndices=function(){var e=[];return this.eachNode(function(t){e.push(t.dataIndex)}),e},r.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||"value"),this.dataIndex)},r.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,i=t.data.getItemModel(this.dataIndex);return i.getModel(e)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},r.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},r.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},r.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},r}();var Ige=function(){function r(e){this.type="tree",this._nodes=[],this.hostModel=e}return r.prototype.eachNode=function(e,t,i){this.root.eachNode(e,t,i)},r.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},r.prototype.getNodeById=function(e){return this.root.getNodeById(e)},r.prototype.update=function(){for(var e=this.data,t=this._nodes,i=0,n=t.length;i<n;i++)t[i].dataIndex=-1;for(var i=0,n=e.count();i<n;i++)t[e.getRawIndex(i)].dataIndex=i},r.prototype.clearLayouts=function(){this.data.clearItemLayouts()},r.createTree=function(e,t,i){var n=new r(t),a=[],o=1;s(e);function s(c,h){var f=c.value;o=Math.max(o,pe(f)?f.length:1),a.push(c);var p=new Pge(Kr(c.name,""),n);h?Nge(p,h):n.root=p,n._nodes.push(p);var d=c.children;if(d)for(var g=0;g<d.length;g++)s(d[g],p)}n.root.updateDepthAndHeight(0);var l=Nl(a,{coordDimensions:["value"],dimensionsCount:o}).dimensions,u=new oi(l,t);return u.initData(a),i&&i(u),lE({mainData:u,struct:n,structAttr:"tree"}),n.update(),n},r}();function Nge(r,e){var t=e.children;r.parentNode!==e&&(t.push(r),r.parentNode=e)}var Vv=Ige;function wc(r,e,t){if(r&&yt(e,r.type)>=0){var i=t.getData().tree.root,n=r.targetNode;if(Ce(n)&&(n=i.getNodeById(n)),n&&i.contains(n))return{node:n};var a=r.targetNodeId;if(a!=null&&(n=i.getNodeById(a)))return{node:n}}}function FN(r){for(var e=[];r;)r=r.parentNode,r&&e.push(r);return e.reverse()}function Gv(r,e){var t=FN(r);return yt(t,e)>=0}function Qh(r,e){for(var t=[];r;){var i=r.dataIndex;t.push({name:r.name,dataIndex:i,value:e.getRawValue(i)}),r=r.parentNode}return t.reverse(),t}var Uge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var i={name:t.name,children:t.data},n=t.leaves||{},a=new Jt(n,this,this.ecModel),o=Vv.createTree(i,this,s);function s(h){h.wrapMethod("getItemModel",function(f,p){var d=o.getNodeByDataIndex(p);return d&&d.children.length&&d.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(h){h.depth>l&&(l=h.depth)});var u=t.expandAndCollapse,c=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return o.root.eachNode("preorder",function(h){var f=h.hostTree.data.getRawDataItem(h.dataIndex);h.isExpand=f&&f.collapsed!=null?!f.collapsed:h.depth<=c}),o.data},e.prototype.getOrient=function(){var t=this.get("orient");return t==="horizontal"?t="LR":t==="vertical"&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,i,n){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(t),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return kr("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treeAncestors=Qh(n,this),i.collapsed=!n.isExpand,i},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}($t),T7=Uge;function E7(r,e,t){for(var i=[r],n=[],a;a=i.pop();)if(n.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s<o.length;s++)i.push(o[s])}for(;a=n.pop();)e(a,t)}function Hv(r,e){for(var t=[r],i;i=t.pop();)if(e(i),i.isExpand){var n=i.children;if(n.length)for(var a=n.length-1;a>=0;a--)t.push(n[a])}}function kN(r,e){r.eachSeriesByType("tree",function(t){Oge(t,e)})}function Oge(r,e){var t=g7(r,e);r.layoutInfo=t;var i=r.get("layout"),n=0,a=0,o=null;i==="radial"?(n=2*Math.PI,a=Math.min(t.height,t.width)/2,o=UN(function(y,x){return(y.parentNode===x.parentNode?1:2)/y.depth})):(n=t.width,a=t.height,o=UN());var s=r.getData().tree.root,l=s.children[0];if(l){d7(s),E7(l,m7,o),s.hierNode.modifier=-l.hierNode.prelim,Hv(l,v7);var u=l,c=l,h=l;Hv(l,function(y){var x=y.getLayout().x;x<u.getLayout().x&&(u=y),x>c.getLayout().x&&(c=y),y.depth>h.depth&&(h=y)});var f=u===c?1:o(u,c)/2,p=f-u.getLayout().x,d=0,g=0,m=0,v=0;if(i==="radial")d=n/(c.getLayout().x+f+p),g=a/(h.depth-1||1),Hv(l,function(y){m=(y.getLayout().x+p)*d,v=(y.depth-1)*g;var x=pd(m,v);y.setLayout({x:x.x,y:x.y,rawX:m,rawY:v},!0)});else{var _=r.getOrient();_==="RL"||_==="LR"?(g=a/(c.getLayout().x+f+p),d=n/(h.depth-1||1),Hv(l,function(y){v=(y.getLayout().x+p)*g,m=_==="LR"?(y.depth-1)*d:n-(y.depth-1)*d,y.setLayout({x:m,y:v},!0)})):(_==="TB"||_==="BT")&&(d=n/(c.getLayout().x+f+p),g=a/(h.depth-1||1),Hv(l,function(y){m=(y.getLayout().x+p)*d,v=_==="TB"?(y.depth-1)*g:a-(y.depth-1)*g,y.setLayout({x:m,y:v},!0)}))}}}function VN(r){r.eachSeriesByType("tree",function(e){var t=e.getData(),i=t.tree;i.eachNode(function(n){var a=n.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=t.ensureUniqueItemVisual(n.dataIndex,"style");he(s,o)})})}function A7(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var n=e.dataIndex,a=i.getData().tree,o=a.getNodeByDataIndex(n);o.isExpand=!o.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,i){t.eachComponent({mainType:"series",subType:"tree",query:e},function(n){var a=n.coordinateSystem,o=kv(a,e,void 0,i);n.setCenter&&n.setCenter(o.center),n.setZoom&&n.setZoom(o.zoom)})})}function GN(r){r.registerChartView(b7),r.registerSeriesModel(T7),r.registerLayout(kN),r.registerVisual(VN),A7(r)}var C7=["treemapZoomToNode","treemapRender","treemapMove"];function R7(r){for(var e=0;e<C7.length;e++)r.registerAction({type:C7[e],update:"updateView"},zr);r.registerAction({type:"treemapRootToNode",update:"updateView"},function(t,i){i.eachComponent({mainType:"series",subType:"treemap",query:t},n);function n(a,o){var s=["treemapZoomToNode","treemapRootToNode"],l=wc(t,s,a);if(l){var u=a.getViewRoot();u&&(t.direction=Gv(u,l.node)?"rollUp":"drillDown"),a.resetViewRoot(l.node)}}})}function sS(r){var e=r.getData(),t=e.tree,i={};t.eachNode(function(n){for(var a=n;a&&a.depth>1;)a=a.parentNode;var o=vx(r.ecModel,a.name||a.dataIndex+"",i);n.setVisual("decal",o)})}var zge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,i){var n={name:t.name,children:t.data};L7(n);var a=t.levels||[],o=this.designatedVisualItemStyle={},s=new Jt({itemStyle:o},this,i);a=t.levels=Fge(a,i);var l=de(a||[],function(h){return new Jt(h,s,i)},this),u=Vv.createTree(n,this,c);function c(h){h.wrapMethod("getItemModel",function(f,p){var d=u.getNodeByDataIndex(p),g=d?l[d.depth]:null;return f.parentModel=g||s,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return kr("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treeAncestors=Qh(n,this),i.treePathInfo=i.treeAncestors,i},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},he(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var i=this._idIndexMap;i||(i=this._idIndexMap=ke(),this._idIndexMapCount=0);var n=i.get(t);return n==null&&i.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var i=this.getRawData().tree.root;(!t||t!==i&&!i.contains(t))&&(this._viewRoot=i)},e.prototype.enableAriaDecal=function(){sS(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"\u25B6",zoomToNodeRatio:.32*.32,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}($t);function L7(r){var e=0;N(r.children,function(i){L7(i);var n=i.value;pe(n)&&(n=n[0]),e+=n});var t=r.value;pe(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),pe(r.value)?r.value[0]=t:r.value=t}function Fge(r,e){var t=tr(e.get("color")),i=tr(e.get(["aria","decal","decals"]));if(t){r=r||[];var n,a;N(r,function(s){var l=new Jt(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(n=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=r[0]||(r[0]={});return n||(o.color=t.slice()),!a&&i&&(o.decal=i.slice()),r}}var D7=zge;var Bge=8,P7=8,HN=5,kge=function(){function r(e){this.group=new Ze,e.add(this.group)}return r.prototype.render=function(e,t,i,n){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!i)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),h={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,h,u),this._renderContent(e,h,s,l,u,c,n),Ih(o,h.pos,h.box)}},r.prototype._prepare=function(e,t,i){for(var n=e;n;n=n.parentNode){var a=Kr(n.getModel().get("name"),""),o=i.getTextRect(a),s=Math.max(o.width+Bge*2,t.emptyItemWidth);t.totalWidth+=s+P7,t.renderList.push({node:n,text:a,width:s})}},r.prototype._renderContent=function(e,t,i,n,a,o,s){for(var l=0,u=t.emptyItemWidth,c=e.get(["breadcrumb","height"]),h=I5(t.pos,t.box),f=t.totalWidth,p=t.renderList,d=n.getModel("itemStyle").getItemStyle(),g=p.length-1;g>=0;g--){var m=p[g],v=m.node,_=m.width,y=m.text;f>h.width&&(f-=_-u,_=u,y=null);var x=new ai({shape:{points:Vge(l,0,_,c,g===p.length-1,g===0)},style:Ye(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new It({style:pr(a,{text:y})}),textConfig:{position:"inside"},z2:oc*1e4,onclick:ut(s,v)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=pr(o,{text:y}),x.ensureState("emphasis").style=d,sr(x,n.get("focus"),n.get("blurScope"),n.get("disabled")),this.group.add(x),Gge(x,e,v),l+=_+P7}},r.prototype.remove=function(){this.group.removeAll()},r}();function Vge(r,e,t,i,n,a){var o=[[n?r:r-HN,e],[r+t,e],[r+t,e+i],[n?r:r-HN,e+i]];return!a&&o.splice(2,0,[r+t+HN,e+i/2]),!n&&o.push([r,e+i/2]),o}function Gge(r,e,t){it(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:t&&t.dataIndex,name:t&&t.name},treePathInfo:t&&Qh(t,e)}}var I7=kge;var Hge=function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(e,t,i,n,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:i,delay:n,easing:a}),!0)},r.prototype.finished=function(e){return this._finishedCallback=e,this},r.prototype.start=function(){for(var e=this,t=this._storage.length,i=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},n=0,a=this._storage.length;n<a;n++){var o=this._storage[n];o.el.animateTo(o.target,{duration:o.duration,delay:o.delay,easing:o.easing,setToFinal:!0,done:i,aborted:i})}return this},r}();function N7(){return new Hge}var WN=Ze,U7=Rt,O7=3,z7="label",F7="upperLabel",Xge=oc*10,Yge=oc*2,qge=oc*3,dd=Mo([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),B7=function(r){var e=dd(r);return e.stroke=e.fill=e.lineWidth=null,e},uE=xt(),Zge=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._state="ready",t._storage=lS(),t}return e.prototype.render=function(t,i,n,a){var o=i.findComponents({mainType:"series",subType:"treemap",query:a});if(!(yt(o,t)<0)){this.seriesModel=t,this.api=n,this.ecModel=i;var s=["treemapZoomToNode","treemapRootToNode"],l=wc(a,s,t),u=a&&a.type,c=t.layoutInfo,h=!this._oldTree,f=this._storage,p=u==="treemapRootToNode"&&l&&f?{rootNodeGroup:f.nodeGroup[l.node.getRawIndex()],direction:a.direction}:null,d=this._giveContainerGroup(c),g=t.get("animation"),m=this._doRender(d,t,p);g&&!h&&(!u||u==="treemapZoomToNode"||u==="treemapRootToNode")?this._doAnimation(d,m,t,p):m.renderFinally(),this._resetController(n),this._renderBreadcrumb(t,n,l)}},e.prototype._giveContainerGroup=function(t){var i=this._containerGroup;return i||(i=this._containerGroup=new WN,this._initEvents(i),this.group.add(i)),i.x=t.x,i.y=t.y,i},e.prototype._doRender=function(t,i,n){var a=i.getData().tree,o=this._oldTree,s=lS(),l=lS(),u=this._storage,c=[];function h(m,v,_,y){return jge(i,l,u,n,s,c,m,v,_,y)}p(a.root?[a.root]:[],o&&o.root?[o.root]:[],t,a===o||!o,0);var f=d(u);return this._oldTree=a,this._storage=l,{lastsForAnimation:s,willDeleteEls:f,renderFinally:g};function p(m,v,_,y,x){y?(v=m,N(m,function(w,T){!w.isRemoved()&&S(T,T)})):new In(v,m,M,M).add(S).update(S).remove(ut(S,null)).execute();function M(w){return w.getId()}function S(w,T){var C=w!=null?m[w]:null,b=T!=null?v[T]:null,E=h(C,b,_,x);E&&p(C&&C.viewChildren||[],b&&b.viewChildren||[],E,y,x+1)}}function d(m){var v=lS();return m&&N(m,function(_,y){var x=v[y];N(_,function(M){M&&(x.push(M),uE(M).willDelete=!0)})}),v}function g(){N(f,function(m){N(m,function(v){v.parent&&v.parent.remove(v)})}),N(c,function(m){m.invisible=!0,m.dirty()})}},e.prototype._doAnimation=function(t,i,n,a){var o=n.get("animationDurationUpdate"),s=n.get("animationEasing"),l=(He(o)?0:o)||0,u=(He(s)?null:s)||"cubicOut",c=N7();N(i.willDeleteEls,function(h,f){N(h,function(p,d){if(!p.invisible){var g=p.parent,m,v=uE(g);if(a&&a.direction==="drillDown")m=g===a.rootNodeGroup?{shape:{x:0,y:0,width:v.nodeWidth,height:v.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var _=0,y=0;v.willDelete||(_=v.nodeWidth/2,y=v.nodeHeight/2),m=f==="nodeGroup"?{x:_,y,style:{opacity:0}}:{shape:{x:_,y,width:0,height:0},style:{opacity:0}}}m&&c.add(p,m,l,0,u)}})}),N(this._storage,function(h,f){N(h,function(p,d){var g=i.lastsForAnimation[f][d],m={};g&&(p instanceof Ze?g.oldX!=null&&(m.x=p.x,m.y=p.y,p.x=g.oldX,p.y=g.oldY):(g.oldShape&&(m.shape=he({},p.shape),p.setShape(g.oldShape)),g.fadein?(p.setStyle("opacity",0),m.style={opacity:1}):p.style.opacity!==1&&(m.style={opacity:1})),c.add(p,m,l,0,u))})},this),this._state="animating",c.finished(Be(function(){this._state="ready",i.renderFinally()},this)).start()},e.prototype._resetController=function(t){var i=this._controller;i||(i=this._controller=new Pu(t.getZr()),i.enable(this.seriesModel.get("roam")),i.on("pan",Be(this._onPan,this)),i.on("zoom",Be(this._onZoom,this)));var n=new ht(0,0,t.getWidth(),t.getHeight());i.setPointerChecker(function(a,o,s){return n.contain(o,s)})},e.prototype._clearController=function(){var t=this._controller;t&&(t.dispose(),t=null)},e.prototype._onPan=function(t){if(this._state!=="animating"&&(Math.abs(t.dx)>O7||Math.abs(t.dy)>O7)){var i=this.seriesModel.getData().tree.root;if(!i)return;var n=i.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var i=t.originX,n=t.originY;if(this._state!=="animating"){var a=this.seriesModel.getData().tree.root;if(!a)return;var o=a.getLayout();if(!o)return;var s=new ht(o.x,o.y,o.width,o.height),l=this.seriesModel.layoutInfo;i-=l.x,n-=l.y;var u=Ci();Tn(u,u,[-i,-n]),Fm(u,u,[t.scale,t.scale]),Tn(u,u,[i,n]),s.applyTransform(u),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(t){var i=this;t.on("click",function(n){if(i._state==="ready"){var a=i.seriesModel.get("nodeClick",!0);if(a){var o=i.findTarget(n.offsetX,n.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)i._rootToNode(o);else if(a==="zoomToNode")i._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&Jp(u,c)}}}}},this)},e.prototype._renderBreadcrumb=function(t,i,n){var a=this;n||(n=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(i.getWidth()/2,i.getHeight()/2),n||(n={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new I7(this.group))).render(t,i,n.node,function(o){a._state!=="animating"&&(Gv(t.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=lS(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,i){var n,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(t,i),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)n={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),n},e.type="treemap",e}(Zt);function lS(){return{nodeGroup:[],background:[],content:[]}}function jge(r,e,t,i,n,a,o,s,l,u){if(!o)return;var c=o.getLayout(),h=r.getData(),f=o.getModel();if(h.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var p=c.width,d=c.height,g=c.borderWidth,m=c.invisible,v=o.getRawIndex(),_=s&&s.getRawIndex(),y=o.viewChildren,x=c.upperHeight,M=y&&y.length,S=f.getModel("itemStyle"),w=f.getModel(["emphasis","itemStyle"]),T=f.getModel(["blur","itemStyle"]),C=f.getModel(["select","itemStyle"]),b=S.get("borderRadius")||0,E=V("nodeGroup",WN);if(!E)return;if(l.add(E),E.x=c.x||0,E.y=c.y||0,E.markRedraw(),uE(E).nodeWidth=p,uE(E).nodeHeight=d,c.isAboveViewRoot)return E;var I=V("background",U7,u,Yge);I&&k(E,I,M&&c.upperLabelHeight);var R=f.getModel("emphasis"),A=R.get("focus"),P=R.get("blurScope"),U=R.get("disabled"),B=A==="ancestor"?o.getAncestorsIndices():A==="descendant"?o.getDescendantIndices():A;if(M)Ph(E)&&lc(E,!1),I&&(lc(I,!U),h.setItemGraphicEl(o.dataIndex,I),Ww(I,B,P));else{var z=V("content",U7,u,qge);z&&G(E,z),I.disableMorphing=!0,I&&Ph(I)&&lc(I,!1),lc(E,!U),h.setItemGraphicEl(o.dataIndex,E),Ww(E,B,P)}return E;function k(ve,ue,se){var Ee=it(ue);if(Ee.dataIndex=o.dataIndex,Ee.seriesIndex=r.seriesIndex,ue.setShape({x:0,y:0,width:p,height:d,r:b}),m)Y(ue);else{ue.invisible=!1;var q=o.getVisual("style"),H=q.stroke,We=B7(S);We.fill=H;var _e=dd(w);_e.fill=w.get("borderColor");var xe=dd(T);xe.fill=T.get("borderColor");var Le=dd(C);if(Le.fill=C.get("borderColor"),se){var Ue=p-2*g;J(ue,H,q.opacity,{x:g,y:0,width:Ue,height:x})}else ue.removeTextContent();ue.setStyle(We),ue.ensureState("emphasis").style=_e,ue.ensureState("blur").style=xe,ue.ensureState("select").style=Le,Ml(ue)}ve.add(ue)}function G(ve,ue){var se=it(ue);se.dataIndex=o.dataIndex,se.seriesIndex=r.seriesIndex;var Ee=Math.max(p-2*g,0),q=Math.max(d-2*g,0);if(ue.culling=!0,ue.setShape({x:g,y:g,width:Ee,height:q,r:b}),m)Y(ue);else{ue.invisible=!1;var H=o.getVisual("style"),We=H.fill,_e=B7(S);_e.fill=We,_e.decal=H.decal;var xe=dd(w),Le=dd(T),Ue=dd(C);J(ue,We,H.opacity,null),ue.setStyle(_e),ue.ensureState("emphasis").style=xe,ue.ensureState("blur").style=Le,ue.ensureState("select").style=Ue,Ml(ue)}ve.add(ue)}function Y(ve){!ve.invisible&&a.push(ve)}function J(ve,ue,se,Ee){var q=f.getModel(Ee?F7:z7),H=Kr(f.get("name"),null),We=q.getShallow("show");Fr(ve,Rr(f,Ee?F7:z7),{defaultText:We?H:null,inheritColor:ue,defaultOpacity:se,labelFetcher:r,labelDataIndex:o.dataIndex});var _e=ve.getTextContent();if(_e){var xe=_e.style,Le=Pm(xe.padding||0);Ee&&(ve.setTextConfig({layoutRect:Ee}),_e.disableLabelLayout=!0),_e.beforeUpdate=function(){var Ne=Math.max((Ee?Ee.width:ve.shape.width)-Le[1]-Le[3],0),Ve=Math.max((Ee?Ee.height:ve.shape.height)-Le[0]-Le[2],0);(xe.width!==Ne||xe.height!==Ve)&&_e.setStyle({width:Ne,height:Ve})},xe.truncateMinChar=2,xe.lineOverflow="truncate",Q(xe,Ee,c);var Ue=_e.getState("emphasis");Q(Ue?Ue.style:null,Ee,c)}}function Q(ve,ue,se){var Ee=ve?ve.text:null;if(!ue&&se.isLeafRoot&&Ee!=null){var q=r.get("drillDownIcon",!0);ve.text=q?q+" "+Ee:Ee}}function V(ve,ue,se,Ee){var q=_!=null&&t[ve][_],H=n[ve];return q?(t[ve][_]=null,K(H,q)):m||(q=new ue,q instanceof Si&&(q.z2=Kge(se,Ee)),ae(H,q)),e[ve][v]=q}function K(ve,ue){var se=ve[v]={};ue instanceof WN?(se.oldX=ue.x,se.oldY=ue.y):se.oldShape=he({},ue.shape)}function ae(ve,ue){var se=ve[v]={},Ee=o.parentNode,q=ue instanceof Ze;if(Ee&&(!i||i.direction==="drillDown")){var H=0,We=0,_e=n.background[Ee.getRawIndex()];!i&&_e&&_e.oldShape&&(H=_e.oldShape.width,We=_e.oldShape.height),q?(se.oldX=0,se.oldY=We):se.oldShape={x:H,y:We,width:0,height:0}}se.fadein=!q}}function Kge(r,e){return r*Xge+e}var k7=Zge;var hS=N,Jge=qe,fE=-1,ZN=function(){function r(e){var t=e.mappingMethod,i=e.type,n=this.option=Qe(e);this.type=i,this.mappingMethod=t,this._normalizeData=eye[t];var a=r.visualHandlers[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(XN(n),$ge(n)):t==="category"?n.categories?Qge(n):XN(n,!0):(Wr(t!=="linear"||n.dataExtent),XN(n))}return r.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},r.prototype.getNormalizer=function(){return Be(this._normalizeData,this)},r.listVisualTypes=function(){return At(r.visualHandlers)},r.isValidType=function(e){return r.visualHandlers.hasOwnProperty(e)},r.eachVisual=function(e,t,i){qe(e)?N(e,t,i):t.call(i,e)},r.mapVisual=function(e,t,i){var n,a=pe(e)?[]:qe(e)?{}:(n=!0,null);return r.eachVisual(e,function(o,s){var l=t.call(i,o,s);n?a=l:a[s]=l}),a},r.retrieveVisuals=function(e){var t={},i;return e&&hS(r.visualHandlers,function(n,a){e.hasOwnProperty(a)&&(t[a]=e[a],i=!0)}),i?t:null},r.prepareVisualTypes=function(e){if(pe(e))e=e.slice();else if(Jge(e)){var t=[];hS(e,function(i,n){t.push(n)}),e=t}else return[];return e.sort(function(i,n){return n==="color"&&i!=="color"&&i.indexOf("color")===0?1:-1}),e},r.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},r.findPieceIndex=function(e,t,i){for(var n,a=1/0,o=0,s=t.length;o<s;o++){var l=t[o].value;if(l!=null){if(l===e||Ce(l)&&l===e+"")return o;i&&f(l,o)}}for(var o=0,s=t.length;o<s;o++){var u=t[o],c=u.interval,h=u.close;if(c){if(c[0]===-1/0){if(hE(h[1],e,c[1]))return o}else if(c[1]===1/0){if(hE(h[0],c[0],e))return o}else if(hE(h[0],c[0],e)&&hE(h[1],e,c[1]))return o;i&&f(c[0],o),i&&f(c[1],o)}}if(i)return e===1/0?t.length-1:e===-1/0?0:n;function f(p,d){var g=Math.abs(p-e);g<a&&(a=g,n=d)}},r.visualHandlers={color:{applyVisual:uS("color"),getColorMapper:function(){var e=this.option;return Be(e.mappingMethod==="category"?function(t,i){return!i&&(t=this._normalizeData(t)),cS.call(this,t)}:function(t,i,n){var a=!!n;return!i&&(t=this._normalizeData(t)),n=hw(t,e.parsedVisual,n),a?n:Ns(n,"rgba")},this)},_normalizedToVisual:{linear:function(e){return Ns(hw(e,this.option.parsedVisual),"rgba")},category:cS,piecewise:function(e,t){var i=qN.call(this,t);return i==null&&(i=Ns(hw(e,this.option.parsedVisual),"rgba")),i},fixed:md}},colorHue:cE(function(e,t){return xp(e,t)}),colorSaturation:cE(function(e,t){return xp(e,null,t)}),colorLightness:cE(function(e,t){return xp(e,null,null,t)}),colorAlpha:cE(function(e,t){return Sp(e,t)}),decal:{applyVisual:uS("decal"),_normalizedToVisual:{linear:null,category:cS,piecewise:null,fixed:null}},opacity:{applyVisual:uS("opacity"),_normalizedToVisual:YN([0,1])},liftZ:{applyVisual:uS("liftZ"),_normalizedToVisual:{linear:md,category:md,piecewise:md,fixed:md}},symbol:{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);i("symbol",n)},_normalizedToVisual:{linear:V7,category:cS,piecewise:function(e,t){var i=qN.call(this,t);return i==null&&(i=V7.call(this,e)),i},fixed:md}},symbolSize:{applyVisual:uS("symbolSize"),_normalizedToVisual:YN([0,1])}},r}();function $ge(r){var e=r.pieceList;r.hasSpecialVisual=!1,N(e,function(t,i){t.originIndex=i,t.visual!=null&&(r.hasSpecialVisual=!0)})}function Qge(r){var e=r.categories,t=r.categoryMap={},i=r.visual;if(hS(e,function(o,s){t[o]=s}),!pe(i)){var n=[];qe(i)?hS(i,function(o,s){var l=t[s];n[l??fE]=o}):n[fE]=i,i=G7(r,n)}for(var a=e.length-1;a>=0;a--)i[a]==null&&(delete t[e[a]],e.pop())}function XN(r,e){var t=r.visual,i=[];qe(t)?hS(t,function(a){i.push(a)}):t!=null&&i.push(t);var n={color:1,symbol:1};!e&&i.length===1&&!n.hasOwnProperty(r.type)&&(i[1]=i[0]),G7(r,i)}function cE(r){return{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);i("color",r(t("color"),n))},_normalizedToVisual:YN([0,1])}}function V7(r){var e=this.option.visual;return e[Math.round(ar(r,[0,1],[0,e.length-1],!0))]||{}}function uS(r){return function(e,t,i){i(r,this.mapValueToVisual(e))}}function cS(r){var e=this.option.visual;return e[this.option.loop&&r!==fE?r%e.length:r]}function md(){return this.option.visual[0]}function YN(r){return{linear:function(e){return ar(e,r,this.option.visual,!0)},category:cS,piecewise:function(e,t){var i=qN.call(this,t);return i==null&&(i=ar(e,r,this.option.visual,!0)),i},fixed:md}}function qN(r){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var i=ZN.findPieceIndex(r,t),n=t[i];if(n&&n.visual)return n.visual[this.type]}}function G7(r,e){return r.visual=e,r.type==="color"&&(r.parsedVisual=de(e,function(t){var i=pn(t);return i||[0,0,0,1]})),e}var eye={linear:function(r){return ar(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var e=this.option.pieceList,t=ZN.findPieceIndex(r,e,!0);if(t!=null)return ar(t,[0,e.length-1],[0,1],!0)},category:function(r){var e=this.option.categories?this.option.categoryMap[r]:r;return e??fE},fixed:zr};function hE(r,e,t){return r?e<=t:e<t}var gi=ZN;var tye="itemStyle",W7=xt(),X7={seriesType:"treemap",reset:function(r){var e=r.getData().tree,t=e.root;t.isRemoved()||Y7(t,{},r.getViewRoot().getAncestors(),r)}};function Y7(r,e,t,i){var n=r.getModel(),a=r.getLayout(),o=r.hostTree.data;if(!(!a||a.invisible||!a.isInView)){var s=n.getModel(tye),l=rye(s,e,i),u=o.ensureUniqueItemVisual(r.dataIndex,"style"),c=s.get("borderColor"),h=s.get("borderColorSaturation"),f;h!=null&&(f=H7(l),c=iye(h,f)),u.stroke=c;var p=r.viewChildren;if(!p||!p.length)f=H7(l),u.fill=f;else{var d=nye(r,n,a,s,l,p);N(p,function(g,m){if(g.depth>=t.length||g===t[g.depth]){var v=aye(n,l,g,m,d,i);Y7(g,v,t,i)}})}}}function rye(r,e,t){var i=he({},e),n=t.designatedVisualItemStyle;return N(["color","colorAlpha","colorSaturation"],function(a){n[a]=e[a];var o=r.get(a);n[a]=null,o!=null&&(i[a]=o)}),i}function H7(r){var e=jN(r,"color");if(e){var t=jN(r,"colorAlpha"),i=jN(r,"colorSaturation");return i&&(e=xp(e,null,null,i)),t&&(e=Sp(e,t)),e}}function iye(r,e){return e!=null?xp(e,null,null,r):null}function jN(r,e){var t=r[e];if(t!=null&&t!=="none")return t}function nye(r,e,t,i,n,a){if(!(!a||!a.length)){var o=KN(e,"color")||n.color!=null&&n.color!=="none"&&(KN(e,"colorAlpha")||KN(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();s!=null&&s<u[0]&&(u[0]=s),l!=null&&l>u[1]&&(u[1]=l);var c=e.get("colorMappingBy"),h={type:o.name,dataExtent:u,visual:o.range};h.type==="color"&&(c==="index"||c==="id")?(h.mappingMethod="category",h.loop=!0):h.mappingMethod="linear";var f=new gi(h);return W7(f).drColorMappingBy=c,f}}}function KN(r,e){var t=r.get(e);return pe(t)&&t.length?{name:e,range:t}:null}function aye(r,e,t,i,n,a){var o=he({},e);if(n){var s=n.type,l=s==="color"&&W7(n).drColorMappingBy,u=l==="index"?i:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(r.get("visualDimension"));o[s]=n.mapValueToVisual(u)}return o}var fS=Math.max,pE=Math.min,q7=Hr,JN=N,j7=["itemStyle","borderWidth"],oye=["itemStyle","gapWidth"],sye=["upperLabel","show"],lye=["upperLabel","height"],K7={seriesType:"treemap",reset:function(r,e,t,i){var n=t.getWidth(),a=t.getHeight(),o=r.option,s=br(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=o.size||[],u=ze(q7(s.width,l[0]),n),c=ze(q7(s.height,l[1]),a),h=i&&i.type,f=["treemapZoomToNode","treemapRootToNode"],p=wc(i,f,r),d=h==="treemapRender"||h==="treemapMove"?i.rootRect:null,g=r.getViewRoot(),m=FN(g);if(h!=="treemapMove"){var v=h==="treemapZoomToNode"?dye(r,p,g,u,c):d?[d.width,d.height]:[u,c],_=o.sort;_&&_!=="asc"&&_!=="desc"&&(_="desc");var y={squareRatio:o.squareRatio,sort:_,leafDepth:o.leafDepth};g.hostTree.clearLayouts();var x={x:0,y:0,width:v[0],height:v[1],area:v[0]*v[1]};g.setLayout(x),J7(g,y,!1,0),x=g.getLayout(),JN(m,function(S,w){var T=(m[w+1]||g).getValue();S.setLayout(he({dataExtent:[T,T],borderWidth:0,upperHeight:0},x))})}var M=r.getData().tree.root;M.setLayout(mye(s,d,p),!0),r.setLayoutInfo(s),$7(M,new ht(-s.x,-s.y,n,a),m,g,0)}};function J7(r,e,t,i){var n,a;if(!r.isRemoved()){var o=r.getLayout();n=o.width,a=o.height;var s=r.getModel(),l=s.get(j7),u=s.get(oye)/2,c=Q7(s),h=Math.max(l,c),f=l-u,p=h-u;r.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:c},!0),n=fS(n-2*f,0),a=fS(a-f-p,0);var d=n*a,g=uye(r,s,d,e,t,i);if(g.length){var m={x:f,y:p,width:n,height:a},v=pE(n,a),_=1/0,y=[];y.area=0;for(var x=0,M=g.length;x<M;){var S=g[x];y.push(S),y.area+=S.getLayout().area;var w=pye(y,v,e.squareRatio);w<=_?(x++,_=w):(y.area-=y.pop().getLayout().area,Z7(y,v,m,u,!1),v=pE(m.width,m.height),y.length=y.area=0,_=1/0)}if(y.length&&Z7(y,v,m,u,!0),!t){var T=s.get("childrenVisibleMin");T!=null&&d<T&&(t=!0)}for(var x=0,M=g.length;x<M;x++)J7(g[x],e,t,i+1)}}}function uye(r,e,t,i,n,a){var o=r.children||[],s=i.sort;s!=="asc"&&s!=="desc"&&(s=null);var l=i.leafDepth!=null&&i.leafDepth<=a;if(n&&!l)return r.viewChildren=[];o=Yt(o,function(p){return!p.isRemoved()}),hye(o,s);var u=fye(e,o,s);if(u.sum===0)return r.viewChildren=[];if(u.sum=cye(e,t,u.sum,s,o),u.sum===0)return r.viewChildren=[];for(var c=0,h=o.length;c<h;c++){var f=o[c].getValue()/u.sum*t;o[c].setLayout({area:f})}return l&&(o.length&&r.setLayout({isLeafRoot:!0},!0),o.length=0),r.viewChildren=o,r.setLayout({dataExtent:u.dataExtent},!0),o}function cye(r,e,t,i,n){if(!i)return t;for(var a=r.get("visibleMin"),o=n.length,s=o,l=o-1;l>=0;l--){var u=n[i==="asc"?o-l-1:l].getValue();u/t*e<a&&(s=l,t-=u)}return i==="asc"?n.splice(0,o-s):n.splice(s,o-s),t}function hye(r,e){return e&&r.sort(function(t,i){var n=e==="asc"?t.getValue()-i.getValue():i.getValue()-t.getValue();return n===0?e==="asc"?t.dataIndex-i.dataIndex:i.dataIndex-t.dataIndex:n}),r}function fye(r,e,t){for(var i=0,n=0,a=e.length;n<a;n++)i+=e[n].getValue();var o=r.get("visualDimension"),s;return!e||!e.length?s=[NaN,NaN]:o==="value"&&t?(s=[e[e.length-1].getValue(),e[0].getValue()],t==="asc"&&s.reverse()):(s=[1/0,-1/0],JN(e,function(l){var u=l.getValue(o);u<s[0]&&(s[0]=u),u>s[1]&&(s[1]=u)})),{sum:i,dataExtent:s}}function pye(r,e,t){for(var i=0,n=1/0,a=0,o=void 0,s=r.length;a<s;a++)o=r[a].getLayout().area,o&&(o<n&&(n=o),o>i&&(i=o));var l=r.area*r.area,u=e*e*t;return l?fS(u*i/l,l/(u*n)):1/0}function Z7(r,e,t,i,n){var a=e===t.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=t[s[a]],c=e?r.area/e:0;(n||c>t[l[o]])&&(c=t[l[o]]);for(var h=0,f=r.length;h<f;h++){var p=r[h],d={},g=c?p.getLayout().area/c:0,m=d[l[o]]=fS(c-2*i,0),v=t[s[a]]+t[l[a]]-u,_=h===f-1||v<g?v:g,y=d[l[a]]=fS(_-2*i,0);d[s[o]]=t[s[o]]+pE(i,m/2),d[s[a]]=u+pE(i,y/2),u+=_,p.setLayout(d,!0)}t[s[o]]+=c,t[l[o]]-=c}function dye(r,e,t,i,n){var a=(e||{}).node,o=[i,n];if(!a||a===t)return o;for(var s,l=i*n,u=l*r.option.zoomToNodeRatio;s=a.parentNode;){for(var c=0,h=s.children,f=0,p=h.length;f<p;f++)c+=h[f].getValue();var d=a.getValue();if(d===0)return o;u*=c/d;var g=s.getModel(),m=g.get(j7),v=Math.max(m,Q7(g));u+=4*m*m+(3*m+v)*Math.pow(u,.5),u>B_&&(u=B_),a=s}u<l&&(u=l);var _=Math.pow(u/l,.5);return[i*_,n*_]}function mye(r,e,t){if(e)return{x:e.x,y:e.y};var i={x:0,y:0};if(!t)return i;var n=t.node,a=n.getLayout();if(!a)return i;for(var o=[a.width/2,a.height/2],s=n;s;){var l=s.getLayout();o[0]+=l.x,o[1]+=l.y,s=s.parentNode}return{x:r.width/2-o[0],y:r.height/2-o[1]}}function $7(r,e,t,i,n){var a=r.getLayout(),o=t[n],s=o&&o===r;if(!(o&&!s||n===t.length&&r!==i)){r.setLayout({isInView:!0,invisible:!s&&!e.intersect(a),isAboveViewRoot:s},!0);var l=new ht(e.x-a.x,e.y-a.y,e.width,e.height);JN(r.viewChildren||[],function(u){$7(u,l,t,i,n+1)})}}function Q7(r){return r.get(sye)?r.get(lye):0}function $N(r){r.registerSeriesModel(D7),r.registerChartView(k7),r.registerVisual(X7),r.registerLayout(K7),R7(r)}function QN(r){var e=r.findComponents({mainType:"legend"});!e||!e.length||r.eachSeriesByType("graph",function(t){var i=t.getCategoriesData(),n=t.getGraph(),a=n.data,o=i.mapArray(i.getName);a.filterSelf(function(s){var l=a.getItemModel(s),u=l.getShallow("category");if(u!=null){Dt(u)&&(u=o[u]);for(var c=0;c<e.length;c++)if(!e[c].isSelected(u))return!1}return!0})})}function eU(r){var e={};r.eachSeriesByType("graph",function(t){var i=t.getCategoriesData(),n=t.getData(),a={};i.each(function(o){var s=i.getName(o);a["ec-"+s]=o;var l=i.getItemModel(o),u=l.getModel("itemStyle").getItemStyle();u.fill||(u.fill=t.getColorFromPalette(s,e)),i.setItemVisual(o,"style",u);for(var c=["symbol","symbolSize","symbolKeepAspect"],h=0;h<c.length;h++){var f=l.getShallow(c[h],!0);f!=null&&i.setItemVisual(o,c[h],f)}}),i.count()&&n.each(function(o){var s=n.getItemModel(o),l=s.getShallow("category");if(l!=null){Ce(l)&&(l=a["ec-"+l]);var u=i.getItemVisual(l,"style"),c=n.ensureUniqueItemVisual(o,"style");he(c,u);for(var h=["symbol","symbolSize","symbolKeepAspect"],f=0;f<h.length;f++)n.setItemVisual(o,h[f],i.getItemVisual(l,h[f]))}})})}function dE(r){return r instanceof Array||(r=[r,r]),r}function tU(r){r.eachSeriesByType("graph",function(e){var t=e.getGraph(),i=e.getEdgeData(),n=dE(e.get("edgeSymbol")),a=dE(e.get("edgeSymbolSize"));i.setVisual("fromSymbol",n&&n[0]),i.setVisual("toSymbol",n&&n[1]),i.setVisual("fromSymbolSize",a&&a[0]),i.setVisual("toSymbolSize",a&&a[1]),i.setVisual("style",e.getModel("lineStyle").getLineStyle()),i.each(function(o){var s=i.getItemModel(o),l=t.getEdgeByIndex(o),u=dE(s.getShallow("symbol",!0)),c=dE(s.getShallow("symbolSize",!0)),h=s.getModel("lineStyle").getLineStyle(),f=i.ensureUniqueItemVisual(o,"style");switch(he(f,h),f.stroke){case"source":{var p=l.node1.getVisual("style");f.stroke=p&&p.fill;break}case"target":{var p=l.node2.getVisual("style");f.stroke=p&&p.fill;break}}u[0]&&l.setVisual("fromSymbol",u[0]),u[1]&&l.setVisual("toSymbol",u[1]),c[0]&&l.setVisual("fromSymbolSize",c[0]),c[1]&&l.setVisual("toSymbolSize",c[1])})})}var rU="-->",mE=function(r){return r.get("autoCurveness")||null},eY=function(r,e){var t=mE(r),i=20,n=[];if(Dt(t))i=t;else if(pe(t)){r.__curvenessList=t;return}e>i&&(i=e);var a=i%2?i+2:i+3;n=[];for(var o=0;o<a;o++)n.push((o%2?o+1:o)/10*(o%2?-1:1));r.__curvenessList=n},pS=function(r,e,t){var i=[r.id,r.dataIndex].join("."),n=[e.id,e.dataIndex].join(".");return[t.uid,i,n].join(rU)},tY=function(r){var e=r.split(rU);return[e[0],e[2],e[1]].join(rU)},vye=function(r,e){var t=pS(r.node1,r.node2,e);return e.__edgeMap[t]},gye=function(r,e){var t=iU(pS(r.node1,r.node2,e),e),i=iU(pS(r.node2,r.node1,e),e);return t+i},iU=function(r,e){var t=e.__edgeMap;return t[r]?t[r].length:0};function rY(r){mE(r)&&(r.__curvenessList=[],r.__edgeMap={},eY(r))}function iY(r,e,t,i){if(mE(t)){var n=pS(r,e,t),a=t.__edgeMap,o=a[tY(n)];a[n]&&!o?a[n].isForward=!0:o&&a[n]&&(o.isForward=!0,a[n].isForward=!1),a[n]=a[n]||[],a[n].push(i)}}function Wv(r,e,t,i){var n=mE(e),a=pe(n);if(!n)return null;var o=vye(r,e);if(!o)return null;for(var s=-1,l=0;l<o.length;l++)if(o[l]===t){s=l;break}var u=gye(r,e);eY(e,u),r.lineStyle=r.lineStyle||{};var c=pS(r.node1,r.node2,e),h=e.__curvenessList,f=a||u%2?0:1;if(o.isForward)return h[f+s];var p=tY(c),d=iU(p,e),g=h[s+d+f];return i?a?n&&n[0]===0?(d+f)%2?g:-g:((d%2?0:1)+f)%2?g:-g:(d+f)%2?g:-g:h[s+d+f]}function vE(r){var e=r.coordinateSystem;if(!(e&&e.type!=="view")){var t=r.getGraph();t.eachNode(function(i){var n=i.getModel();i.setLayout([+n.get("x"),+n.get("y")])}),dS(t,r)}}function dS(r,e){r.eachEdge(function(t,i){var n=qi(t.getModel().get(["lineStyle","curveness"]),-Wv(t,e,i,!0),0),a=ho(t.node1.getLayout()),o=ho(t.node2.getLayout()),s=[a,o];+n&&s.push([(a[0]+o[0])/2-(a[1]-o[1])*n,(a[1]+o[1])/2-(o[0]-a[0])*n]),t.setLayout(s)})}function nU(r,e){r.eachSeriesByType("graph",function(t){var i=t.get("layout"),n=t.coordinateSystem;if(n&&n.type!=="view"){var a=t.getData(),o=[];N(n.dimensions,function(f){o=o.concat(a.mapDimensionsAll(f))});for(var s=0;s<a.count();s++){for(var l=[],u=!1,c=0;c<o.length;c++){var h=a.get(o[c],s);isNaN(h)||(u=!0),l.push(h)}u?a.setItemLayout(s,n.dataToPoint(l)):a.setItemLayout(s,[NaN,NaN])}dS(a.graph,t)}else(!i||i==="none")&&vE(t)})}function vd(r){var e=r.coordinateSystem;if(e.type!=="view")return 1;var t=r.option.nodeScaleRatio,i=e.scaleX,n=e.getZoom(),a=(n-1)*t+1;return a/i}function gd(r){var e=r.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}var nY=Math.PI,aU=[];function Xv(r,e,t,i){var n=r.coordinateSystem;if(!(n&&n.type!=="view")){var a=n.getBoundingRect(),o=r.getData(),s=o.graph,l=a.width/2+a.x,u=a.height/2+a.y,c=Math.min(a.width,a.height)/2,h=o.count();if(o.setLayout({cx:l,cy:u}),!!h){if(t){var f=n.pointToData(i),p=f[0],d=f[1],g=[p-l,d-u];Cs(g,g),Nm(g,g,c),t.setLayout([l+g[0],u+g[1]],!0);var m=r.get(["circular","rotateLabel"]);oU(t,m,l,u)}yye[e](r,s,o,c,l,u,h),s.eachEdge(function(v,_){var y=qi(v.getModel().get(["lineStyle","curveness"]),Wv(v,r,_),0),x=ho(v.node1.getLayout()),M=ho(v.node2.getLayout()),S,w=(x[0]+M[0])/2,T=(x[1]+M[1])/2;+y&&(y*=3,S=[l*y+w*(1-y),u*y+T*(1-y)]),v.setLayout([x,M,S])})}}}var yye={value:function(r,e,t,i,n,a,o){var s=0,l=t.getSum("value"),u=Math.PI*2/(l||o);e.eachNode(function(c){var h=c.getValue("value"),f=u*(l?h:1)/2;s+=f,c.setLayout([i*Math.cos(s)+n,i*Math.sin(s)+a]),s+=f})},symbolSize:function(r,e,t,i,n,a,o){var s=0;aU.length=o;var l=vd(r);e.eachNode(function(h){var f=gd(h);isNaN(f)&&(f=2),f<0&&(f=0),f*=l;var p=Math.asin(f/2/i);isNaN(p)&&(p=nY/2),aU[h.dataIndex]=p,s+=p*2});var u=(2*nY-s)/o/2,c=0;e.eachNode(function(h){var f=u+aU[h.dataIndex];c+=f,(!h.getLayout()||!h.getLayout().fixed)&&h.setLayout([i*Math.cos(c)+n,i*Math.sin(c)+a]),c+=f})}};function oU(r,e,t,i){var n=r.getGraphicEl();if(n){var a=r.getModel(),o=a.get(["label","rotate"])||0,s=n.getSymbolPath();if(e){var l=r.getLayout(),u=Math.atan2(l[1]-i,l[0]-t);u<0&&(u=Math.PI*2+u);var c=l[0]<t;c&&(u=u-Math.PI);var h=c?"left":"right";s.setTextConfig({rotation:-u,position:h,origin:"center"});var f=s.ensureState("emphasis");he(f.textConfig||(f.textConfig={}),{position:h})}else s.setTextConfig({rotation:o*=Math.PI/180})}}function sU(r){r.eachSeriesByType("graph",function(e){e.get("layout")==="circular"&&Xv(e,"symbolSize")})}var Yv=__;function aY(r,e,t){for(var i=r,n=e,a=t.rect,o=a.width,s=a.height,l=[a.x+o/2,a.y+s/2],u=t.gravity==null?.1:t.gravity,c=0;c<i.length;c++){var h=i[c];h.p||(h.p=uu(o*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),h.pp=ho(h.p),h.edges=null}var f=t.friction==null?.6:t.friction,p=f,d,g;return{warmUp:function(){p=f*.8},setFixed:function(m){i[m].fixed=!0},setUnfixed:function(m){i[m].fixed=!1},beforeStep:function(m){d=m},afterStep:function(m){g=m},step:function(m){d&&d(i,n);for(var v=[],_=i.length,y=0;y<n.length;y++){var x=n[y];if(!x.ignoreForceLayout){var M=x.n1,S=x.n2;yl(v,S.p,M.p);var w=qb(v)-x.d,T=S.w/(M.w+S.w);isNaN(T)&&(T=0),Cs(v,v),!M.fixed&&Yv(M.p,M.p,v,T*w*p),!S.fixed&&Yv(S.p,S.p,v,-(1-T)*w*p)}}for(var y=0;y<_;y++){var C=i[y];C.fixed||(yl(v,l,C.p),Yv(C.p,C.p,v,u*p))}for(var y=0;y<_;y++)for(var M=i[y],b=y+1;b<_;b++){var S=i[b];yl(v,S.p,M.p);var w=qb(v);w===0&&(eG(v,Math.random()-.5,Math.random()-.5),w=1);var E=(M.rep+S.rep)/w/w;!M.fixed&&Yv(M.pp,M.pp,v,E),!S.fixed&&Yv(S.pp,S.pp,v,-E)}for(var I=[],y=0;y<_;y++){var C=i[y];C.fixed||(yl(I,C.p,C.pp),Yv(C.p,C.p,I,p),ji(C.pp,C.p))}p=p*.992;var R=p<.01;g&&g(i,n,R),m&&m(R)}}}function lU(r){r.eachSeriesByType("graph",function(e){var t=e.coordinateSystem;if(!(t&&t.type!=="view"))if(e.get("layout")==="force"){var i=e.preservedPoints||{},n=e.getGraph(),a=n.data,o=n.edgeData,s=e.getModel("force"),l=s.get("initLayout");e.preservedPoints?a.each(function(y){var x=a.getId(y);a.setItemLayout(y,i[x]||[NaN,NaN])}):!l||l==="none"?vE(e):l==="circular"&&Xv(e,"value");var u=a.getDataExtent("value"),c=o.getDataExtent("value"),h=s.get("repulsion"),f=s.get("edgeLength"),p=pe(h)?h:[h,h],d=pe(f)?f:[f,f];d=[d[1],d[0]];var g=a.mapArray("value",function(y,x){var M=a.getItemLayout(x),S=ar(y,u,p);return isNaN(S)&&(S=(p[0]+p[1])/2),{w:S,rep:S,fixed:a.getItemModel(x).get("fixed"),p:!M||isNaN(M[0])||isNaN(M[1])?null:M}}),m=o.mapArray("value",function(y,x){var M=n.getEdgeByIndex(x),S=ar(y,c,d);isNaN(S)&&(S=(d[0]+d[1])/2);var w=M.getModel(),T=qi(M.getModel().get(["lineStyle","curveness"]),-Wv(M,e,x,!0),0);return{n1:g[M.node1.dataIndex],n2:g[M.node2.dataIndex],d:S,curveness:T,ignoreForceLayout:w.get("ignoreForceLayout")}}),v=t.getBoundingRect(),_=aY(g,m,{rect:v,gravity:s.get("gravity"),friction:s.get("friction")});_.beforeStep(function(y,x){for(var M=0,S=y.length;M<S;M++)y[M].fixed&&ji(y[M].p,n.getNodeByIndex(M).getLayout())}),_.afterStep(function(y,x,M){for(var S=0,w=y.length;S<w;S++)y[S].fixed||n.getNodeByIndex(S).setLayout(y[S].p),i[a.getId(S)]=y[S].p;for(var S=0,w=x.length;S<w;S++){var T=x[S],C=n.getEdgeByIndex(S),b=T.n1.p,E=T.n2.p,I=C.getLayout();I=I?I.slice():[],I[0]=I[0]||[],I[1]=I[1]||[],ji(I[0],b),ji(I[1],E),+T.curveness&&(I[2]=[(b[0]+E[0])/2-(b[1]-E[1])*T.curveness,(b[1]+E[1])/2-(E[0]-b[0])*T.curveness]),C.setLayout(I)}}),e.forceLayout=_,e.preservedPoints=i,_.step()}else e.forceLayout=null})}function _ye(r,e,t){var i=he(r.getBoxLayoutParams(),{aspect:t});return br(i,{width:e.getWidth(),height:e.getHeight()})}function uU(r,e){var t=[];return r.eachSeriesByType("graph",function(i){var n=i.get("coordinateSystem");if(!n||n==="view"){var a=i.getData(),o=a.mapArray(function(m){var v=a.getItemModel(m);return[+v.get("x"),+v.get("y")]}),s=[],l=[];Ip(o,s,l),l[0]-s[0]===0&&(l[0]+=1,s[0]-=1),l[1]-s[1]===0&&(l[1]+=1,s[1]-=1);var u=(l[0]-s[0])/(l[1]-s[1]),c=_ye(i,e,u);isNaN(u)&&(s=[c.x,c.y],l=[c.x+c.width,c.y+c.height]);var h=l[0]-s[0],f=l[1]-s[1],p=c.width,d=c.height,g=i.coordinateSystem=new bc;g.zoomLimit=i.get("scaleLimit"),g.setBoundingRect(s[0],s[1],h,f),g.setViewRect(c.x,c.y,p,d),g.setCenter(i.get("center"),e),g.setZoom(i.get("zoom")),t.push(g)}}),t}var oY=ei.prototype,cU=Hp.prototype,sY=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return r}(),YQe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(sY);function hU(r){return isNaN(+r.cpx1)||isNaN(+r.cpy1)}var xye=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="ec-line",i}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new sY},e.prototype.buildPath=function(t,i){hU(i)?oY.buildPath.call(this,t,i):cU.buildPath.call(this,t,i)},e.prototype.pointAt=function(t){return hU(this.shape)?oY.pointAt.call(this,t):cU.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var i=this.shape,n=hU(i)?[i.x2-i.x1,i.y2-i.y1]:cU.tangentAt.call(this,t);return Cs(n,n)},e}(pt),lY=xye;var fU=["fromSymbol","toSymbol"];function uY(r){return"_"+r+"Type"}function cY(r,e,t){var i=e.getItemVisual(t,r);if(!i||i==="none")return i;var n=e.getItemVisual(t,r+"Size"),a=e.getItemVisual(t,r+"Rotate"),o=e.getItemVisual(t,r+"Offset"),s=e.getItemVisual(t,r+"KeepAspect"),l=Pl(n),u=ss(o||0,l);return i+l+u+(a||"")+(s||"")}function hY(r,e,t){var i=e.getItemVisual(t,r);if(!(!i||i==="none")){var n=e.getItemVisual(t,r+"Size"),a=e.getItemVisual(t,r+"Rotate"),o=e.getItemVisual(t,r+"Offset"),s=e.getItemVisual(t,r+"KeepAspect"),l=Pl(n),u=ss(o||0,l),c=wr(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=a==null||isNaN(a)?void 0:+a*Math.PI/180||0,c.name=r,c}}function Sye(r){var e=new lY({name:"line",subPixelOptimize:!0});return pU(e.shape,r),e}function pU(r,e){r.x1=e[0][0],r.y1=e[0][1],r.x2=e[1][0],r.y2=e[1][1],r.percent=1;var t=e[2];t?(r.cpx1=t[0],r.cpy1=t[1]):(r.cpx1=NaN,r.cpy1=NaN)}var Mye=function(r){Z(e,r);function e(t,i,n){var a=r.call(this)||this;return a._createLine(t,i,n),a}return e.prototype._createLine=function(t,i,n){var a=t.hostModel,o=t.getItemLayout(i),s=Sye(o);s.shape.percent=0,lr(s,{shape:{percent:1}},a,i),this.add(s),N(fU,function(l){var u=hY(l,t,i);this.add(u),this[uY(l)]=cY(l,t,i)},this),this._updateCommonStl(t,i,n)},e.prototype.updateData=function(t,i,n){var a=t.hostModel,o=this.childOfName("line"),s=t.getItemLayout(i),l={shape:{}};pU(l.shape,s),Ut(o,l,a,i),N(fU,function(u){var c=cY(u,t,i),h=uY(u);if(this[h]!==c){this.remove(this.childOfName(u));var f=hY(u,t,i);this.add(f)}this[h]=c},this),this._updateCommonStl(t,i,n)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,i,n){var a=t.hostModel,o=this.childOfName("line"),s=n&&n.emphasisLineStyle,l=n&&n.blurLineStyle,u=n&&n.selectLineStyle,c=n&&n.labelStatesModels,h=n&&n.emphasisDisabled,f=n&&n.focus,p=n&&n.blurScope;if(!n||t.hasItemOption){var d=t.getItemModel(i),g=d.getModel("emphasis");s=g.getModel("lineStyle").getLineStyle(),l=d.getModel(["blur","lineStyle"]).getLineStyle(),u=d.getModel(["select","lineStyle"]).getLineStyle(),h=g.get("disabled"),f=g.get("focus"),p=g.get("blurScope"),c=Rr(d)}var m=t.getItemVisual(i,"style"),v=m.stroke;o.useStyle(m),o.style.fill=null,o.style.strokeNoScale=!0,o.ensureState("emphasis").style=s,o.ensureState("blur").style=l,o.ensureState("select").style=u,N(fU,function(S){var w=this.childOfName(S);if(w){w.setColor(v),w.style.opacity=m.opacity;for(var T=0;T<Vi.length;T++){var C=Vi[T],b=o.getState(C);if(b){var E=b.style||{},I=w.ensureState(C),R=I.style||(I.style={});E.stroke!=null&&(R[w.__isEmptyBrush?"stroke":"fill"]=E.stroke),E.opacity!=null&&(R.opacity=E.opacity)}}w.markRedraw()}},this);var _=a.getRawValue(i);Fr(this,c,{labelDataIndex:i,labelFetcher:{getFormattedLabel:function(S,w){return a.getFormattedLabel(S,w,t.dataType)}},inheritColor:v||"#000",defaultOpacity:m.opacity,defaultText:(_==null?t.getName(i):isFinite(_)?Pr(_):_)+""});var y=this.getTextContent();if(y){var x=c.normal;y.__align=y.style.align,y.__verticalAlign=y.style.verticalAlign,y.__position=x.get("position")||"middle";var M=x.get("distance");pe(M)||(M=[M,M]),y.__labelDistance=M}this.setTextConfig({position:null,local:!0,inside:!1}),sr(this,f,p,h)},e.prototype.highlight=function(){Zn(this)},e.prototype.downplay=function(){jn(this)},e.prototype.updateLayout=function(t,i){this.setLinePoints(t.getItemLayout(i))},e.prototype.setLinePoints=function(t){var i=this.childOfName("line");pU(i.shape,t),i.dirty()},e.prototype.beforeUpdate=function(){var t=this,i=t.childOfName("fromSymbol"),n=t.childOfName("toSymbol"),a=t.getTextContent();if(!i&&!n&&(!a||a.ignore))return;for(var o=1,s=this.parent;s;)s.scaleX&&(o/=s.scaleX),s=s.parent;var l=t.childOfName("line");if(!this.__dirty&&!l.__dirty)return;var u=l.shape.percent,c=l.pointAt(0),h=l.pointAt(u),f=yl([],h,c);Cs(f,f);function p(b,E){var I=b.__specifiedRotation;if(I==null){var R=l.tangentAt(E);b.attr("rotation",(E===1?-1:1)*Math.PI/2-Math.atan2(R[1],R[0]))}else b.attr("rotation",I)}if(i&&(i.setPosition(c),p(i,0),i.scaleX=i.scaleY=o*u,i.markRedraw()),n&&(n.setPosition(h),p(n,1),n.scaleX=n.scaleY=o*u,n.markRedraw()),a&&!a.ignore){a.x=a.y=0,a.originX=a.originY=0;var d=void 0,g=void 0,m=a.__labelDistance,v=m[0]*o,_=m[1]*o,y=u/2,x=l.tangentAt(y),M=[x[1],-x[0]],S=l.pointAt(y);M[1]>0&&(M[0]=-M[0],M[1]=-M[1]);var w=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var T=-Math.atan2(x[1],x[0]);h[0]<c[0]&&(T=Math.PI+T),a.rotation=T}var C=void 0;switch(a.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":C=-_,g="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":C=_,g="top";break;default:C=0,g="middle"}switch(a.__position){case"end":a.x=f[0]*v+h[0],a.y=f[1]*_+h[1],d=f[0]>.8?"left":f[0]<-.8?"right":"center",g=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*v+c[0],a.y=-f[1]*_+c[1],d=f[0]>.8?"right":f[0]<-.8?"left":"center",g=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=v*w+c[0],a.y=c[1]+C,d=x[0]<0?"right":"left",a.originX=-v*w,a.originY=-C;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=S[0],a.y=S[1]+C,d="center",a.originY=-C;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-v*w+h[0],a.y=h[1]+C,d=x[0]>=0?"right":"left",a.originX=v*w,a.originY=-C;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||d})}},e}(Ze),qv=Mye;var bye=function(){function r(e){this.group=new Ze,this._LineCtor=e||qv}return r.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var i=this,n=i.group,a=i._lineData;i._lineData=e,a||n.removeAll();var o=fY(e);e.diff(a).add(function(s){t._doAdd(e,s,o)}).update(function(s,l){t._doUpdate(a,e,l,s,o)}).remove(function(s){n.remove(a.getItemGraphicEl(s))}).execute()},r.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,i){t.updateLayout(e,i)},this)},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=fY(e),this._lineData=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function i(s){!s.isGroup&&!wye(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var n=e.start;n<e.end;n++){var a=t.getItemLayout(n);if(dU(a)){var o=new this._LineCtor(t,n,this._seriesScope);o.traverse(i),this.group.add(o),t.setItemGraphicEl(n,o),this._progressiveEls.push(o)}}},r.prototype.remove=function(){this.group.removeAll()},r.prototype.eachRendered=function(e){ya(this._progressiveEls||this.group,e)},r.prototype._doAdd=function(e,t,i){var n=e.getItemLayout(t);if(dU(n)){var a=new this._LineCtor(e,t,i);e.setItemGraphicEl(t,a),this.group.add(a)}},r.prototype._doUpdate=function(e,t,i,n,a){var o=e.getItemGraphicEl(i);if(!dU(t.getItemLayout(n))){this.group.remove(o);return}o?o.updateData(t,n,a):o=new this._LineCtor(t,n,a),t.setItemGraphicEl(n,o),this.group.add(o)},r}();function wye(r){return r.animators&&r.animators.length>0}function fY(r){var e=r.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:Rr(e)}}function pY(r){return isNaN(r[0])||isNaN(r[1])}function dU(r){return r&&!pY(r[0])&&!pY(r[1])}var Zv=bye;var mU=[],vU=[],gU=[],jv=xi,yU=ec,dY=Math.abs;function mY(r,e,t){for(var i=r[0],n=r[1],a=r[2],o=1/0,s,l=t*t,u=.1,c=.1;c<=.9;c+=.1){mU[0]=jv(i[0],n[0],a[0],c),mU[1]=jv(i[1],n[1],a[1],c);var h=dY(yU(mU,e)-l);h<o&&(o=h,s=c)}for(var f=0;f<32;f++){var p=s+u;vU[0]=jv(i[0],n[0],a[0],s),vU[1]=jv(i[1],n[1],a[1],s),gU[0]=jv(i[0],n[0],a[0],p),gU[1]=jv(i[1],n[1],a[1],p);var h=yU(vU,e)-l;if(dY(h)<.01)break;var d=yU(gU,e)-l;u/=2,h<0?d>=0?s=s+u:s=s-u:d>=0?s=s-u:s=s+u}return s}function mS(r,e){var t=[],i=xh,n=[[],[],[]],a=[[],[]],o=[];e/=2,r.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),h=s.getVisual("toSymbol");u.__original||(u.__original=[ho(u[0]),ho(u[1])],u[2]&&u.__original.push(ho(u[2])));var f=u.__original;if(u[2]!=null){if(ji(n[0],f[0]),ji(n[1],f[2]),ji(n[2],f[1]),c&&c!=="none"){var p=gd(s.node1),d=mY(n,f[0],p*e);i(n[0][0],n[1][0],n[2][0],d,t),n[0][0]=t[3],n[1][0]=t[4],i(n[0][1],n[1][1],n[2][1],d,t),n[0][1]=t[3],n[1][1]=t[4]}if(h&&h!=="none"){var p=gd(s.node2),d=mY(n,f[1],p*e);i(n[0][0],n[1][0],n[2][0],d,t),n[1][0]=t[1],n[2][0]=t[2],i(n[0][1],n[1][1],n[2][1],d,t),n[1][1]=t[1],n[2][1]=t[2]}ji(u[0],n[0]),ji(u[1],n[2]),ji(u[2],n[1])}else{if(ji(a[0],f[0]),ji(a[1],f[1]),yl(o,a[1],a[0]),Cs(o,o),c&&c!=="none"){var p=gd(s.node1);__(a[0],a[0],o,p*e)}if(h&&h!=="none"){var p=gd(s.node2);__(a[1],a[1],o,-p*e)}ji(u[0],a[0]),ji(u[1],a[1])}})}function vY(r){return r.type==="view"}var Tye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){var n=new Cu,a=new Zv,o=this.group;this._controller=new Pu(i.getZr()),this._controllerHost={target:o},o.add(n.group),o.add(a.group),this._symbolDraw=n,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,i,n){var a=this,o=t.coordinateSystem;this._model=t;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(vY(o)){var c={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(c):Ut(u,c,t)}mS(t.getGraph(),vd(t));var h=t.getData();s.updateData(h);var f=t.getEdgeData();l.updateData(f),this._updateNodeAndLinkScale(),this._updateController(t,i,n),clearTimeout(this._layoutTimeout);var p=t.forceLayout,d=t.get(["force","layoutAnimation"]);p&&this._startForceLayoutIteration(p,d);var g=t.get("layout");h.graph.eachNode(function(y){var x=y.dataIndex,M=y.getGraphicEl(),S=y.getModel();if(M){M.off("drag").off("dragend");var w=S.get("draggable");w&&M.on("drag",function(C){switch(g){case"force":p.warmUp(),!a._layouting&&a._startForceLayoutIteration(p,d),p.setFixed(x),h.setItemLayout(x,[M.x,M.y]);break;case"circular":h.setItemLayout(x,[M.x,M.y]),y.setLayout({fixed:!0},!0),Xv(t,"symbolSize",y,[C.offsetX,C.offsetY]),a.updateLayout(t);break;case"none":default:h.setItemLayout(x,[M.x,M.y]),dS(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){p&&p.setUnfixed(x)}),M.setDraggable(w,!!S.get("cursor"));var T=S.get(["emphasis","focus"]);T==="adjacency"&&(it(M).focus=y.getAdjacentDataIndices())}}),h.graph.eachEdge(function(y){var x=y.getGraphicEl(),M=y.getModel().get(["emphasis","focus"]);x&&M==="adjacency"&&(it(x).focus={edge:[y.dataIndex],node:[y.node1.dataIndex,y.node2.dataIndex]})});var m=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),v=h.getLayout("cx"),_=h.getLayout("cy");h.graph.eachNode(function(y){oU(y,m,v,_)}),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,i){var n=this;(function a(){t.step(function(o){n.updateLayout(n._model),(n._layouting=!o)&&(i?n._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,i,n){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,c,h){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(c,h)&&!Jh(u,n,t)}),!vY(t.coordinateSystem)){o.disable();return}o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){Fv(s,u.dx,u.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){Bv(s,u.scale,u.originX,u.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),mS(t.getGraph(),vd(t)),a._lineDraw.updateLayout(),n.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,i=t.getData(),n=vd(t);i.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(n)})},e.prototype.updateLayout=function(t){mS(t.getGraph(),vd(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(Zt),gY=Tye;function Kv(r){return"_EC_"+r}var Eye=function(){function r(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var i=this._nodesMap;if(!i[Kv(e)]){var n=new yd(e,t);return n.hostGraph=this,this.nodes.push(n),i[Kv(e)]=n,n}},r.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},r.prototype.getNodeById=function(e){return this._nodesMap[Kv(e)]},r.prototype.addEdge=function(e,t,i){var n=this._nodesMap,a=this._edgesMap;if(Dt(e)&&(e=this.nodes[e]),Dt(t)&&(t=this.nodes[t]),e instanceof yd||(e=n[Kv(e)]),t instanceof yd||(t=n[Kv(t)]),!(!e||!t)){var o=e.id+"-"+t.id,s=new yY(e,t,i);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),a[o]=s,s}},r.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},r.prototype.getEdge=function(e,t){e instanceof yd&&(e=e.id),t instanceof yd&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},r.prototype.eachNode=function(e,t){for(var i=this.nodes,n=i.length,a=0;a<n;a++)i[a].dataIndex>=0&&e.call(t,i[a],a)},r.prototype.eachEdge=function(e,t){for(var i=this.edges,n=i.length,a=0;a<n;a++)i[a].dataIndex>=0&&i[a].node1.dataIndex>=0&&i[a].node2.dataIndex>=0&&e.call(t,i[a],a)},r.prototype.breadthFirstTraverse=function(e,t,i,n){if(t instanceof yd||(t=this._nodesMap[Kv(t)]),!!t){for(var a=i==="out"?"outEdges":i==="in"?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(n,t,null))for(var s=[t];s.length;)for(var l=s.shift(),u=l[a],o=0;o<u.length;o++){var c=u[o],h=c.node1===l?c.node2:c.node1;if(!h.__visited){if(e.call(n,h,l))return;s.push(h),h.__visited=!0}}}},r.prototype.update=function(){for(var e=this.data,t=this.edgeData,i=this.nodes,n=this.edges,a=0,o=i.length;a<o;a++)i[a].dataIndex=-1;for(var a=0,o=e.count();a<o;a++)i[e.getRawIndex(a)].dataIndex=a;t.filterSelf(function(s){var l=n[t.getRawIndex(s)];return l.node1.dataIndex>=0&&l.node2.dataIndex>=0});for(var a=0,o=n.length;a<o;a++)n[a].dataIndex=-1;for(var a=0,o=t.count();a<o;a++)n[t.getRawIndex(a)].dataIndex=a},r.prototype.clone=function(){for(var e=new r(this._directed),t=this.nodes,i=this.edges,n=0;n<t.length;n++)e.addNode(t[n].id,t[n].dataIndex);for(var n=0;n<i.length;n++){var a=i[n];e.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return e},r}(),yd=function(){function r(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=e??"",this.dataIndex=t??-1}return r.prototype.degree=function(){return this.edges.length},r.prototype.inDegree=function(){return this.inEdges.length},r.prototype.outDegree=function(){return this.outEdges.length},r.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostGraph,i=t.data.getItemModel(this.dataIndex);return i.getModel(e)}},r.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var i=this.edges[t];i.dataIndex<0||(e.edge.push(i.dataIndex),e.node.push(i.node1.dataIndex,i.node2.dataIndex))}return e},r.prototype.getTrajectoryDataIndices=function(){for(var e=ke(),t=ke(),i=0;i<this.edges.length;i++){var n=this.edges[i];if(!(n.dataIndex<0)){e.set(n.dataIndex,!0);for(var a=[n.node1],o=[n.node2],s=0;s<a.length;){var l=a[s];s++,t.set(l.dataIndex,!0);for(var u=0;u<l.inEdges.length;u++)e.set(l.inEdges[u].dataIndex,!0),a.push(l.inEdges[u].node1)}for(s=0;s<o.length;){var c=o[s];s++,t.set(c.dataIndex,!0);for(var u=0;u<c.outEdges.length;u++)e.set(c.outEdges[u].dataIndex,!0),o.push(c.outEdges[u].node2)}}}return{edge:e.keys(),node:t.keys()}},r}(),yY=function(){function r(e,t,i){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=i??-1}return r.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostGraph,i=t.edgeData.getItemModel(this.dataIndex);return i.getModel(e)}},r.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},r.prototype.getTrajectoryDataIndices=function(){var e=ke(),t=ke();e.set(this.dataIndex,!0);for(var i=[this.node1],n=[this.node2],a=0;a<i.length;){var o=i[a];a++,t.set(o.dataIndex,!0);for(var s=0;s<o.inEdges.length;s++)e.set(o.inEdges[s].dataIndex,!0),i.push(o.inEdges[s].node1)}for(a=0;a<n.length;){var l=n[a];a++,t.set(l.dataIndex,!0);for(var s=0;s<l.outEdges.length;s++)e.set(l.outEdges[s].dataIndex,!0),n.push(l.outEdges[s].node2)}return{edge:e.keys(),node:t.keys()}},r}();function _Y(r,e){return{getValue:function(t){var i=this[r][e];return i.getStore().get(i.getDimensionIndex(t||"value"),this.dataIndex)},setVisual:function(t,i){this.dataIndex>=0&&this[r][e].setItemVisual(this.dataIndex,t,i)},getVisual:function(t){return this[r][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,i){this.dataIndex>=0&&this[r][e].setItemLayout(this.dataIndex,t,i)},getLayout:function(){return this[r][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][e].getRawIndex(this.dataIndex)}}}Cr(yd,_Y("hostGraph","data"));Cr(yY,_Y("hostGraph","edgeData"));var xY=Eye;function vS(r,e,t,i,n){for(var a=new xY(i),o=0;o<r.length;o++)a.addNode(Hr(r[o].id,r[o].name,o),o);for(var s=[],l=[],u=0,o=0;o<e.length;o++){var c=e[o],h=c.source,f=c.target;a.addEdge(h,f,u)&&(l.push(c),s.push(Hr(Kr(c.id,null),h+" > "+f)),u++)}var p=t.get("coordinateSystem"),d;if(p==="cartesian2d"||p==="polar")d=mn(r,t);else{var g=gc.get(p),m=g?g.dimensions||[]:[];yt(m,"value")<0&&m.concat(["value"]);var v=Nl(r,{coordDimensions:m,encodeDefine:t.getEncode()}).dimensions;d=new oi(v,t),d.initData(r)}var _=new oi(["value"],t);return _.initData(l,s),n&&n(d,_),lE({mainData:d,struct:a,structAttr:"graph",datas:{node:d,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var Aye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments);var i=this;function n(){return i._categoriesData}this.legendVisualProvider=new Du(n,n),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){r.prototype.mergeDefaultAndTheme.apply(this,arguments),rs(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,i){var n=t.edges||t.links||[],a=t.data||t.nodes||[],o=this;if(a&&n){rY(this);var s=vS(a,n,this,!0,l);return N(s.edges,function(u){iY(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(d){var g=o._categoriesModels,m=d.getShallow("category"),v=g[m];return v&&(v.parentModel=d.parentModel,d.parentModel=v),d});var h=Jt.prototype.getModel;function f(d,g){var m=h.call(this,d,g);return m.resolveParentPath=p,m}c.wrapMethod("getItemModel",function(d){return d.resolveParentPath=p,d.getModel=f,d});function p(d){if(d&&(d[0]==="label"||d[1]==="label")){var g=d.slice();return d[0]==="label"?g[0]="edgeLabel":d[1]==="label"&&(g[1]="edgeLabel"),g}return d}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,i,n){if(n==="edge"){var a=this.getData(),o=this.getDataParams(t,n),s=a.graph.getEdgeByIndex(t),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),kr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var h=z1({series:this,dataIndex:t,multipleSeries:i});return h},e.prototype._updateCategoriesData=function(){var t=de(this.option.categories||[],function(n){return n.value!=null?n:he({value:0},n)}),i=new oi(["value"],this);i.initData(t),this._categoriesData=i,this._categoriesModels=i.mapArray(function(n){return i.getItemModel(n)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}($t),SY=Aye;var Cye={type:"graphRoam",event:"graphRoam",update:"none"};function _U(r){r.registerChartView(gY),r.registerSeriesModel(SY),r.registerProcessor(QN),r.registerVisual(eU),r.registerVisual(tU),r.registerLayout(nU),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,sU),r.registerLayout(lU),r.registerCoordinateSystem("graphView",{dimensions:bc.dimensions,create:uU}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},zr),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},zr),r.registerAction(Cye,function(e,t,i){t.eachComponent({mainType:"series",query:e},function(n){var a=n.coordinateSystem,o=kv(a,e,void 0,i);n.setCenter&&n.setCenter(o.center),n.setZoom&&n.setZoom(o.zoom)})})}var Rye=function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r}(),Lye=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="pointer",i}return e.prototype.getDefaultShape=function(){return new Rye},e.prototype.buildPath=function(t,i){var n=Math.cos,a=Math.sin,o=i.r,s=i.width,l=i.angle,u=i.x-n(l)*s*(s>=o/3?1:2),c=i.y-a(l)*s*(s>=o/3?1:2);l=i.angle-Math.PI/2,t.moveTo(u,c),t.lineTo(i.x+n(l)*s,i.y+a(l)*s),t.lineTo(i.x+n(i.angle)*o,i.y+a(i.angle)*o),t.lineTo(i.x-n(l)*s,i.y-a(l)*s),t.lineTo(u,c)},e}(pt),MY=Lye;function Dye(r,e){var t=r.get("center"),i=e.getWidth(),n=e.getHeight(),a=Math.min(i,n),o=ze(t[0],e.getWidth()),s=ze(t[1],e.getHeight()),l=ze(r.get("radius"),a/2);return{cx:o,cy:s,r:l}}function gE(r,e){var t=r==null?"":r+"";return e&&(Ce(e)?t=e.replace("{value}",t):He(e)&&(t=e(r))),t}var Pye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),o=Dye(t,n);this._renderMain(t,i,n,a,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,i,n,a,o){var s=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,c=-t.get("endAngle")/180*Math.PI,h=t.getModel("axisLine"),f=h.get("roundCap"),p=f?Ov:Mi,d=h.get("show"),g=h.getModel("lineStyle"),m=g.get("width"),v=[u,c];q_(v,!l),u=v[0],c=v[1];for(var _=c-u,y=u,x=[],M=0;d&&M<a.length;M++){var S=Math.min(Math.max(a[M][0],0),1);c=u+_*S;var w=new p({shape:{startAngle:y,endAngle:c,cx:o.cx,cy:o.cy,clockwise:l,r0:o.r-m,r:o.r},silent:!0});w.setStyle({fill:a[M][1]}),w.setStyle(g.getLineStyle(["color","width"])),x.push(w),y=c}x.reverse(),N(x,function(C){return s.add(C)});var T=function(C){if(C<=0)return a[0][1];var b;for(b=0;b<a.length;b++)if(a[b][0]>=C&&(b===0?0:a[b-1][0])<C)return a[b][1];return a[b-1][1]};this._renderTicks(t,i,n,T,o,u,c,l,m),this._renderTitleAndDetail(t,i,n,T,o),this._renderAnchor(t,o),this._renderPointer(t,i,n,T,o,u,c,l,m)},e.prototype._renderTicks=function(t,i,n,a,o,s,l,u,c){for(var h=this.group,f=o.cx,p=o.cy,d=o.r,g=+t.get("min"),m=+t.get("max"),v=t.getModel("splitLine"),_=t.getModel("axisTick"),y=t.getModel("axisLabel"),x=t.get("splitNumber"),M=_.get("splitNumber"),S=ze(v.get("length"),d),w=ze(_.get("length"),d),T=s,C=(l-s)/x,b=C/M,E=v.getModel("lineStyle").getLineStyle(),I=_.getModel("lineStyle").getLineStyle(),R=v.get("distance"),A,P,U=0;U<=x;U++){if(A=Math.cos(T),P=Math.sin(T),v.get("show")){var B=R?R+c:c,z=new ei({shape:{x1:A*(d-B)+f,y1:P*(d-B)+p,x2:A*(d-S-B)+f,y2:P*(d-S-B)+p},style:E,silent:!0});E.stroke==="auto"&&z.setStyle({stroke:a(U/x)}),h.add(z)}if(y.get("show")){var B=y.get("distance")+R,k=gE(Pr(U/x*(m-g)+g),y.get("formatter")),G=a(U/x),Y=A*(d-S-B)+f,J=P*(d-S-B)+p,Q=y.get("rotate"),V=0;Q==="radial"?(V=-T+2*Math.PI,V>Math.PI/2&&(V+=Math.PI)):Q==="tangential"?V=-T-Math.PI/2:Dt(Q)&&(V=Q*Math.PI/180),V===0?h.add(new It({style:pr(y,{text:k,x:Y,y:J,verticalAlign:P<-.8?"top":P>.8?"bottom":"middle",align:A<-.4?"left":A>.4?"right":"center"},{inheritColor:G}),silent:!0})):h.add(new It({style:pr(y,{text:k,x:Y,y:J,verticalAlign:"middle",align:"center"},{inheritColor:G}),silent:!0,originX:Y,originY:J,rotation:V}))}if(_.get("show")&&U!==x){var B=_.get("distance");B=B?B+c:c;for(var K=0;K<=M;K++){A=Math.cos(T),P=Math.sin(T);var ae=new ei({shape:{x1:A*(d-B)+f,y1:P*(d-B)+p,x2:A*(d-w-B)+f,y2:P*(d-w-B)+p},silent:!0,style:I});I.stroke==="auto"&&ae.setStyle({stroke:a((U+K/M)/x)}),h.add(ae),T+=b}T-=b}else T+=C}},e.prototype._renderPointer=function(t,i,n,a,o,s,l,u,c){var h=this.group,f=this._data,p=this._progressEls,d=[],g=t.get(["pointer","show"]),m=t.getModel("progress"),v=m.get("show"),_=t.getData(),y=_.mapDimension("value"),x=+t.get("min"),M=+t.get("max"),S=[x,M],w=[s,l];function T(b,E){var I=_.getItemModel(b),R=I.getModel("pointer"),A=ze(R.get("width"),o.r),P=ze(R.get("length"),o.r),U=t.get(["pointer","icon"]),B=R.get("offsetCenter"),z=ze(B[0],o.r),k=ze(B[1],o.r),G=R.get("keepAspect"),Y;return U?Y=wr(U,z-A/2,k-P,A,P,null,G):Y=new MY({shape:{angle:-Math.PI/2,width:A,r:P,x:z,y:k}}),Y.rotation=-(E+Math.PI/2),Y.x=o.cx,Y.y=o.cy,Y}function C(b,E){var I=m.get("roundCap"),R=I?Ov:Mi,A=m.get("overlap"),P=A?m.get("width"):c/_.count(),U=A?o.r-P:o.r-(b+1)*P,B=A?o.r:o.r-b*P,z=new R({shape:{startAngle:s,endAngle:E,cx:o.cx,cy:o.cy,clockwise:u,r0:U,r:B}});return A&&(z.z2=M-_.get(y,b)%M),z}(v||g)&&(_.diff(f).add(function(b){var E=_.get(y,b);if(g){var I=T(b,s);lr(I,{rotation:-((isNaN(+E)?w[0]:ar(E,S,w,!0))+Math.PI/2)},t),h.add(I),_.setItemGraphicEl(b,I)}if(v){var R=C(b,s),A=m.get("clip");lr(R,{shape:{endAngle:ar(E,S,w,A)}},t),h.add(R),j_(t.seriesIndex,_.dataType,b,R),d[b]=R}}).update(function(b,E){var I=_.get(y,b);if(g){var R=f.getItemGraphicEl(E),A=R?R.rotation:s,P=T(b,A);P.rotation=A,Ut(P,{rotation:-((isNaN(+I)?w[0]:ar(I,S,w,!0))+Math.PI/2)},t),h.add(P),_.setItemGraphicEl(b,P)}if(v){var U=p[E],B=U?U.shape.endAngle:s,z=C(b,B),k=m.get("clip");Ut(z,{shape:{endAngle:ar(I,S,w,k)}},t),h.add(z),j_(t.seriesIndex,_.dataType,b,z),d[b]=z}}).execute(),_.each(function(b){var E=_.getItemModel(b),I=E.getModel("emphasis"),R=I.get("focus"),A=I.get("blurScope"),P=I.get("disabled");if(g){var U=_.getItemGraphicEl(b),B=_.getItemVisual(b,"style"),z=B.fill;if(U instanceof Br){var k=U.style;U.useStyle(he({image:k.image,x:k.x,y:k.y,width:k.width,height:k.height},B))}else U.useStyle(B),U.type!=="pointer"&&U.setColor(z);U.setStyle(E.getModel(["pointer","itemStyle"]).getItemStyle()),U.style.fill==="auto"&&U.setStyle("fill",a(ar(_.get(y,b),S,[0,1],!0))),U.z2EmphasisLift=0,Yr(U,E),sr(U,R,A,P)}if(v){var G=d[b];G.useStyle(_.getItemVisual(b,"style")),G.setStyle(E.getModel(["progress","itemStyle"]).getItemStyle()),G.z2EmphasisLift=0,Yr(G,E),sr(G,R,A,P)}}),this._progressEls=d)},e.prototype._renderAnchor=function(t,i){var n=t.getModel("anchor"),a=n.get("show");if(a){var o=n.get("size"),s=n.get("icon"),l=n.get("offsetCenter"),u=n.get("keepAspect"),c=wr(s,i.cx-o/2+ze(l[0],i.r),i.cy-o/2+ze(l[1],i.r),o,o,null,u);c.z2=n.get("showAbove")?1:0,c.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(c)}},e.prototype._renderTitleAndDetail=function(t,i,n,a,o){var s=this,l=t.getData(),u=l.mapDimension("value"),c=+t.get("min"),h=+t.get("max"),f=new Ze,p=[],d=[],g=t.isAnimationEnabled(),m=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(v){p[v]=new It({silent:!0}),d[v]=new It({silent:!0})}).update(function(v,_){p[v]=s._titleEls[_],d[v]=s._detailEls[_]}).execute(),l.each(function(v){var _=l.getItemModel(v),y=l.get(u,v),x=new Ze,M=a(ar(y,[c,h],[0,1],!0)),S=_.getModel("title");if(S.get("show")){var w=S.get("offsetCenter"),T=o.cx+ze(w[0],o.r),C=o.cy+ze(w[1],o.r),b=p[v];b.attr({z2:m?0:2,style:pr(S,{x:T,y:C,text:l.getName(v),align:"center",verticalAlign:"middle"},{inheritColor:M})}),x.add(b)}var E=_.getModel("detail");if(E.get("show")){var I=E.get("offsetCenter"),R=o.cx+ze(I[0],o.r),A=o.cy+ze(I[1],o.r),P=ze(E.get("width"),o.r),U=ze(E.get("height"),o.r),B=t.get(["progress","show"])?l.getItemVisual(v,"style").fill:M,b=d[v],z=E.get("formatter");b.attr({z2:m?0:2,style:pr(E,{x:R,y:A,text:gE(y,z),width:isNaN(P)?null:P,height:isNaN(U)?null:U,align:"center",verticalAlign:"middle"},{inheritColor:B})}),a1(b,{normal:E},y,function(G){return gE(G,z)}),g&&o1(b,v,l,t,{getFormattedLabel:function(G,Y,J,Q,V,K){return gE(K?K.interpolatedValue:y,z)}}),x.add(b)}f.add(x)}),this.group.add(f),this._titleEls=p,this._detailEls=d},e.type="gauge",e}(Zt),bY=Pye;var Iye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,i){return us(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}($t),wY=Iye;function xU(r){r.registerChartView(bY),r.registerSeriesModel(wY)}var Nye=["itemStyle","opacity"],Uye=function(r){Z(e,r);function e(t,i){var n=r.call(this)||this,a=n,o=new ri,s=new It;return a.setTextContent(s),n.setTextGuideLine(o),n.updateData(t,i,!0),n}return e.prototype.updateData=function(t,i,n){var a=this,o=t.hostModel,s=t.getItemModel(i),l=t.getItemLayout(i),u=s.getModel("emphasis"),c=s.get(Nye);c=c??1,n||Ui(a),a.useStyle(t.getItemVisual(i,"style")),a.style.lineJoin="round",n?(a.setShape({points:l.points}),a.style.opacity=0,lr(a,{style:{opacity:c}},o,i)):Ut(a,{style:{opacity:c},shape:{points:l.points}},o,i),Yr(a,s),this._updateLabel(t,i),sr(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,i){var n=this,a=this.getTextGuideLine(),o=n.getTextContent(),s=t.hostModel,l=t.getItemModel(i),u=t.getItemLayout(i),c=u.label,h=t.getItemVisual(i,"style"),f=h.fill;Fr(o,Rr(l),{labelFetcher:t.hostModel,labelDataIndex:i,defaultOpacity:h.opacity,defaultText:t.getName(i)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}}),n.setTextConfig({local:!0,inside:!!c.inside,insideStroke:f,outsideFill:f});var p=c.linePoints;a.setShape({points:p}),n.textGuideLineConfig={anchor:p?new zt(p[0][0],p[0][1]):null},Ut(o,{style:{x:c.x,y:c.y}},s,i),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),Pv(n,Iv(l),{stroke:f})},e}(ai),Oye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new Uye(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);cc(u,t,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(Zt),TY=Oye;var zye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Du(Be(this.getData,this),Be(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,i){return us(this,{coordDimensions:["value"],encodeDefaulter:ut(_v,this)})},e.prototype._defaultLabelLine=function(t){rs(t,"labelLine",["show"]);var i=t.labelLine,n=t.emphasis.labelLine;i.show=i.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var i=this.getData(),n=r.prototype.getDataParams.call(this,t),a=i.mapDimension("value"),o=i.getSum(a);return n.percent=o?+(i.get(a,t)/o*100).toFixed(2):0,n.$vars.push("percent"),n},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}($t),EY=zye;function Fye(r,e){return br(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Bye(r,e){for(var t=r.mapDimension("value"),i=r.mapArray(t,function(l){return l}),n=[],a=e==="ascending",o=0,s=r.count();o<s;o++)n[o]=o;return He(e)?n.sort(e):e!=="none"&&n.sort(function(l,u){return a?i[l]-i[u]:i[u]-i[l]}),n}function kye(r){var e=r.hostModel,t=e.get("orient");r.each(function(i){var n=r.getItemModel(i),a=n.getModel("label"),o=a.get("position"),s=n.getModel("labelLine"),l=r.getItemLayout(i),u=l.points,c=o==="inner"||o==="inside"||o==="center"||o==="insideLeft"||o==="insideRight",h,f,p,d;if(c)o==="insideLeft"?(f=(u[0][0]+u[3][0])/2+5,p=(u[0][1]+u[3][1])/2,h="left"):o==="insideRight"?(f=(u[1][0]+u[2][0])/2-5,p=(u[1][1]+u[2][1])/2,h="right"):(f=(u[0][0]+u[1][0]+u[2][0]+u[3][0])/4,p=(u[0][1]+u[1][1]+u[2][1]+u[3][1])/4,h="center"),d=[[f,p],[f,p]];else{var g=void 0,m=void 0,v=void 0,_=void 0,y=s.get("length");o==="left"?(g=(u[3][0]+u[0][0])/2,m=(u[3][1]+u[0][1])/2,v=g-y,f=v-5,h="right"):o==="right"?(g=(u[1][0]+u[2][0])/2,m=(u[1][1]+u[2][1])/2,v=g+y,f=v+5,h="left"):o==="top"?(g=(u[3][0]+u[0][0])/2,m=(u[3][1]+u[0][1])/2,_=m-y,p=_-5,h="center"):o==="bottom"?(g=(u[1][0]+u[2][0])/2,m=(u[1][1]+u[2][1])/2,_=m+y,p=_+5,h="center"):o==="rightTop"?(g=t==="horizontal"?u[3][0]:u[1][0],m=t==="horizontal"?u[3][1]:u[1][1],t==="horizontal"?(_=m-y,p=_-5,h="center"):(v=g+y,f=v+5,h="top")):o==="rightBottom"?(g=u[2][0],m=u[2][1],t==="horizontal"?(_=m+y,p=_+5,h="center"):(v=g+y,f=v+5,h="bottom")):o==="leftTop"?(g=u[0][0],m=t==="horizontal"?u[0][1]:u[1][1],t==="horizontal"?(_=m-y,p=_-5,h="center"):(v=g-y,f=v-5,h="right")):o==="leftBottom"?(g=t==="horizontal"?u[1][0]:u[3][0],m=t==="horizontal"?u[1][1]:u[2][1],t==="horizontal"?(_=m+y,p=_+5,h="center"):(v=g-y,f=v-5,h="right")):(g=(u[1][0]+u[2][0])/2,m=(u[1][1]+u[2][1])/2,t==="horizontal"?(_=m+y,p=_+5,h="center"):(v=g+y,f=v+5,h="left")),t==="horizontal"?(v=g,f=v):(_=m,p=_),d=[[g,m],[v,_]]}l.label={linePoints:d,x:f,y:p,verticalAlign:"middle",textAlign:h,inside:c}})}function SU(r,e){r.eachSeriesByType("funnel",function(t){var i=t.getData(),n=i.mapDimension("value"),a=t.get("sort"),o=Fye(t,e),s=t.get("orient"),l=o.width,u=o.height,c=Bye(i,a),h=o.x,f=o.y,p=s==="horizontal"?[ze(t.get("minSize"),u),ze(t.get("maxSize"),u)]:[ze(t.get("minSize"),l),ze(t.get("maxSize"),l)],d=i.getDataExtent(n),g=t.get("min"),m=t.get("max");g==null&&(g=Math.min(d[0],0)),m==null&&(m=d[1]);var v=t.get("funnelAlign"),_=t.get("gap"),y=s==="horizontal"?l:u,x=(y-_*(i.count()-1))/i.count(),M=function(A,P){if(s==="horizontal"){var U=i.get(n,A)||0,B=ar(U,[g,m],p,!0),z=void 0;switch(v){case"top":z=f;break;case"center":z=f+(u-B)/2;break;case"bottom":z=f+(u-B);break}return[[P,z],[P,z+B]]}var k=i.get(n,A)||0,G=ar(k,[g,m],p,!0),Y;switch(v){case"left":Y=h;break;case"center":Y=h+(l-G)/2;break;case"right":Y=h+l-G;break}return[[Y,P],[Y+G,P]]};a==="ascending"&&(x=-x,_=-_,s==="horizontal"?h+=l:f+=u,c=c.reverse());for(var S=0;S<c.length;S++){var w=c[S],T=c[S+1],C=i.getItemModel(w);if(s==="horizontal"){var b=C.get(["itemStyle","width"]);b==null?b=x:(b=ze(b,l),a==="ascending"&&(b=-b));var E=M(w,h),I=M(T,h+b);h+=b+_,i.setItemLayout(w,{points:E.concat(I.slice().reverse())})}else{var R=C.get(["itemStyle","height"]);R==null?R=x:(R=ze(R,u),a==="ascending"&&(R=-R));var E=M(w,f),I=M(T,f+R);f+=R+_,i.setItemLayout(w,{points:E.concat(I.slice().reverse())})}}kye(i)})}function MU(r){r.registerChartView(TY),r.registerSeriesModel(EY),r.registerLayout(SU),r.registerProcessor(kl("funnel"))}var Vye=.3,Gye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._dataGroup=new Ze,t._initialized=!1,t}return e.prototype.init=function(){this.group.add(this._dataGroup)},e.prototype.render=function(t,i,n,a){this._progressiveEls=null;var o=this._dataGroup,s=t.getData(),l=this._data,u=t.coordinateSystem,c=u.dimensions,h=CY(t);s.diff(l).add(f).update(p).remove(d).execute();function f(m){var v=AY(s,o,m,c,u);bU(v,s,m,h)}function p(m,v){var _=l.getItemGraphicEl(v),y=RY(s,m,c,u);s.setItemGraphicEl(m,_),Ut(_,{shape:{points:y}},t,m),Ui(_),bU(_,s,m,h)}function d(m){var v=l.getItemGraphicEl(m);o.remove(v)}if(!this._initialized){this._initialized=!0;var g=Hye(u,t,function(){setTimeout(function(){o.removeClipPath()})});o.setClipPath(g)}this._data=s},e.prototype.incrementalPrepareRender=function(t,i,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},e.prototype.incrementalRender=function(t,i,n){for(var a=i.getData(),o=i.coordinateSystem,s=o.dimensions,l=CY(i),u=this._progressiveEls=[],c=t.start;c<t.end;c++){var h=AY(a,this._dataGroup,c,s,o);h.incremental=!0,bU(h,a,c,l),u.push(h)}},e.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},e.type="parallel",e}(Zt);function Hye(r,e,t){var i=r.model,n=r.getRect(),a=new Rt({shape:{x:n.x,y:n.y,width:n.width,height:n.height}}),o=i.get("layout")==="horizontal"?"width":"height";return a.setShape(o,0),lr(a,{shape:{width:n.width,height:n.height}},e,t),a}function RY(r,e,t,i){for(var n=[],a=0;a<t.length;a++){var o=t[a],s=r.get(r.mapDimension(o),e);Wye(s,i.getAxis(o).type)||n.push(i.dataToPoint(s,o))}return n}function AY(r,e,t,i,n){var a=RY(r,t,i,n),o=new ri({shape:{points:a},z2:10});return e.add(o),r.setItemGraphicEl(t,o),o}function CY(r){var e=r.get("smooth",!0);return e===!0&&(e=Vye),e=_o(e),dh(e)&&(e=0),{smooth:e}}function bU(r,e,t,i){r.useStyle(e.getItemVisual(t,"style")),r.style.fill=null,r.setShape("smooth",i.smooth);var n=e.getItemModel(t),a=n.getModel("emphasis");Yr(r,n,"lineStyle"),sr(r,a.get("focus"),a.get("blurScope"),a.get("disabled"))}function Wye(r,e){return e==="category"?r==null:r==null||isNaN(r)}var LY=Gye;var Xye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.getInitialData=function(t,i){return mn(null,this,{useEncodeDefaulter:Be(Yye,null,this)})},e.prototype.getRawIndicesByActiveState=function(t){var i=this.coordinateSystem,n=this.getData(),a=[];return i.eachActiveState(n,function(o,s){t===o&&a.push(n.getRawIndex(s))}),a},e.type="series.parallel",e.dependencies=["parallel"],e.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},e}($t);function Yye(r){var e=r.ecModel.getComponent("parallel",r.get("parallelIndex"));if(e){var t={};return N(e.dimensions,function(i){var n=qye(i);t[i]=n}),t}}function qye(r){return+r.replace("dim","")}var DY=Xye;var Zye=["lineStyle","opacity"],jye={seriesType:"parallel",reset:function(r,e){var t=r.coordinateSystem,i={normal:r.get(["lineStyle","opacity"]),active:r.get("activeOpacity"),inactive:r.get("inactiveOpacity")};return{progress:function(n,a){t.eachActiveState(a,function(o,s){var l=i[o];if(o==="normal"&&a.hasItemOption){var u=a.getItemModel(s).get(Zye,!0);u!=null&&(l=u)}var c=a.ensureUniqueItemVisual(s,"style");c.opacity=l},n.start,n.end)}}}},PY=jye;function wU(r){Kye(r),Jye(r)}function Kye(r){if(!r.parallel){var e=!1;N(r.series,function(t){t&&t.type==="parallel"&&(e=!0)}),e&&(r.parallel=[{}])}}function Jye(r){var e=tr(r.parallelAxis);N(e,function(t){if(qe(t)){var i=t.parallelIndex||0,n=tr(r.parallel)[i];n&&n.parallelAxisDefault&&bt(t,n.parallelAxisDefault,!1)}})}var $ye=5,Qye=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){this._model=t,this._api=n,this._handlers||(this._handlers={},N(e0e,function(a,o){n.getZr().on(o,this._handlers[o]=Be(a,this))},this)),Hs(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},e.prototype.dispose=function(t,i){xc(this,"_throttledDispatchExpand"),N(this._handlers,function(n,a){i.getZr().off(a,n)}),this._handlers=null},e.prototype._throttledDispatchExpand=function(t){this._dispatchExpand(t)},e.prototype._dispatchExpand=function(t){t&&this._api.dispatchAction(he({type:"parallelAxisExpand"},t))},e.type="parallel",e}(ir),e0e={mousedown:function(r){TU(this,"click")&&(this._mouseDownPoint=[r.offsetX,r.offsetY])},mouseup:function(r){var e=this._mouseDownPoint;if(TU(this,"click")&&e){var t=[r.offsetX,r.offsetY],i=Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2);if(i>$ye)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]);n.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(r){if(!(this._mouseDownPoint||!TU(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]),i=t.behavior;i==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(i==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:i==="jump"?null:{duration:0}})}}};function TU(r,e){var t=r._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}var IY=Qye;var t0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){r.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var i=this.option;t&&bt(i,t,!0),this._initDimensions()},e.prototype.contains=function(t,i){var n=t.get("parallelIndex");return n!=null&&i.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){N(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(i){t.hasOwnProperty(i)&&(this.option[i]=t[i])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],i=this.parallelAxisIndex=[],n=Yt(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);N(n,function(a){t.push("dim"+a.get("dim")),i.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Nt),NY=t0e;var r0e=function(r){Z(e,r);function e(t,i,n,a,o){var s=r.call(this,t,i,n)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(vn),UY=r0e;function Io(r,e,t,i,n,a){r=r||0;var o=t[1]-t[0];if(n!=null&&(n=Jv(n,[0,o])),a!=null&&(a=Math.max(a,n??0)),i==="all"){var s=Math.abs(e[1]-e[0]);s=Jv(s,[0,o]),n=a=Jv(s,[n,a]),i=0}e[0]=Jv(e[0],t),e[1]=Jv(e[1],t);var l=EU(e,i);e[i]+=r;var u=n||0,c=t.slice();l.sign<0?c[0]+=u:c[1]-=u,e[i]=Jv(e[i],c);var h;return h=EU(e,i),n!=null&&(h.sign!==l.sign||h.span<n)&&(e[1-i]=e[i]+l.sign*n),h=EU(e,i),a!=null&&h.span>a&&(e[1-i]=e[i]+h.sign*a),e}function EU(r,e){var t=r[e]-r[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function Jv(r,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,r))}var AU=N,FY=Math.min,BY=Math.max,OY=Math.floor,i0e=Math.ceil,zY=Pr,n0e=Math.PI,a0e=function(){function r(e,t,i){this.type="parallel",this._axesMap=ke(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,i)}return r.prototype._init=function(e,t,i){var n=e.dimensions,a=e.parallelAxisIndex;AU(n,function(o,s){var l=a[s],u=t.getComponent("parallelAxis",l),c=this._axesMap.set(o,new UY(o,Xh(u),[0,0],u.get("type"),l)),h=c.type==="category";c.onBand=h&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},r.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},r.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),i=t.axisBase,n=t.layoutBase,a=t.pixelDimIndex,o=e[1-a],s=e[a];return o>=i&&o<=i+t.axisLength&&s>=n&&s<=n+t.layoutLength},r.prototype.getModel=function(){return this._model},r.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(i){if(e.contains(i,t)){var n=i.getData();AU(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(n,n.mapDimension(a)),bu(o.scale,o.model)},this)}},this)},r.prototype.resize=function(e,t){this._rect=br(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},r.prototype.getRect=function(){return this._rect},r.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,i=["x","y"],n=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=t[n[o]],l=[0,s],u=this.dimensions.length,c=yE(e.get("axisExpandWidth"),l),h=yE(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>h&&h>1&&c>0&&s>0,p=e.get("axisExpandWindow"),d;if(p)d=yE(p[1]-p[0],l),p[1]=p[0]+d;else{d=yE(c*(h-1),l);var g=e.get("axisExpandCenter")||OY(u/2);p=[c*g-d/2],p[1]=p[0]+d}var m=(s-d)/(u-h);m<3&&(m=0);var v=[OY(zY(p[0]/c,1))+1,i0e(zY(p[1]/c,1))-1],_=m/c*p[0];return{layout:a,pixelDimIndex:o,layoutBase:t[i[o]],layoutLength:s,axisBase:t[i[1-o]],axisLength:t[n[1-o]],axisExpandable:f,axisExpandWidth:c,axisCollapseWidth:m,axisExpandWindow:p,axisCount:u,winInnerIndices:v,axisExpandWindow0Pos:_}},r.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),a=n.layout;t.each(function(o){var s=[0,n.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),AU(i,function(o,s){var l=(n.axisExpandable?s0e:o0e)(s,n),u={horizontal:{x:l.position,y:n.axisLength},vertical:{x:0,y:l.position}},c={horizontal:n0e/2,vertical:0},h=[u[a].x+e.x,u[a].y+e.y],f=c[a],p=Ci();vo(p,p,f),Tn(p,p,h),this._axesLayout[o]={position:h,rotation:f,transform:p,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},r.prototype.getAxis=function(e){return this._axesMap.get(e)},r.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},r.prototype.eachActiveState=function(e,t,i,n){i==null&&(i=0),n==null&&(n=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];N(o,function(m){s.push(e.mapDimension(m)),l.push(a.get(m).model)});for(var u=this.hasAxisBrushed(),c=i;c<n;c++){var h=void 0;if(!u)h="normal";else{h="active";for(var f=e.getValues(s,c),p=0,d=o.length;p<d;p++){var g=l[p].getActiveState(f[p]);if(g==="inactive"){h="inactive";break}}}t(h,c)}},r.prototype.hasAxisBrushed=function(){for(var e=this.dimensions,t=this._axesMap,i=!1,n=0,a=e.length;n<a;n++)t.get(e[n]).model.getActiveState()!=="normal"&&(i=!0);return i},r.prototype.axisCoordToPoint=function(e,t){var i=this._axesLayout[t];return Ln([e,0],i.transform)},r.prototype.getAxisLayout=function(e){return Qe(this._axesLayout[e])},r.prototype.getSlidedAxisExpandWindow=function(e){var t=this._makeLayoutInfo(),i=t.pixelDimIndex,n=t.axisExpandWindow.slice(),a=n[1]-n[0],o=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:n};var s=e[i]-t.layoutBase-t.axisExpandWindow0Pos,l,u="slide",c=t.axisCollapseWidth,h=this._model.get("axisExpandSlideTriggerArea"),f=h[0]!=null;if(c)f&&c&&s<a*h[0]?(u="jump",l=s-a*h[2]):f&&c&&s>a*(1-h[0])?(u="jump",l=s-a*(1-h[2])):(l=s-a*h[1])>=0&&(l=s-a*(1-h[1]))<=0&&(l=0),l*=t.axisExpandWidth/c,l?Io(l,n,o,"all"):u="none";else{var p=n[1]-n[0],d=o[1]*s/p;n=[BY(0,d-p/2)],n[1]=FY(o[1],n[0]+p),n[0]=n[1]-p}return{axisExpandWindow:n,behavior:u}},r}();function yE(r,e){return FY(BY(r,e[0]),e[1])}function o0e(r,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*r,axisNameAvailableWidth:t,axisLabelShow:!0}}function s0e(r,e){var t=e.layoutLength,i=e.axisExpandWidth,n=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,c;return r<o[0]?(s=r*a,c=a):r<=o[1]?(s=e.axisExpandWindow0Pos+r*i-e.axisExpandWindow[0],l=i,u=!0):(s=t-(n-1-r)*a,c=a),{position:s,axisNameAvailableWidth:l,axisLabelShow:u,nameTruncateMaxWidth:c}}var kY=a0e;function l0e(r,e){var t=[];return r.eachComponent("parallel",function(i,n){var a=new kY(i,r,e);a.name="parallel_"+n,a.resize(i,e),i.coordinateSystem=a,a.model=i,t.push(a)}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="parallel"){var n=i.getReferringComponents("parallel",Ir).models[0];i.coordinateSystem=n.coordinateSystem}}),t}var u0e={create:l0e},VY=u0e;var GY=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.activeIntervals=[],t}return e.prototype.getAreaSelectStyle=function(){return Mo([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},e.prototype.setActiveIntervals=function(t){var i=this.activeIntervals=Qe(t);if(i)for(var n=i.length-1;n>=0;n--)Ri(i[n])},e.prototype.getActiveState=function(t){var i=this.activeIntervals;if(!i.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(i.length===1){var n=i[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var a=0,o=i.length;a<o;a++)if(i[a][0]<=t&&t<=i[a][1])return"active";return"inactive"},e}(Nt);Cr(GY,wu);var CU=GY;var _d=!0,gS=Math.min,$v=Math.max,c0e=Math.pow,h0e=1e4,f0e=6,p0e=6,HY="globalPan",d0e={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},m0e={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},WY={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},v0e=0,g0e=function(r){Z(e,r);function e(t){var i=r.call(this)||this;return i._track=[],i._covers=[],i._handlers={},i._zr=t,i.group=new Ze,i._uid="brushController_"+v0e++,N(w0e,function(n,a){this._handlers[a]=Be(n,this)},i),i}return e.prototype.enableBrush=function(t){return this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},e.prototype._doEnableBrush=function(t){var i=this._zr;this._enableGlobalPan||I9(i,HY,this._uid),N(this._handlers,function(n,a){i.on(a,n)}),this._brushType=t.brushType,this._brushOption=bt(Qe(WY),t,!0)},e.prototype._doDisableBrush=function(){var t=this._zr;N9(t,HY,this._uid),N(this._handlers,function(i,n){t.off(n,i)}),this._brushType=this._brushOption=null},e.prototype.setPanels=function(t){if(t&&t.length){var i=this._panels={};N(t,function(n){i[n.panelId]=Qe(n)})}else this._panels=null;return this},e.prototype.mount=function(t){t=t||{},this._enableGlobalPan=t.enableGlobalPan;var i=this.group;return this._zr.add(i),i.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=i.getLocalTransform(),this},e.prototype.updateCovers=function(t){t=de(t,function(f){return bt(Qe(WY),f,!0)});var i="\0-brush-index-",n=this._covers,a=this._covers=[],o=this,s=this._creatingCover;return new In(n,t,u,l).add(c).update(c).remove(h).execute(),this;function l(f,p){return(f.id!=null?f.id:i+p)+"-"+f.brushType}function u(f,p){return l(f.__brushOption,p)}function c(f,p){var d=t[f];if(p!=null&&n[p]===s)a[f]=n[p];else{var g=a[f]=p!=null?(n[p].__brushOption=d,n[p]):KY(o,jY(o,d));NU(o,g)}}function h(f){n[f]!==s&&o.group.remove(n[f])}},e.prototype.unmount=function(){return this.enableBrush(!1),RU(this),this._zr.remove(this.group),this},e.prototype.dispose=function(){this.unmount(),this.off()},e}(Ni);function jY(r,e){var t=_E[e.brushType].createCover(r,e);return t.__brushOption=e,$Y(t,e),r.group.add(t),t}function KY(r,e){var t=UU(e);return t.endCreating&&(t.endCreating(r,e),$Y(e,e.__brushOption)),e}function JY(r,e){var t=e.__brushOption;UU(e).updateCoverShape(r,e,t.range,t)}function $Y(r,e){var t=e.z;t==null&&(t=h0e),r.traverse(function(i){i.z=t,i.z2=t})}function NU(r,e){UU(e).updateCommon(r,e),JY(r,e)}function UU(r){return _E[r.__brushOption.brushType]}function OU(r,e,t){var i=r._panels;if(!i)return _d;var n,a=r._transform;return N(i,function(o){o.isTargetByCursor(e,t,a)&&(n=o)}),n}function QY(r,e){var t=r._panels;if(!t)return _d;var i=e.__brushOption.panelId;return i!=null?t[i]:_d}function RU(r){var e=r._covers,t=e.length;return N(e,function(i){r.group.remove(i)},r),e.length=0,!!t}function xd(r,e){var t=de(r._covers,function(i){var n=i.__brushOption,a=Qe(n.range);return{brushType:n.brushType,panelId:n.panelId,range:a}});r.trigger("brush",{areas:t,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function y0e(r){var e=r._track;if(!e.length)return!1;var t=e[e.length-1],i=e[0],n=t[0]-i[0],a=t[1]-i[1],o=c0e(n*n+a*a,.5);return o>f0e}function eq(r){var e=r.length-1;return e<0&&(e=0),[r[0],r[e]]}function tq(r,e,t,i){var n=new Ze;return n.add(new Rt({name:"main",style:zU(t),silent:!0,draggable:!0,cursor:"move",drift:ut(XY,r,e,n,["n","s","w","e"]),ondragend:ut(xd,e,{isEnd:!0})})),N(i,function(a){n.add(new Rt({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:ut(XY,r,e,n,a),ondragend:ut(xd,e,{isEnd:!0})}))}),n}function rq(r,e,t,i){var n=i.brushStyle.lineWidth||0,a=$v(n,p0e),o=t[0][0],s=t[1][0],l=o-n/2,u=s-n/2,c=t[0][1],h=t[1][1],f=c-a+n/2,p=h-a+n/2,d=c-o,g=h-s,m=d+n,v=g+n;Tc(r,e,"main",o,s,d,g),i.transformable&&(Tc(r,e,"w",l,u,a,v),Tc(r,e,"e",f,u,a,v),Tc(r,e,"n",l,u,m,a),Tc(r,e,"s",l,p,m,a),Tc(r,e,"nw",l,u,a,a),Tc(r,e,"ne",f,u,a,a),Tc(r,e,"sw",l,p,a,a),Tc(r,e,"se",f,p,a,a))}function LU(r,e){var t=e.__brushOption,i=t.transformable,n=e.childAt(0);n.useStyle(zU(t)),n.attr({silent:!i,cursor:i?"move":"default"}),N([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?DU(r,a[0]):x0e(r,a);o&&o.attr({silent:!i,invisible:!i,cursor:i?m0e[s]+"-resize":null})})}function Tc(r,e,t,i,n,a,o){var s=e.childOfName(t);s&&s.setShape(M0e(FU(r,e,[[i,n],[i+a,n+o]])))}function zU(r){return Ye({strokeNoScale:!0},r.brushStyle)}function iq(r,e,t,i){var n=[gS(r,t),gS(e,i)],a=[$v(r,t),$v(e,i)];return[[n[0],a[0]],[n[1],a[1]]]}function _0e(r){return Tl(r.group)}function DU(r,e){var t={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},n=Yp(t[e],_0e(r));return i[n]}function x0e(r,e){var t=[DU(r,e[0]),DU(r,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function XY(r,e,t,i,n,a){var o=t.__brushOption,s=r.toRectRange(o.range),l=nq(e,n,a);N(i,function(u){var c=d0e[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=r.fromRectRange(iq(s[0][0],s[1][0],s[0][1],s[1][1])),NU(e,t),xd(e,{isEnd:!1})}function S0e(r,e,t,i){var n=e.__brushOption.range,a=nq(r,t,i);N(n,function(o){o[0]+=a[0],o[1]+=a[1]}),NU(r,e),xd(r,{isEnd:!1})}function nq(r,e,t){var i=r.group,n=i.transformCoordToLocal(e,t),a=i.transformCoordToLocal(0,0);return[n[0]-a[0],n[1]-a[1]]}function FU(r,e,t){var i=QY(r,e);return i&&i!==_d?i.clipPath(t,r._transform):Qe(t)}function M0e(r){var e=gS(r[0][0],r[1][0]),t=gS(r[0][1],r[1][1]),i=$v(r[0][0],r[1][0]),n=$v(r[0][1],r[1][1]);return{x:e,y:t,width:i-e,height:n-t}}function b0e(r,e,t){if(!(!r._brushType||T0e(r,e.offsetX,e.offsetY))){var i=r._zr,n=r._covers,a=OU(r,e,t);if(!r._dragging)for(var o=0;o<n.length;o++){var s=n[o].__brushOption;if(a&&(a===_d||s.panelId===a.panelId)&&_E[s.brushType].contain(n[o],t[0],t[1]))return}a&&i.setCursorStyle("crosshair")}}function PU(r){var e=r.event;e.preventDefault&&e.preventDefault()}function IU(r,e,t){return r.childOfName("main").contain(e,t)}function aq(r,e,t,i){var n=r._creatingCover,a=r._creatingPanel,o=r._brushOption,s;if(r._track.push(t.slice()),y0e(r)||n){if(a&&!n){o.brushMode==="single"&&RU(r);var l=Qe(o);l.brushType=YY(l.brushType,a),l.panelId=a===_d?null:a.panelId,n=r._creatingCover=jY(r,l),r._covers.push(n)}if(n){var u=_E[YY(r._brushType,a)],c=n.__brushOption;c.range=u.getCreatingRange(FU(r,n,r._track)),i&&(KY(r,n),u.updateCommon(r,n)),JY(r,n),s={isEnd:i}}}else i&&o.brushMode==="single"&&o.removeOnClick&&OU(r,e,t)&&RU(r)&&(s={isEnd:i,removeOnClick:!0});return s}function YY(r,e){return r==="auto"?e.defaultBrushType:r}var w0e={mousedown:function(r){if(this._dragging)qY(this,r);else if(!r.target||!r.target.draggable){PU(r);var e=this.group.transformCoordToLocal(r.offsetX,r.offsetY);this._creatingCover=null;var t=this._creatingPanel=OU(this,r,e);t&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(r){var e=r.offsetX,t=r.offsetY,i=this.group.transformCoordToLocal(e,t);if(b0e(this,r,i),this._dragging){PU(r);var n=aq(this,r,i,!1);n&&xd(this,n)}},mouseup:function(r){qY(this,r)}};function qY(r,e){if(r._dragging){PU(e);var t=e.offsetX,i=e.offsetY,n=r.group.transformCoordToLocal(t,i),a=aq(r,e,n,!0);r._dragging=!1,r._track=[],r._creatingCover=null,a&&xd(r,a)}}function T0e(r,e,t){var i=r._zr;return e<0||e>i.getWidth()||t<0||t>i.getHeight()}var _E={lineX:ZY(0),lineY:ZY(1),rect:{createCover:function(r,e){function t(i){return i}return tq({toRectRange:t,fromRectRange:t},r,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(r){var e=eq(r);return iq(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(r,e,t,i){rq(r,e,t,i)},updateCommon:LU,contain:IU},polygon:{createCover:function(r,e){var t=new Ze;return t.add(new ri({name:"main",style:zU(e),silent:!0})),t},getCreatingRange:function(r){return r},endCreating:function(r,e){e.remove(e.childAt(0)),e.add(new ai({name:"main",draggable:!0,drift:ut(S0e,r,e),ondragend:ut(xd,r,{isEnd:!0})}))},updateCoverShape:function(r,e,t,i){e.childAt(0).setShape({points:FU(r,e,t)})},updateCommon:LU,contain:IU}};function ZY(r){return{createCover:function(e,t){return tq({toRectRange:function(i){var n=[i,[0,100]];return r&&n.reverse(),n},fromRectRange:function(i){return i[r]}},e,t,[[["w"],["e"]],[["n"],["s"]]][r])},getCreatingRange:function(e){var t=eq(e),i=gS(t[0][r],t[1][r]),n=$v(t[0][r],t[1][r]);return[i,n]},updateCoverShape:function(e,t,i,n){var a,o=QY(e,t);if(o!==_d&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(r);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-r]]}var l=[i,a];r&&l.reverse(),rq(e,t,l,n)},updateCommon:LU,contain:IU}}var Qv=g0e;function xE(r){return r=BU(r),function(e){return CD(e,r)}}function SE(r,e){return r=BU(r),function(t){var i=e??t,n=i?r.width:r.height,a=i?r.x:r.y;return[a,a+(n||0)]}}function ME(r,e,t){var i=BU(r);return function(n,a){return i.contain(a[0],a[1])&&!Jh(n,e,t)}}function BU(r){return ht.create(r)}var E0e=["axisLine","axisTickLabel","axisName"],A0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){r.prototype.init.apply(this,arguments),(this._brushController=new Qv(i.getZr())).on("brush",Be(this._onBrush,this))},e.prototype.render=function(t,i,n,a){if(!C0e(t,i,a)){this.axisModel=t,this.api=n,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ze,this.group.add(this._axisGroup),!!t.get("show")){var s=L0e(t,i),l=s.coordinateSystem,u=t.getAreaSelectStyle(),c=u.width,h=t.axis.dim,f=l.getAxisLayout(h),p=he({strokeContainThreshold:c},f),d=new Nn(t,p);N(E0e,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(p,u,t,s,c,n),fc(o,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,i,n,a,o,s){var l=n.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),h=ht.create({x:l[0],y:-o/2,width:u,height:o});h.x-=c,h.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:xE(h),isTargetByCursor:ME(h,s,a),getLinearBrushOtherExtent:SE(h,0)}]).enableBrush({brushType:"lineX",brushStyle:i,removeOnClick:!0}).updateCovers(R0e(n))},e.prototype._onBrush=function(t){var i=t.areas,n=this.axisModel,a=n.axis,o=de(i,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!n.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(ir);function C0e(r,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===r}function R0e(r){var e=r.axis;return de(r.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function L0e(r,e){return e.getComponent("parallel",r.get("parallelIndex"))}var sq=A0e;var D0e={type:"axisAreaSelect",event:"axisAreaSelected"};function lq(r){r.registerAction(D0e,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(i){i.axis.model.setActiveIntervals(e.intervals)})}),r.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(i){i.setAxisExpand(e)})})}var P0e={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function yS(r){r.registerComponentView(IY),r.registerComponentModel(NY),r.registerCoordinateSystem("parallel",VY),r.registerPreprocessor(wU),r.registerComponentModel(CU),r.registerComponentView(sq),Vl(r,"parallel",CU,P0e),lq(r)}function kU(r){Ot(yS),r.registerChartView(LY),r.registerSeriesModel(DY),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,PY)}var I0e=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r}(),N0e=function(r){Z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new I0e},e.prototype.buildPath=function(t,i){var n=i.extent;t.moveTo(i.x1,i.y1),t.bezierCurveTo(i.cpx1,i.cpy1,i.cpx2,i.cpy2,i.x2,i.y2),i.orient==="vertical"?(t.lineTo(i.x2+n,i.y2),t.bezierCurveTo(i.cpx2+n,i.cpy2,i.cpx1+n,i.cpy1,i.x1+n,i.y1)):(t.lineTo(i.x2,i.y2+n),t.bezierCurveTo(i.cpx2,i.cpy2+n,i.cpx1,i.cpy1+n,i.x1,i.y1+n)),t.closePath()},e.prototype.highlight=function(){Zn(this)},e.prototype.downplay=function(){jn(this)},e}(pt),U0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,i,n){var a=this,o=t.getGraph(),s=this.group,l=t.layoutInfo,u=l.width,c=l.height,h=t.getData(),f=t.getData("edge"),p=t.get("orient");this._model=t,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(d){var g=new N0e,m=it(g);m.dataIndex=d.dataIndex,m.seriesIndex=t.seriesIndex,m.dataType="edge";var v=d.getModel(),_=v.getModel("lineStyle"),y=_.get("curveness"),x=d.node1.getLayout(),M=d.node1.getModel(),S=M.get("localX"),w=M.get("localY"),T=d.node2.getLayout(),C=d.node2.getModel(),b=C.get("localX"),E=C.get("localY"),I=d.getLayout(),R,A,P,U,B,z,k,G;g.shape.extent=Math.max(1,I.dy),g.shape.orient=p,p==="vertical"?(R=(S!=null?S*u:x.x)+I.sy,A=(w!=null?w*c:x.y)+x.dy,P=(b!=null?b*u:T.x)+I.ty,U=E!=null?E*c:T.y,B=R,z=A*(1-y)+U*y,k=P,G=A*y+U*(1-y)):(R=(S!=null?S*u:x.x)+x.dx,A=(w!=null?w*c:x.y)+I.sy,P=b!=null?b*u:T.x,U=(E!=null?E*c:T.y)+I.ty,B=R*(1-y)+P*y,z=A,k=R*y+P*(1-y),G=U),g.setShape({x1:R,y1:A,x2:P,y2:U,cpx1:B,cpy1:z,cpx2:k,cpy2:G}),g.useStyle(_.getItemStyle()),uq(g.style,p,d);var Y=""+v.get("value"),J=Rr(v,"edgeLabel");Fr(g,J,{labelFetcher:{getFormattedLabel:function(K,ae,ve,ue,se,Ee){return t.getFormattedLabel(K,ae,"edge",ue,qi(se,J.normal&&J.normal.get("formatter"),Y),Ee)}},labelDataIndex:d.dataIndex,defaultText:Y}),g.setTextConfig({position:"inside"});var Q=v.getModel("emphasis");Yr(g,v,"lineStyle",function(K){var ae=K.getItemStyle();return uq(ae,p,d),ae}),s.add(g),f.setItemGraphicEl(d.dataIndex,g);var V=Q.get("focus");sr(g,V==="adjacency"?d.getAdjacentDataIndices():V==="trajectory"?d.getTrajectoryDataIndices():V,Q.get("blurScope"),Q.get("disabled"))}),o.eachNode(function(d){var g=d.getLayout(),m=d.getModel(),v=m.get("localX"),_=m.get("localY"),y=m.getModel("emphasis"),x=new Rt({shape:{x:v!=null?v*u:g.x,y:_!=null?_*c:g.y,width:g.dx,height:g.dy},style:m.getModel("itemStyle").getItemStyle(),z2:10});Fr(x,Rr(m),{labelFetcher:{getFormattedLabel:function(S,w){return t.getFormattedLabel(S,w,"node")}},labelDataIndex:d.dataIndex,defaultText:d.id}),x.disableLabelAnimation=!0,x.setStyle("fill",d.getVisual("color")),x.setStyle("decal",d.getVisual("style").decal),Yr(x,m),s.add(x),h.setItemGraphicEl(d.dataIndex,x),it(x).dataType="node";var M=y.get("focus");sr(x,M==="adjacency"?d.getAdjacentDataIndices():M==="trajectory"?d.getTrajectoryDataIndices():M,y.get("blurScope"),y.get("disabled"))}),h.eachItemGraphicEl(function(d,g){var m=h.getItemModel(g);m.get("draggable")&&(d.drift=function(v,_){a._focusAdjacencyDisabled=!0,this.shape.x+=v,this.shape.y+=_,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:h.getRawIndex(g),localX:this.shape.x/u,localY:this.shape.y/c})},d.ondragend=function(){a._focusAdjacencyDisabled=!1},d.draggable=!0,d.cursor="move")}),!this._data&&t.isAnimationEnabled()&&s.setClipPath(O0e(s.getBoundingRect(),t,function(){s.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(Zt);function uq(r,e,t){switch(r.fill){case"source":r.fill=t.node1.getVisual("color"),r.decal=t.node1.getVisual("style").decal;break;case"target":r.fill=t.node2.getVisual("color"),r.decal=t.node2.getVisual("style").decal;break;case"gradient":var i=t.node1.getVisual("color"),n=t.node2.getVisual("color");Ce(i)&&Ce(n)&&(r.fill=new xu(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:i,offset:0},{color:n,offset:1}]))}}function O0e(r,e,t){var i=new Rt({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return lr(i,{shape:{width:r.width+20}},e,t),i}var cq=U0e;var z0e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){var n=t.edges||t.links,a=t.data||t.nodes,o=t.levels;this.levelModels=[];for(var s=this.levelModels,l=0;l<o.length;l++)o[l].depth!=null&&o[l].depth>=0&&(s[o[l].depth]=new Jt(o[l],this,i));if(a&&n){var u=vS(a,n,this,!0,c);return u.data}function c(h,f){h.wrapMethod("getItemModel",function(p,d){var g=p.parentModel,m=g.getData().getItemLayout(d);if(m){var v=m.depth,_=g.levelModels[v];_&&(p.parentModel=_)}return p}),f.wrapMethod("getItemModel",function(p,d){var g=p.parentModel,m=g.getGraph().getEdgeByIndex(d),v=m.node1.getLayout();if(v){var _=v.depth,y=g.levelModels[_];y&&(p.parentModel=y)}return p})}},e.prototype.setNodePosition=function(t,i){var n=this.option.data||this.option.nodes,a=n[t];a.localX=i[0],a.localY=i[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,i,n){function a(p){return isNaN(p)||p==null}if(n==="edge"){var o=this.getDataParams(t,n),s=o.data,l=o.value,u=s.source+" -- "+s.target;return kr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(t),h=c.getLayout().value,f=this.getDataParams(t,n).data.name;return kr("nameValue",{name:f!=null?f+"":null,value:h,noValue:a(h)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,i){var n=r.prototype.getDataParams.call(this,t,i);if(n.value==null&&i==="node"){var a=this.getGraph().getNodeByIndex(t),o=a.getLayout().value;n.value=o}return n},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}($t),hq=z0e;function GU(r,e){r.eachSeriesByType("sankey",function(t){var i=t.get("nodeWidth"),n=t.get("nodeGap"),a=F0e(t,e);t.layoutInfo=a;var o=a.width,s=a.height,l=t.getGraph(),u=l.nodes,c=l.edges;k0e(u);var h=Yt(u,function(g){return g.getLayout().value===0}),f=h.length!==0?0:t.get("layoutIterations"),p=t.get("orient"),d=t.get("nodeAlign");B0e(u,c,i,n,o,s,f,p,d)})}function F0e(r,e){return br(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function B0e(r,e,t,i,n,a,o,s,l){V0e(r,e,t,n,a,s,l),X0e(r,e,a,n,i,o,s),e_e(r,s)}function k0e(r){N(r,function(e){var t=ef(e.outEdges,bE),i=ef(e.inEdges,bE),n=e.getValue()||0,a=Math.max(t,i,n);e.setLayout({value:a},!0)})}function V0e(r,e,t,i,n,a,o){for(var s=[],l=[],u=[],c=[],h=0,f=0;f<e.length;f++)s[f]=1;for(var f=0;f<r.length;f++)l[f]=r[f].inEdges.length,l[f]===0&&u.push(r[f]);for(var p=-1;u.length;){for(var d=0;d<u.length;d++){var g=u[d],m=g.hostGraph.data.getRawDataItem(g.dataIndex),v=m.depth!=null&&m.depth>=0;v&&m.depth>p&&(p=m.depth),g.setLayout({depth:v?m.depth:h},!0),a==="vertical"?g.setLayout({dy:t},!0):g.setLayout({dx:t},!0);for(var _=0;_<g.outEdges.length;_++){var y=g.outEdges[_],x=e.indexOf(y);s[x]=0;var M=y.node2,S=r.indexOf(M);--l[S]===0&&c.indexOf(M)<0&&c.push(M)}}++h,u=c,c=[]}for(var f=0;f<s.length;f++)if(s[f]===1)throw new Error("Sankey is a DAG, the original data has cycle!");var w=p>h-1?p:h-1;o&&o!=="left"&&G0e(r,o,a,w);var T=a==="vertical"?(n-t)/w:(i-t)/w;W0e(r,T,a)}function fq(r){var e=r.hostGraph.data.getRawDataItem(r.dataIndex);return e.depth!=null&&e.depth>=0}function G0e(r,e,t,i){if(e==="right"){for(var n=[],a=r,o=0;a.length;){for(var s=0;s<a.length;s++){var l=a[s];l.setLayout({skNodeHeight:o},!0);for(var u=0;u<l.inEdges.length;u++){var c=l.inEdges[u];n.indexOf(c.node1)<0&&n.push(c.node1)}}a=n,n=[],++o}N(r,function(h){fq(h)||h.setLayout({depth:Math.max(0,i-h.getLayout().skNodeHeight)},!0)})}else e==="justify"&&H0e(r,i)}function H0e(r,e){N(r,function(t){!fq(t)&&!t.outEdges.length&&t.setLayout({depth:e},!0)})}function W0e(r,e,t){N(r,function(i){var n=i.getLayout().depth*e;t==="vertical"?i.setLayout({y:n},!0):i.setLayout({x:n},!0)})}function X0e(r,e,t,i,n,a,o){var s=Y0e(r,o);q0e(s,e,t,i,n,o),VU(s,n,t,i,o);for(var l=1;a>0;a--)l*=.99,Z0e(s,l,o),VU(s,n,t,i,o),Q0e(s,l,o),VU(s,n,t,i,o)}function Y0e(r,e){var t=[],i=e==="vertical"?"y":"x",n=W_(r,function(a){return a.getLayout()[i]});return n.keys.sort(function(a,o){return a-o}),N(n.keys,function(a){t.push(n.buckets.get(a))}),t}function q0e(r,e,t,i,n,a){var o=1/0;N(r,function(s){var l=s.length,u=0;N(s,function(h){u+=h.getLayout().value});var c=a==="vertical"?(i-(l-1)*n)/u:(t-(l-1)*n)/u;c<o&&(o=c)}),N(r,function(s){N(s,function(l,u){var c=l.getLayout().value*o;a==="vertical"?(l.setLayout({x:u},!0),l.setLayout({dx:c},!0)):(l.setLayout({y:u},!0),l.setLayout({dy:c},!0))})}),N(e,function(s){var l=+s.getValue()*o;s.setLayout({dy:l},!0)})}function VU(r,e,t,i,n){var a=n==="vertical"?"x":"y";N(r,function(o){o.sort(function(g,m){return g.getLayout()[a]-m.getLayout()[a]});for(var s,l,u,c=0,h=o.length,f=n==="vertical"?"dx":"dy",p=0;p<h;p++)l=o[p],u=c-l.getLayout()[a],u>0&&(s=l.getLayout()[a]+u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[f]+e;var d=n==="vertical"?i:t;if(u=c-e-d,u>0){s=l.getLayout()[a]-u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var p=h-2;p>=0;--p)l=o[p],u=l.getLayout()[a]+l.getLayout()[f]+e-c,u>0&&(s=l.getLayout()[a]-u,n==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function Z0e(r,e,t){N(r.slice().reverse(),function(i){N(i,function(n){if(n.outEdges.length){var a=ef(n.outEdges,j0e,t)/ef(n.outEdges,bE);if(isNaN(a)){var o=n.outEdges.length;a=o?ef(n.outEdges,K0e,t)/o:0}if(t==="vertical"){var s=n.getLayout().x+(a-tf(n,t))*e;n.setLayout({x:s},!0)}else{var l=n.getLayout().y+(a-tf(n,t))*e;n.setLayout({y:l},!0)}}})})}function j0e(r,e){return tf(r.node2,e)*r.getValue()}function K0e(r,e){return tf(r.node2,e)}function J0e(r,e){return tf(r.node1,e)*r.getValue()}function $0e(r,e){return tf(r.node1,e)}function tf(r,e){return e==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function bE(r){return r.getValue()}function ef(r,e,t){for(var i=0,n=r.length,a=-1;++a<n;){var o=+e(r[a],t);isNaN(o)||(i+=o)}return i}function Q0e(r,e,t){N(r,function(i){N(i,function(n){if(n.inEdges.length){var a=ef(n.inEdges,J0e,t)/ef(n.inEdges,bE);if(isNaN(a)){var o=n.inEdges.length;a=o?ef(n.inEdges,$0e,t)/o:0}if(t==="vertical"){var s=n.getLayout().x+(a-tf(n,t))*e;n.setLayout({x:s},!0)}else{var l=n.getLayout().y+(a-tf(n,t))*e;n.setLayout({y:l},!0)}}})})}function e_e(r,e){var t=e==="vertical"?"x":"y";N(r,function(i){i.outEdges.sort(function(n,a){return n.node2.getLayout()[t]-a.node2.getLayout()[t]}),i.inEdges.sort(function(n,a){return n.node1.getLayout()[t]-a.node1.getLayout()[t]})}),N(r,function(i){var n=0,a=0;N(i.outEdges,function(o){o.setLayout({sy:n},!0),n+=o.getLayout().dy}),N(i.inEdges,function(o){o.setLayout({ty:a},!0),a+=o.getLayout().dy})})}function HU(r){r.eachSeriesByType("sankey",function(e){var t=e.getGraph(),i=t.nodes,n=t.edges;if(i.length){var a=1/0,o=-1/0;N(i,function(s){var l=s.getLayout().value;l<a&&(a=l),l>o&&(o=l)}),N(i,function(s){var l=new gi({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}n.length&&N(n,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function WU(r){r.registerChartView(cq),r.registerSeriesModel(hq),r.registerLayout(GU),r.registerVisual(HU),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(i){i.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var wE=function(){function r(){}return r.prototype.getInitialData=function(e,t){var i,n=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=n.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",i=n.getOrdinalMeta(),l=!0):s==="category"?(e.layout="vertical",i=a.getOrdinalMeta(),l=!0):e.layout=e.layout||"horizontal";var u=["x","y"],c=e.layout==="horizontal"?0:1,h=this._baseAxisDim=u[c],f=u[1-c],p=[n,a],d=p[c].get("type"),g=p[1-c].get("type"),m=e.data;if(m&&l){var v=[];N(m,function(x,M){var S;pe(x)?(S=x.slice(),x.unshift(M)):pe(x.value)?(S=he({},x),S.value=S.value.slice(),x.value.unshift(M)):S=x,v.push(S)}),e.data=v}var _=this.defaultValueDimensions,y=[{name:h,type:id(d),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:id(g),dimsDef:_.slice()}];return us(this,{coordDimensions:y,dimensionsCount:_.length+1,encodeDefaulter:ut(_1,y,this)})},r.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},r}();var pq=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],t.visualDrawType="stroke",t}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}($t);Cr(pq,wE,!0);var dq=pq;var t_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),h=mq(c,a,u,l,!0);a.setItemGraphicEl(u,h),o.add(h)}}).update(function(u,c){var h=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(h);return}var f=a.getItemLayout(u);h?(Ui(h),vq(f,h,a,u)):h=mq(f,a,u,l),o.add(h),a.setItemGraphicEl(u,h)}).remove(function(u){var c=s.getItemGraphicEl(u);c&&o.remove(c)}).execute(),this._data=a},e.prototype.remove=function(t){var i=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl(function(a){a&&i.remove(a)})},e.type="boxplot",e}(Zt),r_e=function(){function r(){}return r}(),i_e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="boxplotBoxPath",i}return e.prototype.getDefaultShape=function(){return new r_e},e.prototype.buildPath=function(t,i){var n=i.points,a=0;for(t.moveTo(n[a][0],n[a][1]),a++;a<4;a++)t.lineTo(n[a][0],n[a][1]);for(t.closePath();a<n.length;a++)t.moveTo(n[a][0],n[a][1]),a++,t.lineTo(n[a][0],n[a][1])},e}(pt);function mq(r,e,t,i,n){var a=r.ends,o=new i_e({shape:{points:n?n_e(a,i,r):a}});return vq(r,o,e,t,n),o}function vq(r,e,t,i,n){var a=t.hostModel,o=Pt[n?"initProps":"updateProps"];o(e,{shape:{points:r.ends}},a,i),e.useStyle(t.getItemVisual(i,"style")),e.style.strokeNoScale=!0,e.z2=100;var s=t.getItemModel(i),l=s.getModel("emphasis");Yr(e,s),sr(e,l.get("focus"),l.get("blurScope"),l.get("disabled"))}function n_e(r,e,t){return de(r,function(i){return i=i.slice(),i[e]=t.initBaseline,i})}var gq=t_e;var _S=N;function XU(r){var e=a_e(r);_S(e,function(t){var i=t.seriesModels;i.length&&(o_e(t),_S(i,function(n,a){s_e(n,t.boxOffsetList[a],t.boxWidthList[a])}))})}function a_e(r){var e=[],t=[];return r.eachSeriesByType("boxplot",function(i){var n=i.getBaseAxis(),a=yt(t,n);a<0&&(a=t.length,t[a]=n,e[a]={axis:n,seriesModels:[]}),e[a].seriesModels.push(i)}),e}function o_e(r){var e=r.axis,t=r.seriesModels,i=t.length,n=r.boxWidthList=[],a=r.boxOffsetList=[],o=[],s;if(e.type==="category")s=e.getBandWidth();else{var l=0;_S(t,function(d){l=Math.max(l,d.getData().count())});var u=e.getExtent();s=Math.abs(u[1]-u[0])/l}_S(t,function(d){var g=d.get("boxWidth");pe(g)||(g=[g,g]),o.push([ze(g[0],s)||0,ze(g[1],s)||0])});var c=s*.8-2,h=c/i*.3,f=(c-h*(i-1))/i,p=f/2-c/2;_S(t,function(d,g){a.push(p),p+=h+f,n.push(Math.min(Math.max(f,o[g][0]),o[g][1]))})}function s_e(r,e,t){var i=r.coordinateSystem,n=r.getData(),a=t/2,o=r.get("layout")==="horizontal"?0:1,s=1-o,l=["x","y"],u=n.mapDimension(l[o]),c=n.mapDimensionsAll(l[s]);if(u==null||c.length<5)return;for(var h=0;h<n.count();h++){var f=n.get(u,h),p=y(f,c[2],h),d=y(f,c[0],h),g=y(f,c[1],h),m=y(f,c[3],h),v=y(f,c[4],h),_=[];x(_,g,!1),x(_,m,!0),_.push(d,g,v,m),M(_,d),M(_,v),M(_,p),n.setItemLayout(h,{initBaseline:p[s],ends:_})}function y(S,w,T){var C=n.get(w,T),b=[];b[o]=S,b[s]=C;var E;return isNaN(S)||isNaN(C)?E=[NaN,NaN]:(E=i.dataToPoint(b),E[o]+=e),E}function x(S,w,T){var C=w.slice(),b=w.slice();C[o]+=a,b[o]-=a,T?S.push(C,b):S.push(b,C)}function M(S,w){var T=w.slice(),C=w.slice();T[o]-=a,C[o]+=a,S.push(T,C)}}function YU(r,e){e=e||{};for(var t=[],i=[],n=e.boundIQR,a=n==="none"||n===0,o=0;o<r.length;o++){var s=Ri(r[o].slice()),l=Km(s,.25),u=Km(s,.5),c=Km(s,.75),h=s[0],f=s[s.length-1],p=(n??1.5)*(c-l),d=a?h:Math.max(h,l-p),g=a?f:Math.min(f,c+p),m=e.itemNameFormatter,v=He(m)?m({value:o}):Ce(m)?m.replace("{value}",o+""):o+"";t.push([v,d,l,u,c,g]);for(var _=0;_<s.length;_++){var y=s[_];if(y<d||y>g){var x=[v,y];i.push(x)}}}return{boxData:t,outliers:i}}var yq={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==Li){var i="";hr(i)}var n=YU(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:n.boxData},{data:n.outliers}]}};function qU(r){r.registerSeriesModel(dq),r.registerChartView(gq),r.registerLayout(XU),r.registerTransform(yq)}var l_e=["color","borderColor"],u_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,i,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,i,n,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,i):this._incrementalRenderNormal(t,i)},e.prototype.eachRendered=function(t){ya(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var i=t.pipelineContext.large;(this._isLargeDraw==null||i!==this._isLargeDraw)&&(this._isLargeDraw=i,this._clear())},e.prototype._renderNormal=function(t){var i=t.getData(),n=this._data,a=this.group,o=i.getLayout("isSimpleBox"),s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),i.diff(n).add(function(c){if(i.hasValue(c)){var h=i.getItemLayout(c);if(s&&_q(u,h))return;var f=ZU(h,c,!0);lr(f,{shape:{points:h.ends}},t,c),jU(f,i,c,o),a.add(f),i.setItemGraphicEl(c,f)}}).update(function(c,h){var f=n.getItemGraphicEl(h);if(!i.hasValue(c)){a.remove(f);return}var p=i.getItemLayout(c);if(s&&_q(u,p)){a.remove(f);return}f?(Ut(f,{shape:{points:p.ends}},t,c),Ui(f)):f=ZU(p,c),jU(f,i,c,o),a.add(f),i.setItemGraphicEl(c,f)}).remove(function(c){var h=n.getItemGraphicEl(c);h&&a.remove(h)}).execute(),this._data=i},e.prototype._renderLarge=function(t){this._clear(),xq(t,this.group);var i=t.get("clip",!0)?Ru(t.coordinateSystem,!1,t):null;i?this.group.setClipPath(i):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,i){for(var n=i.getData(),a=n.getLayout("isSimpleBox"),o;(o=t.next())!=null;){var s=n.getItemLayout(o),l=ZU(s,o);jU(l,n,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,i){xq(i,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(Zt),c_e=function(){function r(){}return r}(),h_e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="normalCandlestickBox",i}return e.prototype.getDefaultShape=function(){return new c_e},e.prototype.buildPath=function(t,i){var n=i.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(pt);function ZU(r,e,t){var i=r.ends;return new h_e({shape:{points:t?f_e(i,r):i},z2:100})}function _q(r,e){for(var t=!0,i=0;i<e.ends.length;i++)if(r.contain(e.ends[i][0],e.ends[i][1])){t=!1;break}return t}function jU(r,e,t,i){var n=e.getItemModel(t);r.useStyle(e.getItemVisual(t,"style")),r.style.strokeNoScale=!0,r.__simpleBox=i,Yr(r,n)}function f_e(r,e){return de(r,function(t){return t=t.slice(),t[1]=e.initBaseline,t})}var p_e=function(){function r(){}return r}(),KU=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i.type="largeCandlestickBox",i}return e.prototype.getDefaultShape=function(){return new p_e},e.prototype.buildPath=function(t,i){for(var n=i.points,a=0;a<n.length;)if(this.__sign===n[a++]){var o=n[a++];t.moveTo(o,n[a++]),t.lineTo(o,n[a++])}else a+=3},e}(pt);function xq(r,e,t,i){var n=r.getData(),a=n.getLayout("largePoints"),o=new KU({shape:{points:a},__sign:1,ignoreCoarsePointer:!0});e.add(o);var s=new KU({shape:{points:a},__sign:-1,ignoreCoarsePointer:!0});e.add(s);var l=new KU({shape:{points:a},__sign:0,ignoreCoarsePointer:!0});e.add(l),JU(1,o,r,n),JU(-1,s,r,n),JU(0,l,r,n),i&&(o.incremental=!0,s.incremental=!0),t&&t.push(o,s)}function JU(r,e,t,i){var n=t.get(["itemStyle",r>0?"borderColor":"borderColor0"])||t.get(["itemStyle",r>0?"color":"color0"]);r===0&&(n=t.get(["itemStyle","borderColorDoji"]));var a=t.getModel("itemStyle").getItemStyle(l_e);e.useStyle(a),e.style.fill=null,e.style.stroke=n}var Sq=u_e;var Mq=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],t}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,i,n){var a=i.getItemLayout(t);return a&&n.rect(a.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}($t);Cr(Mq,wE,!0);var bq=Mq;function $U(r){!r||!pe(r.series)||N(r.series,function(e){qe(e)&&e.type==="k"&&(e.type="candlestick")})}var d_e=["itemStyle","borderColor"],m_e=["itemStyle","borderColor0"],v_e=["itemStyle","borderColorDoji"],g_e=["itemStyle","color"],y_e=["itemStyle","color0"],__e={seriesType:"candlestick",plan:os(),performRawSeries:!0,reset:function(r,e){function t(a,o){return o.get(a>0?g_e:y_e)}function i(a,o){return o.get(a===0?v_e:a>0?d_e:m_e)}if(!e.isSeriesFiltered(r)){var n=r.pipelineContext.large;return!n&&{progress:function(a,o){for(var s;(s=a.next())!=null;){var l=o.getItemModel(s),u=o.getItemLayout(s).sign,c=l.getItemStyle();c.fill=t(u,l),c.stroke=i(u,l)||c.fill;var h=o.ensureUniqueItemVisual(s,"style");he(h,c)}}}}}},wq=__e;var x_e={seriesType:"candlestick",plan:os(),reset:function(r){var e=r.coordinateSystem,t=r.getData(),i=S_e(r,t),n=0,a=1,o=["x","y"],s=t.getDimensionIndex(t.mapDimension(o[n])),l=de(t.mapDimensionsAll(o[a]),t.getDimensionIndex,t),u=l[0],c=l[1],h=l[2],f=l[3];if(t.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),s<0||l.length<4)return;return{progress:r.pipelineContext.large?d:p};function p(g,m){for(var v,_=m.getStore();(v=g.next())!=null;){var y=_.get(s,v),x=_.get(u,v),M=_.get(c,v),S=_.get(h,v),w=_.get(f,v),T=Math.min(x,M),C=Math.max(x,M),b=B(T,y),E=B(C,y),I=B(S,y),R=B(w,y),A=[];z(A,E,0),z(A,b,1),A.push(G(R),G(E),G(I),G(b));var P=m.getItemModel(v),U=!!P.get(["itemStyle","borderColorDoji"]);m.setItemLayout(v,{sign:Tq(_,v,x,M,c,U),initBaseline:x>M?E[a]:b[a],ends:A,brushRect:k(S,w,y)})}function B(Y,J){var Q=[];return Q[n]=J,Q[a]=Y,isNaN(J)||isNaN(Y)?[NaN,NaN]:e.dataToPoint(Q)}function z(Y,J,Q){var V=J.slice(),K=J.slice();V[n]=ox(V[n]+i/2,1,!1),K[n]=ox(K[n]-i/2,1,!0),Q?Y.push(V,K):Y.push(K,V)}function k(Y,J,Q){var V=B(Y,Q),K=B(J,Q);return V[n]-=i/2,K[n]-=i/2,{x:V[0],y:V[1],width:a?i:K[0]-V[0],height:a?K[1]-V[1]:i}}function G(Y){return Y[n]=ox(Y[n],1),Y}}function d(g,m){for(var v=Sa(g.count*4),_=0,y,x=[],M=[],S,w=m.getStore(),T=!!r.get(["itemStyle","borderColorDoji"]);(S=g.next())!=null;){var C=w.get(s,S),b=w.get(u,S),E=w.get(c,S),I=w.get(h,S),R=w.get(f,S);if(isNaN(C)||isNaN(I)||isNaN(R)){v[_++]=NaN,_+=3;continue}v[_++]=Tq(w,S,b,E,c,T),x[n]=C,x[a]=I,y=e.dataToPoint(x,null,M),v[_++]=y?y[0]:NaN,v[_++]=y?y[1]:NaN,x[a]=R,y=e.dataToPoint(x,null,M),v[_++]=y?y[1]:NaN}m.setLayout("largePoints",v)}}};function Tq(r,e,t,i,n,a){var o;return t>i?o=-1:t<i?o=1:o=a?0:e>0?r.get(n,e-1)<=i?1:-1:1,o}function S_e(r,e){var t=r.getBaseAxis(),i,n=t.type==="category"?t.getBandWidth():(i=t.getExtent(),Math.abs(i[1]-i[0])/e.count()),a=ze(mt(r.get("barMaxWidth"),n),n),o=ze(mt(r.get("barMinWidth"),1),n),s=r.get("barWidth");return s!=null?ze(s,n):Math.max(Math.min(n/2,a),o)}var Eq=x_e;function QU(r){r.registerChartView(Sq),r.registerSeriesModel(bq),r.registerPreprocessor($U),r.registerVisual(wq),r.registerLayout(Eq)}function Aq(r,e){var t=e.rippleEffectColor||e.color;r.eachChild(function(i){i.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var M_e=function(r){Z(e,r);function e(t,i){var n=r.call(this)||this,a=new Mc(t,i),o=new Ze;return n.add(a),n.add(o),n.updateData(t,i),n}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var i=t.symbolType,n=t.color,a=t.rippleNumber,o=this.childAt(1),s=0;s<a;s++){var l=wr(i,-1,-1,2,2,n);l.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var u=-s/a*t.period+t.effectOffset;l.animate("",!0).when(t.period,{scaleX:t.rippleScale/2,scaleY:t.rippleScale/2}).delay(u).start(),l.animateStyle(!0).when(t.period,{opacity:0}).delay(u).start(),o.add(l)}Aq(o,t)},e.prototype.updateEffectAnimation=function(t){for(var i=this._effectCfg,n=this.childAt(1),a=["symbolType","period","rippleScale","rippleNumber"],o=0;o<a.length;o++){var s=a[o];if(i[s]!==t[s]){this.stopEffectAnimation(),this.startEffectAnimation(t);return}}Aq(n,t)},e.prototype.highlight=function(){Zn(this)},e.prototype.downplay=function(){jn(this)},e.prototype.getSymbolType=function(){var t=this.childAt(0);return t&&t.getSymbolType()},e.prototype.updateData=function(t,i){var n=this,a=t.hostModel;this.childAt(0).updateData(t,i);var o=this.childAt(1),s=t.getItemModel(i),l=t.getItemVisual(i,"symbol"),u=Pl(t.getItemVisual(i,"symbolSize")),c=t.getItemVisual(i,"style"),h=c&&c.fill,f=s.getModel("emphasis");o.setScale(u),o.traverse(function(m){m.setStyle("fill",h)});var p=ss(t.getItemVisual(i,"symbolOffset"),u);p&&(o.x=p[0],o.y=p[1]);var d=t.getItemVisual(i,"symbolRotate");o.rotation=(d||0)*Math.PI/180||0;var g={};g.showEffectOn=a.get("showEffectOn"),g.rippleScale=s.get(["rippleEffect","scale"]),g.brushType=s.get(["rippleEffect","brushType"]),g.period=s.get(["rippleEffect","period"])*1e3,g.effectOffset=i/t.count(),g.z=a.getShallow("z")||0,g.zlevel=a.getShallow("zlevel")||0,g.symbolType=l,g.color=h,g.rippleEffectColor=s.get(["rippleEffect","color"]),g.rippleNumber=s.get(["rippleEffect","number"]),g.showEffectOn==="render"?(this._effectCfg?this.updateEffectAnimation(g):this.startEffectAnimation(g),this._effectCfg=g):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(m){m==="emphasis"?g.showEffectOn!=="render"&&n.startEffectAnimation(g):m==="normal"&&g.showEffectOn!=="render"&&n.stopEffectAnimation()}),this._effectCfg=g,sr(this,f.get("focus"),f.get("blurScope"),f.get("disabled"))},e.prototype.fadeOut=function(t){t&&t()},e}(Ze),Cq=M_e;var b_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this._symbolDraw=new Cu(Cq)},e.prototype.render=function(t,i,n){var a=t.getData(),o=this._symbolDraw;o.updateData(a,{clipShape:this._getClipShape(t)}),this.group.add(o.group)},e.prototype._getClipShape=function(t){var i=t.coordinateSystem,n=i&&i.getArea&&i.getArea();return t.get("clip",!0)?n:null},e.prototype.updateTransform=function(t,i,n){var a=t.getData();this.group.dirty();var o=Bl("").reset(t,i,n);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout()},e.prototype._updateGroupTransform=function(t){var i=t.coordinateSystem;i&&i.getRoamTransform&&(this.group.transform=lG(i.getRoamTransform()),this.group.decomposeTransform())},e.prototype.remove=function(t,i){this._symbolDraw&&this._symbolDraw.remove(!0)},e.type="effectScatter",e}(Zt),Rq=b_e;var w_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,i){return mn(null,this,{useEncodeDefaulter:!0})},e.prototype.brushSelector=function(t,i,n){return n.point(i.getItemLayout(t))},e.type="series.effectScatter",e.dependencies=["grid","polar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},e}($t),Lq=w_e;function eO(r){r.registerChartView(Rq),r.registerSeriesModel(Lq),r.registerLayout(Bl("effectScatter"))}var T_e=function(r){Z(e,r);function e(t,i,n){var a=r.call(this)||this;return a.add(a.createLine(t,i,n)),a._updateEffectSymbol(t,i),a}return e.prototype.createLine=function(t,i,n){return new qv(t,i,n)},e.prototype._updateEffectSymbol=function(t,i){var n=t.getItemModel(i),a=n.getModel("effect"),o=a.get("symbolSize"),s=a.get("symbol");pe(o)||(o=[o,o]);var l=t.getItemVisual(i,"style"),u=a.get("color")||l&&l.stroke,c=this.childAt(1);this._symbolType!==s&&(this.remove(c),c=wr(s,-.5,-.5,1,1,u),c.z2=100,c.culling=!0,this.add(c)),c&&(c.setStyle("shadowColor",u),c.setStyle(a.getItemStyle(["color"])),c.scaleX=o[0],c.scaleY=o[1],c.setColor(u),this._symbolType=s,this._symbolScale=o,this._updateEffectAnimation(t,a,i))},e.prototype._updateEffectAnimation=function(t,i,n){var a=this.childAt(1);if(a){var o=t.getItemLayout(n),s=i.get("period")*1e3,l=i.get("loop"),u=i.get("roundTrip"),c=i.get("constantSpeed"),h=Hr(i.get("delay"),function(p){return p/t.count()*s/3});if(a.ignore=!0,this._updateAnimationPoints(a,o),c>0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;He(h)?f=h(n):f=h,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,i,n,a,o){if(i>0){t.__t=0;var s=this,l=t.animate("",a).when(o?i*2:i,{__t:o?2:1}).delay(n).during(function(){s._updateSymbolPosition(t)});a||l.done(function(){s.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return Rs(t.__p1,t.__cp1)+Rs(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,i){t.__p1=i[0],t.__p2=i[1],t.__cp1=i[2]||[(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2]},e.prototype.updateData=function(t,i,n){this.childAt(0).updateData(t,i,n),this._updateEffectSymbol(t,i)},e.prototype._updateSymbolPosition=function(t){var i=t.__p1,n=t.__p2,a=t.__cp1,o=t.__t<1?t.__t:2-t.__t,s=[t.x,t.y],l=s.slice(),u=xi,c=A_;s[0]=u(i[0],a[0],n[0],o),s[1]=u(i[1],a[1],n[1],o);var h=t.__t<1?c(i[0],a[0],n[0],o):c(n[0],a[0],i[0],1-o),f=t.__t<1?c(i[1],a[1],n[1],o):c(n[1],a[1],i[1],1-o);t.rotation=-Math.atan2(f,h)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT<t.__t?(t.scaleY=Rs(l,s)*1.05,o===1&&(s[0]=l[0]+(s[0]-l[0])/2,s[1]=l[1]+(s[1]-l[1])/2)):t.__lastT===1?t.scaleY=2*Rs(i,s):t.scaleY=this._symbolScale[1]),t.__lastT=t.__t,t.ignore=!1,t.x=s[0],t.y=s[1]},e.prototype.updateLayout=function(t,i){this.childAt(0).updateLayout(t,i);var n=t.getItemModel(i).getModel("effect");this._updateEffectAnimation(t,n,i)},e}(Ze),TE=T_e;var E_e=function(r){Z(e,r);function e(t,i,n){var a=r.call(this)||this;return a._createPolyline(t,i,n),a}return e.prototype._createPolyline=function(t,i,n){var a=t.getItemLayout(i),o=new ri({shape:{points:a}});this.add(o),this._updateCommonStl(t,i,n)},e.prototype.updateData=function(t,i,n){var a=t.hostModel,o=this.childAt(0),s={shape:{points:t.getItemLayout(i)}};Ut(o,s,a,i),this._updateCommonStl(t,i,n)},e.prototype._updateCommonStl=function(t,i,n){var a=this.childAt(0),o=t.getItemModel(i),s=n&&n.emphasisLineStyle,l=n&&n.focus,u=n&&n.blurScope,c=n&&n.emphasisDisabled;if(!n||t.hasItemOption){var h=o.getModel("emphasis");s=h.getModel("lineStyle").getLineStyle(),c=h.get("disabled"),l=h.get("focus"),u=h.get("blurScope")}a.useStyle(t.getItemVisual(i,"style")),a.style.fill=null,a.style.strokeNoScale=!0;var f=a.ensureState("emphasis");f.style=s,sr(this,l,u,c)},e.prototype.updateLayout=function(t,i){var n=this.childAt(0);n.setShape("points",t.getItemLayout(i))},e}(Ze),EE=E_e;var A_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}return e.prototype.createLine=function(t,i,n){return new EE(t,i,n)},e.prototype._updateAnimationPoints=function(t,i){this._points=i;for(var n=[0],a=0,o=1;o<i.length;o++){var s=i[o-1],l=i[o];a+=Rs(s,l),n.push(a)}if(a===0){this._length=0;return}for(var o=0;o<n.length;o++)n[o]/=a;this._offsets=n,this._length=a},e.prototype._getLineLength=function(){return this._length},e.prototype._updateSymbolPosition=function(t){var i=t.__t<1?t.__t:2-t.__t,n=this._points,a=this._offsets,o=n.length;if(a){var s=this._lastFrame,l;if(i<this._lastFramePercent){var u=Math.min(s+1,o-1);for(l=u;l>=0&&!(a[l]<=i);l--);l=Math.min(l,o-2)}else{for(l=s;l<o&&!(a[l]>i);l++);l=Math.min(l-1,o-2)}var c=(i-a[l])/(a[l+1]-a[l]),h=n[l],f=n[l+1];t.x=h[0]*(1-c)+c*f[0],t.y=h[1]*(1-c)+c*f[1];var p=t.__t<1?f[0]-h[0]:h[0]-f[0],d=t.__t<1?f[1]-h[1]:h[1]-f[1];t.rotation=-Math.atan2(d,p)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=i,t.ignore=!1}},e}(TE),Dq=A_e;var C_e=function(){function r(){this.polyline=!1,this.curveness=0,this.segs=[]}return r}(),R_e=function(r){Z(e,r);function e(t){var i=r.call(this,t)||this;return i._off=0,i.hoverDataIdx=-1,i}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new C_e},e.prototype.buildPath=function(t,i){var n=i.segs,a=i.curveness,o;if(i.polyline)for(o=this._off;o<n.length;){var s=n[o++];if(s>0){t.moveTo(n[o++],n[o++]);for(var l=1;l<s;l++)t.lineTo(n[o++],n[o++])}}else for(o=this._off;o<n.length;){var u=n[o++],c=n[o++],h=n[o++],f=n[o++];if(t.moveTo(u,c),a>0){var p=(u+h)/2-(c-f)*a,d=(c+f)/2-(h-u)*a;t.quadraticCurveTo(p,d,h,f)}else t.lineTo(h,f)}this.incremental&&(this._off=o,this.notClear=!0)},e.prototype.findDataIndex=function(t,i){var n=this.shape,a=n.segs,o=n.curveness,s=this.style.lineWidth;if(n.polyline)for(var l=0,u=0;u<a.length;){var c=a[u++];if(c>0)for(var h=a[u++],f=a[u++],p=1;p<c;p++){var d=a[u++],g=a[u++];if(gu(h,f,d,g,s,t,i))return l}l++}else for(var l=0,u=0;u<a.length;){var h=a[u++],f=a[u++],d=a[u++],g=a[u++];if(o>0){var m=(h+d)/2-(f-g)*o,v=(f+g)/2-(d-h)*o;if(zw(h,f,m,v,d,g,s,t,i))return l}else if(gu(h,f,d,g,s,t,i))return l;l++}return-1},e.prototype.contain=function(t,i){var n=this.transformCoordToLocal(t,i),a=this.getBoundingRect();if(t=n[0],i=n[1],a.contain(t,i)){var o=this.hoverDataIdx=this.findDataIndex(t,i);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var i=this.shape,n=i.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u<n.length;){var c=n[u++],h=n[u++];a=Math.min(c,a),s=Math.max(c,s),o=Math.min(h,o),l=Math.max(h,l)}t=this._rect=new ht(a,o,s,l)}return t},e}(pt),L_e=function(){function r(){this.group=new Ze}return r.prototype.updateData=function(e){this._clear();var t=this._create();t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e)},r.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clear()},r.prototype.incrementalUpdate=function(e,t){var i=this._newAdded[0],n=t.getLayout("linesPoints"),a=i&&i.shape.segs;if(a&&a.length<2e4){var o=a.length,s=new Float32Array(o+n.length);s.set(a),s.set(n,o),i.setShape({segs:s})}else{this._newAdded=[];var l=this._create();l.incremental=!0,l.setShape({segs:n}),this._setCommon(l,t),l.__startIndex=e.start}},r.prototype.remove=function(){this._clear()},r.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},r.prototype._create=function(){var e=new R_e({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(e),this.group.add(e),e},r.prototype._setCommon=function(e,t,i){var n=t.hostModel;e.setShape({polyline:n.get("polyline"),curveness:n.get(["lineStyle","curveness"])}),e.useStyle(n.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var a=t.getVisual("style");a&&a.stroke&&e.setStyle("stroke",a.stroke),e.setStyle("fill",null);var o=it(e);o.seriesIndex=n.seriesIndex,e.on("mousemove",function(s){o.dataIndex=null;var l=e.hoverDataIdx;l>0&&(o.dataIndex=l+e.__startIndex)})},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),Pq=L_e;var D_e={seriesType:"lines",plan:os(),reset:function(r){var e=r.coordinateSystem;if(e){var t=r.get("polyline"),i=r.pipelineContext.large;return{progress:function(n,a){var o=[];if(i){var s=void 0,l=n.end-n.start;if(t){for(var u=0,c=n.start;c<n.end;c++)u+=r.getLineCoordsCount(c);s=new Float32Array(l+u*2)}else s=new Float32Array(l*4);for(var h=0,f=[],c=n.start;c<n.end;c++){var p=r.getLineCoords(c,o);t&&(s[h++]=p);for(var d=0;d<p;d++)f=e.dataToPoint(o[d],!1,f),s[h++]=f[0],s[h++]=f[1]}a.setLayout("linesPoints",s)}else for(var c=n.start;c<n.end;c++){var g=a.getItemModel(c),p=r.getLineCoords(c,o),m=[];if(t)for(var v=0;v<p;v++)m.push(e.dataToPoint(o[v]));else{m[0]=e.dataToPoint(o[0]),m[1]=e.dataToPoint(o[1]);var _=g.get(["lineStyle","curveness"]);+_&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*_,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*_])}a.setItemLayout(c,m)}}}}}},AE=D_e;var P_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this._updateLineDraw(a,t),s=t.get("zlevel"),l=t.get(["effect","trailLength"]),u=n.getZr(),c=u.painter.getType()==="svg";c||u.painter.getLayer(s).clear(!0),this._lastZlevel!=null&&!c&&u.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&l>0&&(c||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var h=t.get("clip",!0)&&Ru(t.coordinateSystem,!1,t);h?this.group.setClipPath(h):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,i,n){var a=t.getData(),o=this._updateLineDraw(a,t);o.incrementalPrepareUpdate(a),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,i,n){this._lineDraw.incrementalUpdate(t,i.getData()),this._finished=t.end===i.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,i,n){var a=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=AE.reset(t,i,n);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,i){var n=this._lineDraw,a=this._showEffect(i),o=!!i.get("polyline"),s=i.pipelineContext,l=s.large;return(!n||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(n&&n.remove(),n=this._lineDraw=l?new Pq:new Zv(o?a?Dq:EE:a?TE:qv),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var i=t.getZr(),n=i.painter.getType()==="svg";!n&&this._lastZlevel!=null&&i.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,i){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(i)},e.prototype.dispose=function(t,i){this.remove(t,i)},e.type="lines",e}(Zt),Iq=P_e;var I_e=typeof Uint32Array>"u"?Array:Uint32Array,N_e=typeof Float64Array>"u"?Array:Float64Array;function Nq(r){var e=r.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(r.data=de(e,function(t){var i=[t[0].coord,t[1].coord],n={coords:i};return t[0].name&&(n.fromName=t[0].name),t[1].name&&(n.toName=t[1].name),Dm([n,t[0],t[1]])}))}var U_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.init=function(t){t.data=t.data||[],Nq(t);var i=this._processFlatCoordsArray(t.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(t.data=new Float32Array(i.count)),r.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(Nq(t),t.data){var i=this._processFlatCoordsArray(t.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(t.data=new Float32Array(i.count))}r.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var i=this._processFlatCoordsArray(t.data);i.flatCoords&&(this._flatCoords?(this._flatCoords=hp(this._flatCoords,i.flatCoords),this._flatCoordsOffset=hp(this._flatCoordsOffset,i.flatCoordsOffset)):(this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset),t.data=new Float32Array(i.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var i=this.getData().getItemModel(t),n=i.option instanceof Array?i.option:i.getShallow("coords");return n},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[t*2+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,i){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],o=0;o<a;o++)i[o]=i[o]||[],i[o][0]=this._flatCoords[n+o*2],i[o][1]=this._flatCoords[n+o*2+1];return a}else{for(var s=this._getCoordsFromItemModel(t),o=0;o<s.length;o++)i[o]=i[o]||[],i[o][0]=s[o][0],i[o][1]=s[o][1];return s.length}},e.prototype._processFlatCoordsArray=function(t){var i=0;if(this._flatCoords&&(i=this._flatCoords.length),Dt(t[0])){for(var n=t.length,a=new I_e(n),o=new N_e(n),s=0,l=0,u=0,c=0;c<n;){u++;var h=t[c++];a[l++]=s+i,a[l++]=h;for(var f=0;f<h;f++){var p=t[c++],d=t[c++];o[s++]=p,o[s++]=d,c>n}}return{flatCoordsOffset:new Uint32Array(a.buffer,0,l),flatCoords:o,count:u}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,i){if(0)var n;var a=new oi(["value"],this);return a.hasItemOption=!1,a.initData(t.data,[],function(o,s,l,u){if(o instanceof Array)return NaN;a.hasItemOption=!0;var c=o.value;if(c!=null)return c instanceof Array?c[u]:c}),a},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=a.getItemModel(t),s=o.get("name");if(s)return s;var l=o.get("fromName"),u=o.get("toName"),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),kr("nameValue",{name:c.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?1e4:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?2e4:this.get("progressiveThreshold"))},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),i=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&i>0?i+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}($t),Uq=U_e;function CE(r){return r instanceof Array||(r=[r,r]),r}var O_e={seriesType:"lines",reset:function(r){var e=CE(r.get("symbol")),t=CE(r.get("symbolSize")),i=r.getData();i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",t&&t[0]),i.setVisual("toSymbolSize",t&&t[1]);function n(a,o){var s=a.getItemModel(o),l=CE(s.getShallow("symbol",!0)),u=CE(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:i.hasItemOption?n:null}}},Oq=O_e;function tO(r){r.registerChartView(Iq),r.registerSeriesModel(Uq),r.registerLayout(AE),r.registerVisual(Oq)}var z_e=256,F_e=function(){function r(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=qn.createCanvas();this.canvas=e}return r.prototype.update=function(e,t,i,n,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,h=this.canvas,f=h.getContext("2d"),p=e.length;h.width=t,h.height=i;for(var d=0;d<p;++d){var g=e[d],m=g[0],v=g[1],_=g[2],y=n(_);f.globalAlpha=y,f.drawImage(s,m-c,v-c)}if(!h.width||!h.height)return h;for(var x=f.getImageData(0,0,h.width,h.height),M=x.data,S=0,w=M.length,T=this.minOpacity,C=this.maxOpacity,b=C-T;S<w;){var y=M[S+3]/256,E=Math.floor(y*(z_e-1))*4;if(y>0){var I=o(y)?l:u;y>0&&(y=y*b+T),M[S++]=I[E],M[S++]=I[E+1],M[S++]=I[E+2],M[S++]=I[E+3]*y*256}else S+=4}return f.putImageData(x,0,0),h},r.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=qn.createCanvas()),t=this.pointSize+this.blurSize,i=t*2;e.width=i,e.height=i;var n=e.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-t,t,this.pointSize,0,Math.PI*2,!0),n.closePath(),n.fill(),e},r.prototype._getGradient=function(e,t){for(var i=this._gradientPixels,n=i[t]||(i[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,a),n[o++]=a[0],n[o++]=a[1],n[o++]=a[2],n[o++]=a[3];return n},r}(),zq=F_e;function B_e(r,e,t){var i=r[1]-r[0];e=de(e,function(o){return{interval:[(o.interval[0]-r[0])/i,(o.interval[1]-r[0])/i]}});var n=e.length,a=0;return function(o){var s;for(s=a;s<n;s++){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}if(s===n)for(s=a-1;s>=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s<n&&t[s]}}function k_e(r,e){var t=r[1]-r[0];return e=[(e[0]-r[0])/t,(e[1]-r[0])/t],function(i){return i>=e[0]&&i<=e[1]}}function Fq(r){var e=r.dimensions;return e[0]==="lng"&&e[1]==="lat"}var V_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a;i.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===t&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):Fq(o)&&this._renderOnGeo(o,t,a,n)},e.prototype.incrementalPrepareRender=function(t,i,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,i,n,a){var o=i.coordinateSystem;o&&(Fq(o)?this.render(i,n,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(i,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){ya(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,i,n,a,o){var s=t.coordinateSystem,l=Ys(s,"cartesian2d"),u,c,h,f;if(l){var p=s.getAxis("x"),d=s.getAxis("y");u=p.getBandWidth()+.5,c=d.getBandWidth()+.5,h=p.scale.getExtent(),f=d.scale.getExtent()}for(var g=this.group,m=t.getData(),v=t.getModel(["emphasis","itemStyle"]).getItemStyle(),_=t.getModel(["blur","itemStyle"]).getItemStyle(),y=t.getModel(["select","itemStyle"]).getItemStyle(),x=t.get(["itemStyle","borderRadius"]),M=Rr(t),S=t.getModel("emphasis"),w=S.get("focus"),T=S.get("blurScope"),C=S.get("disabled"),b=l?[m.mapDimension("x"),m.mapDimension("y"),m.mapDimension("value")]:[m.mapDimension("time"),m.mapDimension("value")],E=n;E<a;E++){var I=void 0,R=m.getItemVisual(E,"style");if(l){var A=m.get(b[0],E),P=m.get(b[1],E);if(isNaN(m.get(b[2],E))||isNaN(A)||isNaN(P)||A<h[0]||A>h[1]||P<f[0]||P>f[1])continue;var U=s.dataToPoint([A,P]);I=new Rt({shape:{x:U[0]-u/2,y:U[1]-c/2,width:u,height:c},style:R})}else{if(isNaN(m.get(b[1],E)))continue;I=new Rt({z2:1,shape:s.dataToRect([m.get(b[0],E)]).contentShape,style:R})}if(m.hasItemOption){var B=m.getItemModel(E),z=B.getModel("emphasis");v=z.getModel("itemStyle").getItemStyle(),_=B.getModel(["blur","itemStyle"]).getItemStyle(),y=B.getModel(["select","itemStyle"]).getItemStyle(),x=B.get(["itemStyle","borderRadius"]),w=z.get("focus"),T=z.get("blurScope"),C=z.get("disabled"),M=Rr(B)}I.shape.r=x;var k=t.getRawValue(E),G="-";k&&k[2]!=null&&(G=k[2]+""),Fr(I,M,{labelFetcher:t,labelDataIndex:E,defaultOpacity:R.opacity,defaultText:G}),I.ensureState("emphasis").style=v,I.ensureState("blur").style=_,I.ensureState("select").style=y,sr(I,w,T,C),I.incremental=o,o&&(I.states.emphasis.hoverLayer=!0),g.add(I),m.setItemGraphicEl(E,I),this._progressiveEls&&this._progressiveEls.push(I)}},e.prototype._renderOnGeo=function(t,i,n,a){var o=n.targetVisuals.inRange,s=n.targetVisuals.outOfRange,l=i.getData(),u=this._hmLayer||this._hmLayer||new zq;u.blurSize=i.get("blurSize"),u.pointSize=i.get("pointSize"),u.minOpacity=i.get("minOpacity"),u.maxOpacity=i.get("maxOpacity");var c=t.getViewRect().clone(),h=t.getRoamTransform();c.applyTransform(h);var f=Math.max(c.x,0),p=Math.max(c.y,0),d=Math.min(c.width+c.x,a.getWidth()),g=Math.min(c.height+c.y,a.getHeight()),m=d-f,v=g-p,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],y=l.mapArray(_,function(w,T,C){var b=t.dataToPoint([w,T]);return b[0]-=f,b[1]-=p,b.push(C),b}),x=n.getExtent(),M=n.type==="visualMap.continuous"?k_e(x,n.option.range):B_e(x,n.getPieceList(),n.option.selected);u.update(y,m,v,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},M);var S=new Br({style:{width:m,height:v,x:f,y:p,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(Zt),Bq=V_e;var G_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,i){return mn(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=gc.get(this.get("coordinateSystem"));if(t&&t.dimensions)return t.dimensions[0]==="lng"&&t.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}($t),kq=G_e;function rO(r){r.registerChartView(Bq),r.registerSeriesModel(kq)}var H_e=["itemStyle","borderWidth"],Vq=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],iO=new ga,W_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),h=l.master.getRect(),f={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[h.x,h.x+h.width],[h.y,h.y+h.height]],isHorizontal:c,valueDim:Vq[+c],categoryDim:Vq[1-+c]};o.diff(s).add(function(d){if(o.hasValue(d)){var g=Hq(o,d),m=Gq(o,d,g,f),v=Wq(o,f,m);o.setItemGraphicEl(d,v),a.add(v),Yq(v,f,m)}}).update(function(d,g){var m=s.getItemGraphicEl(g);if(!o.hasValue(d)){a.remove(m);return}var v=Hq(o,d),_=Gq(o,d,v,f),y=Qq(o,_);m&&y!==m.__pictorialShapeStr&&(a.remove(m),o.setItemGraphicEl(d,null),m=null),m?J_e(m,f,_):m=Wq(o,f,_,!0),o.setItemGraphicEl(d,m),m.__pictorialSymbolMeta=_,a.add(m),Yq(m,f,_)}).remove(function(d){var g=s.getItemGraphicEl(d);g&&Xq(s,d,g.__pictorialSymbolMeta.animationModel,g)}).execute();var p=t.get("clip",!0)?Ru(t.coordinateSystem,!1,t):null;return p?a.setClipPath(p):a.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(t,i){var n=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(o){Xq(a,it(o).dataIndex,t,o)}):n.removeAll()},e.type="pictorialBar",e}(Zt);function Gq(r,e,t,i){var n=r.getItemLayout(e),a=t.get("symbolRepeat"),o=t.get("symbolClip"),s=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=t.get("symbolPatternSize")||2,h=t.isAnimationEnabled(),f={dataIndex:e,layout:n,itemModel:t,symbolType:r.getItemVisual(e,"symbol")||"circle",style:r.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:h?t:null,hoverScale:h&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};X_e(t,a,n,i,f),Y_e(r,e,n,a,o,f.boundingLength,f.pxSign,c,i,f),q_e(t,f.symbolScale,u,i,f);var p=f.symbolSize,d=ss(t.get("symbolOffset"),p);return Z_e(t,p,n,a,o,d,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,i,f),f}function X_e(r,e,t,i,n){var a=i.valueDim,o=r.get("symbolBoundingData"),s=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(t[a.wh]<=0),c;if(pe(o)){var h=[nO(s,o[0])-l,nO(s,o[1])-l];h[1]<h[0]&&h.reverse(),c=h[u]}else o!=null?c=nO(s,o)-l:e?c=i.coordSysExtent[a.index][u]-l:c=t[a.wh];n.boundingLength=c,e&&(n.repeatCutLength=t[a.wh]),n.pxSign=c>0?1:-1}function nO(r,e){return r.toGlobalCoord(r.dataToCoord(r.scale.parse(e)))}function Y_e(r,e,t,i,n,a,o,s,l,u){var c=l.valueDim,h=l.categoryDim,f=Math.abs(t[h.wh]),p=r.getItemVisual(e,"symbolSize"),d;pe(p)?d=p.slice():p==null?d=["100%","100%"]:d=[p,p],d[h.index]=ze(d[h.index],f),d[c.index]=ze(d[c.index],i?f:Math.abs(a)),u.symbolSize=d;var g=u.symbolScale=[d[0]/s,d[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*o}function q_e(r,e,t,i,n){var a=r.get(H_e)||0;a&&(iO.attr({scaleX:e[0],scaleY:e[1],rotation:t}),iO.updateTransform(),a/=iO.getLineScale(),a*=e[i.valueDim.index]),n.valueLineWidth=a||0}function Z_e(r,e,t,i,n,a,o,s,l,u,c,h){var f=c.categoryDim,p=c.valueDim,d=h.pxSign,g=Math.max(e[p.index]+s,0),m=g;if(i){var v=Math.abs(l),_=Hr(r.get("symbolMargin"),"15%")+"",y=!1;_.lastIndexOf("!")===_.length-1&&(y=!0,_=_.slice(0,_.length-1));var x=ze(_,e[p.index]),M=Math.max(g+x*2,0),S=y?0:x*2,w=Rp(i),T=w?i:qq((v+S)/M),C=v-T*g;x=C/2/(y?T:Math.max(T-1,1)),M=g+x*2,S=y?0:x*2,!w&&i!=="fixed"&&(T=u?qq((Math.abs(u)+S)/M):0),m=T*M-S,h.repeatTimes=T,h.symbolMargin=x}var b=d*(m/2),E=h.pathPosition=[];E[f.index]=t[f.wh]/2,E[p.index]=o==="start"?b:o==="end"?l-b:l/2,a&&(E[0]+=a[0],E[1]+=a[1]);var I=h.bundlePosition=[];I[f.index]=t[f.xy],I[p.index]=t[p.xy];var R=h.barRectShape=he({},t);R[p.wh]=d*Math.max(Math.abs(t[p.wh]),Math.abs(E[p.index]+b)),R[f.wh]=t[f.wh];var A=h.clipShape={};A[f.xy]=-t[f.xy],A[f.wh]=c.ecSize[f.wh],A[p.xy]=0,A[p.wh]=t[p.wh]}function Zq(r){var e=r.symbolPatternSize,t=wr(r.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function jq(r,e,t,i){var n=r.__pictorialBundle,a=t.symbolSize,o=t.valueLineWidth,s=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,c=0,h=a[e.valueDim.index]+o+t.symbolMargin*2;for(aO(r,function(g){g.__pictorialAnimationIndex=c,g.__pictorialRepeatTimes=u,c<u?eg(g,null,d(c),t,i):eg(g,null,{scaleX:0,scaleY:0},t,i,function(){n.remove(g)}),c++});c<u;c++){var f=Zq(t);f.__pictorialAnimationIndex=c,f.__pictorialRepeatTimes=u,n.add(f);var p=d(c);eg(f,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},t,i)}function d(g){var m=s.slice(),v=t.pxSign,_=g;return(t.symbolRepeatDirection==="start"?v>0:v<0)&&(_=u-1-g),m[l.index]=h*(_-u/2+.5)+s[l.index],{x:m[0],y:m[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function Kq(r,e,t,i){var n=r.__pictorialBundle,a=r.__pictorialMainPath;a?eg(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,i):(a=r.__pictorialMainPath=Zq(t),n.add(a),eg(a,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:0,scaleY:0,rotation:t.rotation},{scaleX:t.symbolScale[0],scaleY:t.symbolScale[1]},t,i))}function Jq(r,e,t){var i=he({},e.barRectShape),n=r.__pictorialBarRect;n?eg(n,null,{shape:i},e,t):(n=r.__pictorialBarRect=new Rt({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),n.disableMorphing=!0,r.add(n))}function $q(r,e,t,i){if(t.symbolClip){var n=r.__pictorialClipPath,a=he({},t.clipShape),o=e.valueDim,s=t.animationModel,l=t.dataIndex;if(n)Ut(n,{shape:a},s,l);else{a[o.wh]=0,n=new Rt({shape:a}),r.__pictorialBundle.setClipPath(n),r.__pictorialClipPath=n;var u={};u[o.wh]=t.clipShape[o.wh],Pt[i?"updateProps":"initProps"](n,{shape:u},s,l)}}}function Hq(r,e){var t=r.getItemModel(e);return t.getAnimationDelayParams=j_e,t.isAnimationEnabled=K_e,t}function j_e(r){return{index:r.__pictorialAnimationIndex,count:r.__pictorialRepeatTimes}}function K_e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function Wq(r,e,t,i){var n=new Ze,a=new Ze;return n.add(a),n.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?jq(n,e,t):Kq(n,e,t),Jq(n,t,i),$q(n,e,t,i),n.__pictorialShapeStr=Qq(r,t),n.__pictorialSymbolMeta=t,n}function J_e(r,e,t){var i=t.animationModel,n=t.dataIndex,a=r.__pictorialBundle;Ut(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},i,n),t.symbolRepeat?jq(r,e,t,!0):Kq(r,e,t,!0),Jq(r,t,!0),$q(r,e,t,!0)}function Xq(r,e,t,i){var n=i.__pictorialBarRect;n&&n.removeTextContent();var a=[];aO(i,function(o){a.push(o)}),i.__pictorialMainPath&&a.push(i.__pictorialMainPath),i.__pictorialClipPath&&(t=null),N(a,function(o){Fs(o,{scaleX:0,scaleY:0},t,e,function(){i.parent&&i.parent.remove(i)})}),r.setItemGraphicEl(e,null)}function Qq(r,e){return[r.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function aO(r,e,t){N(r.__pictorialBundle.children(),function(i){i!==r.__pictorialBarRect&&e.call(t,i)})}function eg(r,e,t,i,n,a){e&&r.attr(e),i.symbolClip&&!n?t&&r.attr(t):t&&Pt[n?"updateProps":"initProps"](r,t,i.animationModel,i.dataIndex,a)}function Yq(r,e,t){var i=t.dataIndex,n=t.itemModel,a=n.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=n.getModel(["blur","itemStyle"]).getItemStyle(),l=n.getModel(["select","itemStyle"]).getItemStyle(),u=n.getShallow("cursor"),c=a.get("focus"),h=a.get("blurScope"),f=a.get("scale");aO(r,function(g){if(g instanceof Br){var m=g.style;g.useStyle(he({image:m.image,x:m.x,y:m.y,width:m.width,height:m.height},t.style))}else g.useStyle(t.style);var v=g.ensureState("emphasis");v.style=o,f&&(v.scaleX=g.scaleX*1.1,v.scaleY=g.scaleY*1.1),g.ensureState("blur").style=s,g.ensureState("select").style=l,u&&(g.cursor=u),g.z2=t.z2});var p=e.valueDim.posDesc[+(t.boundingLength>0)],d=r.__pictorialBarRect;d.ignoreClip=!0,Fr(d,Rr(n),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:Fl(e.seriesModel.getData(),i),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:p}),sr(r,c,h,a.get("disabled"))}function qq(r){var e=Math.round(r);return Math.abs(r-e)<1e-4?e:Math.ceil(r)}var eZ=W_e;var $_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t.defaultSymbol="roundRect",t}return e.prototype.getInitialData=function(t){return t.stack=null,r.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=$n(Uv.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(Uv),tZ=$_e;function oO(r){r.registerChartView(eZ),r.registerSeriesModel(tZ),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,ut(cT,"pictorialBar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,hT("pictorialBar"))}var Q_e=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,i,n){var a=t.getData(),o=this,s=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,h=u.boundaryGap;s.x=0,s.y=c.y+h[0];function f(m){return m.name}var p=new In(this._layersSeries||[],l,f,f),d=[];p.add(Be(g,this,"add")).update(Be(g,this,"update")).remove(Be(g,this,"remove")).execute();function g(m,v,_){var y=o._layers;if(m==="remove"){s.remove(y[v]);return}for(var x=[],M=[],S,w=l[v].indices,T=0;T<w.length;T++){var C=a.getItemLayout(w[T]),b=C.x,E=C.y0,I=C.y;x.push(b,E),M.push(b,E+I),S=a.getItemVisual(w[T],"style")}var R,A=a.getItemLayout(w[0]),P=t.getModel("label"),U=P.get("margin"),B=t.getModel("emphasis");if(m==="add"){var z=d[v]=new Ze;R=new kT({shape:{points:x,stackedOnPoints:M,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),z.add(R),s.add(z),t.isAnimationEnabled()&&R.setClipPath(exe(R.getBoundingRect(),t,function(){R.removeClipPath()}))}else{var z=y[_];R=z.childAt(0),s.add(z),d[v]=z,Ut(R,{shape:{points:x,stackedOnPoints:M}},t),Ui(R)}Fr(R,Rr(t),{labelDataIndex:w[T-1],defaultText:a.getName(w[T-1]),inheritColor:S.fill},{normal:{verticalAlign:"middle"}}),R.setTextConfig({position:null,local:!0});var k=R.getTextContent();k&&(k.x=A.x-U,k.y=A.y0+A.y/2),R.useStyle(S),a.setItemGraphicEl(v,R),Yr(R,t),sr(R,B.get("focus"),B.get("blurScope"),B.get("disabled"))}this._layersSeries=l,this._layers=d},e.type="themeRiver",e}(Zt);function exe(r,e,t){var i=new Rt({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return lr(i,{shape:{x:r.x-50,width:r.width+100,height:r.height+20}},e,t),i}var rZ=Q_e;var sO=2,txe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Du(Be(this.getData,this),Be(this.getRawData,this))},e.prototype.fixData=function(t){var i=t.length,n={},a=W_(t,function(f){return n.hasOwnProperty(f[0]+"")||(n[f[0]+""]=-1),f[2]}),o=[];a.buckets.each(function(f,p){o.push({name:p,dataList:f})});for(var s=o.length,l=0;l<s;++l){for(var u=o[l].name,c=0;c<o[l].dataList.length;++c){var h=o[l].dataList[c][0]+"";n[h]=l}for(var h in n)n.hasOwnProperty(h)&&n[h]!==l&&(n[h]=l,t[i]=[h,0,u],i++)}return t},e.prototype.getInitialData=function(t,i){for(var n=this.getReferringComponents("singleAxis",Ir).models[0],a=n.get("type"),o=Yt(t.data,function(d){return d[2]!==void 0}),s=this.fixData(o||[]),l=[],u=this.nameMap=ke(),c=0,h=0;h<s.length;++h)l.push(s[h][sO]),u.get(s[h][sO])||(u.set(s[h][sO],c),c++);var f=Nl(s,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:id(a)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,p=new oi(f,this);return p.initData(s),p},e.prototype.getLayerSeries=function(){for(var t=this.getData(),i=t.count(),n=[],a=0;a<i;++a)n[a]=a;var o=t.mapDimension("single"),s=W_(n,function(u){return t.get("name",u)}),l=[];return s.buckets.each(function(u,c){u.sort(function(h,f){return t.get(o,h)-t.get(o,f)}),l.push({name:c,indices:u})}),l},e.prototype.getAxisTooltipData=function(t,i,n){pe(t)||(t=t?[t]:[]);for(var a=this.getData(),o=this.getLayerSeries(),s=[],l=o.length,u,c=0;c<l;++c){for(var h=Number.MAX_VALUE,f=-1,p=o[c].indices.length,d=0;d<p;++d){var g=a.get(t[0],o[c].indices[d]),m=Math.abs(g-i);m<=h&&(u=g,h=m,f=o[c].indices[d])}s.push(f)}return{dataIndices:s,nestestValue:u}},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=a.getName(t),s=a.get(a.mapDimension("value"),t);return kr("nameValue",{name:o,value:s})},e.type="series.themeRiver",e.dependencies=["singleAxis"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},e}($t),iZ=txe;function lO(r,e){r.eachSeriesByType("themeRiver",function(t){var i=t.getData(),n=t.coordinateSystem,a={},o=n.getRect();a.rect=o;var s=t.get("boundaryGap"),l=n.getAxis();if(a.boundaryGap=s,l.orient==="horizontal"){s[0]=ze(s[0],o.height),s[1]=ze(s[1],o.height);var u=o.height-s[0]-s[1];nZ(i,t,u)}else{s[0]=ze(s[0],o.width),s[1]=ze(s[1],o.width);var c=o.width-s[0]-s[1];nZ(i,t,c)}i.setLayout("layoutInfo",a)})}function nZ(r,e,t){if(r.count())for(var i=e.coordinateSystem,n=e.getLayerSeries(),a=r.mapDimension("single"),o=r.mapDimension("value"),s=de(n,function(m){return de(m.indices,function(v){var _=i.dataToPoint(r.get(a,v));return _[1]=r.get(o,v),_})}),l=rxe(s),u=l.y0,c=t/l.max,h=n.length,f=n[0].indices.length,p,d=0;d<f;++d){p=u[d]*c,r.setItemLayout(n[0].indices[d],{layerIndex:0,x:s[0][d][0],y0:p,y:s[0][d][1]*c});for(var g=1;g<h;++g)p+=s[g-1][d][1]*c,r.setItemLayout(n[g].indices[d],{layerIndex:g,x:s[g][d][0],y0:p,y:s[g][d][1]*c})}}function rxe(r){for(var e=r.length,t=r[0].length,i=[],n=[],a=0,o=0;o<t;++o){for(var s=0,l=0;l<e;++l)s+=r[l][o][1];s>a&&(a=s),i.push(s)}for(var u=0;u<t;++u)n[u]=(a-i[u])/2;a=0;for(var c=0;c<t;++c){var h=i[c]+n[c];h>a&&(a=h)}return{y0:n,max:a}}function uO(r){r.registerChartView(rZ),r.registerSeriesModel(iZ),r.registerLayout(lO),r.registerProcessor(kl("themeRiver"))}var ixe=2,nxe=4,axe=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this)||this;o.z2=ixe,o.textConfig={inside:!0},it(o).seriesIndex=i.seriesIndex;var s=new It({z2:nxe,silent:t.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,t,i,n,a),o}return e.prototype.updateData=function(t,i,n,a,o){this.node=i,i.piece=this,n=n||this._seriesModel,a=a||this._ecModel;var s=this;it(s).dataIndex=i.dataIndex;var l=i.getModel(),u=l.getModel("emphasis"),c=i.getLayout(),h=he({},c);h.label=null;var f=i.getVisual("style");f.lineJoin="bevel";var p=i.getVisual("decal");p&&(f.decal=Il(p,o));var d=Lu(l.getModel("itemStyle"),h,!0);he(h,d),N(Vi,function(_){var y=s.ensureState(_),x=l.getModel([_,"itemStyle"]);y.style=x.getItemStyle();var M=Lu(x,h);M&&(y.shape=M)}),t?(s.setShape(h),s.shape.r=c.r0,lr(s,{shape:{r:c.r}},n,i.dataIndex)):(Ut(s,{shape:h},n),Ui(s)),s.useStyle(f),this._updateLabel(n);var g=l.getShallow("cursor");g&&s.attr("cursor",g),this._seriesModel=n||this._seriesModel,this._ecModel=a||this._ecModel;var m=u.get("focus"),v=m==="ancestor"?i.getAncestorsIndices():m==="descendant"?i.getDescendantIndices():m;sr(this,v,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var i=this,n=this.node.getModel(),a=n.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),h=this,f=h.getTextContent(),p=this.node.dataIndex,d=a.get("minAngle")/180*Math.PI,g=a.get("show")&&!(d!=null&&Math.abs(s)<d);f.ignore=!g,N(Lh,function(v){var _=v==="normal"?n.getModel("label"):n.getModel([v,"label"]),y=v==="normal",x=y?f:f.ensureState(v),M=t.getFormattedLabel(p,v);y&&(M=M||i.node.name),x.style=pr(_,{},null,v!=="normal",!0),M&&(x.style.text=M);var S=_.get("show");S!=null&&!y&&(x.ignore=!S);var w=m(_,"position"),T=y?h:h.states[v],C=T.style.fill;T.textConfig={outsideFill:_.get("color")==="inherit"?C:null,inside:w!=="outside"};var b,E=m(_,"distance")||0,I=m(_,"align"),R=m(_,"rotate"),A=Math.PI*.5,P=Math.PI*1.5,U=Rn(R==="tangential"?Math.PI/2-l:l),B=U>A&&!ic(U-A)&&U<P;w==="outside"?(b=o.r+E,I=B?"right":"left"):!I||I==="center"?(s===2*Math.PI&&o.r0===0?b=0:b=(o.r+o.r0)/2,I="center"):I==="left"?(b=o.r0+E,I=B?"right":"left"):I==="right"&&(b=o.r-E,I=B?"left":"right"),x.style.align=I,x.style.verticalAlign=m(_,"verticalAlign")||"middle",x.x=b*u+o.cx,x.y=b*c+o.cy;var z=0;R==="radial"?z=Rn(-l)+(B?Math.PI:0):R==="tangential"?z=Rn(Math.PI/2-l)+(B?Math.PI:0):Dt(R)&&(z=R*Math.PI/180),x.rotation=Rn(z)});function m(v,_){var y=v.get(_);return y??a.get(_)}f.dirtyStyle()},e}(Mi),cO=axe;var RE="sunburstRootToNode",aZ="sunburstHighlight",oxe="sunburstUnhighlight";function oZ(r){r.registerAction({type:RE,update:"updateView"},function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},i);function i(n,a){var o=wc(e,[RE],n);if(o){var s=n.getViewRoot();s&&(e.direction=Gv(s,o.node)?"rollUp":"drillDown"),n.resetViewRoot(o.node)}}}),r.registerAction({type:aZ,update:"none"},function(e,t,i){e=he({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},n);function n(a){var o=wc(e,[aZ],a);o&&(e.dataIndex=o.node.dataIndex)}i.dispatchAction(he(e,{type:"highlight"}))}),r.registerAction({type:oxe,update:"updateView"},function(e,t,i){e=he({},e),i.dispatchAction(he(e,{type:"downplay"}))})}var sxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n,a){var o=this;this.seriesModel=t,this.api=n,this.ecModel=i;var s=t.getData(),l=s.tree.root,u=t.getViewRoot(),c=this.group,h=t.get("renderLabelForZeroData"),f=[];u.eachNode(function(_){f.push(_)});var p=this._oldChildren||[];d(f,p),v(l,u),this._initEvents(),this._oldChildren=f;function d(_,y){if(_.length===0&&y.length===0)return;new In(y,_,x,x).add(M).update(M).remove(ut(M,null)).execute();function x(S){return S.getId()}function M(S,w){var T=S==null?null:_[S],C=w==null?null:y[w];g(T,C)}}function g(_,y){if(!h&&_&&!_.getValue()&&(_=null),_!==l&&y!==l){if(y&&y.piece)_?(y.piece.updateData(!1,_,t,i,n),s.setItemGraphicEl(_.dataIndex,y.piece)):m(y);else if(_){var x=new cO(_,t,i,n);c.add(x),s.setItemGraphicEl(_.dataIndex,x)}}}function m(_){_&&_.piece&&(c.remove(_.piece),_.piece=null)}function v(_,y){y.depth>0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,t,i,n):(o.virtualPiece=new cO(_,t,i,n),c.add(o.virtualPiece)),y.piece.off("click"),o.virtualPiece.on("click",function(x){o._rootToNode(y.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(i){var n=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(o){if(!n&&o.piece&&o.piece===i.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")t._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";Jp(u,c)}}n=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:RE,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,i){var n=i.getData(),a=n.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(Zt),sZ=sxe;var lxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,i){var n={name:t.name,children:t.data};lZ(n);var a=this._levelModels=de(t.levels||[],function(l){return new Jt(l,this,i)},this),o=Vv.createTree(n,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var h=o.getNodeByDataIndex(c),f=a[h.depth];return f&&(u.parentModel=f),u})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var i=r.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(t);return i.treePathInfo=Qh(n,this),i},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var i=this.getRawData().tree.root;(!t||t!==i&&!i.contains(t))&&(this._viewRoot=i)},e.prototype.enableAriaDecal=function(){sS(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}($t);function lZ(r){var e=0;N(r.children,function(i){lZ(i);var n=i.value;pe(n)&&(n=n[0]),e+=n});var t=r.value;pe(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),pe(r.value)?r.value[0]=t:r.value=t}var uZ=lxe;var cZ=Math.PI/180;function hO(r,e,t){e.eachSeriesByType(r,function(i){var n=i.get("center"),a=i.get("radius");pe(a)||(a=[0,a]),pe(n)||(n=[n,n]);var o=t.getWidth(),s=t.getHeight(),l=Math.min(o,s),u=ze(n[0],o),c=ze(n[1],s),h=ze(a[0],l/2),f=ze(a[1],l/2),p=-i.get("startAngle")*cZ,d=i.get("minAngle")*cZ,g=i.getData().tree.root,m=i.getViewRoot(),v=m.depth,_=i.get("sort");_!=null&&hZ(m,_);var y=0;N(m.children,function(U){!isNaN(U.getValue())&&y++});var x=m.getValue(),M=Math.PI/(x||y)*2,S=m.depth>0,w=m.height-(S?-1:1),T=(f-h)/(w||1),C=i.get("clockwise"),b=i.get("stillShowZeroSum"),E=C?1:-1,I=function(U,B){if(U){var z=B;if(U!==g){var k=U.getValue(),G=x===0&&b?M:k*M;G<d&&(G=d),z=B+E*G;var Y=U.depth-v-(S?-1:1),J=h+T*Y,Q=h+T*(Y+1),V=i.getLevelModel(U);if(V){var K=V.get("r0",!0),ae=V.get("r",!0),ve=V.get("radius",!0);ve!=null&&(K=ve[0],ae=ve[1]),K!=null&&(J=ze(K,l/2)),ae!=null&&(Q=ze(ae,l/2))}U.setLayout({angle:G,startAngle:B,endAngle:z,clockwise:C,cx:u,cy:c,r0:J,r:Q})}if(U.children&&U.children.length){var ue=0;N(U.children,function(se){ue+=I(se,B+ue)})}return z-B}};if(S){var R=h,A=h+T,P=Math.PI*2;g.setLayout({angle:P,startAngle:p,endAngle:p+P,clockwise:C,cx:u,cy:c,r0:R,r:A})}I(m,p)})}function hZ(r,e){var t=r.children||[];r.children=uxe(t,e),t.length&&N(r.children,function(i){hZ(i,e)})}function uxe(r,e){if(He(e)){var t=de(r,function(n,a){var o=n.getValue();return{params:{depth:n.depth,height:n.height,dataIndex:n.dataIndex,getValue:function(){return o}},index:a}});return t.sort(function(n,a){return e(n.params,a.params)}),de(t,function(n){return r[n.index]})}else{var i=e==="asc";return r.sort(function(n,a){var o=(n.getValue()-a.getValue())*(i?1:-1);return o===0?(n.dataIndex-a.dataIndex)*(i?-1:1):o})}}function fO(r){var e={};function t(i,n,a){for(var o=i;o&&o.depth>1;)o=o.parentNode;var s=n.getColorFromPalette(o.name||o.dataIndex+"",e);return i.depth>1&&Ce(s)&&(s=cw(s,(i.depth-1)/(a-1)*.5)),s}r.eachSeriesByType("sunburst",function(i){var n=i.getData(),a=n.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(o,i,a.root.height));var u=n.ensureUniqueItemVisual(o.dataIndex,"style");he(u,l)})})}function pO(r){r.registerChartView(sZ),r.registerSeriesModel(uZ),r.registerLayout(ut(hO,"sunburst")),r.registerProcessor(ut(kl,"sunburst")),r.registerVisual(fO),oZ(r)}var dO={color:"fill",borderColor:"stroke"},fZ={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Iu=xt(),cxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,i){return mn(null,this)},e.prototype.getDataParams=function(t,i,n){var a=r.prototype.getDataParams.call(this,t,i);return n&&(a.info=Iu(n).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}($t),pZ=cxe;function hxe(r,e){return e=e||[0,0],de(["x","y"],function(t,i){var n=this.getAxis(t),a=e[i],o=r[i]/2;return n.type==="category"?n.getBandWidth():Math.abs(n.dataToCoord(a-o)-n.dataToCoord(a+o))},this)}function mO(r){var e=r.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:Be(hxe,r)}}}function fxe(r,e){return e=e||[0,0],de([0,1],function(t){var i=e[t],n=r[t]/2,a=[],o=[];return a[t]=i-n,o[t]=i+n,a[1-t]=o[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(o)[t])},this)}function vO(r){var e=r.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:r.getZoom()},api:{coord:function(t){return r.dataToPoint(t)},size:Be(fxe,r)}}}function pxe(r,e){var t=this.getAxis(),i=e instanceof Array?e[0]:e,n=(r instanceof Array?r[0]:r)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(i-n)-t.dataToCoord(i+n))}function gO(r){var e=r.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:Be(pxe,r)}}}function dxe(r,e){return e=e||[0,0],de(["Radius","Angle"],function(t,i){var n="get"+t+"Axis",a=this[n](),o=e[i],s=r[i]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function yO(r){var e=r.getRadiusAxis(),t=r.getAngleAxis(),i=e.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:r.cx,cy:r.cy,r:i[1],r0:i[0]},api:{coord:function(n){var a=e.dataToRadius(n[0]),o=t.dataToAngle(n[1]),s=r.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:Be(dxe,r)}}}function _O(r){var e=r.getRect(),t=r.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:r.getCellWidth(),cellHeight:r.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(i,n){return r.dataToPoint(i,n)}}}}function LE(r,e,t,i){return r&&(r.legacy||r.legacy!==!1&&!t&&!i&&e!=="tspan"&&(e==="text"||tt(r,"text")))}function DE(r,e,t){var i=r,n,a,o;if(e==="text")o=i;else{o={},tt(i,"text")&&(o.text=i.text),tt(i,"rich")&&(o.rich=i.rich),tt(i,"textFill")&&(o.fill=i.textFill),tt(i,"textStroke")&&(o.stroke=i.textStroke),tt(i,"fontFamily")&&(o.fontFamily=i.fontFamily),tt(i,"fontSize")&&(o.fontSize=i.fontSize),tt(i,"fontStyle")&&(o.fontStyle=i.fontStyle),tt(i,"fontWeight")&&(o.fontWeight=i.fontWeight),a={type:"text",style:o,silent:!0},n={};var s=tt(i,"textPosition");t?n.position=s?i.textPosition:"inside":s&&(n.position=i.textPosition),tt(i,"textPosition")&&(n.position=i.textPosition),tt(i,"textOffset")&&(n.offset=i.textOffset),tt(i,"textRotation")&&(n.rotation=i.textRotation),tt(i,"textDistance")&&(n.distance=i.textDistance)}return dZ(o,r),N(o.rich,function(l){dZ(l,l)}),{textConfig:n,textContent:a}}function dZ(r,e){e&&(e.font=e.textFont||e.font,tt(e,"textStrokeWidth")&&(r.lineWidth=e.textStrokeWidth),tt(e,"textAlign")&&(r.align=e.textAlign),tt(e,"textVerticalAlign")&&(r.verticalAlign=e.textVerticalAlign),tt(e,"textLineHeight")&&(r.lineHeight=e.textLineHeight),tt(e,"textWidth")&&(r.width=e.textWidth),tt(e,"textHeight")&&(r.height=e.textHeight),tt(e,"textBackgroundColor")&&(r.backgroundColor=e.textBackgroundColor),tt(e,"textPadding")&&(r.padding=e.textPadding),tt(e,"textBorderColor")&&(r.borderColor=e.textBorderColor),tt(e,"textBorderWidth")&&(r.borderWidth=e.textBorderWidth),tt(e,"textBorderRadius")&&(r.borderRadius=e.textBorderRadius),tt(e,"textBoxShadowColor")&&(r.shadowColor=e.textBoxShadowColor),tt(e,"textBoxShadowBlur")&&(r.shadowBlur=e.textBoxShadowBlur),tt(e,"textBoxShadowOffsetX")&&(r.shadowOffsetX=e.textBoxShadowOffsetX),tt(e,"textBoxShadowOffsetY")&&(r.shadowOffsetY=e.textBoxShadowOffsetY))}function xO(r,e,t){var i=r;i.textPosition=i.textPosition||t.position||"inside",t.offset!=null&&(i.textOffset=t.offset),t.rotation!=null&&(i.textRotation=t.rotation),t.distance!=null&&(i.textDistance=t.distance);var n=i.textPosition.indexOf("inside")>=0,a=r.fill||"#000";mZ(i,e);var o=i.textFill==null;return n?o&&(i.textFill=t.insideFill||"#fff",!i.textStroke&&t.insideStroke&&(i.textStroke=t.insideStroke),!i.textStroke&&(i.textStroke=a),i.textStrokeWidth==null&&(i.textStrokeWidth=2)):(o&&(i.textFill=r.fill||t.outsideFill||"#000"),!i.textStroke&&t.outsideStroke&&(i.textStroke=t.outsideStroke)),i.text=e.text,i.rich=e.rich,N(e.rich,function(s){mZ(s,s)}),i}function mZ(r,e){e&&(tt(e,"fill")&&(r.textFill=e.fill),tt(e,"stroke")&&(r.textStroke=e.fill),tt(e,"lineWidth")&&(r.textStrokeWidth=e.lineWidth),tt(e,"font")&&(r.font=e.font),tt(e,"fontStyle")&&(r.fontStyle=e.fontStyle),tt(e,"fontWeight")&&(r.fontWeight=e.fontWeight),tt(e,"fontSize")&&(r.fontSize=e.fontSize),tt(e,"fontFamily")&&(r.fontFamily=e.fontFamily),tt(e,"align")&&(r.textAlign=e.align),tt(e,"verticalAlign")&&(r.textVerticalAlign=e.verticalAlign),tt(e,"lineHeight")&&(r.textLineHeight=e.lineHeight),tt(e,"width")&&(r.textWidth=e.width),tt(e,"height")&&(r.textHeight=e.height),tt(e,"backgroundColor")&&(r.textBackgroundColor=e.backgroundColor),tt(e,"padding")&&(r.textPadding=e.padding),tt(e,"borderColor")&&(r.textBorderColor=e.borderColor),tt(e,"borderWidth")&&(r.textBorderWidth=e.borderWidth),tt(e,"borderRadius")&&(r.textBorderRadius=e.borderRadius),tt(e,"shadowColor")&&(r.textBoxShadowColor=e.shadowColor),tt(e,"shadowBlur")&&(r.textBoxShadowBlur=e.shadowBlur),tt(e,"shadowOffsetX")&&(r.textBoxShadowOffsetX=e.shadowOffsetX),tt(e,"shadowOffsetY")&&(r.textBoxShadowOffsetY=e.shadowOffsetY),tt(e,"textShadowColor")&&(r.textShadowColor=e.textShadowColor),tt(e,"textShadowBlur")&&(r.textShadowBlur=e.textShadowBlur),tt(e,"textShadowOffsetX")&&(r.textShadowOffsetX=e.textShadowOffsetX),tt(e,"textShadowOffsetY")&&(r.textShadowOffsetY=e.textShadowOffsetY))}var _Z={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},vZ=At(_Z),Zst=bn(ts,function(r,e){return r[e]=1,r},{}),jst=ts.join(", "),xS=["","style","shape","extra"],tg=xt();function SO(r,e,t,i,n){var a=r+"Animation",o=Su(r,i,n)||{},s=tg(e).userDuring;return o.duration>0&&(o.during=s?Be(_xe,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=r),he(o,t[a]),o}function rg(r,e,t,i){i=i||{};var n=i.dataIndex,a=i.isInit,o=i.clearStyle,s=t.isAnimationEnabled(),l=tg(r),u=e.style;l.userDuring=e.during;var c={},h={};if(Sxe(r,e,h),yZ("shape",e,h),yZ("extra",e,h),!a&&s&&(xxe(r,e,c),gZ("shape",r,e,c),gZ("extra",r,e,c),Mxe(r,e,u,c)),h.style=u,mxe(r,h,o),gxe(r,e),s)if(a){var f={};N(xS,function(d){var g=d?e[d]:e;g&&g.enterFrom&&(d&&(f[d]=f[d]||{}),he(d?f[d]:f,g.enterFrom))});var p=SO("enter",r,e,t,n);p.duration>0&&r.animateFrom(f,p)}else vxe(r,e,n||0,t,c);MO(r,e),u?r.dirty():r.markRedraw()}function MO(r,e){for(var t=tg(r).leaveToProps,i=0;i<xS.length;i++){var n=xS[i],a=n?e[n]:e;a&&a.leaveTo&&(t||(t=tg(r).leaveToProps={}),n&&(t[n]=t[n]||{}),he(n?t[n]:t,a.leaveTo))}}function ig(r,e,t,i){if(r){var n=r.parent,a=tg(r).leaveToProps;if(a){var o=SO("update",r,e,t,0);o.done=function(){n.remove(r),i&&i()},r.animateTo(a,o)}else n.remove(r),i&&i()}}function rf(r){return r==="all"}function mxe(r,e,t){var i=e.style;if(!r.isGroup&&i){if(t){r.useStyle({});for(var n=r.animators,a=0;a<n.length;a++){var o=n[a];o.targetName==="style"&&o.changeTarget(r.style)}}r.setStyle(i)}e&&(e.style=null,e&&r.attr(e),e.style=i)}function vxe(r,e,t,i,n){if(n){var a=SO("update",r,e,i,t);a.duration>0&&r.animateFrom(n,a)}}function gxe(r,e){tt(e,"silent")&&(r.silent=e.silent),tt(e,"ignore")&&(r.ignore=e.ignore),r instanceof Si&&tt(e,"invisible")&&(r.invisible=e.invisible),r instanceof pt&&tt(e,"autoBatch")&&(r.autoBatch=e.autoBatch)}var Nu={},yxe={setTransform:function(r,e){return Nu.el[r]=e,this},getTransform:function(r){return Nu.el[r]},setShape:function(r,e){var t=Nu.el,i=t.shape||(t.shape={});return i[r]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(r){var e=Nu.el.shape;if(e)return e[r]},setStyle:function(r,e){var t=Nu.el,i=t.style;return i&&(i[r]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(r){var e=Nu.el.style;if(e)return e[r]},setExtra:function(r,e){var t=Nu.el.extra||(Nu.el.extra={});return t[r]=e,this},getExtra:function(r){var e=Nu.el.extra;if(e)return e[r]}};function _xe(){var r=this,e=r.el;if(e){var t=tg(e).userDuring,i=r.userDuring;if(t!==i){r.el=r.userDuring=null;return}Nu.el=e,i(yxe)}}function gZ(r,e,t,i){var n=t[r];if(n){var a=e[r],o;if(a){var s=t.transition,l=n.transition;if(l)if(!o&&(o=i[r]={}),rf(l))he(o,a);else for(var u=tr(l),c=0;c<u.length;c++){var h=u[c],f=a[h];o[h]=f}else if(rf(s)||yt(s,r)>=0){!o&&(o=i[r]={});for(var p=At(a),c=0;c<p.length;c++){var h=p[c],f=a[h];bxe(n[h],f)&&(o[h]=f)}}}}}function yZ(r,e,t){var i=e[r];if(i)for(var n=t[r]={},a=At(i),o=0;o<a.length;o++){var s=a[o];n[s]=Mp(i[s])}}function xxe(r,e,t){for(var i=e.transition,n=rf(i)?ts:tr(i||[]),a=0;a<n.length;a++){var o=n[a];if(!(o==="style"||o==="shape"||o==="extra")){var s=r[o];t[o]=s}}}function Sxe(r,e,t){for(var i=0;i<vZ.length;i++){var n=vZ[i],a=_Z[n],o=e[n];o&&(t[a[0]]=o[0],t[a[1]]=o[1])}for(var i=0;i<ts.length;i++){var s=ts[i];e[s]!=null&&(t[s]=e[s])}}function Mxe(r,e,t,i){if(t){var n=r.style,a;if(n){var o=t.transition,s=e.transition;if(o&&!rf(o)){var l=tr(o);!a&&(a=i.style={});for(var u=0;u<l.length;u++){var c=l[u],h=n[c];a[c]=h}}else if(r.getAnimationStyleProps&&(rf(s)||rf(o)||yt(s,"style")>=0)){var f=r.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=i.style={});for(var d=At(t),u=0;u<d.length;u++){var c=d[u];if(p[c]){var h=n[c];a[c]=h}}}}}}}function bxe(r,e){return di(r)?r!==e:r!=null&&isFinite(r)}var xZ=xt(),wxe=["percent","easing","shape","style","extra"];function PE(r){r.stopAnimation("keyframe"),r.attr(xZ(r))}function ng(r,e,t){if(!(!t.isAnimationEnabled()||!e)){if(pe(e)){N(e,function(s){ng(r,s,t)});return}var i=e.keyframes,n=e.duration;if(t&&n==null){var a=Su("enter",t,0);n=a&&a.duration}if(!(!i||!n)){var o=xZ(r);N(xS,function(s){if(!(s&&!r[s])){var l,u=!1;i.sort(function(c,h){return c.percent-h.percent}),N(i,function(c){var h=r.animators,f=s?c[s]:c;if(f){var p=At(f);if(s||(p=Yt(p,function(m){return yt(wxe,m)<0})),!!p.length){l||(l=r.animate(s,e.loop,!0),l.scope="keyframe");for(var d=0;d<h.length;d++)h[d]!==l&&h[d].targetName===l.targetName&&h[d].stopTracks(p);s&&(o[s]=o[s]||{});var g=s?o[s]:o;N(p,function(m){g[m]=((s?r[s]:r)||{})[m]}),l.whenWithKeys(n*c.percent,f,p,c.easing)}}}),l&&l.delay(e.delay||0).duration(n).start(e.easing)}})}}}var Ec="emphasis",nf="normal",CO="blur",RO="select",af=[nf,Ec,CO,RO],bO={normal:["itemStyle"],emphasis:[Ec,"itemStyle"],blur:[CO,"itemStyle"],select:[RO,"itemStyle"]},wO={normal:["label"],emphasis:[Ec,"label"],blur:[CO,"label"],select:[RO,"label"]},Txe=["x","y"],Exe="e\0\0",Ks={normal:{},emphasis:{},blur:{},select:{}},Axe={cartesian2d:mO,geo:vO,single:gO,polar:yO,calendar:_O};function EO(r){return r instanceof pt}function AO(r){return r instanceof Si}function Cxe(r,e){e.copyTransform(r),AO(e)&&AO(r)&&(e.setStyle(r.style),e.z=r.z,e.z2=r.z2,e.zlevel=r.zlevel,e.invisible=r.invisible,e.ignore=r.ignore,EO(e)&&EO(r)&&e.setShape(r.shape))}var Rxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n,a){this._progressiveEls=null;var o=this._data,s=t.getData(),l=this.group,u=SZ(t,s,i,n);o||l.removeAll(),s.diff(o).add(function(h){TO(n,null,h,u(h,a),t,l,s)}).remove(function(h){var f=o.getItemGraphicEl(h);f&&ig(f,Iu(f).option,t)}).update(function(h,f){var p=o.getItemGraphicEl(f);TO(n,p,h,u(h,a),t,l,s)}).execute();var c=t.get("clip",!0)?Ru(t.coordinateSystem,!1,t):null;c?l.setClipPath(c):l.removeClipPath(),this._data=s},e.prototype.incrementalPrepareRender=function(t,i,n){this.group.removeAll(),this._data=null},e.prototype.incrementalRender=function(t,i,n,a,o){var s=i.getData(),l=SZ(i,s,n,a),u=this._progressiveEls=[];function c(p){p.isGroup||(p.incremental=!0,p.ensureState("emphasis").hoverLayer=!0)}for(var h=t.start;h<t.end;h++){var f=TO(null,null,h,l(h,o),i,this.group,s);f&&(f.traverse(c),u.push(f))}},e.prototype.eachRendered=function(t){ya(this._progressiveEls||this.group,t)},e.prototype.filterForExposedEvent=function(t,i,n,a){var o=i.element;if(o==null||n.name===o)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===o)return!0;return!1},e.type="custom",e}(Zt),TZ=Rxe;function LO(r){var e=r.type,t;if(e==="path"){var i=r.shape,n=i.width!=null&&i.height!=null?{x:i.x||0,y:i.y||0,width:i.width,height:i.height}:null,a=CZ(i);t=hv(a,null,n,i.layout||"center"),Iu(t).customPathData=a}else if(e==="image")t=new Br({}),Iu(t).customImagePath=r.style.image;else if(e==="text")t=new It({});else if(e==="group")t=new Ze;else{if(e==="compoundPath")throw new Error('"compoundPath" is not supported yet.');var o=ax(e);if(!o){var s="";hr(s)}t=new o}return Iu(t).customGraphicType=e,t.name=r.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function DO(r,e,t,i,n,a,o){PE(e);var s=n&&n.normal.cfg;s&&e.setTextConfig(s),i&&i.transition==null&&(i.transition=Txe);var l=i&&i.style;if(l){if(e.type==="text"){var u=l;tt(u,"textFill")&&(u.fill=u.textFill),tt(u,"textStroke")&&(u.stroke=u.textStroke)}var c=void 0,h=EO(e)?l.decal:null;r&&h&&(h.dirty=!0,c=Il(h,r)),l.__decalPattern=c}if(AO(e)&&l){var c=l.__decalPattern;c&&(l.decal=c)}rg(e,i,a,{dataIndex:t,isInit:o,clearStyle:!0}),ng(e,i.keyframeAnimation,a)}function EZ(r,e,t,i,n){var a=e.isGroup?null:e,o=n&&n[r].cfg;if(a){var s=a.ensureState(r);if(i===!1){var l=a.getState(r);l&&(l.style=null)}else s.style=i||null;o&&(s.textConfig=o),Ml(a)}}function Lxe(r,e,t){if(!r.isGroup){var i=r,n=t.currentZ,a=t.currentZLevel;i.z=n,i.zlevel=a;var o=e.z2;o!=null&&(i.z2=o||0);for(var s=0;s<af.length;s++)Dxe(i,e,af[s])}}function Dxe(r,e,t){var i=t===nf,n=i?e:IE(e,t),a=n?n.z2:null,o;a!=null&&(o=i?r:r.ensureState(t),o.z2=a||0)}function SZ(r,e,t,i){var n=r.get("renderItem"),a=r.coordinateSystem,o={};a&&(o=a.prepareCustoms?a.prepareCustoms(a):Axe[a.type](a));for(var s=Ye({getWidth:i.getWidth,getHeight:i.getHeight,getZr:i.getZr,getDevicePixelRatio:i.getDevicePixelRatio,value:x,style:S,ordinalRawValue:M,styleEmphasis:w,visual:b,barLayout:E,currentSeriesIndices:I,font:R},o.api||{}),l={context:{},seriesId:r.id,seriesName:r.name,seriesIndex:r.seriesIndex,coordSys:o.coordSys,dataInsideLength:e.count(),encode:Pxe(r.getData())},u,c,h={},f={},p={},d={},g=0;g<af.length;g++){var m=af[g];p[m]=r.getModel(bO[m]),d[m]=r.getModel(wO[m])}function v(A){return A===u?c||(c=e.getItemModel(A)):e.getItemModel(A)}function _(A,P){return e.hasItemOption?A===u?h[P]||(h[P]=v(A).getModel(bO[P])):v(A).getModel(bO[P]):p[P]}function y(A,P){return e.hasItemOption?A===u?f[P]||(f[P]=v(A).getModel(wO[P])):v(A).getModel(wO[P]):d[P]}return function(A,P){return u=A,c=null,h={},f={},n&&n(Ye({dataIndexInside:A,dataIndex:e.getRawIndex(A),actionType:P?P.type:null},l),s)};function x(A,P){return P==null&&(P=u),e.getStore().get(e.getDimensionIndex(A||0),P)}function M(A,P){P==null&&(P=u),A=A||0;var U=e.getDimensionInfo(A);if(!U){var B=e.getDimensionIndex(A);return B>=0?e.getStore().get(B,P):void 0}var z=e.get(U.name,P),k=U&&U.ordinalMeta;return k?k.categories[z]:z}function S(A,P){P==null&&(P=u);var U=e.getItemVisual(P,"style"),B=U&&U.fill,z=U&&U.opacity,k=_(P,nf).getItemStyle();B!=null&&(k.fill=B),z!=null&&(k.opacity=z);var G={inheritColor:Ce(B)?B:"#000"},Y=y(P,nf),J=pr(Y,null,G,!1,!0);J.text=Y.getShallow("show")?mt(r.getFormattedLabel(P,nf),Fl(e,P)):null;var Q=sx(Y,G,!1);return C(A,k),k=xO(k,J,Q),A&&T(k,A),k.legacy=!0,k}function w(A,P){P==null&&(P=u);var U=_(P,Ec).getItemStyle(),B=y(P,Ec),z=pr(B,null,null,!0,!0);z.text=B.getShallow("show")?qi(r.getFormattedLabel(P,Ec),r.getFormattedLabel(P,nf),Fl(e,P)):null;var k=sx(B,null,!0);return C(A,U),U=xO(U,z,k),A&&T(U,A),U.legacy=!0,U}function T(A,P){for(var U in P)tt(P,U)&&(A[U]=P[U])}function C(A,P){A&&(A.textFill&&(P.textFill=A.textFill),A.textPosition&&(P.textPosition=A.textPosition))}function b(A,P){if(P==null&&(P=u),tt(dO,A)){var U=e.getItemVisual(P,"style");return U?U[dO[A]]:null}if(tt(fZ,A))return e.getItemVisual(P,A)}function E(A){if(a.type==="cartesian2d"){var P=a.getBaseAxis();return c8(Ye({axis:P},A))}}function I(){return t.getCurrentSeriesIndices()}function R(A){return pv(A,t)}}function Pxe(r){var e={};return N(r.dimensions,function(t){var i=r.getDimensionInfo(t);if(!i.isExtraCoord){var n=i.coordDim,a=e[n]=e[n]||[];a[i.coordDimIndex]=r.getDimensionIndex(t)}}),e}function TO(r,e,t,i,n,a,o){if(!i){a.remove(e);return}var s=PO(r,e,t,i,n,a);return s&&o.setItemGraphicEl(t,s),s&&sr(s,i.focus,i.blurScope,i.emphasisDisabled),s}function PO(r,e,t,i,n,a){var o=-1,s=e;e&&AZ(e,i,n)&&(o=yt(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=LO(i),s&&Cxe(s,u)),i.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),Ks.normal.cfg=Ks.normal.conOpt=Ks.emphasis.cfg=Ks.emphasis.conOpt=Ks.blur.cfg=Ks.blur.conOpt=Ks.select.cfg=Ks.select.conOpt=null,Ks.isLegacy=!1,Nxe(u,t,i,n,l,Ks),Ixe(u,t,i,n,l),DO(r,u,t,i,Ks,n,l),tt(i,"info")&&(Iu(u).info=i.info);for(var c=0;c<af.length;c++){var h=af[c];if(h!==nf){var f=IE(i,h),p=IO(i,f,h);EZ(h,u,f,p,Ks)}}return Lxe(u,i,n),i.type==="group"&&Uxe(r,u,t,i,n),o>=0?a.replaceAt(u,o):a.add(u),u}function AZ(r,e,t){var i=Iu(r),n=e.type,a=e.shape,o=e.style;return t.isUniversalTransitionEnabled()||n!=null&&n!==i.customGraphicType||n==="path"&&Bxe(a)&&CZ(a)!==i.customPathData||n==="image"&&tt(o,"image")&&o.image!==i.customImagePath}function Ixe(r,e,t,i,n){var a=t.clipPath;if(a===!1)r&&r.getClipPath()&&r.removeClipPath();else if(a){var o=r.getClipPath();o&&AZ(o,a,i)&&(o=null),o||(o=LO(a),r.setClipPath(o)),DO(null,o,e,a,null,i,n)}}function Nxe(r,e,t,i,n,a){if(!r.isGroup){MZ(t,null,a),MZ(t,Ec,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=r.getTextContent();if(o===!1)c&&r.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=LO(o),r.setTextContent(c)),DO(null,c,e,o,null,i,n);for(var h=o&&o.style,f=0;f<af.length;f++){var p=af[f];if(p!==nf){var d=a[p].conOpt;EZ(p,c,d,IO(o,d,p),null)}}h?c.dirty():c.markRedraw()}}}}function MZ(r,e,t){var i=e?IE(r,e):r,n=e?IO(r,i,Ec):r.style,a=r.type,o=i?i.textConfig:null,s=r.textContent,l=s?e?IE(s,e):s:null;if(n&&(t.isLegacy||LE(n,a,!!o,!!l))){t.isLegacy=!0;var u=DE(n,a,!e);!o&&u.textConfig&&(o=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!e&&l){var c=l;!c.type&&(c.type="text")}var h=e?t[e]:t.normal;h.cfg=o,h.conOpt=l}function IE(r,e){return e?r?r[e]:null:r}function IO(r,e,t){var i=e&&e.style;return i==null&&t===Ec&&r&&(i=r.styleEmphasis),i}function Uxe(r,e,t,i,n){var a=i.children,o=a?a.length:0,s=i.$mergeChildren,l=s==="byName"||i.diffChildrenByName,u=s===!1;if(!(!o&&!l&&!u)){if(l){zxe({api:r,oldChildren:e.children()||[],newChildren:a||[],dataIndex:t,seriesModel:n,group:e});return}u&&e.removeAll();for(var c=0;c<o;c++){var h=a[c],f=e.childAt(c);h?(h.ignore==null&&(h.ignore=!1),PO(r,f,t,h,n,e)):f.ignore=!0}for(var p=e.childCount()-1;p>=c;p--){var d=e.childAt(p);Oxe(e,d,n)}}}function Oxe(r,e,t){e&&ig(e,Iu(r).option,t)}function zxe(r){new In(r.oldChildren,r.newChildren,bZ,bZ,r).add(wZ).update(wZ).remove(Fxe).execute()}function bZ(r,e){var t=r&&r.name;return t??Exe+e}function wZ(r,e){var t=this.context,i=r!=null?t.newChildren[r]:null,n=e!=null?t.oldChildren[e]:null;PO(t.api,n,t.dataIndex,i,t.seriesModel,t.group)}function Fxe(r){var e=this.context,t=e.oldChildren[r];t&&ig(t,Iu(t).option,e.seriesModel)}function CZ(r){return r&&(r.pathData||r.d)}function Bxe(r){return r&&(tt(r,"pathData")||tt(r,"d"))}function NO(r){r.registerChartView(TZ),r.registerSeriesModel(pZ)}var Sd=xt(),RZ=Qe,UO=Be,kxe=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(e,t,i,n){var a=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,i);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=c;var h=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new Ze,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),i.getZr().add(s);else{var f=ut(LZ,t,h);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,t)}PZ(s,t,!0),this._renderHandle(a)}},r.prototype.remove=function(e){this.clear(e)},r.prototype.dispose=function(e){this.clear(e)},r.prototype.determineAnimation=function(e,t){var i=t.get("animation"),n=e.axis,a=n.type==="category",o=t.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=jT(e).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},r.prototype.makeElOption=function(e,t,i,n,a){},r.prototype.createPointerEl=function(e,t,i,n){var a=t.pointer;if(a){var o=Sd(e).pointerEl=new Pt[a.type](RZ(t.pointer));e.add(o)}},r.prototype.createLabelEl=function(e,t,i,n){if(t.label){var a=Sd(e).labelEl=new It(RZ(t.label));e.add(a),DZ(a,n)}},r.prototype.updatePointerEl=function(e,t,i){var n=Sd(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},r.prototype.updateLabelEl=function(e,t,i,n){var a=Sd(e).labelEl;a&&(a.setStyle(t.label.style),i(a,{x:t.label.x,y:t.label.y}),DZ(a,n))},r.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=t.getModel("handle"),o=t.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=pc(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){po(u.event)},onmousedown:UO(this._onHandleDragMove,this,0,0),drift:UO(this._onHandleDragMove,this),ondragend:UO(this._onHandleDragEnd,this)}),i.add(n)),PZ(n,t,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");pe(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,Hs(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},r.prototype._moveHandleToValue=function(e,t){LZ(this._axisPointerModel,!t&&this._moveAnimation,this._handle,OO(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(OO(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(OO(n)),Sd(i).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,n=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),xc(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(e,t,i){return i=i||0,{x:e[i],y:e[1-i],width:t[i],height:t[1-i]}},r}();function LZ(r,e,t,i){IZ(Sd(t).lastProp,i)||(Sd(t).lastProp=i,e?Ut(t,i,r):(t.stopAnimation(),t.attr(i)))}function IZ(r,e){if(qe(r)&&qe(e)){var t=!0;return N(e,function(i,n){t=t&&IZ(r[n],i)}),!!t}else return r===e}function DZ(r,e){r[e.get(["label","show"])?"show":"hide"]()}function OO(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function PZ(r,e,t){var i=e.get("z"),n=e.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=t)})}var ag=kxe;function og(r){var e=r.get("type"),t=r.getModel(e+"Style"),i;return e==="line"?(i=t.getLineStyle(),i.fill=null):e==="shadow"&&(i=t.getAreaStyle(),i.stroke=null),i}function zO(r,e,t,i,n){var a=t.get("value"),o=FO(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=Al(s.get("padding")||0),u=s.getFont(),c=fu(o,u),h=n.position,f=c.width+l[1]+l[3],p=c.height+l[0]+l[2],d=n.align;d==="right"&&(h[0]-=f),d==="center"&&(h[0]-=f/2);var g=n.verticalAlign;g==="bottom"&&(h[1]-=p),g==="middle"&&(h[1]-=p/2),Vxe(h,f,p,i);var m=s.get("backgroundColor");(!m||m==="auto")&&(m=e.get(["axisLine","lineStyle","color"])),r.label={x:h[0],y:h[1],style:pr(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:m}),z2:10}}function Vxe(r,e,t,i){var n=i.getWidth(),a=i.getHeight();r[0]=Math.min(r[0]+e,n)-e,r[1]=Math.min(r[1]+t,a)-t,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function FO(r,e,t,i,n){r=e.scale.parse(r);var a=e.scale.getLabel({value:r},{precision:n.precision}),o=n.formatter;if(o){var s={value:Yx(e,{value:r}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};N(i,function(l){var u=t.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,h=u&&u.getDataParams(c);h&&s.seriesData.push(h)}),Ce(o)?a=o.replace("{value}",a):He(o)&&(a=o(s))}return a}function SS(r,e,t){var i=Ci();return vo(i,i,t.rotation),Tn(i,i,t.position),Ln([r.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],i)}function NE(r,e,t,i,n,a){var o=Nn.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=n.get(["label","margin"]),zO(e,i,n,a,{position:SS(i.axis,r,t),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function sg(r,e,t){return t=t||0,{x1:r[t],y1:r[1-t],x2:e[t],y2:e[1-t]}}function UE(r,e,t){return t=t||0,{x:r[t],y:r[1-t],width:e[t],height:e[1-t]}}function BO(r,e,t,i,n,a){return{cx:r,cy:e,r0:t,r:i,startAngle:n,endAngle:a,clockwise:!0}}var Gxe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),c=NZ(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var f=og(a),p=Hxe[u](s,h,c);p.style=f,t.graphicKey=p.type,t.pointer=p}var d=iS(l.model,n);NE(i,t,d,n,a,o)},e.prototype.getHandleTransform=function(t,i,n){var a=iS(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=SS(i.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=NZ(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,h=[t.x,t.y];h[c]+=i[c],h[c]=Math.min(l[1],h[c]),h[c]=Math.max(l[0],h[c]);var f=(u[1]+u[0])/2,p=[f,f];p[c]=h[c];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:t.rotation,cursorPoint:p,tooltipOption:d[c]}},e}(ag);function NZ(r,e){var t={};return t[e.dim+"AxisIndex"]=e.index,r.getCartesian(t)}var Hxe={line:function(r,e,t){var i=sg([e,t[0]],[e,t[1]],UZ(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,e,t){var i=Math.max(1,r.getBandWidth()),n=t[1]-t[0];return{type:"Rect",shape:UE([e-i/2,t[0]],[i,n],UZ(r))}}};function UZ(r){return r.dim==="x"?0:1}var OZ=Gxe;var Wxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Nt),zZ=Wxe;var Ac=xt(),Xxe=N;function zE(r,e,t){if(!Bt.node){var i=e.getZr();Ac(i).records||(Ac(i).records={}),Yxe(i,e);var n=Ac(i).records[r]||(Ac(i).records[r]={});n.handler=t}}function Yxe(r,e){if(Ac(r).initialized)return;Ac(r).initialized=!0,t("click",ut(FZ,"click")),t("mousemove",ut(FZ,"mousemove")),t("globalout",Zxe);function t(i,n){r.on(i,function(a){var o=jxe(e);Xxe(Ac(r).records,function(s){s&&n(s,a,o.dispatchAction)}),qxe(o.pendings,e)})}}function qxe(r,e){var t=r.showTip.length,i=r.hideTip.length,n;t?n=r.showTip[t-1]:i&&(n=r.hideTip[i-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function Zxe(r,e,t){r.handler("leave",null,t)}function FZ(r,e,t,i){e.handler(r,t,i)}function jxe(r){var e={showTip:[],hideTip:[]},t=function(i){var n=e[i.type];n?n.push(i):(i.dispatchAction=t,r.dispatchAction(i))};return{dispatchAction:t,pendings:e}}function MS(r,e){if(!Bt.node){var t=e.getZr(),i=(Ac(t).records||{})[r];i&&(Ac(t).records[r]=null)}}var Kxe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=i.getComponent("tooltip"),o=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";zE("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,i){MS("axisPointer",i)},e.prototype.dispose=function(t,i){MS("axisPointer",i)},e.type="axisPointer",e}(ir),kZ=Kxe;function bS(r,e){var t=[],i=r.seriesIndex,n;if(i==null||!(n=e.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=Us(a,r);if(o==null||o<0||pe(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)t=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),h=c.dim,f=u.dim,p=h==="x"||h==="radius"?1:0,d=a.mapDimension(f),g=[];g[p]=a.get(d,o),g[1-p]=a.get(a.getCalculationInfo("stackResultDimension"),o),t=l.dataToPoint(g)||[]}else t=l.dataToPoint(a.getValues(de(l.dimensions,function(v){return a.mapDimension(v)}),o))||[];else if(s){var m=s.getBoundingRect().clone();m.applyTransform(s.transform),t=[m.x+m.width/2,m.y+m.height/2]}return{point:t,el:s}}var VZ=xt();function kO(r,e,t){var i=r.currTrigger,n=[r.x,r.y],a=r,o=r.dispatchAction||Be(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){FE(n)&&(n=bS({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=FE(n),u=a.axesInfo,c=s.axesInfo,h=i==="leave"||FE(n),f={},p={},d={list:[],map:{}},g={showPointer:ut($xe,p),showTooltip:ut(Qxe,d)};N(s.coordSysMap,function(v,_){var y=l||v.containPoint(n);N(s.coordSysAxesInfo[_],function(x,M){var S=x.axis,w=iSe(u,x);if(!h&&y&&(!u||w)){var T=w&&w.value;T==null&&!l&&(T=S.pointToData(n)),T!=null&&GZ(x,T,g,!1,f)}})});var m={};return N(c,function(v,_){var y=v.linkGroup;y&&!p[_]&&N(y.axesInfo,function(x,M){var S=p[M];if(x!==v&&S){var w=S.value;y.mapper&&(w=v.axis.scale.parse(y.mapper(w,HZ(x),HZ(v)))),m[v.key]=w}})}),N(m,function(v,_){GZ(c[_],v,g,!0,f)}),eSe(p,c,f),tSe(d,n,r,o),rSe(c,o,t),f}}function GZ(r,e,t,i,n){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!r.involveSeries){t.showPointer(r,e);return}var o=Jxe(e,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&he(n,s[0]),!i&&r.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(r,e,s),t.showTooltip(r,o,l)}}function Jxe(r,e){var t=e.axis,i=t.dim,n=r,a=[],o=Number.MAX_VALUE,s=-1;return N(e.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(i),h,f;if(l.getAxisTooltipData){var p=l.getAxisTooltipData(c,r,t);f=p.dataIndices,h=p.nestestValue}else{if(f=l.getData().indicesOfNearest(c[0],r,t.type==="category"?.5:null),!f.length)return;h=l.getData().get(c[0],f[0])}if(!(h==null||!isFinite(h))){var d=r-h,g=Math.abs(d);g<=o&&((g<o||d>=0&&s<0)&&(o=g,s=d,n=h,a.length=0),N(f,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:n}}function $xe(r,e,t,i){r[e.key]={value:t,payloadBatch:i}}function Qxe(r,e,t,i){var n=t.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!n.length)){var l=e.coordSys.model,u=zv(l),c=r.map[u];c||(c=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function eSe(r,e,t){var i=t.axesInfo=[];N(e,function(n,a){var o=n.axisPointerModel.option,s=r[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function tSe(r,e,t,i){if(FE(e)||!r.list.length){i({type:"hideTip"});return}var n=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:r.list})}function rSe(r,e,t){var i=t.getZr(),n="axisPointerLastHighlights",a=VZ(i)[n]||{},o=VZ(i)[n]={};N(r,function(u,c){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&N(h.seriesDataIndices,function(f){var p=f.seriesIndex+" | "+f.dataIndex;o[p]=f})});var s=[],l=[];N(a,function(u,c){!o[c]&&l.push(u)}),N(o,function(u,c){!a[c]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function iSe(r,e){for(var t=0;t<(r||[]).length;t++){var i=r[t];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function HZ(r){var e=r.axis.model,t={},i=t.axisDim=r.axis.dim;return t.axisIndex=t[i+"AxisIndex"]=e.componentIndex,t.axisName=t[i+"AxisName"]=e.name,t.axisId=t[i+"AxisId"]=e.id,t}function FE(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function Gl(r){Po.registerAxisPointerClass("CartesianAxisPointer",OZ),r.registerComponentModel(zZ),r.registerComponentView(kZ),r.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!pe(t)&&(e.axisPointer.link=[t])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=v9(e,t)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},kO)}function VO(r){Ot($T),Ot(Gl)}var nSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),c=u.getExtent(),h=s.dataToCoord(i),f=a.get("type");if(f&&f!=="none"){var p=og(a),d=oSe[f](s,l,h,c);d.style=p,t.graphicKey=d.type,t.pointer=d}var g=a.get(["label","margin"]),m=aSe(i,n,a,l,g);zO(t,n,a,o,m)},e}(ag);function aSe(r,e,t,i,n){var a=e.axis,o=a.dataToCoord(r),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=i.getRadiusAxis().getExtent(),u,c,h;if(a.dim==="radius"){var f=Ci();vo(f,f,s),Tn(f,f,[i.cx,i.cy]),u=Ln([o,-n],f);var p=e.getModel("axisLabel").get("rotate")||0,d=Nn.innerTextLayout(s,p*Math.PI/180,-1);c=d.textAlign,h=d.textVerticalAlign}else{var g=l[1];u=i.coordToPoint([g+n,o]);var m=i.cx,v=i.cy;c=Math.abs(u[0]-m)/g<.3?"center":u[0]>m?"left":"right",h=Math.abs(u[1]-v)/g<.3?"middle":u[1]>v?"top":"bottom"}return{position:u,align:c,verticalAlign:h}}var oSe={line:function(r,e,t,i){return r.dim==="angle"?{type:"Line",shape:sg(e.coordToPoint([i[0],t]),e.coordToPoint([i[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(r,e,t,i){var n=Math.max(1,r.getBandWidth()),a=Math.PI/180;return r.dim==="angle"?{type:"Sector",shape:BO(e.cx,e.cy,i[0],i[1],(-t-n/2)*a,(-t+n/2)*a)}:{type:"Sector",shape:BO(e.cx,e.cy,t-n/2,t+n/2,0,Math.PI*2)}}},WZ=nSe;var sSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var i,n=this.ecModel;return n.eachComponent(t,function(a){a.getCoordSysModel()===this&&(i=a)},this),i},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Nt),XZ=sSe;var GO=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Ir).models[0]},e.type="polarAxis",e}(Nt);Cr(GO,wu);var YZ=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(GO);var qZ=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(GO);var HO=function(r){Z(e,r);function e(t,i){return r.call(this,"radius",t,i)||this}return e.prototype.pointToData=function(t,i){return this.polar.pointToData(t,i)[this.dim==="radius"?0:1]},e}(vn);HO.prototype.dataToRadius=vn.prototype.dataToCoord;HO.prototype.radiusToData=vn.prototype.coordToData;var ZZ=HO;var lSe=xt(),WO=function(r){Z(e,r);function e(t,i){return r.call(this,"angle",t,i||[0,360])||this}return e.prototype.pointToData=function(t,i){return this.polar.pointToData(t,i)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,i=t.getLabelModel(),n=t.scale,a=n.getExtent(),o=n.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=t.dataToCoord(s+1)-t.dataToCoord(s),u=Math.abs(l),c=fu(s==null?"":s+"",i.getFont(),"center","top"),h=Math.max(c.height,7),f=h/u;isNaN(f)&&(f=1/0);var p=Math.max(0,Math.floor(f)),d=lSe(t.model),g=d.lastAutoInterval,m=d.lastTickCount;return g!=null&&m!=null&&Math.abs(g-p)<=1&&Math.abs(m-o)<=1&&g>p?p=g:(d.lastTickCount=o,d.lastAutoInterval=p),p},e}(vn);WO.prototype.dataToAngle=vn.prototype.dataToCoord;WO.prototype.angleToData=vn.prototype.coordToData;var jZ=WO;var XO=["radius","angle"],uSe=function(){function r(e){this.dimensions=XO,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new ZZ,this._angleAxis=new jZ,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return r.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},r.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},r.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},r.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},r.prototype.getAxesByScale=function(e){var t=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===e&&t.push(i),n.scale.type===e&&t.push(n),t},r.prototype.getAngleAxis=function(){return this._angleAxis},r.prototype.getRadiusAxis=function(){return this._radiusAxis},r.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},r.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},r.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},r.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},r.prototype.pointToData=function(e,t){var i=this.pointToCoord(e);return[this._radiusAxis.radiusToData(i[0],t),this._angleAxis.angleToData(i[1],t)]},r.prototype.pointToCoord=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=this.getAngleAxis(),a=n.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);n.inverse?o=s-360:s=o+360;var l=Math.sqrt(t*t+i*i);t/=l,i/=l;for(var u=Math.atan2(-i,t)/Math.PI*180,c=u<o?1:-1;u<o||u>s;)u+=c*360;return[l,u]},r.prototype.coordToPoint=function(e){var t=e[0],i=e[1]/180*Math.PI,n=Math.cos(i)*t+this.cx,a=-Math.sin(i)*t+this.cy;return[n,a]},r.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),i=t.getExtent().slice();i[0]>i[1]&&i.reverse();var n=e.getExtent(),a=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:i[0],r:i[1],startAngle:-n[0]*a,endAngle:-n[1]*a,clockwise:e.inverse,contain:function(o,s){var l=o-this.cx,u=s-this.cy,c=l*l+u*u-1e-4,h=this.r,f=this.r0;return c<=h*h&&c>=f*f}}},r.prototype.convertToPixel=function(e,t,i){var n=KZ(t);return n===this?this.dataToPoint(i):null},r.prototype.convertFromPixel=function(e,t,i){var n=KZ(t);return n===this?this.pointToData(i):null},r}();function KZ(r){var e=r.seriesModel,t=r.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}var JZ=uSe;function cSe(r,e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight();r.cx=ze(i[0],n),r.cy=ze(i[1],a);var o=r.getRadiusAxis(),s=Math.min(n,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:pe(l)||(l=[0,l]);var u=[ze(l[0],s),ze(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function hSe(r,e){var t=this,i=t.getAngleAxis(),n=t.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),n.scale.setExtent(1/0,-1/0),r.eachSeries(function(s){if(s.coordinateSystem===t){var l=s.getData();N(Lv(l,"radius"),function(u){n.scale.unionExtentFromData(l,u)}),N(Lv(l,"angle"),function(u){i.scale.unionExtentFromData(l,u)})}}),bu(i.scale,i.model),bu(n.scale,n.model),i.type==="category"&&!i.onBand){var a=i.getExtent(),o=360/i.scale.count();i.inverse?a[1]+=o:a[1]-=o,i.setExtent(a[0],a[1])}}function fSe(r){return r.mainType==="angleAxis"}function $Z(r,e){var t;if(r.type=e.get("type"),r.scale=Xh(e),r.onBand=e.get("boundaryGap")&&r.type==="category",r.inverse=e.get("inverse"),fSe(e)){r.inverse=r.inverse!==e.get("clockwise");var i=e.get("startAngle"),n=(t=e.get("endAngle"))!==null&&t!==void 0?t:i+(r.inverse?-360:360);r.setExtent(i,n)}e.axis=r,r.model=e}var pSe={dimensions:XO,create:function(r,e){var t=[];return r.eachComponent("polar",function(i,n){var a=new JZ(n+"");a.update=hSe;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=i.findAxisModel("radiusAxis"),u=i.findAxisModel("angleAxis");$Z(o,l),$Z(s,u),cSe(a,i,e),t.push(a),i.coordinateSystem=a,a.model=i}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="polar"){var n=i.getReferringComponents("polar",Ir).models[0];i.coordinateSystem=n.coordinateSystem}}),t}},QZ=pSe;var dSe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function BE(r,e,t){e[1]>e[0]&&(e=e.slice().reverse());var i=r.coordToPoint([e[0],t]),n=r.coordToPoint([e[1],t]);return{x1:i[0],y1:i[1],x2:n[0],y2:n[1]}}function kE(r){var e=r.getRadiusAxis();return e.inverse?0:1}function ej(r){var e=r[0],t=r[r.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&r.pop()}var mSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,i){if(this.group.removeAll(),!!t.get("show")){var n=t.axis,a=n.polar,o=a.getRadiusAxis().getExtent(),s=n.getTicksCoords(),l=n.getMinorTicksCoords(),u=de(n.getViewLabels(),function(c){c=Qe(c);var h=n.scale,f=h.type==="ordinal"?h.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=n.dataToCoord(f),c});ej(u),ej(s),N(dSe,function(c){t.get([c,"show"])&&(!n.scale.isBlank()||c==="axisLine")&&vSe[c](this.group,t,a,s,l,o,u)},this)}},e.type="angleAxis",e}(Po),vSe={axisLine:function(r,e,t,i,n,a){var o=e.getModel(["axisLine","lineStyle"]),s=t.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=kE(t),h=c?0:1,f,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[h]===0?f=new Pt[p]({shape:{cx:t.cx,cy:t.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new Gp({shape:{cx:t.cx,cy:t.cy,r:a[c],r0:a[h]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,r.add(f)},axisTick:function(r,e,t,i,n,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[kE(t)],u=de(i,function(c){return new ei({shape:BE(t,[l,l+s],c.coord)})});r.add(Jn(u,{style:Ye(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(r,e,t,i,n,a){if(n.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[kE(t)],c=[],h=0;h<n.length;h++)for(var f=0;f<n[h].length;f++)c.push(new ei({shape:BE(t,[u,u+l],n[h][f].coord)}));r.add(Jn(c,{style:Ye(s.getModel("lineStyle").getLineStyle(),Ye(o.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(r,e,t,i,n,a,o){var s=e.getCategories(!0),l=e.getModel("axisLabel"),u=l.get("margin"),c=e.get("triggerEvent");N(o,function(h,f){var p=l,d=h.tickValue,g=a[kE(t)],m=t.coordToPoint([g+u,h.coord]),v=t.cx,_=t.cy,y=Math.abs(m[0]-v)/g<.3?"center":m[0]>v?"left":"right",x=Math.abs(m[1]-_)/g<.3?"middle":m[1]>_?"top":"bottom";if(s&&s[d]){var M=s[d];qe(M)&&M.textStyle&&(p=new Jt(M.textStyle,l,l.ecModel))}var S=new It({silent:Nn.isLabelSilent(e),style:pr(p,{x:m[0],y:m[1],fill:p.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:h.formattedLabel,align:y,verticalAlign:x})});if(r.add(S),c){var w=Nn.makeAxisEventDataBase(e);w.targetType="axisLabel",w.value=h.rawLabel,it(S).eventData=w}},this)},splitLine:function(r,e,t,i,n,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=0;h<i.length;h++){var f=u++%l.length;c[f]=c[f]||[],c[f].push(new ei({shape:BE(t,a,i[h].coord)}))}for(var h=0;h<c.length;h++)r.add(Jn(c[h],{style:Ye({stroke:l[h%l.length]},s.getLineStyle()),silent:!0,z:e.get("z")}))},minorSplitLine:function(r,e,t,i,n,a){if(n.length){for(var o=e.getModel("minorSplitLine"),s=o.getModel("lineStyle"),l=[],u=0;u<n.length;u++)for(var c=0;c<n[u].length;c++)l.push(new ei({shape:BE(t,a,n[u][c].coord)}));r.add(Jn(l,{style:s.getLineStyle(),silent:!0,z:e.get("z")}))}},splitArea:function(r,e,t,i,n,a){if(i.length){var o=e.getModel("splitArea"),s=o.getModel("areaStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=Math.PI/180,f=-i[0].coord*h,p=Math.min(a[0],a[1]),d=Math.max(a[0],a[1]),g=e.get("clockwise"),m=1,v=i.length;m<=v;m++){var _=m===v?i[0].coord:i[m].coord,y=u++%l.length;c[y]=c[y]||[],c[y].push(new Mi({shape:{cx:t.cx,cy:t.cy,r0:p,r:d,startAngle:f,endAngle:-_*h,clockwise:g},silent:!0})),f=-_*h}for(var m=0;m<c.length;m++)r.add(Jn(c[m],{style:Ye({fill:l[m%l.length]},s.getAreaStyle()),silent:!0}))}}},tj=mSe;var gSe=["axisLine","axisTickLabel","axisName"],ySe=["splitLine","splitArea","minorSplitLine"],_Se=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,i){if(this.group.removeAll(),!!t.get("show")){var n=this._axisGroup,a=this._axisGroup=new Ze;this.group.add(a);var o=t.axis,s=o.polar,l=s.getAngleAxis(),u=o.getTicksCoords(),c=o.getMinorTicksCoords(),h=l.getExtent()[0],f=o.getExtent(),p=SSe(s,t,h),d=new Nn(t,p);N(gSe,d.add,d),a.add(d.getGroup()),fc(n,a,t),N(ySe,function(g){t.get([g,"show"])&&!o.scale.isBlank()&&xSe[g](this.group,t,s,h,f,u,c)},this)}},e.type="radiusAxis",e}(Po),xSe={splitLine:function(r,e,t,i,n,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0,c=t.getAngleAxis(),h=Math.PI/180,f=c.getExtent(),p=Math.abs(f[1]-f[0])===360?"Circle":"Arc";l=l instanceof Array?l:[l];for(var d=[],g=0;g<a.length;g++){var m=u++%l.length;d[m]=d[m]||[],d[m].push(new Pt[p]({shape:{cx:t.cx,cy:t.cy,r:Math.max(a[g].coord,0),startAngle:-f[0]*h,endAngle:-f[1]*h,clockwise:c.inverse}}))}for(var g=0;g<d.length;g++)r.add(Jn(d[g],{style:Ye({stroke:l[g%l.length],fill:null},s.getLineStyle()),silent:!0}))},minorSplitLine:function(r,e,t,i,n,a,o){if(o.length){for(var s=e.getModel("minorSplitLine"),l=s.getModel("lineStyle"),u=[],c=0;c<o.length;c++)for(var h=0;h<o[c].length;h++)u.push(new ga({shape:{cx:t.cx,cy:t.cy,r:o[c][h].coord}}));r.add(Jn(u,{style:Ye({fill:null},l.getLineStyle()),silent:!0}))}},splitArea:function(r,e,t,i,n,a){if(a.length){var o=e.getModel("splitArea"),s=o.getModel("areaStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],h=a[0].coord,f=1;f<a.length;f++){var p=u++%l.length;c[p]=c[p]||[],c[p].push(new Mi({shape:{cx:t.cx,cy:t.cy,r0:h,r:a[f].coord,startAngle:0,endAngle:Math.PI*2},silent:!0})),h=a[f].coord}for(var f=0;f<c.length;f++)r.add(Jn(c[f],{style:Ye({fill:l[f%l.length]},s.getAreaStyle()),silent:!0}))}}};function SSe(r,e,t){return{position:[r.cx,r.cy],rotation:t/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}var rj=_Se;function ij(r){return r.get("stack")||"__ec_stack_"+r.seriesIndex}function nj(r,e){return e.dim+r.model.componentIndex}function MSe(r,e,t){var i={},n=bSe(Yt(e.getSeriesByType(r),function(a){return!e.isSeriesFiltered(a)&&a.coordinateSystem&&a.coordinateSystem.type==="polar"}));e.eachSeriesByType(r,function(a){if(a.coordinateSystem.type==="polar"){var o=a.getData(),s=a.coordinateSystem,l=s.getBaseAxis(),u=nj(s,l),c=ij(a),h=n[u][c],f=h.offset,p=h.width,d=s.getOtherAxis(l),g=a.coordinateSystem.cx,m=a.coordinateSystem.cy,v=a.get("barMinHeight")||0,_=a.get("barMinAngle")||0;i[c]=i[c]||[];for(var y=o.mapDimension(d.dim),x=o.mapDimension(l.dim),M=ls(o,y),S=l.dim!=="radius"||!a.get("roundCap",!0),w=d.dataToCoord(0),T=0,C=o.count();T<C;T++){var b=o.get(y,T),E=o.get(x,T),I=b>=0?"p":"n",R=w;M&&(i[c][E]||(i[c][E]={p:w,n:w}),R=i[c][E][I]);var A=void 0,P=void 0,U=void 0,B=void 0;if(d.dim==="radius"){var z=d.dataToCoord(b)-w,k=l.dataToCoord(E);Math.abs(z)<v&&(z=(z<0?-1:1)*v),A=R,P=R+z,U=k-f,B=U-p,M&&(i[c][E][I]=P)}else{var G=d.dataToCoord(b,S)-w,Y=l.dataToCoord(E);Math.abs(G)<_&&(G=(G<0?-1:1)*_),A=Y+f,P=A+p,U=R,B=R+G,M&&(i[c][E][I]=B)}o.setItemLayout(T,{cx:g,cy:m,r0:A,r:P,startAngle:-U*Math.PI/180,endAngle:-B*Math.PI/180,clockwise:U>=B})}}})}function bSe(r){var e={};N(r,function(i,n){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=nj(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),h=e[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=h.stacks;e[l]=h;var p=ij(i);f[p]||h.autoWidthCount++,f[p]=f[p]||{width:0,maxWidth:0};var d=ze(i.get("barWidth"),c),g=ze(i.get("barMaxWidth"),c),m=i.get("barGap"),v=i.get("barCategoryGap");d&&!f[p].width&&(d=Math.min(h.remainedWidth,d),f[p].width=d,h.remainedWidth-=d),g&&(f[p].maxWidth=g),m!=null&&(h.gap=m),v!=null&&(h.categoryGap=v)});var t={};return N(e,function(i,n){t[n]={};var a=i.stacks,o=i.bandWidth,s=ze(i.categoryGap,o),l=ze(i.gap,1),u=i.remainedWidth,c=i.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),N(a,function(g,m){var v=g.maxWidth;v&&v<h&&(v=Math.min(v,u),g.width&&(v=Math.min(v,g.width)),u-=v,g.width=v,c--)}),h=(u-s)/(c+(c-1)*l),h=Math.max(h,0);var f=0,p;N(a,function(g,m){g.width||(g.width=h),p=g,f+=g.width*(1+l)}),p&&(f-=p.width*l);var d=-f/2;N(a,function(g,m){t[n][m]=t[n][m]||{offset:d,width:g.width},d+=g.width*(1+l)})}),t}var aj=MSe;var wSe={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},TSe={splitNumber:5},ESe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="polar",e}(ir);function YO(r){Ot(Gl),Po.registerAxisPointerClass("PolarAxisPointer",WZ),r.registerCoordinateSystem("polar",QZ),r.registerComponentModel(XZ),r.registerComponentView(ESe),Vl(r,"angle",YZ,wSe),Vl(r,"radius",qZ,TSe),r.registerComponentView(tj),r.registerComponentView(rj),r.registerLayout(ut(aj,"bar"))}function wS(r,e){e=e||{};var t=r.coordinateSystem,i=r.axis,n={},a=i.position,o=i.orient,s=t.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};n.position=[o==="vertical"?u.vertical[a]:l[0],o==="horizontal"?u.horizontal[a]:l[3]];var c={horizontal:0,vertical:1};n.rotation=Math.PI/2*c[o];var h={top:-1,bottom:1,right:1,left:-1};n.labelDirection=n.tickDirection=n.nameDirection=h[a],r.get(["axisTick","inside"])&&(n.tickDirection=-n.tickDirection),Hr(e.labelInside,r.get(["axisLabel","inside"]))&&(n.labelDirection=-n.labelDirection);var f=e.rotate;return f==null&&(f=r.get(["axisLabel","rotate"])),n.labelRotation=a==="top"?-f:f,n.z2=1,n}var ASe=["axisLine","axisTickLabel","axisName"],CSe=["splitArea","splitLine"],RSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="SingleAxisPointer",t}return e.prototype.render=function(t,i,n,a){var o=this.group;o.removeAll();var s=this._axisGroup;this._axisGroup=new Ze;var l=wS(t),u=new Nn(t,l);N(ASe,u.add,u),o.add(this._axisGroup),o.add(u.getGroup()),N(CSe,function(c){t.get([c,"show"])&&LSe[c](this,this.group,this._axisGroup,t)},this),fc(s,this._axisGroup,t),r.prototype.render.call(this,t,i,n,a)},e.prototype.remove=function(){JT(this)},e.type="singleAxis",e}(Po),LSe={splitLine:function(r,e,t,i){var n=i.axis;if(!n.scale.isBlank()){var a=i.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=s instanceof Array?s:[s];for(var l=o.get("width"),u=i.coordinateSystem.getRect(),c=n.isHorizontal(),h=[],f=0,p=n.getTicksCoords({tickModel:a}),d=[],g=[],m=0;m<p.length;++m){var v=n.toGlobalCoord(p[m].coord);c?(d[0]=v,d[1]=u.y,g[0]=v,g[1]=u.y+u.height):(d[0]=u.x,d[1]=v,g[0]=u.x+u.width,g[1]=v);var _=new ei({shape:{x1:d[0],y1:d[1],x2:g[0],y2:g[1]},silent:!0});hc(_.shape,l);var y=f++%s.length;h[y]=h[y]||[],h[y].push(_)}for(var x=o.getLineStyle(["color"]),m=0;m<h.length;++m)e.add(Jn(h[m],{style:Ye({stroke:s[m%s.length]},x),silent:!0}))}},splitArea:function(r,e,t,i){KT(r,t,i,i)}},sj=RSe;var lj=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getCoordSysModel=function(){return this},e.type="singleAxis",e.layoutMode="box",e.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},e}(Nt);Cr(lj,wu.prototype);var VE=lj;var DSe=function(r){Z(e,r);function e(t,i,n,a,o){var s=r.call(this,t,i,n)||this;return s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.pointToData=function(t,i){return this.coordinateSystem.pointToData(t)[0]},e}(vn),uj=DSe;var qO=["single"],PSe=function(){function r(e,t,i){this.type="single",this.dimension="single",this.dimensions=qO,this.axisPointerEnabled=!0,this.model=e,this._init(e,t,i)}return r.prototype._init=function(e,t,i){var n=this.dimension,a=new uj(n,Xh(e),[0,0],e.get("type"),e.get("position")),o=a.type==="category";a.onBand=o&&e.get("boundaryGap"),a.inverse=e.get("inverse"),a.orient=e.get("orient"),e.axis=a,a.model=e,a.coordinateSystem=this,this._axis=a},r.prototype.update=function(e,t){e.eachSeries(function(i){if(i.coordinateSystem===this){var n=i.getData();N(n.mapDimensionsAll(this.dimension),function(a){this._axis.scale.unionExtentFromData(n,a)},this),bu(this._axis.scale,this._axis.model)}},this)},r.prototype.resize=function(e,t){this._rect=br({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},r.prototype.getRect=function(){return this._rect},r.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,i=t.isHorizontal(),n=i?[0,e.width]:[0,e.height],a=t.inverse?1:0;t.setExtent(n[a],n[1-a]),this._updateAxisTransform(t,i?e.x:e.y)},r.prototype._updateAxisTransform=function(e,t){var i=e.getExtent(),n=i[0]+i[1],a=e.isHorizontal();e.toGlobalCoord=a?function(o){return o+t}:function(o){return n-o+t},e.toLocalCoord=a?function(o){return o-t}:function(o){return n-o+t}},r.prototype.getAxis=function(){return this._axis},r.prototype.getBaseAxis=function(){return this._axis},r.prototype.getAxes=function(){return[this._axis]},r.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},r.prototype.containPoint=function(e){var t=this.getRect(),i=this.getAxis(),n=i.orient;return n==="horizontal"?i.contain(i.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},r.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},r.prototype.dataToPoint=function(e){var t=this.getAxis(),i=this.getRect(),n=[],a=t.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),n[a]=t.toGlobalCoord(t.dataToCoord(+e)),n[1-a]=a===0?i.y+i.height/2:i.x+i.width/2,n},r.prototype.convertToPixel=function(e,t,i){var n=cj(t);return n===this?this.dataToPoint(i):null},r.prototype.convertFromPixel=function(e,t,i){var n=cj(t);return n===this?this.pointToData(i):null},r}();function cj(r){var e=r.seriesModel,t=r.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}var hj=PSe;function ISe(r,e){var t=[];return r.eachComponent("singleAxis",function(i,n){var a=new hj(i,r,e);a.name="single_"+n,a.resize(i,e),i.coordinateSystem=a,t.push(a)}),r.eachSeries(function(i){if(i.get("coordinateSystem")==="singleAxis"){var n=i.getReferringComponents("singleAxis",Ir).models[0];i.coordinateSystem=n&&n.coordinateSystem}}),t}var NSe={create:ISe,dimensions:qO},fj=NSe;var pj=["x","y"],USe=["width","height"],OSe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,i,n,a,o){var s=n.axis,l=s.coordinateSystem,u=ZO(l,1-GE(s)),c=l.dataToPoint(i)[0],h=a.get("type");if(h&&h!=="none"){var f=og(a),p=zSe[h](s,c,u);p.style=f,t.graphicKey=p.type,t.pointer=p}var d=wS(n);NE(i,t,d,n,a,o)},e.prototype.getHandleTransform=function(t,i,n){var a=wS(i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=SS(i.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,i,n,a){var o=n.axis,s=o.coordinateSystem,l=GE(o),u=ZO(s,l),c=[t.x,t.y];c[l]+=i[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var h=ZO(s,1-l),f=(h[1]+h[0])/2,p=[f,f];return p[l]=c[l],{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:p,tooltipOption:{verticalAlign:"middle"}}},e}(ag),zSe={line:function(r,e,t){var i=sg([e,t[0]],[e,t[1]],GE(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,e,t){var i=r.getBandWidth(),n=t[1]-t[0];return{type:"Rect",shape:UE([e-i/2,t[0]],[i,n],GE(r))}}};function GE(r){return r.isHorizontal()?0:1}function ZO(r,e){var t=r.getRect();return[t[pj[e]],t[pj[e]]+t[USe[e]]]}var dj=OSe;var FSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(ir);function jO(r){Ot(Gl),Po.registerAxisPointerClass("SingleAxisPointer",dj),r.registerComponentView(FSe),r.registerComponentView(sj),r.registerComponentModel(VE),Vl(r,"single",VE,VE.defaultOption),r.registerCoordinateSystem("single",fj)}var BSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i,n){var a=ks(t);r.prototype.init.apply(this,arguments),mj(t,a)},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),mj(this.option,t)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Nt);function mj(r,e){var t=r.cellSize,i;pe(t)?i=t:i=r.cellSize=[t,t],i.length===1&&(i[1]=i[0]);var n=de([0,1],function(a){return N5(e,a)&&(i[a]="auto"),i[a]!=null&&i[a]!=="auto"});Eo(r,e,{type:"box",ignoreSize:n})}var vj=BSe;var kSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){var a=this.group;a.removeAll();var o=t.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=i.getLocaleModel();this._renderDayRect(t,s,a),this._renderLines(t,s,l,a),this._renderYearText(t,s,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,s,l,a)},e.prototype._renderDayRect=function(t,i,n){for(var a=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=i.start.time;u<=i.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToRect([u],!1).tl,h=new Rt({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});n.add(h)}},e.prototype._renderLines=function(t,i,n,a){var o=this,s=t.coordinateSystem,l=t.getModel(["splitLine","lineStyle"]).getLineStyle(),u=t.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=i.start,f=0;h.time<=i.end.time;f++){d(h.formatedDate),f===0&&(h=s.getDateInfo(i.start.y+"-"+i.start.m));var p=h.date;p.setMonth(p.getMonth()+1),h=s.getDateInfo(p)}d(s.getNextNDay(i.end.time,1).formatedDate);function d(g){o._firstDayOfMonth.push(s.getDateInfo(g)),o._firstDayPoints.push(s.dataToRect([g],!1).tl);var m=o._getLinePointsOfOneWeek(t,g,n);o._tlpoints.push(m[0]),o._blpoints.push(m[m.length-1]),u&&o._drawSplitline(m,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,n),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,n),l,a)},e.prototype._getEdgesPoints=function(t,i,n){var a=[t[0].slice(),t[t.length-1].slice()],o=n==="horizontal"?0:1;return a[0][o]=a[0][o]-i/2,a[1][o]=a[1][o]+i/2,a},e.prototype._drawSplitline=function(t,i,n){var a=new ri({z2:20,shape:{points:t},style:i});n.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,i,n){for(var a=t.coordinateSystem,o=a.getDateInfo(i),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToRect([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[n==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(t,i){return Ce(t)&&t?D5(t,i):He(t)?t(i):i.nameMap},e.prototype._yearTextPositionControl=function(t,i,n,a,o){var s=i[0],l=i[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,i,n,a){var o=t.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=n!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,h=(u[0][1]+u[1][1])/2,f=n==="horizontal"?0:1,p={top:[c,u[f][1]],bottom:[c,u[1-f][1]],left:[u[1-f][0],h],right:[u[f][0],h]},d=i.start.y;+i.end.y>+i.start.y&&(d=d+"-"+i.end.y);var g=o.get("formatter"),m={start:i.start.y,end:i.end.y,nameMap:d},v=this._formatterLabel(g,m),_=new It({z2:30,style:pr(o,{text:v})});_.attr(this._yearTextPositionControl(_,p[l],n,l,s)),a.add(_)}},e.prototype._monthTextPositionControl=function(t,i,n,a,o){var s="left",l="top",u=t[0],c=t[1];return n==="horizontal"?(c=c+o,i&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,i&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(t,i,n,a){var o=t.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),h=[this._tlpoints,this._blpoints];(!s||Ce(s))&&(s&&(i=lx(s)||i),s=i.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,p=n==="horizontal"?0:1;l=u==="start"?-l:l;for(var d=c==="center",g=0;g<h[f].length-1;g++){var m=h[f][g].slice(),v=this._firstDayOfMonth[g];if(d){var _=this._firstDayPoints[g];m[p]=(_[p]+h[0][g+1][p])/2}var y=o.get("formatter"),x=s[+v.m-1],M={yyyy:v.y,yy:(v.y+"").slice(2),MM:v.m,M:+v.m,nameMap:x},S=this._formatterLabel(y,M),w=new It({z2:30,style:he(pr(o,{text:S}),this._monthTextPositionControl(m,d,n,u,l))});a.add(w)}}},e.prototype._weekTextPositionControl=function(t,i,n,a,o){var s="center",l="middle",u=t[0],c=t[1],h=n==="start";return i==="horizontal"?(u=u+a+(h?1:-1)*o[0]/2,s=h?"right":"left"):(c=c+a+(h?1:-1)*o[1]/2,l=h?"bottom":"top"),{x:u,y:c,align:s,verticalAlign:l}},e.prototype._renderWeekText=function(t,i,n,a,o){var s=t.getModel("dayLabel");if(s.get("show")){var l=t.coordinateSystem,u=s.get("position"),c=s.get("nameMap"),h=s.get("margin"),f=l.getFirstDayOfWeek();if(!c||Ce(c)){c&&(i=lx(c)||i);var p=i.get(["time","dayOfWeekShort"]);c=p||de(i.get(["time","dayOfWeekAbbr"]),function(M){return M[0]})}var d=l.getNextNDay(n.end.time,7-n.lweek).time,g=[l.getCellWidth(),l.getCellHeight()];h=ze(h,Math.min(g[1],g[0])),u==="start"&&(d=l.getNextNDay(n.start.time,-(7+n.fweek)).time,h=-h);for(var m=0;m<7;m++){var v=l.getNextNDay(d,m),_=l.dataToRect([v.time],!1).center,y=m;y=Math.abs((m+f)%7);var x=new It({z2:30,style:he(pr(s,{text:c[y]}),this._weekTextPositionControl(_,a,u,h,g))});o.add(x)}}},e.type="calendar",e}(ir),gj=kSe;var KO=864e5,VSe=function(){function r(e,t,i){this.type="calendar",this.dimensions=r.dimensions,this.getDimensionsInfo=r.getDimensionsInfo,this._model=e}return r.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},r.prototype.getRangeInfo=function(){return this._rangeInfo},r.prototype.getModel=function(){return this._model},r.prototype.getRect=function(){return this._rect},r.prototype.getCellWidth=function(){return this._sw},r.prototype.getCellHeight=function(){return this._sh},r.prototype.getOrient=function(){return this._orient},r.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},r.prototype.getDateInfo=function(e){e=Cn(e);var t=e.getFullYear(),i=e.getMonth()+1,n=i<10?"0"+i:""+i,a=e.getDate(),o=a<10?"0"+a:""+a,s=e.getDay();return s=Math.abs((s+7-this.getFirstDayOfWeek())%7),{y:t+"",m:n,d:o,day:s,time:e.getTime(),formatedDate:t+"-"+n+"-"+o,date:e}},r.prototype.getNextNDay=function(e,t){return t=t||0,t===0?this.getDateInfo(e):(e=new Date(this.getDateInfo(e).time),e.setDate(e.getDate()+t),this.getDateInfo(e))},r.prototype.update=function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var i=this._rangeInfo.weeks||1,n=["width","height"],a=this._model.getCellSize().slice(),o=this._model.getBoxLayoutParams(),s=this._orient==="horizontal"?[i,7]:[7,i];N([0,1],function(h){c(a,h)&&(o[n[h]]=a[h]*s[h])});var l={width:t.getWidth(),height:t.getHeight()},u=this._rect=br(o,l);N([0,1],function(h){c(a,h)||(a[h]=u[n[h]]/s[h])});function c(h,f){return h[f]!=null&&h[f]!=="auto"}this._sw=a[0],this._sh=a[1]},r.prototype.dataToPoint=function(e,t){pe(e)&&(e=e[0]),t==null&&(t=!0);var i=this.getDateInfo(e),n=this._rangeInfo,a=i.formatedDate;if(t&&!(i.time>=n.start.time&&i.time<n.end.time+KO))return[NaN,NaN];var o=i.day,s=this._getRangeInfo([n.start.time,a]).nthWeek;return this._orient==="vertical"?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+s*this._sh+this._sh/2]:[this._rect.x+s*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},r.prototype.pointToData=function(e){var t=this.pointToDate(e);return t&&t.time},r.prototype.dataToRect=function(e,t){var i=this.dataToPoint(e,t);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},r.prototype.pointToDate=function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,i=Math.floor((e[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return this._orient==="vertical"?this._getDateByWeeksAndDay(i,t-1,n):this._getDateByWeeksAndDay(t,i-1,n)},r.prototype.convertToPixel=function(e,t,i){var n=yj(t);return n===this?n.dataToPoint(i):null},r.prototype.convertFromPixel=function(e,t,i){var n=yj(t);return n===this?n.pointToData(i):null},r.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},r.prototype._initRangeOption=function(){var e=this._model.get("range"),t;if(pe(e)&&e.length===1&&(e=e[0]),pe(e))t=e;else{var i=e.toString();if(/^\d{4}$/.test(i)&&(t=[i+"-01-01",i+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(i)){var n=this.getDateInfo(i),a=n.date;a.setMonth(a.getMonth()+1);var o=this.getNextNDay(a,-1);t=[n.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(i)&&(t=[i,i])}if(!t)return e;var s=this._getRangeInfo(t);return s.start.time>s.end.time&&t.reverse(),t},r.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],i;t[0].time>t[1].time&&(i=!0,t.reverse());var n=Math.floor(t[1].time/KO)-Math.floor(t[0].time/KO)+1,a=new Date(t[0].time),o=a.getDate(),s=t[1].date.getDate();a.setDate(o+n-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-t[1].time)*u>0;)n-=u,a.setDate(l-u);var c=Math.floor((n+t[0].day+6)/7),h=i?-c+1:c-1;return i&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:n,weeks:c,nthWeek:h,fweek:t[0].day,lweek:t[1].day}},r.prototype._getDateByWeeksAndDay=function(e,t,i){var n=this._getRangeInfo(i);if(e>n.weeks||e===0&&t<n.fweek||e===n.weeks&&t>n.lweek)return null;var a=(e-1)*7-n.fweek+t,o=new Date(n.start.time);return o.setDate(+n.start.d+a),this.getDateInfo(o)},r.create=function(e,t){var i=[];return e.eachComponent("calendar",function(n){var a=new r(n,e,t);i.push(a),n.coordinateSystem=a}),e.eachSeries(function(n){n.get("coordinateSystem")==="calendar"&&(n.coordinateSystem=i[n.get("calendarIndex")||0])}),i},r.dimensions=["time","value"],r}();function yj(r){var e=r.calendarModel,t=r.seriesModel,i=e?e.coordinateSystem:t?t.coordinateSystem:null;return i}var _j=VSe;function JO(r){r.registerComponentModel(vj),r.registerComponentView(gj),r.registerCoordinateSystem("calendar",_j)}function GSe(r,e){var t=r.existing;if(e.id=r.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var i=e.parentOption;i?e.parentId=i.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function xj(r,e){var t;return N(e,function(i){r[i]!=null&&r[i]!=="auto"&&(t=!0)}),t}function HSe(r,e,t){var i=he({},t),n=r[e],a=t.$action||"merge";if(a==="merge")if(n){if(0)var o;bt(n,i,!0),Eo(n,i,{ignoreSize:!0}),$D(t,n),HE(t,n),HE(t,n,"shape"),HE(t,n,"style"),HE(t,n,"extra"),t.clipPath=n.clipPath}else r[e]=i;else a==="replace"?r[e]=i:a==="remove"&&n&&(r[e]=null)}var Sj=["transition","enterFrom","leaveTo"],WSe=Sj.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function HE(r,e,t){if(t&&(!r[t]&&e[t]&&(r[t]={}),r=r[t],e=e[t]),!(!r||!e))for(var i=t?Sj:WSe,n=0;n<i.length;n++){var a=i[n];r[a]==null&&e[a]!=null&&(r[a]=e[a])}}function XSe(r,e){if(r&&(r.hv=e.hv=[xj(e,["left","right"]),xj(e,["top","bottom"])],r.type==="group")){var t=r,i=e;t.width==null&&(t.width=i.width=0),t.height==null&&(t.height=i.height=0)}}var Mj=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.preventAutoZ=!0,t}return e.prototype.mergeOption=function(t,i){var n=this.option.elements;this.option.elements=null,r.prototype.mergeOption.call(this,t,i),this.option.elements=n},e.prototype.optionUpdated=function(t,i){var n=this.option,a=(i?n:t).elements,o=n.elements=i?[]:n.elements,s=[];this._flatten(a,s,null);var l=Dw(o,s,"normalMerge"),u=this._elOptionsToUpdate=[];N(l,function(c,h){var f=c.newOption;f&&(u.push(f),GSe(c,f),HSe(o,h,f),XSe(o[h],f))},this),n.elements=Yt(o,function(c){return c&&delete c.$action,c!=null})},e.prototype._flatten=function(t,i,n){N(t,function(a){if(a){n&&(a.parentOption=n),i.push(a);var o=a.children;o&&o.length&&this._flatten(o,i,a),delete a.children}},this)},e.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t},e.type="graphic",e.defaultOption={elements:[]},e}(Nt);var bj={path:null,compoundPath:null,group:Ze,image:Br,text:It},Js=xt(),Ej=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this._elMap=ke()},e.prototype.render=function(t,i,n){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,n)},e.prototype._updateElements=function(t){var i=t.useElOptionsToUpdate();if(i){var n=this._elMap,a=this.group,o=t.get("z"),s=t.get("zlevel");N(i,function(l){var u=Kr(l.id,null),c=u!=null?n.get(u):null,h=Kr(l.parentId,null),f=h!=null?n.get(h):a,p=l.type,d=l.style;p==="text"&&d&&l.hv&&l.hv[1]&&(d.textVerticalAlign=d.textBaseline=d.verticalAlign=d.align=null);var g=l.textContent,m=l.textConfig;if(d&&LE(d,p,!!m,!!g)){var v=DE(d,p,!0);!m&&v.textConfig&&(m=l.textConfig=v.textConfig),!g&&v.textContent&&(g=v.textContent)}var _=YSe(l),y=l.$action||"merge",x=y==="merge",M=y==="replace";if(x){var S=!c,w=c;S?w=wj(u,f,l.type,n):(w&&(Js(w).isNew=!1),PE(w)),w&&(rg(w,_,t,{isInit:S}),Tj(w,l,o,s))}else if(M){WE(c,l,n,t);var T=wj(u,f,l.type,n);T&&(rg(T,_,t,{isInit:!0}),Tj(T,l,o,s))}else y==="remove"&&(MO(c,l),WE(c,l,n,t));var C=n.get(u);if(C&&g)if(x){var b=C.getTextContent();b?b.attr(g):C.setTextContent(new It(g))}else M&&C.setTextContent(new It(g));if(C){var E=l.clipPath;if(E){var I=E.type,R=void 0,S=!1;if(x){var A=C.getClipPath();S=!A||Js(A).type!==I,R=S?$O(I):A}else M&&(S=!0,R=$O(I));C.setClipPath(R),rg(R,E,t,{isInit:S}),ng(R,E.keyframeAnimation,t)}var P=Js(C);C.setTextConfig(m),P.option=l,qSe(C,t,l),El({el:C,componentModel:t,itemName:C.name,itemTooltipOption:l.tooltip}),ng(C,l.keyframeAnimation,t)}})}},e.prototype._relocate=function(t,i){for(var n=t.option.elements,a=this.group,o=this._elMap,s=i.getWidth(),l=i.getHeight(),u=["x","y"],c=0;c<n.length;c++){var h=n[c],f=Kr(h.id,null),p=f!=null?o.get(f):null;if(!(!p||!p.isGroup)){var d=p.parent,g=d===a,m=Js(p),v=Js(d);m.width=ze(m.option.width,g?s:v.width)||0,m.height=ze(m.option.height,g?l:v.height)||0}}for(var c=n.length-1;c>=0;c--){var h=n[c],f=Kr(h.id,null),p=f!=null?o.get(f):null;if(p){var d=p.parent,v=Js(d),_=d===a?{width:s,height:l}:{width:v.width,height:v.height},y={},x=Ih(p,h,_,null,{hv:h.hv,boundingMode:h.bounding},y);if(!Js(p).isNew&&x){for(var M=h.transition,S={},w=0;w<u.length;w++){var T=u[w],C=y[T];M&&(rf(M)||yt(M,T)>=0)?S[T]=C:p[T]=C}Ut(p,S,t,0)}else p.attr(y)}}},e.prototype._clear=function(){var t=this,i=this._elMap;i.each(function(n){WE(n,Js(n).option,i,t._lastGraphicModel)}),this._elMap=ke()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(ir);function $O(r){var e=tt(bj,r)?bj[r]:ax(r),t=new e({});return Js(t).type=r,t}function wj(r,e,t,i){var n=$O(t);return e.add(n),i.set(r,n),Js(n).id=r,Js(n).isNew=!0,n}function WE(r,e,t,i){var n=r&&r.parent;n&&(r.type==="group"&&r.traverse(function(a){WE(a,e,t,i)}),ig(r,e,i),t.removeKey(Js(r).id))}function Tj(r,e,t,i){r.isGroup||N([["cursor",Si.prototype.cursor],["zlevel",i||0],["z",t||0],["z2",0]],function(n){var a=n[0];tt(e,a)?r[a]=mt(e[a],n[1]):r[a]==null&&(r[a]=n[1])}),N(At(e),function(n){if(n.indexOf("on")===0){var a=e[n];r[n]=He(a)?a:null}}),tt(e,"draggable")&&(r.draggable=e.draggable),e.name!=null&&(r.name=e.name),e.id!=null&&(r.id=e.id)}function YSe(r){return r=he({},r),N(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(KD),function(e){delete r[e]}),r}function qSe(r,e,t){var i=it(r).eventData;!r.silent&&!r.ignore&&!i&&(i=it(r).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:r.name}),i&&(i.info=t.info)}function QO(r){r.registerComponentModel(Mj),r.registerComponentView(Ej),r.registerPreprocessor(function(e){var t=e.graphic;pe(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var e3=["x","y","radius","angle","single"],ZSe=["cartesian2d","polar","singleAxis"];function Aj(r){var e=r.get("coordinateSystem");return yt(ZSe,e)>=0}function $s(r){return r+"Axis"}function Cj(r,e){var t=ke(),i=[],n=ke();r.eachComponent({mainType:"dataZoom",query:e},function(c){n.get(c.uid)||s(c)});var a;do a=!1,r.eachComponent("dataZoom",o);while(a);function o(c){!n.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){n.set(c.uid,!0),i.push(c),u(c)}function l(c){var h=!1;return c.eachTargetAxis(function(f,p){var d=t.get(f);d&&d[p]&&(h=!0)}),h}function u(c){c.eachTargetAxis(function(h,f){(t.get(h)||t.set(h,[]))[f]=!0})}return i}function XE(r){var e=r.ecModel,t={infoList:[],infoMap:ke()};return r.eachTargetAxis(function(i,n){var a=e.getComponent($s(i),n);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=t.infoMap.get(s);l||(l={model:o,axisModels:[]},t.infoList.push(l),t.infoMap.set(s,l)),l.axisModels.push(a)}}}),t}var t3=function(){function r(){this.indexList=[],this.indexMap=[]}return r.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},r}(),jSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,i,n){var a=Rj(t);this.settledOption=a,this.mergeDefaultAndTheme(t,n),this._doInit(a)},e.prototype.mergeOption=function(t){var i=Rj(t);bt(this.option,t,!0),bt(this.settledOption,i,!0),this._doInit(i)},e.prototype._doInit=function(t){var i=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;N([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(i[a[0]]=n[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),i=this._targetAxisInfoMap=ke(),n=this._fillSpecifiedTargetAxis(i);n?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var i=!1;return N(e3,function(n){var a=this.getReferringComponents($s(n),bH);if(a.specified){i=!0;var o=new t3;N(a.models,function(s){o.add(s.componentIndex)}),t.set(n,o)}},this),i},e.prototype._fillAutoTargetAxisByOrient=function(t,i){var n=this.ecModel,a=!0;if(a){var o=i==="vertical"?"y":"x",s=n.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=n.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===i}});l(s,"single")}function l(u,c){var h=u[0];if(h){var f=new t3;if(f.add(h.componentIndex),t.set(c,f),a=!1,c==="x"||c==="y"){var p=h.getReferringComponents("grid",Ir).models[0];p&&N(u,function(d){h.componentIndex!==d.componentIndex&&p===d.getReferringComponents("grid",Ir).models[0]&&f.add(d.componentIndex)})}}}a&&N(e3,function(u){if(a){var c=n.findComponents({mainType:$s(u),filter:function(f){return f.get("type",!0)==="category"}});if(c[0]){var h=new t3;h.add(c[0].componentIndex),t.set(u,h),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(i){!t&&(t=i)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var i=this._rangePropMode,n=this.get("rangeMode");N([["start","startValue"],["end","endValue"]],function(a,o){var s=t[a[0]]!=null,l=t[a[1]]!=null;s&&!l?i[o]="percent":!s&&l?i[o]="value":n?i[o]=n[o]:s&&(i[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(i,n){t==null&&(t=this.ecModel.getComponent($s(i),n))},this),t},e.prototype.eachTargetAxis=function(t,i){this._targetAxisInfoMap.each(function(n,a){N(n.indexList,function(o){t.call(i,a,o)})})},e.prototype.getAxisProxy=function(t,i){var n=this.getAxisModel(t,i);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,i){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[i])return this.ecModel.getComponent($s(t),i)},e.prototype.setRawRange=function(t){var i=this.option,n=this.settledOption;N([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(i[a[0]]=n[a[0]]=t[a[0]],i[a[1]]=n[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var i=this.option;N(["start","startValue","end","endValue"],function(n){i[n]=t[n]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,i){if(t==null&&i==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(t,i).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var i,n=this._targetAxisInfoMap.keys(),a=0;a<n.length;a++)for(var o=n[a],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var u=this.getAxisProxy(o,s.indexList[l]);if(u.hostedBy(this))return u;i||(i=u)}return i},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e}(Nt);function Rj(r){var e={};return N(["start","end","startValue","endValue","throttle"],function(t){r.hasOwnProperty(t)&&(e[t]=r[t])}),e}var of=jSe;var KSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.select",e}(of),Lj=KSe;var JSe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n,a){this.dataZoomModel=t,this.ecModel=i,this.api=n},e.type="dataZoom",e}(ir),lg=JSe;var $Se=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.select",e}(lg),Dj=$Se;var ug=N,Pj=Ri,QSe=function(){function r(e,t,i,n){this._dimName=e,this._axisIndex=t,this.ecModel=n,this._dataZoomModel=i}return r.prototype.hostedBy=function(e){return this._dataZoomModel===e},r.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},r.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},r.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(Aj(t)){var i=$s(this._dimName),n=t.getReferringComponents(i,Ir).models[0];n&&this._axisIndex===n.componentIndex&&e.push(t)}},this),e},r.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},r.prototype.getMinMaxSpan=function(){return Qe(this._minMaxSpan)},r.prototype.calculateDataWindow=function(e){var t=this._dataExtent,i=this.getAxisModel(),n=i.axis.scale,a=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],u;ug(["start","end"],function(f,p){var d=e[f],g=e[f+"Value"];a[p]==="percent"?(d==null&&(d=o[p]),g=n.parse(ar(d,o,t))):(u=!0,g=g==null?t[p]:n.parse(g),d=ar(g,t,o)),l[p]=g==null||isNaN(g)?t[p]:g,s[p]=d==null||isNaN(d)?o[p]:d}),Pj(l),Pj(s);var c=this._minMaxSpan;u?h(l,s,t,o,!1):h(s,l,o,t,!0);function h(f,p,d,g,m){var v=m?"Span":"ValueSpan";Io(0,f,d,"all",c["min"+v],c["max"+v]);for(var _=0;_<2;_++)p[_]=ar(f[_],d,g,!0),m&&(p[_]=n.parse(p[_]))}return{valueWindow:l,percentWindow:s}},r.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=eMe(this,this._dimName,t),this._updateMinMaxSpan();var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,this._setAxisModel()}},r.prototype.filterData=function(e,t){if(e!==this._dataZoomModel)return;var i=this._dimName,n=this.getTargetSeriesModels(),a=e.get("filterMode"),o=this._valueWindow;if(a==="none")return;ug(n,function(l){var u=l.getData(),c=u.mapDimensionsAll(i);if(c.length){if(a==="weakFilter"){var h=u.getStore(),f=de(c,function(p){return u.getDimensionIndex(p)},u);u.filterSelf(function(p){for(var d,g,m,v=0;v<c.length;v++){var _=h.get(f[v],p),y=!isNaN(_),x=_<o[0],M=_>o[1];if(y&&!x&&!M)return!0;y&&(m=!0),x&&(d=!0),M&&(g=!0)}return m&&d&&g})}else ug(c,function(p){if(a==="empty")l.setData(u=u.map(p,function(g){return s(g)?g:NaN}));else{var d={};d[p]=o,u.selectRange(d)}});ug(c,function(p){u.setApproximateExtent(o,p)})}});function s(l){return l>=o[0]&&l<=o[1]}},r.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,i=this._dataExtent;ug(["min","max"],function(n){var a=t.get(n+"Span"),o=t.get(n+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=ar(i[0]+o,i,[0,100],!0):a!=null&&(o=ar(a,[0,100],i,!0)-i[0]),e[n+"Span"]=a,e[n+"ValueSpan"]=o},this)},r.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,i=this._valueWindow;if(t){var n=qm(i,[0,500]);n=Math.min(n,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+i[0].toFixed(n)),t[1]!==100&&a.setDeterminedMinMax("max",+i[1].toFixed(n)),a.freeze()}},r}();function eMe(r,e,t){var i=[1/0,-1/0];ug(t,function(o){M8(i,o.getData(),e)});var n=r.getAxisModel(),a=gT(n.axis.scale,n,i).calculate();return[a.min,a.max]}var Ij=QSe;var tMe={getTargetSeries:function(r){function e(n){r.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=r.getComponent($s(o),s);n(o,s,l,a)})})}e(function(n,a,o,s){o.__dzAxisProxy=null});var t=[];e(function(n,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new Ij(n,a,s,r),t.push(o.__dzAxisProxy))});var i=ke();return N(t,function(n){N(n.getTargetSeriesModels(),function(a){i.set(a.uid,a)})}),i},overallReset:function(r,e){r.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(i,n){t.getAxisProxy(i,n).reset(t)}),t.eachTargetAxis(function(i,n){t.getAxisProxy(i,n).filterData(t,e)})}),r.eachComponent("dataZoom",function(t){var i=t.findRepresentativeAxisProxy();if(i){var n=i.getDataPercentWindow(),a=i.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:a[0],endValue:a[1]})}})}},Nj=tMe;function r3(r){r.registerAction("dataZoom",function(e,t){var i=Cj(t,e);N(i,function(n){n.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var Uj=!1;function Md(r){Uj||(Uj=!0,r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,Nj),r3(r),r.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function Oj(r){r.registerComponentModel(Lj),r.registerComponentView(Dj),Md(r)}var en=function(){function r(){}return r}();var zj={};function sf(r,e){zj[r]=e}function YE(r){return zj[r]}var iMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){r.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;N(this.option.feature,function(i,n){var a=YE(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),bt(i,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Nt),Fj=iMe;function Bj(r,e,t){var i=e.getBoxLayoutParams(),n=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},o=br(i,a,n);Rl(e.get("orient"),r,e.get("itemGap"),o.width,o.height),Ih(r,i,a,n)}function qE(r,e){var t=Al(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),r=new Rt({shape:{x:r.x-t[3],y:r.y-t[0],width:r.width+t[1]+t[3],height:r.height+t[0]+t[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1}),r}var aMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n,a){var o=this.group;if(o.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},c=this._features||(this._features={}),h=[];N(u,function(d,g){h.push(g)}),new In(this._featureNames||[],h).add(f).update(f).remove(ut(f,null)).execute(),this._featureNames=h;function f(d,g){var m=h[d],v=h[g],_=u[m],y=new Jt(_,t,t.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===m&&(_.title=a.newTitle),m&&!v){if(oMe(m))x={onclick:y.option.onclick,featureName:m};else{var M=YE(m);if(!M)return;x=new M}c[m]=x}else if(x=c[v],!x)return;x.uid=Bs("toolbox-feature"),x.model=y,x.ecModel=i,x.api=n;var S=x instanceof en;if(!m&&v){S&&x.dispose&&x.dispose(i,n);return}if(!y.get("show")||S&&x.unusable){S&&x.remove&&x.remove(i,n);return}p(y,x,m),y.setIconStatus=function(w,T){var C=this.option,b=this.iconPaths;C.iconStatus=C.iconStatus||{},C.iconStatus[w]=T,b[w]&&(T==="emphasis"?Zn:jn)(b[w])},x instanceof en&&x.render&&x.render(y,i,n,a)}function p(d,g,m){var v=d.getModel("iconStyle"),_=d.getModel(["emphasis","iconStyle"]),y=g instanceof en&&g.getIcons?g.getIcons():d.get("icon"),x=d.get("title")||{},M,S;Ce(y)?(M={},M[m]=y):M=y,Ce(x)?(S={},S[m]=x):S=x;var w=d.iconPaths={};N(M,function(T,C){var b=pc(T,{},{x:-s/2,y:-s/2,width:s,height:s});b.setStyle(v.getItemStyle());var E=b.ensureState("emphasis");E.style=_.getItemStyle();var I=new It({style:{text:S[C],align:_.get("textAlign"),borderRadius:_.get("textBorderRadius"),padding:_.get("textPadding"),fill:null,font:pv({fontStyle:_.get("textFontStyle"),fontFamily:_.get("textFontFamily"),fontSize:_.get("textFontSize"),fontWeight:_.get("textFontWeight")},i)},ignore:!0});b.setTextContent(I),El({el:b,componentModel:t,itemName:C,formatterParamsExtra:{title:S[C]}}),b.__title=S[C],b.on("mouseover",function(){var R=_.getItemStyle(),A=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";I.setStyle({fill:_.get("textFill")||R.fill||R.stroke||"#000",backgroundColor:_.get("textBackgroundColor")}),b.setTextConfig({position:_.get("textPosition")||A}),I.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){d.get(["iconStatus",C])!=="emphasis"&&n.leaveEmphasis(this),I.hide()}),(d.get(["iconStatus",C])==="emphasis"?Zn:jn)(b),o.add(b),b.on("click",Be(g.onclick,g,i,n,C)),w[C]=b})}Bj(o,t,n),o.add(qE(o.getBoundingRect(),t)),l||o.eachChild(function(d){var g=d.__title,m=d.ensureState("emphasis"),v=m.textConfig||(m.textConfig={}),_=d.getTextContent(),y=_&&_.ensureState("emphasis");if(y&&!He(y)&&g){var x=y.style||(y.style={}),M=fu(g,It.makeFont(x)),S=d.x+o.x,w=d.y+o.y+s,T=!1;w+M.height>n.getHeight()&&(v.position="top",T=!0);var C=T?-5-M.height:s+10;S+M.width/2>n.getWidth()?(v.position=["100%",C],x.align="right"):S-M.width/2<0&&(v.position=[0,C],x.align="left")}})},e.prototype.updateView=function(t,i,n,a){N(this._features,function(o){o instanceof en&&o.updateView&&o.updateView(o.model,i,n,a)})},e.prototype.remove=function(t,i){N(this._features,function(n){n instanceof en&&n.remove&&n.remove(t,i)}),this.group.removeAll()},e.prototype.dispose=function(t,i){N(this._features,function(n){n instanceof en&&n.dispose&&n.dispose(t,i)})},e.type="toolbox",e}(ir);function oMe(r){return r.indexOf("my")===0}var kj=aMe;var sMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){var n=this.model,a=n.get("name")||t.get("title.0.text")||"echarts",o=i.getZr().painter.getType()==="svg",s=o?"svg":n.get("type",!0)||"png",l=i.getConnectedDataURL({type:s,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),u=Bt.browser;if(He(MouseEvent)&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var h=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(h)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),p=f[0].indexOf("base64")>-1,d=o?decodeURIComponent(f[1]):f[1];p&&(d=window.atob(d));var g=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var m=d.length,v=new Uint8Array(m);m--;)v[m]=d.charCodeAt(m);var _=new Blob([v]);window.navigator.msSaveOrOpenBlob(_,g)}else{var y=document.createElement("iframe");document.body.appendChild(y);var x=y.contentWindow,M=x.document;M.open("image/svg+xml","replace"),M.write(d),M.close(),x.focus(),M.execCommand("SaveAs",!0,g),document.body.removeChild(y)}}else{var S=n.get("lang"),w='<body style="margin:0;"><img src="'+l+'" style="max-width:100%;" title="'+(S&&S[0]||"")+'" /></body>',T=window.open();T.document.write(w),T.document.title=a}},e.getDefaultOption=function(t){var i={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return i},e}(en),Vj=sMe;var Gj="__ec_magicType_stack__";var lMe=[["line","bar"],["stack"]],uMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,i=t.get("icon"),n={};return N(t.get("type"),function(a){i[a]&&(n[a]=i[a])}),n},e.getDefaultOption=function(t){var i={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return i},e.prototype.onclick=function(t,i,n){var a=this.model,o=a.get(["seriesIndex",n]);if(Hj[n]){var s={series:[]},l=function(h){var f=h.subType,p=h.id,d=Hj[n](f,p,h,a);d&&(Ye(d,h.option),s.series.push(d));var g=h.coordinateSystem;if(g&&g.type==="cartesian2d"&&(n==="line"||n==="bar")){var m=g.getAxesByScale("ordinal")[0];if(m){var v=m.dim,_=v+"Axis",y=h.getReferringComponents(_,Ir).models[0],x=y.componentIndex;s[_]=s[_]||[];for(var M=0;M<=x;M++)s[_][x]=s[_][x]||{};s[_][x].boundaryGap=n==="bar"}}};N(lMe,function(h){yt(h,n)>=0&&N(h,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=n;n==="stack"&&(u=bt({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",n])!=="emphasis"&&(c="tiled")),i.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},e}(en),Hj={line:function(r,e,t,i){if(r==="bar")return bt({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(r,e,t,i){if(r==="line")return bt({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(r,e,t,i){var n=t.get("stack")===Gj;if(r==="line"||r==="bar")return i.setIconStatus("stack",n?"normal":"emphasis"),bt({id:e,stack:n?"":Gj},i.get(["option","stack"])||{},!0)}};xa({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(r,e){e.mergeOption(r.newOption)});var Wj=uMe;var jE=new Array(60).join("-"),cg=" ";function cMe(r){var e={},t=[],i=[];return r.eachRawSeries(function(n){var a=n.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(n)}else t.push(n)}else t.push(n)}),{seriesGroupByCategoryAxis:e,other:t,meta:i}}function hMe(r){var e=[];return N(r,function(t,i){var n=t.categoryAxis,a=t.valueAxis,o=a.dim,s=[" "].concat(de(t.series,function(p){return p.name})),l=[n.model.getCategories()];N(t.series,function(p){var d=p.getRawData();l.push(p.getRawData().mapArray(d.mapDimension(o),function(g){return g}))});for(var u=[s.join(cg)],c=0;c<l[0].length;c++){for(var h=[],f=0;f<l.length;f++)h.push(l[f][c]);u.push(h.join(cg))}e.push(u.join(`
  2217. `))}),e.join(`
  2218. `+jE+`
  2219. `)}function fMe(r){return de(r,function(e){var t=e.getRawData(),i=[e.name],n=[];return t.each(t.dimensions,function(){for(var a=arguments.length,o=arguments[a-1],s=t.getName(o),l=0;l<a-1;l++)n[l]=arguments[l];i.push((s?s+cg:"")+n.join(cg))}),i.join(`
  2220. `)}).join(`
  2221. `+jE+`
  2222. `)}function pMe(r){var e=cMe(r);return{value:Yt([hMe(e.seriesGroupByCategoryAxis),fMe(e.other)],function(t){return!!t.replace(/[\n\t\s]/g,"")}).join(`
  2223. `+jE+`
  2224. `),meta:e.meta}}function ZE(r){return r.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function dMe(r){var e=r.slice(0,r.indexOf(`
  2225. `));if(e.indexOf(cg)>=0)return!0}var i3=new RegExp("["+cg+"]+","g");function mMe(r){for(var e=r.split(/\n+/g),t=ZE(e.shift()).split(i3),i=[],n=de(t,function(l){return{name:l,data:[]}}),a=0;a<e.length;a++){var o=ZE(e[a]).split(i3);i.push(o.shift());for(var s=0;s<o.length;s++)n[s]&&(n[s].data[a]=o[s])}return{series:n,categories:i}}function vMe(r){for(var e=r.split(/\n+/g),t=ZE(e.shift()),i=[],n=0;n<e.length;n++){var a=ZE(e[n]);if(a){var o=a.split(i3),s="",l=void 0,u=!1;isNaN(o[0])?(u=!0,s=o[0],o=o.slice(1),i[n]={name:s,value:[]},l=i[n].value):l=i[n]=[];for(var c=0;c<o.length;c++)l.push(+o[c]);l.length===1&&(u?i[n].value=l[0]:i[n]=l[0])}}return{name:t,data:i}}function gMe(r,e){var t=r.split(new RegExp(`
  2226. *`+jE+`
  2227. *`,"g")),i={series:[]};return N(t,function(n,a){if(dMe(n)){var o=mMe(n),s=e[a],l=s.axisDim+"Axis";s&&(i[l]=i[l]||[],i[l][s.axisIndex]={data:o.categories},i.series=i.series.concat(o.series))}else{var o=vMe(n);i.series.push(o)}}),i}var yMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){setTimeout(function(){i.dispatchAction({type:"hideTip"})});var n=i.getDom(),a=this.model;this._dom&&n.removeChild(this._dom);var o=document.createElement("div");o.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",o.style.backgroundColor=a.get("backgroundColor")||"#fff";var s=document.createElement("h4"),l=a.get("lang")||[];s.innerHTML=l[0]||a.get("title"),s.style.cssText="margin:10px 20px",s.style.color=a.get("textColor");var u=document.createElement("div"),c=document.createElement("textarea");u.style.cssText="overflow:auto";var h=a.get("optionToContent"),f=a.get("contentToOption"),p=pMe(t);if(He(h)){var d=h(i.getOption());Ce(d)?u.innerHTML=d:fh(d)&&u.appendChild(d)}else{c.readOnly=a.get("readOnly");var g=c.style;g.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",g.color=a.get("textColor"),g.borderColor=a.get("textareaBorderColor"),g.backgroundColor=a.get("textareaColor"),c.value=p.value,u.appendChild(c)}var m=p.meta,v=document.createElement("div");v.style.cssText="position:absolute;bottom:5px;left:0;right:0";var _="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",y=document.createElement("div"),x=document.createElement("div");_+=";background-color:"+a.get("buttonColor"),_+=";color:"+a.get("buttonTextColor");var M=this;function S(){n.removeChild(o),M._dom=null}x_(y,"click",S),x_(x,"click",function(){if(f==null&&h!=null||f!=null&&h==null){S();return}var w;try{He(f)?w=f(u,i.getOption()):w=gMe(c.value,m)}catch(T){throw S(),new Error("Data view format error "+T)}w&&i.dispatchAction({type:"changeDataView",newOption:w}),S()}),y.innerHTML=l[1],x.innerHTML=l[2],x.style.cssText=y.style.cssText=_,!a.get("readOnly")&&v.appendChild(x),v.appendChild(y),o.appendChild(s),o.appendChild(u),o.appendChild(v),u.style.height=n.clientHeight-80+"px",n.appendChild(o),this._dom=o},e.prototype.remove=function(t,i){this._dom&&i.getDom().removeChild(this._dom)},e.prototype.dispose=function(t,i){this.remove(t,i)},e.getDefaultOption=function(t){var i={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"};return i},e}(en);function _Me(r,e){return de(r,function(t,i){var n=e&&e[i];if(qe(n)&&!pe(n)){var a=qe(t)&&!pe(t);a||(t={value:t});var o=n.name!=null&&t.name==null;return t=Ye(t,n),o&&delete t.name,t}else return t})}xa({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(r,e){var t=[];N(r.newOption.series,function(i){var n=e.getSeriesByName(i.name)[0];if(!n)t.push(he({type:"scatter"},i));else{var a=n.get("data");t.push({name:i.name,data:_Me(i.data,a)})}}),e.mergeOption(Ye({series:t},r.newOption))});var Xj=yMe;var Yj=N,qj=xt();function Zj(r,e){var t=n3(r);Yj(e,function(i,n){for(var a=t.length-1;a>=0;a--){var o=t[a];if(o[n])break}if(a<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(s){var l=s.getPercentRange();t[0][n]={dataZoomId:n,start:l[0],end:l[1]}}}}),t.push(e)}function jj(r){var e=n3(r),t=e[e.length-1];e.length>1&&e.pop();var i={};return Yj(t,function(n,a){for(var o=e.length-1;o>=0;o--)if(n=e[o][a],n){i[a]=n;break}}),i}function Kj(r){qj(r).snapshots=null}function Jj(r){return n3(r).length}function n3(r){var e=qj(r);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var xMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,i){Kj(t),i.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var i={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return i},e}(en);xa({type:"restore",event:"restore",update:"prepareAndUpdate"},function(r,e){e.resetOption("recreate")});var Qj=xMe;var SMe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],MMe=function(){function r(e,t,i){var n=this;this._targetInfoList=[];var a=eK(t,e);N(bMe,function(o,s){(!i||!i.include||yt(i.include,s)>=0)&&o(a,n._targetInfoList)})}return r.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(i,n,a){if((i.coordRanges||(i.coordRanges=[])).push(n),!i.coordRange){i.coordRange=n;var o=a3[i.brushType](0,a,n);i.__rangeOffset={offset:nK[i.brushType](o.values,i.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},r.prototype.matchOutputRanges=function(e,t,i){N(e,function(n){var a=this.findTargetInfo(n,t);a&&a!==!0&&N(a.coordSyses,function(o){var s=a3[n.brushType](1,o,n.range,!0);i(n,s.values,o,t)})},this)},r.prototype.setInputRanges=function(e,t){N(e,function(i){var n=this.findTargetInfo(i,t);if(i.range=i.range||[],n&&n!==!0){i.panelId=n.panelId;var a=a3[i.brushType](0,n.coordSys,i.coordRange),o=i.__rangeOffset;i.range=o?nK[i.brushType](a.values,o.offset,wMe(a.xyMinMax,o.xyMinMax)):a.values}},this)},r.prototype.makePanelOpts=function(e,t){return de(this._targetInfoList,function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t?t(i):null,clipPath:xE(n),isTargetByCursor:ME(n,e,i.coordSysModel),getLinearBrushOtherExtent:SE(n)}})},r.prototype.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return n===!0||n&&yt(n.coordSyses,t.coordinateSystem)>=0},r.prototype.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=eK(t,e),a=0;a<i.length;a++){var o=i[a],s=e.panelId;if(s){if(o.panelId===s)return o}else for(var l=0;l<tK.length;l++)if(tK[l](n,o))return o}return!0},r}();function o3(r){return r[0]>r[1]&&r.reverse(),r}function eK(r,e){return bh(r,e,{includeMainTypes:SMe})}var bMe={grid:function(r,e){var t=r.xAxisModels,i=r.yAxisModels,n=r.gridModels,a=ke(),o={},s={};!t&&!i&&!n||(N(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),N(i,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),N(n,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];N(u.getCartesians(),function(h,f){(yt(t,h.getAxis("x").model)>=0||yt(i,h.getAxis("y").model)>=0)&&c.push(h)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:rK.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(r,e){N(r.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:rK.geo})})}},tK=[function(r,e){var t=r.xAxisModel,i=r.yAxisModel,n=r.gridModel;return!n&&t&&(n=t.axis.grid.model),!n&&i&&(n=i.axis.grid.model),n&&n===e.gridModel},function(r,e){var t=r.geoModel;return t&&t===e.geoModel}],rK={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var r=this.coordSys,e=r.getBoundingRect().clone();return e.applyTransform(Tl(r)),e}},a3={lineX:ut(iK,0),lineY:ut(iK,1),rect:function(r,e,t,i){var n=r?e.pointToData([t[0][0],t[1][0]],i):e.dataToPoint([t[0][0],t[1][0]],i),a=r?e.pointToData([t[0][1],t[1][1]],i):e.dataToPoint([t[0][1],t[1][1]],i),o=[o3([n[0],a[0]]),o3([n[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(r,e,t,i){var n=[[1/0,-1/0],[1/0,-1/0]],a=de(t,function(o){var s=r?e.pointToData(o,i):e.dataToPoint(o,i);return n[0][0]=Math.min(n[0][0],s[0]),n[1][0]=Math.min(n[1][0],s[1]),n[0][1]=Math.max(n[0][1],s[0]),n[1][1]=Math.max(n[1][1],s[1]),s});return{values:a,xyMinMax:n}}};function iK(r,e,t,i){var n=t.getAxis(["x","y"][r]),a=o3(de([0,1],function(s){return e?n.coordToData(n.toLocalCoord(i[s]),!0):n.toGlobalCoord(n.dataToCoord(i[s]))})),o=[];return o[r]=a,o[1-r]=[NaN,NaN],{values:a,xyMinMax:o}}var nK={lineX:ut(aK,0),lineY:ut(aK,1),rect:function(r,e,t){return[[r[0][0]-t[0]*e[0][0],r[0][1]-t[0]*e[0][1]],[r[1][0]-t[1]*e[1][0],r[1][1]-t[1]*e[1][1]]]},polygon:function(r,e,t){return de(r,function(i,n){return[i[0]-t[0]*e[n][0],i[1]-t[1]*e[n][1]]})}};function aK(r,e,t,i){return[e[0]-i[r]*t[0],e[1]-i[r]*t[1]]}function wMe(r,e){var t=oK(r),i=oK(e),n=[t[0]/i[0],t[1]/i[1]];return isNaN(n[0])&&(n[0]=1),isNaN(n[1])&&(n[1]=1),n}function oK(r){return r?[r[0][1]-r[0][0],r[1][1]-r[1][0]]:[NaN,NaN]}var TS=MMe;var s3=N,TMe=xH("toolbox-dataZoom_");var EMe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n,a){this._brushController||(this._brushController=new Qv(n.getZr()),this._brushController.on("brush",Be(this._onBrush,this)).mount()),RMe(t,i,this,a,n),CMe(t,i)},e.prototype.onclick=function(t,i,n){AMe[n].call(this)},e.prototype.remove=function(t,i){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,i){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var i=t.areas;if(!t.isEnd||!i.length)return;var n={},a=this.ecModel;this._brushController.updateCovers([]);var o=new TS(l3(this.model),a,{include:["grid"]});o.matchOutputRanges(i,a,function(u,c,h){if(h.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",h,c[0]),s("y",h,c[1])):s({lineX:"x",lineY:"y"}[f],h,c)}}),Zj(a,n),this._dispatchZoomAction(n);function s(u,c,h){var f=c.getAxis(u),p=f.model,d=l(u,p,a),g=d.findRepresentativeAxisProxy(p).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(h=Io(0,h.slice(),f.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),d&&(n[d.id]={dataZoomId:d.id,startValue:h[0],endValue:h[1]})}function l(u,c,h){var f;return h.eachComponent({mainType:"dataZoom",subType:"select"},function(p){var d=p.getAxisModel(u,c.componentIndex);d&&(f=p)}),f}},e.prototype._dispatchZoomAction=function(t){var i=[];s3(t,function(n,a){i.push(Qe(n))}),i.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:i})},e.getDefaultOption=function(t){var i={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return i},e}(en),AMe={zoom:function(){var r=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:r})},back:function(){this._dispatchZoomAction(jj(this.ecModel))}};function l3(r){var e={xAxisIndex:r.get("xAxisIndex",!0),yAxisIndex:r.get("yAxisIndex",!0),xAxisId:r.get("xAxisId",!0),yAxisId:r.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function CMe(r,e){r.setIconStatus("back",Jj(e)>1?"emphasis":"normal")}function RMe(r,e,t,i,n){var a=t._isZoomActive;i&&i.type==="takeGlobalCursor"&&(a=i.key==="dataZoomSelect"?i.dataZoomSelectActive:!1),t._isZoomActive=a,r.setIconStatus("zoom",a?"emphasis":"normal");var o=new TS(l3(r),e,{include:["grid"]}),s=o.makePanelOpts(n,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}:!1)}V5("dataZoom",function(r){var e=r.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var i=e.getModel(t),n=[],a=l3(i),o=bh(r,a);s3(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),s3(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var h=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:TMe+u+h};f[c]=h,n.push(f)}return n});var sK=EMe;function u3(r){r.registerComponentModel(Fj),r.registerComponentView(kj),sf("saveAsImage",Vj),sf("magicType",Wj),sf("dataView",Xj),sf("dataZoom",sK),sf("restore",Qj),Ot(Oj)}var LMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Nt),lK=LMe;function KE(r){var e=r.get("confine");return e!=null?!!e:r.get("renderMode")==="richText"}function uK(r){if(Bt.domSupported){for(var e=document.documentElement.style,t=0,i=r.length;t<i;t++)if(r[t]in e)return r[t]}}var c3=uK(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),cK=uK(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function h3(r,e){if(!r)return e;e=d1(e,!0);var t=r.indexOf(e);return r=t===-1?e:"-"+r.slice(0,t)+"-"+e,r.toLowerCase()}function hK(r,e){var t=r.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(r);return t?e?t[e]:t:null}var DMe=h3(cK,"transition"),f3=h3(c3,"transform"),PMe="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(Bt.transform3dSupported?"will-change:transform;":"");function IMe(r){return r=r==="left"?"right":r==="right"?"left":r==="top"?"bottom":"top",r}function NMe(r,e,t){if(!Ce(t)||t==="inside")return"";var i=r.get("backgroundColor"),n=r.get("borderWidth");e=Cl(e);var a=IMe(t),o=Math.max(Math.round(n)*1.5,6),s="",l=f3+":",u;yt(["left","right"],a)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,h=o+n,f=h*Math.abs(Math.cos(c))+h*Math.abs(Math.sin(c)),p=Math.round(((f-Math.SQRT2*n)/2+Math.SQRT2*n-(f-h)/2)*100)/100;s+=";"+a+":-"+p+"px";var d=e+" solid "+n+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+i+";"];return'<div style="'+g.join("")+'"></div>'}function UMe(r,e){var t="cubic-bezier(0.23,1,0.32,1)",i=" "+r/2+"s "+t,n="opacity"+i+",visibility"+i;return e||(i=" "+r+"s "+t,n+=Bt.transformSupported?","+f3+i:",left"+i+",top"+i),DMe+":"+n}function fK(r,e,t){var i=r.toFixed(0)+"px",n=e.toFixed(0)+"px";if(!Bt.transformSupported)return t?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=Bt.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return t?"top:0;left:0;"+f3+":"+o+";":[["top",0],["left",0],[c3,o]]}function OMe(r){var e=[],t=r.get("fontSize"),i=r.getTextColor();i&&e.push("color:"+i),e.push("font:"+r.getFont()),t&&e.push("line-height:"+Math.round(t*3/2)+"px");var n=r.get("textShadowColor"),a=r.get("textShadowBlur")||0,o=r.get("textShadowOffsetX")||0,s=r.get("textShadowOffsetY")||0;return n&&a&&e.push("text-shadow:"+o+"px "+s+"px "+a+"px "+n),N(["decoration","align"],function(l){var u=r.get(l);u&&e.push("text-"+l+":"+u)}),e.join(";")}function zMe(r,e,t){var i=[],n=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),c=r.getModel("textStyle"),h=U1(r,"html"),f=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+f),e&&n&&i.push(UMe(n,t)),a&&i.push("background-color:"+a),N(["width","color","radius"],function(p){var d="border-"+p,g=d1(d),m=r.get(g);m!=null&&i.push(d+":"+m+(p==="color"?"":"px"))}),i.push(OMe(c)),h!=null&&i.push("padding:"+Al(h).join("px ")+"px"),i.join(";")+";"}function pK(r,e,t,i,n){var a=e&&e.painter;if(t){var o=a&&a.getViewportRoot();o&&iG(r,o,t,i,n)}else{r[0]=i,r[1]=n;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/e.getWidth(),r[3]=r[1]/e.getHeight()}var FMe=function(){function r(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Bt.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=e.getZr(),a=t.appendTo,o=a&&(Ce(a)?document.querySelector(a):fh(a)?a:He(a)&&a(e.getDom()));pK(this._styleCoord,n,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(i),this._api=e,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,c=n.painter.getViewportRoot();fo(c,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),i=hK(t,"position"),n=t.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},r.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=PMe+zMe(e,!this._firstShow,this._longHide)+fK(a[0],a[1],!0)+("border-color:"+Cl(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(e,t,i,n,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(Ce(a)&&i.get("trigger")==="item"&&!KE(i)&&(s=NMe(i,n,a)),Ce(e))o.innerHTML=e+s;else if(e){o.innerHTML="",pe(e)||(e=[e]);for(var l=0;l<e.length;l++)fh(e[l])&&e[l].parentNode!==o&&o.appendChild(e[l]);if(s&&o.childNodes.length){var u=document.createElement("div");u.innerHTML=s,o.appendChild(u)}}},r.prototype.setEnterable=function(e){this._enterable=e},r.prototype.getSize=function(){var e=this.el;return[e.offsetWidth,e.offsetHeight]},r.prototype.moveTo=function(e,t){var i=this._styleCoord;if(pK(i,this._zr,this._container,e,t),i[0]!=null&&i[1]!=null){var n=this.el.style,a=fK(i[0],i[1]);N(a,function(o){n[o[0]]=o[1]})}},r.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},r.prototype.hide=function(){var e=this,t=this.el.style;t.visibility="hidden",t.opacity="0",Bt.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},r.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Be(this.hide,this),e)):this.hide())},r.prototype.isShow=function(){return this._show},r.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},r}(),dK=FMe;var BMe=function(){function r(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),vK(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return r.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},r.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},r.prototype.setContent=function(e,t,i,n,a){var o=this;qe(e)&&hr(""),this.el&&this._zr.remove(this.el);var s=i.getModel("textStyle");this.el=new It({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:n,textShadowColor:s.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:U1(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),N(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(u){o.el.style[u]=i.get(u)}),N(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(u){o.el.style[u]=s.get(u)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},r.prototype.setEnterable=function(e){this._enterable=e},r.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),i=mK(e.style);return[t.width+i.left+i.right,t.height+i.top+i.bottom]},r.prototype.moveTo=function(e,t){var i=this.el;if(i){var n=this._styleCoord;vK(n,this._zr,e,t),e=n[0],t=n[1];var a=i.style,o=lf(a.borderWidth||0),s=mK(a);i.x=e+o+s.left,i.y=t+o+s.top,i.markRedraw()}},r.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},r.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},r.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Be(this.hide,this),e)):this.hide())},r.prototype.isShow=function(){return this._show},r.prototype.dispose=function(){this._zr.remove(this.el)},r}();function lf(r){return Math.max(0,r)}function mK(r){var e=lf(r.shadowBlur||0),t=lf(r.shadowOffsetX||0),i=lf(r.shadowOffsetY||0);return{left:lf(e-t),right:lf(e+t),top:lf(e-i),bottom:lf(e+i)}}function vK(r,e,t,i){r[0]=t,r[1]=i,r[2]=r[0]/e.getWidth(),r[3]=r[1]/e.getHeight()}var gK=BMe;var kMe=new Rt({shape:{x:-1,y:-1,width:2,height:2}}),VMe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){if(!(Bt.node||!i.getDom())){var n=t.getComponent("tooltip"),a=this._renderMode=TH(n.get("renderMode"));this._tooltipContent=a==="richText"?new gK(i):new dK(i,{appendTo:n.get("appendToBody",!0)?"body":n.get("appendTo",!0)})}},e.prototype.render=function(t,i,n){if(!(Bt.node||!n.getDom())){this.group.removeAll(),this._tooltipModel=t,this._ecModel=i,this._api=n;var a=this._tooltipContent;a.update(t),a.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&t.get("transitionDuration")?Hs(this,"_updatePosition",50,"fixRate"):xc(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var t=this._tooltipModel,i=t.get("triggerOn");zE("itemTooltip",this._api,Be(function(n,a,o){i!=="none"&&(i.indexOf(n)>=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,i=this._ecModel,n=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(t,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,i,n,a){if(!(a.from===this.uid||Bt.node||!n.getDom())){var o=yK(a,n);this._ticket="";var s=a.dataByCoordSys,l=XMe(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=kMe;c.x=a.x,c.y=a.y,c.update(),it(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,i,n,a))return;var h=bS(a,i),f=h.point[0],p=h.point[1];f!=null&&p!=null&&this._tryShow({offsetX:f,offsetY:p,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(t,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(yK(a,n))},e.prototype._manuallyAxisShowTip=function(t,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var c=u.getData(),h=ES([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(t,i){var n=t.target,a=this._tooltipModel;if(a){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,t);else if(n){var s=it(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Dl(n,function(c){if(it(c).dataIndex!=null)return l=c,!0;if(it(c).tooltipConfig!=null)return u=c,!0},!0),l?this._showSeriesItemTooltip(t,l,i):u?this._showComponentItemTooltip(t,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},e.prototype._showOrMove=function(t,i){var n=t.get("showDelay");i=Be(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},e.prototype._showAxisTooltip=function(t,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=ES([i.tooltipOption],a),l=this._renderMode,u=[],c=kr("section",{blocks:[],noHeader:!0}),h=[],f=new O1;N(t,function(_){N(_.dataByAxis,function(y){var x=n.getComponent(y.axisDim+"Axis",y.axisIndex),M=y.value;if(!(!x||M==null)){var S=FO(M,x.axis,n,y.seriesDataIndices,y.valueLabelOpt),w=kr("section",{header:S,noHeader:!Zi(S),sortBlocks:!0,blocks:[]});c.blocks.push(w),N(y.seriesDataIndices,function(T){var C=n.getSeriesByIndex(T.seriesIndex),b=T.dataIndexInside,E=C.getDataParams(b);if(!(E.dataIndex<0)){E.axisDim=y.axisDim,E.axisIndex=y.axisIndex,E.axisType=y.axisType,E.axisId=y.axisId,E.axisValue=Yx(x.axis,{value:M}),E.axisValueLabel=S,E.marker=f.makeTooltipMarker("item",Cl(E.color),l);var I=fP(C.formatTooltip(b,!0,null)),R=I.frag;if(R){var A=ES([C],a).get("valueFormatter");w.blocks.push(A?he({valueFormatter:A},R):R)}I.text&&h.push(I.text),u.push(E)}})}})}),c.blocks.reverse(),h.reverse();var p=i.position,d=s.get("order"),g=_P(c,f,l,d,n.get("useUTC"),s.get("textStyle"));g&&h.unshift(g);var m=l==="richText"?`
  2228. `:"<br/>",v=h.join(m);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,p,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,v,u,Math.random()+"",o[0],o[1],p,null,f)})},e.prototype._showSeriesItemTooltip=function(t,i,n){var a=this._ecModel,o=it(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,h=o.dataType,f=u.getData(h),p=this._renderMode,d=t.positionDefault,g=ES([f.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),m=g.get("trigger");if(!(m!=null&&m!=="item")){var v=u.getDataParams(c,h),_=new O1;v.marker=_.makeTooltipMarker("item",Cl(v.color),p);var y=fP(u.formatTooltip(c,!1,h)),x=g.get("order"),M=g.get("valueFormatter"),S=y.frag,w=S?_P(M?he({valueFormatter:M},S):S,_,p,x,a.get("useUTC"),g.get("textStyle")):y.text,T="item_"+u.name+"_"+c;this._showOrMove(g,function(){this._showTooltipContent(g,w,v,T,t.offsetX,t.offsetY,t.position,t.target,_)}),n({type:"showTip",dataIndexInside:c,dataIndex:f.getRawIndex(c),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,i,n){var a=it(i),o=a.tooltipConfig,s=o.option||{};if(Ce(s)){var l=s;s={content:l,formatter:l}}var u=[s],c=this._ecModel.getComponent(a.componentMainType,a.componentIndex);c&&u.push(c),u.push({formatter:s.content});var h=t.positionDefault,f=ES(u,this._tooltipModel,h?{position:h}:null),p=f.get("content"),d=Math.random()+"",g=new O1;this._showOrMove(f,function(){var m=Qe(f.get("formatterParams")||{});this._showTooltipContent(f,p,m,d,t.offsetX,t.offsetY,t.position,i,g)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,i,n,a,o,s,l,u,c){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var h=this._tooltipContent;h.setEnterable(t.get("enterable"));var f=t.get("formatter");l=l||t.get("position");var p=i,d=this._getNearestPoint([o,s],n,t.get("trigger"),t.get("borderColor")),g=d.color;if(f)if(Ce(f)){var m=t.ecModel.get("useUTC"),v=pe(n)?n[0]:n,_=v&&v.axisType&&v.axisType.indexOf("time")>=0;p=f,_&&(p=Kp(v.axisValue,p,m)),p=v1(p,n,!0)}else if(He(f)){var y=Be(function(x,M){x===this._ticket&&(h.setContent(M,c,t,g,l),this._updatePosition(t,l,o,s,h,n,u))},this);this._ticket=a,p=f(n,a,y)}else p=f;h.setContent(p,c,t,g,l),h.show(t,g),this._updatePosition(t,l,o,s,h,n,u)}},e.prototype._getNearestPoint=function(t,i,n,a){if(n==="axis"||pe(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!pe(i))return{color:a||i.color||i.borderColor}},e.prototype._updatePosition=function(t,i,n,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();i=i||t.get("position");var h=o.getSize(),f=t.get("align"),p=t.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),He(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,c],contentSize:h.slice()})),pe(i))n=ze(i[0],u),a=ze(i[1],c);else if(qe(i)){var g=i;g.width=h[0],g.height=h[1];var m=br(g,{width:u,height:c});n=m.x,a=m.y,f=null,p=null}else if(Ce(i)&&l){var v=WMe(i,d,h,t.get("borderWidth"));n=v[0],a=v[1]}else{var v=GMe(n,a,o,u,c,f?null:20,p?null:20);n=v[0],a=v[1]}if(f&&(n-=_K(f)?h[0]/2:f==="right"?h[0]:0),p&&(a-=_K(p)?h[1]/2:p==="bottom"?h[1]:0),KE(t)){var v=HMe(n,a,o,u,c);n=v[0],a=v[1]}o.moveTo(n,a)},e.prototype._updateContentNotChangedOnAxis=function(t,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===t.length;return o&&N(n,function(s,l){var u=s.dataByAxis||[],c=t[l]||{},h=c.dataByAxis||[];o=o&&u.length===h.length,o&&N(u,function(f,p){var d=h[p]||{},g=f.seriesDataIndices||[],m=d.seriesDataIndices||[];o=o&&f.value===d.value&&f.axisType===d.axisType&&f.axisId===d.axisId&&g.length===m.length,o&&N(g,function(v,_){var y=m[_];o=o&&v.seriesIndex===y.seriesIndex&&v.dataIndex===y.dataIndex}),a&&N(f.seriesDataIndices,function(v){var _=v.seriesIndex,y=i[_],x=a[_];y&&x&&x.data!==y.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=i,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,i){Bt.node||!i.getDom()||(xc(this,"_updatePosition"),this._tooltipContent.dispose(),MS("itemTooltip",i))},e.type="tooltip",e}(ir);function ES(r,e,t){var i=e.ecModel,n;t?(n=new Jt(t,i,i),n=new Jt(e.option,n,i)):n=e;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof Jt&&(o=o.get("tooltip",!0)),Ce(o)&&(o={formatter:o}),o&&(n=new Jt(o,n,i)))}return n}function yK(r,e){return r.dispatchAction||Be(e.dispatchAction,e)}function GMe(r,e,t,i,n,a,o){var s=t.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>i?r-=l+a:r+=a),o!=null&&(e+u+o>n?e-=u+o:e+=o),[r,e]}function HMe(r,e,t,i,n){var a=t.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,i)-o,e=Math.min(e+s,n)-s,r=Math.max(r,0),e=Math.max(e,0),[r,e]}function WMe(r,e,t,i){var n=t[0],a=t[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,c=e.height;switch(r){case"inside":s=e.x+u/2-n/2,l=e.y+c/2-a/2;break;case"top":s=e.x+u/2-n/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-n/2,l=e.y+c+o;break;case"left":s=e.x-n-o,l=e.y+c/2-a/2;break;case"right":s=e.x+u+o,l=e.y+c/2-a/2}return[s,l]}function _K(r){return r==="center"||r==="middle"}function XMe(r,e,t){var i=H_(r).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=wh(e,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=t.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=it(u).tooltipConfig;if(c&&c.name===r.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}var xK=VMe;function p3(r){Ot(Gl),r.registerComponentModel(lK),r.registerComponentView(xK),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},zr),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},zr)}var YMe=["rect","polygon","keep","clear"];function d3(r,e){var t=tr(r?r.brush:[]);if(t.length){var i=[];N(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(i=i.concat(u))});var n=r&&r.toolbox;pe(n)&&(n=n[0]),n||(n={feature:{}},r.toolbox=[n]);var a=n.feature||(n.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,i),qMe(s),e&&!s.length&&s.push.apply(s,YMe)}}function qMe(r){var e={};N(r,function(t){e[t]=1}),r.length=0,N(e,function(t,i){r.push(i)})}var SK=N;function MK(r){if(r){for(var e in r)if(r.hasOwnProperty(e))return!0}}function AS(r,e,t){var i={};return SK(e,function(a){var o=i[a]=n();SK(r[a],function(s,l){if(gi.isValidType(l)){var u={type:l,visual:s};t&&t(u,a),o[l]=new gi(u),l==="opacity"&&(u=Qe(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new gi(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function JE(r,e,t){var i;N(t,function(n){e.hasOwnProperty(n)&&MK(e[n])&&(i=!0)}),i&&N(t,function(n){e.hasOwnProperty(n)&&MK(e[n])?r[n]=Qe(e[n]):delete r[n]})}function bK(r,e,t,i,n,a){var o={};N(r,function(h){var f=gi.prepareVisualTypes(e[h]);o[h]=f});var s;function l(h){return Rx(t,s,h)}function u(h,f){EP(t,s,h,f)}a==null?t.each(c):t.each([a],c);function c(h,f){s=a==null?h:f;var p=t.getRawDataItem(s);if(!(p&&p.visualMap===!1))for(var d=i.call(n,h),g=e[d],m=o[d],v=0,_=m.length;v<_;v++){var y=m[v];g[y]&&g[y].applyVisual(h,l,u)}}}function wK(r,e,t,i){var n={};return N(r,function(a){var o=gi.prepareVisualTypes(e[a]);n[a]=o}),{progress:function(o,s){var l;i!=null&&(l=s.getDimensionIndex(i));function u(M){return Rx(s,h,M)}function c(M,S){EP(s,h,M,S)}for(var h,f=s.getStore();(h=o.next())!=null;){var p=s.getRawDataItem(h);if(!(p&&p.visualMap===!1))for(var d=i!=null?f.get(l,h):h,g=t(d),m=e[g],v=n[g],_=0,y=v.length;_<y;_++){var x=v[_];m[x]&&m[x].applyVisual(d,u,c)}}}}}function AK(r){var e=r.brushType,t={point:function(i){return TK[e].point(i,t,r)},rect:function(i){return TK[e].rect(i,t,r)}};return t}var TK={lineX:EK(0),lineY:EK(1),rect:{point:function(r,e,t){return r&&t.boundingRect.contain(r[0],r[1])},rect:function(r,e,t){return r&&t.boundingRect.intersect(r)}},polygon:{point:function(r,e,t){return r&&t.boundingRect.contain(r[0],r[1])&&Sc(t.range,r[0],r[1])},rect:function(r,e,t){var i=t.range;if(!r||i.length<=1)return!1;var n=r.x,a=r.y,o=r.width,s=r.height,l=i[0];if(Sc(i,n,a)||Sc(i,n+o,a)||Sc(i,n,a+s)||Sc(i,n+o,a+s)||ht.create(r).contain(l[0],l[1])||fv(n,a,n+o,a,i)||fv(n,a,n,a+s,i)||fv(n+o,a,n+o,a+s,i)||fv(n,a+s,n+o,a+s,i))return!0}}};function EK(r){var e=["x","y"],t=["width","height"];return{point:function(i,n,a){if(i){var o=a.range,s=i[r];return CS(s,o)}},rect:function(i,n,a){if(i){var o=a.range,s=[i[e[r]],i[e[r]]+i[t[r]]];return s[1]<s[0]&&s.reverse(),CS(s[0],o)||CS(s[1],o)||CS(o[0],s)||CS(o[1],s)}}}}function CS(r,e){return e[0]<=r&&r<=e[1]}var CK=["inBrush","outOfBrush"],m3="__ecBrushSelect",v3="__ecInBrushSelectEvent";function g3(r){r.eachComponent({mainType:"brush"},function(e){var t=e.brushTargetManager=new TS(e.option,r);t.setInputRanges(e.areas,r)})}function y3(r,e,t){var i=[],n,a;r.eachComponent({mainType:"brush"},function(o){t&&t.type==="takeGlobalCursor"&&o.setBrushOption(t.key==="brush"?t.brushOption:{brushType:!1})}),g3(r),r.eachComponent({mainType:"brush"},function(o,s){var l={brushId:o.id,brushIndex:s,brushName:o.name,areas:Qe(o.areas),selected:[]};i.push(l);var u=o.option,c=u.brushLink,h=[],f=[],p=[],d=!1;s||(n=u.throttleType,a=u.throttleDelay);var g=de(o.areas,function(M){var S=JMe[M.brushType],w=Ye({boundingRect:S?S(M):void 0},M);return w.selectors=AK(w),w}),m=AS(o.option,CK,function(M){M.mappingMethod="fixed"});pe(c)&&N(c,function(M){h[M]=1});function v(M){return c==="all"||!!h[M]}function _(M){return!!M.length}r.eachSeries(function(M,S){var w=p[S]=[];M.subType==="parallel"?y(M,S):x(M,S,w)});function y(M,S){var w=M.coordinateSystem;d=d||w.hasAxisBrushed(),v(S)&&w.eachActiveState(M.getData(),function(T,C){T==="active"&&(f[C]=1)})}function x(M,S,w){if(!(!M.brushSelector||KMe(o,S))&&(N(g,function(C){o.brushTargetManager.controlSeries(C,M,r)&&w.push(C),d=d||_(w)}),v(S)&&_(w))){var T=M.getData();T.each(function(C){RK(M,w,T,C)&&(f[C]=1)})}}r.eachSeries(function(M,S){var w={seriesId:M.id,seriesIndex:S,seriesName:M.name,dataIndex:[]};l.selected.push(w);var T=p[S],C=M.getData(),b=v(S)?function(E){return f[E]?(w.dataIndex.push(C.getRawIndex(E)),"inBrush"):"outOfBrush"}:function(E){return RK(M,T,C,E)?(w.dataIndex.push(C.getRawIndex(E)),"inBrush"):"outOfBrush"};(v(S)?d:_(T))&&bK(CK,m,C,b)})}),ZMe(e,n,a,i,t)}function ZMe(r,e,t,i,n){if(n){var a=r.getZr();if(!a[v3]){a[m3]||(a[m3]=jMe);var o=Hs(a,m3,t,e);o(r,i)}}}function jMe(r,e){if(!r.isDisposed()){var t=r.getZr();t[v3]=!0,r.dispatchAction({type:"brushSelect",batch:e}),t[v3]=!1}}function RK(r,e,t,i){for(var n=0,a=e.length;n<a;n++){var o=e[n];if(r.brushSelector(i,t,o.selectors,o))return!0}}function KMe(r,e){var t=r.option.seriesIndex;return t!=null&&t!=="all"&&(pe(t)?yt(t,e)<0:e!==t)}var JMe={rect:function(r){return LK(r.range)},polygon:function(r){for(var e,t=r.range,i=0,n=t.length;i<n;i++){e=e||[[1/0,-1/0],[1/0,-1/0]];var a=t[i];a[0]<e[0][0]&&(e[0][0]=a[0]),a[0]>e[0][1]&&(e[0][1]=a[0]),a[1]<e[1][0]&&(e[1][0]=a[1]),a[1]>e[1][1]&&(e[1][1]=a[1])}return e&&LK(e)}};function LK(r){return new ht(r[0][0],r[1][0],r[0][1]-r[0][0],r[1][1]-r[1][0])}var $Me=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){this.ecModel=t,this.api=i,this.model,(this._brushController=new Qv(i.getZr())).on("brush",Be(this._onBrush,this)).mount()},e.prototype.render=function(t,i,n,a){this.model=t,this._updateController(t,i,n,a)},e.prototype.updateTransform=function(t,i,n,a){g3(i),this._updateController(t,i,n,a)},e.prototype.updateVisual=function(t,i,n,a){this.updateTransform(t,i,n,a)},e.prototype.updateView=function(t,i,n,a){this._updateController(t,i,n,a)},e.prototype._updateController=function(t,i,n,a){(!a||a.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var i=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:Qe(n),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:Qe(n),$from:i})},e.type="brush",e}(ir),DK=$Me;var QMe="#ddd",ebe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,i){var n=this.option;!i&&JE(n,t,["inBrush","outOfBrush"]);var a=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:QMe},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=de(t,function(i){return PK(this.option,i)},this))},e.prototype.setBrushOption=function(t){this.brushOption=PK(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Nt);function PK(r,e){return bt({brushType:r.brushType,brushMode:r.brushMode,transformable:r.transformable,brushStyle:new Jt(r.brushStyle).getItemStyle(),removeOnClick:r.removeOnClick,z:r.z},e,!0)}var IK=ebe;var tbe=["rect","polygon","lineX","lineY","keep","clear"],rbe=function(r){Z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,i,n){var a,o,s;i.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,N(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,i,n){this.render(t,i,n)},e.prototype.getIcons=function(){var t=this.model,i=t.get("icon",!0),n={};return N(t.get("type",!0),function(a){i[a]&&(n[a]=i[a])}),n},e.prototype.onclick=function(t,i,n){var a=this._brushType,o=this._brushMode;n==="clear"?(i.dispatchAction({type:"axisAreaSelect",intervals:[]}),i.dispatchAction({type:"brush",command:"clear",areas:[]})):i.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:n==="keep"?a:a===n?!1:n,brushMode:n==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(t){var i={show:!0,type:tbe.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return i},e}(en),NK=rbe;function _3(r){r.registerComponentView(DK),r.registerComponentModel(IK),r.registerPreprocessor(d3),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,y3),r.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(i){i.setAreas(e.areas)})}),r.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},zr),r.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},zr),sf("brush",NK)}var ibe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Nt),nbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,i,n){if(this.group.removeAll(),!!t.get("show")){var a=this.group,o=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=mt(t.get("textBaseline"),t.get("textVerticalAlign")),c=new It({style:pr(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),h=c.getBoundingRect(),f=t.get("subtext"),p=new It({style:pr(s,{text:f,fill:s.getTextColor(),y:h.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),g=t.get("sublink"),m=t.get("triggerEvent",!0);c.silent=!d&&!m,p.silent=!g&&!m,d&&c.on("click",function(){Jp(d,"_"+t.get("target"))}),g&&p.on("click",function(){Jp(g,"_"+t.get("subtarget"))}),it(c).eventData=it(p).eventData=m?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(c),f&&a.add(p);var v=a.getBoundingRect(),_=t.getBoxLayoutParams();_.width=v.width,_.height=v.height;var y=br(_,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?y.x+=y.width:l==="center"&&(y.x+=y.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?y.y+=y.height:u==="middle"&&(y.y+=y.height/2),u=u||"top"),a.x=y.x,a.y=y.y,a.markRedraw();var x={align:l,verticalAlign:u};c.setStyle(x),p.setStyle(x),v=a.getBoundingRect();var M=y.margin,S=t.getItemStyle(["color","opacity"]);S.fill=t.get("backgroundColor");var w=new Rt({shape:{x:v.x-M[3],y:v.y-M[0],width:v.width+M[1]+M[3],height:v.height+M[0]+M[2],r:t.get("borderRadius")},style:S,subPixelOptimize:!0,silent:!0});a.add(w)}},e.type="title",e}(ir);function x3(r){r.registerComponentModel(ibe),r.registerComponentView(nbe)}var abe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n),this._initData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var i=this._data.count();this.option.loop?t=(t%i+i)%i:(t>=i&&(t=i-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t=this.option,i=t.data||[],n=t.axisType,a=this._names=[],o;n==="category"?(o=[],N(i,function(u,c){var h=Kr(Sl(u),""),f;qe(u)?(f=Qe(u),f.value=c):f=c,o.push(f),a.push(h)})):o=i;var s={category:"ordinal",time:"time",value:"number"}[n]||"number",l=this._data=new oi([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Nt),S3=abe;var UK=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=$n(S3.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(S3);Cr(UK,Mv.prototype);var OK=UK;var obe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(ir),zK=obe;var sbe=function(r){Z(e,r);function e(t,i,n,a){var o=r.call(this,t,i,n)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(vn),FK=sbe;var M3=Math.PI,BK=xt(),lbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,i){this.api=i},e.prototype.render=function(t,i,n){if(this.model=t,this.api=n,this.ecModel=i,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,n),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return kr("nameValue",{noName:!0,value:c})},N(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,t)},this),this._renderAxisLabel(a,s,l,t),this._position(a,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,i){var n=t.get(["label","position"]),a=t.get("orient"),o=cbe(t,i),s;n==null||n==="auto"?s=a==="horizontal"?o.y+o.height/2<i.getHeight()/2?"-":"+":o.x+o.width/2<i.getWidth()/2?"+":"-":Ce(n)?s={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[a][n]:s=n;var l={horizontal:"center",vertical:s>=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:M3/2},h=a==="vertical"?o.height:o.width,f=t.getModel("controlStyle"),p=f.get("show",!0),d=p?f.get("itemSize"):0,g=p?f.get("itemGap"):0,m=d+g,v=t.get(["label","rotate"])||0;v=v*M3/180;var _,y,x,M=f.get("position",!0),S=p&&f.get("showPlayBtn",!0),w=p&&f.get("showPrevBtn",!0),T=p&&f.get("showNextBtn",!0),C=0,b=h;M==="left"||M==="bottom"?(S&&(_=[0,0],C+=m),w&&(y=[C,0],C+=m),T&&(x=[b-d,0],b-=m)):(S&&(_=[b-d,0],b-=m),w&&(y=[0,0],C+=m),T&&(x=[b-d,0],b-=m));var E=[C,b];return t.get("inverse")&&E.reverse(),{viewRect:o,mainLength:h,orient:a,rotation:c[a],labelRotation:v,labelPosOpt:s,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:_,prevBtnPosition:y,nextBtnPosition:x,axisExtent:E,controlSize:d,controlGap:g}},e.prototype._position=function(t,i){var n=this._mainGroup,a=this._labelGroup,o=t.viewRect;if(t.orient==="vertical"){var s=Ci(),l=o.x,u=o.y+o.height;Tn(s,s,[-l,-u]),vo(s,s,-M3/2),Tn(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),h=_(n.getBoundingRect()),f=_(a.getBoundingRect()),p=[n.x,n.y],d=[a.x,a.y];d[0]=p[0]=c[0][0];var g=t.labelPosOpt;if(g==null||Ce(g)){var m=g==="+"?0:1;y(p,h,c,1,m),y(d,f,c,1,1-m)}else{var m=g>=0?0:1;y(p,h,c,1,m),d[1]=p[1]+g}n.setPosition(p),a.setPosition(d),n.rotation=a.rotation=t.rotation,v(n),v(a);function v(x){x.originX=c[0][0]-x.x,x.originY=c[1][0]-x.y}function _(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function y(x,M,S,w,T){x[w]+=S[w][T]-M[w][T]}},e.prototype._createAxis=function(t,i){var n=i.getData(),a=i.get("axisType"),o=ube(i,a);o.getTicks=function(){return n.mapArray(["value"],function(u){return{value:u}})};var s=n.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new FK("value",o,t.axisExtent,a);return l.model=i,l},e.prototype._createGroup=function(t){var i=this[t]=new Ze;return this.group.add(i),i},e.prototype._renderAxisLine=function(t,i,n,a){var o=n.getExtent();if(a.get(["lineStyle","show"])){var s=new ei({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:he({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});i.add(s);var l=this._progressLine=new ei({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ye({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});i.add(l)}},e.prototype._renderAxisTick=function(t,i,n,a){var o=this,s=a.getData(),l=n.scale.getTicks();this._tickSymbols=[],N(l,function(u){var c=n.dataToCoord(u.value),h=s.getItemModel(u.value),f=h.getModel("itemStyle"),p=h.getModel(["emphasis","itemStyle"]),d=h.getModel(["progress","itemStyle"]),g={x:c,y:0,onclick:Be(o._changeTimeline,o,u.value)},m=kK(h,f,i,g);m.ensureState("emphasis").style=p.getItemStyle(),m.ensureState("progress").style=d.getItemStyle(),yu(m);var v=it(m);h.get("tooltip")?(v.dataIndex=u.value,v.dataModel=a):v.dataIndex=v.dataModel=null,o._tickSymbols.push(m)})},e.prototype._renderAxisLabel=function(t,i,n,a){var o=this,s=n.getLabelModel();if(s.get("show")){var l=a.getData(),u=n.getViewLabels();this._tickLabels=[],N(u,function(c){var h=c.tickValue,f=l.getItemModel(h),p=f.getModel("label"),d=f.getModel(["emphasis","label"]),g=f.getModel(["progress","label"]),m=n.dataToCoord(c.tickValue),v=new It({x:m,y:0,rotation:t.labelRotation-t.rotation,onclick:Be(o._changeTimeline,o,h),silent:!1,style:pr(p,{text:c.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});v.ensureState("emphasis").style=pr(d),v.ensureState("progress").style=pr(g),i.add(v),yu(v),BK(v).dataIndex=h,o._tickLabels.push(v)})}},e.prototype._renderControl=function(t,i,n,a){var o=t.controlSize,s=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),h=a.get("inverse",!0);f(t.nextBtnPosition,"next",Be(this._changeTimeline,this,h?"-":"+")),f(t.prevBtnPosition,"prev",Be(this._changeTimeline,this,h?"+":"-")),f(t.playPosition,c?"stop":"play",Be(this._handlePlayClick,this,!c),!0);function f(p,d,g,m){if(p){var v=En(mt(a.get(["controlStyle",d+"BtnSize"]),o),o),_=[0,-v/2,v,v],y=hbe(a,d+"Icon",_,{x:p[0],y:p[1],originX:o/2,originY:0,rotation:m?-s:0,rectHover:!0,style:l,onclick:g});y.ensureState("emphasis").style=u,i.add(y),yu(y)}}},e.prototype._renderCurrentPointer=function(t,i,n,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(h){h.draggable=!0,h.drift=Be(u._handlePointerDrag,u),h.ondragend=Be(u._handlePointerDragend,u),VK(h,u._progressLine,s,n,a,!0)},onUpdate:function(h){VK(h,u._progressLine,s,n,a)}};this._currentPointer=kK(l,l,this._mainGroup,{},this._currentPointer,c)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,i,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,i){var n=this._toAxisCoord(t)[0],a=this._axis,o=Ri(a.getExtent().slice());n>o[1]&&(n=o[1]),n<o[0]&&(n=o[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var s=this._progressLine;s&&(s.shape.x2=n,s.dirty());var l=this._findNearestTick(n),u=this.model;(i||l!==u.getCurrentIndex()&&u.get("realtime"))&&this._changeTimeline(l)},e.prototype._doPlayStop=function(){var t=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(function(){var i=t.model;t._changeTimeline(i.getCurrentIndex()+(i.get("rewind",!0)?-1:1))},this.model.get("playInterval")))},e.prototype._toAxisCoord=function(t){var i=this._mainGroup.getLocalTransform();return Ln(t,i,!0)},e.prototype._findNearestTick=function(t){var i=this.model.getData(),n=1/0,a,o=this._axis;return i.each(["value"],function(s,l){var u=o.dataToCoord(s),c=Math.abs(u-t);c<n&&(n=c,a=l)}),a},e.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},e.prototype._changeTimeline=function(t){var i=this.model.getCurrentIndex();t==="+"?t=i+1:t==="-"&&(t=i-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})},e.prototype._updateTicksStatus=function(){var t=this.model.getCurrentIndex(),i=this._tickSymbols,n=this._tickLabels;if(i)for(var a=0;a<i.length;a++)i&&i[a]&&i[a].toggleState("progress",a<t);if(n)for(var a=0;a<n.length;a++)n&&n[a]&&n[a].toggleState("progress",BK(n[a]).dataIndex<=t)},e.type="timeline.slider",e}(zK);function ube(r,e){if(e=e||r.get("type"),e)switch(e){case"category":return new Wx({ordinalMeta:r.getCategories(),extent:[1/0,-1/0]});case"time":return new pT({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new Do}}function cbe(r,e){return br(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},r.get("padding"))}function hbe(r,e,t,i){var n=i.style,a=pc(r.get(["controlStyle",e]),i||{},new ht(t[0],t[1],t[2],t[3]));return n&&a.setStyle(n),a}function kK(r,e,t,i,n,a){var o=e.get("color");if(n)n.setColor(o),t.add(n),a&&a.onUpdate(n);else{var s=r.get("symbol");n=wr(s,-1,-1,2,2,o),n.setStyle("strokeNoScale",!0),t.add(n),a&&a.onCreate(n)}var l=e.getItemStyle(["color"]);n.setStyle(l),i=bt({rectHover:!0,z2:100},i,!0);var u=Pl(r.get("symbolSize"));i.scaleX=u[0]/2,i.scaleY=u[1]/2;var c=ss(r.get("symbolOffset"),u);c&&(i.x=(i.x||0)+c[0],i.y=(i.y||0)+c[1]);var h=r.get("symbolRotate");return i.rotation=(h||0)*Math.PI/180||0,n.attr(i),n.updateTransform(),n}function VK(r,e,t,i,n,a){if(!r.dragging){var o=n.getModel("checkpointStyle"),s=i.dataToCoord(n.getData().get("value",t));if(a||!o.get("animation",!0))r.attr({x:s,y:0}),e&&e.attr({shape:{x2:s}});else{var l={duration:o.get("animationDuration",!0),easing:o.get("animationEasing",!0)};r.stopAnimation(null,!0),r.animateTo({x:s,y:0},l),e&&e.animateTo({shape:{x2:s}},l)}}}var GK=lbe;function HK(r){r.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(e,t,i){var n=t.getComponent("timeline");return n&&e.currentIndex!=null&&(n.setCurrentIndex(e.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.getPlayState()&&(n.setPlayState(!1),i.dispatchAction({type:"timelinePlayChange",playState:!1,from:e.from}))),t.resetOption("timeline",{replaceMerge:n.get("replaceMerge",!0)}),Ye({currentIndex:n.option.currentIndex},e)}),r.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(e,t){var i=t.getComponent("timeline");i&&e.playState!=null&&i.setPlayState(e.playState)})}function b3(r){var e=r&&r.timeline;pe(e)||(e=e?[e]:[]),N(e,function(t){t&&fbe(t)})}function fbe(r){var e=r.type,t={number:"value",time:"time"};if(t[e]&&(r.axisType=t[e],delete r.type),WK(r),bd(r,"controlPosition")){var i=r.controlStyle||(r.controlStyle={});bd(i,"position")||(i.position=r.controlPosition),i.position==="none"&&!bd(i,"show")&&(i.show=!1,delete i.position),delete r.controlPosition}N(r.data||[],function(n){qe(n)&&!pe(n)&&(!bd(n,"value")&&bd(n,"name")&&(n.value=n.name),WK(n))})}function WK(r){var e=r.itemStyle||(r.itemStyle={}),t=e.emphasis||(e.emphasis={}),i=r.label||r.label||{},n=i.normal||(i.normal={}),a={normal:1,emphasis:1};N(i,function(o,s){!a[s]&&!bd(n,s)&&(n[s]=o)}),t.label&&!bd(i,"emphasis")&&(i.emphasis=t.label,delete t.label)}function bd(r,e){return r.hasOwnProperty(e)}function w3(r){r.registerComponentModel(OK),r.registerComponentView(GK),r.registerSubTypeDefaulter("timeline",function(){return"slider"}),HK(r),r.registerPreprocessor(b3)}function wd(r,e){if(!r)return!1;for(var t=pe(r)?r:[r],i=0;i<t.length;i++)if(t[i]&&t[i][e])return!0;return!1}function QE(r){rs(r,"label",["show"])}var eA=xt(),XK=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.createdBySelf=!1,t}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n),this._mergeOption(t,n,!1,!0)},e.prototype.isAnimationEnabled=function(){if(Bt.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},e.prototype.mergeOption=function(t,i){this._mergeOption(t,i,!1,!1)},e.prototype._mergeOption=function(t,i,n,a){var o=this.mainType;n||i.eachSeries(function(s){var l=s.get(this.mainType,!0),u=eA(s)[o];if(!l||!l.data){eA(s)[o]=null;return}u?u._mergeOption(l,i,!0):(a&&QE(l),N(l.data,function(c){c instanceof Array?(QE(c[0]),QE(c[1])):QE(c)}),u=this.createMarkerModelFromSeries(l,this,i),he(u,{mainType:this.mainType,seriesIndex:s.seriesIndex,name:s.name,createdBySelf:!0}),u.__hostSeries=s),eA(s)[o]=u},this)},e.prototype.formatTooltip=function(t,i,n){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return kr("section",{header:this.name,blocks:[kr("nameValue",{name:s,value:o,noName:!s,noValue:o==null})]})},e.prototype.getData=function(){return this._data},e.prototype.setData=function(t){this._data=t},e.getMarkerModelFromSeries=function(t,i){return eA(t)[i]},e.type="marker",e.dependencies=["series","grid","polar","geo"],e}(Nt);Cr(XK,Mv.prototype);var Ta=XK;var pbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markPoint",e.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},e}(Ta),YK=pbe;function E3(r){return!(isNaN(parseFloat(r.x))&&isNaN(parseFloat(r.y)))}function dbe(r){return!isNaN(parseFloat(r.x))&&!isNaN(parseFloat(r.y))}function tA(r,e,t,i,n,a){var o=[],s=ls(e,i),l=s?e.getCalculationInfo("stackResultDimension"):i,u=iA(e,l,r),c=e.indicesOfNearest(l,u)[0];o[n]=e.get(t,c),o[a]=e.get(l,c);var h=e.get(i,c),f=An(e.get(i,c));return f=Math.min(f,20),f>=0&&(o[a]=+o[a].toFixed(f)),[o,h]}var T3={min:ut(tA,"min"),max:ut(tA,"max"),average:ut(tA,"average"),median:ut(tA,"median")};function uf(r,e){if(e){var t=r.getData(),i=r.coordinateSystem,n=i&&i.dimensions;if(!dbe(e)&&!pe(e.coord)&&pe(n)){var a=A3(e,t,i,r);if(e=Qe(e),e.type&&T3[e.type]&&a.baseAxis&&a.valueAxis){var o=yt(n,a.baseAxis.dim),s=yt(n,a.valueAxis.dim),l=T3[e.type](t,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!pe(n))e.coord=[];else for(var u=e.coord,c=0;c<2;c++)T3[u[c]]&&(u[c]=iA(t,t.mapDimension(n[c]),u[c]));return e}}function A3(r,e,t,i){var n={};return r.valueIndex!=null||r.valueDim!=null?(n.valueDataDim=r.valueIndex!=null?e.getDimension(r.valueIndex):r.valueDim,n.valueAxis=t.getAxis(mbe(i,n.valueDataDim)),n.baseAxis=t.getOtherAxis(n.valueAxis),n.baseDataDim=e.mapDimension(n.baseAxis.dim)):(n.baseAxis=i.getBaseAxis(),n.valueAxis=t.getOtherAxis(n.baseAxis),n.baseDataDim=e.mapDimension(n.baseAxis.dim),n.valueDataDim=e.mapDimension(n.valueAxis.dim)),n}function mbe(r,e){var t=r.getData().getDimensionInfo(e);return t&&t.coordDim}function cf(r,e){return r&&r.containData&&e.coord&&!E3(e)?r.containData(e.coord):!0}function qK(r,e,t){return r&&r.containZone&&e.coord&&t.coord&&!E3(e)&&!E3(t)?r.containZone(e.coord,t.coord):!0}function rA(r,e){return r?function(t,i,n,a){var o=a<2?t.coord&&t.coord[a]:t.value;return Gs(o,e[a])}:function(t,i,n,a){return Gs(t.value,e[a])}}function iA(r,e,t){if(t==="average"){var i=0,n=0;return r.each(e,function(a,o){isNaN(a)||(i+=a,n++)}),i/n}else return t==="median"?r.getMedian(e):r.getDataExtent(e)[t==="max"?1:0]}var R3=xt(),vbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=ke()},e.prototype.render=function(t,i,n){var a=this,o=this.markerGroupMap;o.each(function(s){R3(s).keep=!1}),i.eachSeries(function(s){var l=Ta.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,i,n)}),o.each(function(s){!R3(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(t){R3(t).keep=!0},e.prototype.toggleBlurSeries=function(t,i){var n=this;N(t,function(a){var o=Ta.getMarkerModelFromSeries(a,n.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(i?Gw(l):Q_(l))})}})},e.type="marker",e}(ir),hg=vbe;function ZK(r,e,t){var i=e.coordinateSystem;r.each(function(n){var a=r.getItemModel(n),o,s=ze(a.get("x"),t.getWidth()),l=ze(a.get("y"),t.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(r.getValues(r.dimensions,n));else if(i){var u=r.get(i.dimensions[0],n),c=r.get(i.dimensions[1],n);o=i.dataToPoint([u,c])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),r.setItemLayout(n,o)})}var gbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=Ta.getMarkerModelFromSeries(a,"markPoint");o&&(ZK(o.getData(),a,n),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Cu),h=ybe(o,t,i);i.setData(h),ZK(i.getData(),t,a),h.each(function(f){var p=h.getItemModel(f),d=p.getShallow("symbol"),g=p.getShallow("symbolSize"),m=p.getShallow("symbolRotate"),v=p.getShallow("symbolOffset"),_=p.getShallow("symbolKeepAspect");if(He(d)||He(g)||He(m)||He(v)){var y=i.getRawValue(f),x=i.getDataParams(f);He(d)&&(d=d(y,x)),He(g)&&(g=g(y,x)),He(m)&&(m=m(y,x)),He(v)&&(v=v(y,x))}var M=p.getModel("itemStyle").getItemStyle(),S=Mu(l,"color");M.fill||(M.fill=S),h.setItemVisual(f,{symbol:d,symbolSize:g,symbolRotate:m,symbolOffset:v,symbolKeepAspect:_,style:M})}),c.updateData(h),this.group.add(c.group),h.eachItemGraphicEl(function(f){f.traverse(function(p){it(p).dataModel=i})}),this.markKeep(c),c.group.silent=i.get("silent")||t.get("silent")},e.type="markPoint",e}(hg);function ybe(r,e,t){var i;r?i=de(r&&r.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return he(he({},l),{name:s,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var n=new oi(i,t),a=de(t.get("data"),ut(uf,e));r&&(a=Yt(a,ut(cf,r)));var o=rA(!!r,i);return n.initData(a,null,o),n}var jK=gbe;function L3(r){r.registerComponentModel(YK),r.registerComponentView(jK),r.registerPreprocessor(function(e){wd(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var _be=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(Ta),KK=_be;var nA=xt(),xbe=function(r,e,t,i){var n=r.getData(),a;if(pe(i))a=i;else{var o=i.type;if(o==="min"||o==="max"||o==="average"||o==="median"||i.xAxis!=null||i.yAxis!=null){var s=void 0,l=void 0;if(i.yAxis!=null||i.xAxis!=null)s=e.getAxis(i.yAxis!=null?"y":"x"),l=Hr(i.yAxis,i.xAxis);else{var u=A3(i,n,e,r);s=u.valueAxis;var c=sT(n,u.valueDataDim);l=iA(n,c,o)}var h=s.dim==="x"?0:1,f=1-h,p=Qe(i),d={coord:[]};p.type=null,p.coord=[],p.coord[f]=-1/0,d.coord[f]=1/0;var g=t.get("precision");g>=0&&Dt(l)&&(l=+l.toFixed(Math.min(g,20))),p.coord[h]=d.coord[h]=l,a=[p,d,{type:o,valueIndex:i.valueIndex,value:l}]}else a=[]}var m=[uf(r,a[0]),uf(r,a[1]),he({},a[2])];return m[2].type=m[2].type||null,bt(m[2],m[0]),bt(m[2],m[1]),m};function aA(r){return!isNaN(r)&&!isFinite(r)}function JK(r,e,t,i){var n=1-r,a=i.dimensions[r];return aA(e[n])&&aA(t[n])&&e[r]===t[r]&&i.getAxis(a).containData(e[r])}function Sbe(r,e){if(r.type==="cartesian2d"){var t=e[0].coord,i=e[1].coord;if(t&&i&&(JK(1,t,i,r)||JK(0,t,i,r)))return!0}return cf(r,e[0])&&cf(r,e[1])}function D3(r,e,t,i,n){var a=i.coordinateSystem,o=r.getItemModel(e),s,l=ze(o.get("x"),n.getWidth()),u=ze(o.get("y"),n.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition)s=i.getMarkerPosition(r.getValues(r.dimensions,e));else{var c=a.dimensions,h=r.get(c[0],e),f=r.get(c[1],e);s=a.dataToPoint([h,f])}if(Ys(a,"cartesian2d")){var p=a.getAxis("x"),d=a.getAxis("y"),c=a.dimensions;aA(r.get(c[0],e))?s[0]=p.toGlobalCoord(p.getExtent()[t?0:1]):aA(r.get(c[1],e))&&(s[1]=d.toGlobalCoord(d.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}r.setItemLayout(e,s)}var Mbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=Ta.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=nA(o).from,u=nA(o).to;l.each(function(c){D3(l,c,!0,a,n),D3(u,c,!1,a,n)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Zv);this.group.add(c.group);var h=bbe(o,t,i),f=h.from,p=h.to,d=h.line;nA(i).from=f,nA(i).to=p,i.setData(d);var g=i.get("symbol"),m=i.get("symbolSize"),v=i.get("symbolRotate"),_=i.get("symbolOffset");pe(g)||(g=[g,g]),pe(m)||(m=[m,m]),pe(v)||(v=[v,v]),pe(_)||(_=[_,_]),h.from.each(function(x){y(f,x,!0),y(p,x,!1)}),d.each(function(x){var M=d.getItemModel(x).getModel("lineStyle").getLineStyle();d.setItemLayout(x,[f.getItemLayout(x),p.getItemLayout(x)]),M.stroke==null&&(M.stroke=f.getItemVisual(x,"style").fill),d.setItemVisual(x,{fromSymbolKeepAspect:f.getItemVisual(x,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(x,"symbolOffset"),fromSymbolRotate:f.getItemVisual(x,"symbolRotate"),fromSymbolSize:f.getItemVisual(x,"symbolSize"),fromSymbol:f.getItemVisual(x,"symbol"),toSymbolKeepAspect:p.getItemVisual(x,"symbolKeepAspect"),toSymbolOffset:p.getItemVisual(x,"symbolOffset"),toSymbolRotate:p.getItemVisual(x,"symbolRotate"),toSymbolSize:p.getItemVisual(x,"symbolSize"),toSymbol:p.getItemVisual(x,"symbol"),style:M})}),c.updateData(d),h.line.eachItemGraphicEl(function(x){it(x).dataModel=i,x.traverse(function(M){it(M).dataModel=i})});function y(x,M,S){var w=x.getItemModel(M);D3(x,M,S,t,a);var T=w.getModel("itemStyle").getItemStyle();T.fill==null&&(T.fill=Mu(l,"color")),x.setItemVisual(M,{symbolKeepAspect:w.get("symbolKeepAspect"),symbolOffset:mt(w.get("symbolOffset",!0),_[S?0:1]),symbolRotate:mt(w.get("symbolRotate",!0),v[S?0:1]),symbolSize:mt(w.get("symbolSize"),m[S?0:1]),symbol:mt(w.get("symbol",!0),g[S?0:1]),style:T})}this.markKeep(c),c.group.silent=i.get("silent")||t.get("silent")},e.type="markLine",e}(hg);function bbe(r,e,t){var i;r?i=de(r&&r.dimensions,function(u){var c=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return he(he({},c),{name:u,ordinalMeta:null})}):i=[{name:"value",type:"float"}];var n=new oi(i,t),a=new oi(i,t),o=new oi([],t),s=de(t.get("data"),ut(xbe,e,r,t));r&&(s=Yt(s,ut(Sbe,r)));var l=rA(!!r,i);return n.initData(de(s,function(u){return u[0]}),null,l),a.initData(de(s,function(u){return u[1]}),null,l),o.initData(de(s,function(u){return u[2]})),o.hasItemOption=!0,{from:n,to:a,line:o}}var $K=Mbe;function P3(r){r.registerComponentModel(KK),r.registerComponentView($K),r.registerPreprocessor(function(e){wd(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var wbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(Ta),QK=wbe;var oA=xt(),Tbe=function(r,e,t,i){var n=i[0],a=i[1];if(!(!n||!a)){var o=uf(r,n),s=uf(r,a),l=o.coord,u=s.coord;l[0]=Hr(l[0],-1/0),l[1]=Hr(l[1],-1/0),u[0]=Hr(u[0],1/0),u[1]=Hr(u[1],1/0);var c=Dm([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function sA(r){return!isNaN(r)&&!isFinite(r)}function eJ(r,e,t,i){var n=1-r;return sA(e[n])&&sA(t[n])}function Ebe(r,e){var t=e.coord[0],i=e.coord[1],n={coord:t,x:e.x0,y:e.y0},a={coord:i,x:e.x1,y:e.y1};return Ys(r,"cartesian2d")?t&&i&&(eJ(1,t,i,r)||eJ(0,t,i,r))?!0:qK(r,n,a):cf(r,n)||cf(r,a)}function tJ(r,e,t,i,n){var a=i.coordinateSystem,o=r.getItemModel(e),s,l=ze(o.get(t[0]),n.getWidth()),u=ze(o.get(t[1]),n.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(i.getMarkerPosition){var c=r.getValues(["x0","y0"],e),h=r.getValues(["x1","y1"],e),f=a.clampData(c),p=a.clampData(h),d=[];t[0]==="x0"?d[0]=f[0]>p[0]?h[0]:c[0]:d[0]=f[0]>p[0]?c[0]:h[0],t[1]==="y0"?d[1]=f[1]>p[1]?h[1]:c[1]:d[1]=f[1]>p[1]?c[1]:h[1],s=i.getMarkerPosition(d,t,!0)}else{var g=r.get(t[0],e),m=r.get(t[1],e),v=[g,m];a.clampData&&a.clampData(v,v),s=a.dataToPoint(v,!0)}if(Ys(a,"cartesian2d")){var _=a.getAxis("x"),y=a.getAxis("y"),g=r.get(t[0],e),m=r.get(t[1],e);sA(g)?s[0]=_.toGlobalCoord(_.getExtent()[t[0]==="x0"?0:1]):sA(m)&&(s[1]=y.toGlobalCoord(y.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var rJ=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],Abe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,i,n){i.eachSeries(function(a){var o=Ta.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=de(rJ,function(h){return tJ(s,l,h,a,n)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,i,n,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Ze});this.group.add(c.group),this.markKeep(c);var h=Cbe(o,t,i);i.setData(h),h.each(function(f){var p=de(rJ,function(T){return tJ(h,f,T,t,a)}),d=o.getAxis("x").scale,g=o.getAxis("y").scale,m=d.getExtent(),v=g.getExtent(),_=[d.parse(h.get("x0",f)),d.parse(h.get("x1",f))],y=[g.parse(h.get("y0",f)),g.parse(h.get("y1",f))];Ri(_),Ri(y);var x=!(m[0]>_[1]||m[1]<_[0]||v[0]>y[1]||v[1]<y[0]),M=!x;h.setItemLayout(f,{points:p,allClipped:M});var S=h.getItemModel(f).getModel("itemStyle").getItemStyle(),w=Mu(l,"color");S.fill||(S.fill=w,Ce(S.fill)&&(S.fill=Sp(S.fill,.4))),S.stroke||(S.stroke=w),h.setItemVisual(f,"style",S)}),h.diff(oA(c).data).add(function(f){var p=h.getItemLayout(f);if(!p.allClipped){var d=new ai({shape:{points:p.points}});h.setItemGraphicEl(f,d),c.group.add(d)}}).update(function(f,p){var d=oA(c).data.getItemGraphicEl(p),g=h.getItemLayout(f);g.allClipped?d&&c.group.remove(d):(d?Ut(d,{shape:{points:g.points}},i,f):d=new ai({shape:{points:g.points}}),h.setItemGraphicEl(f,d),c.group.add(d))}).remove(function(f){var p=oA(c).data.getItemGraphicEl(f);c.group.remove(p)}).execute(),h.eachItemGraphicEl(function(f,p){var d=h.getItemModel(p),g=h.getItemVisual(p,"style");f.useStyle(h.getItemVisual(p,"style")),Fr(f,Rr(d),{labelFetcher:i,labelDataIndex:p,defaultText:h.getName(p)||"",inheritColor:Ce(g.fill)?Sp(g.fill,1):"#000"}),Yr(f,d),sr(f,null,null,d.get(["emphasis","disabled"])),it(f).dataModel=i}),oA(c).data=h,c.group.silent=i.get("silent")||t.get("silent")},e.type="markArea",e}(hg);function Cbe(r,e,t){var i,n,a=["x0","y0","x1","y1"];if(r){var o=de(r&&r.dimensions,function(u){var c=e.getData(),h=c.getDimensionInfo(c.mapDimension(u))||{};return he(he({},h),{name:u,ordinalMeta:null})});n=de(a,function(u,c){return{name:u,type:o[c%2].type}}),i=new oi(n,t)}else n=[{name:"value",type:"float"}],i=new oi(n,t);var s=de(t.get("data"),ut(Tbe,e,r,t));r&&(s=Yt(s,ut(Ebe,r)));var l=r?function(u,c,h,f){var p=u.coord[Math.floor(f/2)][f%2];return Gs(p,n[f])}:function(u,c,h,f){return Gs(u.value,n[f])};return i.initData(s,null,l),i.hasItemOption=!0,i}var iJ=Abe;function I3(r){r.registerComponentModel(QK),r.registerComponentView(iJ),r.registerPreprocessor(function(e){wd(e.series,"markArea")&&(e.markArea=e.markArea||{})})}var Rbe=function(r,e){if(e==="all")return{type:"all",title:r.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:r.getLocaleModel().get(["legend","selector","inverse"])}},Lbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(t,i){r.prototype.mergeOption.call(this,t,i),this._updateSelector(t)},e.prototype._updateSelector=function(t){var i=t.selector,n=this.ecModel;i===!0&&(i=t.selector=["all","inverse"]),pe(i)&&N(i,function(a,o){Ce(a)&&(a={type:a}),i[o]=bt(a,Rbe(n,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&this.get("selectedMode")==="single"){for(var i=!1,n=0;n<t.length;n++){var a=t[n].get("name");if(this.isSelected(a)){this.select(a),i=!0;break}}!i&&this.select(t[0].get("name"))}},e.prototype._updateData=function(t){var i=[],n=[];t.eachRawSeries(function(l){var u=l.name;n.push(u);var c;if(l.legendVisualProvider){var h=l.legendVisualProvider,f=h.getAllNames();t.isSeriesFiltered(l)||(n=n.concat(f)),f.length?i=i.concat(f):c=!0}else c=!0;c&&$m(l)&&i.push(l.name)}),this._availableNames=n;var a=this.get("data")||i,o=ke(),s=de(a,function(l){return(Ce(l)||Dt(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new Jt(l,this,this.ecModel))},this);this._data=Yt(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(t){var i=this.option.selected,n=this.get("selectedMode");if(n==="single"){var a=this._data;N(a,function(o){i[o.get("name")]=!1})}i[t]=!0},e.prototype.unSelect=function(t){this.get("selectedMode")!=="single"&&(this.option.selected[t]=!1)},e.prototype.toggleSelected=function(t){var i=this.option.selected;i.hasOwnProperty(t)||(i[t]=!0),this[i[t]?"unSelect":"select"](t)},e.prototype.allSelect=function(){var t=this._data,i=this.option.selected;N(t,function(n){i[n.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var t=this._data,i=this.option.selected;N(t,function(n){var a=n.get("name",!0);i.hasOwnProperty(a)||(i[a]=!0),i[a]=!i[a]})},e.prototype.isSelected=function(t){var i=this.option.selected;return!(i.hasOwnProperty(t)&&!i[t])&&yt(this._availableNames,t)>=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Nt),RS=Lbe;var fg=ut,N3=N,lA=Ze,Dbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new lA),this.group.add(this._selectorGroup=new lA),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var o=t.get("align"),s=t.get("orient");(!o||o==="auto")&&(o=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,t,i,n,l,s,u);var c=t.getBoxLayoutParams(),h={width:n.getWidth(),height:n.getHeight()},f=t.get("padding"),p=br(c,h,f),d=this.layoutInner(t,o,p,a,l,u),g=br(Ye({width:d.width,height:d.height},c),h,f);this.group.x=g.x-d.x,this.group.y=g.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=qE(d,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,i,n,a,o,s,l){var u=this.getContentGroup(),c=ke(),h=i.get("selectedMode"),f=[];n.eachRawSeries(function(p){!p.get("legendHoverLink")&&f.push(p.id)}),N3(i.getData(),function(p,d){var g=p.get("name");if(!this.newlineDisabled&&(g===""||g===`
  2229. `)){var m=new lA;m.newline=!0,u.add(m);return}var v=n.getSeriesByName(g)[0];if(!c.get(g))if(v){var _=v.getData(),y=_.getVisual("legendLineStyle")||{},x=_.getVisual("legendIcon"),M=_.getVisual("style"),S=this._createItem(v,g,d,p,i,t,y,M,x,h,a);S.on("click",fg(nJ,g,null,a,f)).on("mouseover",fg(U3,v.name,null,a,f)).on("mouseout",fg(O3,v.name,null,a,f)),n.ssr&&S.eachChild(function(w){var T=it(w);T.seriesIndex=v.seriesIndex,T.dataIndex=d,T.ssrType="legend"}),c.set(g,!0)}else n.eachRawSeries(function(w){if(!c.get(g)&&w.legendVisualProvider){var T=w.legendVisualProvider;if(!T.containName(g))return;var C=T.indexOfName(g),b=T.getItemVisual(C,"style"),E=T.getItemVisual(C,"legendIcon"),I=pn(b.fill);I&&I[3]===0&&(I[3]=.2,b=he(he({},b),{fill:Ns(I,"rgba")}));var R=this._createItem(w,g,d,p,i,t,{},b,E,h,a);R.on("click",fg(nJ,null,g,a,f)).on("mouseover",fg(U3,null,g,a,f)).on("mouseout",fg(O3,null,g,a,f)),n.ssr&&R.eachChild(function(A){var P=it(A);P.seriesIndex=w.seriesIndex,P.dataIndex=d,P.ssrType="legend"}),c.set(g,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},e.prototype._createSelector=function(t,i,n,a,o){var s=this.getSelectorGroup();N3(t,function(u){var c=u.type,h=new It({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(h);var f=i.getModel("selectorLabel"),p=i.getModel(["emphasis","selectorLabel"]);Fr(h,{normal:f,emphasis:p},{defaultText:u.title}),yu(h)})},e.prototype._createItem=function(t,i,n,a,o,s,l,u,c,h,f){var p=t.visualDrawType,d=o.get("itemWidth"),g=o.get("itemHeight"),m=o.isSelected(i),v=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),y=a.get("icon");c=y||c||"roundRect";var x=Pbe(c,a,l,u,p,m,f),M=new lA,S=a.getModel("textStyle");if(He(t.getLegendIcon)&&(!y||y==="inherit"))M.add(t.getLegendIcon({itemWidth:d,itemHeight:g,icon:c,iconRotate:v,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}));else{var w=y==="inherit"&&t.getData().getVisual("symbol")?v==="inherit"?t.getData().getVisual("symbolRotate"):v:0;M.add(Ibe({itemWidth:d,itemHeight:g,icon:c,iconRotate:w,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}))}var T=s==="left"?d+5:-5,C=s,b=o.get("formatter"),E=i;Ce(b)&&b?E=b.replace("{name}",i??""):He(b)&&(E=b(i));var I=m?S.getTextColor():a.get("inactiveColor");M.add(new It({style:pr(S,{text:E,x:T,y:g/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var R=new Rt({shape:M.getBoundingRect(),style:{fill:"transparent"}}),A=a.getModel("tooltip");return A.get("show")&&El({el:R,componentModel:o,itemName:i,itemTooltipOption:A.option}),M.add(R),M.eachChild(function(P){P.silent=!0}),R.silent=!h,this.getContentGroup().add(M),yu(M),M.__legendDataIndex=n,M},e.prototype.layoutInner=function(t,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Rl(t.get("orient"),l,t.get("itemGap"),n.width,n.height);var c=l.getBoundingRect(),h=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){Rl("horizontal",u,t.get("selectorItemGap",!0));var f=u.getBoundingRect(),p=[-f.x,-f.y],d=t.get("selectorButtonGap",!0),g=t.getOrient().index,m=g===0?"width":"height",v=g===0?"height":"width",_=g===0?"y":"x";s==="end"?p[g]+=c[m]+d:h[g]+=f[m]+d,p[1-g]+=c[v]/2-f[v]/2,u.x=p[0],u.y=p[1],l.x=h[0],l.y=h[1];var y={x:0,y:0};return y[m]=c[m]+d+f[m],y[v]=Math.max(c[v],f[v]),y[_]=Math.min(0,f[_]+p[1-g]),y}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(ir);function Pbe(r,e,t,i,n,a,o){function s(m,v){m.lineWidth==="auto"&&(m.lineWidth=v.lineWidth>0?2:0),N3(m,function(_,y){m[y]==="inherit"&&(m[y]=v[y])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=r.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?i.decal:Il(h,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[c]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:t).opacity),s(u,i);var f=e.getModel("lineStyle"),p=f.getLineStyle();if(s(p,t),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),p.stroke==="auto"&&(p.stroke=i.fill),!a){var d=e.get("inactiveBorderWidth"),g=u[c];u.lineWidth=d==="auto"?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=f.get("inactiveColor"),p.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}function Ibe(r){var e=r.icon||"roundRect",t=wr(e,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return t.setStyle(r.itemStyle),t.rotation=(r.iconRotate||0)*Math.PI/180,t.setOrigin([r.itemWidth/2,r.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function nJ(r,e,t,i){O3(r,e,t,i),t.dispatchAction({type:"legendToggleSelect",name:r??e}),U3(r,e,t,i)}function aJ(r){for(var e=r.getZr().storage.getDisplayList(),t,i=0,n=e.length;i<n&&!(t=e[i].states.emphasis);)i++;return t&&t.hoverLayer}function U3(r,e,t,i){aJ(t)||t.dispatchAction({type:"highlight",seriesName:r,name:e,excludeSeriesId:i})}function O3(r,e,t,i){aJ(t)||t.dispatchAction({type:"downplay",seriesName:r,name:e,excludeSeriesId:i})}var uA=Dbe;function z3(r){var e=r.findComponents({mainType:"legend"});e&&e.length&&r.filterSeries(function(t){for(var i=0;i<e.length;i++)if(!e[i].isSelected(t.name))return!1;return!0})}function LS(r,e,t){var i={},n=r==="toggleSelected",a;return t.eachComponent("legend",function(o){n&&a!=null?o[a?"select":"unSelect"](e.name):r==="allSelect"||r==="inverseSelect"?o[r]():(o[r](e.name),a=o.isSelected(e.name));var s=o.getData();N(s,function(l){var u=l.get("name");if(!(u===`
  2230. `||u==="")){var c=o.isSelected(u);i.hasOwnProperty(u)?i[u]=i[u]&&c:i[u]=c}})}),r==="allSelect"||r==="inverseSelect"?{selected:i}:{name:e.name,selected:i}}function oJ(r){r.registerAction("legendToggleSelect","legendselectchanged",ut(LS,"toggleSelected")),r.registerAction("legendAllSelect","legendselectall",ut(LS,"allSelect")),r.registerAction("legendInverseSelect","legendinverseselect",ut(LS,"inverseSelect")),r.registerAction("legendSelect","legendselected",ut(LS,"select")),r.registerAction("legendUnSelect","legendunselected",ut(LS,"unSelect"))}function cA(r){r.registerComponentModel(RS),r.registerComponentView(uA),r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER,z3),r.registerSubTypeDefaulter("legend",function(){return"plain"}),oJ(r)}var Nbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(t,i,n){var a=ks(t);r.prototype.init.call(this,t,i,n),sJ(this,t,a)},e.prototype.mergeOption=function(t,i){r.prototype.mergeOption.call(this,t,i),sJ(this,this.option,t)},e.type="legend.scroll",e.defaultOption=$n(RS.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(RS);function sJ(r,e,t){var i=r.getOrient(),n=[1,1];n[i.index]=0,Eo(e,t,{type:"box",ignoreSize:!!n})}var lJ=Nbe;var uJ=Ze,F3=["width","height"],B3=["x","y"],Ube=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!0,t._currentIndex=0,t}return e.prototype.init=function(){r.prototype.init.call(this),this.group.add(this._containerGroup=new uJ),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new uJ)},e.prototype.resetInner=function(){r.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(t,i,n,a,o,s,l){var u=this;r.prototype.renderInner.call(this,t,i,n,a,o,s,l);var c=this._controllerGroup,h=i.get("pageIconSize",!0),f=pe(h)?h:[h,h];d("pagePrev",0);var p=i.getModel("pageTextStyle");c.add(new It({name:"pageText",style:{text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),d("pageNext",1);function d(g,m){var v=g+"DataIndex",_=pc(i.get("pageIcons",!0)[i.getOrient().name][m],{onclick:Be(u._pageGo,u,v,i,a)},{x:-f[0]/2,y:-f[1]/2,width:f[0],height:f[1]});_.name=g,c.add(_)}},e.prototype.layoutInner=function(t,i,n,a,o,s){var l=this.getSelectorGroup(),u=t.getOrient().index,c=F3[u],h=B3[u],f=F3[1-u],p=B3[1-u];o&&Rl("horizontal",l,t.get("selectorItemGap",!0));var d=t.get("selectorButtonGap",!0),g=l.getBoundingRect(),m=[-g.x,-g.y],v=Qe(n);o&&(v[c]=n[c]-g[c]-d);var _=this._layoutContentAndController(t,a,v,u,c,f,p,h);if(o){if(s==="end")m[u]+=_[c]+d;else{var y=g[c]+d;m[u]-=y,_[h]-=y}_[c]+=g[c]+d,m[1-u]+=_[p]+_[f]/2-g[f]/2,_[f]=Math.max(_[f],g[f]),_[p]=Math.min(_[p],g[p]+m[1-u]),l.x=m[0],l.y=m[1],l.markRedraw()}return _},e.prototype._layoutContentAndController=function(t,i,n,a,o,s,l,u){var c=this.getContentGroup(),h=this._containerGroup,f=this._controllerGroup;Rl(t.get("orient"),c,t.get("itemGap"),a?n.width:null,a?null:n.height),Rl("horizontal",f,t.get("pageButtonItemGap",!0));var p=c.getBoundingRect(),d=f.getBoundingRect(),g=this._showController=p[o]>n[o],m=[-p.x,-p.y];i||(m[a]=c[u]);var v=[0,0],_=[-d.x,-d.y],y=mt(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(g){var x=t.get("pageButtonPosition",!0);x==="end"?_[a]+=n[o]-d[o]:v[a]+=d[o]+y}_[1-a]+=p[s]/2-d[s]/2,c.setPosition(m),h.setPosition(v),f.setPosition(_);var M={x:0,y:0};if(M[o]=g?n[o]:p[o],M[s]=Math.max(p[s],d[s]),M[l]=Math.min(0,d[l]+_[1-a]),h.__rectSize=n[o],g){var S={x:0,y:0};S[o]=Math.max(n[o]-d[o]-y,0),S[s]=M[s],h.setClipPath(new Rt({shape:S})),h.__rectSize=S[o]}else f.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var w=this._getPageInfo(t);return w.pageIndex!=null&&Ut(c,{x:w.contentPosition[0],y:w.contentPosition[1]},g?t:null),this._updatePageInfoView(t,w),M},e.prototype._pageGo=function(t,i,n){var a=this._getPageInfo(i)[t];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},e.prototype._updatePageInfoView=function(t,i){var n=this._controllerGroup;N(["pagePrev","pageNext"],function(c){var h=c+"DataIndex",f=i[h]!=null,p=n.childOfName(c);p&&(p.setStyle("fill",f?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),p.cursor=f?"pointer":"default")});var a=n.childOfName("pageText"),o=t.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",Ce(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var i=t.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=t.getOrient().index,s=F3[o],l=B3[o],u=this._findTargetItemIndex(i),c=n.children(),h=c[u],f=c.length,p=f?1:0,d={contentPosition:[n.x,n.y],pageCount:p,pageIndex:p-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return d;var g=x(h);d.contentPosition[o]=-g.s;for(var m=u+1,v=g,_=g,y=null;m<=f;++m)y=x(c[m]),(!y&&_.e>v.s+a||y&&!M(y,v.s))&&(_.i>v.i?v=_:v=y,v&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=v.i),++d.pageCount)),_=y;for(var m=u-1,v=g,_=g,y=null;m>=-1;--m)y=x(c[m]),(!y||!M(_,y.s))&&v.i<_.i&&(_=v,d.pagePrevDataIndex==null&&(d.pagePrevDataIndex=v.i),++d.pageCount,++d.pageIndex),v=y;return d;function x(S){if(S){var w=S.getBoundingRect(),T=w[l]+S[l];return{s:T,e:T+w[s],i:S.__legendDataIndex}}}function M(S,w){return S.e>=w&&S.s<=w+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===t&&(i=s)}),i??a},e.type="legend.scroll",e}(uA),cJ=Ube;function k3(r){r.registerAction("legendScroll","legendscroll",function(e,t){var i=e.scrollDataIndex;i!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(n){n.setScrollDataIndex(i)})})}function hJ(r){Ot(cA),r.registerComponentModel(lJ),r.registerComponentView(cJ),k3(r)}function V3(r){Ot(cA),Ot(hJ)}var Obe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=$n(of.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(of),fJ=Obe;var G3=xt();function pJ(r,e,t){G3(r).coordSysRecordMap.each(function(i){var n=i.dataZoomInfoMap.get(e.uid);n&&(n.getRange=t)})}function dJ(r,e){for(var t=G3(r).coordSysRecordMap,i=t.keys(),n=0;n<i.length;n++){var a=i[n],o=t.get(a),s=o.dataZoomInfoMap;if(s){var l=e.uid,u=s.get(l);u&&(s.removeKey(l),s.keys().length||mJ(t,o))}}}function mJ(r,e){if(e){r.removeKey(e.model.uid);var t=e.controller;t&&t.dispose()}}function zbe(r,e){var t={model:e,containsPoint:ut(Bbe,e),dispatchAction:ut(Fbe,r),dataZoomInfoMap:null,controller:null},i=t.controller=new Pu(r.getZr());return N(["pan","zoom","scrollMove"],function(n){i.on(n,function(a){var o=[];t.dataZoomInfoMap.each(function(s){if(a.isAvailableBehavior(s.model.option)){var l=(s.getRange||{})[n],u=l&&l(s.dzReferCoordSysInfo,t.model.mainType,t.controller,a);!s.model.get("disabled",!0)&&u&&o.push({dataZoomId:s.model.id,start:u[0],end:u[1]})}}),o.length&&t.dispatchAction(o)})}),t}function Fbe(r,e){r.isDisposed()||r.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function Bbe(r,e,t,i){return r.coordinateSystem.containPoint([t,i])}function kbe(r){var e,t="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},n=!0;return r.each(function(a){var o=a.model,s=o.get("disabled",!0)?!1:o.get("zoomLock",!0)?"move":!0;i[t+s]>i[t+e]&&(e=s),n=n&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}function vJ(r){r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,function(e,t){var i=G3(t),n=i.coordSysRecordMap||(i.coordSysRecordMap=ke());n.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=XE(a);N(o.infoList,function(s){var l=s.model.uid,u=n.get(l)||n.set(l,zbe(t,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=ke());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),n.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){mJ(n,a);return}var c=kbe(l);o.enable(c.controlType,c.opt),o.setPointerChecker(a.containsPoint),Hs(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Gbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,i,n){if(r.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),pJ(n,t,{pan:Be(H3.pan,this),zoom:Be(H3.zoom,this),scrollMove:Be(H3.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){dJ(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(lg),H3={zoom:function(r,e,t,i){var n=this.range,a=n.slice(),o=r.axisModels[0];if(o){var s=W3[e](null,[i.originX,i.originY],o,t,r),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Io(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,n[0]!==a[0]||n[1]!==a[1])return a}},pan:gJ(function(r,e,t,i,n,a){var o=W3[i]([a.oldX,a.oldY],[a.newX,a.newY],e,n,t);return o.signal*(r[1]-r[0])*o.pixel/o.pixelLength}),scrollMove:gJ(function(r,e,t,i,n,a){var o=W3[i]([0,0],[a.scrollDelta,a.scrollDelta],e,n,t);return o.signal*(r[1]-r[0])*a.scrollDelta})};function gJ(r){return function(e,t,i,n){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=r(o,s,e,t,i,n);if(Io(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var W3={grid:function(r,e,t,i,n){var a=t.axis,o={},s=n.model.coordinateSystem.getRect();return r=r||[0,0],a.dim==="x"?(o.pixel=e[0]-r[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(r,e,t,i,n){var a=t.axis,o={},s=n.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return r=r?s.pointToCoord(r):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-r[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(r,e,t,i,n){var a=t.axis,o=n.model.coordinateSystem.getRect(),s={};return r=r||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-r[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-r[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},yJ=Gbe;function DS(r){Md(r),r.registerComponentModel(fJ),r.registerComponentView(yJ),vJ(r)}var Hbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=$n(of.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(of),_J=Hbe;var PS=Rt,xJ=7,Wbe=1,X3=30,Xbe=7,IS="horizontal",SJ="vertical",Ybe=5,qbe=["line","bar","candlestick","scatter"],Zbe={easing:"cubicOut",duration:100,delay:0},jbe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,i){this.api=i,this._onBrush=Be(this._onBrush,this),this._onBrushEnd=Be(this._onBrushEnd,this)},e.prototype.render=function(t,i,n,a){if(r.prototype.render.apply(this,arguments),Hs(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){xc(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var i=this._displayables.sliderGroup=new Ze;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(i),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,i=this.api,n=t.get("brushSelect"),a=n?Xbe:0,o=this._findCoordRect(),s={width:i.getWidth(),height:i.getHeight()},l=this._orient===IS?{right:s.width-o.x-o.width,top:s.height-X3-xJ-a,width:o.width,height:X3}:{right:xJ,top:o.y,width:X3,height:o.height},u=ks(t.option);N(["right","top","width","height"],function(h){u[h]==="ph"&&(u[h]=l[h])});var c=br(u,s);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===SJ&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,i=this._location,n=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(n===IS&&!o?{scaleY:l?1:-1,scaleX:1}:n===IS&&o?{scaleY:l?1:-1,scaleX:-1}:n===SJ&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=i.x-u.x,t.y=i.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,i=this._size,n=this._displayables.sliderGroup,a=t.get("brushSelect");n.add(new PS({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new PS({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:Be(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),n.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var i=this._size,n=this._shadowSize||[],a=t.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||i[0]!==n[0]||i[1]!==n[1]){var h=o.getDataExtent(l),f=(h[1]-h[0])*.3;h=[h[0]-f,h[1]+f];var p=[0,i[1]],d=[0,i[0]],g=[[i[0],0],[0,0]],m=[],v=d[1]/(o.count()-1),_=0,y=Math.round(o.count()/i[0]),x;o.each([l],function(C,b){if(y>0&&b%y){_+=v;return}var E=C==null||isNaN(C)||C==="",I=E?0:ar(C,h,p,!0);E&&!x&&b?(g.push([g[g.length-1][0],0]),m.push([m[m.length-1][0],0])):!E&&x&&(g.push([_,0]),m.push([_,0])),g.push([_,I]),m.push([_,I]),_+=v,x=E}),u=this._shadowPolygonPts=g,c=this._shadowPolylinePts=m}this._shadowData=o,this._shadowDim=l,this._shadowSize=[i[0],i[1]];var M=this.dataZoomModel;function S(C){var b=M.getModel(C?"selectedDataBackground":"dataBackground"),E=new Ze,I=new ai({shape:{points:u},segmentIgnoreThreshold:1,style:b.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),R=new ri({shape:{points:c},segmentIgnoreThreshold:1,style:b.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return E.add(I),E.add(R),E}for(var w=0;w<3;w++){var T=S(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,i=t.get("showDataShadow");if(i!==!1){var n,a=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();N(l,function(u){if(!n&&!(i!==!0&&yt(qbe,u.get("type"))<0)){var c=a.getComponent($s(o),s).axis,h=Kbe(o),f,p=u.coordinateSystem;h!=null&&p.getOtherAxis&&(f=p.getOtherAxis(c).inverse),h=u.getData().mapDimension(h),n={thisAxis:c,series:u,thisDim:o,otherDim:h,otherAxisInverse:f}}},this)},this),n}},e.prototype._renderHandle=function(){var t=this.group,i=this._displayables,n=i.handles=[null,null],a=i.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,h=l.get("brushSelect"),f=i.filler=new PS({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new PS({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:Wbe,fill:"rgba(0,0,0,0)"}})),N([0,1],function(y){var x=l.get("handleIcon");!Lx[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var M=wr(x,-1,0,2,2,null,!0);M.attr({cursor:MJ(this._orient),draggable:!0,drift:Be(this._onDragMove,this,y),ondragend:Be(this._onDragEnd,this),onmouseover:Be(this._showDataInfo,this,!0),onmouseout:Be(this._showDataInfo,this,!1),z2:5});var S=M.getBoundingRect(),w=l.get("handleSize");this._handleHeight=ze(w,this._size[1]),this._handleWidth=S.width/S.height*this._handleHeight,M.setStyle(l.getModel("handleStyle").getItemStyle()),M.style.strokeNoScale=!0,M.rectHover=!0,M.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),yu(M);var T=l.get("handleColor");T!=null&&(M.style.fill=T),o.add(n[y]=M);var C=l.getModel("textStyle");t.add(a[y]=new It({silent:!0,invisible:!0,style:pr(C,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:C.getTextColor(),font:C.getFont()}),z2:10}))},this);var p=f;if(h){var d=ze(l.get("moveHandleSize"),s[1]),g=i.moveHandle=new Rt({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:d}}),m=d*.8,v=i.moveHandleIcon=wr(l.get("moveHandleIcon"),-m/2,-m/2,m,m,"#fff",!0);v.silent=!0,v.y=s[1]+d/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(d,10));p=i.moveZone=new Rt({invisible:!0,shape:{y:s[1]-_,height:d+_}}),p.on("mouseover",function(){u.enterEmphasis(g)}).on("mouseout",function(){u.leaveEmphasis(g)}),o.add(g),o.add(v),o.add(p)}p.attr({draggable:!0,cursor:MJ(this._orient),drift:Be(this._onDragMove,this,"all"),ondragstart:Be(this._showDataInfo,this,!0),ondragend:Be(this._onDragEnd,this),onmouseover:Be(this._showDataInfo,this,!0),onmouseout:Be(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[ar(t[0],[0,100],i,!0),ar(t[1],[0,100],i,!0)]},e.prototype._updateInterval=function(t,i){var n=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=n.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Io(i,a,o,n.get("zoomLock")?"all":t,s.minSpan!=null?ar(s.minSpan,l,o,!0):null,s.maxSpan!=null?ar(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Ri([ar(a[0],o,l,!0),ar(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},e.prototype._updateView=function(t){var i=this._displayables,n=this._handleEnds,a=Ri(n.slice()),o=this._size;N([0,1],function(p){var d=i.handles[p],g=this._handleHeight;d.attr({scaleX:g/2,scaleY:g/2,x:n[p]+(p?-1:1),y:o[1]/2-g/2})},this),i.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};i.moveHandle&&(i.moveHandle.setShape(s),i.moveZone.setShape(s),i.moveZone.getBoundingRect(),i.moveHandleIcon&&i.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=i.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;c<l.length;c++){var h=l[c],f=h.getClipPath();f||(f=new Rt,h.setClipPath(f)),f.setShape({x:u[c],y:0,width:u[c+1]-u[c],height:o[1]})}this._updateDataInfo(t)},e.prototype._updateDataInfo=function(t){var i=this.dataZoomModel,n=this._displayables,a=n.handleLabels,o=this._orient,s=["",""];if(i.get("showDetail")){var l=i.findRepresentativeAxisProxy();if(l){var u=l.getAxisModel().axis,c=this._range,h=t?l.calculateDataWindow({start:c[0],end:c[1]}).valueWindow:l.getDataValueWindow();s=[this._formatLabel(h[0],u),this._formatLabel(h[1],u)]}}var f=Ri(this._handleEnds.slice());p.call(this,0),p.call(this,1);function p(d){var g=Tl(n.handles[d].parent,this.group),m=Yp(d===0?"right":"left",g),v=this._handleWidth/2+Ybe,_=Ln([f[d]+(d===0?-v:v),this._size[1]/2],g);a[d].setStyle({x:_[0],y:_[1],verticalAlign:o===IS?"middle":m,align:o===IS?m:"center",text:s[d]})}},e.prototype._formatLabel=function(t,i){var n=this.dataZoomModel,a=n.get("labelFormatter"),o=n.get("labelPrecision");(o==null||o==="auto")&&(o=i.getPixelPrecision());var s=t==null||isNaN(t)?"":i.type==="category"||i.type==="time"?i.scale.getLabel({value:Math.round(t)}):t.toFixed(Math.min(o,20));return He(a)?a(t,s):Ce(a)?a.replace("{value}",s):s},e.prototype._showDataInfo=function(t){t=this._dragging||t;var i=this._displayables,n=i.handleLabels;n[0].attr("invisible",!t),n[1].attr("invisible",!t),i.moveHandle&&this.api[t?"enterEmphasis":"leaveEmphasis"](i.moveHandle,1)},e.prototype._onDragMove=function(t,i,n,a){this._dragging=!0,po(a.event);var o=this._displayables.sliderGroup.getLocalTransform(),s=Ln([i,n],o,!0),l=this._updateInterval(t,s[0]),u=this.dataZoomModel.get("realtime");this._updateView(!u),l&&u&&this._dispatchZoomAction(!0)},e.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1);var t=this.dataZoomModel.get("realtime");!t&&this._dispatchZoomAction(!1)},e.prototype._onClickPanel=function(t){var i=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(n[0]<0||n[0]>i[0]||n[1]<0||n[1]>i[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",n[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var i=t.offsetX,n=t.offsetY;this._brushStart=new zt(i,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var i=this._displayables.brushRect;if(this._brushing=!1,!!i){i.attr("ignore",!0);var n=i.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(n.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Ri([ar(n.x,o,s,!0),ar(n.x+n.width,o,s,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(po(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,i){var n=this._displayables,a=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new PS({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,i),c=l.transformCoordToLocal(s.x,s.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:h[1]})},e.prototype._dispatchZoomAction=function(t){var i=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?Zbe:null,start:i[0],end:i[1]})},e.prototype._findCoordRect=function(){var t,i=XE(this.dataZoomModel).infoList;if(!t&&i.length){var n=i[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var a=this.api.getWidth(),o=this.api.getHeight();t={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(lg);function Kbe(r){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[r]}function MJ(r){return r==="vertical"?"ns-resize":"ew-resize"}var bJ=jbe;function NS(r){r.registerComponentModel(_J),r.registerComponentView(bJ),Md(r)}function Y3(r){Ot(DS),Ot(NS)}var Jbe={get:function(r,e,t){var i=Qe(($be[r]||{})[e]);return t&&pe(i)?i[i.length-1]:i}},$be={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},hA=Jbe;var wJ=gi.mapVisual,Qbe=gi.eachVisual,ewe=pe,TJ=N,twe=Ri,rwe=ar,iwe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,i,n){this.mergeDefaultAndTheme(t,n)},e.prototype.optionUpdated=function(t,i){var n=this.option;!i&&JE(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var i=this.stateList;t=Be(t,this),this.controllerVisuals=AS(this.option.controller,i,t),this.targetVisuals=AS(this.option.target,i,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,i=[];return t==null||t==="all"?this.ecModel.eachSeries(function(n,a){i.push(a)}):i=tr(t),i},e.prototype.eachTargetSeries=function(t,i){N(this.getTargetSeriesIndices(),function(n){var a=this.ecModel.getSeriesByIndex(n);a&&t.call(i,a)},this)},e.prototype.isTargetSeries=function(t){var i=!1;return this.eachTargetSeries(function(n){n===t&&(i=!0)}),i},e.prototype.formatValueText=function(t,i,n){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;n=n||["<",">"],pe(t)&&(t=t.slice(),u=!0);var c=i?t:u?[h(t[0]),h(t[1])]:h(t);if(Ce(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(He(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?n[0]+" "+c[1]:t[1]===s[1]?n[1]+" "+c[0]:c[0]+" - "+c[1];return c;function h(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,i=twe([t.min,t.max]);this._dataExtent=i},e.prototype.getDataDimensionIndex=function(t){var i=this.option.dimension;if(i!=null)return t.getDimensionIndex(i);for(var n=t.dimensions,a=n.length-1;a>=0;a--){var o=n[a],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,i=this.option,n={inRange:i.inRange,outOfRange:i.outOfRange},a=i.target||(i.target={}),o=i.controller||(i.controller={});bt(a,n),bt(o,n);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(h){ewe(i.color)&&!h.inRange&&(h.inRange={color:i.color.slice().reverse()}),h.inRange=h.inRange||{color:t.get("gradientColor")}}function u(h,f,p){var d=h[f],g=h[p];d&&!g&&(g=h[p]={},TJ(d,function(m,v){if(gi.isValidType(v)){var _=hA.get(v,"inactive",s);_!=null&&(g[v]=_,v==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function c(h){var f=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,p=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,d=this.get("inactiveColor"),g=this.getItemSymbol(),m=g||"roundRect";TJ(this.stateList,function(v){var _=this.itemSize,y=h[v];y||(y=h[v]={color:s?d:[d]}),y.symbol==null&&(y.symbol=f&&Qe(f)||(s?m:[m])),y.symbolSize==null&&(y.symbolSize=p&&Qe(p)||(s?_[0]:[_[0],_[0]])),y.symbol=wJ(y.symbol,function(S){return S==="none"?m:S});var x=y.symbolSize;if(x!=null){var M=-1/0;Qbe(x,function(S){S>M&&(M=S)}),y.symbolSize=wJ(x,function(S){return rwe(S,[0,M],[0,_[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Nt),pg=iwe;var EJ=[20,140],nwe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(n){n.mappingMethod="linear",n.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=EJ[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=EJ[1])},e.prototype._resetRange=function(){var t=this.getExtent(),i=this.option.range;!i||i.auto?(t.auto=1,this.option.range=t):pe(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],t[0]),i[1]=Math.min(i[1],t[1]))},e.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),N(this.stateList,function(t){var i=this.option.controller[t].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),i=Ri((this.get("range")||[]).slice());return i[0]>t[1]&&(i[0]=t[1]),i[1]>t[1]&&(i[1]=t[1]),i[0]<t[0]&&(i[0]=t[0]),i[1]<t[0]&&(i[1]=t[0]),i},e.prototype.getValueState=function(t){var i=this.option.range,n=this.getExtent();return(i[0]<=n[0]||i[0]<=t)&&(i[1]>=n[1]||t<=i[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var i=[];return this.eachTargetSeries(function(n){var a=[],o=n.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&a.push(l)},this),i.push({seriesId:n.id,dataIndex:a})},this),i},e.prototype.getVisualMeta=function(t){var i=AJ(this,"outOfRange",this.getExtent()),n=AJ(this,"inRange",this.option.range.slice()),a=[];function o(p,d){a.push({value:p,color:t(p,d)})}for(var s=0,l=0,u=n.length,c=i.length;l<c&&(!n.length||i[l]<=n[0]);l++)i[l]<n[s]&&o(i[l],"outOfRange");for(var h=1;s<u;s++,h=0)h&&a.length&&o(n[s],"outOfRange"),o(n[s],"inRange");for(var h=1;l<c;l++)(!n.length||n[n.length-1]<i[l])&&(h&&(a.length&&o(a[a.length-1].value,"outOfRange"),h=0),o(i[l],"outOfRange"));var f=a.length;return{stops:a,outerColors:[f?a[0].color:"transparent",f?a[f-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=$n(pg.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(pg);function AJ(r,e,t){if(t[0]===t[1])return t.slice();for(var i=200,n=(t[1]-t[0])/i,a=t[0],o=[],s=0;s<=i&&a<t[1];s++)o.push(a),a+=n;return o.push(t[1]),o}var CJ=nwe;var awe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.autoPositionValues={left:1,right:1,top:1,bottom:1},t}return e.prototype.init=function(t,i){this.ecModel=t,this.api=i},e.prototype.render=function(t,i,n,a){if(this.visualMapModel=t,t.get("show")===!1){this.group.removeAll();return}this.doRender(t,i,n,a)},e.prototype.renderBackground=function(t){var i=this.visualMapModel,n=Al(i.get("padding")||0),a=t.getBoundingRect();t.add(new Rt({z2:-1,silent:!0,shape:{x:a.x-n[3],y:a.y-n[0],width:a.width+n[3]+n[1],height:a.height+n[0]+n[2]},style:{fill:i.get("backgroundColor"),stroke:i.get("borderColor"),lineWidth:i.get("borderWidth")}}))},e.prototype.getControllerVisual=function(t,i,n){n=n||{};var a=n.forceState,o=this.visualMapModel,s={};if(i==="color"){var l=o.get("contentColor");s.color=l}function u(p){return s[p]}function c(p,d){s[p]=d}var h=o.controllerVisuals[a||o.getValueState(t)],f=gi.prepareVisualTypes(h);return N(f,function(p){var d=h[p];n.convertOpacityToAlpha&&p==="opacity"&&(p="colorAlpha",d=h.__alphaForOpacity),gi.dependsOn(p,i)&&d&&d.applyVisual(t,u,c)}),s[i]},e.prototype.positionGroup=function(t){var i=this.visualMapModel,n=this.api;Ih(t,i.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},e.prototype.doRender=function(t,i,n,a){},e.type="visualMap",e}(ir),fA=awe;var RJ=[["left","right","width"],["top","bottom","height"]];function pA(r,e,t){var i=r.option,n=i.align;if(n!=null&&n!=="auto")return n;for(var a={width:e.getWidth(),height:e.getHeight()},o=i.orient==="horizontal"?1:0,s=RJ[o],l=[0,null,10],u={},c=0;c<3;c++)u[RJ[1-o][c]]=l[c],u[s[c]]=c===2?t[0]:i[s[c]];var h=[["x","width",3],["y","height",0]][o],f=br(u,a,i.padding);return s[(f.margin[h[2]]||0)+f[h[0]]+f[h[1]]*.5<a[h[1]]*.5?0:1]}function dg(r,e){return N(r||[],function(t){t.dataIndex!=null&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")}),r}var Uu=ar,owe=N,DJ=Math.min,q3=Math.max,swe=12,lwe=6,uwe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._shapes={},t._dataInterval=[],t._handleEnds=[],t._hoverLinkDataIndices=[],t}return e.prototype.init=function(t,i){r.prototype.init.call(this,t,i),this._hoverLinkFromSeriesMouseOver=Be(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=Be(this._hideIndicator,this)},e.prototype.doRender=function(t,i,n,a){(!a||a.type!=="selectDataRange"||a.from!==this.uid)&&this._buildView()},e.prototype._buildView=function(){this.group.removeAll();var t=this.visualMapModel,i=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(i);var n=t.get("text");this._renderEndsText(i,n,0),this._renderEndsText(i,n,1),this._updateView(!0),this.renderBackground(i),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(i)},e.prototype._renderEndsText=function(t,i,n){if(i){var a=i[1-n];a=a!=null?a+"":"";var o=this.visualMapModel,s=o.get("textGap"),l=o.itemSize,u=this._shapes.mainGroup,c=this._applyTransform([l[0]/2,n===0?-s:l[1]+s],u),h=this._applyTransform(n===0?"bottom":"top",u),f=this._orient,p=this.visualMapModel.textStyleModel;this.group.add(new It({style:pr(p,{x:c[0],y:c[1],verticalAlign:f==="horizontal"?"middle":h,align:f==="horizontal"?h:"center",text:a})}))}},e.prototype._renderBar=function(t){var i=this.visualMapModel,n=this._shapes,a=i.itemSize,o=this._orient,s=this._useHandle,l=pA(i,this.api,a),u=n.mainGroup=this._createBarGroup(l),c=new Ze;u.add(c),c.add(n.outOfRange=PJ()),c.add(n.inRange=PJ(null,s?NJ(this._orient):null,Be(this._dragHandle,this,"all",!1),Be(this._dragHandle,this,"all",!0))),c.setClipPath(new Rt({shape:{x:0,y:0,width:a[0],height:a[1],r:3}}));var h=i.textStyleModel.getTextRect("\u56FD"),f=q3(h.width,h.height);s&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(i,u,0,a,f,o),this._createHandle(i,u,1,a,f,o)),this._createIndicator(i,u,a,f,o),t.add(u)},e.prototype._createHandle=function(t,i,n,a,o,s){var l=Be(this._dragHandle,this,n,!1),u=Be(this._dragHandle,this,n,!0),c=En(t.get("handleSize"),a[0]),h=wr(t.get("handleIcon"),-c/2,-c/2,c,c,null,!0),f=NJ(this._orient);h.attr({cursor:f,draggable:!0,drift:l,ondragend:u,onmousemove:function(v){po(v.event)}}),h.x=a[0]/2,h.useStyle(t.getModel("handleStyle").getItemStyle()),h.setStyle({strokeNoScale:!0,strokeFirst:!0}),h.style.lineWidth*=2,h.ensureState("emphasis").style=t.getModel(["emphasis","handleStyle"]).getItemStyle(),lc(h,!0),i.add(h);var p=this.visualMapModel.textStyleModel,d=new It({cursor:f,draggable:!0,drift:l,onmousemove:function(v){po(v.event)},ondragend:u,style:pr(p,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var g=[c,0],m=this._shapes;m.handleThumbs[n]=h,m.handleLabelPoints[n]=g,m.handleLabels[n]=d},e.prototype._createIndicator=function(t,i,n,a,o){var s=En(t.get("indicatorSize"),n[0]),l=wr(t.get("indicatorIcon"),-s/2,-s/2,s,s,null,!0);l.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var u=t.getModel("indicatorStyle").getItemStyle();if(l instanceof Br){var c=l.style;l.useStyle(he({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},u))}else l.useStyle(u);i.add(l);var h=this.visualMapModel.textStyleModel,f=new It({silent:!0,invisible:!0,style:pr(h,{x:0,y:0,text:""})});this.group.add(f);var p=[(o==="horizontal"?a/2:lwe)+n[0]/2,0],d=this._shapes;d.indicator=l,d.indicatorLabel=f,d.indicatorLabelPoint=p,this._firstShowIndicator=!0},e.prototype._dragHandle=function(t,i,n,a){if(this._useHandle){if(this._dragging=!i,!i){var o=this._applyTransform([n,a],this._shapes.mainGroup,!0);this._updateInterval(t,o[1]),this._hideIndicator(),this._updateView()}i===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),i?!this._hovering&&this._clearHoverLinkToSeries():IJ(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},e.prototype._resetInterval=function(){var t=this.visualMapModel,i=this._dataInterval=t.getSelected(),n=t.getExtent(),a=[0,t.itemSize[1]];this._handleEnds=[Uu(i[0],n,a,!0),Uu(i[1],n,a,!0)]},e.prototype._updateInterval=function(t,i){i=i||0;var n=this.visualMapModel,a=this._handleEnds,o=[0,n.itemSize[1]];Io(i,a,o,t,0);var s=n.getExtent();this._dataInterval=[Uu(a[0],o,s,!0),Uu(a[1],o,s,!0)]},e.prototype._updateView=function(t){var i=this.visualMapModel,n=i.getExtent(),a=this._shapes,o=[0,i.itemSize[1]],s=t?o:this._handleEnds,l=this._createBarVisual(this._dataInterval,n,s,"inRange"),u=this._createBarVisual(n,n,o,"outOfRange");a.inRange.setStyle({fill:l.barColor}).setShape("points",l.barPoints),a.outOfRange.setStyle({fill:u.barColor}).setShape("points",u.barPoints),this._updateHandle(s,l)},e.prototype._createBarVisual=function(t,i,n,a){var o={forceState:a,convertOpacityToAlpha:!0},s=this._makeColorGradient(t,o),l=[this.getControllerVisual(t[0],"symbolSize",o),this.getControllerVisual(t[1],"symbolSize",o)],u=this._createBarPoints(n,l);return{barColor:new xu(0,0,0,1,s),barPoints:u,handlesColor:[s[0].color,s[s.length-1].color]}},e.prototype._makeColorGradient=function(t,i){var n=100,a=[],o=(t[1]-t[0])/n;a.push({color:this.getControllerVisual(t[0],"color",i),offset:0});for(var s=1;s<n;s++){var l=t[0]+o*s;if(l>t[1])break;a.push({color:this.getControllerVisual(l,"color",i),offset:s/n})}return a.push({color:this.getControllerVisual(t[1],"color",i),offset:1}),a},e.prototype._createBarPoints=function(t,i){var n=this.visualMapModel.itemSize;return[[n[0]-i[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-i[1],t[1]]]},e.prototype._createBarGroup=function(t){var i=this._orient,n=this.visualMapModel.get("inverse");return new Ze(i==="horizontal"&&!n?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&n?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!n?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,i){if(this._useHandle){var n=this._shapes,a=this.visualMapModel,o=n.handleThumbs,s=n.handleLabels,l=a.itemSize,u=a.getExtent();owe([0,1],function(c){var h=o[c];h.setStyle("fill",i.handlesColor[c]),h.y=t[c];var f=Uu(t[c],[0,l[1]],u,!0),p=this.getControllerVisual(f,"symbolSize");h.scaleX=h.scaleY=p/l[0],h.x=l[0]-p/2;var d=Ln(n.handleLabelPoints[c],Tl(h,this.group));s[c].setStyle({x:d[0],y:d[1],text:a.formatValueText(this._dataInterval[c]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",n.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,i,n,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,h=c.indicator;if(h){h.attr("invisible",!1);var f={convertOpacityToAlpha:!0},p=this.getControllerVisual(t,"color",f),d=this.getControllerVisual(t,"symbolSize"),g=Uu(t,s,u,!0),m=l[0]-d/2,v={x:h.x,y:h.y};h.y=g,h.x=m;var _=Ln(c.indicatorLabelPoint,Tl(h,this.group)),y=c.indicatorLabel;y.attr("invisible",!1);var x=this._applyTransform("left",c.mainGroup),M=this._orient,S=M==="horizontal";y.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:S?x:"middle",align:S?"center":x});var w={x:m,y:g,style:{fill:p}},T={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var C={duration:100,easing:"cubicInOut",additive:!0};h.x=v.x,h.y=v.y,h.animateTo(w,C),y.animateTo(T,C)}else h.attr(w),y.attr(T);this._firstShowIndicator=!1;var b=this._shapes.handleLabels;if(b)for(var E=0;E<b.length;E++)this.api.enterBlur(b[E])}},e.prototype._enableHoverLinkToSeries=function(){var t=this;this._shapes.mainGroup.on("mousemove",function(i){if(t._hovering=!0,!t._dragging){var n=t.visualMapModel.itemSize,a=t._applyTransform([i.offsetX,i.offsetY],t._shapes.mainGroup,!0,!0);a[1]=DJ(q3(0,a[1]),n[1]),t._doHoverLinkToSeries(a[1],0<=a[0]&&a[0]<=n[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()})},e.prototype._enableHoverLinkFromSeries=function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},e.prototype._doHoverLinkToSeries=function(t,i){var n=this.visualMapModel,a=n.itemSize;if(n.option.hoverLink){var o=[0,a[1]],s=n.getExtent();t=DJ(q3(o[0],t),o[1]);var l=cwe(n,s,o),u=[t-l,t+l],c=Uu(t,o,s,!0),h=[Uu(u[0],o,s,!0),Uu(u[1],o,s,!0)];u[0]<o[0]&&(h[0]=-1/0),u[1]>o[1]&&(h[1]=1/0),i&&(h[0]===-1/0?this._showIndicator(c,h[1],"< ",l):h[1]===1/0?this._showIndicator(c,h[0],"> ",l):this._showIndicator(c,c,"\u2248 ",l));var f=this._hoverLinkDataIndices,p=[];(i||IJ(n))&&(p=this._hoverLinkDataIndices=n.findTargetDataIndices(h));var d=MH(f,p);this._dispatchHighDown("downplay",dg(d[0],n)),this._dispatchHighDown("highlight",dg(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var i;if(Dl(t.target,function(l){var u=it(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var n=this.ecModel.getSeriesByIndex(i.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(n)){var o=n.getData(i.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var n=0;n<i.length;n++)this.api.leaveBlur(i[n])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",dg(t,this.visualMapModel)),t.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(t,i,n,a){var o=Tl(i,a?null:this.group);return pe(t)?Ln(t,o,n):Yp(t,o,n)},e.prototype._dispatchHighDown=function(t,i){i&&i.length&&this.api.dispatchAction({type:t,batch:i})},e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(fA);function PJ(r,e,t,i){return new ai({shape:{points:r},draggable:!!t,cursor:e,drift:t,onmousemove:function(n){po(n.event)},ondragend:i})}function cwe(r,e,t){var i=swe/2,n=r.get("hoverLinkDataSize");return n&&(i=Uu(n,e,t,!0)/2),i}function IJ(r){var e=r.get("hoverLinkOnHandle");return!!(e??r.get("realtime"))}function NJ(r){return r==="vertical"?"ns-resize":"ew-resize"}var UJ=uwe;var OJ={type:"selectDataRange",event:"dataRangeSelected",update:"update"},zJ=function(r,e){e.eachComponent({mainType:"visualMap",query:r},function(t){t.setSelected(r.selected)})};var FJ=[{createOnAllSeries:!0,reset:function(r,e){var t=[];return e.eachComponent("visualMap",function(i){var n=r.pipelineContext;!i.isTargetSeries(r)||n&&n.large||t.push(wK(i.stateList,i.targetVisuals,Be(i.getValueState,i),i.getDataDimensionIndex(r.getData())))}),t}},{createOnAllSeries:!0,reset:function(r,e){var t=r.getData(),i=[];e.eachComponent("visualMap",function(n){if(n.isTargetSeries(r)){var a=n.getVisualMeta(Be(hwe,null,r,n))||{stops:[],outerColors:[]},o=n.getDataDimensionIndex(t);o>=0&&(a.dimension=o,i.push(a))}}),r.getData().setVisual("visualMeta",i)}}];function hwe(r,e,t,i){for(var n=e.targetVisuals[i],a=gi.prepareVisualTypes(n),o={color:Mu(r.getData(),"color")},s=0,l=a.length;s<l;s++){var u=a[s],c=n[u==="opacity"?"__alphaForOpacity":u];c&&c.applyVisual(t,h,f)}return o.color;function h(p){return o[p]}function f(p,d){o[p]=d}}var BJ=N;function Z3(r){var e=r&&r.visualMap;pe(e)||(e=e?[e]:[]),BJ(e,function(t){if(t){mg(t,"splitList")&&!mg(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var i=t.pieces;i&&pe(i)&&BJ(i,function(n){qe(n)&&(mg(n,"start")&&!mg(n,"min")&&(n.min=n.start),mg(n,"end")&&!mg(n,"max")&&(n.max=n.end))})}})}function mg(r,e){return r&&r.hasOwnProperty&&r.hasOwnProperty(e)}var kJ=!1;function US(r){kJ||(kJ=!0,r.registerSubTypeDefaulter("visualMap",function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),r.registerAction(OJ,zJ),N(FJ,function(e){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,e)}),r.registerPreprocessor(Z3))}function OS(r){r.registerComponentModel(CJ),r.registerComponentView(UJ),US(r)}var fwe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],pwe[this._mode].call(this,this._pieceList),this._resetSelected(t,i);var a=this.option.categories;this.resetVisual(function(o,s){n==="categories"?(o.mappingMethod="category",o.categories=Qe(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=de(this._pieceList,function(l){return l=Qe(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,i={},n=gi.listVisualTypes(),a=this.isCategory();N(t.pieces,function(s){N(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),N(i,function(s,l){var u=!1;N(this.stateList,function(c){u=u||o(t,c,l)||o(t.target,c,l)},this),!u&&N(this.stateList,function(c){(t[c]||(t[c]={}))[l]=hA.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,i){var n=this.option,a=this._pieceList,o=(i?n:t).selected||{};if(n.selected=o,N(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),n.selectedMode==="single"){var s=!1;N(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Qe(t)},e.prototype.getValueState=function(t){var i=gi.findPieceIndex(t,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var i=[],n=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=gi.findPieceIndex(l,n);c===t&&o.push(u)},this),i.push({seriesId:a.id,dataIndex:o})},this),i},e.prototype.getRepresentValue=function(t){var i;if(this.isCategory())i=t.value;else if(t.value!=null)i=t.value;else{var n=t.interval||[];i=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return i},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var i=[],n=["",""],a=this;function o(c,h){var f=a.getRepresentValue({interval:c});h||(h=a.getValueState(f));var p=t(f,h);c[0]===-1/0?n[0]=p:c[1]===1/0?n[1]=p:i.push({value:c[0],color:p},{value:c[1],color:p})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return N(s,function(c){var h=c.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:i,outerColors:n}},e.type="visualMap.piecewise",e.defaultOption=$n(pg.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(pg),pwe={splitNumber:function(r){var e=this.option,t=Math.min(e.precision,20),i=this.getExtent(),n=e.splitNumber;n=Math.max(parseInt(n,10),1),e.splitNumber=n;for(var a=(i[1]-i[0])/n;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&r.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o<n;s+=a,o++){var l=o===n-1?i[1]:s+a;r.push({interval:[s,l],close:[1,1]})}e.maxOpen&&r.push({interval:[i[1],1/0],close:[0,0]}),V_(r),N(r,function(u,c){u.index=c,u.text=this.formatValueText(u.interval)},this)},categories:function(r){var e=this.option;N(e.categories,function(t){r.push({text:this.formatValueText(t,!0),value:t})},this),VJ(e,r)},pieces:function(r){var e=this.option;N(e.pieces,function(t,i){qe(t)||(t={value:t});var n={text:"",index:i};if(t.label!=null&&(n.text=t.label),t.hasOwnProperty("value")){var a=n.value=t.value;n.interval=[a,a],n.close=[1,1]}else{for(var o=n.interval=[],s=n.close=[0,0],l=[1,0,1],u=[-1/0,1/0],c=[],h=0;h<2;h++){for(var f=[["gte","gt","min"],["lte","lt","max"]][h],p=0;p<3&&o[h]==null;p++)o[h]=t[f[p]],s[h]=l[p],c[h]=p===2;o[h]==null&&(o[h]=u[h])}c[0]&&o[1]===1/0&&(s[0]=0),c[1]&&o[0]===-1/0&&(s[1]=0),o[0]===o[1]&&s[0]&&s[1]&&(n.value=o[0])}n.visual=gi.retrieveVisuals(t),r.push(n)},this),VJ(e,r),V_(r),N(r,function(t){var i=t.close,n=[["<","\u2264"][i[1]],[">","\u2265"][i[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,n)},this)}};function VJ(r,e){var t=r.inverse;(r.orient==="vertical"?!t:t)&&e.reverse()}var GJ=fwe;var dwe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var i=this.visualMapModel,n=i.get("textGap"),a=i.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=i.itemSize,c=this._getViewData(),h=c.endsText,f=Hr(i.get("showLabel",!0),!h);h&&this._renderEndsText(t,h[0],u,f,l),N(c.viewPieceList,function(p){var d=p.piece,g=new Ze;g.onclick=Be(this._onItemClick,this,d),this._enableHoverLink(g,p.indexInModelPieceList);var m=i.getRepresentValue(d);if(this._createItemSymbol(g,m,[0,0,u[0],u[1]]),f){var v=this.visualMapModel.getValueState(m);g.add(new It({style:{x:l==="right"?-n:u[0]+n,y:u[1]/2,text:d.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:v==="outOfRange"?.5:1}}))}t.add(g)},this),h&&this._renderEndsText(t,h[1],u,f,l),Rl(i.get("orient"),t,i.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,i){var n=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=n.visualMapModel;s.option.hoverLink&&n.api.dispatchAction({type:o,batch:dg(s.findTargetDataIndices(i),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,i=t.option;if(i.orient==="vertical")return pA(t,this.api,t.itemSize);var n=i.align;return(!n||n==="auto")&&(n="left"),n},e.prototype._renderEndsText=function(t,i,n,a,o){if(i){var s=new Ze,l=this.visualMapModel.textStyleModel;s.add(new It({style:pr(l,{x:a?o==="right"?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:a?o:"center",text:i})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,i=de(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),n=t.get("text"),a=t.get("orient"),o=t.get("inverse");return(a==="horizontal"?o:!o)?i.reverse():n&&(n=n.slice().reverse()),{viewPieceList:i,endsText:n}},e.prototype._createItemSymbol=function(t,i,n){t.add(wr(this.getControllerVisual(i,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(i,"color")))},e.prototype._onItemClick=function(t){var i=this.visualMapModel,n=i.option,a=n.selectedMode;if(a){var o=Qe(n.selected),s=i.getSelectedMapKey(t);a==="single"||a===!0?(o[s]=!0,N(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(fA),HJ=dwe;function zS(r){r.registerComponentModel(GJ),r.registerComponentView(HJ),US(r)}function j3(r){Ot(OS),Ot(zS)}var mwe={label:{enabled:!0},decal:{show:!1}},WJ=xt(),vwe={};function K3(r,e){var t=r.getModel("aria");if(!t.get("enabled"))return;var i=Qe(mwe);bt(i.label,r.getLocaleModel().get("aria"),!1),bt(t.option,i,!1),n(),a();function n(){var u=t.getModel("decal"),c=u.get("show");if(c){var h=ke();r.eachSeries(function(f){if(!f.isColorBySeries()){var p=h.get(f.type);p||(p={},h.set(f.type,p)),WJ(f).scope=p}}),r.eachRawSeries(function(f){if(r.isSeriesFiltered(f))return;if(He(f.enableAriaDecal)){f.enableAriaDecal();return}var p=f.getData();if(f.isColorBySeries()){var _=vx(f.ecModel,f.name,vwe,r.getSeriesCount()),y=p.getVisual("decal");p.setVisual("decal",x(y,_))}else{var d=f.getRawData(),g={},m=WJ(f).scope;p.each(function(M){var S=p.getRawIndex(M);g[S]=M});var v=d.count();d.each(function(M){var S=g[M],w=d.getName(M)||M+"",T=vx(f.ecModel,w,m,v),C=p.getItemVisual(S,"decal");p.setItemVisual(S,"decal",x(C,T))})}function x(M,S){var w=M?he(he({},S),M):S;return w.dirty=!0,w}})}}function a(){var u=r.getLocaleModel().get("aria"),c=t.getModel("label");if(c.option=Ye(c.option,u),!!c.get("enabled")){var h=e.getZr().dom;if(c.get("description")){h.setAttribute("aria-label",c.get("description"));return}var f=r.getSeriesCount(),p=c.get(["data","maxCount"])||10,d=c.get(["series","maxCount"])||10,g=Math.min(f,d),m;if(!(f<1)){var v=s();if(v){var _=c.get(["general","withTitle"]);m=o(_,{title:v})}else m=c.get(["general","withoutTitle"]);var y=[],x=f>1?c.get(["series","multiple","prefix"]):c.get(["series","single","prefix"]);m+=o(x,{seriesCount:f}),r.eachSeries(function(T,C){if(C<g){var b=void 0,E=T.get("name"),I=E?"withName":"withoutName";b=f>1?c.get(["series","multiple",I]):c.get(["series","single",I]),b=o(b,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var R=T.getData();if(R.count()>p){var A=c.get(["data","partialData"]);b+=o(A,{displayCnt:p})}else b+=c.get(["data","allData"]);for(var P=c.get(["data","separator","middle"]),U=c.get(["data","separator","end"]),B=[],z=0;z<R.count();z++)if(z<p){var k=R.getName(z),G=R.getValues(z),Y=c.get(["data",k?"withName":"withoutName"]);B.push(o(Y,{name:k,value:G.join(P)}))}b+=B.join(P)+U,y.push(b)}});var M=c.getModel(["series","multiple","separator"]),S=M.get("middle"),w=M.get("end");m+=y.join(S)+w,h.setAttribute("aria-label",m)}}}function o(u,c){if(!Ce(u))return u;var h=u;return N(c,function(f,p){h=h.replace(new RegExp("\\{\\s*"+p+"\\s*\\}","g"),f)}),h}function s(){var u=r.get("title");return u&&u.length&&(u=u[0]),u&&u.text}function l(u){var c=r.getLocaleModel().get(["series","typeNames"]);return c[u]||c.chart}}function J3(r){if(!(!r||!r.aria)){var e=r.aria;e.show!=null&&(e.enabled=e.show),e.label=e.label||{},N(["description","general","series","data"],function(t){e[t]!=null&&(e.label[t]=e[t])})}}function $3(r){r.registerPreprocessor(J3),r.registerVisual(r.PRIORITY.VISUAL.ARIA,K3)}var XJ={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},gwe=function(){function r(e){var t=this._condVal=Ce(e)?new RegExp(e):JV(e)?e:null;if(t==null){var i="";hr(i)}}return r.prototype.evaluate=function(e){var t=typeof e;return Ce(t)?this._condVal.test(e):Dt(t)?this._condVal.test(e+""):!1},r}(),ywe=function(){function r(){}return r.prototype.evaluate=function(){return this.value},r}(),_we=function(){function r(){}return r.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(!e[t].evaluate())return!1;return!0},r}(),xwe=function(){function r(){}return r.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(e[t].evaluate())return!0;return!1},r}(),Swe=function(){function r(){}return r.prototype.evaluate=function(){return!this.child.evaluate()},r}(),Mwe=function(){function r(){}return r.prototype.evaluate=function(){for(var e=!!this.valueParser,t=this.getValue,i=t(this.valueGetterParam),n=e?this.valueParser(i):null,a=0;a<this.subCondList.length;a++)if(!this.subCondList[a].evaluate(e?n:i))return!1;return!0},r}();function Q3(r,e){if(r===!0||r===!1){var t=new ywe;return t.value=r,t}var i="";return qJ(r)||hr(i),r.and?YJ("and",r,e):r.or?YJ("or",r,e):r.not?bwe(r,e):wwe(r,e)}function YJ(r,e,t){var i=e[r],n="";pe(i)||hr(n),i.length||hr(n);var a=r==="and"?new _we:new xwe;return a.children=de(i,function(o){return Q3(o,t)}),a.children.length||hr(n),a}function bwe(r,e){var t=r.not,i="";qJ(t)||hr(i);var n=new Swe;return n.child=Q3(t,e),n.child||hr(i),n}function wwe(r,e){for(var t="",i=e.prepareGetValue(r),n=[],a=At(r),o=r.parser,s=o?R1(o):null,l=0;l<a.length;l++){var u=a[l];if(!(u==="parser"||e.valueGetterAttrMap.get(u))){var c=tt(XJ,u)?XJ[u]:u,h=r[u],f=s?s(h):h,p=pW(c,f)||c==="reg"&&new gwe(f);p||hr(t),n.push(p)}}n.length||hr(t);var d=new Mwe;return d.valueGetterParam=i,d.valueParser=s,d.getValue=e.getValue,d.subCondList=n,d}function qJ(r){return qe(r)&&!di(r)}var Twe=function(){function r(e,t){this._cond=Q3(e,t)}return r.prototype.evaluate=function(){return this._cond.evaluate()},r}();function ZJ(r,e){return new Twe(r,e)}var jJ={type:"echarts:filter",transform:function(r){for(var e=r.upstream,t,i=ZJ(r.config,{valueGetterAttrMap:ke({dimension:!0}),prepareGetValue:function(s){var l="",u=s.dimension;tt(s,"dimension")||hr(l);var c=e.getDimensionInfo(u);return c||hr(l),{dimIdx:c.index}},getValue:function(s){return e.retrieveValueFromItem(t,s.dimIdx)}}),n=[],a=0,o=e.count();a<o;a++)t=e.getRawDataItem(a),i.evaluate()&&n.push(t);return{data:n}}};var KJ={type:"echarts:sort",transform:function(r){var e=r.upstream,t=r.config,i="",n=tr(t);n.length||hr(i);var a=[];N(n,function(c){var h=c.dimension,f=c.order,p=c.parser,d=c.incomparable;if(h==null&&hr(i),f!=="asc"&&f!=="desc"&&hr(i),d&&d!=="min"&&d!=="max"){var g="";hr(g)}if(f!=="asc"&&f!=="desc"){var m="";hr(m)}var v=e.getDimensionInfo(h);v||hr(i);var _=p?R1(p):null;p&&!_&&hr(i),a.push({dimIdx:v.index,parser:_,comparator:new L1(f,d)})});var o=e.sourceFormat;o!==Li&&o!==Pn&&hr(i);for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(c,h){for(var f=0;f<a.length;f++){var p=a[f],d=e.retrieveValueFromItem(c,p.dimIdx),g=e.retrieveValueFromItem(h,p.dimIdx);p.parser&&(d=p.parser(d),g=p.parser(g));var m=p.comparator.evaluate(d,g);if(m!==0)return m}return 0}),{data:s}}};function ez(r){r.registerTransform(jJ),r.registerTransform(KJ)}var Ewe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataset",t}return e.prototype.init=function(t,i,n){r.prototype.init.call(this,t,i,n),this._sourceManager=new I1(this),vP(this)},e.prototype.mergeOption=function(t,i){r.prototype.mergeOption.call(this,t,i),vP(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Ao},e}(Nt);var Awe=function(r){Z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataset",t}return e.type="dataset",e}(ir);function tz(r){r.registerComponentModel(Ewe),r.registerComponentView(Awe)}var Ou=$i.CMD;function vg(r,e){return Math.abs(r-e)<1e-5}function dA(r){var e=r.data,t=r.len(),i=[],n,a=0,o=0,s=0,l=0;function u(R,A){n&&n.length>2&&i.push(n),n=[R,A]}function c(R,A,P,U){vg(R,P)&&vg(A,U)||n.push(R,A,P,U,P,U)}function h(R,A,P,U,B,z){var k=Math.abs(A-R),G=Math.tan(k/4)*4/3,Y=A<R?-1:1,J=Math.cos(R),Q=Math.sin(R),V=Math.cos(A),K=Math.sin(A),ae=J*B+P,ve=Q*z+U,ue=V*B+P,se=K*z+U,Ee=B*G*Y,q=z*G*Y;n.push(ae-Ee*Q,ve+q*J,ue+Ee*K,se-q*V,ue,se)}for(var f,p,d,g,m=0;m<t;){var v=e[m++],_=m===1;switch(_&&(a=e[m],o=e[m+1],s=a,l=o,(v===Ou.L||v===Ou.C||v===Ou.Q)&&(n=[s,l])),v){case Ou.M:a=s=e[m++],o=l=e[m++],u(s,l);break;case Ou.L:f=e[m++],p=e[m++],c(a,o,f,p),a=f,o=p;break;case Ou.C:n.push(e[m++],e[m++],e[m++],e[m++],a=e[m++],o=e[m++]);break;case Ou.Q:f=e[m++],p=e[m++],d=e[m++],g=e[m++],n.push(a+2/3*(f-a),o+2/3*(p-o),d+2/3*(f-d),g+2/3*(p-g),d,g),a=d,o=g;break;case Ou.A:var y=e[m++],x=e[m++],M=e[m++],S=e[m++],w=e[m++],T=e[m++]+w;m+=1;var C=!e[m++];f=Math.cos(w)*M+y,p=Math.sin(w)*S+x,_?(s=f,l=p,u(s,l)):c(a,o,f,p),a=Math.cos(T)*M+y,o=Math.sin(T)*S+x;for(var b=(C?-1:1)*Math.PI/2,E=w;C?E>T:E<T;E+=b){var I=C?Math.max(E+b,T):Math.min(E+b,T);h(E,I,y,x,M,S)}break;case Ou.R:s=a=e[m++],l=o=e[m++],f=s+e[m++],p=l+e[m++],u(f,l),c(f,l,f,p),c(f,p,s,p),c(s,p,s,l),c(s,l,f,l);break;case Ou.Z:n&&c(a,o,s,l),a=s,o=l;break}}return n&&n.length>2&&i.push(n),i}function rz(r,e,t,i,n,a,o,s,l,u){if(vg(r,t)&&vg(e,i)&&vg(n,o)&&vg(a,s)){l.push(o,s);return}var c=2/u,h=c*c,f=o-r,p=s-e,d=Math.sqrt(f*f+p*p);f/=d,p/=d;var g=t-r,m=i-e,v=n-o,_=a-s,y=g*g+m*m,x=v*v+_*_;if(y<h&&x<h){l.push(o,s);return}var M=f*g+p*m,S=-f*v-p*_,w=y-M*M,T=x-S*S;if(w<h&&M>=0&&T<h&&S>=0){l.push(o,s);return}var C=[],b=[];Ps(r,t,n,o,.5,C),Ps(e,i,a,s,.5,b),rz(C[0],b[0],C[1],b[1],C[2],b[2],C[3],b[3],l,u),rz(C[4],b[4],C[5],b[5],C[6],b[6],C[7],b[7],l,u)}function JJ(r,e){var t=dA(r),i=[];e=e||1;for(var n=0;n<t.length;n++){var a=t[n],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var c=a[u++],h=a[u++],f=a[u++],p=a[u++],d=a[u++],g=a[u++];rz(s,l,c,h,f,p,d,g,o,e),s=d,l=g}i.push(o)}return i}function t$(r,e,t){var i=r[e],n=r[1-e],a=Math.abs(i/n),o=Math.ceil(Math.sqrt(a*t)),s=Math.floor(t/o);s===0&&(s=1,o=t);for(var l=[],u=0;u<o;u++)l.push(s);var c=o*s,h=t-c;if(h>0)for(var u=0;u<h;u++)l[u%o]+=1;return l}function $J(r,e,t){for(var i=r.r0,n=r.r,a=r.startAngle,o=r.endAngle,s=Math.abs(o-a),l=s*n,u=n-i,c=l>Math.abs(u),h=t$([l,u],c?0:1,e),f=(c?s:u)/h.length,p=0;p<h.length;p++)for(var d=(c?u:s)/h[p],g=0;g<h[p];g++){var m={};c?(m.startAngle=a+f*p,m.endAngle=a+f*(p+1),m.r0=i+d*g,m.r=i+d*(g+1)):(m.startAngle=a+d*g,m.endAngle=a+d*(g+1),m.r0=i+f*p,m.r=i+f*(p+1)),m.clockwise=r.clockwise,m.cx=r.cx,m.cy=r.cy,t.push(m)}}function Cwe(r,e,t){for(var i=r.width,n=r.height,a=i>n,o=t$([i,n],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=r[s]/o.length,f=0;f<o.length;f++)for(var p=r[l]/o[f],d=0;d<o[f];d++){var g={};g[u]=f*h,g[c]=d*p,g[s]=h,g[l]=p,g.x+=r.x,g.y+=r.y,t.push(g)}}function QJ(r,e,t,i){return r*i-t*e}function Rwe(r,e,t,i,n,a,o,s){var l=t-r,u=i-e,c=o-n,h=s-a,f=QJ(c,h,l,u);if(Math.abs(f)<1e-6)return null;var p=r-n,d=e-a,g=QJ(p,d,c,h)/f;return g<0||g>1?null:new zt(g*l+r,g*u+e)}function Lwe(r,e,t){var i=new zt;zt.sub(i,t,e),i.normalize();var n=new zt;zt.sub(n,r,e);var a=n.dot(i);return a}function gg(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function Dwe(r,e,t){for(var i=r.length,n=[],a=0;a<i;a++){var o=r[a],s=r[(a+1)%i],l=Rwe(o[0],o[1],s[0],s[1],e.x,e.y,t.x,t.y);l&&n.push({projPt:Lwe(l,e,t),pt:l,idx:a})}if(n.length<2)return[{points:r},{points:r}];n.sort(function(m,v){return m.projPt-v.projPt});var u=n[0],c=n[n.length-1];if(c.idx<u.idx){var h=u;u=c,c=h}for(var f=[u.pt.x,u.pt.y],p=[c.pt.x,c.pt.y],d=[f],g=[p],a=u.idx+1;a<=c.idx;a++)gg(d,r[a].slice());gg(d,p),gg(d,f);for(var a=c.idx+1;a<=u.idx+i;a++)gg(g,r[a%i].slice());return gg(g,f),gg(g,p),[{points:d},{points:g}]}function e$(r){var e=r.points,t=[],i=[];Ip(e,t,i);var n=new ht(t[0],t[1],i[0]-t[0],i[1]-t[1]),a=n.width,o=n.height,s=n.x,l=n.y,u=new zt,c=new zt;return a>o?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),Dwe(e,u,c)}function mA(r,e,t,i){if(t===1)i.push(e);else{var n=Math.floor(t/2),a=r(e);mA(r,a[0],n,i),mA(r,a[1],t-n,i)}return i}function Pwe(r,e){for(var t=[],i=0;i<e;i++)t.push(sv(r));return t}function Iwe(r,e){e.setStyle(r.style),e.z=r.z,e.z2=r.z2,e.zlevel=r.zlevel}function Nwe(r){for(var e=[],t=0;t<r.length;)e.push([r[t++],r[t++]]);return e}function r$(r,e){var t=[],i=r.shape,n;switch(r.type){case"rect":Cwe(i,e,t),n=Rt;break;case"sector":$J(i,e,t),n=Mi;break;case"circle":$J({r0:0,r:i.r,startAngle:0,endAngle:Math.PI*2,cx:i.cx,cy:i.cy},e,t),n=Mi;break;default:var a=r.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=de(JJ(r.getUpdatedPathProxy(),o),function(v){return Nwe(v)}),l=s.length;if(l===0)mA(e$,{points:s[0]},e,t);else if(l===e)for(var u=0;u<l;u++)t.push({points:s[u]});else{var c=0,h=de(s,function(v){var _=[],y=[];Ip(v,_,y);var x=(y[1]-_[1])*(y[0]-_[0]);return c+=x,{poly:v,area:x}});h.sort(function(v,_){return _.area-v.area});for(var f=e,u=0;u<l;u++){var p=h[u];if(f<=0)break;var d=u===l-1?f:Math.ceil(p.area/c*e);d<0||(mA(e$,{points:p.poly},d,t),f-=d)}}n=ai;break}if(!n)return Pwe(r,e);for(var g=[],u=0;u<t.length;u++){var m=new n;m.setShape(t[u]),Iwe(r,m),g.push(m)}return g}function Uwe(r,e){var t=r.length,i=e.length;if(t===i)return[r,e];for(var n=[],a=[],o=t<i?r:e,s=Math.min(t,i),l=Math.abs(i-t)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,h=[o[0],o[1]],f=l,p=2;p<s;){var d=o[p-2],g=o[p-1],m=o[p++],v=o[p++],_=o[p++],y=o[p++],x=o[p++],M=o[p++];if(f<=0){h.push(m,v,_,y,x,M);continue}for(var S=Math.min(f,c-1)+1,w=1;w<=S;w++){var T=w/S;Ps(d,m,_,x,T,n),Ps(g,v,y,M,T,a),d=n[3],g=a[3],h.push(n[1],a[1],n[2],a[2],d,g),m=n[5],v=a[5],_=n[6],y=a[6]}f-=S-1}return o===r?[h,e]:[r,h]}function i$(r,e){for(var t=r.length,i=r[t-2],n=r[t-1],a=[],o=0;o<e.length;)a[o++]=i,a[o++]=n;return a}function Owe(r,e){for(var t,i,n,a=[],o=[],s=0;s<Math.max(r.length,e.length);s++){var l=r[s],u=e[s],c=void 0,h=void 0;l?u?(t=Uwe(l,u),c=t[0],h=t[1],i=c,n=h):(h=i$(n||l,l),c=l):(c=i$(i||u,u),h=u),a.push(c),o.push(h)}return[a,o]}function n$(r){for(var e=0,t=0,i=0,n=r.length,a=0,o=n-2;a<n;o=a,a+=2){var s=r[o],l=r[o+1],u=r[a],c=r[a+1],h=s*c-u*l;e+=h,t+=(s+u)*h,i+=(l+c)*h}return e===0?[r[0]||0,r[1]||0]:[t/e/3,i/e/3,e]}function zwe(r,e,t,i){for(var n=(r.length-2)/6,a=1/0,o=0,s=r.length,l=s-2,u=0;u<n;u++){for(var c=u*6,h=0,f=0;f<s;f+=2){var p=f===0?c:(c+f-2)%l+2,d=r[p]-t[0],g=r[p+1]-t[1],m=e[f]-i[0],v=e[f+1]-i[1],_=m-d,y=v-g;h+=_*_+y*y}h<a&&(a=h,o=u)}return o}function Fwe(r){for(var e=[],t=r.length,i=0;i<t;i+=2)e[i]=r[t-i-2],e[i+1]=r[t-i-1];return e}function Bwe(r,e,t,i){for(var n=[],a,o=0;o<r.length;o++){var s=r[o],l=e[o],u=n$(s),c=n$(l);a==null&&(a=u[2]<0!=c[2]<0);var h=[],f=[],p=0,d=1/0,g=[],m=s.length;a&&(s=Fwe(s));for(var v=zwe(s,l,u,c)*6,_=m-2,y=0;y<_;y+=2){var x=(v+y)%_+2;h[y+2]=s[x]-u[0],h[y+3]=s[x+1]-u[1]}if(h[0]=s[v]-u[0],h[1]=s[v+1]-u[1],t>0)for(var M=i/t,S=-i/2;S<=i/2;S+=M){for(var w=Math.sin(S),T=Math.cos(S),C=0,y=0;y<s.length;y+=2){var b=h[y],E=h[y+1],I=l[y]-c[0],R=l[y+1]-c[1],A=I*T-R*w,P=I*w+R*T;g[y]=A,g[y+1]=P;var U=A-b,B=P-E;C+=U*U+B*B}if(C<d){d=C,p=S;for(var z=0;z<g.length;z++)f[z]=g[z]}}else for(var k=0;k<m;k+=2)f[k]=l[k]-c[0],f[k+1]=l[k+1]-c[1];n.push({from:h,to:f,fromCp:u,toCp:c,rotation:-p})}return n}function BS(r){return r.__isCombineMorphing}var o$="__mOriginal_";function vA(r,e,t){var i=o$+e,n=r[i]||r[e];r[i]||(r[i]=r[e]);var a=t.replace,o=t.after,s=t.before;r[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=n.apply(this,l),o&&o.apply(this,l),u}}function FS(r,e){var t=o$+e;r[t]&&(r[e]=r[t],r[t]=null)}function a$(r,e){for(var t=0;t<r.length;t++)for(var i=r[t],n=0;n<i.length;){var a=i[n],o=i[n+1];i[n++]=e[0]*a+e[2]*o+e[4],i[n++]=e[1]*a+e[3]*o+e[5]}}function s$(r,e){var t=r.getUpdatedPathProxy(),i=e.getUpdatedPathProxy(),n=Owe(dA(t),dA(i)),a=n[0],o=n[1],s=r.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&a$(a,s),l&&a$(o,l),vA(e,"updateTransform",{replace:u}),e.transform=null;var c=Bwe(a,o,10,Math.PI),h=[];vA(e,"buildPath",{replace:function(f){for(var p=e.__morphT,d=1-p,g=[],m=0;m<c.length;m++){var v=c[m],_=v.from,y=v.to,x=v.rotation*p,M=v.fromCp,S=v.toCp,w=Math.sin(x),T=Math.cos(x);Um(g,M,S,p);for(var C=0;C<_.length;C+=2){var b=_[C],E=_[C+1],I=y[C],R=y[C+1],A=b*d+I*p,P=E*d+R*p;h[C]=A*T-P*w+g[0],h[C+1]=A*w+P*T+g[1]}var U=h[0],B=h[1];f.moveTo(U,B);for(var C=2;C<_.length;){var I=h[C++],R=h[C++],z=h[C++],k=h[C++],G=h[C++],Y=h[C++];U===I&&B===R&&z===G&&k===Y?f.lineTo(G,Y):f.bezierCurveTo(I,R,z,k,G,Y),U=G,B=Y}}}})}function yA(r,e,t){if(!r||!e)return e;var i=t.done,n=t.during;s$(r,e),e.__morphT=0;function a(){FS(e,"buildPath"),FS(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},Ye({during:function(o){e.dirtyShape(),n&&n(o)},done:function(){a(),i&&i()}},t)),e}function kwe(r,e,t,i,n,a){var o=16;r=n===t?0:Math.round(32767*(r-t)/(n-t)),e=a===i?0:Math.round(32767*(e-i)/(a-i));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var c=0,h=0;(r&u)>0&&(c=1),(e&u)>0&&(h=1),s+=u*u*(3*c^h),h===0&&(c===1&&(r=u-1-r,e=u-1-e),l=r,r=e,e=l)}return s}function gA(r){var e=1/0,t=1/0,i=-1/0,n=-1/0,a=de(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),t=Math.min(h,t),i=Math.max(c,i),n=Math.max(h,n),[c,h]}),o=de(a,function(s,l){return{cp:s,z:kwe(s[0],s[1],e,t,i,n),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function l$(r){return r$(r.path,r.count)}function iz(){return{fromIndividuals:[],toIndividuals:[],count:0}}function u$(r,e,t){var i=[];function n(M){for(var S=0;S<M.length;S++){var w=M[S];BS(w)?n(w.childrenRef()):w instanceof pt&&i.push(w)}}n(r);var a=i.length;if(!a)return iz();var o=t.dividePath||l$,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),iz();i=gA(i),s=gA(s);for(var l=t.done,u=t.during,c=t.individualDelay,h=new go,f=0;f<a;f++){var p=i[f],d=s[f];d.parent=e,d.copyTransform(h),c||s$(p,d)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function g(M){for(var S=0;S<s.length;S++)s[S].addSelfToZr(M)}vA(e,"addSelfToZr",{after:function(M){g(M)}}),vA(e,"removeSelfFromZr",{after:function(M){for(var S=0;S<s.length;S++)s[S].removeSelfFromZr(M)}});function m(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,FS(e,"addSelfToZr"),FS(e,"removeSelfFromZr")}var v=s.length;if(c)for(var _=v,y=function(){_--,_===0&&(m(),l&&l())},f=0;f<v;f++){var x=c?Ye({delay:(t.delay||0)+c(f,v,i[f],s[f]),done:y},t):t;yA(i[f],s[f],x)}else e.__morphT=0,e.animateTo({__morphT:1},Ye({during:function(M){for(var S=0;S<v;S++){var w=s[S];w.__morphT=e.__morphT,w.dirtyShape()}u&&u(M)},done:function(){m();for(var M=0;M<r.length;M++)FS(r[M],"updateTransform");l&&l()}},t));return e.__zr&&g(e.__zr),{fromIndividuals:i,toIndividuals:s,count:v}}function c$(r,e,t){var i=e.length,n=[],a=t.dividePath||l$;function o(p){for(var d=0;d<p.length;d++){var g=p[d];BS(g)?o(g.childrenRef()):g instanceof pt&&n.push(g)}}if(BS(r)){o(r.childrenRef());var s=n.length;if(s<i)for(var l=0,u=s;u<i;u++)n.push(sv(n[l++%s]));n.length=i}else{n=a({path:r,count:i});for(var c=r.getComputedTransform(),u=0;u<n.length;u++)n[u].setLocalTransform(c);if(n.length!==i)return console.error("Invalid morphing: unmatched splitted path"),iz()}n=gA(n),e=gA(e);for(var h=t.individualDelay,u=0;u<i;u++){var f=h?Ye({delay:(t.delay||0)+h(u,i,n[u],e[u])},t):t;yA(n[u],e[u],f)}return{fromIndividuals:n,toIndividuals:e,count:e.length}}function h$(r){return pe(r[0])}function f$(r,e){for(var t=[],i=r.length,n=0;n<i;n++)t.push({one:r[n],many:[]});for(var n=0;n<e.length;n++){var a=e[n].length,o=void 0;for(o=0;o<a;o++)t[o%i].many.push(e[n][o])}for(var s=0,n=i-1;n>=0;n--)if(!t[n].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var a=l.length,u=Math.ceil(a/2);t[n].many=l.slice(u,a),t[s].many=l.slice(0,u),s++}return t}var Vwe={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),i=0;i<r.count;i++){var n=sv(r.path);n.setStyle("opacity",t),e.push(n)}return e},split:null};function _A(r,e,t,i,n,a){if(!r.length||!e.length)return;var o=Su("update",i,n);if(!(o&&o.duration>0))return;var s=i.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;h$(r)&&(u=r,c=e),h$(e)&&(u=e,c=r);function h(v,_,y,x,M){var S=v.many,w=v.one;if(S.length===1&&!M){var T=_?S[0]:w,C=_?w:S[0];if(BS(T))h({many:[T],one:C},!0,y,x,!0);else{var b=s?Ye({delay:s(y,x)},l):l;yA(T,C,b),a(T,C,T,C,b)}}else for(var E=Ye({dividePath:Vwe[t],individualDelay:s&&function(B,z,k,G){return s(B+y,x)}},l),I=_?u$(S,w,E):c$(w,S,E),R=I.fromIndividuals,A=I.toIndividuals,P=R.length,U=0;U<P;U++){var b=s?Ye({delay:s(U,P)},l):l;a(R[U],A[U],_?S[U]:v.one,_?v.one:S[U],b)}}for(var f=u?u===r:r.length>e.length,p=u?f$(c,u):f$(f?e:r,[f?r:e]),d=0,g=0;g<p.length;g++)d+=p[g].many.length;for(var m=0,g=0;g<p.length;g++)h(p[g],f,m,d),m+=p[g].many.length}function hf(r){if(!r)return[];if(pe(r)){for(var e=[],t=0;t<r.length;t++)e.push(hf(r[t]));return e}var i=[];return r.traverse(function(n){n instanceof pt&&!n.disableMorphing&&!n.invisible&&!n.ignore&&i.push(n)}),i}var x$=1e4,Gwe=0,p$=1,d$=2,Hwe=xt();function Wwe(r,e){for(var t=r.dimensions,i=0;i<t.length;i++){var n=r.getDimensionInfo(t[i]);if(n&&n.otherDims[e]===0)return t[i]}}function Xwe(r,e,t){var i=r.getDimensionInfo(t),n=i&&i.ordinalMeta;if(i){var a=r.get(i.name,e);return n&&n.categories[a]||a+""}}function m$(r,e,t,i){var n=i?"itemChildGroupId":"itemGroupId",a=Wwe(r,n);if(a){var o=Xwe(r,e,a);return o}var s=r.getRawDataItem(e),l=i?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!i)return t||r.getId(e)}function v$(r){var e=[];return N(r,function(t){var i=t.data,n=t.dataGroupId;if(!(i.count()>x$))for(var a=i.getIndices(),o=0;o<a.length;o++)e.push({data:i,groupId:m$(i,o,n,!1),childGroupId:m$(i,o,n,!0),divide:t.divide,dataIndex:o})}),e}function nz(r,e,t){r.traverse(function(i){i instanceof pt&&lr(i,{style:{opacity:0}},e,{dataIndex:t,isFrom:!0})})}function az(r){if(r.parent){var e=r.getComputedTransform();r.setLocalTransform(e),r.parent.remove(r)}}function yg(r){r.stopAnimation(),r.isGroup&&r.traverse(function(e){e.stopAnimation()})}function Ywe(r,e,t){var i=Su("update",t,e);i&&r.traverse(function(n){if(n instanceof Si){var a=n5(n);a&&n.animateFrom({style:a},i)}})}function qwe(r,e){var t=r.length;if(t!==e.length)return!1;for(var i=0;i<t;i++){var n=r[i],a=e[i];if(n.data.getId(n.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function S$(r,e,t){var i=v$(r),n=v$(e);function a(y,x,M,S,w){(M||y)&&x.animateFrom({style:M&&M!==y?he(he({},M.style),y.style):y.style},w)}var o=!1,s=Gwe,l=ke(),u=ke();i.forEach(function(y){y.groupId&&l.set(y.groupId,!0),y.childGroupId&&u.set(y.childGroupId,!0)});for(var c=0;c<n.length;c++){var h=n[c].groupId;if(u.get(h)){s=p$;break}var f=n[c].childGroupId;if(f&&l.get(f)){s=d$;break}}function p(y,x){return function(M){var S=M.data,w=M.dataIndex;return x?S.getId(w):y?s===p$?M.childGroupId:M.groupId:s===d$?M.childGroupId:M.groupId}}var d=qwe(i,n),g={};if(!d)for(var c=0;c<n.length;c++){var m=n[c],v=m.data.getItemGraphicEl(m.dataIndex);v&&(g[v.id]=!0)}function _(y,x){var M=i[x],S=n[y],w=S.data.hostModel,T=M.data.getItemGraphicEl(M.dataIndex),C=S.data.getItemGraphicEl(S.dataIndex);if(T===C){C&&Ywe(C,S.dataIndex,w);return}T&&g[T.id]||C&&(yg(C),T?(yg(T),az(T),o=!0,_A(hf(T),hf(C),S.divide,w,y,a)):nz(C,w,y))}new In(i,n,p(!0,d),p(!1,d),null,"multiple").update(_).updateManyToOne(function(y,x){var M=n[y],S=M.data,w=S.hostModel,T=S.getItemGraphicEl(M.dataIndex),C=Yt(de(x,function(b){return i[b].data.getItemGraphicEl(i[b].dataIndex)}),function(b){return b&&b!==T&&!g[b.id]});T&&(yg(T),C.length?(N(C,function(b){yg(b),az(b)}),o=!0,_A(hf(C),hf(T),M.divide,w,y,a)):nz(T,w,M.dataIndex))}).updateOneToMany(function(y,x){var M=i[x],S=M.data.getItemGraphicEl(M.dataIndex);if(!(S&&g[S.id])){var w=Yt(de(y,function(C){return n[C].data.getItemGraphicEl(n[C].dataIndex)}),function(C){return C&&C!==S}),T=n[y[0]].data.hostModel;w.length&&(N(w,function(C){return yg(C)}),S?(yg(S),az(S),o=!0,_A(hf(S),hf(w),M.divide,T,y[0],a)):N(w,function(C){return nz(C,T,y[0])}))}}).updateManyToMany(function(y,x){new In(x,y,function(M){return i[M].data.getId(i[M].dataIndex)},function(M){return n[M].data.getId(n[M].dataIndex)}).update(function(M,S){_(y[M],x[S])}).execute()}).execute(),o&&N(e,function(y){var x=y.data,M=x.hostModel,S=M&&t.getViewOfSeriesModel(M),w=Su("update",M,0);S&&M.isAnimationEnabled()&&w&&w.duration>0&&S.group.traverse(function(T){T instanceof pt&&!T.animators.length&&T.animateFrom({style:{opacity:0}},w)})})}function g$(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function y$(r){return pe(r)?r.sort().join(","):r}function ff(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function Zwe(r,e){var t=ke(),i=ke(),n=ke();N(r.oldSeries,function(o,s){var l=r.oldDataGroupIds[s],u=r.oldData[s],c=g$(o),h=y$(c);i.set(h,{dataGroupId:l,data:u}),pe(c)&&N(c,function(f){n.set(f,{key:h,dataGroupId:l,data:u})})});function a(o){t.get(o)&&dH("Duplicated seriesKey in universalTransition "+o)}return N(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=g$(o),c=y$(u),h=i.get(c);if(h)t.set(c,{oldSeries:[{dataGroupId:h.dataGroupId,divide:ff(h.data),data:h.data}],newSeries:[{dataGroupId:s,divide:ff(l),data:l}]});else if(pe(u)){var f=[];N(u,function(g){var m=i.get(g);m.data&&f.push({dataGroupId:m.dataGroupId,divide:ff(m.data),data:m.data})}),f.length&&t.set(c,{oldSeries:f,newSeries:[{dataGroupId:s,data:l,divide:ff(l)}]})}else{var p=n.get(u);if(p){var d=t.get(p.key);d||(d={oldSeries:[{dataGroupId:p.dataGroupId,data:p.data,divide:ff(p.data)}],newSeries:[]},t.set(p.key,d)),d.newSeries.push({dataGroupId:s,data:l,divide:ff(l)})}}}}),t}function _$(r,e){for(var t=0;t<r.length;t++){var i=e.seriesIndex!=null&&e.seriesIndex===r[t].seriesIndex||e.seriesId!=null&&e.seriesId===r[t].id;if(i)return t}}function jwe(r,e,t,i){var n=[],a=[];N(tr(r.from),function(o){var s=_$(e.oldSeries,o);s>=0&&n.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:ff(e.oldData[s]),groupIdDim:o.dimension})}),N(tr(r.to),function(o){var s=_$(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:ff(l),groupIdDim:o.dimension})}}),n.length>0&&a.length>0&&S$(n,a,i)}function oz(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,i){N(tr(i.seriesTransition),function(n){N(tr(n.to),function(a){for(var o=i.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][Tx]=!0)})})}),r.registerUpdateLifecycle("series:transition",function(e,t,i){var n=Hwe(t);if(n.oldSeries&&i.updatedSeries&&i.optionChanged){var a=i.seriesTransition;if(a)N(tr(a),function(p){jwe(p,n,i,t)});else{var o=Zwe(n,i);N(o.keys(),function(p){var d=o.get(p);S$(d.oldSeries,d.newSeries,t)})}N(i.updatedSeries,function(p){p[Tx]&&(p[Tx]=!1)})}for(var s=e.getSeries(),l=n.oldSeries=[],u=n.oldDataGroupIds=[],c=n.oldData=[],h=0;h<s.length;h++){var f=s[h].getData();f.count()<x$&&(l.push(s[h]),u.push(s[h].get("dataGroupId")),c.push(f))}})}Ot([BI]);Ot([FI]);Ot([YI,jI,tN,fN,mN,PN,GN,$N,_U,xU,MU,kU,WU,qU,QU,eO,tO,rO,oO,uO,pO,NO]);Ot(VO);Ot(YO);Ot(oS);Ot(jO);Ot(yS);Ot(JO);Ot(QO);Ot(u3);Ot(p3);Ot(Gl);Ot(_3);Ot(x3);Ot(w3);Ot(L3);Ot(P3);Ot(I3);Ot(V3);Ot(Y3);Ot(DS);Ot(NS);Ot(j3);Ot(OS);Ot(zS);Ot($3);Ot(ez);Ot(tz);Ot(oz);Ot(gI);var df=["*"];function Kwe(r,e){if(r&1&&er(0,"nz-avatar",3),r&2){let t=Dr();rt("nzSrc",t.nzSrc)}}function Jwe(r,e){r&1&&ni(0,0,["*ngIf","!nzSrc"])}function $we(r,e){if(r&1&&er(0,"nz-list-item-meta-avatar",3),r&2){let t=Dr();rt("nzSrc",t.avatarStr)}}function Qwe(r,e){if(r&1&&(ft(0,"nz-list-item-meta-avatar"),CV(1,4),ot()),r&2){let t=Dr();st(),rt("ngTemplateOutlet",t.avatarTpl)}}function e1e(r,e){if(r&1&&(au(0),jt(1),ou()),r&2){let t=Dr(3);st(),ma(t.nzTitle)}}function t1e(r,e){if(r&1&&(ft(0,"nz-list-item-meta-title"),gr(1,e1e,2,1,"ng-container",6),ot()),r&2){let t=Dr(2);st(),rt("nzStringTemplateOutlet",t.nzTitle)}}function r1e(r,e){if(r&1&&(au(0),jt(1),ou()),r&2){let t=Dr(3);st(),ma(t.nzDescription)}}function i1e(r,e){if(r&1&&(ft(0,"nz-list-item-meta-description"),gr(1,r1e,2,1,"ng-container",6),ot()),r&2){let t=Dr(2);st(),rt("nzStringTemplateOutlet",t.nzDescription)}}function n1e(r,e){if(r&1&&(ft(0,"div",5),gr(1,t1e,2,1,"nz-list-item-meta-title",1)(2,i1e,2,1,"nz-list-item-meta-description",1),ni(3,1),ni(4,2),ot()),r&2){let t=Dr();st(),rt("ngIf",t.nzTitle&&!t.titleComponent),st(),rt("ngIf",t.nzDescription&&!t.descriptionComponent)}}var a1e=[[["nz-list-item-meta-avatar"]],[["nz-list-item-meta-title"]],[["nz-list-item-meta-description"]]],o1e=["nz-list-item-meta-avatar","nz-list-item-meta-title","nz-list-item-meta-description"];function s1e(r,e){r&1&&ni(0)}var l1e=["nz-list-item-actions",""];function u1e(r,e){}function c1e(r,e){r&1&&er(0,"em",3)}function h1e(r,e){if(r&1&&(ft(0,"li"),gr(1,u1e,0,0,"ng-template",1)(2,c1e,1,0,"em",2),ot()),r&2){let t=e.$implicit,i=e.last;st(),rt("ngTemplateOutlet",t),st(),rt("ngIf",!i)}}function f1e(r,e){}var A$=(r,e)=>({$implicit:r,index:e});function p1e(r,e){if(r&1&&(au(0),gr(1,f1e,0,0,"ng-template",9),ou()),r&2){let t=e.$implicit,i=e.index,n=Dr(2);st(),rt("ngTemplateOutlet",n.nzRenderItem)("ngTemplateOutletContext",ZL(2,A$,t,i))}}function d1e(r,e){if(r&1&&(ft(0,"div",7),gr(1,p1e,2,5,"ng-container",8),ni(2,4),ot()),r&2){let t=Dr();st(),rt("ngForOf",t.nzDataSource)}}function m1e(r,e){if(r&1&&(au(0),jt(1),ou()),r&2){let t=Dr(2);st(),ma(t.nzHeader)}}function v1e(r,e){if(r&1&&(ft(0,"nz-list-header"),gr(1,m1e,2,1,"ng-container",10),ot()),r&2){let t=Dr();st(),rt("nzStringTemplateOutlet",t.nzHeader)}}function g1e(r,e){r&1&&er(0,"div"),r&2&&TV("min-height",53,"px")}function y1e(r,e){}function _1e(r,e){if(r&1&&(ft(0,"div",13),gr(1,y1e,0,0,"ng-template",9),ot()),r&2){let t=e.$implicit,i=e.index,n=Dr(2);rt("nzSpan",n.nzGrid.span||null)("nzXs",n.nzGrid.xs||null)("nzSm",n.nzGrid.sm||null)("nzMd",n.nzGrid.md||null)("nzLg",n.nzGrid.lg||null)("nzXl",n.nzGrid.xl||null)("nzXXl",n.nzGrid.xxl||null),st(),rt("ngTemplateOutlet",n.nzRenderItem)("ngTemplateOutletContext",ZL(9,A$,t,i))}}function x1e(r,e){if(r&1&&(ft(0,"div",11),gr(1,_1e,2,12,"div",12),ot()),r&2){let t=Dr();rt("nzGutter",t.nzGrid.gutter||null),st(),rt("ngForOf",t.nzDataSource)}}function S1e(r,e){if(r&1&&er(0,"nz-list-empty",14),r&2){let t=Dr();rt("nzNoResult",t.nzNoResult)}}function M1e(r,e){if(r&1&&(au(0),jt(1),ou()),r&2){let t=Dr(2);st(),ma(t.nzFooter)}}function b1e(r,e){if(r&1&&(ft(0,"nz-list-footer"),gr(1,M1e,2,1,"ng-container",10),ot()),r&2){let t=Dr();st(),rt("nzStringTemplateOutlet",t.nzFooter)}}function w1e(r,e){}function T1e(r,e){}function E1e(r,e){if(r&1&&(ft(0,"nz-list-pagination"),gr(1,T1e,0,0,"ng-template",6),ot()),r&2){let t=Dr();st(),rt("ngTemplateOutlet",t.nzPagination)}}var A1e=[[["nz-list-header"]],[["nz-list-footer"],["","nz-list-footer",""]],[["nz-list-load-more"],["","nz-list-load-more",""]],[["nz-list-pagination"],["","nz-list-pagination",""]],"*"],C1e=["nz-list-header","nz-list-footer, [nz-list-footer]","nz-list-load-more, [nz-list-load-more]","nz-list-pagination, [nz-list-pagination]","*"];function R1e(r,e){if(r&1&&er(0,"ul",6),r&2){let t=Dr(2);rt("nzActions",t.nzActions)}}function L1e(r,e){if(r&1&&(gr(0,R1e,1,1,"ul",5),ni(1)),r&2){let t=Dr();rt("ngIf",t.nzActions&&t.nzActions.length>0)}}function D1e(r,e){if(r&1&&(au(0),jt(1),ou()),r&2){let t=Dr(3);st(),ma(t.nzContent)}}function P1e(r,e){if(r&1&&(au(0),gr(1,D1e,2,1,"ng-container",8),ou()),r&2){let t=Dr(2);st(),rt("nzStringTemplateOutlet",t.nzContent)}}function I1e(r,e){if(r&1&&(ni(0,1),ni(1,2),gr(2,P1e,2,1,"ng-container",7)),r&2){let t=Dr();st(2),rt("ngIf",t.nzContent)}}function N1e(r,e){r&1&&ni(0,3)}function U1e(r,e){}function O1e(r,e){}function z1e(r,e){}function F1e(r,e){}function B1e(r,e){if(r&1&&gr(0,U1e,0,0,"ng-template",9)(1,O1e,0,0,"ng-template",9)(2,z1e,0,0,"ng-template",9)(3,F1e,0,0,"ng-template",9),r&2){let t=Dr(),i=su(3),n=su(5),a=su(1);rt("ngTemplateOutlet",i),st(),rt("ngTemplateOutlet",t.nzExtra),st(),rt("ngTemplateOutlet",n),st(),rt("ngTemplateOutlet",a)}}function k1e(r,e){}function V1e(r,e){}function G1e(r,e){}function H1e(r,e){if(r&1&&(ft(0,"nz-list-item-extra"),gr(1,G1e,0,0,"ng-template",9),ot()),r&2){let t=Dr(2);st(),rt("ngTemplateOutlet",t.nzExtra)}}function W1e(r,e){}function X1e(r,e){if(r&1&&(au(0),ft(1,"div",10),gr(2,k1e,0,0,"ng-template",9)(3,V1e,0,0,"ng-template",9),ot(),gr(4,H1e,2,1,"nz-list-item-extra",7)(5,W1e,0,0,"ng-template",9),ou()),r&2){let t=Dr(),i=su(3),n=su(1),a=su(5);st(2),rt("ngTemplateOutlet",i),st(),rt("ngTemplateOutlet",n),st(),rt("ngIf",t.nzExtra),st(),rt("ngTemplateOutlet",a)}}var Y1e=[[["nz-list-item-actions"],["","nz-list-item-actions",""]],[["nz-list-item-meta"],["","nz-list-item-meta",""]],"*",[["nz-list-item-extra"],["","nz-list-item-extra",""]]],q1e=["nz-list-item-actions, [nz-list-item-actions]","nz-list-item-meta, [nz-list-item-meta]","*","nz-list-item-extra, [nz-list-item-extra]"],M$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-item-meta-title"]],exportAs:["nzListItemMetaTitle"],standalone:!0,features:[Ar],ngContentSelectors:df,decls:2,vars:0,consts:[[1,"ant-list-item-meta-title"]],template:function(n,a){n&1&&(Sn(),ft(0,"h4",0),ni(1),ot())},encapsulation:2,changeDetection:0});let r=e;return r})(),b$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-item-meta-description"]],exportAs:["nzListItemMetaDescription"],standalone:!0,features:[Ar],ngContentSelectors:df,decls:2,vars:0,consts:[[1,"ant-list-item-meta-description"]],template:function(n,a){n&1&&(Sn(),ft(0,"div",0),ni(1),ot())},encapsulation:2,changeDetection:0});let r=e;return r})(),C$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-item-meta-avatar"]],inputs:{nzSrc:"nzSrc"},exportAs:["nzListItemMetaAvatar"],standalone:!0,features:[Ar],ngContentSelectors:df,decls:3,vars:2,consts:[[1,"ant-list-item-meta-avatar"],[3,"nzSrc",4,"ngIf"],[4,"ngIf"],[3,"nzSrc"]],template:function(n,a){n&1&&(Sn(),ft(0,"div",0),gr(1,Kwe,1,1,"nz-avatar",1)(2,Jwe,1,0,"ng-content",2),ot()),n&2&&(st(),rt("ngIf",a.nzSrc),st(),rt("ngIf",!a.nzSrc))},dependencies:[Yn,BV,As],encapsulation:2,changeDetection:0});let r=e;return r})(),Z1e=(()=>{let e=class e{set nzAvatar(i){i instanceof YL?(this.avatarStr="",this.avatarTpl=i):this.avatarStr=i}constructor(i){this.elementRef=i,this.avatarStr=""}};e.\u0275fac=function(n){return new(n||e)(da(p_))},e.\u0275cmp=Er({type:e,selectors:[["nz-list-item-meta"],["","nz-list-item-meta",""]],contentQueries:function(n,a,o){if(n&1&&(Qu(o,b$,5),Qu(o,M$,5)),n&2){let s;fi(s=pi())&&(a.descriptionComponent=s.first),fi(s=pi())&&(a.titleComponent=s.first)}},hostAttrs:[1,"ant-list-item-meta"],inputs:{nzAvatar:"nzAvatar",nzTitle:"nzTitle",nzDescription:"nzDescription"},exportAs:["nzListItemMeta"],standalone:!0,features:[Ar],ngContentSelectors:o1e,decls:4,vars:3,consts:[[3,"nzSrc",4,"ngIf"],[4,"ngIf"],["class","ant-list-item-meta-content",4,"ngIf"],[3,"nzSrc"],[3,"ngTemplateOutlet"],[1,"ant-list-item-meta-content"],[4,"nzStringTemplateOutlet"]],template:function(n,a){n&1&&(Sn(a1e),gr(0,$we,1,1,"nz-list-item-meta-avatar",0)(1,Qwe,2,1,"nz-list-item-meta-avatar",1),ni(2),gr(3,n1e,5,2,"div",2)),n&2&&(rt("ngIf",a.avatarStr),st(),rt("ngIf",a.avatarTpl),st(2),rt("ngIf",a.nzTitle||a.nzDescription||a.descriptionComponent||a.titleComponent))},dependencies:[C$,As,m_,M$,Ob,Ub,b$],encapsulation:2,changeDetection:0});let r=e;return r})(),w$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-item-extra"],["","nz-list-item-extra",""]],hostAttrs:[1,"ant-list-item-extra"],exportAs:["nzListItemExtra"],standalone:!0,features:[Ar],ngContentSelectors:df,decls:1,vars:0,template:function(n,a){n&1&&(Sn(),ni(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),j1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-item-action"]],viewQuery:function(n,a){if(n&1&&Mn(YL,5),n&2){let o;fi(o=pi())&&(a.templateRef=o.first)}},exportAs:["nzListItemAction"],standalone:!0,features:[Ar],ngContentSelectors:df,decls:1,vars:0,template:function(n,a){n&1&&(Sn(),gr(0,s1e,1,0,"ng-template"))},encapsulation:2,changeDetection:0});let r=e;return r})(),K1e=(()=>{let e=class e{constructor(i,n,a){this.ngZone=i,this.nzActions=[],this.actions=[],this.inputActionChanges$=new OL,this.contentChildrenChanges$=_V(()=>this.nzListItemActions?yV(null):this.ngZone.onStable.pipe(SV(1),this.enterZone(),MV(()=>this.nzListItemActions.changes.pipe(bV(this.nzListItemActions))))),xV(this.contentChildrenChanges$,this.inputActionChanges$).pipe(zL(a)).subscribe(()=>{this.nzActions.length?this.actions=this.nzActions:this.actions=this.nzListItemActions.map(o=>o.templateRef),n.detectChanges()})}ngOnChanges(){this.inputActionChanges$.next(null)}enterZone(){return i=>new vV(n=>i.subscribe({next:a=>this.ngZone.run(()=>n.next(a))}))}};e.\u0275fac=function(n){return new(n||e)(da(VL),da(Ib),da(Fb))},e.\u0275cmp=Er({type:e,selectors:[["ul","nz-list-item-actions",""]],contentQueries:function(n,a,o){if(n&1&&Qu(o,j1e,4),n&2){let s;fi(s=pi())&&(a.nzListItemActions=s)}},hostAttrs:[1,"ant-list-item-action"],inputs:{nzActions:"nzActions"},exportAs:["nzListItemActions"],standalone:!0,features:[RV([Fb]),sh,Ar],attrs:l1e,decls:1,vars:1,consts:[[4,"ngFor","ngForOf"],[3,"ngTemplateOutlet"],["class","ant-list-item-action-split",4,"ngIf"],[1,"ant-list-item-action-split"]],template:function(n,a){n&1&&gr(0,h1e,3,2,"li",0),n&2&&rt("ngForOf",a.actions)},dependencies:[d_,m_,As],encapsulation:2,changeDetection:0});let r=e;return r})(),R$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-empty"]],hostAttrs:[1,"ant-list-empty-text"],inputs:{nzNoResult:"nzNoResult"},exportAs:["nzListHeader"],standalone:!0,features:[Ar],decls:1,vars:2,consts:[[3,"nzComponentName","specificContent"]],template:function(n,a){n&1&&er(0,"nz-embed-empty",0),n&2&&rt("nzComponentName","list")("specificContent",a.nzNoResult)},dependencies:[zV,OV],encapsulation:2,changeDetection:0});let r=e;return r})(),J1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-header"]],hostAttrs:[1,"ant-list-header"],exportAs:["nzListHeader"],standalone:!0,features:[Ar],ngContentSelectors:df,decls:1,vars:0,template:function(n,a){n&1&&(Sn(),ni(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),T$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-footer"]],hostAttrs:[1,"ant-list-footer"],exportAs:["nzListFooter"],standalone:!0,features:[Ar],ngContentSelectors:df,decls:1,vars:0,template:function(n,a){n&1&&(Sn(),ni(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),E$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["nz-list-pagination"]],hostAttrs:[1,"ant-list-pagination"],exportAs:["nzListPagination"],standalone:!0,features:[Ar],ngContentSelectors:df,decls:1,vars:0,template:function(n,a){n&1&&(Sn(),ni(0))},encapsulation:2,changeDetection:0});let r=e;return r})(),$1e=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275dir=FL({type:e,selectors:[["nz-list-load-more"]],exportAs:["nzListLoadMoreDirective"],standalone:!0});let r=e;return r})();var L$=(()=>{let e=class e{get itemLayoutNotify$(){return this.itemLayoutNotifySource.asObservable()}constructor(i){this.directionality=i,this.nzBordered=!1,this.nzGrid="",this.nzItemLayout="horizontal",this.nzRenderItem=null,this.nzLoading=!1,this.nzLoadMore=null,this.nzSize="default",this.nzSplit=!0,this.hasSomethingAfterLastItem=!1,this.dir="ltr",this.itemLayoutNotifySource=new gV(this.nzItemLayout),this.destroy$=new OL}ngOnInit(){this.dir=this.directionality.value,this.directionality.change?.pipe(zL(this.destroy$)).subscribe(i=>{this.dir=i})}getSomethingAfterLastItem(){return!!(this.nzLoadMore||this.nzPagination||this.nzFooter||this.nzListFooterComponent||this.nzListPaginationComponent||this.nzListLoadMoreDirective)}ngOnChanges(i){i.nzItemLayout&&this.itemLayoutNotifySource.next(this.nzItemLayout)}ngOnDestroy(){this.itemLayoutNotifySource.unsubscribe(),this.destroy$.next(),this.destroy$.complete()}ngAfterContentInit(){this.hasSomethingAfterLastItem=this.getSomethingAfterLastItem()}};e.\u0275fac=function(n){return new(n||e)(da(PV,8))},e.\u0275cmp=Er({type:e,selectors:[["nz-list"],["","nz-list",""]],contentQueries:function(n,a,o){if(n&1&&(Qu(o,T$,5),Qu(o,E$,5),Qu(o,$1e,5)),n&2){let s;fi(s=pi())&&(a.nzListFooterComponent=s.first),fi(s=pi())&&(a.nzListPaginationComponent=s.first),fi(s=pi())&&(a.nzListLoadMoreDirective=s.first)}},hostAttrs:[1,"ant-list"],hostVars:16,hostBindings:function(n,a){n&2&&Nb("ant-list-rtl",a.dir==="rtl")("ant-list-vertical",a.nzItemLayout==="vertical")("ant-list-lg",a.nzSize==="large")("ant-list-sm",a.nzSize==="small")("ant-list-split",a.nzSplit)("ant-list-bordered",a.nzBordered)("ant-list-loading",a.nzLoading)("ant-list-something-after-last-item",a.hasSomethingAfterLastItem)},inputs:{nzDataSource:"nzDataSource",nzBordered:"nzBordered",nzGrid:"nzGrid",nzHeader:"nzHeader",nzFooter:"nzFooter",nzItemLayout:"nzItemLayout",nzRenderItem:"nzRenderItem",nzLoading:"nzLoading",nzLoadMore:"nzLoadMore",nzPagination:"nzPagination",nzSize:"nzSize",nzSplit:"nzSplit",nzNoResult:"nzNoResult"},exportAs:["nzList"],standalone:!0,features:[sh,Ar],ngContentSelectors:C1e,decls:15,vars:9,consts:[["itemsTpl",""],[4,"ngIf"],[3,"nzSpinning"],[3,"min-height",4,"ngIf"],["nz-row","",3,"nzGutter",4,"ngIf","ngIfElse"],[3,"nzNoResult",4,"ngIf"],[3,"ngTemplateOutlet"],[1,"ant-list-items"],[4,"ngFor","ngForOf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"nzStringTemplateOutlet"],["nz-row","",3,"nzGutter"],["nz-col","",3,"nzSpan","nzXs","nzSm","nzMd","nzLg","nzXl","nzXXl",4,"ngFor","ngForOf"],["nz-col","",3,"nzSpan","nzXs","nzSm","nzMd","nzLg","nzXl","nzXXl"],[3,"nzNoResult"]],template:function(n,a){if(n&1&&(Sn(A1e),gr(0,d1e,3,1,"ng-template",null,0,sp)(2,v1e,2,1,"nz-list-header",1),ni(3),ft(4,"nz-spin",2),au(5),gr(6,g1e,1,2,"div",3)(7,x1e,2,2,"div",4)(8,S1e,1,1,"nz-list-empty",5),ou(),ot(),gr(9,b1e,2,1,"nz-list-footer",1),ni(10,1),gr(11,w1e,0,0,"ng-template",6),ni(12,2),gr(13,E1e,2,1,"nz-list-pagination",1),ni(14,3)),n&2){let o=su(1);st(2),rt("ngIf",a.nzHeader),st(2),rt("nzSpinning",a.nzLoading),st(2),rt("ngIf",a.nzLoading&&a.nzDataSource&&a.nzDataSource.length===0),st(),rt("ngIf",a.nzGrid&&a.nzDataSource)("ngIfElse",o),st(),rt("ngIf",!a.nzLoading&&a.nzDataSource&&a.nzDataSource.length===0),st(),rt("ngIf",a.nzFooter),st(2),rt("ngTemplateOutlet",a.nzLoadMore),st(2),rt("ngIf",a.nzPagination)}},dependencies:[m_,d_,J1e,As,Ob,Ub,Xn,FV,fn,hh,ch,R$,T$,E$],encapsulation:2,changeDetection:0});let r=e;return f_([v_()],r.prototype,"nzBordered",void 0),f_([v_()],r.prototype,"nzLoading",void 0),f_([v_()],r.prototype,"nzSplit",void 0),r})(),Q1e=(()=>{let e=class e{get isVerticalAndExtra(){return this.itemLayout==="vertical"&&(!!this.listItemExtraDirective||!!this.nzExtra)}constructor(i,n){this.parentComp=i,this.cdr=n,this.nzActions=[],this.nzExtra=null,this.nzNoFlex=!1}ngAfterViewInit(){this.itemLayout$=this.parentComp.itemLayoutNotify$.subscribe(i=>{this.itemLayout=i,this.cdr.detectChanges()})}ngOnDestroy(){this.itemLayout$&&this.itemLayout$.unsubscribe()}};e.\u0275fac=function(n){return new(n||e)(da(L$),da(Ib))},e.\u0275cmp=Er({type:e,selectors:[["nz-list-item"],["","nz-list-item",""]],contentQueries:function(n,a,o){if(n&1&&Qu(o,w$,5),n&2){let s;fi(s=pi())&&(a.listItemExtraDirective=s.first)}},hostAttrs:[1,"ant-list-item"],hostVars:2,hostBindings:function(n,a){n&2&&Nb("ant-list-item-no-flex",a.nzNoFlex)},inputs:{nzActions:"nzActions",nzContent:"nzContent",nzExtra:"nzExtra",nzNoFlex:"nzNoFlex"},exportAs:["nzListItem"],standalone:!0,features:[Ar],ngContentSelectors:q1e,decls:9,vars:2,consts:[["actionsTpl",""],["contentTpl",""],["extraTpl",""],["simpleTpl",""],[4,"ngIf","ngIfElse"],["nz-list-item-actions","",3,"nzActions",4,"ngIf"],["nz-list-item-actions","",3,"nzActions"],[4,"ngIf"],[4,"nzStringTemplateOutlet"],[3,"ngTemplateOutlet"],[1,"ant-list-item-main"]],template:function(n,a){if(n&1&&(Sn(Y1e),gr(0,L1e,2,1,"ng-template",null,0,sp)(2,I1e,3,1,"ng-template",null,1,sp)(4,N1e,1,0,"ng-template",null,2,sp)(6,B1e,4,4,"ng-template",null,3,sp)(8,X1e,6,4,"ng-container",4)),n&2){let o=su(7);st(8),rt("ngIf",a.isVerticalAndExtra)("ngIfElse",o)}},dependencies:[K1e,As,Ob,Ub,m_,w$],encapsulation:2,changeDetection:0});let r=e;return f_([v_()],r.prototype,"nzNoFlex",void 0),r})();var D$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=Pb({type:e}),e.\u0275inj=Db({imports:[L$,R$,Q1e,Z1e,C$]});let r=e;return r})();var eTe=["chart"],P$=(()=>{let e=class e{constructor(){this.chartInstance=null,this.options={},this.defaultTooltipOptions={tooltip:{trigger:"item",borderColor:"#00eff8",backgroundColor:"#12192C",padding:[6,14,6,14],textStyle:{fontSize:14,color:"#74FAFB"},position:"top",axisPointer:{type:"shadow"}},series:[{type:"gauge",startAngle:180,endAngle:0,center:["50%","75%"],radius:"90%",min:0,max:1,splitNumber:8,axisLine:{lineStyle:{width:6,color:[[.25,"#74FAFB"],[.5,"#74FAFB"],[.75,"#74FAFB"],[1,"#74FAFB"]]}},pointer:{icon:"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",length:"12%",width:20,offsetCenter:[0,"-60%"],itemStyle:{color:"auto"}},axisTick:{length:12,lineStyle:{color:"auto",width:2}},splitLine:{length:20,lineStyle:{color:"auto",width:5}},axisLabel:{color:"#464646",fontSize:20,distance:-60,rotate:"tangential",formatter:function(i){return""}},title:{offsetCenter:[0,"-10%"],fontSize:20},tooltip:{trigger:"item",borderColor:"#00eff8",backgroundColor:"#12192C",padding:[6,14,6,14],textStyle:{fontSize:14,color:"#74FAFB"},position:"top",axisPointer:{type:"shadow"}},detail:{fontSize:30,offsetCenter:[0,"-5%"],valueAnimation:!0,formatter:function(i){return Math.round(i*100)+""},color:"inherit"}}]}}ngOnInit(){console.log("ChartComponentComponent ngOnInit"),this.initEcharts()}ngOnChanges(i){i.options&&!i.options.isFirstChange()&&(console.log("ChartComponentComponent ngOnChanges"),this.updateChartOptions())}ngOnDestroy(){this.chartInstance&&(console.log("ChartComponentComponent ngOnInit"),this.chartInstance.dispose())}initEcharts(){let i=this.chartContainer.nativeElement;this.chartInstance=Ev(i,"dark");let n=Rb(Rb({},this.defaultTooltipOptions),this.options);this.chartInstance.setOption(n)}updateChartOptions(){this.chartInstance&&this.chartInstance.setOption(this.options)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["app-chart-component"]],viewQuery:function(n,a){if(n&1&&Mn(eTe,7),n&2){let o;fi(o=pi())&&(a.chartContainer=o.first)}},inputs:{options:"options"},standalone:!0,features:[sh,Ar],decls:2,vars:0,consts:[[2,"width","100%","height","100%"],["chart",""]],template:function(n,a){n&1&&er(0,"div",0,1)}});let r=e;return r})();var rTe=r=>({margin:r,width:"100%",height:"16rem"});function iTe(r,e){if(r&1&&er(0,"app-chart-component",28),r&2){let t=Dr(2).$implicit,i=Dr();EV(qL(3,rTe,"20px "+20/i.chartConfig.rowNumber+"px")),rt("options",t.options)}}function nTe(r,e){if(r&1&&(ft(0,"div",26),gr(1,iTe,1,5,"app-chart-component",27),ot()),r&2){let t=Dr().$implicit,i=Dr();rt("nzSpan",24/i.chartConfig.rowNumber),st(),rt("ngIf",t.checked)}}function aTe(r,e){if(r&1&&gr(0,nTe,2,2,"div",25),r&2){let t=e.$implicit;rt("ngIf",t.checked)}}function oTe(r,e){if(r&1&&(ft(0,"div",4)(1,"div",29),er(2,"app-chart-component",30),ot()()),r&2){let t=e.$implicit;st(2),rt("options",t)}}var I$=(()=>{let e=class e{handleCheckedItems(i){console.log("\u5F53\u524D\u9009\u4E2D\u7684\u9879\u76EE:",i)}constructor(i){this._mqttService=i,this.http=xn(lu),this.modal=xn(uh),this.chartConfig={rowNumber:1,optionsCheckList:[{label:"\u5168\u6C34",options:{},checked:!0},{label:"\u70ED\u503C",options:{},checked:!0},{label:"\u5168\u786B",options:{},checked:!1},{label:"\u5185\u6C34",options:{},checked:!1},{label:"\u7070\u5206",options:{},checked:!1},{label:"\u6325\u53D1\u5206",options:{},checked:!1}],optionBottomList:[{}],optionsList:[{label:"\u5168\u6C34",options:{},checked:!0},{label:"\u70ED\u503C",options:{},checked:!0}],tableList:[{coldef:[{headerName:"\u65F6\u95F4",field:"rwmc",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u7CFB\u7EDF/\u8BBE\u5907",field:"rwms",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u64CD\u4F5C\u63CF\u8FF0",field:"kssj",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u64CD\u4F5C\u4EBA\u5458",field:"jhwcsj",unSortIcon:!0,minWidth:void 0,flex:1}],rowData:[]},{coldef:[{headerName:"\u5E8F\u53F7",field:"rwmc",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u65F6\u95F4",field:"kssj",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",field:"rwms",unSortIcon:!0,minWidth:void 0,flex:1},{headerName:"\u7B49\u7EA7",field:"dqzt",unSortIcon:!0,minWidth:void 0,flex:1}],rowData:[]}]},this.chart_options={},this.chart_options0={},this.chart_options1={},this.chart_options2={},this.chart_options3={},this.chart_options4={},this.rowData=[],this.colDefs1=[{headerName:"\u65F6\u95F4",field:"rwmc",flex:1},{headerName:"\u7CFB\u7EDF/\u8BBE\u5907",field:"rwms",flex:1},{headerName:"\u64CD\u4F5C\u63CF\u8FF0",field:"kssj",flex:1},{headerName:"\u64CD\u4F5C\u4EBA\u5458",field:"jhwcsj",flex:1}],this.colDefs2=[{headerName:"\u5E8F\u53F7",field:"rwmc",flex:1},{headerName:"\u65F6\u95F4",field:"kssj",flex:2},{headerName:"\u4EFB\u52A1\u63CF\u8FF0",field:"rwms",flex:1},{headerName:"\u7B49\u7EA7",field:"dqzt",flex:1.5}],this.subscription=this._mqttService.observe("s1").subscribe(n=>{let a=JSON.parse(n.payload.toString());console.log("Received message as object: ",a.msg),this.chart_options0=a.msg})}ngOnInit(){this.getServerConfig();for(var i=1;i<30;i++)this.rowData.push({rwmc:`\u4EFB\u52A1${i}`,rwms:`\u4EFB\u52A1\u63CF\u8FF0${i}`,kssj:`2024-1-${i} 13:38:${i*11}`,jhwcsj:`2024-1-${i} 13:38:${i*10}`,sfcq:"\u5426",dqzt:"\u6B63\u5E38",dqjd:`\u8282\u70B9${i}`,sjwcsj:`2024-1-${i} 13:38:${i*27}`,bjmc:"\u62A5\u8B665",bjms:"\u62A5\u8B66\u63CF\u8FF05",bjsj:`2024-1-${i} 13:38:${i*12}`,gzyy:"-",clff:"-",tzsj:`2024-1-${i} 13:38:${i*19}`,zycd:"\u4E00\u822C",tzmc:"\u7CFB\u7EDF\u63D0\u793A",tznr:"\u8D26\u6237\u767B\u5F55",fj:"-",cz:"\u64CD\u4F5C"});for(var n=[],a=[],o=[],s=100,i=0;i<s;i++){var l=Math.random()*1e3;a.push(`category${i}`),n.push([i,Dv.round(Math.max(0,l-Math.random()*100)),Dv.round(l+Math.random()*80)]),o.push(Dv.round(l,2))}this.chart_options={backgroundColor:"transparent",series:[{type:"gauge",startAngle:180,endAngle:0,center:["50%","75%"],radius:"90%",min:0,max:1,splitNumber:8,axisLine:{lineStyle:{width:6,color:[[.25,"#74FAFB"],[.5,"#74FAFB"],[.75,"#74FAFB"],[1,"#74FAFB"]]}},pointer:{icon:"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",length:"12%",width:20,offsetCenter:[0,"-60%"],itemStyle:{color:"auto"}},axisTick:{length:12,lineStyle:{color:"auto",width:2}},splitLine:{length:20,lineStyle:{color:"auto",width:5}},axisLabel:{color:"#464646",fontSize:20,distance:-60,rotate:"tangential",formatter:function(u){return""}},title:{offsetCenter:[0,"-10%"],fontSize:20},detail:{fontSize:30,offsetCenter:[0,"-5%"],valueAnimation:!0,formatter:function(u){return`${Math.round(u*100)}`},color:"inherit"},data:[{value:.9,name:""}]}]},this.chart_options0={backgroundColor:"transparent",series:[{type:"gauge",startAngle:180,endAngle:0,center:["50%","75%"],radius:"90%",min:0,max:1,splitNumber:8,axisLine:{lineStyle:{width:6,color:[[.25,"#74FAFB"],[.5,"#74FAFB"],[.75,"#74FAFB"],[1,"#74FAFB"]]}},pointer:{icon:"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",length:"12%",width:20,offsetCenter:[0,"-60%"],itemStyle:{color:"auto"}},axisTick:{length:12,lineStyle:{color:"auto",width:2}},splitLine:{length:20,lineStyle:{color:"auto",width:5}},axisLabel:{color:"#464646",fontSize:20,distance:-60,rotate:"tangential",formatter:function(u){return""}},title:{offsetCenter:[0,"0%"],fontSize:20},detail:{fontSize:30,offsetCenter:[0,"-5%"],valueAnimation:!0,formatter:function(u){return`${Math.round(u*100)}`},color:"inherit"},data:[{value:.97,name:""}]}]},this.chart_options1={title:{textStyle:{color:"#ffffff"},text:"\u5168\u6C34",subtext:"(kg/kg)"},legend:{data:["\u6D4B\u91CF\u503C","\u4E0A\u9650\u503C","\u4E0B\u9650\u503C"]},calculable:!0,xAxis:[{axisLine:{lineStyle:{color:[[.25,"#74FAFB"],[.5,"#74FAFB"],[.75,"#74FAFB"],[1,"#74FAFB"]]}},position:"bottom",type:"category",data:["1","2","3","4","5","6","7","8","9","10","11","12"]}],yAxis:[{type:"value"}],series:[{name:"\u6D4B\u91CF\u503C",type:"line",data:[100,155,139,199,220,160,120,182.2,150,155,160,180],markPoint:{data:[{name:"\u6700\u5927\u503C",value:220,xAxis:4,yAxis:220},{name:"\u6700\u5C0F\u503C",value:100,xAxis:0,yAxis:100}]},markLine:{data:[{type:"average",name:"\u5E73\u5747\u503C"}]}},{type:"custom",name:"error",itemStyle:{borderWidth:1.5},renderItem:function(u,c){var h=c.value(0),f=c.coord([h,c.value(1)]),p=c.coord([h,c.value(2)]),d=c.size([1,0])[0]*.1,g=c.style({stroke:c.visual("color"),fill:void 0});return{type:"group",children:[{type:"line",transition:["shape"],shape:{x1:f[0]-d,y1:f[1],x2:f[0]+d,y2:f[1]},style:g},{type:"line",transition:["shape"],shape:{x1:f[0],y1:f[1],x2:p[0],y2:p[1]},style:g},{type:"line",transition:["shape"],shape:{x1:p[0]-d,y1:p[1],x2:p[0]+d,y2:p[1]},style:g}]}},encode:{x:0,y:[1,2]},data:n,z:100}]},this.chart_options2={title:{text:"\u70ED\u503C",subtext:"(kg/kg)"},legend:{data:["\u8D85\u5DEE\u6837\u6570\u91CF","\u4E0D\u5408\u683C\u6837\u6570\u91CF"]},xAxis:[{type:"category",data:["1","2","3","4","5","6","7","8","9","10","11","12"]}],yAxis:[{type:"value"}],series:[{name:"\u8D85\u5DEE\u6837\u6570\u91CF",type:"line",data:[2,4.9,7,23.2,25.6,76.7,135.6,162.2,32.6,20,6.4,3.3],markPoint:{data:[{type:"max",name:"Max"},{type:"min",name:"Min"}]}},{name:"\u4E0D\u5408\u683C\u6837\u6570\u91CF",type:"bar",data:[2.6,5.9,9,26.4,28.7,70.7,175.6,182.2,48.7,18.8,6,2.3],markPoint:{data:[{name:"Max",value:182.2,xAxis:7,yAxis:183},{name:"Min",value:2.3,xAxis:11,yAxis:3}]},markLine:{data:[{type:"average",name:"Avg"}]}}],grid:{left:"3%",right:"3%",bottom:"3%",containLabel:!0},toolbox:{show:!1,feature:{dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},calculable:!0},this.chart_options3={title:{text:"\u7164\u6837\u8D85\u5DEE\u7387"},grid:{top:"10%",left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:["\u8D85\u5DEE\u6837\u91CF","\u603B\u6837\u91CF"]},yAxis:{type:"value"},series:[{data:[3,16],label:{show:!0,position:"top",formatter:function(u){return u.value}},type:"bar"}]},this.chart_options4={title:{text:"\u7164\u6837\u5408\u683C\u7387",left:"center"},grid:{top:"10%",left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:["\u8D85\u5DEE\u6837\u91CF","\u603B\u6837\u91CF"]},yAxis:{type:"value"},series:[{data:[15,16],type:"bar",label:{show:!0,position:"top",formatter:function(u){return u.value}}}]},this.chartConfig.optionsCheckList[1].options=this.chart_options2,this.chartConfig.optionsCheckList[2].options=this.chart_options3,this.chartConfig.optionsCheckList[3].options=this.chart_options4,this.chartConfig.optionBottomList[0]=this.chart_options3,this.chartConfig.optionBottomList[1]=this.chart_options4}unsafePublish(i,n){this._mqttService.unsafePublish(i,n,{qos:1,retain:!0})}ngOnDestroy(){this.subscription.unsubscribe()}getServerConfig(){this.http.get("http://localhost:5006/api/config/s1").subscribe(i=>{this.chartConfig.optionsCheckList[0].options=i.data,console.log(i)})}};e.\u0275fac=function(n){return new(n||e)(da(kb))},e.\u0275cmp=Er({type:e,selectors:[["app-data-v-s1"]],standalone:!0,features:[Ar],decls:56,vars:13,consts:[["nz-row","",1,"s1-container",3,"nzGutter"],["nz-col","","nzSpan","8"],["title","\u7CFB\u7EDF\u72B6\u6001"],["nz-row","",2,"justify-content","center","align-items","center"],["nz-col","","nzSpan","12"],[1,"centered-element"],[2,"width","26rem","height","11rem",3,"options"],[1,"sys-status-title"],["title","\u7CFB\u7EDF\u64CD\u4F5C\u8BB0\u5F55",2,"margin-top","1rem"],[1,"ag-theme-datav",3,"rowData","columnDefs"],["title","\u7CFB\u7EDF\u62A5\u8B66\u4FE1\u606F",2,"margin-top","1rem"],["title","",2,"margin-top","1rem"],[1,"progress-container"],[1,"status-text"],[2,"width","100%",3,"nzPercent","nzStrokeColor"],[1,"status-ext-text"],[1,"progress-container","mt-sm"],["title",""],[2,"height","34.6rem"],["src","assets/dashboard/dashboard_ws_demo1.png",2,"width","100%"],["nz-row","",2,"justify-content","center","align-items","center","margin-top","0.5rem"],["nz-col","","nzSpan","12",1,"sys-status-title"],["title","\u5316\u9A8C\u7ED3\u679C",3,"showSetting","optionsList","onCheckedItemsChange"],["nz-row","",1,"scrollable-container"],["nz-row",""],["nz-col","","class","centered-element",3,"nzSpan",4,"ngIf"],["nz-col","",1,"centered-element",3,"nzSpan"],[3,"options","style",4,"ngIf"],[3,"options"],[1,"centered-element",2,"margin","2px"],[2,"width","26rem","height","11rem","margin-left","0.4rem",3,"options"],["nz-col","","class","centered-element",3,"nzSpan"]],template:function(n,a){n&1&&(ft(0,"div",0)(1,"div",1)(2,"data-v-card",2)(3,"div",3)(4,"div",4)(5,"div",5),er(6,"app-chart-component",6),ot(),ft(7,"div",7),jt(8,"\u7CFB\u7EDF\u5065\u5EB7\u5EA6"),ot()(),ft(9,"div",4)(10,"div",5),er(11,"app-chart-component",6),ot(),ft(12,"div",7),jt(13,"\u8BBE\u5907\u6295\u8FD0\u5EA6"),ot()()()(),ft(14,"data-v-card",8),er(15,"ag-grid-angular",9),ot(),ft(16,"data-v-card",10),er(17,"ag-grid-angular",9),ot(),ft(18,"data-v-card",11)(19,"div",12)(20,"span",13),jt(21,"\u5316\u9A8C\u6548\u7387\uFF1A"),ot(),er(22,"nz-progress",14),ft(23,"span",15),jt(24,"\uFF0816/25\uFF09"),ot()(),ft(25,"div",16)(26,"span",13),jt(27,"\u5B8C \u6210 \u7387 \uFF1A"),ot(),er(28,"nz-progress",14),ft(29,"span",15),jt(30,"\uFF0812/20\uFF09"),ot()()()(),ft(31,"div",1)(32,"data-v-card",17)(33,"div",18),er(34,"img",19),ft(35,"div",20)(36,"div",21),jt(37," \u673A\u5668\u4EBA "),ot(),ft(38,"div",21),jt(39," \u5168\u786B\u4EEA "),ot(),ft(40,"div",21),jt(41," \u5168\u6C34\u5206\u6790\u4EEA "),ot(),ft(42,"div",21),jt(43," \u6325\u53D1\u5206\u4EEA "),ot(),ft(44,"div",21),jt(45," \u91CF\u70ED\u4EEA "),ot(),ft(46,"div",21),jt(47," \u78B3\u6C22\u6C2E\u5143\u7D20 "),ot()()()()(),ft(48,"div",1)(49,"data-v-card",22),XL("onCheckedItemsChange",function(s){return a.handleCheckedItems(s)}),ft(50,"div",23),HL(51,aTe,1,1,"div",31,GL),ot(),ft(53,"div",24),HL(54,oTe,3,1,"div",4,GL),ot()()()()),n&2&&(rt("nzGutter",16),st(6),rt("options",a.chart_options),st(5),rt("options",a.chart_options0),st(4),rt("rowData",a.rowData)("columnDefs",a.colDefs1),st(2),rt("rowData",a.rowData)("columnDefs",a.colDefs2),st(5),rt("nzPercent",64)("nzStrokeColor","#74FAFB"),st(6),rt("nzPercent",60)("nzStrokeColor","#74FAFB"),st(21),rt("showSetting",!0)("optionsList",a.chartConfig.optionsCheckList),st(2),WL(a.chartConfig.optionsCheckList),st(3),WL(a.chartConfig.optionBottomList))},dependencies:[lh,As,UV,uo,kV,Bb,HV,D$,Ba,ka,io,Ja,ao,oo,no,to,Fa,Za,Ka,co,eo,$a,hh,ch,fn,Ua,Ya,qa,so,Wa,Yn,Qa,Ha,ja,Xa,lo,za,Oa,ro,Ga,Wn,Va,Xn,P$],styles:[".dashboard-container[_ngcontent-%COMP%]{width:20rem;height:10rem;margin-top:-3rem;margin-bottom:-2rem}.sys-status-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:#94ddf3;text-align:center}.ag-theme-datav[_ngcontent-%COMP%]{--ag-border-color: #74FAFB;--ag-foreground-color: #74FAFB;--ag-background-color: #0A1632;--ag-header-foreground-color: #74FAFB;--ag-header-background-color: #0A1632;--ag-odd-row-background-color: #0A1632;--ag-header-column-resize-handle-color: #7e2e84;--ag-font-size: 17px;--ag-font-family: monospace;height:5rem}.centered-element[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%}.status-container[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.5rem}.status-circle[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%}.status-circle.red[_ngcontent-%COMP%]{background-color:red}.status-circle.green[_ngcontent-%COMP%]{background-color:green}.progress-container[_ngcontent-%COMP%]{display:flex;color:#fff}.progress-container[_ngcontent-%COMP%] .status-text[_ngcontent-%COMP%]{width:8rem;margin-left:6px;font-size:16px;font-weight:600;color:#74fafb}.progress-container[_ngcontent-%COMP%] .status-ext-text[_ngcontent-%COMP%]{margin-top:3px;font-size:12px}.progress-display[_ngcontent-%COMP%]{color:#fff;text-align:right}.statistic-item-container[_ngcontent-%COMP%]{display:flex;padding:1rem 0;color:#fff}.white-color-theme[_ngcontent-%COMP%]{color:#74fafb}.scrollable-container[_ngcontent-%COMP%]{scrollbar-color:auto;overflow-y:auto;width:100%;height:20rem} ::-webkit-scrollbar{width:10px} ::-webkit-scrollbar-track{background-color:#0a1632} ::-webkit-scrollbar-thumb{background-color:#74fafb;border-radius:2px} ::-webkit-scrollbar-thumb:hover{background-color:#74fafb}"]});let r=e;return r})();var aMt=new wV("nz-carousel-custom-strategies");var N$=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=Pb({type:e}),e.\u0275inj=Db({});let r=e;return r})();var sTe=["myGrid"],U$=(()=>{let e=class e{constructor(){this.gridOptions={headerHeight:0,width:"100%"},this.defaultColDef={width:130,editable:!1},this.columnDefs=[],this.rowData=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz"}ngOnInit(){console.log("-----\u8868\u683C\u521D\u59CB\u5316-----"),this.pageSize=10,this.pageIndex=1,this.pageRowTotal=this.rowData.length}nzPageSizeChange(i){this.pageSize=i}nzPageIndexChange(i){console.log(`nzPageIndexChange${i}`),this.grid.api&&(i==1?this.grid.api.paginationGoToFirstPage():this.grid.api.paginationGoToPage(i))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["lj-car-ag-grid-component"]],viewQuery:function(n,a){if(n&1&&Mn(sTe,5),n&2){let o;fi(o=pi())&&(a.grid=o.first)}},inputs:{defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData:"rowData",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[Ar],decls:2,vars:11,consts:[[2,"height","100%",3,"pagination","suppressPaginationPanel","suppressScrollOnNewData","paginationPageSize","defaultColDef","rowData","columnDefs","gridOptions"],["myGrid",""]],template:function(n,a){n&1&&er(0,"ag-grid-angular",0,1),n&2&&(AV(a.gridThemeClass),rt("pagination",!0)("suppressPaginationPanel",!0)("suppressPaginationPanel",!0)("suppressScrollOnNewData",!0)("paginationPageSize",a.pageSize)("defaultColDef",a.defaultColDef)("rowData",a.rowData)("columnDefs",a.columnDefs)("gridOptions",a.gridOptions))},dependencies:[Bb,Rm],styles:[".grid-pagination[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:32px}.grid-pagination[_ngcontent-%COMP%] .ant-select-selection-item, .ant-select-selector[_ngcontent-%COMP%]{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .page-total-style{font-size:medium;font-weight:700;color:#00eff8} .ant-select-item-option{color:#00eff8!important} .ant-select-item-option-active div{font-weight:800!important;color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .anticon{color:#00eff8}.grid-pagination[_ngcontent-%COMP%] .ant-select-selector{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-prev .ant-pagination-item-link{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item a{color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active a{color:#000!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-next button, .ant-pagination-prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active:focus-visible, .ant-pagination-item-active[_ngcontent-%COMP%]:hover, .ant-pagination-next[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%], .ant-pagination-prev[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%]{border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active{font-weight:500;background-color:#00eff8;border-color:#00eff8;border-width:2px}"]});let r=e;return r})();var lTe=["myGrid"],uTe=["*"],SA=(()=>{let e=class e{constructor(){this.gridThemedClass="ag-theme-quartz ag-theme-datav",this.title="",this.defaultColDef={editable:!1,cellStyle:{"font-weight":"bold",textAlign:"center","justify-content":"center","line-height":"38px"}},this.columnDefs=[],this.rowData1=[],this.rowData2=[],this.rowData3=[],this.rowData4=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz",this.tableColumns=[{key:"sort",title:"\u5E8F\u53F7"},{key:"time",title:"\u65F6\u95F4"},{key:"option",title:"\u64CD\u4F5C"},{key:"optionDesc",title:"\u64CD\u4F5C\u63CF\u8FF0"},{key:"optionMan",title:"\u64CD\u4F5C\u4EBA\u5458"},{key:"mark",title:"\u5907\u6CE8"},{key:"edit",title:"\u7F16\u8F91"}],this.colDefs1=[{headerName:"\u5E8F\u53F7",valueGetter:function(i){return parseInt(i.node.id)+1},width:20,cellStyle:{"font-size":"8px"},field:"xh"},{headerName:"\u65F6\u95F4",field:"time",width:60,cellStyle:{"font-size":"8px"}},{headerName:"\u8F66\u724C",field:"carNo",width:60,cellStyle:{"font-size":"8px"}},{headerName:"\u8F66\u578B",field:"carType",width:50,cellStyle:{"font-size":"8px"}},{headerName:"\u5361\u53F7",field:"no",width:50,cellStyle:{"font-size":"8px"}},{headerName:"\u4F9B\u5E94\u5546",width:50,field:"supplier",cellStyle:{"font-size":"8px"}},{headerName:"\u6BDB\u91CD",width:50,field:"grossWeight",cellStyle:{"font-size":"8px"}},{headerName:"\u4E0A\u62A5\u70ED\u503C",width:50,field:"reportHotValue",cellStyle:{"font-size":"8px"}},{headerName:"\u4F30\u7B97\u70ED\u503C",width:50,field:"estimateValue",cellStyle:{"font-size":"8px"}}]}ngOnInit(){this.rowData1.push({xh:1,time:"13:25",carNo:"A4132",carType:"\u91CD\u5361",no:"6-*",supplier:"\u5927\u540C",grossWeight:"7.15",reportHotValue:"7.6",estimateValue:"7.51"}),this.rowData1.push({xh:1,time:"13:25",carNo:"A4132",carType:"\u91CD\u5361",no:"6-*",supplier:"\u5927\u540C",grossWeight:"7.15",reportHotValue:"7.6",estimateValue:"7.51"}),this.rowData1.push({xh:1,time:"13:25",carNo:"A4132",carType:"\u91CD\u5361",no:"6-*",supplier:"\u5927\u540C",grossWeight:"7.15",reportHotValue:"7.6",estimateValue:"7.51"}),console.log("-----\u8868\u683C\u521D\u59CB\u5316-----"),this.pageSize=5,this.pageIndex=1,this.pageRowTotal=this.rowData1.length}nzPageSizeChange(i){this.pageSize=i}nzPageIndexChange(i){console.log(`nzPageIndexChange${i}`),this.grid.api&&(i==1?this.grid.api.paginationGoToFirstPage():this.grid.api.paginationGoToPage(i))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["app-data-v-lj-car-info-table"]],viewQuery:function(n,a){if(n&1&&Mn(lTe,5),n&2){let o;fi(o=pi())&&(a.grid=o.first)}},inputs:{title:"title",defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData1:"rowData1",rowData2:"rowData2",rowData3:"rowData3",rowData4:"rowData4",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[Ar],ngContentSelectors:uTe,decls:43,vars:12,consts:[[1,"card-content"],[1,"table-container"],[1,"table-header"],[1,"grid-container"],[1,"grid-item"],[1,"rounded-border",2,"color","#ff0200"],["gridThemeClass","ag-theme-quartz ag-theme-datav",2,"width","100%","height","120px",3,"defaultColDef","rowData","columnDefs"],[1,"rounded-border",2,"color","#25f551"],[1,"rounded-border",2,"color","#bbbbbb"]],template:function(n,a){n&1&&(Sn(),ft(0,"div",0)(1,"div",1)(2,"div",2)(3,"span"),jt(4,"\u5E8F\u53F7"),ot(),ft(5,"span"),jt(6,"\u65F6\u95F4"),ot(),ft(7,"span"),jt(8,"\u8F66\u724C"),ot(),ft(9,"span"),jt(10,"\u8F66\u578B"),ot(),ft(11,"span"),jt(12,"\u5361\u53F7"),ot(),ft(13,"span"),jt(14,"\u4F9B\u5E94\u5546"),ot(),ft(15,"span"),jt(16,"\u6BDB\u91CD"),ot(),ft(17,"span"),jt(18,"\u4E0A\u62A5"),er(19,"br"),jt(20,"\u70ED\u503C"),ot(),ft(21,"span"),jt(22,"\u4F30\u7B97"),er(23,"br"),jt(24,"\u70ED\u503C"),ot()()(),ft(25,"div",3)(26,"div",4)(27,"div",5),jt(28,"#1"),ot(),er(29,"lj-car-ag-grid-component",6),ot(),ft(30,"div",4)(31,"div",7),jt(32,"#2"),ot(),er(33,"lj-car-ag-grid-component",6),ot(),ft(34,"div",4)(35,"div",5),jt(36,"#3"),ot(),er(37,"lj-car-ag-grid-component",6),ot(),ft(38,"div",4)(39,"div",8),jt(40,"#4"),ot(),er(41,"lj-car-ag-grid-component",6),ot()(),ni(42),ot()),n&2&&(st(29),rt("defaultColDef",a.defaultColDef)("rowData",a.rowData1)("columnDefs",a.colDefs1),st(4),rt("defaultColDef",a.defaultColDef)("rowData",a.rowData1)("columnDefs",a.colDefs1),st(4),rt("defaultColDef",a.defaultColDef)("rowData",a.rowData1)("columnDefs",a.colDefs1),st(4),rt("defaultColDef",a.defaultColDef)("rowData",a.rowData1)("columnDefs",a.colDefs1))},dependencies:[Ba,ka,io,Ja,ao,oo,no,to,Fa,Za,Ka,co,eo,$a,fn,Ua,Ya,qa,so,uo,Wa,Yn,Qa,Ha,ja,Xa,lo,za,Oa,ro,Ga,Wn,Va,Xn,U$],styles:['.card-top-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto;align-items:center;justify-content:space-between;margin-bottom:10px}.buttons-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end}.card-button[_ngcontent-%COMP%], span[nz-icon][_ngcontent-%COMP%]{margin-left:.5rem}.card-button[_ngcontent-%COMP%]{cursor:pointer;width:82px;height:40px;font-size:26px;line-height:20px;color:#00eff8;text-align:center;background-color:#213069;border:none;border-radius:3px}.card-content[_ngcontent-%COMP%]{overflow:hidden;margin-bottom:.5rem;//height: 18rem;padding:1rem 1.5rem;padding:1rem;//position: relative;background-image:url("./media/dashboard_card_bg2-IIPDCMYC.png");background-repeat:no-repeat;background-position:center;// background-position: top;background-size:100% 100%}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;flex-grow:1;align-items:center;justify-content:space-between;width:fit-content;height:fit-content;margin-bottom:.5rem;padding:5px 20px;font-size:28px;font-weight:600;line-height:22px;color:#74fafb;color:#00eff8;text-align:center;background-color:#19426e;border:1px solid #1f6f97;border-radius:10px 10px 0 0;box-shadow:inset 0 0 10px #1f6f97}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{flex:1;align-self:flex-start}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}.table-container[_ngcontent-%COMP%]{margin:10px 3px 20px 55px;padding:5px;border:1px solid #fff}.table-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.table-header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;font-size:12px;text-align:center}.grid-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;margin-bottom:20px}.rounded-border[_ngcontent-%COMP%]{display:flex;place-items:center center;justify-content:center;width:50px;height:40px;margin-right:10px;padding:3px;font-size:26px;font-weight:700;text-align:center;background-color:#21306a;border:1px solid #00EFF9;border-radius:2px}']});let r=e;return r})();function cTe(r,e){r&1&&(ft(0,"button",7),jt(1,"\u63D0\u4EA4"),ot())}function hTe(r,e){r&1&&(ft(0,"button",7),jt(1,"\u6253\u5370"),ot())}function fTe(r,e){r&1&&er(0,"span",8)}var pTe=["*"],O$=(()=>{let e=class e{constructor(){this.showSetting=!1,this.showEditButton=!1,this.optionsList=[],this.onCheckedItemsChange=new kL,this.title=""}getCheckedItems(){return this.optionsList.filter(i=>i.checked)}onCheckChange(){let i=this.getCheckedItems();this.onCheckedItemsChange.emit(i)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["lj-data-v-board-title"]],inputs:{showSetting:"showSetting",showEditButton:"showEditButton",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[Ar],ngContentSelectors:pTe,decls:10,vars:4,consts:[[1,"card-content"],[1,"card-top-content"],[1,"card-content-title"],[1,"card-content-l"],[1,"buttons-container"],["class","card-button",4,"ngIf"],["nz-icon","","nzType","setting","nzTheme","outline",4,"ngIf"],[1,"card-button"],["nz-icon","","nzType","setting","nzTheme","outline"]],template:function(n,a){n&1&&(Sn(),ft(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),jt(4),ot()(),ft(5,"div",4),gr(6,cTe,2,0,"button",5)(7,hTe,2,0,"button",5)(8,fTe,1,0,"span",6),ot()(),ni(9),ot()),n&2&&(st(4),ma(a.title),st(2),rt("ngIf",a.showEditButton),st(),rt("ngIf",a.showEditButton),st(),rt("ngIf",a.showSetting))},dependencies:[Wn,IV,lh,As,Ha,Ba,ka,io,Ja,ao,oo,no,to,Fa,Za,Ka,co,eo,$a,fn,Ua,NV,Ya,qa,so,uo,Wa,Yn,Qa,ja,Xa,lo,za,Oa,ro,Ga,Va,Xn],styles:['.card-top-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto;align-items:start;justify-content:space-between;margin-bottom:10px}.buttons-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end}.card-button[_ngcontent-%COMP%], span[nz-icon][_ngcontent-%COMP%]{margin-left:.5rem}.card-button[_ngcontent-%COMP%]{cursor:pointer;width:72px;height:40px;font-size:24px;line-height:20px;color:#00eff8;text-align:center;background-color:#213069;border:none;border-radius:3px}.card-content[_ngcontent-%COMP%]{overflow:hidden;height:350px;margin-bottom:.5rem;padding:1rem 1.5rem;padding:1rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-repeat:no-repeat;background-position:center;background-size:100% 100%}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;flex-grow:1;align-items:center;justify-content:space-between;width:fit-content;height:fit-content;margin-bottom:.5rem;padding:5px 20px;font-size:28px;font-weight:600;line-height:22px;color:#74fafb;color:#00eff8;text-align:center;background-color:#19426e;border:1px solid #1f6f97;border-radius:10px 10px 0 0;box-shadow:inset 0 0 10px #1f6f97}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{flex:1;align-self:flex-start}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let r=e;return r})();function dTe(r,e){if(r&1&&er(0,"div",5),r&2){let t=Dr();op("id",t.chartId)}}var MA=(()=>{let e=class e{constructor(){this.chartId="",this.text=""}ngOnInit(){setTimeout(()=>this.initCharts(),0)}initCharts(){console.log("\u521D\u59CB\u5316\u56FE\u8868"),console.log(this,this.chartId),console.log(this,this.chartId.toString());let i=Ev(document.getElementById(this.chartId)),n={tooltip:{formatter:"{a} <br/>{b} : {c}%"},series:[{name:"Pressure",type:"gauge",progress:{show:!0},detail:{valueAnimation:!0,formatter:"{value}"},data:[{value:50,name:"SCORE"}]}]};i.setOption(n)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["app-data-v-lj-text-dashboard"]],inputs:{chartId:"chartId",text:"text"},standalone:!0,features:[Ar],decls:7,vars:2,consts:[[1,"chart-card"],[1,"chart-container"],["class","chart-container",3,"id",4,"ngIf"],[1,"chart-text"],[1,"chart-button"],[1,"chart-container",3,"id"]],template:function(n,a){n&1&&(ft(0,"div",0)(1,"div",1),gr(2,dTe,1,1,"div",2),ot(),ft(3,"p",3),jt(4),ot(),ft(5,"button",4),jt(6,"1#\u91CD\u78C5"),ot()()),n&2&&(st(2),rt("ngIf",a.chartId),st(2),ma(a.text))},dependencies:[Ba,ka,io,Ja,ao,oo,no,to,Fa,Za,Ka,co,eo,$a,fn,Ua,Ya,qa,so,uo,Wa,Yn,Qa,Ha,ja,Xa,lo,za,Oa,ro,Ga,Wn,Va,Xn,lh,As],styles:[".chart-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center}.chart-text[_ngcontent-%COMP%]{margin:0;font-size:24px;color:#7eddf3}.chart-button[_ngcontent-%COMP%]{width:17rem;height:5;margin:5px;font-size:28px;line-height:22px;color:red;text-align:center;background-color:#06467800;background-image:url(/assets/dashboardButtonBg.png);background-repeat:no-repeat;background-position:center;background-size:contain;border-width:0}@media (min-width:0){.chart-button[_ngcontent-%COMP%]{font-size:12px}}@media (min-width: 360px){.chart-button[_ngcontent-%COMP%]{font-size:14px}}@media (min-width: 920px){.chart-button[_ngcontent-%COMP%]{font-size:18px}}@media (min-width: 1920px){.chart-button[_ngcontent-%COMP%]{font-size:26px}}.chart-container[_ngcontent-%COMP%]{width:10rem;height:10rem}"]});let r=e;return r})();var mTe=["myGrid"],bA=(()=>{let e=class e{constructor(){this.title="",this.showSetting=!0,this.defaultColDef={width:130,editable:!1,headerClass:"ag-header-center",cellStyle:{"font-weight":"bold",textAlign:"center","justify-content":"center","line-height":"38px"}},this.columnDefs=[],this.rowData=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz"}ngOnInit(){}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["app-data-v-lj-dashboard"]],viewQuery:function(n,a){if(n&1&&Mn(mTe,5),n&2){let o;fi(o=pi())&&(a.grid=o.first)}},inputs:{title:"title",defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData:"rowData",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[Ar],decls:4,vars:1,consts:[["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12",3,"title"],[2,"display","flex","justify-content","center","align-items","center"],["chartId","leftChart","text","\u91CD\u8861\u7CFB\u7EDF\u5065\u5EB7\u5EA6"],["chartId","rightChart","text","\u91CD\u8861\u7CFB\u7EDF\u6295\u8FD0\u7387"]],template:function(n,a){n&1&&(ft(0,"lj-data-v-board-title",0)(1,"div",1),er(2,"app-data-v-lj-text-dashboard",2)(3,"app-data-v-lj-text-dashboard",3),ot()()),n&2&&op("title",a.title)},dependencies:[Rm,MA,O$],encapsulation:2});let r=e;return r})();var VS="162";var z$=0,lz=1,F$=2;var wA=1,B$=2,Hl=3,hs=0,bi=1,fs=2,el=0,Cc=1,uz=2,cz=3,hz=4,k$=5,Rc=100,V$=101,G$=102,fz=103,pz=104,H$=200,W$=201,X$=202,Y$=203,GS=204,HS=205,q$=206,Z$=207,j$=208,K$=209,J$=210,$$=211,Q$=212,eQ=213,tQ=214,rQ=0,iQ=1,nQ=2,Zg=3,aQ=4,oQ=5,sQ=6,lQ=7,TA=0,uQ=1,cQ=2,tl=0,hQ=1,fQ=2,pQ=3,dQ=4,mQ=5,vQ=6,gQ=7;var dz=300,Wl=301,zu=302,WS=303,XS=304,mf=306,YS=1e3,Ea=1001,qS=1002,Gi=1003,mz=1004;var jg=1005;var tn=1006,EA=1007;var Xl=1008;var ps=1009,yQ=1010,_Q=1011,Kg=1012,AA=1013,ds=1014,No=1015,Lc=1016,CA=1017,RA=1018,rl=1020,xQ=1021,Un=1023,SQ=1024,MQ=1025,Yl=1026,Fu=1027,bQ=1028,LA=1029,wQ=1030,DA=1031,PA=1033,IA=33776,NA=33777,UA=33778,OA=33779,vz=35840,gz=35841,yz=35842,_z=35843,zA=36196,xz=37492,Sz=37496,Mz=37808,bz=37809,wz=37810,Tz=37811,Ez=37812,Az=37813,Cz=37814,Rz=37815,Lz=37816,Dz=37817,Pz=37818,Iz=37819,Nz=37820,Uz=37821,FA=36492,Oz=36494,zz=36495,TQ=36283,Fz=36284,Bz=36285,kz=36286;var EQ=3200,AQ=3201,CQ=0,RQ=1,il="",Uo="srgb",Oo="srgb-linear",Jg="display-p3",Ad="display-p3-linear",$g="linear",qr="srgb",Qg="rec709",ey="p3";var Cd=7680;var Vz=519,LQ=512,DQ=513,PQ=514,BA=515,IQ=516,NQ=517,UQ=518,OQ=519,Gz=35044;var Hz="300 es",ZS=1035,zo=2e3,Rd=2001;var Fo=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let n=i.slice(0);for(let a=0,o=n.length;a<o;a++)n[a].call(this,e);e.target=null}}};var ta=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var kA=Math.PI/180,jS=180/Math.PI;function Bu(){let r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(ta[r&255]+ta[r>>8&255]+ta[r>>16&255]+ta[r>>24&255]+"-"+ta[e&255]+ta[e>>8&255]+"-"+ta[e>>16&15|64]+ta[e>>24&255]+"-"+ta[t&63|128]+ta[t>>8&255]+"-"+ta[t>>16&255]+ta[t>>24&255]+ta[i&255]+ta[i>>8&255]+ta[i>>16&255]+ta[i>>24&255]).toLowerCase()}function rn(r,e,t){return Math.max(e,Math.min(t,r))}function zQ(r,e){return(r%e+e)%e}function VA(r,e,t){return(1-t)*r+t*e}function Wz(r){return(r&r-1)===0&&r!==0}function KS(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function ty(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Aa(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var Qt=class r{constructor(e=0,t=0){r.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(rn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),a=this.x-e.x,o=this.y-e.y;return this.x=a*i-o*n+e.x,this.y=a*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};var rr=class r{constructor(e,t,i,n,a,o,s,l,u){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u)}set(e,t,i,n,a,o,s,l,u){let c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=a,c[5]=l,c[6]=i,c[7]=o,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[3],l=i[6],u=i[1],c=i[4],h=i[7],f=i[2],p=i[5],d=i[8],g=n[0],m=n[3],v=n[6],_=n[1],y=n[4],x=n[7],M=n[2],S=n[5],w=n[8];return a[0]=o*g+s*_+l*M,a[3]=o*m+s*y+l*S,a[6]=o*v+s*x+l*w,a[1]=u*g+c*_+h*M,a[4]=u*m+c*y+h*S,a[7]=u*v+c*x+h*w,a[2]=f*g+p*_+d*M,a[5]=f*m+p*y+d*S,a[8]=f*v+p*x+d*w,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t*o*c-t*s*u-i*a*c+i*s*l+n*a*u-n*o*l}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=s*l-c*a,p=u*a-o*l,d=t*h+i*f+n*p;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/d;return e[0]=h*g,e[1]=(n*u-c*i)*g,e[2]=(s*i-n*o)*g,e[3]=f*g,e[4]=(c*t-n*l)*g,e[5]=(n*a-s*t)*g,e[6]=p*g,e[7]=(i*l-u*t)*g,e[8]=(o*t-i*a)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,a,o,s){let l=Math.cos(a),u=Math.sin(a);return this.set(i*l,i*u,-i*(l*o+u*s)+o+e,-n*u,n*l,-n*(-u*o+l*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(Xz.makeScale(e,t)),this}rotate(e){return this.premultiply(Xz.makeRotation(-e)),this}translate(e,t){return this.premultiply(Xz.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Xz=new rr;function GA(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function ry(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function BQ(){let r=ry("canvas");return r.style.display="block",r}var FQ={};function kQ(r){r in FQ||(FQ[r]=!0,console.warn(r))}var VQ=new rr().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),GQ=new rr().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),HA={[Oo]:{transfer:$g,primaries:Qg,toReference:r=>r,fromReference:r=>r},[Uo]:{transfer:qr,primaries:Qg,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[Ad]:{transfer:$g,primaries:ey,toReference:r=>r.applyMatrix3(GQ),fromReference:r=>r.applyMatrix3(VQ)},[Jg]:{transfer:qr,primaries:ey,toReference:r=>r.convertSRGBToLinear().applyMatrix3(GQ),fromReference:r=>r.applyMatrix3(VQ).convertLinearToSRGB()}},vTe=new Set([Oo,Ad]),Lr={enabled:!0,_workingColorSpace:Oo,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!vTe.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;let i=HA[e].toReference,n=HA[t].fromReference;return n(i(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return HA[r].primaries},getTransfer:function(r){return r===il?$g:HA[r].transfer}};function vf(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function WA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var iy,ny=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{iy===void 0&&(iy=ry("canvas")),iy.width=e.width,iy.height=e.height;let i=iy.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=iy}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=ry("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),a=n.data;for(let o=0;o<a.length;o++)a[o]=vf(a[o]/255)*255;return i.putImageData(n,0,0),t}else if(e.data){let t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(vf(t[i]/255)*255):t[i]=vf(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}};var gTe=0,ay=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:gTe++}),this.uuid=Bu(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let i={uuid:this.uuid,url:""},n=this.data;if(n!==null){let a;if(Array.isArray(n)){a=[];for(let o=0,s=n.length;o<s;o++)n[o].isDataTexture?a.push(Yz(n[o].image)):a.push(Yz(n[o]))}else a=Yz(n);i.url=a}return t||(e.images[this.uuid]=i),i}};function Yz(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?ny.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var yTe=0,Bo=(()=>{class r extends Fo{constructor(t=r.DEFAULT_IMAGE,i=r.DEFAULT_MAPPING,n=Ea,a=Ea,o=tn,s=Xl,l=Un,u=ps,c=r.DEFAULT_ANISOTROPY,h=il){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:yTe++}),this.uuid=Bu(),this.name="",this.source=new ay(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=n,this.wrapT=a,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=u,this.offset=new Qt(0,0),this.repeat=new Qt(1,1),this.center=new Qt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new rr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,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.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),i||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==dz)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case YS:t.x=t.x-Math.floor(t.x);break;case Ea:t.x=t.x<0?0:1;break;case qS:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case YS:t.y=t.y-Math.floor(t.y);break;case Ea:t.y=t.y<0?0:1;break;case qS:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}}return r.DEFAULT_IMAGE=null,r.DEFAULT_MAPPING=dz,r.DEFAULT_ANISOTROPY=1,r})();var li=class r{constructor(e=0,t=0,i=0,n=1){r.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*a,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*a,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*a,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,a,l=e.elements,u=l[0],c=l[4],h=l[8],f=l[1],p=l[5],d=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(c-f)<.01&&Math.abs(h-g)<.01&&Math.abs(d-m)<.01){if(Math.abs(c+f)<.1&&Math.abs(h+g)<.1&&Math.abs(d+m)<.1&&Math.abs(u+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let y=(u+1)/2,x=(p+1)/2,M=(v+1)/2,S=(c+f)/4,w=(h+g)/4,T=(d+m)/4;return y>x&&y>M?y<.01?(i=0,n=.707106781,a=.707106781):(i=Math.sqrt(y),n=S/i,a=w/i):x>M?x<.01?(i=.707106781,n=0,a=.707106781):(n=Math.sqrt(x),i=S/n,a=T/n):M<.01?(i=.707106781,n=.707106781,a=0):(a=Math.sqrt(M),i=w/a,n=T/a),this.set(i,n,a,t),this}let _=Math.sqrt((m-d)*(m-d)+(h-g)*(h-g)+(f-c)*(f-c));return Math.abs(_)<.001&&(_=1),this.x=(m-d)/_,this.y=(h-g)/_,this.z=(f-c)/_,this.w=Math.acos((u+p+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){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(){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(){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(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};var XA=class extends Fo{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new li(0,0,e,t),this.scissorTest=!1,this.viewport=new li(0,0,e,t);let n={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let a=new Bo(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);a.flipY=!1,a.generateMipmaps=i.generateMipmaps,a.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let s=0;s<o;s++)this.textures[s]=a.clone(),this.textures[s].isRenderTargetTexture=!0;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,a=this.textures.length;n<a;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,n=e.textures.length;i<n;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new ay(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}};var ko=class extends XA{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}};var oy=class extends Bo{constructor(e=null,t=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=Gi,this.minFilter=Gi,this.wrapR=Ea,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var YA=class extends Bo{constructor(e=null,t=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=Gi,this.minFilter=Gi,this.wrapR=Ea,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Vu=class{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,a,o,s){let l=i[n+0],u=i[n+1],c=i[n+2],h=i[n+3],f=a[o+0],p=a[o+1],d=a[o+2],g=a[o+3];if(s===0){e[t+0]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h;return}if(s===1){e[t+0]=f,e[t+1]=p,e[t+2]=d,e[t+3]=g;return}if(h!==g||l!==f||u!==p||c!==d){let m=1-s,v=l*f+u*p+c*d+h*g,_=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){let M=Math.sqrt(y),S=Math.atan2(M,v*_);m=Math.sin(m*S)/M,s=Math.sin(s*S)/M}let x=s*_;if(l=l*m+f*x,u=u*m+p*x,c=c*m+d*x,h=h*m+g*x,m===1-s){let M=1/Math.sqrt(l*l+u*u+c*c+h*h);l*=M,u*=M,c*=M,h*=M}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,n,a,o){let s=i[n],l=i[n+1],u=i[n+2],c=i[n+3],h=a[o],f=a[o+1],p=a[o+2],d=a[o+3];return e[t]=s*d+c*h+l*p-u*f,e[t+1]=l*d+c*f+u*h-s*p,e[t+2]=u*d+c*p+s*f-l*h,e[t+3]=c*d-s*h-l*f-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let i=e._x,n=e._y,a=e._z,o=e._order,s=Math.cos,l=Math.sin,u=s(i/2),c=s(n/2),h=s(a/2),f=l(i/2),p=l(n/2),d=l(a/2);switch(o){case"XYZ":this._x=f*c*h+u*p*d,this._y=u*p*h-f*c*d,this._z=u*c*d+f*p*h,this._w=u*c*h-f*p*d;break;case"YXZ":this._x=f*c*h+u*p*d,this._y=u*p*h-f*c*d,this._z=u*c*d-f*p*h,this._w=u*c*h+f*p*d;break;case"ZXY":this._x=f*c*h-u*p*d,this._y=u*p*h+f*c*d,this._z=u*c*d+f*p*h,this._w=u*c*h-f*p*d;break;case"ZYX":this._x=f*c*h-u*p*d,this._y=u*p*h+f*c*d,this._z=u*c*d-f*p*h,this._w=u*c*h+f*p*d;break;case"YZX":this._x=f*c*h+u*p*d,this._y=u*p*h+f*c*d,this._z=u*c*d-f*p*h,this._w=u*c*h-f*p*d;break;case"XZY":this._x=f*c*h-u*p*d,this._y=u*p*h-f*c*d,this._z=u*c*d+f*p*h,this._w=u*c*h+f*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],a=t[8],o=t[1],s=t[5],l=t[9],u=t[2],c=t[6],h=t[10],f=i+s+h;if(f>0){let p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(c-l)*p,this._y=(a-u)*p,this._z=(o-n)*p}else if(i>s&&i>h){let p=2*Math.sqrt(1+i-s-h);this._w=(c-l)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(a+u)/p}else if(s>h){let p=2*Math.sqrt(1+s-i-h);this._w=(a-u)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(l+c)/p}else{let p=2*Math.sqrt(1+h-i-s);this._w=(o-n)/p,this._x=(a+u)/p,this._y=(l+c)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(rn(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,a=e._z,o=e._w,s=t._x,l=t._y,u=t._z,c=t._w;return this._x=i*c+o*s+n*u-a*l,this._y=n*c+o*l+a*s-i*u,this._z=a*c+o*u+i*l-n*s,this._w=o*c-i*s-n*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,n=this._y,a=this._z,o=this._w,s=o*e._w+i*e._x+n*e._y+a*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=n,this._z=a,this;let l=1-s*s;if(l<=Number.EPSILON){let p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*a+t*this._z,this.normalize(),this}let u=Math.sqrt(l),c=Math.atan2(u,s),h=Math.sin((1-t)*c)/u,f=Math.sin(t*c)/u;return this._w=o*h+this._w*f,this._x=i*h+this._x*f,this._y=n*h+this._y*f,this._z=a*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};var be=class r{constructor(e=0,t=0,i=0){r.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(HQ.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(HQ.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*n,this.y=a[1]*t+a[4]*i+a[7]*n,this.z=a[2]*t+a[5]*i+a[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=e.elements,o=1/(a[3]*t+a[7]*i+a[11]*n+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*n+a[12])*o,this.y=(a[1]*t+a[5]*i+a[9]*n+a[13])*o,this.z=(a[2]*t+a[6]*i+a[10]*n+a[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,a=e.x,o=e.y,s=e.z,l=e.w,u=2*(o*n-s*i),c=2*(s*t-a*n),h=2*(a*i-o*t);return this.x=t+l*u+o*h-s*c,this.y=i+l*c+s*u-a*h,this.z=n+l*h+a*c-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n,this.y=a[1]*t+a[5]*i+a[9]*n,this.z=a[2]*t+a[6]*i+a[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,a=e.z,o=t.x,s=t.y,l=t.z;return this.x=n*l-a*s,this.y=a*o-i*l,this.z=i*s-n*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return qz.copy(this).projectOnVector(e),this.sub(qz)}reflect(e){return this.sub(qz.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(rn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},qz=new be,HQ=new Vu;var Pc=class{constructor(e=new be(1/0,1/0,1/0),t=new be(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(ql.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(ql.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=ql.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){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(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(i!==void 0){let a=i.getAttribute("position");if(t===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let o=0,s=a.count;o<s;o++)e.isMesh===!0?e.getVertexPosition(o,ql):ql.fromBufferAttribute(a,o),ql.applyMatrix4(e.matrixWorld),this.expandByPoint(ql);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),qA.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),qA.copy(i.boundingBox)),qA.applyMatrix4(e.matrixWorld),this.union(qA)}let n=e.children;for(let a=0,o=n.length;a<o;a++)this.expandByObject(n[a],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,ql),ql.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(JS),ZA.subVectors(this.max,JS),sy.subVectors(e.a,JS),ly.subVectors(e.b,JS),uy.subVectors(e.c,JS),gf.subVectors(ly,sy),yf.subVectors(uy,ly),Ld.subVectors(sy,uy);let t=[0,-gf.z,gf.y,0,-yf.z,yf.y,0,-Ld.z,Ld.y,gf.z,0,-gf.x,yf.z,0,-yf.x,Ld.z,0,-Ld.x,-gf.y,gf.x,0,-yf.y,yf.x,0,-Ld.y,Ld.x,0];return!Zz(t,sy,ly,uy,ZA)||(t=[1,0,0,0,1,0,0,0,1],!Zz(t,sy,ly,uy,ZA))?!1:(jA.crossVectors(gf,yf),t=[jA.x,jA.y,jA.z],Zz(t,sy,ly,uy,ZA))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ql).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ql).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Dc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Dc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Dc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Dc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Dc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Dc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Dc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Dc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Dc),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},Dc=[new be,new be,new be,new be,new be,new be,new be,new be],ql=new be,qA=new Pc,sy=new be,ly=new be,uy=new be,gf=new be,yf=new be,Ld=new be,JS=new be,ZA=new be,jA=new be,Dd=new be;function Zz(r,e,t,i,n){for(let a=0,o=r.length-3;a<=o;a+=3){Dd.fromArray(r,a);let s=n.x*Math.abs(Dd.x)+n.y*Math.abs(Dd.y)+n.z*Math.abs(Dd.z),l=e.dot(Dd),u=t.dot(Dd),c=i.dot(Dd);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var _Te=new Pc,$S=new be,jz=new be,_f=class{constructor(e=new be,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):_Te.setFromPoints(e).getCenter(i);let n=0;for(let a=0,o=e.length;a<o;a++)n=Math.max(n,i.distanceToSquared(e[a]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;$S.subVectors(e,this.center);let t=$S.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector($S,n/i),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(jz.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint($S.copy(e.center).add(jz)),this.expandByPoint($S.copy(e.center).sub(jz))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};var Ic=new be,Kz=new be,KA=new be,xf=new be,Jz=new be,JA=new be,$z=new be,$A=class{constructor(e=new be,t=new be(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ic)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Ic.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ic.copy(this.origin).addScaledVector(this.direction,t),Ic.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){Kz.copy(e).add(t).multiplyScalar(.5),KA.copy(t).sub(e).normalize(),xf.copy(this.origin).sub(Kz);let a=e.distanceTo(t)*.5,o=-this.direction.dot(KA),s=xf.dot(this.direction),l=-xf.dot(KA),u=xf.lengthSq(),c=Math.abs(1-o*o),h,f,p,d;if(c>0)if(h=o*l-s,f=o*s-l,d=a*c,h>=0)if(f>=-d)if(f<=d){let g=1/c;h*=g,f*=g,p=h*(h+o*f+2*s)+f*(o*h+f+2*l)+u}else f=a,h=Math.max(0,-(o*f+s)),p=-h*h+f*(f+2*l)+u;else f=-a,h=Math.max(0,-(o*f+s)),p=-h*h+f*(f+2*l)+u;else f<=-d?(h=Math.max(0,-(-o*a+s)),f=h>0?-a:Math.min(Math.max(-a,-l),a),p=-h*h+f*(f+2*l)+u):f<=d?(h=0,f=Math.min(Math.max(-a,-l),a),p=f*(f+2*l)+u):(h=Math.max(0,-(o*a+s)),f=h>0?a:Math.min(Math.max(-a,-l),a),p=-h*h+f*(f+2*l)+u);else f=o>0?-a:a,h=Math.max(0,-(o*f+s)),p=-h*h+f*(f+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,h),n&&n.copy(Kz).addScaledVector(KA,f),p}intersectSphere(e,t){Ic.subVectors(e.center,this.origin);let i=Ic.dot(this.direction),n=Ic.dot(Ic)-i*i,a=e.radius*e.radius;if(n>a)return null;let o=Math.sqrt(a-n),s=i-o,l=i+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,a,o,s,l,u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,f=this.origin;return u>=0?(i=(e.min.x-f.x)*u,n=(e.max.x-f.x)*u):(i=(e.max.x-f.x)*u,n=(e.min.x-f.x)*u),c>=0?(a=(e.min.y-f.y)*c,o=(e.max.y-f.y)*c):(a=(e.max.y-f.y)*c,o=(e.min.y-f.y)*c),i>o||a>n||((a>i||isNaN(i))&&(i=a),(o<n||isNaN(n))&&(n=o),h>=0?(s=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(s=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||s>n)||((s>i||i!==i)&&(i=s),(l<n||n!==n)&&(n=l),n<0)?null:this.at(i>=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,Ic)!==null}intersectTriangle(e,t,i,n,a){Jz.subVectors(t,e),JA.subVectors(i,e),$z.crossVectors(Jz,JA);let o=this.direction.dot($z),s;if(o>0){if(n)return null;s=1}else if(o<0)s=-1,o=-o;else return null;xf.subVectors(this.origin,e);let l=s*this.direction.dot(JA.crossVectors(xf,JA));if(l<0)return null;let u=s*this.direction.dot(Jz.cross(xf));if(u<0||l+u>o)return null;let c=-s*xf.dot($z);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};var Zr=class r{constructor(e,t,i,n,a,o,s,l,u,c,h,f,p,d,g,m){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u,c,h,f,p,d,g,m)}set(e,t,i,n,a,o,s,l,u,c,h,f,p,d,g,m){let v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=a,v[5]=o,v[9]=s,v[13]=l,v[2]=u,v[6]=c,v[10]=h,v[14]=f,v[3]=p,v[7]=d,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/cy.setFromMatrixColumn(e,0).length(),a=1/cy.setFromMatrixColumn(e,1).length(),o=1/cy.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,a=e.z,o=Math.cos(i),s=Math.sin(i),l=Math.cos(n),u=Math.sin(n),c=Math.cos(a),h=Math.sin(a);if(e.order==="XYZ"){let f=o*c,p=o*h,d=s*c,g=s*h;t[0]=l*c,t[4]=-l*h,t[8]=u,t[1]=p+d*u,t[5]=f-g*u,t[9]=-s*l,t[2]=g-f*u,t[6]=d+p*u,t[10]=o*l}else if(e.order==="YXZ"){let f=l*c,p=l*h,d=u*c,g=u*h;t[0]=f+g*s,t[4]=d*s-p,t[8]=o*u,t[1]=o*h,t[5]=o*c,t[9]=-s,t[2]=p*s-d,t[6]=g+f*s,t[10]=o*l}else if(e.order==="ZXY"){let f=l*c,p=l*h,d=u*c,g=u*h;t[0]=f-g*s,t[4]=-o*h,t[8]=d+p*s,t[1]=p+d*s,t[5]=o*c,t[9]=g-f*s,t[2]=-o*u,t[6]=s,t[10]=o*l}else if(e.order==="ZYX"){let f=o*c,p=o*h,d=s*c,g=s*h;t[0]=l*c,t[4]=d*u-p,t[8]=f*u+g,t[1]=l*h,t[5]=g*u+f,t[9]=p*u-d,t[2]=-u,t[6]=s*l,t[10]=o*l}else if(e.order==="YZX"){let f=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=g-f*h,t[8]=d*h+p,t[1]=h,t[5]=o*c,t[9]=-s*c,t[2]=-u*c,t[6]=p*h+d,t[10]=f-g*h}else if(e.order==="XZY"){let f=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=-h,t[8]=u*c,t[1]=f*h+g,t[5]=o*c,t[9]=p*h-d,t[2]=d*h-p,t[6]=s*c,t[10]=g*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(xTe,e,STe)}lookAt(e,t,i){let n=this.elements;return ms.subVectors(e,t),ms.lengthSq()===0&&(ms.z=1),ms.normalize(),Sf.crossVectors(i,ms),Sf.lengthSq()===0&&(Math.abs(i.z)===1?ms.x+=1e-4:ms.z+=1e-4,ms.normalize(),Sf.crossVectors(i,ms)),Sf.normalize(),QA.crossVectors(ms,Sf),n[0]=Sf.x,n[4]=QA.x,n[8]=ms.x,n[1]=Sf.y,n[5]=QA.y,n[9]=ms.y,n[2]=Sf.z,n[6]=QA.z,n[10]=ms.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[4],l=i[8],u=i[12],c=i[1],h=i[5],f=i[9],p=i[13],d=i[2],g=i[6],m=i[10],v=i[14],_=i[3],y=i[7],x=i[11],M=i[15],S=n[0],w=n[4],T=n[8],C=n[12],b=n[1],E=n[5],I=n[9],R=n[13],A=n[2],P=n[6],U=n[10],B=n[14],z=n[3],k=n[7],G=n[11],Y=n[15];return a[0]=o*S+s*b+l*A+u*z,a[4]=o*w+s*E+l*P+u*k,a[8]=o*T+s*I+l*U+u*G,a[12]=o*C+s*R+l*B+u*Y,a[1]=c*S+h*b+f*A+p*z,a[5]=c*w+h*E+f*P+p*k,a[9]=c*T+h*I+f*U+p*G,a[13]=c*C+h*R+f*B+p*Y,a[2]=d*S+g*b+m*A+v*z,a[6]=d*w+g*E+m*P+v*k,a[10]=d*T+g*I+m*U+v*G,a[14]=d*C+g*R+m*B+v*Y,a[3]=_*S+y*b+x*A+M*z,a[7]=_*w+y*E+x*P+M*k,a[11]=_*T+y*I+x*U+M*G,a[15]=_*C+y*R+x*B+M*Y,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],a=e[12],o=e[1],s=e[5],l=e[9],u=e[13],c=e[2],h=e[6],f=e[10],p=e[14],d=e[3],g=e[7],m=e[11],v=e[15];return d*(+a*l*h-n*u*h-a*s*f+i*u*f+n*s*p-i*l*p)+g*(+t*l*p-t*u*f+a*o*f-n*o*p+n*u*c-a*l*c)+m*(+t*u*h-t*s*p-a*o*h+i*o*p+a*s*c-i*u*c)+v*(-n*s*c-t*l*h+t*s*f+n*o*h-i*o*f+i*l*c)}transpose(){let e=this.elements,t;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(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],_=h*m*u-g*f*u+g*l*p-s*m*p-h*l*v+s*f*v,y=d*f*u-c*m*u-d*l*p+o*m*p+c*l*v-o*f*v,x=c*g*u-d*h*u+d*s*p-o*g*p-c*s*v+o*h*v,M=d*h*l-c*g*l-d*s*f+o*g*f+c*s*m-o*h*m,S=t*_+i*y+n*x+a*M;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/S;return e[0]=_*w,e[1]=(g*f*a-h*m*a-g*n*p+i*m*p+h*n*v-i*f*v)*w,e[2]=(s*m*a-g*l*a+g*n*u-i*m*u-s*n*v+i*l*v)*w,e[3]=(h*l*a-s*f*a-h*n*u+i*f*u+s*n*p-i*l*p)*w,e[4]=y*w,e[5]=(c*m*a-d*f*a+d*n*p-t*m*p-c*n*v+t*f*v)*w,e[6]=(d*l*a-o*m*a-d*n*u+t*m*u+o*n*v-t*l*v)*w,e[7]=(o*f*a-c*l*a+c*n*u-t*f*u-o*n*p+t*l*p)*w,e[8]=x*w,e[9]=(d*h*a-c*g*a-d*i*p+t*g*p+c*i*v-t*h*v)*w,e[10]=(o*g*a-d*s*a+d*i*u-t*g*u-o*i*v+t*s*v)*w,e[11]=(c*s*a-o*h*a-c*i*u+t*h*u+o*i*p-t*s*p)*w,e[12]=M*w,e[13]=(c*g*n-d*h*n+d*i*f-t*g*f-c*i*m+t*h*m)*w,e[14]=(d*s*n-o*g*n-d*i*l+t*g*l+o*i*m-t*s*m)*w,e[15]=(o*h*n-c*s*n+c*i*l-t*h*l-o*i*f+t*s*f)*w,this}scale(e){let t=this.elements,i=e.x,n=e.y,a=e.z;return t[0]*=i,t[4]*=n,t[8]*=a,t[1]*=i,t[5]*=n,t[9]*=a,t[2]*=i,t[6]*=n,t[10]*=a,t[3]*=i,t[7]*=n,t[11]*=a,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),a=1-i,o=e.x,s=e.y,l=e.z,u=a*o,c=a*s;return this.set(u*o+i,u*s-n*l,u*l+n*s,0,u*s+n*l,c*s+i,c*l-n*o,0,u*l-n*s,c*l+n*o,a*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,a,o){return this.set(1,i,a,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,a=t._x,o=t._y,s=t._z,l=t._w,u=a+a,c=o+o,h=s+s,f=a*u,p=a*c,d=a*h,g=o*c,m=o*h,v=s*h,_=l*u,y=l*c,x=l*h,M=i.x,S=i.y,w=i.z;return n[0]=(1-(g+v))*M,n[1]=(p+x)*M,n[2]=(d-y)*M,n[3]=0,n[4]=(p-x)*S,n[5]=(1-(f+v))*S,n[6]=(m+_)*S,n[7]=0,n[8]=(d+y)*w,n[9]=(m-_)*w,n[10]=(1-(f+g))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,a=cy.set(n[0],n[1],n[2]).length(),o=cy.set(n[4],n[5],n[6]).length(),s=cy.set(n[8],n[9],n[10]).length();this.determinant()<0&&(a=-a),e.x=n[12],e.y=n[13],e.z=n[14],Zl.copy(this);let u=1/a,c=1/o,h=1/s;return Zl.elements[0]*=u,Zl.elements[1]*=u,Zl.elements[2]*=u,Zl.elements[4]*=c,Zl.elements[5]*=c,Zl.elements[6]*=c,Zl.elements[8]*=h,Zl.elements[9]*=h,Zl.elements[10]*=h,t.setFromRotationMatrix(Zl),i.x=a,i.y=o,i.z=s,this}makePerspective(e,t,i,n,a,o,s=zo){let l=this.elements,u=2*a/(t-e),c=2*a/(i-n),h=(t+e)/(t-e),f=(i+n)/(i-n),p,d;if(s===zo)p=-(o+a)/(o-a),d=-2*o*a/(o-a);else if(s===Rd)p=-o/(o-a),d=-o*a/(o-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=d,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,a,o,s=zo){let l=this.elements,u=1/(t-e),c=1/(i-n),h=1/(o-a),f=(t+e)*u,p=(i+n)*c,d,g;if(s===zo)d=(o+a)*h,g=-2*h;else if(s===Rd)d=a*h,g=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=g,l[14]=-d,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},cy=new be,Zl=new Zr,xTe=new be(0,0,0),STe=new be(1,1,1),Sf=new be,QA=new be,ms=new be;var WQ=new Zr,XQ=new Vu,jl=(()=>{class r{constructor(t=0,i=0,n=0,a=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=a}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,n,a=this._order){return this._x=t,this._y=i,this._z=n,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,n=!0){let a=t.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],h=a[9],f=a[2],p=a[6],d=a[10];switch(i){case"XYZ":this._y=Math.asin(rn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-rn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(l,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(rn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-rn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(rn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(l,d));break;case"XZY":this._z=Math.asin(-rn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,n){return WQ.makeRotationFromQuaternion(t),this.setFromRotationMatrix(WQ,i,n)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return XQ.setFromEuler(this),this.setFromQuaternion(XQ,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return r.DEFAULT_ORDER="XYZ",r})();var hy=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}};var MTe=0,YQ=new be,fy=new Vu,Nc=new Zr,eC=new be,QS=new be,bTe=new be,wTe=new Vu,qQ=new be(1,0,0),ZQ=new be(0,1,0),jQ=new be(0,0,1),TTe={type:"added"},ETe={type:"removed"},Qz={type:"childadded",child:null},eF={type:"childremoved",child:null},nn=(()=>{class r extends Fo{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:MTe++}),this.uuid=Bu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new be,i=new jl,n=new Vu,a=new be(1,1,1);function o(){n.setFromEuler(i,!1)}function s(){i.setFromQuaternion(n,void 0,!1)}i._onChange(o),n._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new Zr},normalMatrix:{value:new rr}}),this.matrix=new Zr,this.matrixWorld=new Zr,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new hy,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return fy.setFromAxisAngle(t,i),this.quaternion.multiply(fy),this}rotateOnWorldAxis(t,i){return fy.setFromAxisAngle(t,i),this.quaternion.premultiply(fy),this}rotateX(t){return this.rotateOnAxis(qQ,t)}rotateY(t){return this.rotateOnAxis(ZQ,t)}rotateZ(t){return this.rotateOnAxis(jQ,t)}translateOnAxis(t,i){return YQ.copy(t).applyQuaternion(this.quaternion),this.position.add(YQ.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(qQ,t)}translateY(t){return this.translateOnAxis(ZQ,t)}translateZ(t){return this.translateOnAxis(jQ,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Nc.copy(this.matrixWorld).invert())}lookAt(t,i,n){t.isVector3?eC.copy(t):eC.set(t,i,n);let a=this.parent;this.updateWorldMatrix(!0,!1),QS.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Nc.lookAt(QS,eC,this.up):Nc.lookAt(eC,QS,this.up),this.quaternion.setFromRotationMatrix(Nc),a&&(Nc.extractRotation(a.matrixWorld),fy.setFromRotationMatrix(Nc),this.quaternion.premultiply(fy.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);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?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(TTe),Qz.child=t,this.dispatchEvent(Qz),Qz.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let i=this.children.indexOf(t);return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(ETe),eF.child=t,this.dispatchEvent(eF),eF.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Nc.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Nc.multiply(t.parent.matrixWorld)),t.applyMatrix4(Nc),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let n=0,a=this.children.length;n<a;n++){let s=this.children[n].getObjectByProperty(t,i);if(s!==void 0)return s}}getObjectsByProperty(t,i,n=[]){this[t]===i&&n.push(this);let a=this.children;for(let o=0,s=a.length;o<s;o++)a[o].getObjectsByProperty(t,i,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(QS,t,bTe),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(QS,wTe,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);let i=this.children;for(let n=0,a=i.length;n<a;n++)i[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let i=this.children;for(let n=0,a=i.length;n<a;n++)i[n].traverseVisible(t)}traverseAncestors(t){let i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let i=this.children;for(let n=0,a=i.length;n<a;n++){let o=i[n];(o.matrixWorldAutoUpdate===!0||t===!0)&&o.updateMatrixWorld(t)}}updateWorldMatrix(t,i){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),i===!0){let a=this.children;for(let o=0,s=a.length;o<s;o++){let l=a[o];l.matrixWorldAutoUpdate===!0&&l.updateWorldMatrix(!1,!0)}}}toJSON(t){let i=t===void 0||typeof t=="string",n={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let a={};a.uuid=this.uuid,a.type=this.type,this.name!==""&&(a.name=this.name),this.castShadow===!0&&(a.castShadow=!0),this.receiveShadow===!0&&(a.receiveShadow=!0),this.visible===!1&&(a.visible=!1),this.frustumCulled===!1&&(a.frustumCulled=!1),this.renderOrder!==0&&(a.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.visibility=this._visibility,a.active=this._active,a.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),a.maxGeometryCount=this._maxGeometryCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.geometryCount=this._geometryCount,a.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(a.boundingSphere={center:a.boundingSphere.center.toArray(),radius:a.boundingSphere.radius}),this.boundingBox!==null&&(a.boundingBox={min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}));function o(l,u){return l[u.uuid]===void 0&&(l[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=o(t.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let u=l.shapes;if(Array.isArray(u))for(let c=0,h=u.length;c<h;c++){let f=u[c];o(t.shapes,f)}else o(t.shapes,u)}}if(this.isSkinnedMesh&&(a.bindMode=this.bindMode,a.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(t.skeletons,this.skeleton),a.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let l=[];for(let u=0,c=this.material.length;u<c;u++)l.push(o(t.materials,this.material[u]));a.material=l}else a.material=o(t.materials,this.material);if(this.children.length>0){a.children=[];for(let l=0;l<this.children.length;l++)a.children.push(this.children[l].toJSON(t).object)}if(this.animations.length>0){a.animations=[];for(let l=0;l<this.animations.length;l++){let u=this.animations[l];a.animations.push(o(t.animations,u))}}if(i){let l=s(t.geometries),u=s(t.materials),c=s(t.textures),h=s(t.images),f=s(t.shapes),p=s(t.skeletons),d=s(t.animations),g=s(t.nodes);l.length>0&&(n.geometries=l),u.length>0&&(n.materials=u),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),p.length>0&&(n.skeletons=p),d.length>0&&(n.animations=d),g.length>0&&(n.nodes=g)}return n.object=a,n;function s(l){let u=[];for(let c in l){let h=l[c];delete h.metadata,u.push(h)}return u}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,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.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,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.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let n=0;n<t.children.length;n++){let a=t.children[n];this.add(a.clone())}return this}}return r.DEFAULT_UP=new be(0,1,0),r.DEFAULT_MATRIX_AUTO_UPDATE=!0,r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,r})();var Kl=new be,Uc=new be,tF=new be,Oc=new be,py=new be,dy=new be,KQ=new be,rF=new be,iF=new be,nF=new be,Pd=class r{constructor(e=new be,t=new be,i=new be){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),Kl.subVectors(e,t),n.cross(Kl);let a=n.lengthSq();return a>0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(e,t,i,n,a){Kl.subVectors(n,t),Uc.subVectors(i,t),tF.subVectors(e,t);let o=Kl.dot(Kl),s=Kl.dot(Uc),l=Kl.dot(tF),u=Uc.dot(Uc),c=Uc.dot(tF),h=o*u-s*s;if(h===0)return a.set(0,0,0),null;let f=1/h,p=(u*l-s*c)*f,d=(o*c-s*l)*f;return a.set(1-p-d,d,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Oc)===null?!1:Oc.x>=0&&Oc.y>=0&&Oc.x+Oc.y<=1}static getInterpolation(e,t,i,n,a,o,s,l){return this.getBarycoord(e,t,i,n,Oc)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,Oc.x),l.addScaledVector(o,Oc.y),l.addScaledVector(s,Oc.z),l)}static isFrontFacing(e,t,i,n){return Kl.subVectors(i,t),Uc.subVectors(e,t),Kl.cross(Uc).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Kl.subVectors(this.c,this.b),Uc.subVectors(this.a,this.b),Kl.cross(Uc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return r.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return r.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,a){return r.getInterpolation(e,this.a,this.b,this.c,t,i,n,a)}containsPoint(e){return r.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return r.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,n=this.b,a=this.c,o,s;py.subVectors(n,i),dy.subVectors(a,i),rF.subVectors(e,i);let l=py.dot(rF),u=dy.dot(rF);if(l<=0&&u<=0)return t.copy(i);iF.subVectors(e,n);let c=py.dot(iF),h=dy.dot(iF);if(c>=0&&h<=c)return t.copy(n);let f=l*h-c*u;if(f<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(i).addScaledVector(py,o);nF.subVectors(e,a);let p=py.dot(nF),d=dy.dot(nF);if(d>=0&&p<=d)return t.copy(a);let g=p*u-l*d;if(g<=0&&u>=0&&d<=0)return s=u/(u-d),t.copy(i).addScaledVector(dy,s);let m=c*d-p*h;if(m<=0&&h-c>=0&&p-d>=0)return KQ.subVectors(a,n),s=(h-c)/(h-c+(p-d)),t.copy(n).addScaledVector(KQ,s);let v=1/(m+g+f);return o=g*v,s=f*v,t.copy(i).addScaledVector(py,o).addScaledVector(dy,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};var JQ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Mf={h:0,s:0,l:0},tC={h:0,s:0,l:0};function aF(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}var or=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Uo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Lr.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=Lr.workingColorSpace){return this.r=e,this.g=t,this.b=i,Lr.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=Lr.workingColorSpace){if(e=zQ(e,1),t=rn(t,0,1),i=rn(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,o=2*i-a;this.r=aF(o,a,e+1/3),this.g=aF(o,a,e),this.b=aF(o,a,e-1/3)}return Lr.toWorkingColorSpace(this,n),this}setStyle(e,t=Uo){function i(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let a,o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=n[1],o=a.length;if(o===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Uo){let i=JQ[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=vf(e.r),this.g=vf(e.g),this.b=vf(e.b),this}copyLinearToSRGB(e){return this.r=WA(e.r),this.g=WA(e.g),this.b=WA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Uo){return Lr.fromWorkingColorSpace(ra.copy(this),e),Math.round(rn(ra.r*255,0,255))*65536+Math.round(rn(ra.g*255,0,255))*256+Math.round(rn(ra.b*255,0,255))}getHexString(e=Uo){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Lr.workingColorSpace){Lr.fromWorkingColorSpace(ra.copy(this),t);let i=ra.r,n=ra.g,a=ra.b,o=Math.max(i,n,a),s=Math.min(i,n,a),l,u,c=(s+o)/2;if(s===o)l=0,u=0;else{let h=o-s;switch(u=c<=.5?h/(o+s):h/(2-o-s),o){case i:l=(n-a)/h+(n<a?6:0);break;case n:l=(a-i)/h+2;break;case a:l=(i-n)/h+4;break}l/=6}return e.h=l,e.s=u,e.l=c,e}getRGB(e,t=Lr.workingColorSpace){return Lr.fromWorkingColorSpace(ra.copy(this),t),e.r=ra.r,e.g=ra.g,e.b=ra.b,e}getStyle(e=Uo){Lr.fromWorkingColorSpace(ra.copy(this),e);let t=ra.r,i=ra.g,n=ra.b;return e!==Uo?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(n*255)})`}offsetHSL(e,t,i){return this.getHSL(Mf),this.setHSL(Mf.h+e,Mf.s+t,Mf.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Mf),e.getHSL(tC);let i=VA(Mf.h,tC.h,t),n=VA(Mf.s,tC.s,t),a=VA(Mf.l,tC.l,t);return this.setHSL(i,n,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,n=this.b,a=e.elements;return this.r=a[0]*t+a[3]*i+a[6]*n,this.g=a[1]*t+a[4]*i+a[7]*n,this.b=a[2]*t+a[5]*i+a[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},ra=new or;or.NAMES=JQ;var ATe=0,Gu=class extends Fo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ATe++}),this.uuid=Bu(),this.name="",this.type="Material",this.blending=Cc,this.side=hs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=GS,this.blendDst=HS,this.blendEquation=Rc,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new or(0,0,0),this.blendAlpha=0,this.depthFunc=Zg,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Vz,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Cd,this.stencilZFail=Cd,this.stencilZPass=Cd,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let n=this[t];if(n===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Cc&&(i.blending=this.blending),this.side!==hs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==GS&&(i.blendSrc=this.blendSrc),this.blendDst!==HS&&(i.blendDst=this.blendDst),this.blendEquation!==Rc&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Zg&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Vz&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Cd&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Cd&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Cd&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function n(a){let o=[];for(let s in a){let l=a[s];delete l.metadata,o.push(l)}return o}if(t){let a=n(e.textures),o=n(e.images);a.length>0&&(i.textures=a),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let n=t.length;i=new Array(n);for(let a=0;a!==n;++a)i[a]=t[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};var zc=class extends Gu{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new or(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.envMapRotation=new jl,this.combine=TA,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}};var Hi=new be,rC=new Qt,Ca=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Gz,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=No,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return kQ("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,a=this.itemSize;n<a;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyMatrix3(e),this.setXY(t,rC.x,rC.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)Hi.fromBufferAttribute(this,t),Hi.applyMatrix3(e),this.setXYZ(t,Hi.x,Hi.y,Hi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)Hi.fromBufferAttribute(this,t),Hi.applyMatrix4(e),this.setXYZ(t,Hi.x,Hi.y,Hi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Hi.fromBufferAttribute(this,t),Hi.applyNormalMatrix(e),this.setXYZ(t,Hi.x,Hi.y,Hi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Hi.fromBufferAttribute(this,t),Hi.transformDirection(e),this.setXYZ(t,Hi.x,Hi.y,Hi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=ty(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Aa(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=ty(t,this.array)),t}setX(e,t){return this.normalized&&(t=Aa(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=ty(t,this.array)),t}setY(e,t){return this.normalized&&(t=Aa(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=ty(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Aa(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=ty(t,this.array)),t}setW(e,t){return this.normalized&&(t=Aa(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Aa(t,this.array),i=Aa(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=Aa(t,this.array),i=Aa(i,this.array),n=Aa(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,a){return e*=this.itemSize,this.normalized&&(t=Aa(t,this.array),i=Aa(i,this.array),n=Aa(n,this.array),a=Aa(a,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Gz&&(e.usage=this.usage),e}};var my=class extends Ca{constructor(e,t,i){super(new Uint16Array(e),t,i)}};var vy=class extends Ca{constructor(e,t,i){super(new Uint32Array(e),t,i)}};var ia=class extends Ca{constructor(e,t,i){super(new Float32Array(e),t,i)}};var CTe=0,nl=new Zr,oF=new nn,gy=new be,vs=new Pc,eM=new Pc,gn=new be,Vo=class r extends Fo{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:CTe++}),this.uuid=Bu(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(GA(e)?vy:my)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(i!==void 0){let a=new rr().getNormalMatrix(e);i.applyNormalMatrix(a),i.needsUpdate=!0}let n=this.attributes.tangent;return n!==void 0&&(n.transformDirection(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return nl.makeRotationFromQuaternion(e),this.applyMatrix4(nl),this}rotateX(e){return nl.makeRotationX(e),this.applyMatrix4(nl),this}rotateY(e){return nl.makeRotationY(e),this.applyMatrix4(nl),this}rotateZ(e){return nl.makeRotationZ(e),this.applyMatrix4(nl),this}translate(e,t,i){return nl.makeTranslation(e,t,i),this.applyMatrix4(nl),this}scale(e,t,i){return nl.makeScale(e,t,i),this.applyMatrix4(nl),this}lookAt(e){return oF.lookAt(e),oF.updateMatrix(),this.applyMatrix4(oF.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(gy).negate(),this.translate(gy.x,gy.y,gy.z),this}setFromPoints(e){let t=[];for(let i=0,n=e.length;i<n;i++){let a=e[i];t.push(a.x,a.y,a.z||0)}return this.setAttribute("position",new ia(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Pc);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new be(-1/0,-1/0,-1/0),new be(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,n=t.length;i<n;i++){let a=t[i];vs.setFromBufferAttribute(a),this.morphTargetsRelative?(gn.addVectors(this.boundingBox.min,vs.min),this.boundingBox.expandByPoint(gn),gn.addVectors(this.boundingBox.max,vs.max),this.boundingBox.expandByPoint(gn)):(this.boundingBox.expandByPoint(vs.min),this.boundingBox.expandByPoint(vs.max))}}else 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(){this.boundingSphere===null&&(this.boundingSphere=new _f);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new be,1/0);return}if(e){let i=this.boundingSphere.center;if(vs.setFromBufferAttribute(e),t)for(let a=0,o=t.length;a<o;a++){let s=t[a];eM.setFromBufferAttribute(s),this.morphTargetsRelative?(gn.addVectors(vs.min,eM.min),vs.expandByPoint(gn),gn.addVectors(vs.max,eM.max),vs.expandByPoint(gn)):(vs.expandByPoint(eM.min),vs.expandByPoint(eM.max))}vs.getCenter(i);let n=0;for(let a=0,o=e.count;a<o;a++)gn.fromBufferAttribute(e,a),n=Math.max(n,i.distanceToSquared(gn));if(t)for(let a=0,o=t.length;a<o;a++){let s=t[a],l=this.morphTargetsRelative;for(let u=0,c=s.count;u<c;u++)gn.fromBufferAttribute(s,u),l&&(gy.fromBufferAttribute(e,u),gn.add(gy)),n=Math.max(n,i.distanceToSquared(gn))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let i=t.position,n=t.normal,a=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Ca(new Float32Array(4*i.count),4));let o=this.getAttribute("tangent"),s=[],l=[];for(let T=0;T<i.count;T++)s[T]=new be,l[T]=new be;let u=new be,c=new be,h=new be,f=new Qt,p=new Qt,d=new Qt,g=new be,m=new be;function v(T,C,b){u.fromBufferAttribute(i,T),c.fromBufferAttribute(i,C),h.fromBufferAttribute(i,b),f.fromBufferAttribute(a,T),p.fromBufferAttribute(a,C),d.fromBufferAttribute(a,b),c.sub(u),h.sub(u),p.sub(f),d.sub(f);let E=1/(p.x*d.y-d.x*p.y);isFinite(E)&&(g.copy(c).multiplyScalar(d.y).addScaledVector(h,-p.y).multiplyScalar(E),m.copy(h).multiplyScalar(p.x).addScaledVector(c,-d.x).multiplyScalar(E),s[T].add(g),s[C].add(g),s[b].add(g),l[T].add(m),l[C].add(m),l[b].add(m))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let T=0,C=_.length;T<C;++T){let b=_[T],E=b.start,I=b.count;for(let R=E,A=E+I;R<A;R+=3)v(e.getX(R+0),e.getX(R+1),e.getX(R+2))}let y=new be,x=new be,M=new be,S=new be;function w(T){M.fromBufferAttribute(n,T),S.copy(M);let C=s[T];y.copy(C),y.sub(M.multiplyScalar(M.dot(C))).normalize(),x.crossVectors(S,C);let E=x.dot(l[T])<0?-1:1;o.setXYZW(T,y.x,y.y,y.z,E)}for(let T=0,C=_.length;T<C;++T){let b=_[T],E=b.start,I=b.count;for(let R=E,A=E+I;R<A;R+=3)w(e.getX(R+0)),w(e.getX(R+1)),w(e.getX(R+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Ca(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let f=0,p=i.count;f<p;f++)i.setXYZ(f,0,0,0);let n=new be,a=new be,o=new be,s=new be,l=new be,u=new be,c=new be,h=new be;if(e)for(let f=0,p=e.count;f<p;f+=3){let d=e.getX(f+0),g=e.getX(f+1),m=e.getX(f+2);n.fromBufferAttribute(t,d),a.fromBufferAttribute(t,g),o.fromBufferAttribute(t,m),c.subVectors(o,a),h.subVectors(n,a),c.cross(h),s.fromBufferAttribute(i,d),l.fromBufferAttribute(i,g),u.fromBufferAttribute(i,m),s.add(c),l.add(c),u.add(c),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(g,l.x,l.y,l.z),i.setXYZ(m,u.x,u.y,u.z)}else for(let f=0,p=t.count;f<p;f+=3)n.fromBufferAttribute(t,f+0),a.fromBufferAttribute(t,f+1),o.fromBufferAttribute(t,f+2),c.subVectors(o,a),h.subVectors(n,a),c.cross(h),i.setXYZ(f+0,c.x,c.y,c.z),i.setXYZ(f+1,c.x,c.y,c.z),i.setXYZ(f+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)gn.fromBufferAttribute(e,t),gn.normalize(),e.setXYZ(t,gn.x,gn.y,gn.z)}toNonIndexed(){function e(s,l){let u=s.array,c=s.itemSize,h=s.normalized,f=new u.constructor(l.length*c),p=0,d=0;for(let g=0,m=l.length;g<m;g++){s.isInterleavedBufferAttribute?p=l[g]*s.data.stride+s.offset:p=l[g]*c;for(let v=0;v<c;v++)f[d++]=u[p++]}return new Ca(f,c,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new r,i=this.index.array,n=this.attributes;for(let s in n){let l=n[s],u=e(l,i);t.setAttribute(s,u)}let a=this.morphAttributes;for(let s in a){let l=[],u=a[s];for(let c=0,h=u.length;c<h;c++){let f=u[c],p=e(f,i);l.push(p)}t.morphAttributes[s]=l}t.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let s=0,l=o.length;s<l;s++){let u=o[s];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){let e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let l in i){let u=i[l];e.data.attributes[l]=u.toJSON(e.data)}let n={},a=!1;for(let l in this.morphAttributes){let u=this.morphAttributes[l],c=[];for(let h=0,f=u.length;h<f;h++){let p=u[h];c.push(p.toJSON(e.data))}c.length>0&&(n[l]=c,a=!0)}a&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let n=e.attributes;for(let u in n){let c=n[u];this.setAttribute(u,c.clone(t))}let a=e.morphAttributes;for(let u in a){let c=[],h=a[u];for(let f=0,p=h.length;f<p;f++)c.push(h[f].clone(t));this.morphAttributes[u]=c}this.morphTargetsRelative=e.morphTargetsRelative;let o=e.groups;for(let u=0,c=o.length;u<c;u++){let h=o[u];this.addGroup(h.start,h.count,h.materialIndex)}let s=e.boundingBox;s!==null&&(this.boundingBox=s.clone());let l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}};var $Q=new Zr,Id=new $A,iC=new _f,QQ=new be,yy=new be,_y=new be,xy=new be,sF=new be,nC=new be,aC=new Qt,oC=new Qt,sC=new Qt,eee=new be,tee=new be,ree=new be,lC=new be,uC=new be,an=class extends nn{constructor(e=new Vo,t=new zc){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a<o;a++){let s=n[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=a}}}}getVertexPosition(e,t){let i=this.geometry,n=i.attributes.position,a=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(n,e);let s=this.morphTargetInfluences;if(a&&s){nC.set(0,0,0);for(let l=0,u=a.length;l<u;l++){let c=s[l],h=a[l];c!==0&&(sF.fromBufferAttribute(h,e),o?nC.addScaledVector(sF,c):nC.addScaledVector(sF.sub(t),c))}t.add(nC)}return t}raycast(e,t){let i=this.geometry,n=this.material,a=this.matrixWorld;n!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),iC.copy(i.boundingSphere),iC.applyMatrix4(a),Id.copy(e.ray).recast(e.near),!(iC.containsPoint(Id.origin)===!1&&(Id.intersectSphere(iC,QQ)===null||Id.origin.distanceToSquared(QQ)>(e.far-e.near)**2))&&($Q.copy(a).invert(),Id.copy(e.ray).applyMatrix4($Q),!(i.boundingBox!==null&&Id.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Id)))}_computeIntersections(e,t,i){let n,a=this.geometry,o=this.material,s=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,h=a.attributes.normal,f=a.groups,p=a.drawRange;if(s!==null)if(Array.isArray(o))for(let d=0,g=f.length;d<g;d++){let m=f[d],v=o[m.materialIndex],_=Math.max(m.start,p.start),y=Math.min(s.count,Math.min(m.start+m.count,p.start+p.count));for(let x=_,M=y;x<M;x+=3){let S=s.getX(x),w=s.getX(x+1),T=s.getX(x+2);n=cC(this,v,e,i,u,c,h,S,w,T),n&&(n.faceIndex=Math.floor(x/3),n.face.materialIndex=m.materialIndex,t.push(n))}}else{let d=Math.max(0,p.start),g=Math.min(s.count,p.start+p.count);for(let m=d,v=g;m<v;m+=3){let _=s.getX(m),y=s.getX(m+1),x=s.getX(m+2);n=cC(this,o,e,i,u,c,h,_,y,x),n&&(n.faceIndex=Math.floor(m/3),t.push(n))}}else if(l!==void 0)if(Array.isArray(o))for(let d=0,g=f.length;d<g;d++){let m=f[d],v=o[m.materialIndex],_=Math.max(m.start,p.start),y=Math.min(l.count,Math.min(m.start+m.count,p.start+p.count));for(let x=_,M=y;x<M;x+=3){let S=x,w=x+1,T=x+2;n=cC(this,v,e,i,u,c,h,S,w,T),n&&(n.faceIndex=Math.floor(x/3),n.face.materialIndex=m.materialIndex,t.push(n))}}else{let d=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);for(let m=d,v=g;m<v;m+=3){let _=m,y=m+1,x=m+2;n=cC(this,o,e,i,u,c,h,_,y,x),n&&(n.faceIndex=Math.floor(m/3),t.push(n))}}}};function RTe(r,e,t,i,n,a,o,s){let l;if(e.side===bi?l=i.intersectTriangle(o,a,n,!0,s):l=i.intersectTriangle(n,a,o,e.side===hs,s),l===null)return null;uC.copy(s),uC.applyMatrix4(r.matrixWorld);let u=t.ray.origin.distanceTo(uC);return u<t.near||u>t.far?null:{distance:u,point:uC.clone(),object:r}}function cC(r,e,t,i,n,a,o,s,l,u){r.getVertexPosition(s,yy),r.getVertexPosition(l,_y),r.getVertexPosition(u,xy);let c=RTe(r,e,t,i,yy,_y,xy,lC);if(c){n&&(aC.fromBufferAttribute(n,s),oC.fromBufferAttribute(n,l),sC.fromBufferAttribute(n,u),c.uv=Pd.getInterpolation(lC,yy,_y,xy,aC,oC,sC,new Qt)),a&&(aC.fromBufferAttribute(a,s),oC.fromBufferAttribute(a,l),sC.fromBufferAttribute(a,u),c.uv1=Pd.getInterpolation(lC,yy,_y,xy,aC,oC,sC,new Qt)),o&&(eee.fromBufferAttribute(o,s),tee.fromBufferAttribute(o,l),ree.fromBufferAttribute(o,u),c.normal=Pd.getInterpolation(lC,yy,_y,xy,eee,tee,ree,new be),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let h={a:s,b:l,c:u,normal:new be,materialIndex:0};Pd.getNormal(yy,_y,xy,h.normal),c.face=h}return c}var bf=class r extends Vo{constructor(e=1,t=1,i=1,n=1,a=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:a,depthSegments:o};let s=this;n=Math.floor(n),a=Math.floor(a),o=Math.floor(o);let l=[],u=[],c=[],h=[],f=0,p=0;d("z","y","x",-1,-1,i,t,e,o,a,0),d("z","y","x",1,-1,i,t,-e,o,a,1),d("x","z","y",1,1,e,i,t,n,o,2),d("x","z","y",1,-1,e,i,-t,n,o,3),d("x","y","z",1,-1,e,t,i,n,a,4),d("x","y","z",-1,-1,e,t,-i,n,a,5),this.setIndex(l),this.setAttribute("position",new ia(u,3)),this.setAttribute("normal",new ia(c,3)),this.setAttribute("uv",new ia(h,2));function d(g,m,v,_,y,x,M,S,w,T,C){let b=x/w,E=M/T,I=x/2,R=M/2,A=S/2,P=w+1,U=T+1,B=0,z=0,k=new be;for(let G=0;G<U;G++){let Y=G*E-R;for(let J=0;J<P;J++){let Q=J*b-I;k[g]=Q*_,k[m]=Y*y,k[v]=A,u.push(k.x,k.y,k.z),k[g]=0,k[m]=0,k[v]=S>0?1:-1,c.push(k.x,k.y,k.z),h.push(J/w),h.push(1-G/T),B+=1}}for(let G=0;G<T;G++)for(let Y=0;Y<w;Y++){let J=f+Y+P*G,Q=f+Y+P*(G+1),V=f+(Y+1)+P*(G+1),K=f+(Y+1)+P*G;l.push(J,Q,K),l.push(Q,V,K),z+=6}s.addGroup(p,z,C),p+=z,f+=B}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new r(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function Fc(r){let e={};for(let t in r){e[t]={};for(let i in r[t]){let n=r[t][i];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)?n.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=n.clone():Array.isArray(n)?e[t][i]=n.slice():e[t][i]=n}}return e}function na(r){let e={};for(let t=0;t<r.length;t++){let i=Fc(r[t]);for(let n in i)e[n]=i[n]}return e}function iee(r){let e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function hC(r){return r.getRenderTarget()===null?r.outputColorSpace:Lr.workingColorSpace}var nee={clone:Fc,merge:na};var aee=`
  2231. void main() {
  2232. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  2233. }
  2234. `;var oee=`
  2235. void main() {
  2236. gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
  2237. }
  2238. `;var Ra=class extends Gu{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=aee,this.fragmentShader=oee,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Fc(e.uniforms),this.uniformsGroups=iee(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let o=this.uniforms[n].value;o&&o.isTexture?t.uniforms[n]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[n]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[n]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[n]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[n]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[n]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[n]={type:"m4",value:o.toArray()}:t.uniforms[n]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}};var Sy=class extends nn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Zr,this.projectionMatrix=new Zr,this.projectionMatrixInverse=new Zr,this.coordinateSystem=zo}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};var wf=new be,see=new Qt,lee=new Qt,Wi=class extends Sy{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=jS*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(kA*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return jS*2*Math.atan(Math.tan(kA*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){wf.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(wf.x,wf.y).multiplyScalar(-e/wf.z),wf.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(wf.x,wf.y).multiplyScalar(-e/wf.z)}getViewSize(e,t){return this.getViewBounds(e,see,lee),t.subVectors(lee,see)}setViewOffset(e,t,i,n,a,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(kA*.5*this.fov)/this.zoom,i=2*t,n=this.aspect*i,a=-.5*n,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,u=o.fullHeight;a+=o.offsetX*n/l,t-=o.offsetY*i/u,n*=o.width/l,i*=o.height/u}let s=this.filmOffset;s!==0&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};var My=-90,by=1,fC=class extends nn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new Wi(My,by,e,t);n.layers=this.layers,this.add(n);let a=new Wi(My,by,e,t);a.layers=this.layers,this.add(a);let o=new Wi(My,by,e,t);o.layers=this.layers,this.add(o);let s=new Wi(My,by,e,t);s.layers=this.layers,this.add(s);let l=new Wi(My,by,e,t);l.layers=this.layers,this.add(l);let u=new Wi(My,by,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,a,o,s,l]=t;for(let u of t)this.remove(u);if(e===zo)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Rd)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,o,s,l,u,c]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;let g=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,a),e.setRenderTarget(i,1,n),e.render(t,o),e.setRenderTarget(i,2,n),e.render(t,s),e.setRenderTarget(i,3,n),e.render(t,l),e.setRenderTarget(i,4,n),e.render(t,u),i.texture.generateMipmaps=g,e.setRenderTarget(i,5,n),e.render(t,c),e.setRenderTarget(h,f,p),e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}};var wy=class extends Bo{constructor(e,t,i,n,a,o,s,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:Wl,super(e,t,i,n,a,o,s,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};var pC=class extends ko{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];this.texture=new wy(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:tn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
  2239. varying vec3 vWorldDirection;
  2240. vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
  2241. return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
  2242. }
  2243. void main() {
  2244. vWorldDirection = transformDirection( position, modelMatrix );
  2245. #include <begin_vertex>
  2246. #include <project_vertex>
  2247. }
  2248. `,fragmentShader:`
  2249. uniform sampler2D tEquirect;
  2250. varying vec3 vWorldDirection;
  2251. #include <common>
  2252. void main() {
  2253. vec3 direction = normalize( vWorldDirection );
  2254. vec2 sampleUV = equirectUv( direction );
  2255. gl_FragColor = texture2D( tEquirect, sampleUV );
  2256. }
  2257. `},n=new bf(5,5,5),a=new Ra({name:"CubemapFromEquirect",uniforms:Fc(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:bi,blending:el});a.uniforms.tEquirect.value=t;let o=new an(n,a),s=t.minFilter;return t.minFilter===Xl&&(t.minFilter=tn),new fC(1,10,this).update(e,o),t.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,n){let a=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,n);e.setRenderTarget(a)}};var lF=new be,LTe=new be,DTe=new rr,Jl=class{constructor(e=new be(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=lF.subVectors(i,t).cross(LTe.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let i=e.delta(lF),n=this.normal.dot(i);if(n===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/n;return a<0||a>1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||DTe.getNormalMatrix(e),n=this.coplanarPoint(lF).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};var Nd=new _f,dC=new be,Tf=class{constructor(e=new Jl,t=new Jl,i=new Jl,n=new Jl,a=new Jl,o=new Jl){this.planes=[e,t,i,n,a,o]}set(e,t,i,n,a,o){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(a),s[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=zo){let i=this.planes,n=e.elements,a=n[0],o=n[1],s=n[2],l=n[3],u=n[4],c=n[5],h=n[6],f=n[7],p=n[8],d=n[9],g=n[10],m=n[11],v=n[12],_=n[13],y=n[14],x=n[15];if(i[0].setComponents(l-a,f-u,m-p,x-v).normalize(),i[1].setComponents(l+a,f+u,m+p,x+v).normalize(),i[2].setComponents(l+o,f+c,m+d,x+_).normalize(),i[3].setComponents(l-o,f-c,m-d,x-_).normalize(),i[4].setComponents(l-s,f-h,m-g,x-y).normalize(),t===zo)i[5].setComponents(l+s,f+h,m+g,x+y).normalize();else if(t===Rd)i[5].setComponents(s,h,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Nd.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Nd.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Nd)}intersectsSprite(e){return Nd.center.set(0,0,0),Nd.radius=.7071067811865476,Nd.applyMatrix4(e.matrixWorld),this.intersectsSphere(Nd)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)<n)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let n=t[i];if(dC.x=n.normal.x>0?e.max.x:e.min.x,dC.y=n.normal.y>0?e.max.y:e.min.y,dC.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(dC)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function mC(){let r=null,e=!1,t=null,i=null;function n(a,o){t(a,o),i=r.requestAnimationFrame(n)}return{start:function(){e!==!0&&t!==null&&(i=r.requestAnimationFrame(n),e=!0)},stop:function(){r.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){r=a}}}function uee(r,e){let t=e.isWebGL2,i=new WeakMap;function n(u,c){let h=u.array,f=u.usage,p=h.byteLength,d=r.createBuffer();r.bindBuffer(c,d),r.bufferData(c,h,f),u.onUploadCallback();let g;if(h instanceof Float32Array)g=r.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=r.UNSIGNED_SHORT;else if(h instanceof Int16Array)g=r.SHORT;else if(h instanceof Uint32Array)g=r.UNSIGNED_INT;else if(h instanceof Int32Array)g=r.INT;else if(h instanceof Int8Array)g=r.BYTE;else if(h instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:d,type:g,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:p}}function a(u,c,h){let f=c.array,p=c._updateRange,d=c.updateRanges;if(r.bindBuffer(h,u),p.count===-1&&d.length===0&&r.bufferSubData(h,0,f),d.length!==0){for(let g=0,m=d.length;g<m;g++){let v=d[g];t?r.bufferSubData(h,v.start*f.BYTES_PER_ELEMENT,f,v.start,v.count):r.bufferSubData(h,v.start*f.BYTES_PER_ELEMENT,f.subarray(v.start,v.start+v.count))}c.clearUpdateRanges()}p.count!==-1&&(t?r.bufferSubData(h,p.offset*f.BYTES_PER_ELEMENT,f,p.offset,p.count):r.bufferSubData(h,p.offset*f.BYTES_PER_ELEMENT,f.subarray(p.offset,p.offset+p.count)),p.count=-1),c.onUploadCallback()}function o(u){return u.isInterleavedBufferAttribute&&(u=u.data),i.get(u)}function s(u){u.isInterleavedBufferAttribute&&(u=u.data);let c=i.get(u);c&&(r.deleteBuffer(c.buffer),i.delete(u))}function l(u,c){if(u.isGLBufferAttribute){let f=i.get(u);(!f||f.version<u.version)&&i.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}u.isInterleavedBufferAttribute&&(u=u.data);let h=i.get(u);if(h===void 0)i.set(u,n(u,c));else if(h.version<u.version){if(h.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");a(h.buffer,u,c),h.version=u.version}}return{get:o,remove:s,update:l}}var Ty=class r extends Vo{constructor(e=1,t=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};let a=e/2,o=t/2,s=Math.floor(i),l=Math.floor(n),u=s+1,c=l+1,h=e/s,f=t/l,p=[],d=[],g=[],m=[];for(let v=0;v<c;v++){let _=v*f-o;for(let y=0;y<u;y++){let x=y*h-a;d.push(x,-_,0),g.push(0,0,1),m.push(y/s),m.push(1-v/l)}}for(let v=0;v<l;v++)for(let _=0;_<s;_++){let y=_+u*v,x=_+u*(v+1),M=_+1+u*(v+1),S=_+1+u*v;p.push(y,x,S),p.push(x,M,S)}this.setIndex(p),this.setAttribute("position",new ia(d,3)),this.setAttribute("normal",new ia(g,3)),this.setAttribute("uv",new ia(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new r(e.width,e.height,e.widthSegments,e.heightSegments)}};var cee=`
  2258. #ifdef USE_ALPHAHASH
  2259. if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
  2260. #endif
  2261. `;var hee=`
  2262. #ifdef USE_ALPHAHASH
  2263. /**
  2264. * See: https://casual-effects.com/research/Wyman2017Hashed/index.html
  2265. */
  2266. const float ALPHA_HASH_SCALE = 0.05; // Derived from trials only, and may be changed.
  2267. float hash2D( vec2 value ) {
  2268. return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
  2269. }
  2270. float hash3D( vec3 value ) {
  2271. return hash2D( vec2( hash2D( value.xy ), value.z ) );
  2272. }
  2273. float getAlphaHashThreshold( vec3 position ) {
  2274. // Find the discretized derivatives of our coordinates
  2275. float maxDeriv = max(
  2276. length( dFdx( position.xyz ) ),
  2277. length( dFdy( position.xyz ) )
  2278. );
  2279. float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
  2280. // Find two nearest log-discretized noise scales
  2281. vec2 pixScales = vec2(
  2282. exp2( floor( log2( pixScale ) ) ),
  2283. exp2( ceil( log2( pixScale ) ) )
  2284. );
  2285. // Compute alpha thresholds at our two noise scales
  2286. vec2 alpha = vec2(
  2287. hash3D( floor( pixScales.x * position.xyz ) ),
  2288. hash3D( floor( pixScales.y * position.xyz ) )
  2289. );
  2290. // Factor to interpolate lerp with
  2291. float lerpFactor = fract( log2( pixScale ) );
  2292. // Interpolate alpha threshold from noise at two scales
  2293. float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
  2294. // Pass into CDF to compute uniformly distrib threshold
  2295. float a = min( lerpFactor, 1.0 - lerpFactor );
  2296. vec3 cases = vec3(
  2297. x * x / ( 2.0 * a * ( 1.0 - a ) ),
  2298. ( x - 0.5 * a ) / ( 1.0 - a ),
  2299. 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
  2300. );
  2301. // Find our final, uniformly distributed alpha threshold (\u03B1\u03C4)
  2302. float threshold = ( x < ( 1.0 - a ) )
  2303. ? ( ( x < a ) ? cases.x : cases.y )
  2304. : cases.z;
  2305. // Avoids \u03B1\u03C4 == 0. Could also do \u03B1\u03C4 =1-\u03B1\u03C4
  2306. return clamp( threshold , 1.0e-6, 1.0 );
  2307. }
  2308. #endif
  2309. `;var fee=`
  2310. #ifdef USE_ALPHAMAP
  2311. diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
  2312. #endif
  2313. `;var pee=`
  2314. #ifdef USE_ALPHAMAP
  2315. uniform sampler2D alphaMap;
  2316. #endif
  2317. `;var dee=`
  2318. #ifdef USE_ALPHATEST
  2319. #ifdef ALPHA_TO_COVERAGE
  2320. diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
  2321. if ( diffuseColor.a == 0.0 ) discard;
  2322. #else
  2323. if ( diffuseColor.a < alphaTest ) discard;
  2324. #endif
  2325. #endif
  2326. `;var mee=`
  2327. #ifdef USE_ALPHATEST
  2328. uniform float alphaTest;
  2329. #endif
  2330. `;var vee=`
  2331. #ifdef USE_AOMAP
  2332. // reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture
  2333. float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
  2334. reflectedLight.indirectDiffuse *= ambientOcclusion;
  2335. #if defined( USE_CLEARCOAT )
  2336. clearcoatSpecularIndirect *= ambientOcclusion;
  2337. #endif
  2338. #if defined( USE_SHEEN )
  2339. sheenSpecularIndirect *= ambientOcclusion;
  2340. #endif
  2341. #if defined( USE_ENVMAP ) && defined( STANDARD )
  2342. float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
  2343. reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
  2344. #endif
  2345. #endif
  2346. `;var gee=`
  2347. #ifdef USE_AOMAP
  2348. uniform sampler2D aoMap;
  2349. uniform float aoMapIntensity;
  2350. #endif
  2351. `;var yee=`
  2352. #ifdef USE_BATCHING
  2353. attribute float batchId;
  2354. uniform highp sampler2D batchingTexture;
  2355. mat4 getBatchingMatrix( const in float i ) {
  2356. int size = textureSize( batchingTexture, 0 ).x;
  2357. int j = int( i ) * 4;
  2358. int x = j % size;
  2359. int y = j / size;
  2360. vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
  2361. vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
  2362. vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
  2363. vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
  2364. return mat4( v1, v2, v3, v4 );
  2365. }
  2366. #endif
  2367. `;var _ee=`
  2368. #ifdef USE_BATCHING
  2369. mat4 batchingMatrix = getBatchingMatrix( batchId );
  2370. #endif
  2371. `;var xee=`
  2372. vec3 transformed = vec3( position );
  2373. #ifdef USE_ALPHAHASH
  2374. vPosition = vec3( position );
  2375. #endif
  2376. `;var See=`
  2377. vec3 objectNormal = vec3( normal );
  2378. #ifdef USE_TANGENT
  2379. vec3 objectTangent = vec3( tangent.xyz );
  2380. #endif
  2381. `;var Mee=`
  2382. float G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {
  2383. // geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)
  2384. return 0.25;
  2385. }
  2386. float D_BlinnPhong( const in float shininess, const in float dotNH ) {
  2387. return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
  2388. }
  2389. vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
  2390. vec3 halfDir = normalize( lightDir + viewDir );
  2391. float dotNH = saturate( dot( normal, halfDir ) );
  2392. float dotVH = saturate( dot( viewDir, halfDir ) );
  2393. vec3 F = F_Schlick( specularColor, 1.0, dotVH );
  2394. float G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );
  2395. float D = D_BlinnPhong( shininess, dotNH );
  2396. return F * ( G * D );
  2397. } // validated
  2398. `;var bee=`
  2399. #ifdef USE_IRIDESCENCE
  2400. // XYZ to linear-sRGB color space
  2401. const mat3 XYZ_TO_REC709 = mat3(
  2402. 3.2404542, -0.9692660, 0.0556434,
  2403. -1.5371385, 1.8760108, -0.2040259,
  2404. -0.4985314, 0.0415560, 1.0572252
  2405. );
  2406. // Assume air interface for top
  2407. // Note: We don't handle the case fresnel0 == 1
  2408. vec3 Fresnel0ToIor( vec3 fresnel0 ) {
  2409. vec3 sqrtF0 = sqrt( fresnel0 );
  2410. return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
  2411. }
  2412. // Conversion FO/IOR
  2413. vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
  2414. return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
  2415. }
  2416. // ior is a value between 1.0 and 3.0. 1.0 is air interface
  2417. float IorToFresnel0( float transmittedIor, float incidentIor ) {
  2418. return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
  2419. }
  2420. // Fresnel equations for dielectric/dielectric interfaces.
  2421. // Ref: https://belcour.github.io/blog/research/2017/05/01/brdf-thin-film.html
  2422. // Evaluation XYZ sensitivity curves in Fourier space
  2423. vec3 evalSensitivity( float OPD, vec3 shift ) {
  2424. float phase = 2.0 * PI * OPD * 1.0e-9;
  2425. vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
  2426. vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
  2427. vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
  2428. vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
  2429. xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
  2430. xyz /= 1.0685e-7;
  2431. vec3 rgb = XYZ_TO_REC709 * xyz;
  2432. return rgb;
  2433. }
  2434. vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
  2435. vec3 I;
  2436. // Force iridescenceIOR -> outsideIOR when thinFilmThickness -> 0.0
  2437. float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
  2438. // Evaluate the cosTheta on the base layer (Snell law)
  2439. float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
  2440. // Handle TIR:
  2441. float cosTheta2Sq = 1.0 - sinTheta2Sq;
  2442. if ( cosTheta2Sq < 0.0 ) {
  2443. return vec3( 1.0 );
  2444. }
  2445. float cosTheta2 = sqrt( cosTheta2Sq );
  2446. // First interface
  2447. float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
  2448. float R12 = F_Schlick( R0, 1.0, cosTheta1 );
  2449. float T121 = 1.0 - R12;
  2450. float phi12 = 0.0;
  2451. if ( iridescenceIOR < outsideIOR ) phi12 = PI;
  2452. float phi21 = PI - phi12;
  2453. // Second interface
  2454. vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); // guard against 1.0
  2455. vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
  2456. vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
  2457. vec3 phi23 = vec3( 0.0 );
  2458. if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
  2459. if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
  2460. if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
  2461. // Phase shift
  2462. float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
  2463. vec3 phi = vec3( phi21 ) + phi23;
  2464. // Compound terms
  2465. vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
  2466. vec3 r123 = sqrt( R123 );
  2467. vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
  2468. // Reflectance term for m = 0 (DC term amplitude)
  2469. vec3 C0 = R12 + Rs;
  2470. I = C0;
  2471. // Reflectance term for m > 0 (pairs of diracs)
  2472. vec3 Cm = Rs - T121;
  2473. for ( int m = 1; m <= 2; ++ m ) {
  2474. Cm *= r123;
  2475. vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
  2476. I += Cm * Sm;
  2477. }
  2478. // Since out of gamut colors might be produced, negative color values are clamped to 0.
  2479. return max( I, vec3( 0.0 ) );
  2480. }
  2481. #endif
  2482. `;var wee=`
  2483. #ifdef USE_BUMPMAP
  2484. uniform sampler2D bumpMap;
  2485. uniform float bumpScale;
  2486. // Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen
  2487. // https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf
  2488. // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)
  2489. vec2 dHdxy_fwd() {
  2490. vec2 dSTdx = dFdx( vBumpMapUv );
  2491. vec2 dSTdy = dFdy( vBumpMapUv );
  2492. float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
  2493. float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
  2494. float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
  2495. return vec2( dBx, dBy );
  2496. }
  2497. vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
  2498. // normalize is done to ensure that the bump map looks the same regardless of the texture's scale
  2499. vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
  2500. vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
  2501. vec3 vN = surf_norm; // normalized
  2502. vec3 R1 = cross( vSigmaY, vN );
  2503. vec3 R2 = cross( vN, vSigmaX );
  2504. float fDet = dot( vSigmaX, R1 ) * faceDirection;
  2505. vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
  2506. return normalize( abs( fDet ) * surf_norm - vGrad );
  2507. }
  2508. #endif
  2509. `;var Tee=`
  2510. #if NUM_CLIPPING_PLANES > 0
  2511. vec4 plane;
  2512. #ifdef ALPHA_TO_COVERAGE
  2513. float distanceToPlane, distanceGradient;
  2514. float clipOpacity = 1.0;
  2515. #pragma unroll_loop_start
  2516. for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
  2517. plane = clippingPlanes[ i ];
  2518. distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
  2519. distanceGradient = fwidth( distanceToPlane ) / 2.0;
  2520. clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
  2521. if ( clipOpacity == 0.0 ) discard;
  2522. }
  2523. #pragma unroll_loop_end
  2524. #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
  2525. float unionClipOpacity = 1.0;
  2526. #pragma unroll_loop_start
  2527. for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
  2528. plane = clippingPlanes[ i ];
  2529. distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
  2530. distanceGradient = fwidth( distanceToPlane ) / 2.0;
  2531. unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
  2532. }
  2533. #pragma unroll_loop_end
  2534. clipOpacity *= 1.0 - unionClipOpacity;
  2535. #endif
  2536. diffuseColor.a *= clipOpacity;
  2537. if ( diffuseColor.a == 0.0 ) discard;
  2538. #else
  2539. #pragma unroll_loop_start
  2540. for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
  2541. plane = clippingPlanes[ i ];
  2542. if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
  2543. }
  2544. #pragma unroll_loop_end
  2545. #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
  2546. bool clipped = true;
  2547. #pragma unroll_loop_start
  2548. for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
  2549. plane = clippingPlanes[ i ];
  2550. clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
  2551. }
  2552. #pragma unroll_loop_end
  2553. if ( clipped ) discard;
  2554. #endif
  2555. #endif
  2556. #endif
  2557. `;var Eee=`
  2558. #if NUM_CLIPPING_PLANES > 0
  2559. varying vec3 vClipPosition;
  2560. uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
  2561. #endif
  2562. `;var Aee=`
  2563. #if NUM_CLIPPING_PLANES > 0
  2564. varying vec3 vClipPosition;
  2565. #endif
  2566. `;var Cee=`
  2567. #if NUM_CLIPPING_PLANES > 0
  2568. vClipPosition = - mvPosition.xyz;
  2569. #endif
  2570. `;var Ree=`
  2571. #if defined( USE_COLOR_ALPHA )
  2572. diffuseColor *= vColor;
  2573. #elif defined( USE_COLOR )
  2574. diffuseColor.rgb *= vColor;
  2575. #endif
  2576. `;var Lee=`
  2577. #if defined( USE_COLOR_ALPHA )
  2578. varying vec4 vColor;
  2579. #elif defined( USE_COLOR )
  2580. varying vec3 vColor;
  2581. #endif
  2582. `;var Dee=`
  2583. #if defined( USE_COLOR_ALPHA )
  2584. varying vec4 vColor;
  2585. #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
  2586. varying vec3 vColor;
  2587. #endif
  2588. `;var Pee=`
  2589. #if defined( USE_COLOR_ALPHA )
  2590. vColor = vec4( 1.0 );
  2591. #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
  2592. vColor = vec3( 1.0 );
  2593. #endif
  2594. #ifdef USE_COLOR
  2595. vColor *= color;
  2596. #endif
  2597. #ifdef USE_INSTANCING_COLOR
  2598. vColor.xyz *= instanceColor.xyz;
  2599. #endif
  2600. `;var Iee=`
  2601. #define PI 3.141592653589793
  2602. #define PI2 6.283185307179586
  2603. #define PI_HALF 1.5707963267948966
  2604. #define RECIPROCAL_PI 0.3183098861837907
  2605. #define RECIPROCAL_PI2 0.15915494309189535
  2606. #define EPSILON 1e-6
  2607. #ifndef saturate
  2608. // <tonemapping_pars_fragment> may have defined saturate() already
  2609. #define saturate( a ) clamp( a, 0.0, 1.0 )
  2610. #endif
  2611. #define whiteComplement( a ) ( 1.0 - saturate( a ) )
  2612. float pow2( const in float x ) { return x*x; }
  2613. vec3 pow2( const in vec3 x ) { return x*x; }
  2614. float pow3( const in float x ) { return x*x*x; }
  2615. float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
  2616. float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
  2617. float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
  2618. // expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.
  2619. // do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/
  2620. highp float rand( const in vec2 uv ) {
  2621. const highp float a = 12.9898, b = 78.233, c = 43758.5453;
  2622. highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
  2623. return fract( sin( sn ) * c );
  2624. }
  2625. #ifdef HIGH_PRECISION
  2626. float precisionSafeLength( vec3 v ) { return length( v ); }
  2627. #else
  2628. float precisionSafeLength( vec3 v ) {
  2629. float maxComponent = max3( abs( v ) );
  2630. return length( v / maxComponent ) * maxComponent;
  2631. }
  2632. #endif
  2633. struct IncidentLight {
  2634. vec3 color;
  2635. vec3 direction;
  2636. bool visible;
  2637. };
  2638. struct ReflectedLight {
  2639. vec3 directDiffuse;
  2640. vec3 directSpecular;
  2641. vec3 indirectDiffuse;
  2642. vec3 indirectSpecular;
  2643. };
  2644. #ifdef USE_ALPHAHASH
  2645. varying vec3 vPosition;
  2646. #endif
  2647. vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
  2648. return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
  2649. }
  2650. vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
  2651. // dir can be either a direction vector or a normal vector
  2652. // upper-left 3x3 of matrix is assumed to be orthogonal
  2653. return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
  2654. }
  2655. mat3 transposeMat3( const in mat3 m ) {
  2656. mat3 tmp;
  2657. tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
  2658. tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
  2659. tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
  2660. return tmp;
  2661. }
  2662. float luminance( const in vec3 rgb ) {
  2663. // assumes rgb is in linear color space with sRGB primaries and D65 white point
  2664. const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
  2665. return dot( weights, rgb );
  2666. }
  2667. bool isPerspectiveMatrix( mat4 m ) {
  2668. return m[ 2 ][ 3 ] == - 1.0;
  2669. }
  2670. vec2 equirectUv( in vec3 dir ) {
  2671. // dir is assumed to be unit length
  2672. float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
  2673. float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
  2674. return vec2( u, v );
  2675. }
  2676. vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
  2677. return RECIPROCAL_PI * diffuseColor;
  2678. } // validated
  2679. vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
  2680. // Original approximation by Christophe Schlick '94
  2681. // float fresnel = pow( 1.0 - dotVH, 5.0 );
  2682. // Optimized variant (presented by Epic at SIGGRAPH '13)
  2683. // https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf
  2684. float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
  2685. return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
  2686. } // validated
  2687. float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
  2688. // Original approximation by Christophe Schlick '94
  2689. // float fresnel = pow( 1.0 - dotVH, 5.0 );
  2690. // Optimized variant (presented by Epic at SIGGRAPH '13)
  2691. // https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf
  2692. float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
  2693. return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
  2694. } // validated
  2695. `;var Nee=`
  2696. #ifdef ENVMAP_TYPE_CUBE_UV
  2697. #define cubeUV_minMipLevel 4.0
  2698. #define cubeUV_minTileSize 16.0
  2699. // These shader functions convert between the UV coordinates of a single face of
  2700. // a cubemap, the 0-5 integer index of a cube face, and the direction vector for
  2701. // sampling a textureCube (not generally normalized ).
  2702. float getFace( vec3 direction ) {
  2703. vec3 absDirection = abs( direction );
  2704. float face = - 1.0;
  2705. if ( absDirection.x > absDirection.z ) {
  2706. if ( absDirection.x > absDirection.y )
  2707. face = direction.x > 0.0 ? 0.0 : 3.0;
  2708. else
  2709. face = direction.y > 0.0 ? 1.0 : 4.0;
  2710. } else {
  2711. if ( absDirection.z > absDirection.y )
  2712. face = direction.z > 0.0 ? 2.0 : 5.0;
  2713. else
  2714. face = direction.y > 0.0 ? 1.0 : 4.0;
  2715. }
  2716. return face;
  2717. }
  2718. // RH coordinate system; PMREM face-indexing convention
  2719. vec2 getUV( vec3 direction, float face ) {
  2720. vec2 uv;
  2721. if ( face == 0.0 ) {
  2722. uv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x
  2723. } else if ( face == 1.0 ) {
  2724. uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y
  2725. } else if ( face == 2.0 ) {
  2726. uv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z
  2727. } else if ( face == 3.0 ) {
  2728. uv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x
  2729. } else if ( face == 4.0 ) {
  2730. uv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y
  2731. } else {
  2732. uv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z
  2733. }
  2734. return 0.5 * ( uv + 1.0 );
  2735. }
  2736. vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
  2737. float face = getFace( direction );
  2738. float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
  2739. mipInt = max( mipInt, cubeUV_minMipLevel );
  2740. float faceSize = exp2( mipInt );
  2741. highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; // #25071
  2742. if ( face > 2.0 ) {
  2743. uv.y += faceSize;
  2744. face -= 3.0;
  2745. }
  2746. uv.x += face * faceSize;
  2747. uv.x += filterInt * 3.0 * cubeUV_minTileSize;
  2748. uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
  2749. uv.x *= CUBEUV_TEXEL_WIDTH;
  2750. uv.y *= CUBEUV_TEXEL_HEIGHT;
  2751. #ifdef texture2DGradEXT
  2752. return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; // disable anisotropic filtering
  2753. #else
  2754. return texture2D( envMap, uv ).rgb;
  2755. #endif
  2756. }
  2757. // These defines must match with PMREMGenerator
  2758. #define cubeUV_r0 1.0
  2759. #define cubeUV_m0 - 2.0
  2760. #define cubeUV_r1 0.8
  2761. #define cubeUV_m1 - 1.0
  2762. #define cubeUV_r4 0.4
  2763. #define cubeUV_m4 2.0
  2764. #define cubeUV_r5 0.305
  2765. #define cubeUV_m5 3.0
  2766. #define cubeUV_r6 0.21
  2767. #define cubeUV_m6 4.0
  2768. float roughnessToMip( float roughness ) {
  2769. float mip = 0.0;
  2770. if ( roughness >= cubeUV_r1 ) {
  2771. mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
  2772. } else if ( roughness >= cubeUV_r4 ) {
  2773. mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
  2774. } else if ( roughness >= cubeUV_r5 ) {
  2775. mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
  2776. } else if ( roughness >= cubeUV_r6 ) {
  2777. mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
  2778. } else {
  2779. mip = - 2.0 * log2( 1.16 * roughness ); // 1.16 = 1.79^0.25
  2780. }
  2781. return mip;
  2782. }
  2783. vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
  2784. float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
  2785. float mipF = fract( mip );
  2786. float mipInt = floor( mip );
  2787. vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
  2788. if ( mipF == 0.0 ) {
  2789. return vec4( color0, 1.0 );
  2790. } else {
  2791. vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
  2792. return vec4( mix( color0, color1, mipF ), 1.0 );
  2793. }
  2794. }
  2795. #endif
  2796. `;var Uee=`
  2797. vec3 transformedNormal = objectNormal;
  2798. #ifdef USE_TANGENT
  2799. vec3 transformedTangent = objectTangent;
  2800. #endif
  2801. #ifdef USE_BATCHING
  2802. // this is in lieu of a per-instance normal-matrix
  2803. // shear transforms in the instance matrix are not supported
  2804. mat3 bm = mat3( batchingMatrix );
  2805. transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
  2806. transformedNormal = bm * transformedNormal;
  2807. #ifdef USE_TANGENT
  2808. transformedTangent = bm * transformedTangent;
  2809. #endif
  2810. #endif
  2811. #ifdef USE_INSTANCING
  2812. // this is in lieu of a per-instance normal-matrix
  2813. // shear transforms in the instance matrix are not supported
  2814. mat3 im = mat3( instanceMatrix );
  2815. transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
  2816. transformedNormal = im * transformedNormal;
  2817. #ifdef USE_TANGENT
  2818. transformedTangent = im * transformedTangent;
  2819. #endif
  2820. #endif
  2821. transformedNormal = normalMatrix * transformedNormal;
  2822. #ifdef FLIP_SIDED
  2823. transformedNormal = - transformedNormal;
  2824. #endif
  2825. #ifdef USE_TANGENT
  2826. transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
  2827. #ifdef FLIP_SIDED
  2828. transformedTangent = - transformedTangent;
  2829. #endif
  2830. #endif
  2831. `;var Oee=`
  2832. #ifdef USE_DISPLACEMENTMAP
  2833. uniform sampler2D displacementMap;
  2834. uniform float displacementScale;
  2835. uniform float displacementBias;
  2836. #endif
  2837. `;var zee=`
  2838. #ifdef USE_DISPLACEMENTMAP
  2839. transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
  2840. #endif
  2841. `;var Fee=`
  2842. #ifdef USE_EMISSIVEMAP
  2843. vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
  2844. totalEmissiveRadiance *= emissiveColor.rgb;
  2845. #endif
  2846. `;var Bee=`
  2847. #ifdef USE_EMISSIVEMAP
  2848. uniform sampler2D emissiveMap;
  2849. #endif
  2850. `;var kee=`
  2851. gl_FragColor = linearToOutputTexel( gl_FragColor );
  2852. `;var Vee=`
  2853. // http://www.russellcottrell.com/photo/matrixCalculator.htm
  2854. // Linear sRGB => XYZ => Linear Display P3
  2855. const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(
  2856. vec3( 0.8224621, 0.177538, 0.0 ),
  2857. vec3( 0.0331941, 0.9668058, 0.0 ),
  2858. vec3( 0.0170827, 0.0723974, 0.9105199 )
  2859. );
  2860. // Linear Display P3 => XYZ => Linear sRGB
  2861. const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(
  2862. vec3( 1.2249401, - 0.2249404, 0.0 ),
  2863. vec3( - 0.0420569, 1.0420571, 0.0 ),
  2864. vec3( - 0.0196376, - 0.0786361, 1.0982735 )
  2865. );
  2866. vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {
  2867. return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );
  2868. }
  2869. vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {
  2870. return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );
  2871. }
  2872. vec4 LinearTransferOETF( in vec4 value ) {
  2873. return value;
  2874. }
  2875. vec4 sRGBTransferOETF( in vec4 value ) {
  2876. return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
  2877. }
  2878. // @deprecated, r156
  2879. vec4 LinearToLinear( in vec4 value ) {
  2880. return value;
  2881. }
  2882. // @deprecated, r156
  2883. vec4 LinearTosRGB( in vec4 value ) {
  2884. return sRGBTransferOETF( value );
  2885. }
  2886. `;var Gee=`
  2887. #ifdef USE_ENVMAP
  2888. #ifdef ENV_WORLDPOS
  2889. vec3 cameraToFrag;
  2890. if ( isOrthographic ) {
  2891. cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
  2892. } else {
  2893. cameraToFrag = normalize( vWorldPosition - cameraPosition );
  2894. }
  2895. // Transforming Normal Vectors with the Inverse Transformation
  2896. vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
  2897. #ifdef ENVMAP_MODE_REFLECTION
  2898. vec3 reflectVec = reflect( cameraToFrag, worldNormal );
  2899. #else
  2900. vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
  2901. #endif
  2902. #else
  2903. vec3 reflectVec = vReflect;
  2904. #endif
  2905. #ifdef ENVMAP_TYPE_CUBE
  2906. vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
  2907. #else
  2908. vec4 envColor = vec4( 0.0 );
  2909. #endif
  2910. #ifdef ENVMAP_BLENDING_MULTIPLY
  2911. outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
  2912. #elif defined( ENVMAP_BLENDING_MIX )
  2913. outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
  2914. #elif defined( ENVMAP_BLENDING_ADD )
  2915. outgoingLight += envColor.xyz * specularStrength * reflectivity;
  2916. #endif
  2917. #endif
  2918. `;var Hee=`
  2919. #ifdef USE_ENVMAP
  2920. uniform float envMapIntensity;
  2921. uniform float flipEnvMap;
  2922. uniform mat3 envMapRotation;
  2923. #ifdef ENVMAP_TYPE_CUBE
  2924. uniform samplerCube envMap;
  2925. #else
  2926. uniform sampler2D envMap;
  2927. #endif
  2928. #endif
  2929. `;var Wee=`
  2930. #ifdef USE_ENVMAP
  2931. uniform float reflectivity;
  2932. #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
  2933. #define ENV_WORLDPOS
  2934. #endif
  2935. #ifdef ENV_WORLDPOS
  2936. varying vec3 vWorldPosition;
  2937. uniform float refractionRatio;
  2938. #else
  2939. varying vec3 vReflect;
  2940. #endif
  2941. #endif
  2942. `;var Xee=`
  2943. #ifdef USE_ENVMAP
  2944. #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
  2945. #define ENV_WORLDPOS
  2946. #endif
  2947. #ifdef ENV_WORLDPOS
  2948. varying vec3 vWorldPosition;
  2949. #else
  2950. varying vec3 vReflect;
  2951. uniform float refractionRatio;
  2952. #endif
  2953. #endif
  2954. `;var Yee=`
  2955. #ifdef USE_ENVMAP
  2956. #ifdef ENV_WORLDPOS
  2957. vWorldPosition = worldPosition.xyz;
  2958. #else
  2959. vec3 cameraToVertex;
  2960. if ( isOrthographic ) {
  2961. cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
  2962. } else {
  2963. cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
  2964. }
  2965. vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
  2966. #ifdef ENVMAP_MODE_REFLECTION
  2967. vReflect = reflect( cameraToVertex, worldNormal );
  2968. #else
  2969. vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
  2970. #endif
  2971. #endif
  2972. #endif
  2973. `;var qee=`
  2974. #ifdef USE_FOG
  2975. vFogDepth = - mvPosition.z;
  2976. #endif
  2977. `;var Zee=`
  2978. #ifdef USE_FOG
  2979. varying float vFogDepth;
  2980. #endif
  2981. `;var jee=`
  2982. #ifdef USE_FOG
  2983. #ifdef FOG_EXP2
  2984. float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
  2985. #else
  2986. float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
  2987. #endif
  2988. gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
  2989. #endif
  2990. `;var Kee=`
  2991. #ifdef USE_FOG
  2992. uniform vec3 fogColor;
  2993. varying float vFogDepth;
  2994. #ifdef FOG_EXP2
  2995. uniform float fogDensity;
  2996. #else
  2997. uniform float fogNear;
  2998. uniform float fogFar;
  2999. #endif
  3000. #endif
  3001. `;var Jee=`
  3002. #ifdef USE_GRADIENTMAP
  3003. uniform sampler2D gradientMap;
  3004. #endif
  3005. vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
  3006. // dotNL will be from -1.0 to 1.0
  3007. float dotNL = dot( normal, lightDirection );
  3008. vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
  3009. #ifdef USE_GRADIENTMAP
  3010. return vec3( texture2D( gradientMap, coord ).r );
  3011. #else
  3012. vec2 fw = fwidth( coord ) * 0.5;
  3013. return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
  3014. #endif
  3015. }
  3016. `;var $ee=`
  3017. #ifdef USE_LIGHTMAP
  3018. vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
  3019. vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
  3020. reflectedLight.indirectDiffuse += lightMapIrradiance;
  3021. #endif
  3022. `;var Qee=`
  3023. #ifdef USE_LIGHTMAP
  3024. uniform sampler2D lightMap;
  3025. uniform float lightMapIntensity;
  3026. #endif
  3027. `;var ete=`
  3028. LambertMaterial material;
  3029. material.diffuseColor = diffuseColor.rgb;
  3030. material.specularStrength = specularStrength;
  3031. `;var tte=`
  3032. varying vec3 vViewPosition;
  3033. struct LambertMaterial {
  3034. vec3 diffuseColor;
  3035. float specularStrength;
  3036. };
  3037. void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
  3038. float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
  3039. vec3 irradiance = dotNL * directLight.color;
  3040. reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  3041. }
  3042. void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
  3043. reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  3044. }
  3045. #define RE_Direct RE_Direct_Lambert
  3046. #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert
  3047. `;var rte=`
  3048. uniform bool receiveShadow;
  3049. uniform vec3 ambientLightColor;
  3050. #if defined( USE_LIGHT_PROBES )
  3051. uniform vec3 lightProbe[ 9 ];
  3052. #endif
  3053. // get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere
  3054. // source: https://graphics.stanford.edu/papers/envmap/envmap.pdf
  3055. vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
  3056. // normal is assumed to have unit length
  3057. float x = normal.x, y = normal.y, z = normal.z;
  3058. // band 0
  3059. vec3 result = shCoefficients[ 0 ] * 0.886227;
  3060. // band 1
  3061. result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
  3062. result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
  3063. result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
  3064. // band 2
  3065. result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
  3066. result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
  3067. result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
  3068. result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
  3069. result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
  3070. return result;
  3071. }
  3072. vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
  3073. vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
  3074. vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
  3075. return irradiance;
  3076. }
  3077. vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
  3078. vec3 irradiance = ambientLightColor;
  3079. return irradiance;
  3080. }
  3081. float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
  3082. #if defined ( LEGACY_LIGHTS )
  3083. if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
  3084. return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
  3085. }
  3086. return 1.0;
  3087. #else
  3088. // based upon Frostbite 3 Moving to Physically-based Rendering
  3089. // page 32, equation 26: E[window1]
  3090. // https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
  3091. float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
  3092. if ( cutoffDistance > 0.0 ) {
  3093. distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
  3094. }
  3095. return distanceFalloff;
  3096. #endif
  3097. }
  3098. float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
  3099. return smoothstep( coneCosine, penumbraCosine, angleCosine );
  3100. }
  3101. #if NUM_DIR_LIGHTS > 0
  3102. struct DirectionalLight {
  3103. vec3 direction;
  3104. vec3 color;
  3105. };
  3106. uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
  3107. void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
  3108. light.color = directionalLight.color;
  3109. light.direction = directionalLight.direction;
  3110. light.visible = true;
  3111. }
  3112. #endif
  3113. #if NUM_POINT_LIGHTS > 0
  3114. struct PointLight {
  3115. vec3 position;
  3116. vec3 color;
  3117. float distance;
  3118. float decay;
  3119. };
  3120. uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
  3121. // light is an out parameter as having it as a return value caused compiler errors on some devices
  3122. void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
  3123. vec3 lVector = pointLight.position - geometryPosition;
  3124. light.direction = normalize( lVector );
  3125. float lightDistance = length( lVector );
  3126. light.color = pointLight.color;
  3127. light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
  3128. light.visible = ( light.color != vec3( 0.0 ) );
  3129. }
  3130. #endif
  3131. #if NUM_SPOT_LIGHTS > 0
  3132. struct SpotLight {
  3133. vec3 position;
  3134. vec3 direction;
  3135. vec3 color;
  3136. float distance;
  3137. float decay;
  3138. float coneCos;
  3139. float penumbraCos;
  3140. };
  3141. uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
  3142. // light is an out parameter as having it as a return value caused compiler errors on some devices
  3143. void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
  3144. vec3 lVector = spotLight.position - geometryPosition;
  3145. light.direction = normalize( lVector );
  3146. float angleCos = dot( light.direction, spotLight.direction );
  3147. float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
  3148. if ( spotAttenuation > 0.0 ) {
  3149. float lightDistance = length( lVector );
  3150. light.color = spotLight.color * spotAttenuation;
  3151. light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
  3152. light.visible = ( light.color != vec3( 0.0 ) );
  3153. } else {
  3154. light.color = vec3( 0.0 );
  3155. light.visible = false;
  3156. }
  3157. }
  3158. #endif
  3159. #if NUM_RECT_AREA_LIGHTS > 0
  3160. struct RectAreaLight {
  3161. vec3 color;
  3162. vec3 position;
  3163. vec3 halfWidth;
  3164. vec3 halfHeight;
  3165. };
  3166. // Pre-computed values of LinearTransformedCosine approximation of BRDF
  3167. // BRDF approximation Texture is 64x64
  3168. uniform sampler2D ltc_1; // RGBA Float
  3169. uniform sampler2D ltc_2; // RGBA Float
  3170. uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
  3171. #endif
  3172. #if NUM_HEMI_LIGHTS > 0
  3173. struct HemisphereLight {
  3174. vec3 direction;
  3175. vec3 skyColor;
  3176. vec3 groundColor;
  3177. };
  3178. uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
  3179. vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
  3180. float dotNL = dot( normal, hemiLight.direction );
  3181. float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
  3182. vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
  3183. return irradiance;
  3184. }
  3185. #endif
  3186. `;var ite=`
  3187. #ifdef USE_ENVMAP
  3188. vec3 getIBLIrradiance( const in vec3 normal ) {
  3189. #ifdef ENVMAP_TYPE_CUBE_UV
  3190. vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
  3191. vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
  3192. return PI * envMapColor.rgb * envMapIntensity;
  3193. #else
  3194. return vec3( 0.0 );
  3195. #endif
  3196. }
  3197. vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
  3198. #ifdef ENVMAP_TYPE_CUBE_UV
  3199. vec3 reflectVec = reflect( - viewDir, normal );
  3200. // Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.
  3201. reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
  3202. reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
  3203. vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
  3204. return envMapColor.rgb * envMapIntensity;
  3205. #else
  3206. return vec3( 0.0 );
  3207. #endif
  3208. }
  3209. #ifdef USE_ANISOTROPY
  3210. vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
  3211. #ifdef ENVMAP_TYPE_CUBE_UV
  3212. // https://google.github.io/filament/Filament.md.html#lighting/imagebasedlights/anisotropy
  3213. vec3 bentNormal = cross( bitangent, viewDir );
  3214. bentNormal = normalize( cross( bentNormal, bitangent ) );
  3215. bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
  3216. return getIBLRadiance( viewDir, bentNormal, roughness );
  3217. #else
  3218. return vec3( 0.0 );
  3219. #endif
  3220. }
  3221. #endif
  3222. #endif
  3223. `;var nte=`
  3224. ToonMaterial material;
  3225. material.diffuseColor = diffuseColor.rgb;
  3226. `;var ate=`
  3227. varying vec3 vViewPosition;
  3228. struct ToonMaterial {
  3229. vec3 diffuseColor;
  3230. };
  3231. void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
  3232. vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
  3233. reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  3234. }
  3235. void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
  3236. reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  3237. }
  3238. #define RE_Direct RE_Direct_Toon
  3239. #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon
  3240. `;var ote=`
  3241. BlinnPhongMaterial material;
  3242. material.diffuseColor = diffuseColor.rgb;
  3243. material.specularColor = specular;
  3244. material.specularShininess = shininess;
  3245. material.specularStrength = specularStrength;
  3246. `;var ste=`
  3247. varying vec3 vViewPosition;
  3248. struct BlinnPhongMaterial {
  3249. vec3 diffuseColor;
  3250. vec3 specularColor;
  3251. float specularShininess;
  3252. float specularStrength;
  3253. };
  3254. void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
  3255. float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
  3256. vec3 irradiance = dotNL * directLight.color;
  3257. reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  3258. reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
  3259. }
  3260. void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
  3261. reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  3262. }
  3263. #define RE_Direct RE_Direct_BlinnPhong
  3264. #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
  3265. `;var lte=`
  3266. PhysicalMaterial material;
  3267. material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
  3268. vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
  3269. float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
  3270. material.roughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.
  3271. material.roughness += geometryRoughness;
  3272. material.roughness = min( material.roughness, 1.0 );
  3273. #ifdef IOR
  3274. material.ior = ior;
  3275. #ifdef USE_SPECULAR
  3276. float specularIntensityFactor = specularIntensity;
  3277. vec3 specularColorFactor = specularColor;
  3278. #ifdef USE_SPECULAR_COLORMAP
  3279. specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
  3280. #endif
  3281. #ifdef USE_SPECULAR_INTENSITYMAP
  3282. specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
  3283. #endif
  3284. material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
  3285. #else
  3286. float specularIntensityFactor = 1.0;
  3287. vec3 specularColorFactor = vec3( 1.0 );
  3288. material.specularF90 = 1.0;
  3289. #endif
  3290. material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
  3291. #else
  3292. material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
  3293. material.specularF90 = 1.0;
  3294. #endif
  3295. #ifdef USE_CLEARCOAT
  3296. material.clearcoat = clearcoat;
  3297. material.clearcoatRoughness = clearcoatRoughness;
  3298. material.clearcoatF0 = vec3( 0.04 );
  3299. material.clearcoatF90 = 1.0;
  3300. #ifdef USE_CLEARCOATMAP
  3301. material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
  3302. #endif
  3303. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  3304. material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
  3305. #endif
  3306. material.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model
  3307. material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
  3308. material.clearcoatRoughness += geometryRoughness;
  3309. material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
  3310. #endif
  3311. #ifdef USE_IRIDESCENCE
  3312. material.iridescence = iridescence;
  3313. material.iridescenceIOR = iridescenceIOR;
  3314. #ifdef USE_IRIDESCENCEMAP
  3315. material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
  3316. #endif
  3317. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  3318. material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
  3319. #else
  3320. material.iridescenceThickness = iridescenceThicknessMaximum;
  3321. #endif
  3322. #endif
  3323. #ifdef USE_SHEEN
  3324. material.sheenColor = sheenColor;
  3325. #ifdef USE_SHEEN_COLORMAP
  3326. material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
  3327. #endif
  3328. material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
  3329. #ifdef USE_SHEEN_ROUGHNESSMAP
  3330. material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
  3331. #endif
  3332. #endif
  3333. #ifdef USE_ANISOTROPY
  3334. #ifdef USE_ANISOTROPYMAP
  3335. mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
  3336. vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
  3337. vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
  3338. #else
  3339. vec2 anisotropyV = anisotropyVector;
  3340. #endif
  3341. material.anisotropy = length( anisotropyV );
  3342. if( material.anisotropy == 0.0 ) {
  3343. anisotropyV = vec2( 1.0, 0.0 );
  3344. } else {
  3345. anisotropyV /= material.anisotropy;
  3346. material.anisotropy = saturate( material.anisotropy );
  3347. }
  3348. // Roughness along the anisotropy bitangent is the material roughness, while the tangent roughness increases with anisotropy.
  3349. material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
  3350. material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
  3351. material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
  3352. #endif
  3353. `;var ute=`
  3354. struct PhysicalMaterial {
  3355. vec3 diffuseColor;
  3356. float roughness;
  3357. vec3 specularColor;
  3358. float specularF90;
  3359. #ifdef USE_CLEARCOAT
  3360. float clearcoat;
  3361. float clearcoatRoughness;
  3362. vec3 clearcoatF0;
  3363. float clearcoatF90;
  3364. #endif
  3365. #ifdef USE_IRIDESCENCE
  3366. float iridescence;
  3367. float iridescenceIOR;
  3368. float iridescenceThickness;
  3369. vec3 iridescenceFresnel;
  3370. vec3 iridescenceF0;
  3371. #endif
  3372. #ifdef USE_SHEEN
  3373. vec3 sheenColor;
  3374. float sheenRoughness;
  3375. #endif
  3376. #ifdef IOR
  3377. float ior;
  3378. #endif
  3379. #ifdef USE_TRANSMISSION
  3380. float transmission;
  3381. float transmissionAlpha;
  3382. float thickness;
  3383. float attenuationDistance;
  3384. vec3 attenuationColor;
  3385. #endif
  3386. #ifdef USE_ANISOTROPY
  3387. float anisotropy;
  3388. float alphaT;
  3389. vec3 anisotropyT;
  3390. vec3 anisotropyB;
  3391. #endif
  3392. };
  3393. // temporary
  3394. vec3 clearcoatSpecularDirect = vec3( 0.0 );
  3395. vec3 clearcoatSpecularIndirect = vec3( 0.0 );
  3396. vec3 sheenSpecularDirect = vec3( 0.0 );
  3397. vec3 sheenSpecularIndirect = vec3(0.0 );
  3398. vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
  3399. float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
  3400. float x2 = x * x;
  3401. float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
  3402. return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
  3403. }
  3404. // Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2
  3405. // https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
  3406. float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
  3407. float a2 = pow2( alpha );
  3408. float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
  3409. float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
  3410. return 0.5 / max( gv + gl, EPSILON );
  3411. }
  3412. // Microfacet Models for Refraction through Rough Surfaces - equation (33)
  3413. // http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html
  3414. // alpha is "roughness squared" in Disney\u2019s reparameterization
  3415. float D_GGX( const in float alpha, const in float dotNH ) {
  3416. float a2 = pow2( alpha );
  3417. float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1
  3418. return RECIPROCAL_PI * a2 / pow2( denom );
  3419. }
  3420. // https://google.github.io/filament/Filament.md.html#materialsystem/anisotropicmodel/anisotropicspecularbrdf
  3421. #ifdef USE_ANISOTROPY
  3422. float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
  3423. float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
  3424. float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
  3425. float v = 0.5 / ( gv + gl );
  3426. return saturate(v);
  3427. }
  3428. float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
  3429. float a2 = alphaT * alphaB;
  3430. highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
  3431. highp float v2 = dot( v, v );
  3432. float w2 = a2 / v2;
  3433. return RECIPROCAL_PI * a2 * pow2 ( w2 );
  3434. }
  3435. #endif
  3436. #ifdef USE_CLEARCOAT
  3437. // GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility
  3438. vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
  3439. vec3 f0 = material.clearcoatF0;
  3440. float f90 = material.clearcoatF90;
  3441. float roughness = material.clearcoatRoughness;
  3442. float alpha = pow2( roughness ); // UE4's roughness
  3443. vec3 halfDir = normalize( lightDir + viewDir );
  3444. float dotNL = saturate( dot( normal, lightDir ) );
  3445. float dotNV = saturate( dot( normal, viewDir ) );
  3446. float dotNH = saturate( dot( normal, halfDir ) );
  3447. float dotVH = saturate( dot( viewDir, halfDir ) );
  3448. vec3 F = F_Schlick( f0, f90, dotVH );
  3449. float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
  3450. float D = D_GGX( alpha, dotNH );
  3451. return F * ( V * D );
  3452. }
  3453. #endif
  3454. vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
  3455. vec3 f0 = material.specularColor;
  3456. float f90 = material.specularF90;
  3457. float roughness = material.roughness;
  3458. float alpha = pow2( roughness ); // UE4's roughness
  3459. vec3 halfDir = normalize( lightDir + viewDir );
  3460. float dotNL = saturate( dot( normal, lightDir ) );
  3461. float dotNV = saturate( dot( normal, viewDir ) );
  3462. float dotNH = saturate( dot( normal, halfDir ) );
  3463. float dotVH = saturate( dot( viewDir, halfDir ) );
  3464. vec3 F = F_Schlick( f0, f90, dotVH );
  3465. #ifdef USE_IRIDESCENCE
  3466. F = mix( F, material.iridescenceFresnel, material.iridescence );
  3467. #endif
  3468. #ifdef USE_ANISOTROPY
  3469. float dotTL = dot( material.anisotropyT, lightDir );
  3470. float dotTV = dot( material.anisotropyT, viewDir );
  3471. float dotTH = dot( material.anisotropyT, halfDir );
  3472. float dotBL = dot( material.anisotropyB, lightDir );
  3473. float dotBV = dot( material.anisotropyB, viewDir );
  3474. float dotBH = dot( material.anisotropyB, halfDir );
  3475. float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
  3476. float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
  3477. #else
  3478. float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
  3479. float D = D_GGX( alpha, dotNH );
  3480. #endif
  3481. return F * ( V * D );
  3482. }
  3483. // Rect Area Light
  3484. // Real-Time Polygonal-Light Shading with Linearly Transformed Cosines
  3485. // by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt
  3486. // code: https://github.com/selfshadow/ltc_code/
  3487. vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
  3488. const float LUT_SIZE = 64.0;
  3489. const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
  3490. const float LUT_BIAS = 0.5 / LUT_SIZE;
  3491. float dotNV = saturate( dot( N, V ) );
  3492. // texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )
  3493. vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
  3494. uv = uv * LUT_SCALE + LUT_BIAS;
  3495. return uv;
  3496. }
  3497. float LTC_ClippedSphereFormFactor( const in vec3 f ) {
  3498. // Real-Time Area Lighting: a Journey from Research to Production (p.102)
  3499. // An approximation of the form factor of a horizon-clipped rectangle.
  3500. float l = length( f );
  3501. return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
  3502. }
  3503. vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
  3504. float x = dot( v1, v2 );
  3505. float y = abs( x );
  3506. // rational polynomial approximation to theta / sin( theta ) / 2PI
  3507. float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
  3508. float b = 3.4175940 + ( 4.1616724 + y ) * y;
  3509. float v = a / b;
  3510. float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
  3511. return cross( v1, v2 ) * theta_sintheta;
  3512. }
  3513. vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
  3514. // bail if point is on back side of plane of light
  3515. // assumes ccw winding order of light vertices
  3516. vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
  3517. vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
  3518. vec3 lightNormal = cross( v1, v2 );
  3519. if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
  3520. // construct orthonormal basis around N
  3521. vec3 T1, T2;
  3522. T1 = normalize( V - N * dot( V, N ) );
  3523. T2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system
  3524. // compute transform
  3525. mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
  3526. // transform rect
  3527. vec3 coords[ 4 ];
  3528. coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
  3529. coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
  3530. coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
  3531. coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
  3532. // project rect onto sphere
  3533. coords[ 0 ] = normalize( coords[ 0 ] );
  3534. coords[ 1 ] = normalize( coords[ 1 ] );
  3535. coords[ 2 ] = normalize( coords[ 2 ] );
  3536. coords[ 3 ] = normalize( coords[ 3 ] );
  3537. // calculate vector form factor
  3538. vec3 vectorFormFactor = vec3( 0.0 );
  3539. vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
  3540. vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
  3541. vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
  3542. vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
  3543. // adjust for horizon clipping
  3544. float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
  3545. /*
  3546. // alternate method of adjusting for horizon clipping (see referece)
  3547. // refactoring required
  3548. float len = length( vectorFormFactor );
  3549. float z = vectorFormFactor.z / len;
  3550. const float LUT_SIZE = 64.0;
  3551. const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
  3552. const float LUT_BIAS = 0.5 / LUT_SIZE;
  3553. // tabulated horizon-clipped sphere, apparently...
  3554. vec2 uv = vec2( z * 0.5 + 0.5, len );
  3555. uv = uv * LUT_SCALE + LUT_BIAS;
  3556. float scale = texture2D( ltc_2, uv ).w;
  3557. float result = len * scale;
  3558. */
  3559. return vec3( result );
  3560. }
  3561. // End Rect Area Light
  3562. #if defined( USE_SHEEN )
  3563. // https://github.com/google/filament/blob/master/shaders/src/brdf.fs
  3564. float D_Charlie( float roughness, float dotNH ) {
  3565. float alpha = pow2( roughness );
  3566. // Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"
  3567. float invAlpha = 1.0 / alpha;
  3568. float cos2h = dotNH * dotNH;
  3569. float sin2h = max( 1.0 - cos2h, 0.0078125 ); // 2^(-14/2), so sin2h^2 > 0 in fp16
  3570. return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
  3571. }
  3572. // https://github.com/google/filament/blob/master/shaders/src/brdf.fs
  3573. float V_Neubelt( float dotNV, float dotNL ) {
  3574. // Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"
  3575. return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
  3576. }
  3577. vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
  3578. vec3 halfDir = normalize( lightDir + viewDir );
  3579. float dotNL = saturate( dot( normal, lightDir ) );
  3580. float dotNV = saturate( dot( normal, viewDir ) );
  3581. float dotNH = saturate( dot( normal, halfDir ) );
  3582. float D = D_Charlie( sheenRoughness, dotNH );
  3583. float V = V_Neubelt( dotNV, dotNL );
  3584. return sheenColor * ( D * V );
  3585. }
  3586. #endif
  3587. // This is a curve-fit approxmation to the "Charlie sheen" BRDF integrated over the hemisphere from
  3588. // Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF". The analysis can be found
  3589. // in the Sheen section of https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing
  3590. float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
  3591. float dotNV = saturate( dot( normal, viewDir ) );
  3592. float r2 = roughness * roughness;
  3593. float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
  3594. float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
  3595. float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
  3596. return saturate( DG * RECIPROCAL_PI );
  3597. }
  3598. // Analytical approximation of the DFG LUT, one half of the
  3599. // split-sum approximation used in indirect specular lighting.
  3600. // via 'environmentBRDF' from "Physically Based Shading on Mobile"
  3601. // https://www.unrealengine.com/blog/physically-based-shading-on-mobile
  3602. vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
  3603. float dotNV = saturate( dot( normal, viewDir ) );
  3604. const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
  3605. const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
  3606. vec4 r = roughness * c0 + c1;
  3607. float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
  3608. vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
  3609. return fab;
  3610. }
  3611. vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
  3612. vec2 fab = DFGApprox( normal, viewDir, roughness );
  3613. return specularColor * fab.x + specularF90 * fab.y;
  3614. }
  3615. // Fdez-Ag\xFCera's "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"
  3616. // Approximates multiscattering in order to preserve energy.
  3617. // http://www.jcgt.org/published/0008/01/03/
  3618. #ifdef USE_IRIDESCENCE
  3619. void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
  3620. #else
  3621. void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
  3622. #endif
  3623. vec2 fab = DFGApprox( normal, viewDir, roughness );
  3624. #ifdef USE_IRIDESCENCE
  3625. vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
  3626. #else
  3627. vec3 Fr = specularColor;
  3628. #endif
  3629. vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
  3630. float Ess = fab.x + fab.y;
  3631. float Ems = 1.0 - Ess;
  3632. vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; // 1/21
  3633. vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
  3634. singleScatter += FssEss;
  3635. multiScatter += Fms * Ems;
  3636. }
  3637. #if NUM_RECT_AREA_LIGHTS > 0
  3638. void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  3639. vec3 normal = geometryNormal;
  3640. vec3 viewDir = geometryViewDir;
  3641. vec3 position = geometryPosition;
  3642. vec3 lightPos = rectAreaLight.position;
  3643. vec3 halfWidth = rectAreaLight.halfWidth;
  3644. vec3 halfHeight = rectAreaLight.halfHeight;
  3645. vec3 lightColor = rectAreaLight.color;
  3646. float roughness = material.roughness;
  3647. vec3 rectCoords[ 4 ];
  3648. rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction
  3649. rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
  3650. rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
  3651. rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
  3652. vec2 uv = LTC_Uv( normal, viewDir, roughness );
  3653. vec4 t1 = texture2D( ltc_1, uv );
  3654. vec4 t2 = texture2D( ltc_2, uv );
  3655. mat3 mInv = mat3(
  3656. vec3( t1.x, 0, t1.y ),
  3657. vec3( 0, 1, 0 ),
  3658. vec3( t1.z, 0, t1.w )
  3659. );
  3660. // LTC Fresnel Approximation by Stephen Hill
  3661. // http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf
  3662. vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
  3663. reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
  3664. reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
  3665. }
  3666. #endif
  3667. void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  3668. float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
  3669. vec3 irradiance = dotNL * directLight.color;
  3670. #ifdef USE_CLEARCOAT
  3671. float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
  3672. vec3 ccIrradiance = dotNLcc * directLight.color;
  3673. clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
  3674. #endif
  3675. #ifdef USE_SHEEN
  3676. sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
  3677. #endif
  3678. reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
  3679. reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  3680. }
  3681. void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  3682. reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  3683. }
  3684. void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
  3685. #ifdef USE_CLEARCOAT
  3686. clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
  3687. #endif
  3688. #ifdef USE_SHEEN
  3689. sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
  3690. #endif
  3691. // Both indirect specular and indirect diffuse light accumulate here
  3692. vec3 singleScattering = vec3( 0.0 );
  3693. vec3 multiScattering = vec3( 0.0 );
  3694. vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
  3695. #ifdef USE_IRIDESCENCE
  3696. computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
  3697. #else
  3698. computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
  3699. #endif
  3700. vec3 totalScattering = singleScattering + multiScattering;
  3701. vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
  3702. reflectedLight.indirectSpecular += radiance * singleScattering;
  3703. reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
  3704. reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
  3705. }
  3706. #define RE_Direct RE_Direct_Physical
  3707. #define RE_Direct_RectArea RE_Direct_RectArea_Physical
  3708. #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
  3709. #define RE_IndirectSpecular RE_IndirectSpecular_Physical
  3710. // ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
  3711. float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
  3712. return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
  3713. }
  3714. `;var cte=`
  3715. /**
  3716. * This is a template that can be used to light a material, it uses pluggable
  3717. * RenderEquations (RE)for specific lighting scenarios.
  3718. *
  3719. * Instructions for use:
  3720. * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined
  3721. * - Create a material parameter that is to be passed as the third parameter to your lighting functions.
  3722. *
  3723. * TODO:
  3724. * - Add area light support.
  3725. * - Add sphere light support.
  3726. * - Add diffuse light probe (irradiance cubemap) support.
  3727. */
  3728. vec3 geometryPosition = - vViewPosition;
  3729. vec3 geometryNormal = normal;
  3730. vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
  3731. vec3 geometryClearcoatNormal = vec3( 0.0 );
  3732. #ifdef USE_CLEARCOAT
  3733. geometryClearcoatNormal = clearcoatNormal;
  3734. #endif
  3735. #ifdef USE_IRIDESCENCE
  3736. float dotNVi = saturate( dot( normal, geometryViewDir ) );
  3737. if ( material.iridescenceThickness == 0.0 ) {
  3738. material.iridescence = 0.0;
  3739. } else {
  3740. material.iridescence = saturate( material.iridescence );
  3741. }
  3742. if ( material.iridescence > 0.0 ) {
  3743. material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
  3744. // Iridescence F0 approximation
  3745. material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
  3746. }
  3747. #endif
  3748. IncidentLight directLight;
  3749. #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
  3750. PointLight pointLight;
  3751. #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
  3752. PointLightShadow pointLightShadow;
  3753. #endif
  3754. #pragma unroll_loop_start
  3755. for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
  3756. pointLight = pointLights[ i ];
  3757. getPointLightInfo( pointLight, geometryPosition, directLight );
  3758. #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
  3759. pointLightShadow = pointLightShadows[ i ];
  3760. directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
  3761. #endif
  3762. RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  3763. }
  3764. #pragma unroll_loop_end
  3765. #endif
  3766. #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
  3767. SpotLight spotLight;
  3768. vec4 spotColor;
  3769. vec3 spotLightCoord;
  3770. bool inSpotLightMap;
  3771. #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
  3772. SpotLightShadow spotLightShadow;
  3773. #endif
  3774. #pragma unroll_loop_start
  3775. for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
  3776. spotLight = spotLights[ i ];
  3777. getSpotLightInfo( spotLight, geometryPosition, directLight );
  3778. // spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]
  3779. #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
  3780. #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
  3781. #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
  3782. #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
  3783. #else
  3784. #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
  3785. #endif
  3786. #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
  3787. spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
  3788. inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
  3789. spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
  3790. directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
  3791. #endif
  3792. #undef SPOT_LIGHT_MAP_INDEX
  3793. #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
  3794. spotLightShadow = spotLightShadows[ i ];
  3795. directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
  3796. #endif
  3797. RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  3798. }
  3799. #pragma unroll_loop_end
  3800. #endif
  3801. #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
  3802. DirectionalLight directionalLight;
  3803. #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
  3804. DirectionalLightShadow directionalLightShadow;
  3805. #endif
  3806. #pragma unroll_loop_start
  3807. for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
  3808. directionalLight = directionalLights[ i ];
  3809. getDirectionalLightInfo( directionalLight, directLight );
  3810. #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
  3811. directionalLightShadow = directionalLightShadows[ i ];
  3812. directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
  3813. #endif
  3814. RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  3815. }
  3816. #pragma unroll_loop_end
  3817. #endif
  3818. #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
  3819. RectAreaLight rectAreaLight;
  3820. #pragma unroll_loop_start
  3821. for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
  3822. rectAreaLight = rectAreaLights[ i ];
  3823. RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  3824. }
  3825. #pragma unroll_loop_end
  3826. #endif
  3827. #if defined( RE_IndirectDiffuse )
  3828. vec3 iblIrradiance = vec3( 0.0 );
  3829. vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
  3830. #if defined( USE_LIGHT_PROBES )
  3831. irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
  3832. #endif
  3833. #if ( NUM_HEMI_LIGHTS > 0 )
  3834. #pragma unroll_loop_start
  3835. for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
  3836. irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
  3837. }
  3838. #pragma unroll_loop_end
  3839. #endif
  3840. #endif
  3841. #if defined( RE_IndirectSpecular )
  3842. vec3 radiance = vec3( 0.0 );
  3843. vec3 clearcoatRadiance = vec3( 0.0 );
  3844. #endif
  3845. `;var hte=`
  3846. #if defined( RE_IndirectDiffuse )
  3847. #ifdef USE_LIGHTMAP
  3848. vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
  3849. vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
  3850. irradiance += lightMapIrradiance;
  3851. #endif
  3852. #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
  3853. iblIrradiance += getIBLIrradiance( geometryNormal );
  3854. #endif
  3855. #endif
  3856. #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
  3857. #ifdef USE_ANISOTROPY
  3858. radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
  3859. #else
  3860. radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
  3861. #endif
  3862. #ifdef USE_CLEARCOAT
  3863. clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
  3864. #endif
  3865. #endif
  3866. `;var fte=`
  3867. #if defined( RE_IndirectDiffuse )
  3868. RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  3869. #endif
  3870. #if defined( RE_IndirectSpecular )
  3871. RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  3872. #endif
  3873. `;var pte=`
  3874. #if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
  3875. // Doing a strict comparison with == 1.0 can cause noise artifacts
  3876. // on some platforms. See issue #17623.
  3877. gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
  3878. #endif
  3879. `;var dte=`
  3880. #if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
  3881. uniform float logDepthBufFC;
  3882. varying float vFragDepth;
  3883. varying float vIsPerspective;
  3884. #endif
  3885. `;var mte=`
  3886. #ifdef USE_LOGDEPTHBUF
  3887. #ifdef USE_LOGDEPTHBUF_EXT
  3888. varying float vFragDepth;
  3889. varying float vIsPerspective;
  3890. #else
  3891. uniform float logDepthBufFC;
  3892. #endif
  3893. #endif
  3894. `;var vte=`
  3895. #ifdef USE_LOGDEPTHBUF
  3896. #ifdef USE_LOGDEPTHBUF_EXT
  3897. vFragDepth = 1.0 + gl_Position.w;
  3898. vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
  3899. #else
  3900. if ( isPerspectiveMatrix( projectionMatrix ) ) {
  3901. gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
  3902. gl_Position.z *= gl_Position.w;
  3903. }
  3904. #endif
  3905. #endif
  3906. `;var gte=`
  3907. #ifdef USE_MAP
  3908. vec4 sampledDiffuseColor = texture2D( map, vMapUv );
  3909. #ifdef DECODE_VIDEO_TEXTURE
  3910. // use inline sRGB decode until browsers properly support SRGB8_ALPHA8 with video textures (#26516)
  3911. sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
  3912. #endif
  3913. diffuseColor *= sampledDiffuseColor;
  3914. #endif
  3915. `;var yte=`
  3916. #ifdef USE_MAP
  3917. uniform sampler2D map;
  3918. #endif
  3919. `;var _te=`
  3920. #if defined( USE_MAP ) || defined( USE_ALPHAMAP )
  3921. #if defined( USE_POINTS_UV )
  3922. vec2 uv = vUv;
  3923. #else
  3924. vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
  3925. #endif
  3926. #endif
  3927. #ifdef USE_MAP
  3928. diffuseColor *= texture2D( map, uv );
  3929. #endif
  3930. #ifdef USE_ALPHAMAP
  3931. diffuseColor.a *= texture2D( alphaMap, uv ).g;
  3932. #endif
  3933. `;var xte=`
  3934. #if defined( USE_POINTS_UV )
  3935. varying vec2 vUv;
  3936. #else
  3937. #if defined( USE_MAP ) || defined( USE_ALPHAMAP )
  3938. uniform mat3 uvTransform;
  3939. #endif
  3940. #endif
  3941. #ifdef USE_MAP
  3942. uniform sampler2D map;
  3943. #endif
  3944. #ifdef USE_ALPHAMAP
  3945. uniform sampler2D alphaMap;
  3946. #endif
  3947. `;var Ste=`
  3948. float metalnessFactor = metalness;
  3949. #ifdef USE_METALNESSMAP
  3950. vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
  3951. // reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture
  3952. metalnessFactor *= texelMetalness.b;
  3953. #endif
  3954. `;var Mte=`
  3955. #ifdef USE_METALNESSMAP
  3956. uniform sampler2D metalnessMap;
  3957. #endif
  3958. `;var bte=`
  3959. #ifdef USE_INSTANCING_MORPH
  3960. float morphTargetInfluences[MORPHTARGETS_COUNT];
  3961. float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
  3962. for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  3963. morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
  3964. }
  3965. #endif
  3966. `;var wte=`
  3967. #if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
  3968. // morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:
  3969. // When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)
  3970. // When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting
  3971. vColor *= morphTargetBaseInfluence;
  3972. for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  3973. #if defined( USE_COLOR_ALPHA )
  3974. if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
  3975. #elif defined( USE_COLOR )
  3976. if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
  3977. #endif
  3978. }
  3979. #endif
  3980. `;var Tte=`
  3981. #ifdef USE_MORPHNORMALS
  3982. // morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:
  3983. // When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)
  3984. // When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting
  3985. objectNormal *= morphTargetBaseInfluence;
  3986. #ifdef MORPHTARGETS_TEXTURE
  3987. for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  3988. if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
  3989. }
  3990. #else
  3991. objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
  3992. objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
  3993. objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
  3994. objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
  3995. #endif
  3996. #endif
  3997. `;var Ete=`
  3998. #ifdef USE_MORPHTARGETS
  3999. #ifndef USE_INSTANCING_MORPH
  4000. uniform float morphTargetBaseInfluence;
  4001. #endif
  4002. #ifdef MORPHTARGETS_TEXTURE
  4003. #ifndef USE_INSTANCING_MORPH
  4004. uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
  4005. #endif
  4006. uniform sampler2DArray morphTargetsTexture;
  4007. uniform ivec2 morphTargetsTextureSize;
  4008. vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
  4009. int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
  4010. int y = texelIndex / morphTargetsTextureSize.x;
  4011. int x = texelIndex - y * morphTargetsTextureSize.x;
  4012. ivec3 morphUV = ivec3( x, y, morphTargetIndex );
  4013. return texelFetch( morphTargetsTexture, morphUV, 0 );
  4014. }
  4015. #else
  4016. #ifndef USE_MORPHNORMALS
  4017. uniform float morphTargetInfluences[ 8 ];
  4018. #else
  4019. uniform float morphTargetInfluences[ 4 ];
  4020. #endif
  4021. #endif
  4022. #endif
  4023. `;var Ate=`
  4024. #ifdef USE_MORPHTARGETS
  4025. // morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:
  4026. // When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)
  4027. // When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting
  4028. transformed *= morphTargetBaseInfluence;
  4029. #ifdef MORPHTARGETS_TEXTURE
  4030. for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  4031. if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
  4032. }
  4033. #else
  4034. transformed += morphTarget0 * morphTargetInfluences[ 0 ];
  4035. transformed += morphTarget1 * morphTargetInfluences[ 1 ];
  4036. transformed += morphTarget2 * morphTargetInfluences[ 2 ];
  4037. transformed += morphTarget3 * morphTargetInfluences[ 3 ];
  4038. #ifndef USE_MORPHNORMALS
  4039. transformed += morphTarget4 * morphTargetInfluences[ 4 ];
  4040. transformed += morphTarget5 * morphTargetInfluences[ 5 ];
  4041. transformed += morphTarget6 * morphTargetInfluences[ 6 ];
  4042. transformed += morphTarget7 * morphTargetInfluences[ 7 ];
  4043. #endif
  4044. #endif
  4045. #endif
  4046. `;var Cte=`
  4047. float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
  4048. #ifdef FLAT_SHADED
  4049. vec3 fdx = dFdx( vViewPosition );
  4050. vec3 fdy = dFdy( vViewPosition );
  4051. vec3 normal = normalize( cross( fdx, fdy ) );
  4052. #else
  4053. vec3 normal = normalize( vNormal );
  4054. #ifdef DOUBLE_SIDED
  4055. normal *= faceDirection;
  4056. #endif
  4057. #endif
  4058. #if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
  4059. #ifdef USE_TANGENT
  4060. mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
  4061. #else
  4062. mat3 tbn = getTangentFrame( - vViewPosition, normal,
  4063. #if defined( USE_NORMALMAP )
  4064. vNormalMapUv
  4065. #elif defined( USE_CLEARCOAT_NORMALMAP )
  4066. vClearcoatNormalMapUv
  4067. #else
  4068. vUv
  4069. #endif
  4070. );
  4071. #endif
  4072. #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
  4073. tbn[0] *= faceDirection;
  4074. tbn[1] *= faceDirection;
  4075. #endif
  4076. #endif
  4077. #ifdef USE_CLEARCOAT_NORMALMAP
  4078. #ifdef USE_TANGENT
  4079. mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
  4080. #else
  4081. mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
  4082. #endif
  4083. #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
  4084. tbn2[0] *= faceDirection;
  4085. tbn2[1] *= faceDirection;
  4086. #endif
  4087. #endif
  4088. // non perturbed normal for clearcoat among others
  4089. vec3 nonPerturbedNormal = normal;
  4090. `;var Rte=`
  4091. #ifdef USE_NORMALMAP_OBJECTSPACE
  4092. normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals
  4093. #ifdef FLIP_SIDED
  4094. normal = - normal;
  4095. #endif
  4096. #ifdef DOUBLE_SIDED
  4097. normal = normal * faceDirection;
  4098. #endif
  4099. normal = normalize( normalMatrix * normal );
  4100. #elif defined( USE_NORMALMAP_TANGENTSPACE )
  4101. vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
  4102. mapN.xy *= normalScale;
  4103. normal = normalize( tbn * mapN );
  4104. #elif defined( USE_BUMPMAP )
  4105. normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
  4106. #endif
  4107. `;var Lte=`
  4108. #ifndef FLAT_SHADED
  4109. varying vec3 vNormal;
  4110. #ifdef USE_TANGENT
  4111. varying vec3 vTangent;
  4112. varying vec3 vBitangent;
  4113. #endif
  4114. #endif
  4115. `;var Dte=`
  4116. #ifndef FLAT_SHADED
  4117. varying vec3 vNormal;
  4118. #ifdef USE_TANGENT
  4119. varying vec3 vTangent;
  4120. varying vec3 vBitangent;
  4121. #endif
  4122. #endif
  4123. `;var Pte=`
  4124. #ifndef FLAT_SHADED // normal is computed with derivatives when FLAT_SHADED
  4125. vNormal = normalize( transformedNormal );
  4126. #ifdef USE_TANGENT
  4127. vTangent = normalize( transformedTangent );
  4128. vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
  4129. #endif
  4130. #endif
  4131. `;var Ite=`
  4132. #ifdef USE_NORMALMAP
  4133. uniform sampler2D normalMap;
  4134. uniform vec2 normalScale;
  4135. #endif
  4136. #ifdef USE_NORMALMAP_OBJECTSPACE
  4137. uniform mat3 normalMatrix;
  4138. #endif
  4139. #if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
  4140. // Normal Mapping Without Precomputed Tangents
  4141. // http://www.thetenthplanet.de/archives/1180
  4142. mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
  4143. vec3 q0 = dFdx( eye_pos.xyz );
  4144. vec3 q1 = dFdy( eye_pos.xyz );
  4145. vec2 st0 = dFdx( uv.st );
  4146. vec2 st1 = dFdy( uv.st );
  4147. vec3 N = surf_norm; // normalized
  4148. vec3 q1perp = cross( q1, N );
  4149. vec3 q0perp = cross( N, q0 );
  4150. vec3 T = q1perp * st0.x + q0perp * st1.x;
  4151. vec3 B = q1perp * st0.y + q0perp * st1.y;
  4152. float det = max( dot( T, T ), dot( B, B ) );
  4153. float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
  4154. return mat3( T * scale, B * scale, N );
  4155. }
  4156. #endif
  4157. `;var Nte=`
  4158. #ifdef USE_CLEARCOAT
  4159. vec3 clearcoatNormal = nonPerturbedNormal;
  4160. #endif
  4161. `;var Ute=`
  4162. #ifdef USE_CLEARCOAT_NORMALMAP
  4163. vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
  4164. clearcoatMapN.xy *= clearcoatNormalScale;
  4165. clearcoatNormal = normalize( tbn2 * clearcoatMapN );
  4166. #endif
  4167. `;var Ote=`
  4168. #ifdef USE_CLEARCOATMAP
  4169. uniform sampler2D clearcoatMap;
  4170. #endif
  4171. #ifdef USE_CLEARCOAT_NORMALMAP
  4172. uniform sampler2D clearcoatNormalMap;
  4173. uniform vec2 clearcoatNormalScale;
  4174. #endif
  4175. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  4176. uniform sampler2D clearcoatRoughnessMap;
  4177. #endif
  4178. `;var zte=`
  4179. #ifdef USE_IRIDESCENCEMAP
  4180. uniform sampler2D iridescenceMap;
  4181. #endif
  4182. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  4183. uniform sampler2D iridescenceThicknessMap;
  4184. #endif
  4185. `;var Fte=`
  4186. #ifdef OPAQUE
  4187. diffuseColor.a = 1.0;
  4188. #endif
  4189. #ifdef USE_TRANSMISSION
  4190. diffuseColor.a *= material.transmissionAlpha;
  4191. #endif
  4192. gl_FragColor = vec4( outgoingLight, diffuseColor.a );
  4193. `;var Bte=`
  4194. vec3 packNormalToRGB( const in vec3 normal ) {
  4195. return normalize( normal ) * 0.5 + 0.5;
  4196. }
  4197. vec3 unpackRGBToNormal( const in vec3 rgb ) {
  4198. return 2.0 * rgb.xyz - 1.0;
  4199. }
  4200. const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)
  4201. const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)
  4202. const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
  4203. const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
  4204. const float ShiftRight8 = 1. / 256.;
  4205. vec4 packDepthToRGBA( const in float v ) {
  4206. vec4 r = vec4( fract( v * PackFactors ), v );
  4207. r.yzw -= r.xyz * ShiftRight8; // tidy overflow
  4208. return r * PackUpscale;
  4209. }
  4210. float unpackRGBAToDepth( const in vec4 v ) {
  4211. return dot( v, UnpackFactors );
  4212. }
  4213. vec2 packDepthToRG( in highp float v ) {
  4214. return packDepthToRGBA( v ).yx;
  4215. }
  4216. float unpackRGToDepth( const in highp vec2 v ) {
  4217. return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );
  4218. }
  4219. vec4 pack2HalfToRGBA( vec2 v ) {
  4220. vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
  4221. return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
  4222. }
  4223. vec2 unpackRGBATo2Half( vec4 v ) {
  4224. return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
  4225. }
  4226. // NOTE: viewZ, the z-coordinate in camera space, is negative for points in front of the camera
  4227. float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
  4228. // -near maps to 0; -far maps to 1
  4229. return ( viewZ + near ) / ( near - far );
  4230. }
  4231. float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
  4232. // maps orthographic depth in [ 0, 1 ] to viewZ
  4233. return depth * ( near - far ) - near;
  4234. }
  4235. // NOTE: https://twitter.com/gonnavis/status/1377183786949959682
  4236. float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
  4237. // -near maps to 0; -far maps to 1
  4238. return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
  4239. }
  4240. float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
  4241. // maps perspective depth in [ 0, 1 ] to viewZ
  4242. return ( near * far ) / ( ( far - near ) * depth - far );
  4243. }
  4244. `;var kte=`
  4245. #ifdef PREMULTIPLIED_ALPHA
  4246. // Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.
  4247. gl_FragColor.rgb *= gl_FragColor.a;
  4248. #endif
  4249. `;var Vte=`
  4250. vec4 mvPosition = vec4( transformed, 1.0 );
  4251. #ifdef USE_BATCHING
  4252. mvPosition = batchingMatrix * mvPosition;
  4253. #endif
  4254. #ifdef USE_INSTANCING
  4255. mvPosition = instanceMatrix * mvPosition;
  4256. #endif
  4257. mvPosition = modelViewMatrix * mvPosition;
  4258. gl_Position = projectionMatrix * mvPosition;
  4259. `;var Gte=`
  4260. #ifdef DITHERING
  4261. gl_FragColor.rgb = dithering( gl_FragColor.rgb );
  4262. #endif
  4263. `;var Hte=`
  4264. #ifdef DITHERING
  4265. // based on https://www.shadertoy.com/view/MslGR8
  4266. vec3 dithering( vec3 color ) {
  4267. //Calculate grid position
  4268. float grid_position = rand( gl_FragCoord.xy );
  4269. //Shift the individual colors differently, thus making it even harder to see the dithering pattern
  4270. vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
  4271. //modify shift according to grid position.
  4272. dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
  4273. //shift the color by dither_shift
  4274. return color + dither_shift_RGB;
  4275. }
  4276. #endif
  4277. `;var Wte=`
  4278. float roughnessFactor = roughness;
  4279. #ifdef USE_ROUGHNESSMAP
  4280. vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
  4281. // reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture
  4282. roughnessFactor *= texelRoughness.g;
  4283. #endif
  4284. `;var Xte=`
  4285. #ifdef USE_ROUGHNESSMAP
  4286. uniform sampler2D roughnessMap;
  4287. #endif
  4288. `;var Yte=`
  4289. #if NUM_SPOT_LIGHT_COORDS > 0
  4290. varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
  4291. #endif
  4292. #if NUM_SPOT_LIGHT_MAPS > 0
  4293. uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
  4294. #endif
  4295. #ifdef USE_SHADOWMAP
  4296. #if NUM_DIR_LIGHT_SHADOWS > 0
  4297. uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
  4298. varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
  4299. struct DirectionalLightShadow {
  4300. float shadowBias;
  4301. float shadowNormalBias;
  4302. float shadowRadius;
  4303. vec2 shadowMapSize;
  4304. };
  4305. uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
  4306. #endif
  4307. #if NUM_SPOT_LIGHT_SHADOWS > 0
  4308. uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
  4309. struct SpotLightShadow {
  4310. float shadowBias;
  4311. float shadowNormalBias;
  4312. float shadowRadius;
  4313. vec2 shadowMapSize;
  4314. };
  4315. uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
  4316. #endif
  4317. #if NUM_POINT_LIGHT_SHADOWS > 0
  4318. uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
  4319. varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
  4320. struct PointLightShadow {
  4321. float shadowBias;
  4322. float shadowNormalBias;
  4323. float shadowRadius;
  4324. vec2 shadowMapSize;
  4325. float shadowCameraNear;
  4326. float shadowCameraFar;
  4327. };
  4328. uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
  4329. #endif
  4330. /*
  4331. #if NUM_RECT_AREA_LIGHTS > 0
  4332. // TODO (abelnation): create uniforms for area light shadows
  4333. #endif
  4334. */
  4335. float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
  4336. return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
  4337. }
  4338. vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
  4339. return unpackRGBATo2Half( texture2D( shadow, uv ) );
  4340. }
  4341. float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
  4342. float occlusion = 1.0;
  4343. vec2 distribution = texture2DDistribution( shadow, uv );
  4344. float hard_shadow = step( compare , distribution.x ); // Hard Shadow
  4345. if (hard_shadow != 1.0 ) {
  4346. float distance = compare - distribution.x ;
  4347. float variance = max( 0.00000, distribution.y * distribution.y );
  4348. float softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality
  4349. softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed
  4350. occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
  4351. }
  4352. return occlusion;
  4353. }
  4354. float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
  4355. float shadow = 1.0;
  4356. shadowCoord.xyz /= shadowCoord.w;
  4357. shadowCoord.z += shadowBias;
  4358. bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
  4359. bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
  4360. if ( frustumTest ) {
  4361. #if defined( SHADOWMAP_TYPE_PCF )
  4362. vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
  4363. float dx0 = - texelSize.x * shadowRadius;
  4364. float dy0 = - texelSize.y * shadowRadius;
  4365. float dx1 = + texelSize.x * shadowRadius;
  4366. float dy1 = + texelSize.y * shadowRadius;
  4367. float dx2 = dx0 / 2.0;
  4368. float dy2 = dy0 / 2.0;
  4369. float dx3 = dx1 / 2.0;
  4370. float dy3 = dy1 / 2.0;
  4371. shadow = (
  4372. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
  4373. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
  4374. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
  4375. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
  4376. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
  4377. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
  4378. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
  4379. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
  4380. texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
  4381. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
  4382. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
  4383. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
  4384. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
  4385. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
  4386. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
  4387. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
  4388. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
  4389. ) * ( 1.0 / 17.0 );
  4390. #elif defined( SHADOWMAP_TYPE_PCF_SOFT )
  4391. vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
  4392. float dx = texelSize.x;
  4393. float dy = texelSize.y;
  4394. vec2 uv = shadowCoord.xy;
  4395. vec2 f = fract( uv * shadowMapSize + 0.5 );
  4396. uv -= f * texelSize;
  4397. shadow = (
  4398. texture2DCompare( shadowMap, uv, shadowCoord.z ) +
  4399. texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
  4400. texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
  4401. texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
  4402. mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
  4403. texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
  4404. f.x ) +
  4405. mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
  4406. texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
  4407. f.x ) +
  4408. mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
  4409. texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
  4410. f.y ) +
  4411. mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
  4412. texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
  4413. f.y ) +
  4414. mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
  4415. texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
  4416. f.x ),
  4417. mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
  4418. texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
  4419. f.x ),
  4420. f.y )
  4421. ) * ( 1.0 / 9.0 );
  4422. #elif defined( SHADOWMAP_TYPE_VSM )
  4423. shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
  4424. #else // no percentage-closer filtering:
  4425. shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
  4426. #endif
  4427. }
  4428. return shadow;
  4429. }
  4430. // cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D
  4431. // vector suitable for 2D texture mapping. This code uses the following layout for the
  4432. // 2D texture:
  4433. //
  4434. // xzXZ
  4435. // y Y
  4436. //
  4437. // Y - Positive y direction
  4438. // y - Negative y direction
  4439. // X - Positive x direction
  4440. // x - Negative x direction
  4441. // Z - Positive z direction
  4442. // z - Negative z direction
  4443. //
  4444. // Source and test bed:
  4445. // https://gist.github.com/tschw/da10c43c467ce8afd0c4
  4446. vec2 cubeToUV( vec3 v, float texelSizeY ) {
  4447. // Number of texels to avoid at the edge of each square
  4448. vec3 absV = abs( v );
  4449. // Intersect unit cube
  4450. float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
  4451. absV *= scaleToCube;
  4452. // Apply scale to avoid seams
  4453. // two texels less per square (one texel will do for NEAREST)
  4454. v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
  4455. // Unwrap
  4456. // space: -1 ... 1 range for each square
  4457. //
  4458. // #X## dim := ( 4 , 2 )
  4459. // # # center := ( 1 , 1 )
  4460. vec2 planar = v.xy;
  4461. float almostATexel = 1.5 * texelSizeY;
  4462. float almostOne = 1.0 - almostATexel;
  4463. if ( absV.z >= almostOne ) {
  4464. if ( v.z > 0.0 )
  4465. planar.x = 4.0 - v.x;
  4466. } else if ( absV.x >= almostOne ) {
  4467. float signX = sign( v.x );
  4468. planar.x = v.z * signX + 2.0 * signX;
  4469. } else if ( absV.y >= almostOne ) {
  4470. float signY = sign( v.y );
  4471. planar.x = v.x + 2.0 * signY + 2.0;
  4472. planar.y = v.z * signY - 2.0;
  4473. }
  4474. // Transform to UV space
  4475. // scale := 0.5 / dim
  4476. // translate := ( center + 0.5 ) / dim
  4477. return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
  4478. }
  4479. float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
  4480. vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
  4481. // for point lights, the uniform @vShadowCoord is re-purposed to hold
  4482. // the vector from the light to the world-space position of the fragment.
  4483. vec3 lightToPosition = shadowCoord.xyz;
  4484. // dp = normalized distance from light to fragment position
  4485. float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?
  4486. dp += shadowBias;
  4487. // bd3D = base direction 3D
  4488. vec3 bd3D = normalize( lightToPosition );
  4489. #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
  4490. vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
  4491. return (
  4492. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
  4493. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
  4494. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
  4495. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
  4496. texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
  4497. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
  4498. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
  4499. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
  4500. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
  4501. ) * ( 1.0 / 9.0 );
  4502. #else // no percentage-closer filtering
  4503. return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
  4504. #endif
  4505. }
  4506. #endif
  4507. `;var qte=`
  4508. #if NUM_SPOT_LIGHT_COORDS > 0
  4509. uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
  4510. varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
  4511. #endif
  4512. #ifdef USE_SHADOWMAP
  4513. #if NUM_DIR_LIGHT_SHADOWS > 0
  4514. uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
  4515. varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
  4516. struct DirectionalLightShadow {
  4517. float shadowBias;
  4518. float shadowNormalBias;
  4519. float shadowRadius;
  4520. vec2 shadowMapSize;
  4521. };
  4522. uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
  4523. #endif
  4524. #if NUM_SPOT_LIGHT_SHADOWS > 0
  4525. struct SpotLightShadow {
  4526. float shadowBias;
  4527. float shadowNormalBias;
  4528. float shadowRadius;
  4529. vec2 shadowMapSize;
  4530. };
  4531. uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
  4532. #endif
  4533. #if NUM_POINT_LIGHT_SHADOWS > 0
  4534. uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
  4535. varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
  4536. struct PointLightShadow {
  4537. float shadowBias;
  4538. float shadowNormalBias;
  4539. float shadowRadius;
  4540. vec2 shadowMapSize;
  4541. float shadowCameraNear;
  4542. float shadowCameraFar;
  4543. };
  4544. uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
  4545. #endif
  4546. /*
  4547. #if NUM_RECT_AREA_LIGHTS > 0
  4548. // TODO (abelnation): uniforms for area light shadows
  4549. #endif
  4550. */
  4551. #endif
  4552. `;var Zte=`
  4553. #if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
  4554. // Offsetting the position used for querying occlusion along the world normal can be used to reduce shadow acne.
  4555. vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
  4556. vec4 shadowWorldPosition;
  4557. #endif
  4558. #if defined( USE_SHADOWMAP )
  4559. #if NUM_DIR_LIGHT_SHADOWS > 0
  4560. #pragma unroll_loop_start
  4561. for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
  4562. shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
  4563. vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
  4564. }
  4565. #pragma unroll_loop_end
  4566. #endif
  4567. #if NUM_POINT_LIGHT_SHADOWS > 0
  4568. #pragma unroll_loop_start
  4569. for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
  4570. shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
  4571. vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
  4572. }
  4573. #pragma unroll_loop_end
  4574. #endif
  4575. /*
  4576. #if NUM_RECT_AREA_LIGHTS > 0
  4577. // TODO (abelnation): update vAreaShadowCoord with area light info
  4578. #endif
  4579. */
  4580. #endif
  4581. // spot lights can be evaluated without active shadow mapping (when SpotLight.map is used)
  4582. #if NUM_SPOT_LIGHT_COORDS > 0
  4583. #pragma unroll_loop_start
  4584. for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
  4585. shadowWorldPosition = worldPosition;
  4586. #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
  4587. shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
  4588. #endif
  4589. vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
  4590. }
  4591. #pragma unroll_loop_end
  4592. #endif
  4593. `;var jte=`
  4594. float getShadowMask() {
  4595. float shadow = 1.0;
  4596. #ifdef USE_SHADOWMAP
  4597. #if NUM_DIR_LIGHT_SHADOWS > 0
  4598. DirectionalLightShadow directionalLight;
  4599. #pragma unroll_loop_start
  4600. for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
  4601. directionalLight = directionalLightShadows[ i ];
  4602. shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
  4603. }
  4604. #pragma unroll_loop_end
  4605. #endif
  4606. #if NUM_SPOT_LIGHT_SHADOWS > 0
  4607. SpotLightShadow spotLight;
  4608. #pragma unroll_loop_start
  4609. for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
  4610. spotLight = spotLightShadows[ i ];
  4611. shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
  4612. }
  4613. #pragma unroll_loop_end
  4614. #endif
  4615. #if NUM_POINT_LIGHT_SHADOWS > 0
  4616. PointLightShadow pointLight;
  4617. #pragma unroll_loop_start
  4618. for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
  4619. pointLight = pointLightShadows[ i ];
  4620. shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
  4621. }
  4622. #pragma unroll_loop_end
  4623. #endif
  4624. /*
  4625. #if NUM_RECT_AREA_LIGHTS > 0
  4626. // TODO (abelnation): update shadow for Area light
  4627. #endif
  4628. */
  4629. #endif
  4630. return shadow;
  4631. }
  4632. `;var Kte=`
  4633. #ifdef USE_SKINNING
  4634. mat4 boneMatX = getBoneMatrix( skinIndex.x );
  4635. mat4 boneMatY = getBoneMatrix( skinIndex.y );
  4636. mat4 boneMatZ = getBoneMatrix( skinIndex.z );
  4637. mat4 boneMatW = getBoneMatrix( skinIndex.w );
  4638. #endif
  4639. `;var Jte=`
  4640. #ifdef USE_SKINNING
  4641. uniform mat4 bindMatrix;
  4642. uniform mat4 bindMatrixInverse;
  4643. uniform highp sampler2D boneTexture;
  4644. mat4 getBoneMatrix( const in float i ) {
  4645. int size = textureSize( boneTexture, 0 ).x;
  4646. int j = int( i ) * 4;
  4647. int x = j % size;
  4648. int y = j / size;
  4649. vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
  4650. vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
  4651. vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
  4652. vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
  4653. return mat4( v1, v2, v3, v4 );
  4654. }
  4655. #endif
  4656. `;var $te=`
  4657. #ifdef USE_SKINNING
  4658. vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
  4659. vec4 skinned = vec4( 0.0 );
  4660. skinned += boneMatX * skinVertex * skinWeight.x;
  4661. skinned += boneMatY * skinVertex * skinWeight.y;
  4662. skinned += boneMatZ * skinVertex * skinWeight.z;
  4663. skinned += boneMatW * skinVertex * skinWeight.w;
  4664. transformed = ( bindMatrixInverse * skinned ).xyz;
  4665. #endif
  4666. `;var Qte=`
  4667. #ifdef USE_SKINNING
  4668. mat4 skinMatrix = mat4( 0.0 );
  4669. skinMatrix += skinWeight.x * boneMatX;
  4670. skinMatrix += skinWeight.y * boneMatY;
  4671. skinMatrix += skinWeight.z * boneMatZ;
  4672. skinMatrix += skinWeight.w * boneMatW;
  4673. skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
  4674. objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
  4675. #ifdef USE_TANGENT
  4676. objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
  4677. #endif
  4678. #endif
  4679. `;var ere=`
  4680. float specularStrength;
  4681. #ifdef USE_SPECULARMAP
  4682. vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
  4683. specularStrength = texelSpecular.r;
  4684. #else
  4685. specularStrength = 1.0;
  4686. #endif
  4687. `;var tre=`
  4688. #ifdef USE_SPECULARMAP
  4689. uniform sampler2D specularMap;
  4690. #endif
  4691. `;var rre=`
  4692. #if defined( TONE_MAPPING )
  4693. gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
  4694. #endif
  4695. `;var ire=`
  4696. #ifndef saturate
  4697. // <common> may have defined saturate() already
  4698. #define saturate( a ) clamp( a, 0.0, 1.0 )
  4699. #endif
  4700. uniform float toneMappingExposure;
  4701. // exposure only
  4702. vec3 LinearToneMapping( vec3 color ) {
  4703. return saturate( toneMappingExposure * color );
  4704. }
  4705. // source: https://www.cs.utah.edu/docs/techreports/2002/pdf/UUCS-02-001.pdf
  4706. vec3 ReinhardToneMapping( vec3 color ) {
  4707. color *= toneMappingExposure;
  4708. return saturate( color / ( vec3( 1.0 ) + color ) );
  4709. }
  4710. // source: http://filmicworlds.com/blog/filmic-tonemapping-operators/
  4711. vec3 OptimizedCineonToneMapping( vec3 color ) {
  4712. // optimized filmic operator by Jim Hejl and Richard Burgess-Dawson
  4713. color *= toneMappingExposure;
  4714. color = max( vec3( 0.0 ), color - 0.004 );
  4715. return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
  4716. }
  4717. // source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs
  4718. vec3 RRTAndODTFit( vec3 v ) {
  4719. vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
  4720. vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
  4721. return a / b;
  4722. }
  4723. // this implementation of ACES is modified to accommodate a brighter viewing environment.
  4724. // the scale factor of 1/0.6 is subjective. see discussion in #19621.
  4725. vec3 ACESFilmicToneMapping( vec3 color ) {
  4726. // sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT
  4727. const mat3 ACESInputMat = mat3(
  4728. vec3( 0.59719, 0.07600, 0.02840 ), // transposed from source
  4729. vec3( 0.35458, 0.90834, 0.13383 ),
  4730. vec3( 0.04823, 0.01566, 0.83777 )
  4731. );
  4732. // ODT_SAT => XYZ => D60_2_D65 => sRGB
  4733. const mat3 ACESOutputMat = mat3(
  4734. vec3( 1.60475, -0.10208, -0.00327 ), // transposed from source
  4735. vec3( -0.53108, 1.10813, -0.07276 ),
  4736. vec3( -0.07367, -0.00605, 1.07602 )
  4737. );
  4738. color *= toneMappingExposure / 0.6;
  4739. color = ACESInputMat * color;
  4740. // Apply RRT and ODT
  4741. color = RRTAndODTFit( color );
  4742. color = ACESOutputMat * color;
  4743. // Clamp to [0, 1]
  4744. return saturate( color );
  4745. }
  4746. // Matrices for rec 2020 <> rec 709 color space conversion
  4747. // matrix provided in row-major order so it has been transposed
  4748. // https://www.itu.int/pub/R-REP-BT.2407-2017
  4749. const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
  4750. vec3( 1.6605, - 0.1246, - 0.0182 ),
  4751. vec3( - 0.5876, 1.1329, - 0.1006 ),
  4752. vec3( - 0.0728, - 0.0083, 1.1187 )
  4753. );
  4754. const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
  4755. vec3( 0.6274, 0.0691, 0.0164 ),
  4756. vec3( 0.3293, 0.9195, 0.0880 ),
  4757. vec3( 0.0433, 0.0113, 0.8956 )
  4758. );
  4759. // https://iolite-engine.com/blog_posts/minimal_agx_implementation
  4760. // Mean error^2: 3.6705141e-06
  4761. vec3 agxDefaultContrastApprox( vec3 x ) {
  4762. vec3 x2 = x * x;
  4763. vec3 x4 = x2 * x2;
  4764. return + 15.5 * x4 * x2
  4765. - 40.14 * x4 * x
  4766. + 31.96 * x4
  4767. - 6.868 * x2 * x
  4768. + 0.4298 * x2
  4769. + 0.1191 * x
  4770. - 0.00232;
  4771. }
  4772. // AgX Tone Mapping implementation based on Filament, which in turn is based
  4773. // on Blender's implementation using rec 2020 primaries
  4774. // https://github.com/google/filament/pull/7236
  4775. // Inputs and outputs are encoded as Linear-sRGB.
  4776. vec3 AgXToneMapping( vec3 color ) {
  4777. // AgX constants
  4778. const mat3 AgXInsetMatrix = mat3(
  4779. vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
  4780. vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
  4781. vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
  4782. );
  4783. // explicit AgXOutsetMatrix generated from Filaments AgXOutsetMatrixInv
  4784. const mat3 AgXOutsetMatrix = mat3(
  4785. vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
  4786. vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
  4787. vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
  4788. );
  4789. // LOG2_MIN = -10.0
  4790. // LOG2_MAX = +6.5
  4791. // MIDDLE_GRAY = 0.18
  4792. const float AgxMinEv = - 12.47393; // log2( pow( 2, LOG2_MIN ) * MIDDLE_GRAY )
  4793. const float AgxMaxEv = 4.026069; // log2( pow( 2, LOG2_MAX ) * MIDDLE_GRAY )
  4794. color *= toneMappingExposure;
  4795. color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
  4796. color = AgXInsetMatrix * color;
  4797. // Log2 encoding
  4798. color = max( color, 1e-10 ); // avoid 0 or negative numbers for log2
  4799. color = log2( color );
  4800. color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
  4801. color = clamp( color, 0.0, 1.0 );
  4802. // Apply sigmoid
  4803. color = agxDefaultContrastApprox( color );
  4804. // Apply AgX look
  4805. // v = agxLook(v, look);
  4806. color = AgXOutsetMatrix * color;
  4807. // Linearize
  4808. color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
  4809. color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
  4810. // Gamut mapping. Simple clamp for now.
  4811. color = clamp( color, 0.0, 1.0 );
  4812. return color;
  4813. }
  4814. // https://modelviewer.dev/examples/tone-mapping
  4815. vec3 NeutralToneMapping( vec3 color ) {
  4816. float startCompression = 0.8 - 0.04;
  4817. float desaturation = 0.15;
  4818. color *= toneMappingExposure;
  4819. float x = min(color.r, min(color.g, color.b));
  4820. float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
  4821. color -= offset;
  4822. float peak = max(color.r, max(color.g, color.b));
  4823. if (peak < startCompression) return color;
  4824. float d = 1. - startCompression;
  4825. float newPeak = 1. - d * d / (peak + d - startCompression);
  4826. color *= newPeak / peak;
  4827. float g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);
  4828. return mix(color, vec3(1, 1, 1), g);
  4829. }
  4830. vec3 CustomToneMapping( vec3 color ) { return color; }
  4831. `;var nre=`
  4832. #ifdef USE_TRANSMISSION
  4833. material.transmission = transmission;
  4834. material.transmissionAlpha = 1.0;
  4835. material.thickness = thickness;
  4836. material.attenuationDistance = attenuationDistance;
  4837. material.attenuationColor = attenuationColor;
  4838. #ifdef USE_TRANSMISSIONMAP
  4839. material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
  4840. #endif
  4841. #ifdef USE_THICKNESSMAP
  4842. material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
  4843. #endif
  4844. vec3 pos = vWorldPosition;
  4845. vec3 v = normalize( cameraPosition - pos );
  4846. vec3 n = inverseTransformDirection( normal, viewMatrix );
  4847. vec4 transmitted = getIBLVolumeRefraction(
  4848. n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
  4849. pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,
  4850. material.attenuationColor, material.attenuationDistance );
  4851. material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
  4852. totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
  4853. #endif
  4854. `;var are=`
  4855. #ifdef USE_TRANSMISSION
  4856. // Transmission code is based on glTF-Sampler-Viewer
  4857. // https://github.com/KhronosGroup/glTF-Sample-Viewer
  4858. uniform float transmission;
  4859. uniform float thickness;
  4860. uniform float attenuationDistance;
  4861. uniform vec3 attenuationColor;
  4862. #ifdef USE_TRANSMISSIONMAP
  4863. uniform sampler2D transmissionMap;
  4864. #endif
  4865. #ifdef USE_THICKNESSMAP
  4866. uniform sampler2D thicknessMap;
  4867. #endif
  4868. uniform vec2 transmissionSamplerSize;
  4869. uniform sampler2D transmissionSamplerMap;
  4870. uniform mat4 modelMatrix;
  4871. uniform mat4 projectionMatrix;
  4872. varying vec3 vWorldPosition;
  4873. // Mipped Bicubic Texture Filtering by N8
  4874. // https://www.shadertoy.com/view/Dl2SDW
  4875. float w0( float a ) {
  4876. return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
  4877. }
  4878. float w1( float a ) {
  4879. return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );
  4880. }
  4881. float w2( float a ){
  4882. return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
  4883. }
  4884. float w3( float a ) {
  4885. return ( 1.0 / 6.0 ) * ( a * a * a );
  4886. }
  4887. // g0 and g1 are the two amplitude functions
  4888. float g0( float a ) {
  4889. return w0( a ) + w1( a );
  4890. }
  4891. float g1( float a ) {
  4892. return w2( a ) + w3( a );
  4893. }
  4894. // h0 and h1 are the two offset functions
  4895. float h0( float a ) {
  4896. return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
  4897. }
  4898. float h1( float a ) {
  4899. return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
  4900. }
  4901. vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
  4902. uv = uv * texelSize.zw + 0.5;
  4903. vec2 iuv = floor( uv );
  4904. vec2 fuv = fract( uv );
  4905. float g0x = g0( fuv.x );
  4906. float g1x = g1( fuv.x );
  4907. float h0x = h0( fuv.x );
  4908. float h1x = h1( fuv.x );
  4909. float h0y = h0( fuv.y );
  4910. float h1y = h1( fuv.y );
  4911. vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
  4912. vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
  4913. vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
  4914. vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
  4915. return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
  4916. g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
  4917. }
  4918. vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
  4919. vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
  4920. vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
  4921. vec2 fLodSizeInv = 1.0 / fLodSize;
  4922. vec2 cLodSizeInv = 1.0 / cLodSize;
  4923. vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
  4924. vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
  4925. return mix( fSample, cSample, fract( lod ) );
  4926. }
  4927. vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
  4928. // Direction of refracted light.
  4929. vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
  4930. // Compute rotation-independant scaling of the model matrix.
  4931. vec3 modelScale;
  4932. modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
  4933. modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
  4934. modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
  4935. // The thickness is specified in local space.
  4936. return normalize( refractionVector ) * thickness * modelScale;
  4937. }
  4938. float applyIorToRoughness( const in float roughness, const in float ior ) {
  4939. // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and
  4940. // an IOR of 1.5 results in the default amount of microfacet refraction.
  4941. return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
  4942. }
  4943. vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
  4944. float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
  4945. return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
  4946. }
  4947. vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
  4948. if ( isinf( attenuationDistance ) ) {
  4949. // Attenuation distance is +\u221E, i.e. the transmitted color is not attenuated at all.
  4950. return vec3( 1.0 );
  4951. } else {
  4952. // Compute light attenuation using Beer's law.
  4953. vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
  4954. vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); // Beer's law
  4955. return transmittance;
  4956. }
  4957. }
  4958. vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
  4959. const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
  4960. const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,
  4961. const in vec3 attenuationColor, const in float attenuationDistance ) {
  4962. vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
  4963. vec3 refractedRayExit = position + transmissionRay;
  4964. // Project refracted vector on the framebuffer, while mapping to normalized device coordinates.
  4965. vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
  4966. vec2 refractionCoords = ndcPos.xy / ndcPos.w;
  4967. refractionCoords += 1.0;
  4968. refractionCoords /= 2.0;
  4969. // Sample framebuffer to get pixel the refracted ray hits.
  4970. vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
  4971. vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
  4972. vec3 attenuatedColor = transmittance * transmittedLight.rgb;
  4973. // Get the specular component.
  4974. vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
  4975. // As less light is transmitted, the opacity should be increased. This simple approximation does a decent job
  4976. // of modulating a CSS background, and has no effect when the buffer is opaque, due to a solid object or clear color.
  4977. float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
  4978. return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
  4979. }
  4980. #endif
  4981. `;var ore=`
  4982. #if defined( USE_UV ) || defined( USE_ANISOTROPY )
  4983. varying vec2 vUv;
  4984. #endif
  4985. #ifdef USE_MAP
  4986. varying vec2 vMapUv;
  4987. #endif
  4988. #ifdef USE_ALPHAMAP
  4989. varying vec2 vAlphaMapUv;
  4990. #endif
  4991. #ifdef USE_LIGHTMAP
  4992. varying vec2 vLightMapUv;
  4993. #endif
  4994. #ifdef USE_AOMAP
  4995. varying vec2 vAoMapUv;
  4996. #endif
  4997. #ifdef USE_BUMPMAP
  4998. varying vec2 vBumpMapUv;
  4999. #endif
  5000. #ifdef USE_NORMALMAP
  5001. varying vec2 vNormalMapUv;
  5002. #endif
  5003. #ifdef USE_EMISSIVEMAP
  5004. varying vec2 vEmissiveMapUv;
  5005. #endif
  5006. #ifdef USE_METALNESSMAP
  5007. varying vec2 vMetalnessMapUv;
  5008. #endif
  5009. #ifdef USE_ROUGHNESSMAP
  5010. varying vec2 vRoughnessMapUv;
  5011. #endif
  5012. #ifdef USE_ANISOTROPYMAP
  5013. varying vec2 vAnisotropyMapUv;
  5014. #endif
  5015. #ifdef USE_CLEARCOATMAP
  5016. varying vec2 vClearcoatMapUv;
  5017. #endif
  5018. #ifdef USE_CLEARCOAT_NORMALMAP
  5019. varying vec2 vClearcoatNormalMapUv;
  5020. #endif
  5021. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  5022. varying vec2 vClearcoatRoughnessMapUv;
  5023. #endif
  5024. #ifdef USE_IRIDESCENCEMAP
  5025. varying vec2 vIridescenceMapUv;
  5026. #endif
  5027. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  5028. varying vec2 vIridescenceThicknessMapUv;
  5029. #endif
  5030. #ifdef USE_SHEEN_COLORMAP
  5031. varying vec2 vSheenColorMapUv;
  5032. #endif
  5033. #ifdef USE_SHEEN_ROUGHNESSMAP
  5034. varying vec2 vSheenRoughnessMapUv;
  5035. #endif
  5036. #ifdef USE_SPECULARMAP
  5037. varying vec2 vSpecularMapUv;
  5038. #endif
  5039. #ifdef USE_SPECULAR_COLORMAP
  5040. varying vec2 vSpecularColorMapUv;
  5041. #endif
  5042. #ifdef USE_SPECULAR_INTENSITYMAP
  5043. varying vec2 vSpecularIntensityMapUv;
  5044. #endif
  5045. #ifdef USE_TRANSMISSIONMAP
  5046. uniform mat3 transmissionMapTransform;
  5047. varying vec2 vTransmissionMapUv;
  5048. #endif
  5049. #ifdef USE_THICKNESSMAP
  5050. uniform mat3 thicknessMapTransform;
  5051. varying vec2 vThicknessMapUv;
  5052. #endif
  5053. `;var sre=`
  5054. #if defined( USE_UV ) || defined( USE_ANISOTROPY )
  5055. varying vec2 vUv;
  5056. #endif
  5057. #ifdef USE_MAP
  5058. uniform mat3 mapTransform;
  5059. varying vec2 vMapUv;
  5060. #endif
  5061. #ifdef USE_ALPHAMAP
  5062. uniform mat3 alphaMapTransform;
  5063. varying vec2 vAlphaMapUv;
  5064. #endif
  5065. #ifdef USE_LIGHTMAP
  5066. uniform mat3 lightMapTransform;
  5067. varying vec2 vLightMapUv;
  5068. #endif
  5069. #ifdef USE_AOMAP
  5070. uniform mat3 aoMapTransform;
  5071. varying vec2 vAoMapUv;
  5072. #endif
  5073. #ifdef USE_BUMPMAP
  5074. uniform mat3 bumpMapTransform;
  5075. varying vec2 vBumpMapUv;
  5076. #endif
  5077. #ifdef USE_NORMALMAP
  5078. uniform mat3 normalMapTransform;
  5079. varying vec2 vNormalMapUv;
  5080. #endif
  5081. #ifdef USE_DISPLACEMENTMAP
  5082. uniform mat3 displacementMapTransform;
  5083. varying vec2 vDisplacementMapUv;
  5084. #endif
  5085. #ifdef USE_EMISSIVEMAP
  5086. uniform mat3 emissiveMapTransform;
  5087. varying vec2 vEmissiveMapUv;
  5088. #endif
  5089. #ifdef USE_METALNESSMAP
  5090. uniform mat3 metalnessMapTransform;
  5091. varying vec2 vMetalnessMapUv;
  5092. #endif
  5093. #ifdef USE_ROUGHNESSMAP
  5094. uniform mat3 roughnessMapTransform;
  5095. varying vec2 vRoughnessMapUv;
  5096. #endif
  5097. #ifdef USE_ANISOTROPYMAP
  5098. uniform mat3 anisotropyMapTransform;
  5099. varying vec2 vAnisotropyMapUv;
  5100. #endif
  5101. #ifdef USE_CLEARCOATMAP
  5102. uniform mat3 clearcoatMapTransform;
  5103. varying vec2 vClearcoatMapUv;
  5104. #endif
  5105. #ifdef USE_CLEARCOAT_NORMALMAP
  5106. uniform mat3 clearcoatNormalMapTransform;
  5107. varying vec2 vClearcoatNormalMapUv;
  5108. #endif
  5109. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  5110. uniform mat3 clearcoatRoughnessMapTransform;
  5111. varying vec2 vClearcoatRoughnessMapUv;
  5112. #endif
  5113. #ifdef USE_SHEEN_COLORMAP
  5114. uniform mat3 sheenColorMapTransform;
  5115. varying vec2 vSheenColorMapUv;
  5116. #endif
  5117. #ifdef USE_SHEEN_ROUGHNESSMAP
  5118. uniform mat3 sheenRoughnessMapTransform;
  5119. varying vec2 vSheenRoughnessMapUv;
  5120. #endif
  5121. #ifdef USE_IRIDESCENCEMAP
  5122. uniform mat3 iridescenceMapTransform;
  5123. varying vec2 vIridescenceMapUv;
  5124. #endif
  5125. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  5126. uniform mat3 iridescenceThicknessMapTransform;
  5127. varying vec2 vIridescenceThicknessMapUv;
  5128. #endif
  5129. #ifdef USE_SPECULARMAP
  5130. uniform mat3 specularMapTransform;
  5131. varying vec2 vSpecularMapUv;
  5132. #endif
  5133. #ifdef USE_SPECULAR_COLORMAP
  5134. uniform mat3 specularColorMapTransform;
  5135. varying vec2 vSpecularColorMapUv;
  5136. #endif
  5137. #ifdef USE_SPECULAR_INTENSITYMAP
  5138. uniform mat3 specularIntensityMapTransform;
  5139. varying vec2 vSpecularIntensityMapUv;
  5140. #endif
  5141. #ifdef USE_TRANSMISSIONMAP
  5142. uniform mat3 transmissionMapTransform;
  5143. varying vec2 vTransmissionMapUv;
  5144. #endif
  5145. #ifdef USE_THICKNESSMAP
  5146. uniform mat3 thicknessMapTransform;
  5147. varying vec2 vThicknessMapUv;
  5148. #endif
  5149. `;var lre=`
  5150. #if defined( USE_UV ) || defined( USE_ANISOTROPY )
  5151. vUv = vec3( uv, 1 ).xy;
  5152. #endif
  5153. #ifdef USE_MAP
  5154. vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
  5155. #endif
  5156. #ifdef USE_ALPHAMAP
  5157. vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
  5158. #endif
  5159. #ifdef USE_LIGHTMAP
  5160. vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
  5161. #endif
  5162. #ifdef USE_AOMAP
  5163. vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
  5164. #endif
  5165. #ifdef USE_BUMPMAP
  5166. vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
  5167. #endif
  5168. #ifdef USE_NORMALMAP
  5169. vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
  5170. #endif
  5171. #ifdef USE_DISPLACEMENTMAP
  5172. vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
  5173. #endif
  5174. #ifdef USE_EMISSIVEMAP
  5175. vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
  5176. #endif
  5177. #ifdef USE_METALNESSMAP
  5178. vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
  5179. #endif
  5180. #ifdef USE_ROUGHNESSMAP
  5181. vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
  5182. #endif
  5183. #ifdef USE_ANISOTROPYMAP
  5184. vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
  5185. #endif
  5186. #ifdef USE_CLEARCOATMAP
  5187. vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
  5188. #endif
  5189. #ifdef USE_CLEARCOAT_NORMALMAP
  5190. vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
  5191. #endif
  5192. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  5193. vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
  5194. #endif
  5195. #ifdef USE_IRIDESCENCEMAP
  5196. vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
  5197. #endif
  5198. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  5199. vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
  5200. #endif
  5201. #ifdef USE_SHEEN_COLORMAP
  5202. vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
  5203. #endif
  5204. #ifdef USE_SHEEN_ROUGHNESSMAP
  5205. vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
  5206. #endif
  5207. #ifdef USE_SPECULARMAP
  5208. vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
  5209. #endif
  5210. #ifdef USE_SPECULAR_COLORMAP
  5211. vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
  5212. #endif
  5213. #ifdef USE_SPECULAR_INTENSITYMAP
  5214. vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
  5215. #endif
  5216. #ifdef USE_TRANSMISSIONMAP
  5217. vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
  5218. #endif
  5219. #ifdef USE_THICKNESSMAP
  5220. vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
  5221. #endif
  5222. `;var ure=`
  5223. #if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
  5224. vec4 worldPosition = vec4( transformed, 1.0 );
  5225. #ifdef USE_BATCHING
  5226. worldPosition = batchingMatrix * worldPosition;
  5227. #endif
  5228. #ifdef USE_INSTANCING
  5229. worldPosition = instanceMatrix * worldPosition;
  5230. #endif
  5231. worldPosition = modelMatrix * worldPosition;
  5232. #endif
  5233. `;var cre=`
  5234. varying vec2 vUv;
  5235. uniform mat3 uvTransform;
  5236. void main() {
  5237. vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
  5238. gl_Position = vec4( position.xy, 1.0, 1.0 );
  5239. }
  5240. `,hre=`
  5241. uniform sampler2D t2D;
  5242. uniform float backgroundIntensity;
  5243. varying vec2 vUv;
  5244. void main() {
  5245. vec4 texColor = texture2D( t2D, vUv );
  5246. #ifdef DECODE_VIDEO_TEXTURE
  5247. // use inline sRGB decode until browsers properly support SRGB8_APLHA8 with video textures
  5248. texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
  5249. #endif
  5250. texColor.rgb *= backgroundIntensity;
  5251. gl_FragColor = texColor;
  5252. #include <tonemapping_fragment>
  5253. #include <colorspace_fragment>
  5254. }
  5255. `;var fre=`
  5256. varying vec3 vWorldDirection;
  5257. #include <common>
  5258. void main() {
  5259. vWorldDirection = transformDirection( position, modelMatrix );
  5260. #include <begin_vertex>
  5261. #include <project_vertex>
  5262. gl_Position.z = gl_Position.w; // set z to camera.far
  5263. }
  5264. `,pre=`
  5265. #ifdef ENVMAP_TYPE_CUBE
  5266. uniform samplerCube envMap;
  5267. #elif defined( ENVMAP_TYPE_CUBE_UV )
  5268. uniform sampler2D envMap;
  5269. #endif
  5270. uniform float flipEnvMap;
  5271. uniform float backgroundBlurriness;
  5272. uniform float backgroundIntensity;
  5273. uniform mat3 backgroundRotation;
  5274. varying vec3 vWorldDirection;
  5275. #include <cube_uv_reflection_fragment>
  5276. void main() {
  5277. #ifdef ENVMAP_TYPE_CUBE
  5278. vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
  5279. #elif defined( ENVMAP_TYPE_CUBE_UV )
  5280. vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
  5281. #else
  5282. vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
  5283. #endif
  5284. texColor.rgb *= backgroundIntensity;
  5285. gl_FragColor = texColor;
  5286. #include <tonemapping_fragment>
  5287. #include <colorspace_fragment>
  5288. }
  5289. `;var dre=`
  5290. varying vec3 vWorldDirection;
  5291. #include <common>
  5292. void main() {
  5293. vWorldDirection = transformDirection( position, modelMatrix );
  5294. #include <begin_vertex>
  5295. #include <project_vertex>
  5296. gl_Position.z = gl_Position.w; // set z to camera.far
  5297. }
  5298. `,mre=`
  5299. uniform samplerCube tCube;
  5300. uniform float tFlip;
  5301. uniform float opacity;
  5302. varying vec3 vWorldDirection;
  5303. void main() {
  5304. vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
  5305. gl_FragColor = texColor;
  5306. gl_FragColor.a *= opacity;
  5307. #include <tonemapping_fragment>
  5308. #include <colorspace_fragment>
  5309. }
  5310. `;var vre=`
  5311. #include <common>
  5312. #include <batching_pars_vertex>
  5313. #include <uv_pars_vertex>
  5314. #include <displacementmap_pars_vertex>
  5315. #include <morphtarget_pars_vertex>
  5316. #include <skinning_pars_vertex>
  5317. #include <logdepthbuf_pars_vertex>
  5318. #include <clipping_planes_pars_vertex>
  5319. // This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.
  5320. // Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for
  5321. // depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.
  5322. varying vec2 vHighPrecisionZW;
  5323. void main() {
  5324. #include <uv_vertex>
  5325. #include <batching_vertex>
  5326. #include <skinbase_vertex>
  5327. #include <morphinstance_vertex>
  5328. #ifdef USE_DISPLACEMENTMAP
  5329. #include <beginnormal_vertex>
  5330. #include <morphnormal_vertex>
  5331. #include <skinnormal_vertex>
  5332. #endif
  5333. #include <begin_vertex>
  5334. #include <morphtarget_vertex>
  5335. #include <skinning_vertex>
  5336. #include <displacementmap_vertex>
  5337. #include <project_vertex>
  5338. #include <logdepthbuf_vertex>
  5339. #include <clipping_planes_vertex>
  5340. vHighPrecisionZW = gl_Position.zw;
  5341. }
  5342. `,gre=`
  5343. #if DEPTH_PACKING == 3200
  5344. uniform float opacity;
  5345. #endif
  5346. #include <common>
  5347. #include <packing>
  5348. #include <uv_pars_fragment>
  5349. #include <map_pars_fragment>
  5350. #include <alphamap_pars_fragment>
  5351. #include <alphatest_pars_fragment>
  5352. #include <alphahash_pars_fragment>
  5353. #include <logdepthbuf_pars_fragment>
  5354. #include <clipping_planes_pars_fragment>
  5355. varying vec2 vHighPrecisionZW;
  5356. void main() {
  5357. vec4 diffuseColor = vec4( 1.0 );
  5358. #include <clipping_planes_fragment>
  5359. #if DEPTH_PACKING == 3200
  5360. diffuseColor.a = opacity;
  5361. #endif
  5362. #include <map_fragment>
  5363. #include <alphamap_fragment>
  5364. #include <alphatest_fragment>
  5365. #include <alphahash_fragment>
  5366. #include <logdepthbuf_fragment>
  5367. // Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.
  5368. float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
  5369. #if DEPTH_PACKING == 3200
  5370. gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
  5371. #elif DEPTH_PACKING == 3201
  5372. gl_FragColor = packDepthToRGBA( fragCoordZ );
  5373. #endif
  5374. }
  5375. `;var yre=`
  5376. #define DISTANCE
  5377. varying vec3 vWorldPosition;
  5378. #include <common>
  5379. #include <batching_pars_vertex>
  5380. #include <uv_pars_vertex>
  5381. #include <displacementmap_pars_vertex>
  5382. #include <morphtarget_pars_vertex>
  5383. #include <skinning_pars_vertex>
  5384. #include <clipping_planes_pars_vertex>
  5385. void main() {
  5386. #include <uv_vertex>
  5387. #include <batching_vertex>
  5388. #include <skinbase_vertex>
  5389. #include <morphinstance_vertex>
  5390. #ifdef USE_DISPLACEMENTMAP
  5391. #include <beginnormal_vertex>
  5392. #include <morphnormal_vertex>
  5393. #include <skinnormal_vertex>
  5394. #endif
  5395. #include <begin_vertex>
  5396. #include <morphtarget_vertex>
  5397. #include <skinning_vertex>
  5398. #include <displacementmap_vertex>
  5399. #include <project_vertex>
  5400. #include <worldpos_vertex>
  5401. #include <clipping_planes_vertex>
  5402. vWorldPosition = worldPosition.xyz;
  5403. }
  5404. `,_re=`
  5405. #define DISTANCE
  5406. uniform vec3 referencePosition;
  5407. uniform float nearDistance;
  5408. uniform float farDistance;
  5409. varying vec3 vWorldPosition;
  5410. #include <common>
  5411. #include <packing>
  5412. #include <uv_pars_fragment>
  5413. #include <map_pars_fragment>
  5414. #include <alphamap_pars_fragment>
  5415. #include <alphatest_pars_fragment>
  5416. #include <alphahash_pars_fragment>
  5417. #include <clipping_planes_pars_fragment>
  5418. void main () {
  5419. vec4 diffuseColor = vec4( 1.0 );
  5420. #include <clipping_planes_fragment>
  5421. #include <map_fragment>
  5422. #include <alphamap_fragment>
  5423. #include <alphatest_fragment>
  5424. #include <alphahash_fragment>
  5425. float dist = length( vWorldPosition - referencePosition );
  5426. dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
  5427. dist = saturate( dist ); // clamp to [ 0, 1 ]
  5428. gl_FragColor = packDepthToRGBA( dist );
  5429. }
  5430. `;var xre=`
  5431. varying vec3 vWorldDirection;
  5432. #include <common>
  5433. void main() {
  5434. vWorldDirection = transformDirection( position, modelMatrix );
  5435. #include <begin_vertex>
  5436. #include <project_vertex>
  5437. }
  5438. `,Sre=`
  5439. uniform sampler2D tEquirect;
  5440. varying vec3 vWorldDirection;
  5441. #include <common>
  5442. void main() {
  5443. vec3 direction = normalize( vWorldDirection );
  5444. vec2 sampleUV = equirectUv( direction );
  5445. gl_FragColor = texture2D( tEquirect, sampleUV );
  5446. #include <tonemapping_fragment>
  5447. #include <colorspace_fragment>
  5448. }
  5449. `;var Mre=`
  5450. uniform float scale;
  5451. attribute float lineDistance;
  5452. varying float vLineDistance;
  5453. #include <common>
  5454. #include <uv_pars_vertex>
  5455. #include <color_pars_vertex>
  5456. #include <fog_pars_vertex>
  5457. #include <morphtarget_pars_vertex>
  5458. #include <logdepthbuf_pars_vertex>
  5459. #include <clipping_planes_pars_vertex>
  5460. void main() {
  5461. vLineDistance = scale * lineDistance;
  5462. #include <uv_vertex>
  5463. #include <color_vertex>
  5464. #include <morphinstance_vertex>
  5465. #include <morphcolor_vertex>
  5466. #include <begin_vertex>
  5467. #include <morphtarget_vertex>
  5468. #include <project_vertex>
  5469. #include <logdepthbuf_vertex>
  5470. #include <clipping_planes_vertex>
  5471. #include <fog_vertex>
  5472. }
  5473. `,bre=`
  5474. uniform vec3 diffuse;
  5475. uniform float opacity;
  5476. uniform float dashSize;
  5477. uniform float totalSize;
  5478. varying float vLineDistance;
  5479. #include <common>
  5480. #include <color_pars_fragment>
  5481. #include <uv_pars_fragment>
  5482. #include <map_pars_fragment>
  5483. #include <fog_pars_fragment>
  5484. #include <logdepthbuf_pars_fragment>
  5485. #include <clipping_planes_pars_fragment>
  5486. void main() {
  5487. vec4 diffuseColor = vec4( diffuse, opacity );
  5488. #include <clipping_planes_fragment>
  5489. if ( mod( vLineDistance, totalSize ) > dashSize ) {
  5490. discard;
  5491. }
  5492. vec3 outgoingLight = vec3( 0.0 );
  5493. #include <logdepthbuf_fragment>
  5494. #include <map_fragment>
  5495. #include <color_fragment>
  5496. outgoingLight = diffuseColor.rgb; // simple shader
  5497. #include <opaque_fragment>
  5498. #include <tonemapping_fragment>
  5499. #include <colorspace_fragment>
  5500. #include <fog_fragment>
  5501. #include <premultiplied_alpha_fragment>
  5502. }
  5503. `;var wre=`
  5504. #include <common>
  5505. #include <batching_pars_vertex>
  5506. #include <uv_pars_vertex>
  5507. #include <envmap_pars_vertex>
  5508. #include <color_pars_vertex>
  5509. #include <fog_pars_vertex>
  5510. #include <morphtarget_pars_vertex>
  5511. #include <skinning_pars_vertex>
  5512. #include <logdepthbuf_pars_vertex>
  5513. #include <clipping_planes_pars_vertex>
  5514. void main() {
  5515. #include <uv_vertex>
  5516. #include <color_vertex>
  5517. #include <morphinstance_vertex>
  5518. #include <morphcolor_vertex>
  5519. #include <batching_vertex>
  5520. #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
  5521. #include <beginnormal_vertex>
  5522. #include <morphnormal_vertex>
  5523. #include <skinbase_vertex>
  5524. #include <skinnormal_vertex>
  5525. #include <defaultnormal_vertex>
  5526. #endif
  5527. #include <begin_vertex>
  5528. #include <morphtarget_vertex>
  5529. #include <skinning_vertex>
  5530. #include <project_vertex>
  5531. #include <logdepthbuf_vertex>
  5532. #include <clipping_planes_vertex>
  5533. #include <worldpos_vertex>
  5534. #include <envmap_vertex>
  5535. #include <fog_vertex>
  5536. }
  5537. `,Tre=`
  5538. uniform vec3 diffuse;
  5539. uniform float opacity;
  5540. #ifndef FLAT_SHADED
  5541. varying vec3 vNormal;
  5542. #endif
  5543. #include <common>
  5544. #include <dithering_pars_fragment>
  5545. #include <color_pars_fragment>
  5546. #include <uv_pars_fragment>
  5547. #include <map_pars_fragment>
  5548. #include <alphamap_pars_fragment>
  5549. #include <alphatest_pars_fragment>
  5550. #include <alphahash_pars_fragment>
  5551. #include <aomap_pars_fragment>
  5552. #include <lightmap_pars_fragment>
  5553. #include <envmap_common_pars_fragment>
  5554. #include <envmap_pars_fragment>
  5555. #include <fog_pars_fragment>
  5556. #include <specularmap_pars_fragment>
  5557. #include <logdepthbuf_pars_fragment>
  5558. #include <clipping_planes_pars_fragment>
  5559. void main() {
  5560. vec4 diffuseColor = vec4( diffuse, opacity );
  5561. #include <clipping_planes_fragment>
  5562. #include <logdepthbuf_fragment>
  5563. #include <map_fragment>
  5564. #include <color_fragment>
  5565. #include <alphamap_fragment>
  5566. #include <alphatest_fragment>
  5567. #include <alphahash_fragment>
  5568. #include <specularmap_fragment>
  5569. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  5570. // accumulation (baked indirect lighting only)
  5571. #ifdef USE_LIGHTMAP
  5572. vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
  5573. reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
  5574. #else
  5575. reflectedLight.indirectDiffuse += vec3( 1.0 );
  5576. #endif
  5577. // modulation
  5578. #include <aomap_fragment>
  5579. reflectedLight.indirectDiffuse *= diffuseColor.rgb;
  5580. vec3 outgoingLight = reflectedLight.indirectDiffuse;
  5581. #include <envmap_fragment>
  5582. #include <opaque_fragment>
  5583. #include <tonemapping_fragment>
  5584. #include <colorspace_fragment>
  5585. #include <fog_fragment>
  5586. #include <premultiplied_alpha_fragment>
  5587. #include <dithering_fragment>
  5588. }
  5589. `;var Ere=`
  5590. #define LAMBERT
  5591. varying vec3 vViewPosition;
  5592. #include <common>
  5593. #include <batching_pars_vertex>
  5594. #include <uv_pars_vertex>
  5595. #include <displacementmap_pars_vertex>
  5596. #include <envmap_pars_vertex>
  5597. #include <color_pars_vertex>
  5598. #include <fog_pars_vertex>
  5599. #include <normal_pars_vertex>
  5600. #include <morphtarget_pars_vertex>
  5601. #include <skinning_pars_vertex>
  5602. #include <shadowmap_pars_vertex>
  5603. #include <logdepthbuf_pars_vertex>
  5604. #include <clipping_planes_pars_vertex>
  5605. void main() {
  5606. #include <uv_vertex>
  5607. #include <color_vertex>
  5608. #include <morphinstance_vertex>
  5609. #include <morphcolor_vertex>
  5610. #include <batching_vertex>
  5611. #include <beginnormal_vertex>
  5612. #include <morphnormal_vertex>
  5613. #include <skinbase_vertex>
  5614. #include <skinnormal_vertex>
  5615. #include <defaultnormal_vertex>
  5616. #include <normal_vertex>
  5617. #include <begin_vertex>
  5618. #include <morphtarget_vertex>
  5619. #include <skinning_vertex>
  5620. #include <displacementmap_vertex>
  5621. #include <project_vertex>
  5622. #include <logdepthbuf_vertex>
  5623. #include <clipping_planes_vertex>
  5624. vViewPosition = - mvPosition.xyz;
  5625. #include <worldpos_vertex>
  5626. #include <envmap_vertex>
  5627. #include <shadowmap_vertex>
  5628. #include <fog_vertex>
  5629. }
  5630. `,Are=`
  5631. #define LAMBERT
  5632. uniform vec3 diffuse;
  5633. uniform vec3 emissive;
  5634. uniform float opacity;
  5635. #include <common>
  5636. #include <packing>
  5637. #include <dithering_pars_fragment>
  5638. #include <color_pars_fragment>
  5639. #include <uv_pars_fragment>
  5640. #include <map_pars_fragment>
  5641. #include <alphamap_pars_fragment>
  5642. #include <alphatest_pars_fragment>
  5643. #include <alphahash_pars_fragment>
  5644. #include <aomap_pars_fragment>
  5645. #include <lightmap_pars_fragment>
  5646. #include <emissivemap_pars_fragment>
  5647. #include <envmap_common_pars_fragment>
  5648. #include <envmap_pars_fragment>
  5649. #include <fog_pars_fragment>
  5650. #include <bsdfs>
  5651. #include <lights_pars_begin>
  5652. #include <normal_pars_fragment>
  5653. #include <lights_lambert_pars_fragment>
  5654. #include <shadowmap_pars_fragment>
  5655. #include <bumpmap_pars_fragment>
  5656. #include <normalmap_pars_fragment>
  5657. #include <specularmap_pars_fragment>
  5658. #include <logdepthbuf_pars_fragment>
  5659. #include <clipping_planes_pars_fragment>
  5660. void main() {
  5661. vec4 diffuseColor = vec4( diffuse, opacity );
  5662. #include <clipping_planes_fragment>
  5663. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  5664. vec3 totalEmissiveRadiance = emissive;
  5665. #include <logdepthbuf_fragment>
  5666. #include <map_fragment>
  5667. #include <color_fragment>
  5668. #include <alphamap_fragment>
  5669. #include <alphatest_fragment>
  5670. #include <alphahash_fragment>
  5671. #include <specularmap_fragment>
  5672. #include <normal_fragment_begin>
  5673. #include <normal_fragment_maps>
  5674. #include <emissivemap_fragment>
  5675. // accumulation
  5676. #include <lights_lambert_fragment>
  5677. #include <lights_fragment_begin>
  5678. #include <lights_fragment_maps>
  5679. #include <lights_fragment_end>
  5680. // modulation
  5681. #include <aomap_fragment>
  5682. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
  5683. #include <envmap_fragment>
  5684. #include <opaque_fragment>
  5685. #include <tonemapping_fragment>
  5686. #include <colorspace_fragment>
  5687. #include <fog_fragment>
  5688. #include <premultiplied_alpha_fragment>
  5689. #include <dithering_fragment>
  5690. }
  5691. `;var Cre=`
  5692. #define MATCAP
  5693. varying vec3 vViewPosition;
  5694. #include <common>
  5695. #include <batching_pars_vertex>
  5696. #include <uv_pars_vertex>
  5697. #include <color_pars_vertex>
  5698. #include <displacementmap_pars_vertex>
  5699. #include <fog_pars_vertex>
  5700. #include <normal_pars_vertex>
  5701. #include <morphtarget_pars_vertex>
  5702. #include <skinning_pars_vertex>
  5703. #include <logdepthbuf_pars_vertex>
  5704. #include <clipping_planes_pars_vertex>
  5705. void main() {
  5706. #include <uv_vertex>
  5707. #include <color_vertex>
  5708. #include <morphinstance_vertex>
  5709. #include <morphcolor_vertex>
  5710. #include <batching_vertex>
  5711. #include <beginnormal_vertex>
  5712. #include <morphnormal_vertex>
  5713. #include <skinbase_vertex>
  5714. #include <skinnormal_vertex>
  5715. #include <defaultnormal_vertex>
  5716. #include <normal_vertex>
  5717. #include <begin_vertex>
  5718. #include <morphtarget_vertex>
  5719. #include <skinning_vertex>
  5720. #include <displacementmap_vertex>
  5721. #include <project_vertex>
  5722. #include <logdepthbuf_vertex>
  5723. #include <clipping_planes_vertex>
  5724. #include <fog_vertex>
  5725. vViewPosition = - mvPosition.xyz;
  5726. }
  5727. `,Rre=`
  5728. #define MATCAP
  5729. uniform vec3 diffuse;
  5730. uniform float opacity;
  5731. uniform sampler2D matcap;
  5732. varying vec3 vViewPosition;
  5733. #include <common>
  5734. #include <dithering_pars_fragment>
  5735. #include <color_pars_fragment>
  5736. #include <uv_pars_fragment>
  5737. #include <map_pars_fragment>
  5738. #include <alphamap_pars_fragment>
  5739. #include <alphatest_pars_fragment>
  5740. #include <alphahash_pars_fragment>
  5741. #include <fog_pars_fragment>
  5742. #include <normal_pars_fragment>
  5743. #include <bumpmap_pars_fragment>
  5744. #include <normalmap_pars_fragment>
  5745. #include <logdepthbuf_pars_fragment>
  5746. #include <clipping_planes_pars_fragment>
  5747. void main() {
  5748. vec4 diffuseColor = vec4( diffuse, opacity );
  5749. #include <clipping_planes_fragment>
  5750. #include <logdepthbuf_fragment>
  5751. #include <map_fragment>
  5752. #include <color_fragment>
  5753. #include <alphamap_fragment>
  5754. #include <alphatest_fragment>
  5755. #include <alphahash_fragment>
  5756. #include <normal_fragment_begin>
  5757. #include <normal_fragment_maps>
  5758. vec3 viewDir = normalize( vViewPosition );
  5759. vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
  5760. vec3 y = cross( viewDir, x );
  5761. vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks
  5762. #ifdef USE_MATCAP
  5763. vec4 matcapColor = texture2D( matcap, uv );
  5764. #else
  5765. vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); // default if matcap is missing
  5766. #endif
  5767. vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
  5768. #include <opaque_fragment>
  5769. #include <tonemapping_fragment>
  5770. #include <colorspace_fragment>
  5771. #include <fog_fragment>
  5772. #include <premultiplied_alpha_fragment>
  5773. #include <dithering_fragment>
  5774. }
  5775. `;var Lre=`
  5776. #define NORMAL
  5777. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
  5778. varying vec3 vViewPosition;
  5779. #endif
  5780. #include <common>
  5781. #include <batching_pars_vertex>
  5782. #include <uv_pars_vertex>
  5783. #include <displacementmap_pars_vertex>
  5784. #include <normal_pars_vertex>
  5785. #include <morphtarget_pars_vertex>
  5786. #include <skinning_pars_vertex>
  5787. #include <logdepthbuf_pars_vertex>
  5788. #include <clipping_planes_pars_vertex>
  5789. void main() {
  5790. #include <uv_vertex>
  5791. #include <batching_vertex>
  5792. #include <beginnormal_vertex>
  5793. #include <morphinstance_vertex>
  5794. #include <morphnormal_vertex>
  5795. #include <skinbase_vertex>
  5796. #include <skinnormal_vertex>
  5797. #include <defaultnormal_vertex>
  5798. #include <normal_vertex>
  5799. #include <begin_vertex>
  5800. #include <morphtarget_vertex>
  5801. #include <skinning_vertex>
  5802. #include <displacementmap_vertex>
  5803. #include <project_vertex>
  5804. #include <logdepthbuf_vertex>
  5805. #include <clipping_planes_vertex>
  5806. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
  5807. vViewPosition = - mvPosition.xyz;
  5808. #endif
  5809. }
  5810. `,Dre=`
  5811. #define NORMAL
  5812. uniform float opacity;
  5813. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
  5814. varying vec3 vViewPosition;
  5815. #endif
  5816. #include <packing>
  5817. #include <uv_pars_fragment>
  5818. #include <normal_pars_fragment>
  5819. #include <bumpmap_pars_fragment>
  5820. #include <normalmap_pars_fragment>
  5821. #include <logdepthbuf_pars_fragment>
  5822. #include <clipping_planes_pars_fragment>
  5823. void main() {
  5824. vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
  5825. #include <clipping_planes_fragment>
  5826. #include <logdepthbuf_fragment>
  5827. #include <normal_fragment_begin>
  5828. #include <normal_fragment_maps>
  5829. gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
  5830. #ifdef OPAQUE
  5831. gl_FragColor.a = 1.0;
  5832. #endif
  5833. }
  5834. `;var Pre=`
  5835. #define PHONG
  5836. varying vec3 vViewPosition;
  5837. #include <common>
  5838. #include <batching_pars_vertex>
  5839. #include <uv_pars_vertex>
  5840. #include <displacementmap_pars_vertex>
  5841. #include <envmap_pars_vertex>
  5842. #include <color_pars_vertex>
  5843. #include <fog_pars_vertex>
  5844. #include <normal_pars_vertex>
  5845. #include <morphtarget_pars_vertex>
  5846. #include <skinning_pars_vertex>
  5847. #include <shadowmap_pars_vertex>
  5848. #include <logdepthbuf_pars_vertex>
  5849. #include <clipping_planes_pars_vertex>
  5850. void main() {
  5851. #include <uv_vertex>
  5852. #include <color_vertex>
  5853. #include <morphcolor_vertex>
  5854. #include <batching_vertex>
  5855. #include <beginnormal_vertex>
  5856. #include <morphinstance_vertex>
  5857. #include <morphnormal_vertex>
  5858. #include <skinbase_vertex>
  5859. #include <skinnormal_vertex>
  5860. #include <defaultnormal_vertex>
  5861. #include <normal_vertex>
  5862. #include <begin_vertex>
  5863. #include <morphtarget_vertex>
  5864. #include <skinning_vertex>
  5865. #include <displacementmap_vertex>
  5866. #include <project_vertex>
  5867. #include <logdepthbuf_vertex>
  5868. #include <clipping_planes_vertex>
  5869. vViewPosition = - mvPosition.xyz;
  5870. #include <worldpos_vertex>
  5871. #include <envmap_vertex>
  5872. #include <shadowmap_vertex>
  5873. #include <fog_vertex>
  5874. }
  5875. `,Ire=`
  5876. #define PHONG
  5877. uniform vec3 diffuse;
  5878. uniform vec3 emissive;
  5879. uniform vec3 specular;
  5880. uniform float shininess;
  5881. uniform float opacity;
  5882. #include <common>
  5883. #include <packing>
  5884. #include <dithering_pars_fragment>
  5885. #include <color_pars_fragment>
  5886. #include <uv_pars_fragment>
  5887. #include <map_pars_fragment>
  5888. #include <alphamap_pars_fragment>
  5889. #include <alphatest_pars_fragment>
  5890. #include <alphahash_pars_fragment>
  5891. #include <aomap_pars_fragment>
  5892. #include <lightmap_pars_fragment>
  5893. #include <emissivemap_pars_fragment>
  5894. #include <envmap_common_pars_fragment>
  5895. #include <envmap_pars_fragment>
  5896. #include <fog_pars_fragment>
  5897. #include <bsdfs>
  5898. #include <lights_pars_begin>
  5899. #include <normal_pars_fragment>
  5900. #include <lights_phong_pars_fragment>
  5901. #include <shadowmap_pars_fragment>
  5902. #include <bumpmap_pars_fragment>
  5903. #include <normalmap_pars_fragment>
  5904. #include <specularmap_pars_fragment>
  5905. #include <logdepthbuf_pars_fragment>
  5906. #include <clipping_planes_pars_fragment>
  5907. void main() {
  5908. vec4 diffuseColor = vec4( diffuse, opacity );
  5909. #include <clipping_planes_fragment>
  5910. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  5911. vec3 totalEmissiveRadiance = emissive;
  5912. #include <logdepthbuf_fragment>
  5913. #include <map_fragment>
  5914. #include <color_fragment>
  5915. #include <alphamap_fragment>
  5916. #include <alphatest_fragment>
  5917. #include <alphahash_fragment>
  5918. #include <specularmap_fragment>
  5919. #include <normal_fragment_begin>
  5920. #include <normal_fragment_maps>
  5921. #include <emissivemap_fragment>
  5922. // accumulation
  5923. #include <lights_phong_fragment>
  5924. #include <lights_fragment_begin>
  5925. #include <lights_fragment_maps>
  5926. #include <lights_fragment_end>
  5927. // modulation
  5928. #include <aomap_fragment>
  5929. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
  5930. #include <envmap_fragment>
  5931. #include <opaque_fragment>
  5932. #include <tonemapping_fragment>
  5933. #include <colorspace_fragment>
  5934. #include <fog_fragment>
  5935. #include <premultiplied_alpha_fragment>
  5936. #include <dithering_fragment>
  5937. }
  5938. `;var Nre=`
  5939. #define STANDARD
  5940. varying vec3 vViewPosition;
  5941. #ifdef USE_TRANSMISSION
  5942. varying vec3 vWorldPosition;
  5943. #endif
  5944. #include <common>
  5945. #include <batching_pars_vertex>
  5946. #include <uv_pars_vertex>
  5947. #include <displacementmap_pars_vertex>
  5948. #include <color_pars_vertex>
  5949. #include <fog_pars_vertex>
  5950. #include <normal_pars_vertex>
  5951. #include <morphtarget_pars_vertex>
  5952. #include <skinning_pars_vertex>
  5953. #include <shadowmap_pars_vertex>
  5954. #include <logdepthbuf_pars_vertex>
  5955. #include <clipping_planes_pars_vertex>
  5956. void main() {
  5957. #include <uv_vertex>
  5958. #include <color_vertex>
  5959. #include <morphinstance_vertex>
  5960. #include <morphcolor_vertex>
  5961. #include <batching_vertex>
  5962. #include <beginnormal_vertex>
  5963. #include <morphnormal_vertex>
  5964. #include <skinbase_vertex>
  5965. #include <skinnormal_vertex>
  5966. #include <defaultnormal_vertex>
  5967. #include <normal_vertex>
  5968. #include <begin_vertex>
  5969. #include <morphtarget_vertex>
  5970. #include <skinning_vertex>
  5971. #include <displacementmap_vertex>
  5972. #include <project_vertex>
  5973. #include <logdepthbuf_vertex>
  5974. #include <clipping_planes_vertex>
  5975. vViewPosition = - mvPosition.xyz;
  5976. #include <worldpos_vertex>
  5977. #include <shadowmap_vertex>
  5978. #include <fog_vertex>
  5979. #ifdef USE_TRANSMISSION
  5980. vWorldPosition = worldPosition.xyz;
  5981. #endif
  5982. }
  5983. `,Ure=`
  5984. #define STANDARD
  5985. #ifdef PHYSICAL
  5986. #define IOR
  5987. #define USE_SPECULAR
  5988. #endif
  5989. uniform vec3 diffuse;
  5990. uniform vec3 emissive;
  5991. uniform float roughness;
  5992. uniform float metalness;
  5993. uniform float opacity;
  5994. #ifdef IOR
  5995. uniform float ior;
  5996. #endif
  5997. #ifdef USE_SPECULAR
  5998. uniform float specularIntensity;
  5999. uniform vec3 specularColor;
  6000. #ifdef USE_SPECULAR_COLORMAP
  6001. uniform sampler2D specularColorMap;
  6002. #endif
  6003. #ifdef USE_SPECULAR_INTENSITYMAP
  6004. uniform sampler2D specularIntensityMap;
  6005. #endif
  6006. #endif
  6007. #ifdef USE_CLEARCOAT
  6008. uniform float clearcoat;
  6009. uniform float clearcoatRoughness;
  6010. #endif
  6011. #ifdef USE_IRIDESCENCE
  6012. uniform float iridescence;
  6013. uniform float iridescenceIOR;
  6014. uniform float iridescenceThicknessMinimum;
  6015. uniform float iridescenceThicknessMaximum;
  6016. #endif
  6017. #ifdef USE_SHEEN
  6018. uniform vec3 sheenColor;
  6019. uniform float sheenRoughness;
  6020. #ifdef USE_SHEEN_COLORMAP
  6021. uniform sampler2D sheenColorMap;
  6022. #endif
  6023. #ifdef USE_SHEEN_ROUGHNESSMAP
  6024. uniform sampler2D sheenRoughnessMap;
  6025. #endif
  6026. #endif
  6027. #ifdef USE_ANISOTROPY
  6028. uniform vec2 anisotropyVector;
  6029. #ifdef USE_ANISOTROPYMAP
  6030. uniform sampler2D anisotropyMap;
  6031. #endif
  6032. #endif
  6033. varying vec3 vViewPosition;
  6034. #include <common>
  6035. #include <packing>
  6036. #include <dithering_pars_fragment>
  6037. #include <color_pars_fragment>
  6038. #include <uv_pars_fragment>
  6039. #include <map_pars_fragment>
  6040. #include <alphamap_pars_fragment>
  6041. #include <alphatest_pars_fragment>
  6042. #include <alphahash_pars_fragment>
  6043. #include <aomap_pars_fragment>
  6044. #include <lightmap_pars_fragment>
  6045. #include <emissivemap_pars_fragment>
  6046. #include <iridescence_fragment>
  6047. #include <cube_uv_reflection_fragment>
  6048. #include <envmap_common_pars_fragment>
  6049. #include <envmap_physical_pars_fragment>
  6050. #include <fog_pars_fragment>
  6051. #include <lights_pars_begin>
  6052. #include <normal_pars_fragment>
  6053. #include <lights_physical_pars_fragment>
  6054. #include <transmission_pars_fragment>
  6055. #include <shadowmap_pars_fragment>
  6056. #include <bumpmap_pars_fragment>
  6057. #include <normalmap_pars_fragment>
  6058. #include <clearcoat_pars_fragment>
  6059. #include <iridescence_pars_fragment>
  6060. #include <roughnessmap_pars_fragment>
  6061. #include <metalnessmap_pars_fragment>
  6062. #include <logdepthbuf_pars_fragment>
  6063. #include <clipping_planes_pars_fragment>
  6064. void main() {
  6065. vec4 diffuseColor = vec4( diffuse, opacity );
  6066. #include <clipping_planes_fragment>
  6067. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  6068. vec3 totalEmissiveRadiance = emissive;
  6069. #include <logdepthbuf_fragment>
  6070. #include <map_fragment>
  6071. #include <color_fragment>
  6072. #include <alphamap_fragment>
  6073. #include <alphatest_fragment>
  6074. #include <alphahash_fragment>
  6075. #include <roughnessmap_fragment>
  6076. #include <metalnessmap_fragment>
  6077. #include <normal_fragment_begin>
  6078. #include <normal_fragment_maps>
  6079. #include <clearcoat_normal_fragment_begin>
  6080. #include <clearcoat_normal_fragment_maps>
  6081. #include <emissivemap_fragment>
  6082. // accumulation
  6083. #include <lights_physical_fragment>
  6084. #include <lights_fragment_begin>
  6085. #include <lights_fragment_maps>
  6086. #include <lights_fragment_end>
  6087. // modulation
  6088. #include <aomap_fragment>
  6089. vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
  6090. vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
  6091. #include <transmission_fragment>
  6092. vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
  6093. #ifdef USE_SHEEN
  6094. // Sheen energy compensation approximation calculation can be found at the end of
  6095. // https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing
  6096. float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
  6097. outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
  6098. #endif
  6099. #ifdef USE_CLEARCOAT
  6100. float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
  6101. vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
  6102. outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
  6103. #endif
  6104. #include <opaque_fragment>
  6105. #include <tonemapping_fragment>
  6106. #include <colorspace_fragment>
  6107. #include <fog_fragment>
  6108. #include <premultiplied_alpha_fragment>
  6109. #include <dithering_fragment>
  6110. }
  6111. `;var Ore=`
  6112. #define TOON
  6113. varying vec3 vViewPosition;
  6114. #include <common>
  6115. #include <batching_pars_vertex>
  6116. #include <uv_pars_vertex>
  6117. #include <displacementmap_pars_vertex>
  6118. #include <color_pars_vertex>
  6119. #include <fog_pars_vertex>
  6120. #include <normal_pars_vertex>
  6121. #include <morphtarget_pars_vertex>
  6122. #include <skinning_pars_vertex>
  6123. #include <shadowmap_pars_vertex>
  6124. #include <logdepthbuf_pars_vertex>
  6125. #include <clipping_planes_pars_vertex>
  6126. void main() {
  6127. #include <uv_vertex>
  6128. #include <color_vertex>
  6129. #include <morphinstance_vertex>
  6130. #include <morphcolor_vertex>
  6131. #include <batching_vertex>
  6132. #include <beginnormal_vertex>
  6133. #include <morphnormal_vertex>
  6134. #include <skinbase_vertex>
  6135. #include <skinnormal_vertex>
  6136. #include <defaultnormal_vertex>
  6137. #include <normal_vertex>
  6138. #include <begin_vertex>
  6139. #include <morphtarget_vertex>
  6140. #include <skinning_vertex>
  6141. #include <displacementmap_vertex>
  6142. #include <project_vertex>
  6143. #include <logdepthbuf_vertex>
  6144. #include <clipping_planes_vertex>
  6145. vViewPosition = - mvPosition.xyz;
  6146. #include <worldpos_vertex>
  6147. #include <shadowmap_vertex>
  6148. #include <fog_vertex>
  6149. }
  6150. `,zre=`
  6151. #define TOON
  6152. uniform vec3 diffuse;
  6153. uniform vec3 emissive;
  6154. uniform float opacity;
  6155. #include <common>
  6156. #include <packing>
  6157. #include <dithering_pars_fragment>
  6158. #include <color_pars_fragment>
  6159. #include <uv_pars_fragment>
  6160. #include <map_pars_fragment>
  6161. #include <alphamap_pars_fragment>
  6162. #include <alphatest_pars_fragment>
  6163. #include <alphahash_pars_fragment>
  6164. #include <aomap_pars_fragment>
  6165. #include <lightmap_pars_fragment>
  6166. #include <emissivemap_pars_fragment>
  6167. #include <gradientmap_pars_fragment>
  6168. #include <fog_pars_fragment>
  6169. #include <bsdfs>
  6170. #include <lights_pars_begin>
  6171. #include <normal_pars_fragment>
  6172. #include <lights_toon_pars_fragment>
  6173. #include <shadowmap_pars_fragment>
  6174. #include <bumpmap_pars_fragment>
  6175. #include <normalmap_pars_fragment>
  6176. #include <logdepthbuf_pars_fragment>
  6177. #include <clipping_planes_pars_fragment>
  6178. void main() {
  6179. vec4 diffuseColor = vec4( diffuse, opacity );
  6180. #include <clipping_planes_fragment>
  6181. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  6182. vec3 totalEmissiveRadiance = emissive;
  6183. #include <logdepthbuf_fragment>
  6184. #include <map_fragment>
  6185. #include <color_fragment>
  6186. #include <alphamap_fragment>
  6187. #include <alphatest_fragment>
  6188. #include <alphahash_fragment>
  6189. #include <normal_fragment_begin>
  6190. #include <normal_fragment_maps>
  6191. #include <emissivemap_fragment>
  6192. // accumulation
  6193. #include <lights_toon_fragment>
  6194. #include <lights_fragment_begin>
  6195. #include <lights_fragment_maps>
  6196. #include <lights_fragment_end>
  6197. // modulation
  6198. #include <aomap_fragment>
  6199. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
  6200. #include <opaque_fragment>
  6201. #include <tonemapping_fragment>
  6202. #include <colorspace_fragment>
  6203. #include <fog_fragment>
  6204. #include <premultiplied_alpha_fragment>
  6205. #include <dithering_fragment>
  6206. }
  6207. `;var Fre=`
  6208. uniform float size;
  6209. uniform float scale;
  6210. #include <common>
  6211. #include <color_pars_vertex>
  6212. #include <fog_pars_vertex>
  6213. #include <morphtarget_pars_vertex>
  6214. #include <logdepthbuf_pars_vertex>
  6215. #include <clipping_planes_pars_vertex>
  6216. #ifdef USE_POINTS_UV
  6217. varying vec2 vUv;
  6218. uniform mat3 uvTransform;
  6219. #endif
  6220. void main() {
  6221. #ifdef USE_POINTS_UV
  6222. vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
  6223. #endif
  6224. #include <color_vertex>
  6225. #include <morphinstance_vertex>
  6226. #include <morphcolor_vertex>
  6227. #include <begin_vertex>
  6228. #include <morphtarget_vertex>
  6229. #include <project_vertex>
  6230. gl_PointSize = size;
  6231. #ifdef USE_SIZEATTENUATION
  6232. bool isPerspective = isPerspectiveMatrix( projectionMatrix );
  6233. if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
  6234. #endif
  6235. #include <logdepthbuf_vertex>
  6236. #include <clipping_planes_vertex>
  6237. #include <worldpos_vertex>
  6238. #include <fog_vertex>
  6239. }
  6240. `,Bre=`
  6241. uniform vec3 diffuse;
  6242. uniform float opacity;
  6243. #include <common>
  6244. #include <color_pars_fragment>
  6245. #include <map_particle_pars_fragment>
  6246. #include <alphatest_pars_fragment>
  6247. #include <alphahash_pars_fragment>
  6248. #include <fog_pars_fragment>
  6249. #include <logdepthbuf_pars_fragment>
  6250. #include <clipping_planes_pars_fragment>
  6251. void main() {
  6252. vec4 diffuseColor = vec4( diffuse, opacity );
  6253. #include <clipping_planes_fragment>
  6254. vec3 outgoingLight = vec3( 0.0 );
  6255. #include <logdepthbuf_fragment>
  6256. #include <map_particle_fragment>
  6257. #include <color_fragment>
  6258. #include <alphatest_fragment>
  6259. #include <alphahash_fragment>
  6260. outgoingLight = diffuseColor.rgb;
  6261. #include <opaque_fragment>
  6262. #include <tonemapping_fragment>
  6263. #include <colorspace_fragment>
  6264. #include <fog_fragment>
  6265. #include <premultiplied_alpha_fragment>
  6266. }
  6267. `;var kre=`
  6268. #include <common>
  6269. #include <batching_pars_vertex>
  6270. #include <fog_pars_vertex>
  6271. #include <morphtarget_pars_vertex>
  6272. #include <skinning_pars_vertex>
  6273. #include <logdepthbuf_pars_vertex>
  6274. #include <shadowmap_pars_vertex>
  6275. void main() {
  6276. #include <batching_vertex>
  6277. #include <beginnormal_vertex>
  6278. #include <morphinstance_vertex>
  6279. #include <morphnormal_vertex>
  6280. #include <skinbase_vertex>
  6281. #include <skinnormal_vertex>
  6282. #include <defaultnormal_vertex>
  6283. #include <begin_vertex>
  6284. #include <morphtarget_vertex>
  6285. #include <skinning_vertex>
  6286. #include <project_vertex>
  6287. #include <logdepthbuf_vertex>
  6288. #include <worldpos_vertex>
  6289. #include <shadowmap_vertex>
  6290. #include <fog_vertex>
  6291. }
  6292. `,Vre=`
  6293. uniform vec3 color;
  6294. uniform float opacity;
  6295. #include <common>
  6296. #include <packing>
  6297. #include <fog_pars_fragment>
  6298. #include <bsdfs>
  6299. #include <lights_pars_begin>
  6300. #include <logdepthbuf_pars_fragment>
  6301. #include <shadowmap_pars_fragment>
  6302. #include <shadowmask_pars_fragment>
  6303. void main() {
  6304. #include <logdepthbuf_fragment>
  6305. gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
  6306. #include <tonemapping_fragment>
  6307. #include <colorspace_fragment>
  6308. #include <fog_fragment>
  6309. }
  6310. `;var Gre=`
  6311. uniform float rotation;
  6312. uniform vec2 center;
  6313. #include <common>
  6314. #include <uv_pars_vertex>
  6315. #include <fog_pars_vertex>
  6316. #include <logdepthbuf_pars_vertex>
  6317. #include <clipping_planes_pars_vertex>
  6318. void main() {
  6319. #include <uv_vertex>
  6320. vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
  6321. vec2 scale;
  6322. scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
  6323. scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
  6324. #ifndef USE_SIZEATTENUATION
  6325. bool isPerspective = isPerspectiveMatrix( projectionMatrix );
  6326. if ( isPerspective ) scale *= - mvPosition.z;
  6327. #endif
  6328. vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
  6329. vec2 rotatedPosition;
  6330. rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
  6331. rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
  6332. mvPosition.xy += rotatedPosition;
  6333. gl_Position = projectionMatrix * mvPosition;
  6334. #include <logdepthbuf_vertex>
  6335. #include <clipping_planes_vertex>
  6336. #include <fog_vertex>
  6337. }
  6338. `,Hre=`
  6339. uniform vec3 diffuse;
  6340. uniform float opacity;
  6341. #include <common>
  6342. #include <uv_pars_fragment>
  6343. #include <map_pars_fragment>
  6344. #include <alphamap_pars_fragment>
  6345. #include <alphatest_pars_fragment>
  6346. #include <alphahash_pars_fragment>
  6347. #include <fog_pars_fragment>
  6348. #include <logdepthbuf_pars_fragment>
  6349. #include <clipping_planes_pars_fragment>
  6350. void main() {
  6351. vec4 diffuseColor = vec4( diffuse, opacity );
  6352. #include <clipping_planes_fragment>
  6353. vec3 outgoingLight = vec3( 0.0 );
  6354. #include <logdepthbuf_fragment>
  6355. #include <map_fragment>
  6356. #include <alphamap_fragment>
  6357. #include <alphatest_fragment>
  6358. #include <alphahash_fragment>
  6359. outgoingLight = diffuseColor.rgb;
  6360. #include <opaque_fragment>
  6361. #include <tonemapping_fragment>
  6362. #include <colorspace_fragment>
  6363. #include <fog_fragment>
  6364. }
  6365. `;var mr={alphahash_fragment:cee,alphahash_pars_fragment:hee,alphamap_fragment:fee,alphamap_pars_fragment:pee,alphatest_fragment:dee,alphatest_pars_fragment:mee,aomap_fragment:vee,aomap_pars_fragment:gee,batching_pars_vertex:yee,batching_vertex:_ee,begin_vertex:xee,beginnormal_vertex:See,bsdfs:Mee,iridescence_fragment:bee,bumpmap_pars_fragment:wee,clipping_planes_fragment:Tee,clipping_planes_pars_fragment:Eee,clipping_planes_pars_vertex:Aee,clipping_planes_vertex:Cee,color_fragment:Ree,color_pars_fragment:Lee,color_pars_vertex:Dee,color_vertex:Pee,common:Iee,cube_uv_reflection_fragment:Nee,defaultnormal_vertex:Uee,displacementmap_pars_vertex:Oee,displacementmap_vertex:zee,emissivemap_fragment:Fee,emissivemap_pars_fragment:Bee,colorspace_fragment:kee,colorspace_pars_fragment:Vee,envmap_fragment:Gee,envmap_common_pars_fragment:Hee,envmap_pars_fragment:Wee,envmap_pars_vertex:Xee,envmap_physical_pars_fragment:ite,envmap_vertex:Yee,fog_vertex:qee,fog_pars_vertex:Zee,fog_fragment:jee,fog_pars_fragment:Kee,gradientmap_pars_fragment:Jee,lightmap_fragment:$ee,lightmap_pars_fragment:Qee,lights_lambert_fragment:ete,lights_lambert_pars_fragment:tte,lights_pars_begin:rte,lights_toon_fragment:nte,lights_toon_pars_fragment:ate,lights_phong_fragment:ote,lights_phong_pars_fragment:ste,lights_physical_fragment:lte,lights_physical_pars_fragment:ute,lights_fragment_begin:cte,lights_fragment_maps:hte,lights_fragment_end:fte,logdepthbuf_fragment:pte,logdepthbuf_pars_fragment:dte,logdepthbuf_pars_vertex:mte,logdepthbuf_vertex:vte,map_fragment:gte,map_pars_fragment:yte,map_particle_fragment:_te,map_particle_pars_fragment:xte,metalnessmap_fragment:Ste,metalnessmap_pars_fragment:Mte,morphinstance_vertex:bte,morphcolor_vertex:wte,morphnormal_vertex:Tte,morphtarget_pars_vertex:Ete,morphtarget_vertex:Ate,normal_fragment_begin:Cte,normal_fragment_maps:Rte,normal_pars_fragment:Lte,normal_pars_vertex:Dte,normal_vertex:Pte,normalmap_pars_fragment:Ite,clearcoat_normal_fragment_begin:Nte,clearcoat_normal_fragment_maps:Ute,clearcoat_pars_fragment:Ote,iridescence_pars_fragment:zte,opaque_fragment:Fte,packing:Bte,premultiplied_alpha_fragment:kte,project_vertex:Vte,dithering_fragment:Gte,dithering_pars_fragment:Hte,roughnessmap_fragment:Wte,roughnessmap_pars_fragment:Xte,shadowmap_pars_fragment:Yte,shadowmap_pars_vertex:qte,shadowmap_vertex:Zte,shadowmask_pars_fragment:jte,skinbase_vertex:Kte,skinning_pars_vertex:Jte,skinning_vertex:$te,skinnormal_vertex:Qte,specularmap_fragment:ere,specularmap_pars_fragment:tre,tonemapping_fragment:rre,tonemapping_pars_fragment:ire,transmission_fragment:nre,transmission_pars_fragment:are,uv_pars_fragment:ore,uv_pars_vertex:sre,uv_vertex:lre,worldpos_vertex:ure,background_vert:cre,background_frag:hre,backgroundCube_vert:fre,backgroundCube_frag:pre,cube_vert:dre,cube_frag:mre,depth_vert:vre,depth_frag:gre,distanceRGBA_vert:yre,distanceRGBA_frag:_re,equirect_vert:xre,equirect_frag:Sre,linedashed_vert:Mre,linedashed_frag:bre,meshbasic_vert:wre,meshbasic_frag:Tre,meshlambert_vert:Ere,meshlambert_frag:Are,meshmatcap_vert:Cre,meshmatcap_frag:Rre,meshnormal_vert:Lre,meshnormal_frag:Dre,meshphong_vert:Pre,meshphong_frag:Ire,meshphysical_vert:Nre,meshphysical_frag:Ure,meshtoon_vert:Ore,meshtoon_frag:zre,points_vert:Fre,points_frag:Bre,shadow_vert:kre,shadow_frag:Vre,sprite_vert:Gre,sprite_frag:Hre};var vt={common:{diffuse:{value:new or(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new rr},alphaMap:{value:null},alphaMapTransform:{value:new rr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new rr}},envmap:{envMap:{value:null},envMapRotation:{value:new rr},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new rr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new rr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new rr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new rr},normalScale:{value:new Qt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new rr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new rr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new rr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new rr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new or(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new or(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new rr},alphaTest:{value:0},uvTransform:{value:new rr}},sprite:{diffuse:{value:new or(16777215)},opacity:{value:1},center:{value:new Qt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new rr},alphaMap:{value:null},alphaMapTransform:{value:new rr},alphaTest:{value:0}}};var al={basic:{uniforms:na([vt.common,vt.specularmap,vt.envmap,vt.aomap,vt.lightmap,vt.fog]),vertexShader:mr.meshbasic_vert,fragmentShader:mr.meshbasic_frag},lambert:{uniforms:na([vt.common,vt.specularmap,vt.envmap,vt.aomap,vt.lightmap,vt.emissivemap,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.fog,vt.lights,{emissive:{value:new or(0)}}]),vertexShader:mr.meshlambert_vert,fragmentShader:mr.meshlambert_frag},phong:{uniforms:na([vt.common,vt.specularmap,vt.envmap,vt.aomap,vt.lightmap,vt.emissivemap,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.fog,vt.lights,{emissive:{value:new or(0)},specular:{value:new or(1118481)},shininess:{value:30}}]),vertexShader:mr.meshphong_vert,fragmentShader:mr.meshphong_frag},standard:{uniforms:na([vt.common,vt.envmap,vt.aomap,vt.lightmap,vt.emissivemap,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.roughnessmap,vt.metalnessmap,vt.fog,vt.lights,{emissive:{value:new or(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:mr.meshphysical_vert,fragmentShader:mr.meshphysical_frag},toon:{uniforms:na([vt.common,vt.aomap,vt.lightmap,vt.emissivemap,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.gradientmap,vt.fog,vt.lights,{emissive:{value:new or(0)}}]),vertexShader:mr.meshtoon_vert,fragmentShader:mr.meshtoon_frag},matcap:{uniforms:na([vt.common,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.fog,{matcap:{value:null}}]),vertexShader:mr.meshmatcap_vert,fragmentShader:mr.meshmatcap_frag},points:{uniforms:na([vt.points,vt.fog]),vertexShader:mr.points_vert,fragmentShader:mr.points_frag},dashed:{uniforms:na([vt.common,vt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:mr.linedashed_vert,fragmentShader:mr.linedashed_frag},depth:{uniforms:na([vt.common,vt.displacementmap]),vertexShader:mr.depth_vert,fragmentShader:mr.depth_frag},normal:{uniforms:na([vt.common,vt.bumpmap,vt.normalmap,vt.displacementmap,{opacity:{value:1}}]),vertexShader:mr.meshnormal_vert,fragmentShader:mr.meshnormal_frag},sprite:{uniforms:na([vt.sprite,vt.fog]),vertexShader:mr.sprite_vert,fragmentShader:mr.sprite_frag},background:{uniforms:{uvTransform:{value:new rr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:mr.background_vert,fragmentShader:mr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new rr}},vertexShader:mr.backgroundCube_vert,fragmentShader:mr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:mr.cube_vert,fragmentShader:mr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:mr.equirect_vert,fragmentShader:mr.equirect_frag},distanceRGBA:{uniforms:na([vt.common,vt.displacementmap,{referencePosition:{value:new be},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:mr.distanceRGBA_vert,fragmentShader:mr.distanceRGBA_frag},shadow:{uniforms:na([vt.lights,vt.fog,{color:{value:new or(0)},opacity:{value:1}}]),vertexShader:mr.shadow_vert,fragmentShader:mr.shadow_frag}};al.physical={uniforms:na([al.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new rr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new rr},clearcoatNormalScale:{value:new Qt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new rr},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new rr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new rr},sheen:{value:0},sheenColor:{value:new or(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new rr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new rr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new rr},transmissionSamplerSize:{value:new Qt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new rr},attenuationDistance:{value:0},attenuationColor:{value:new or(0)},specularColor:{value:new or(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new rr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new rr},anisotropyVector:{value:new Qt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new rr}}]),vertexShader:mr.meshphysical_vert,fragmentShader:mr.meshphysical_frag};var vC={r:0,b:0,g:0},Ud=new jl,jTe=new Zr;function Wre(r,e,t,i,n,a,o){let s=new or(0),l=a===!0?0:1,u,c,h=null,f=0,p=null;function d(m,v){let _=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y===null?g(s,l):y&&y.isColor&&(g(y,1),_=!0);let x=r.xr.getEnvironmentBlendMode();x==="additive"?i.buffers.color.setClear(0,0,0,1,o):x==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(r.autoClear||_)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===mf)?(c===void 0&&(c=new an(new bf(1,1,1),new Ra({name:"BackgroundCubeMaterial",uniforms:Fc(al.backgroundCube.uniforms),vertexShader:al.backgroundCube.vertexShader,fragmentShader:al.backgroundCube.fragmentShader,side:bi,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(M,S,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),Ud.copy(v.backgroundRotation),Ud.x*=-1,Ud.y*=-1,Ud.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Ud.y*=-1,Ud.z*=-1),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(jTe.makeRotationFromEuler(Ud)),c.material.toneMapped=Lr.getTransfer(y.colorSpace)!==qr,(h!==y||f!==y.version||p!==r.toneMapping)&&(c.material.needsUpdate=!0,h=y,f=y.version,p=r.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new an(new Ty(2,2),new Ra({name:"BackgroundMaterial",uniforms:Fc(al.background.uniforms),vertexShader:al.background.vertexShader,fragmentShader:al.background.fragmentShader,side:hs,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=Lr.getTransfer(y.colorSpace)!==qr,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(h!==y||f!==y.version||p!==r.toneMapping)&&(u.material.needsUpdate=!0,h=y,f=y.version,p=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function g(m,v){m.getRGB(vC,hC(r)),i.buffers.color.setClear(vC.r,vC.g,vC.b,v,o)}return{getClearColor:function(){return s},setClearColor:function(m,v=1){s.set(m),l=v,g(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,g(s,l)},render:d}}function Xre(r,e,t,i){let n=r.getParameter(r.MAX_VERTEX_ATTRIBS),a=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||a!==null,s={},l=m(null),u=l,c=!1;function h(A,P,U,B,z){let k=!1;if(o){let G=g(B,U,P);u!==G&&(u=G,p(u.object)),k=v(A,B,U,z),k&&_(A,B,U,z)}else{let G=P.wireframe===!0;(u.geometry!==B.id||u.program!==U.id||u.wireframe!==G)&&(u.geometry=B.id,u.program=U.id,u.wireframe=G,k=!0)}z!==null&&t.update(z,r.ELEMENT_ARRAY_BUFFER),(k||c)&&(c=!1,T(A,P,U,B),z!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(z).buffer))}function f(){return i.isWebGL2?r.createVertexArray():a.createVertexArrayOES()}function p(A){return i.isWebGL2?r.bindVertexArray(A):a.bindVertexArrayOES(A)}function d(A){return i.isWebGL2?r.deleteVertexArray(A):a.deleteVertexArrayOES(A)}function g(A,P,U){let B=U.wireframe===!0,z=s[A.id];z===void 0&&(z={},s[A.id]=z);let k=z[P.id];k===void 0&&(k={},z[P.id]=k);let G=k[B];return G===void 0&&(G=m(f()),k[B]=G),G}function m(A){let P=[],U=[],B=[];for(let z=0;z<n;z++)P[z]=0,U[z]=0,B[z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:P,enabledAttributes:U,attributeDivisors:B,object:A,attributes:{},index:null}}function v(A,P,U,B){let z=u.attributes,k=P.attributes,G=0,Y=U.getAttributes();for(let J in Y)if(Y[J].location>=0){let V=z[J],K=k[J];if(K===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(K=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(K=A.instanceColor)),V===void 0||V.attribute!==K||K&&V.data!==K.data)return!0;G++}return u.attributesNum!==G||u.index!==B}function _(A,P,U,B){let z={},k=P.attributes,G=0,Y=U.getAttributes();for(let J in Y)if(Y[J].location>=0){let V=k[J];V===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(V=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(V=A.instanceColor));let K={};K.attribute=V,V&&V.data&&(K.data=V.data),z[J]=K,G++}u.attributes=z,u.attributesNum=G,u.index=B}function y(){let A=u.newAttributes;for(let P=0,U=A.length;P<U;P++)A[P]=0}function x(A){M(A,0)}function M(A,P){let U=u.newAttributes,B=u.enabledAttributes,z=u.attributeDivisors;U[A]=1,B[A]===0&&(r.enableVertexAttribArray(A),B[A]=1),z[A]!==P&&((i.isWebGL2?r:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](A,P),z[A]=P)}function S(){let A=u.newAttributes,P=u.enabledAttributes;for(let U=0,B=P.length;U<B;U++)P[U]!==A[U]&&(r.disableVertexAttribArray(U),P[U]=0)}function w(A,P,U,B,z,k,G){G===!0?r.vertexAttribIPointer(A,P,U,z,k):r.vertexAttribPointer(A,P,U,B,z,k)}function T(A,P,U,B){if(i.isWebGL2===!1&&(A.isInstancedMesh||B.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;y();let z=B.attributes,k=U.getAttributes(),G=P.defaultAttributeValues;for(let Y in k){let J=k[Y];if(J.location>=0){let Q=z[Y];if(Q===void 0&&(Y==="instanceMatrix"&&A.instanceMatrix&&(Q=A.instanceMatrix),Y==="instanceColor"&&A.instanceColor&&(Q=A.instanceColor)),Q!==void 0){let V=Q.normalized,K=Q.itemSize,ae=t.get(Q);if(ae===void 0)continue;let ve=ae.buffer,ue=ae.type,se=ae.bytesPerElement,Ee=i.isWebGL2===!0&&(ue===r.INT||ue===r.UNSIGNED_INT||Q.gpuType===AA);if(Q.isInterleavedBufferAttribute){let q=Q.data,H=q.stride,We=Q.offset;if(q.isInstancedInterleavedBuffer){for(let _e=0;_e<J.locationSize;_e++)M(J.location+_e,q.meshPerAttribute);A.isInstancedMesh!==!0&&B._maxInstanceCount===void 0&&(B._maxInstanceCount=q.meshPerAttribute*q.count)}else for(let _e=0;_e<J.locationSize;_e++)x(J.location+_e);r.bindBuffer(r.ARRAY_BUFFER,ve);for(let _e=0;_e<J.locationSize;_e++)w(J.location+_e,K/J.locationSize,ue,V,H*se,(We+K/J.locationSize*_e)*se,Ee)}else{if(Q.isInstancedBufferAttribute){for(let q=0;q<J.locationSize;q++)M(J.location+q,Q.meshPerAttribute);A.isInstancedMesh!==!0&&B._maxInstanceCount===void 0&&(B._maxInstanceCount=Q.meshPerAttribute*Q.count)}else for(let q=0;q<J.locationSize;q++)x(J.location+q);r.bindBuffer(r.ARRAY_BUFFER,ve);for(let q=0;q<J.locationSize;q++)w(J.location+q,K/J.locationSize,ue,V,K*se,K/J.locationSize*q*se,Ee)}}else if(G!==void 0){let V=G[Y];if(V!==void 0)switch(V.length){case 2:r.vertexAttrib2fv(J.location,V);break;case 3:r.vertexAttrib3fv(J.location,V);break;case 4:r.vertexAttrib4fv(J.location,V);break;default:r.vertexAttrib1fv(J.location,V)}}}}S()}function C(){I();for(let A in s){let P=s[A];for(let U in P){let B=P[U];for(let z in B)d(B[z].object),delete B[z];delete P[U]}delete s[A]}}function b(A){if(s[A.id]===void 0)return;let P=s[A.id];for(let U in P){let B=P[U];for(let z in B)d(B[z].object),delete B[z];delete P[U]}delete s[A.id]}function E(A){for(let P in s){let U=s[P];if(U[A.id]===void 0)continue;let B=U[A.id];for(let z in B)d(B[z].object),delete B[z];delete U[A.id]}}function I(){R(),c=!0,u!==l&&(u=l,p(u.object))}function R(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:I,resetDefaultState:R,dispose:C,releaseStatesOfGeometry:b,releaseStatesOfProgram:E,initAttributes:y,enableAttribute:x,disableUnusedAttributes:S}}function Yre(r,e,t,i){let n=i.isWebGL2,a;function o(c){a=c}function s(c,h){r.drawArrays(a,c,h),t.update(h,a,1)}function l(c,h,f){if(f===0)return;let p,d;if(n)p=r,d="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),d="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[d](a,c,h,f),t.update(h,a,f)}function u(c,h,f){if(f===0)return;let p=e.get("WEBGL_multi_draw");if(p===null)for(let d=0;d<f;d++)this.render(c[d],h[d]);else{p.multiDrawArraysWEBGL(a,c,0,h,0,f);let d=0;for(let g=0;g<f;g++)d+=h[g];t.update(d,a,1)}}this.setMode=o,this.render=s,this.renderInstances=l,this.renderMultiDraw=u}function qre(r,e,t){let i;function n(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){let w=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(w.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(w){if(w==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext",s=t.precision!==void 0?t.precision:"highp",l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);let u=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,h=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),f=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=r.getParameter(r.MAX_TEXTURE_SIZE),d=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),_=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),y=f>0,x=o||e.has("OES_texture_float"),M=y&&x,S=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:n,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:f,maxTextureSize:p,maxCubemapSize:d,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:M,maxSamples:S}}function Zre(r){let e=this,t=null,i=0,n=!1,a=!1,o=new Jl,s=new rr,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){let p=h.length!==0||f||i!==0||n;return n=f,i=h.length,p},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(h,f){t=c(h,f,0)},this.setState=function(h,f,p){let d=h.clippingPlanes,g=h.clipIntersection,m=h.clipShadows,v=r.get(h);if(!n||d===null||d.length===0||a&&!m)a?c(null):u();else{let _=a?0:i,y=_*4,x=v.clippingState||null;l.value=x,x=c(d,f,y,p);for(let M=0;M!==y;++M)x[M]=t[M];v.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(h,f,p,d){let g=h!==null?h.length:0,m=null;if(g!==0){if(m=l.value,d!==!0||m===null){let v=p+g*4,_=f.matrixWorldInverse;s.getNormalMatrix(_),(m===null||m.length<v)&&(m=new Float32Array(v));for(let y=0,x=p;y!==g;++y,x+=4)o.copy(h[y]).applyMatrix4(_,s),o.normal.toArray(m,x),m[x+3]=o.constant}l.value=m,l.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,m}}function jre(r){let e=new WeakMap;function t(o,s){return s===WS?o.mapping=Wl:s===XS&&(o.mapping=zu),o}function i(o){if(o&&o.isTexture){let s=o.mapping;if(s===WS||s===XS)if(e.has(o)){let l=e.get(o).texture;return t(l,o.mapping)}else{let l=o.image;if(l&&l.height>0){let u=new pC(l.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",n),t(u.texture,o.mapping)}else return null}}return o}function n(o){let s=o.target;s.removeEventListener("dispose",n);let l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}var Ey=class extends Sy{constructor(e=-1,t=1,i=1,n=-1,a=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=a,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,a,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,a=i-e,o=i+e,s=n+t,l=n-t;if(this.view!==null&&this.view.enabled){let u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,o=a+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(a,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};var Cy=4,Kre=[.125,.215,.35,.446,.526,.582],zd=20,uF=new Ey,Jre=new or,cF=null,hF=0,fF=0,Od=(1+Math.sqrt(5))/2,Ay=1/Od,$re=[new be(1,1,1),new be(-1,1,1),new be(1,1,-1),new be(-1,1,-1),new be(0,Od,Ay),new be(0,Od,-Ay),new be(Ay,0,Od),new be(-Ay,0,Od),new be(Od,Ay,0),new be(-Od,Ay,0)],tM=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){cF=this._renderer.getRenderTarget(),hF=this._renderer.getActiveCubeFace(),fF=this._renderer.getActiveMipmapLevel(),this._setSize(256);let a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,i,n,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=tie(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=eie(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(cF,hF,fF),e.scissorTest=!1,gC(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Wl||e.mapping===zu?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),cF=this._renderer.getRenderTarget(),hF=this._renderer.getActiveCubeFace(),fF=this._renderer.getActiveMipmapLevel();let i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:tn,minFilter:tn,generateMipmaps:!1,type:Lc,format:Un,colorSpace:Oo,depthBuffer:!1},n=Qre(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Qre(e,t,i);let{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=KTe(a)),this._blurMaterial=JTe(a,e,t)}return n}_compileMaterial(e){let t=new an(this._lodPlanes[0],e);this._renderer.compile(t,uF)}_sceneToCubeUV(e,t,i,n){let s=new Wi(90,1,t,i),l=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],c=this._renderer,h=c.autoClear,f=c.toneMapping;c.getClearColor(Jre),c.toneMapping=tl,c.autoClear=!1;let p=new zc({name:"PMREM.Background",side:bi,depthWrite:!1,depthTest:!1}),d=new an(new bf,p),g=!1,m=e.background;m?m.isColor&&(p.color.copy(m),e.background=null,g=!0):(p.color.copy(Jre),g=!0);for(let v=0;v<6;v++){let _=v%3;_===0?(s.up.set(0,l[v],0),s.lookAt(u[v],0,0)):_===1?(s.up.set(0,0,l[v]),s.lookAt(0,u[v],0)):(s.up.set(0,l[v],0),s.lookAt(0,0,u[v]));let y=this._cubeSize;gC(n,_*y,v>2?y:0,y,y),c.setRenderTarget(n),g&&c.render(d,s),c.render(e,s)}d.geometry.dispose(),d.material.dispose(),c.toneMapping=f,c.autoClear=h,e.background=m}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===Wl||e.mapping===zu;n?(this._cubemapMaterial===null&&(this._cubemapMaterial=tie()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=eie());let a=n?this._cubemapMaterial:this._equirectMaterial,o=new an(this._lodPlanes[0],a),s=a.uniforms;s.envMap.value=e;let l=this._cubeSize;gC(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,uF)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;n<this._lodPlanes.length;n++){let a=Math.sqrt(this._sigmas[n]*this._sigmas[n]-this._sigmas[n-1]*this._sigmas[n-1]),o=$re[(n-1)%$re.length];this._blur(e,n-1,n,a,o)}t.autoClear=i}_blur(e,t,i,n,a){let o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,n,"latitudinal",a),this._halfBlur(o,e,i,i,n,"longitudinal",a)}_halfBlur(e,t,i,n,a,o,s){let l=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let c=3,h=new an(this._lodPlanes[n],u),f=u.uniforms,p=this._sizeLods[i]-1,d=isFinite(a)?Math.PI/(2*p):2*Math.PI/(2*zd-1),g=a/d,m=isFinite(a)?1+Math.floor(c*g):zd;m>zd&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${zd}`);let v=[],_=0;for(let w=0;w<zd;++w){let T=w/g,C=Math.exp(-T*T/2);v.push(C),w===0?_+=C:w<m&&(_+=2*C)}for(let w=0;w<v.length;w++)v[w]=v[w]/_;f.envMap.value=e.texture,f.samples.value=m,f.weights.value=v,f.latitudinal.value=o==="latitudinal",s&&(f.poleAxis.value=s);let{_lodMax:y}=this;f.dTheta.value=d,f.mipInt.value=y-i;let x=this._sizeLods[n],M=3*x*(n>y-Cy?n-y+Cy:0),S=4*(this._cubeSize-x);gC(t,M,S,3*x,2*x),l.setRenderTarget(t),l.render(h,uF)}};function KTe(r){let e=[],t=[],i=[],n=r,a=r-Cy+1+Kre.length;for(let o=0;o<a;o++){let s=Math.pow(2,n);t.push(s);let l=1/s;o>r-Cy?l=Kre[o-r+Cy-1]:o===0&&(l=0),i.push(l);let u=1/(s-2),c=-u,h=1+u,f=[c,c,h,c,h,h,c,c,h,h,c,h],p=6,d=6,g=3,m=2,v=1,_=new Float32Array(g*d*p),y=new Float32Array(m*d*p),x=new Float32Array(v*d*p);for(let S=0;S<p;S++){let w=S%3*2/3-1,T=S>2?0:-1,C=[w,T,0,w+2/3,T,0,w+2/3,T+1,0,w,T,0,w+2/3,T+1,0,w,T+1,0];_.set(C,g*d*S),y.set(f,m*d*S);let b=[S,S,S,S,S,S];x.set(b,v*d*S)}let M=new Vo;M.setAttribute("position",new Ca(_,g)),M.setAttribute("uv",new Ca(y,m)),M.setAttribute("faceIndex",new Ca(x,v)),e.push(M),n>Cy&&n--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function Qre(r,e,t){let i=new ko(r,e,t);return i.texture.mapping=mf,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function gC(r,e,t,i,n){r.viewport.set(e,t,i,n),r.scissor.set(e,t,i,n)}function JTe(r,e,t){let i=new Float32Array(zd),n=new be(0,1,0);return new Ra({name:"SphericalGaussianBlur",defines:{n:zd,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:pF(),fragmentShader:`
  6366. precision mediump float;
  6367. precision mediump int;
  6368. varying vec3 vOutputDirection;
  6369. uniform sampler2D envMap;
  6370. uniform int samples;
  6371. uniform float weights[ n ];
  6372. uniform bool latitudinal;
  6373. uniform float dTheta;
  6374. uniform float mipInt;
  6375. uniform vec3 poleAxis;
  6376. #define ENVMAP_TYPE_CUBE_UV
  6377. #include <cube_uv_reflection_fragment>
  6378. vec3 getSample( float theta, vec3 axis ) {
  6379. float cosTheta = cos( theta );
  6380. // Rodrigues' axis-angle rotation
  6381. vec3 sampleDirection = vOutputDirection * cosTheta
  6382. + cross( axis, vOutputDirection ) * sin( theta )
  6383. + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
  6384. return bilinearCubeUV( envMap, sampleDirection, mipInt );
  6385. }
  6386. void main() {
  6387. vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
  6388. if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
  6389. axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
  6390. }
  6391. axis = normalize( axis );
  6392. gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
  6393. gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
  6394. for ( int i = 1; i < n; i++ ) {
  6395. if ( i >= samples ) {
  6396. break;
  6397. }
  6398. float theta = dTheta * float( i );
  6399. gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
  6400. gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
  6401. }
  6402. }
  6403. `,blending:el,depthTest:!1,depthWrite:!1})}function eie(){return new Ra({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:pF(),fragmentShader:`
  6404. precision mediump float;
  6405. precision mediump int;
  6406. varying vec3 vOutputDirection;
  6407. uniform sampler2D envMap;
  6408. #include <common>
  6409. void main() {
  6410. vec3 outputDirection = normalize( vOutputDirection );
  6411. vec2 uv = equirectUv( outputDirection );
  6412. gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
  6413. }
  6414. `,blending:el,depthTest:!1,depthWrite:!1})}function tie(){return new Ra({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:pF(),fragmentShader:`
  6415. precision mediump float;
  6416. precision mediump int;
  6417. uniform float flipEnvMap;
  6418. varying vec3 vOutputDirection;
  6419. uniform samplerCube envMap;
  6420. void main() {
  6421. gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
  6422. }
  6423. `,blending:el,depthTest:!1,depthWrite:!1})}function pF(){return`
  6424. precision mediump float;
  6425. precision mediump int;
  6426. attribute float faceIndex;
  6427. varying vec3 vOutputDirection;
  6428. // RH coordinate system; PMREM face-indexing convention
  6429. vec3 getDirection( vec2 uv, float face ) {
  6430. uv = 2.0 * uv - 1.0;
  6431. vec3 direction = vec3( uv, 1.0 );
  6432. if ( face == 0.0 ) {
  6433. direction = direction.zyx; // ( 1, v, u ) pos x
  6434. } else if ( face == 1.0 ) {
  6435. direction = direction.xzy;
  6436. direction.xz *= -1.0; // ( -u, 1, -v ) pos y
  6437. } else if ( face == 2.0 ) {
  6438. direction.x *= -1.0; // ( -u, v, 1 ) pos z
  6439. } else if ( face == 3.0 ) {
  6440. direction = direction.zyx;
  6441. direction.xz *= -1.0; // ( -1, v, -u ) neg x
  6442. } else if ( face == 4.0 ) {
  6443. direction = direction.xzy;
  6444. direction.xy *= -1.0; // ( -u, -1, v ) neg y
  6445. } else if ( face == 5.0 ) {
  6446. direction.z *= -1.0; // ( u, v, -1 ) neg z
  6447. }
  6448. return direction;
  6449. }
  6450. void main() {
  6451. vOutputDirection = getDirection( uv, faceIndex );
  6452. gl_Position = vec4( position, 1.0 );
  6453. }
  6454. `}function rie(r){let e=new WeakMap,t=null;function i(s){if(s&&s.isTexture){let l=s.mapping,u=l===WS||l===XS,c=l===Wl||l===zu;if(u||c)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let h=e.get(s);return t===null&&(t=new tM(r)),h=u?t.fromEquirectangular(s,h):t.fromCubemap(s,h),e.set(s,h),h.texture}else{if(e.has(s))return e.get(s).texture;{let h=s.image;if(u&&h&&h.height>0||c&&h&&n(h)){t===null&&(t=new tM(r));let f=u?t.fromEquirectangular(s):t.fromCubemap(s);return e.set(s,f),s.addEventListener("dispose",a),f.texture}else return null}}}return s}function n(s){let l=0,u=6;for(let c=0;c<u;c++)s[c]!==void 0&&l++;return l===u}function a(s){let l=s.target;l.removeEventListener("dispose",a);let u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function iie(r){let e={};function t(i){if(e[i]!==void 0)return e[i];let n;switch(i){case"WEBGL_depth_texture":n=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=r.getExtension(i)}return e[i]=n,n}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?(t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance")):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(i){let n=t(i);return n===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),n}}}function nie(r,e,t,i){let n={},a=new WeakMap;function o(h){let f=h.target;f.index!==null&&e.remove(f.index);for(let d in f.attributes)e.remove(f.attributes[d]);for(let d in f.morphAttributes){let g=f.morphAttributes[d];for(let m=0,v=g.length;m<v;m++)e.remove(g[m])}f.removeEventListener("dispose",o),delete n[f.id];let p=a.get(f);p&&(e.remove(p),a.delete(f)),i.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function s(h,f){return n[f.id]===!0||(f.addEventListener("dispose",o),n[f.id]=!0,t.memory.geometries++),f}function l(h){let f=h.attributes;for(let d in f)e.update(f[d],r.ARRAY_BUFFER);let p=h.morphAttributes;for(let d in p){let g=p[d];for(let m=0,v=g.length;m<v;m++)e.update(g[m],r.ARRAY_BUFFER)}}function u(h){let f=[],p=h.index,d=h.attributes.position,g=0;if(p!==null){let _=p.array;g=p.version;for(let y=0,x=_.length;y<x;y+=3){let M=_[y+0],S=_[y+1],w=_[y+2];f.push(M,S,S,w,w,M)}}else if(d!==void 0){let _=d.array;g=d.version;for(let y=0,x=_.length/3-1;y<x;y+=3){let M=y+0,S=y+1,w=y+2;f.push(M,S,S,w,w,M)}}else return;let m=new(GA(f)?vy:my)(f,1);m.version=g;let v=a.get(h);v&&e.remove(v),a.set(h,m)}function c(h){let f=a.get(h);if(f){let p=h.index;p!==null&&f.version<p.version&&u(h)}else u(h);return a.get(h)}return{get:s,update:l,getWireframeAttribute:c}}function aie(r,e,t,i){let n=i.isWebGL2,a;function o(p){a=p}let s,l;function u(p){s=p.type,l=p.bytesPerElement}function c(p,d){r.drawElements(a,d,s,p*l),t.update(d,a,1)}function h(p,d,g){if(g===0)return;let m,v;if(n)m=r,v="drawElementsInstanced";else if(m=e.get("ANGLE_instanced_arrays"),v="drawElementsInstancedANGLE",m===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}m[v](a,d,s,p*l,g),t.update(d,a,g)}function f(p,d,g){if(g===0)return;let m=e.get("WEBGL_multi_draw");if(m===null)for(let v=0;v<g;v++)this.render(p[v]/l,d[v]);else{m.multiDrawElementsWEBGL(a,d,0,s,p,0,g);let v=0;for(let _=0;_<g;_++)v+=d[_];t.update(v,a,1)}}this.setMode=o,this.setIndex=u,this.render=c,this.renderInstances=h,this.renderMultiDraw=f}function oie(r){let e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(a,o,s){switch(t.calls++,o){case r.TRIANGLES:t.triangles+=s*(a/3);break;case r.LINES:t.lines+=s*(a/2);break;case r.LINE_STRIP:t.lines+=s*(a-1);break;case r.LINE_LOOP:t.lines+=s*a;break;case r.POINTS:t.points+=s*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function n(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:n,update:i}}function $Te(r,e){return r[0]-e[0]}function QTe(r,e){return Math.abs(e[1])-Math.abs(r[1])}function sie(r,e,t){let i={},n=new Float32Array(8),a=new WeakMap,o=new li,s=[];for(let u=0;u<8;u++)s[u]=[u,0];function l(u,c,h){let f=u.morphTargetInfluences;if(e.isWebGL2===!0){let d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,g=d!==void 0?d.length:0,m=a.get(c);if(m===void 0||m.count!==g){let R=function(){E.dispose(),a.delete(c),c.removeEventListener("dispose",R)};var p=R;m!==void 0&&m.texture.dispose();let v=c.morphAttributes.position!==void 0,_=c.morphAttributes.normal!==void 0,y=c.morphAttributes.color!==void 0,x=c.morphAttributes.position||[],M=c.morphAttributes.normal||[],S=c.morphAttributes.color||[],w=0;v===!0&&(w=1),_===!0&&(w=2),y===!0&&(w=3);let T=c.attributes.position.count*w,C=1;T>e.maxTextureSize&&(C=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let b=new Float32Array(T*C*4*g),E=new oy(b,T,C,g);E.type=No,E.needsUpdate=!0;let I=w*4;for(let A=0;A<g;A++){let P=x[A],U=M[A],B=S[A],z=T*C*4*A;for(let k=0;k<P.count;k++){let G=k*I;v===!0&&(o.fromBufferAttribute(P,k),b[z+G+0]=o.x,b[z+G+1]=o.y,b[z+G+2]=o.z,b[z+G+3]=0),_===!0&&(o.fromBufferAttribute(U,k),b[z+G+4]=o.x,b[z+G+5]=o.y,b[z+G+6]=o.z,b[z+G+7]=0),y===!0&&(o.fromBufferAttribute(B,k),b[z+G+8]=o.x,b[z+G+9]=o.y,b[z+G+10]=o.z,b[z+G+11]=B.itemSize===4?o.w:1)}}m={count:g,texture:E,size:new Qt(T,C)},a.set(c,m),c.addEventListener("dispose",R)}if(u.isInstancedMesh===!0&&u.morphTexture!==null)h.getUniforms().setValue(r,"morphTexture",u.morphTexture,t);else{let v=0;for(let y=0;y<f.length;y++)v+=f[y];let _=c.morphTargetsRelative?1:1-v;h.getUniforms().setValue(r,"morphTargetBaseInfluence",_),h.getUniforms().setValue(r,"morphTargetInfluences",f)}h.getUniforms().setValue(r,"morphTargetsTexture",m.texture,t),h.getUniforms().setValue(r,"morphTargetsTextureSize",m.size)}else{let d=f===void 0?0:f.length,g=i[c.id];if(g===void 0||g.length!==d){g=[];for(let x=0;x<d;x++)g[x]=[x,0];i[c.id]=g}for(let x=0;x<d;x++){let M=g[x];M[0]=x,M[1]=f[x]}g.sort(QTe);for(let x=0;x<8;x++)x<d&&g[x][1]?(s[x][0]=g[x][0],s[x][1]=g[x][1]):(s[x][0]=Number.MAX_SAFE_INTEGER,s[x][1]=0);s.sort($Te);let m=c.morphAttributes.position,v=c.morphAttributes.normal,_=0;for(let x=0;x<8;x++){let M=s[x],S=M[0],w=M[1];S!==Number.MAX_SAFE_INTEGER&&w?(m&&c.getAttribute("morphTarget"+x)!==m[S]&&c.setAttribute("morphTarget"+x,m[S]),v&&c.getAttribute("morphNormal"+x)!==v[S]&&c.setAttribute("morphNormal"+x,v[S]),n[x]=w,_+=w):(m&&c.hasAttribute("morphTarget"+x)===!0&&c.deleteAttribute("morphTarget"+x),v&&c.hasAttribute("morphNormal"+x)===!0&&c.deleteAttribute("morphNormal"+x),n[x]=0)}let y=c.morphTargetsRelative?1:1-_;h.getUniforms().setValue(r,"morphTargetBaseInfluence",y),h.getUniforms().setValue(r,"morphTargetInfluences",n)}}return{update:l}}function lie(r,e,t,i){let n=new WeakMap;function a(l){let u=i.render.frame,c=l.geometry,h=e.get(l,c);if(n.get(h)!==u&&(e.update(h),n.set(h,u)),l.isInstancedMesh&&(l.hasEventListener("dispose",s)===!1&&l.addEventListener("dispose",s),n.get(l)!==u&&(t.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,r.ARRAY_BUFFER),n.set(l,u))),l.isSkinnedMesh){let f=l.skeleton;n.get(f)!==u&&(f.update(),n.set(f,u))}return h}function o(){n=new WeakMap}function s(l){let u=l.target;u.removeEventListener("dispose",s),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:a,dispose:o}}var Ry=class extends Bo{constructor(e,t,i,n,a,o,s,l,u,c){if(c=c!==void 0?c:Yl,c!==Yl&&c!==Fu)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&c===Yl&&(i=ds),i===void 0&&c===Fu&&(i=rl),super(null,n,a,o,s,l,c,i,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=s!==void 0?s:Gi,this.minFilter=l!==void 0?l:Gi,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}};var mie=new Bo,vie=new Ry(1,1);vie.compareFunction=BA;var gie=new oy,yie=new YA,_ie=new wy,uie=[],cie=[],hie=new Float32Array(16),fie=new Float32Array(9),pie=new Float32Array(4);function Ly(r,e,t){let i=r[0];if(i<=0||i>0)return r;let n=e*t,a=uie[n];if(a===void 0&&(a=new Float32Array(n),uie[n]=a),e!==0){i.toArray(a,0);for(let o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function on(r,e){if(r.length!==e.length)return!1;for(let t=0,i=r.length;t<i;t++)if(r[t]!==e[t])return!1;return!0}function sn(r,e){for(let t=0,i=e.length;t<i;t++)r[t]=e[t]}function yC(r,e){let t=cie[e];t===void 0&&(t=new Int32Array(e),cie[e]=t);for(let i=0;i!==e;++i)t[i]=r.allocateTextureUnit();return t}function eEe(r,e){let t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function tEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;r.uniform2fv(this.addr,e),sn(t,e)}}function rEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(on(t,e))return;r.uniform3fv(this.addr,e),sn(t,e)}}function iEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;r.uniform4fv(this.addr,e),sn(t,e)}}function nEe(r,e){let t=this.cache,i=e.elements;if(i===void 0){if(on(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),sn(t,e)}else{if(on(t,i))return;pie.set(i),r.uniformMatrix2fv(this.addr,!1,pie),sn(t,i)}}function aEe(r,e){let t=this.cache,i=e.elements;if(i===void 0){if(on(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),sn(t,e)}else{if(on(t,i))return;fie.set(i),r.uniformMatrix3fv(this.addr,!1,fie),sn(t,i)}}function oEe(r,e){let t=this.cache,i=e.elements;if(i===void 0){if(on(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),sn(t,e)}else{if(on(t,i))return;hie.set(i),r.uniformMatrix4fv(this.addr,!1,hie),sn(t,i)}}function sEe(r,e){let t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function lEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;r.uniform2iv(this.addr,e),sn(t,e)}}function uEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(on(t,e))return;r.uniform3iv(this.addr,e),sn(t,e)}}function cEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;r.uniform4iv(this.addr,e),sn(t,e)}}function hEe(r,e){let t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function fEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(on(t,e))return;r.uniform2uiv(this.addr,e),sn(t,e)}}function pEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(on(t,e))return;r.uniform3uiv(this.addr,e),sn(t,e)}}function dEe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(on(t,e))return;r.uniform4uiv(this.addr,e),sn(t,e)}}function mEe(r,e,t){let i=this.cache,n=t.allocateTextureUnit();i[0]!==n&&(r.uniform1i(this.addr,n),i[0]=n);let a=this.type===r.SAMPLER_2D_SHADOW?vie:mie;t.setTexture2D(e||a,n)}function vEe(r,e,t){let i=this.cache,n=t.allocateTextureUnit();i[0]!==n&&(r.uniform1i(this.addr,n),i[0]=n),t.setTexture3D(e||yie,n)}function gEe(r,e,t){let i=this.cache,n=t.allocateTextureUnit();i[0]!==n&&(r.uniform1i(this.addr,n),i[0]=n),t.setTextureCube(e||_ie,n)}function yEe(r,e,t){let i=this.cache,n=t.allocateTextureUnit();i[0]!==n&&(r.uniform1i(this.addr,n),i[0]=n),t.setTexture2DArray(e||gie,n)}function _Ee(r){switch(r){case 5126:return eEe;case 35664:return tEe;case 35665:return rEe;case 35666:return iEe;case 35674:return nEe;case 35675:return aEe;case 35676:return oEe;case 5124:case 35670:return sEe;case 35667:case 35671:return lEe;case 35668:case 35672:return uEe;case 35669:case 35673:return cEe;case 5125:return hEe;case 36294:return fEe;case 36295:return pEe;case 36296:return dEe;case 35678:case 36198:case 36298:case 36306:case 35682:return mEe;case 35679:case 36299:case 36307:return vEe;case 35680:case 36300:case 36308:case 36293:return gEe;case 36289:case 36303:case 36311:case 36292:return yEe}}function xEe(r,e){r.uniform1fv(this.addr,e)}function SEe(r,e){let t=Ly(e,this.size,2);r.uniform2fv(this.addr,t)}function MEe(r,e){let t=Ly(e,this.size,3);r.uniform3fv(this.addr,t)}function bEe(r,e){let t=Ly(e,this.size,4);r.uniform4fv(this.addr,t)}function wEe(r,e){let t=Ly(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function TEe(r,e){let t=Ly(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function EEe(r,e){let t=Ly(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function AEe(r,e){r.uniform1iv(this.addr,e)}function CEe(r,e){r.uniform2iv(this.addr,e)}function REe(r,e){r.uniform3iv(this.addr,e)}function LEe(r,e){r.uniform4iv(this.addr,e)}function DEe(r,e){r.uniform1uiv(this.addr,e)}function PEe(r,e){r.uniform2uiv(this.addr,e)}function IEe(r,e){r.uniform3uiv(this.addr,e)}function NEe(r,e){r.uniform4uiv(this.addr,e)}function UEe(r,e,t){let i=this.cache,n=e.length,a=yC(t,n);on(i,a)||(r.uniform1iv(this.addr,a),sn(i,a));for(let o=0;o!==n;++o)t.setTexture2D(e[o]||mie,a[o])}function OEe(r,e,t){let i=this.cache,n=e.length,a=yC(t,n);on(i,a)||(r.uniform1iv(this.addr,a),sn(i,a));for(let o=0;o!==n;++o)t.setTexture3D(e[o]||yie,a[o])}function zEe(r,e,t){let i=this.cache,n=e.length,a=yC(t,n);on(i,a)||(r.uniform1iv(this.addr,a),sn(i,a));for(let o=0;o!==n;++o)t.setTextureCube(e[o]||_ie,a[o])}function FEe(r,e,t){let i=this.cache,n=e.length,a=yC(t,n);on(i,a)||(r.uniform1iv(this.addr,a),sn(i,a));for(let o=0;o!==n;++o)t.setTexture2DArray(e[o]||gie,a[o])}function BEe(r){switch(r){case 5126:return xEe;case 35664:return SEe;case 35665:return MEe;case 35666:return bEe;case 35674:return wEe;case 35675:return TEe;case 35676:return EEe;case 5124:case 35670:return AEe;case 35667:case 35671:return CEe;case 35668:case 35672:return REe;case 35669:case 35673:return LEe;case 5125:return DEe;case 36294:return PEe;case 36295:return IEe;case 36296:return NEe;case 35678:case 36198:case 36298:case 36306:case 35682:return UEe;case 35679:case 36299:case 36307:return OEe;case 35680:case 36300:case 36308:case 36293:return zEe;case 36289:case 36303:case 36311:case 36292:return FEe}}var mF=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=_Ee(t.type)}},vF=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=BEe(t.type)}},gF=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){let n=this.seq;for(let a=0,o=n.length;a!==o;++a){let s=n[a];s.setValue(e,t[s.id],i)}}},dF=/(\w+)(\])?(\[|\.)?/g;function die(r,e){r.seq.push(e),r.map[e.id]=e}function kEe(r,e,t){let i=r.name,n=i.length;for(dF.lastIndex=0;;){let a=dF.exec(i),o=dF.lastIndex,s=a[1],l=a[2]==="]",u=a[3];if(l&&(s=s|0),u===void 0||u==="["&&o+2===n){die(t,u===void 0?new mF(s,r,e):new vF(s,r,e));break}else{let h=t.map[s];h===void 0&&(h=new gF(s),die(t,h)),t=h}}}var Ef=class{constructor(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<i;++n){let a=e.getActiveUniform(t,n),o=e.getUniformLocation(t,a.name);kEe(a,o,this)}}setValue(e,t,i,n){let a=this.map[t];a!==void 0&&a.setValue(e,i,n)}setOptional(e,t,i){let n=t[i];n!==void 0&&this.setValue(e,i,n)}static upload(e,t,i,n){for(let a=0,o=t.length;a!==o;++a){let s=t[a],l=i[s.id];l.needsUpdate!==!1&&s.setValue(e,l.value,n)}}static seqWithValue(e,t){let i=[];for(let n=0,a=e.length;n!==a;++n){let o=e[n];o.id in t&&i.push(o)}return i}};function yF(r,e,t){let i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i}var VEe=37297,GEe=0;function HEe(r,e){let t=r.split(`
  6455. `),i=[],n=Math.max(e-6,0),a=Math.min(e+6,t.length);for(let o=n;o<a;o++){let s=o+1;i.push(`${s===e?">":" "} ${s}: ${t[o]}`)}return i.join(`
  6456. `)}function WEe(r){let e=Lr.getPrimaries(Lr.workingColorSpace),t=Lr.getPrimaries(r),i;switch(e===t?i="":e===ey&&t===Qg?i="LinearDisplayP3ToLinearSRGB":e===Qg&&t===ey&&(i="LinearSRGBToLinearDisplayP3"),r){case Oo:case Ad:return[i,"LinearTransferOETF"];case Uo:case Jg:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[i,"LinearTransferOETF"]}}function xie(r,e,t){let i=r.getShaderParameter(e,r.COMPILE_STATUS),n=r.getShaderInfoLog(e).trim();if(i&&n==="")return"";let a=/ERROR: 0:(\d+)/.exec(n);if(a){let o=parseInt(a[1]);return t.toUpperCase()+`
  6457. `+n+`
  6458. `+HEe(r.getShaderSource(e),o)}else return n}function XEe(r,e){let t=WEe(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function YEe(r,e){let t;switch(e){case hQ:t="Linear";break;case fQ:t="Reinhard";break;case pQ:t="OptimizedCineon";break;case dQ:t="ACESFilmic";break;case vQ:t="AgX";break;case gQ:t="Neutral";break;case mQ:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function qEe(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.normalMapTangentSpace||r.clearcoatNormalMap||r.flatShading||r.alphaToCoverage||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Dy).join(`
  6459. `)}function ZEe(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Dy).join(`
  6460. `)}function jEe(r){let e=[];for(let t in r){let i=r[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(`
  6461. `)}function KEe(r,e){let t={},i=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let n=0;n<i;n++){let a=r.getActiveAttrib(e,n),o=a.name,s=1;a.type===r.FLOAT_MAT2&&(s=2),a.type===r.FLOAT_MAT3&&(s=3),a.type===r.FLOAT_MAT4&&(s=4),t[o]={type:a.type,location:r.getAttribLocation(e,o),locationSize:s}}return t}function Dy(r){return r!==""}function Sie(r,e){let t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Mie(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var JEe=/^[ \t]*#include +<([\w\d./]+)>/gm;function _F(r){return r.replace(JEe,QEe)}var $Ee=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function QEe(r,e){let t=mr[e];if(t===void 0){let i=$Ee.get(e);if(i!==void 0)t=mr[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return _F(t)}var eAe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function bie(r){return r.replace(eAe,tAe)}function tAe(r,e,t,i){let n="";for(let a=parseInt(e);a<parseInt(t);a++)n+=i.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return n}function wie(r){let e=`precision ${r.precision} float;
  6462. precision ${r.precision} int;
  6463. precision ${r.precision} sampler2D;
  6464. precision ${r.precision} samplerCube;
  6465. `;return r.isWebGL2&&(e+=`precision ${r.precision} sampler3D;
  6466. precision ${r.precision} sampler2DArray;
  6467. precision ${r.precision} sampler2DShadow;
  6468. precision ${r.precision} samplerCubeShadow;
  6469. precision ${r.precision} sampler2DArrayShadow;
  6470. precision ${r.precision} isampler2D;
  6471. precision ${r.precision} isampler3D;
  6472. precision ${r.precision} isamplerCube;
  6473. precision ${r.precision} isampler2DArray;
  6474. precision ${r.precision} usampler2D;
  6475. precision ${r.precision} usampler3D;
  6476. precision ${r.precision} usamplerCube;
  6477. precision ${r.precision} usampler2DArray;
  6478. `),r.precision==="highp"?e+=`
  6479. #define HIGH_PRECISION`:r.precision==="mediump"?e+=`
  6480. #define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
  6481. #define LOW_PRECISION`),e}function rAe(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===wA?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===B$?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===Hl&&(e="SHADOWMAP_TYPE_VSM"),e}function iAe(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case Wl:case zu:e="ENVMAP_TYPE_CUBE";break;case mf:e="ENVMAP_TYPE_CUBE_UV";break}return e}function nAe(r){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case zu:e="ENVMAP_MODE_REFRACTION";break}return e}function aAe(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case TA:e="ENVMAP_BLENDING_MULTIPLY";break;case uQ:e="ENVMAP_BLENDING_MIX";break;case cQ:e="ENVMAP_BLENDING_ADD";break}return e}function oAe(r){let e=r.envMapCubeUVHeight;if(e===null)return null;let t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}}function Tie(r,e,t,i){let n=r.getContext(),a=t.defines,o=t.vertexShader,s=t.fragmentShader,l=rAe(t),u=iAe(t),c=nAe(t),h=aAe(t),f=oAe(t),p=t.isWebGL2?"":qEe(t),d=ZEe(t),g=jEe(a),m=n.createProgram(),v,_,y=t.glslVersion?"#version "+t.glslVersion+`
  6482. `:"";t.isRawShaderMaterial?(v=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Dy).join(`
  6483. `),v.length>0&&(v+=`
  6484. `),_=[p,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Dy).join(`
  6485. `),_.length>0&&(_+=`
  6486. `)):(v=[wie(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
  6487. `].filter(Dy).join(`
  6488. `),_=[p,wie(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==tl?"#define TONE_MAPPING":"",t.toneMapping!==tl?mr.tonemapping_pars_fragment:"",t.toneMapping!==tl?YEe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",mr.colorspace_pars_fragment,XEe("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
  6489. `].filter(Dy).join(`
  6490. `)),o=_F(o),o=Sie(o,t),o=Mie(o,t),s=_F(s),s=Sie(s,t),s=Mie(s,t),o=bie(o),s=bie(s),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es
  6491. `,v=[d,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
  6492. `)+`
  6493. `+v,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===Hz?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Hz?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
  6494. `)+`
  6495. `+_);let x=y+v+o,M=y+_+s,S=yF(n,n.VERTEX_SHADER,x),w=yF(n,n.FRAGMENT_SHADER,M);n.attachShader(m,S),n.attachShader(m,w),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);function T(I){if(r.debug.checkShaderErrors){let R=n.getProgramInfoLog(m).trim(),A=n.getShaderInfoLog(S).trim(),P=n.getShaderInfoLog(w).trim(),U=!0,B=!0;if(n.getProgramParameter(m,n.LINK_STATUS)===!1)if(U=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(n,m,S,w);else{let z=xie(n,S,"vertex"),k=xie(n,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(m,n.VALIDATE_STATUS)+`
  6496. Material Name: `+I.name+`
  6497. Material Type: `+I.type+`
  6498. Program Info Log: `+R+`
  6499. `+z+`
  6500. `+k)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(A===""||P==="")&&(B=!1);B&&(I.diagnostics={runnable:U,programLog:R,vertexShader:{log:A,prefix:v},fragmentShader:{log:P,prefix:_}})}n.deleteShader(S),n.deleteShader(w),C=new Ef(n,m),b=KEe(n,m)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let E=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=n.getProgramParameter(m,VEe)),E},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(m),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=GEe++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=S,this.fragmentShader=w,this}var sAe=0,_C=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),a=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(n)===!1&&(o.add(n),n.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new xF(e),t.set(e,i)),i}},xF=class{constructor(e){this.id=sAe++,this.code=e,this.usedTimes=0}};function Eie(r,e,t,i,n,a,o){let s=new hy,l=new _C,u=new Set,c=[],h=n.isWebGL2,f=n.logarithmicDepthBuffer,p=n.vertexTextures,d=n.precision,g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(b){return u.add(b),b===0?"uv":`uv${b}`}function v(b,E,I,R,A){let P=R.fog,U=A.geometry,B=b.isMeshStandardMaterial?R.environment:null,z=(b.isMeshStandardMaterial?t:e).get(b.envMap||B),k=z&&z.mapping===mf?z.image.height:null,G=g[b.type];b.precision!==null&&(d=n.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));let Y=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,J=Y!==void 0?Y.length:0,Q=0;U.morphAttributes.position!==void 0&&(Q=1),U.morphAttributes.normal!==void 0&&(Q=2),U.morphAttributes.color!==void 0&&(Q=3);let V,K,ae,ve;if(G){let kt=al[G];V=kt.vertexShader,K=kt.fragmentShader}else V=b.vertexShader,K=b.fragmentShader,l.update(b),ae=l.getVertexShaderID(b),ve=l.getFragmentShaderID(b);let ue=r.getRenderTarget(),se=A.isInstancedMesh===!0,Ee=A.isBatchedMesh===!0,q=!!b.map,H=!!b.matcap,We=!!z,_e=!!b.aoMap,xe=!!b.lightMap,Le=!!b.bumpMap,Ue=!!b.normalMap,Ne=!!b.displacementMap,Ve=!!b.emissiveMap,dt=!!b.metalnessMap,F=!!b.roughnessMap,L=b.anisotropy>0,ne=b.clearcoat>0,le=b.iridescence>0,me=b.sheen>0,fe=b.transmission>0,et=L&&!!b.anisotropyMap,Ke=ne&&!!b.clearcoatMap,Se=ne&&!!b.clearcoatNormalMap,Ae=ne&&!!b.clearcoatRoughnessMap,at=le&&!!b.iridescenceMap,$=le&&!!b.iridescenceThicknessMap,nt=me&&!!b.sheenColorMap,Xe=me&&!!b.sheenRoughnessMap,Fe=!!b.specularMap,we=!!b.specularColorMap,Ie=!!b.specularIntensityMap,ct=fe&&!!b.transmissionMap,Je=fe&&!!b.thicknessMap,Gt=!!b.gradientMap,X=!!b.alphaMap,Te=b.alphaTest>0,te=!!b.alphaHash,Me=!!b.extensions,De=tl;b.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(De=r.toneMapping);let wt={isWebGL2:h,shaderID:G,shaderType:b.type,shaderName:b.name,vertexShader:V,fragmentShader:K,defines:b.defines,customVertexShaderID:ae,customFragmentShaderID:ve,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:Ee,instancing:se,instancingColor:se&&A.instanceColor!==null,instancingMorph:se&&A.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:ue===null?r.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Oo,alphaToCoverage:!!b.alphaToCoverage,map:q,matcap:H,envMap:We,envMapMode:We&&z.mapping,envMapCubeUVHeight:k,aoMap:_e,lightMap:xe,bumpMap:Le,normalMap:Ue,displacementMap:p&&Ne,emissiveMap:Ve,normalMapObjectSpace:Ue&&b.normalMapType===RQ,normalMapTangentSpace:Ue&&b.normalMapType===CQ,metalnessMap:dt,roughnessMap:F,anisotropy:L,anisotropyMap:et,clearcoat:ne,clearcoatMap:Ke,clearcoatNormalMap:Se,clearcoatRoughnessMap:Ae,iridescence:le,iridescenceMap:at,iridescenceThicknessMap:$,sheen:me,sheenColorMap:nt,sheenRoughnessMap:Xe,specularMap:Fe,specularColorMap:we,specularIntensityMap:Ie,transmission:fe,transmissionMap:ct,thicknessMap:Je,gradientMap:Gt,opaque:b.transparent===!1&&b.blending===Cc&&b.alphaToCoverage===!1,alphaMap:X,alphaTest:Te,alphaHash:te,combine:b.combine,mapUv:q&&m(b.map.channel),aoMapUv:_e&&m(b.aoMap.channel),lightMapUv:xe&&m(b.lightMap.channel),bumpMapUv:Le&&m(b.bumpMap.channel),normalMapUv:Ue&&m(b.normalMap.channel),displacementMapUv:Ne&&m(b.displacementMap.channel),emissiveMapUv:Ve&&m(b.emissiveMap.channel),metalnessMapUv:dt&&m(b.metalnessMap.channel),roughnessMapUv:F&&m(b.roughnessMap.channel),anisotropyMapUv:et&&m(b.anisotropyMap.channel),clearcoatMapUv:Ke&&m(b.clearcoatMap.channel),clearcoatNormalMapUv:Se&&m(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&m(b.clearcoatRoughnessMap.channel),iridescenceMapUv:at&&m(b.iridescenceMap.channel),iridescenceThicknessMapUv:$&&m(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&m(b.sheenColorMap.channel),sheenRoughnessMapUv:Xe&&m(b.sheenRoughnessMap.channel),specularMapUv:Fe&&m(b.specularMap.channel),specularColorMapUv:we&&m(b.specularColorMap.channel),specularIntensityMapUv:Ie&&m(b.specularIntensityMap.channel),transmissionMapUv:ct&&m(b.transmissionMap.channel),thicknessMapUv:Je&&m(b.thicknessMap.channel),alphaMapUv:X&&m(b.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(Ue||L),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:A.isPoints===!0&&!!U.attributes.uv&&(q||X),fog:!!P,useFog:b.fog===!0,fogExp2:!!P&&P.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:A.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:J,morphTextureStride:Q,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:De,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&b.map.isVideoTexture===!0&&Lr.getTransfer(b.map.colorSpace)===qr,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===fs,flipSided:b.side===bi,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Me&&b.extensions.derivatives===!0,extensionFragDepth:Me&&b.extensions.fragDepth===!0,extensionDrawBuffers:Me&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Me&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Me&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Me&&b.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return wt.vertexUv1s=u.has(1),wt.vertexUv2s=u.has(2),wt.vertexUv3s=u.has(3),u.clear(),wt}function _(b){let E=[];if(b.shaderID?E.push(b.shaderID):(E.push(b.customVertexShaderID),E.push(b.customFragmentShaderID)),b.defines!==void 0)for(let I in b.defines)E.push(I),E.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(y(E,b),x(E,b),E.push(r.outputColorSpace)),E.push(b.customProgramCacheKey),E.join()}function y(b,E){b.push(E.precision),b.push(E.outputColorSpace),b.push(E.envMapMode),b.push(E.envMapCubeUVHeight),b.push(E.mapUv),b.push(E.alphaMapUv),b.push(E.lightMapUv),b.push(E.aoMapUv),b.push(E.bumpMapUv),b.push(E.normalMapUv),b.push(E.displacementMapUv),b.push(E.emissiveMapUv),b.push(E.metalnessMapUv),b.push(E.roughnessMapUv),b.push(E.anisotropyMapUv),b.push(E.clearcoatMapUv),b.push(E.clearcoatNormalMapUv),b.push(E.clearcoatRoughnessMapUv),b.push(E.iridescenceMapUv),b.push(E.iridescenceThicknessMapUv),b.push(E.sheenColorMapUv),b.push(E.sheenRoughnessMapUv),b.push(E.specularMapUv),b.push(E.specularColorMapUv),b.push(E.specularIntensityMapUv),b.push(E.transmissionMapUv),b.push(E.thicknessMapUv),b.push(E.combine),b.push(E.fogExp2),b.push(E.sizeAttenuation),b.push(E.morphTargetsCount),b.push(E.morphAttributeCount),b.push(E.numDirLights),b.push(E.numPointLights),b.push(E.numSpotLights),b.push(E.numSpotLightMaps),b.push(E.numHemiLights),b.push(E.numRectAreaLights),b.push(E.numDirLightShadows),b.push(E.numPointLightShadows),b.push(E.numSpotLightShadows),b.push(E.numSpotLightShadowsWithMaps),b.push(E.numLightProbes),b.push(E.shadowMapType),b.push(E.toneMapping),b.push(E.numClippingPlanes),b.push(E.numClipIntersection),b.push(E.depthPacking)}function x(b,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.instancingMorph&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.normalMapObjectSpace&&s.enable(7),E.normalMapTangentSpace&&s.enable(8),E.clearcoat&&s.enable(9),E.iridescence&&s.enable(10),E.alphaTest&&s.enable(11),E.vertexColors&&s.enable(12),E.vertexAlphas&&s.enable(13),E.vertexUv1s&&s.enable(14),E.vertexUv2s&&s.enable(15),E.vertexUv3s&&s.enable(16),E.vertexTangents&&s.enable(17),E.anisotropy&&s.enable(18),E.alphaHash&&s.enable(19),E.batching&&s.enable(20),b.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.useLegacyLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.transmission&&s.enable(15),E.sheen&&s.enable(16),E.opaque&&s.enable(17),E.pointsUvs&&s.enable(18),E.decodeVideoTexture&&s.enable(19),E.alphaToCoverage&&s.enable(20),b.push(s.mask)}function M(b){let E=g[b.type],I;if(E){let R=al[E];I=nee.clone(R.uniforms)}else I=b.uniforms;return I}function S(b,E){let I;for(let R=0,A=c.length;R<A;R++){let P=c[R];if(P.cacheKey===E){I=P,++I.usedTimes;break}}return I===void 0&&(I=new Tie(r,E,b,a),c.push(I)),I}function w(b){if(--b.usedTimes===0){let E=c.indexOf(b);c[E]=c[c.length-1],c.pop(),b.destroy()}}function T(b){l.remove(b)}function C(){l.dispose()}return{getParameters:v,getProgramCacheKey:_,getUniforms:M,acquireProgram:S,releaseProgram:w,releaseShaderCache:T,programs:c,dispose:C}}function Aie(){let r=new WeakMap;function e(a){let o=r.get(a);return o===void 0&&(o={},r.set(a,o)),o}function t(a){r.delete(a)}function i(a,o,s){r.get(a)[o]=s}function n(){r=new WeakMap}return{get:e,remove:t,update:i,dispose:n}}function lAe(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function Cie(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Rie(){let r=[],e=0,t=[],i=[],n=[];function a(){e=0,t.length=0,i.length=0,n.length=0}function o(h,f,p,d,g,m){let v=r[e];return v===void 0?(v={id:h.id,object:h,geometry:f,material:p,groupOrder:d,renderOrder:h.renderOrder,z:g,group:m},r[e]=v):(v.id=h.id,v.object=h,v.geometry=f,v.material=p,v.groupOrder=d,v.renderOrder=h.renderOrder,v.z=g,v.group=m),e++,v}function s(h,f,p,d,g,m){let v=o(h,f,p,d,g,m);p.transmission>0?i.push(v):p.transparent===!0?n.push(v):t.push(v)}function l(h,f,p,d,g,m){let v=o(h,f,p,d,g,m);p.transmission>0?i.unshift(v):p.transparent===!0?n.unshift(v):t.unshift(v)}function u(h,f){t.length>1&&t.sort(h||lAe),i.length>1&&i.sort(f||Cie),n.length>1&&n.sort(f||Cie)}function c(){for(let h=e,f=r.length;h<f;h++){let p=r[h];if(p.id===null)break;p.id=null,p.object=null,p.geometry=null,p.material=null,p.group=null}}return{opaque:t,transmissive:i,transparent:n,init:a,push:s,unshift:l,finish:c,sort:u}}function Lie(){let r=new WeakMap;function e(i,n){let a=r.get(i),o;return a===void 0?(o=new Rie,r.set(i,[o])):n>=a.length?(o=new Rie,a.push(o)):o=a[n],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function uAe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new be,color:new or};break;case"SpotLight":t={position:new be,direction:new be,color:new or,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new be,color:new or,distance:0,decay:0};break;case"HemisphereLight":t={direction:new be,skyColor:new or,groundColor:new or};break;case"RectAreaLight":t={color:new or,position:new be,halfWidth:new be,halfHeight:new be};break}return r[e.id]=t,t}}}function cAe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qt,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var hAe=0;function fAe(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function Die(r,e){let t=new uAe,i=cAe(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new be);let a=new be,o=new Zr,s=new Zr;function l(c,h){let f=0,p=0,d=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let g=0,m=0,v=0,_=0,y=0,x=0,M=0,S=0,w=0,T=0,C=0;c.sort(fAe);let b=h===!0?Math.PI:1;for(let I=0,R=c.length;I<R;I++){let A=c[I],P=A.color,U=A.intensity,B=A.distance,z=A.shadow&&A.shadow.map?A.shadow.map.texture:null;if(A.isAmbientLight)f+=P.r*U*b,p+=P.g*U*b,d+=P.b*U*b;else if(A.isLightProbe){for(let k=0;k<9;k++)n.probe[k].addScaledVector(A.sh.coefficients[k],U);C++}else if(A.isDirectionalLight){let k=t.get(A);if(k.color.copy(A.color).multiplyScalar(A.intensity*b),A.castShadow){let G=A.shadow,Y=i.get(A);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,n.directionalShadow[g]=Y,n.directionalShadowMap[g]=z,n.directionalShadowMatrix[g]=A.shadow.matrix,x++}n.directional[g]=k,g++}else if(A.isSpotLight){let k=t.get(A);k.position.setFromMatrixPosition(A.matrixWorld),k.color.copy(P).multiplyScalar(U*b),k.distance=B,k.coneCos=Math.cos(A.angle),k.penumbraCos=Math.cos(A.angle*(1-A.penumbra)),k.decay=A.decay,n.spot[v]=k;let G=A.shadow;if(A.map&&(n.spotLightMap[w]=A.map,w++,G.updateMatrices(A),A.castShadow&&T++),n.spotLightMatrix[v]=G.matrix,A.castShadow){let Y=i.get(A);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,n.spotShadow[v]=Y,n.spotShadowMap[v]=z,S++}v++}else if(A.isRectAreaLight){let k=t.get(A);k.color.copy(P).multiplyScalar(U),k.halfWidth.set(A.width*.5,0,0),k.halfHeight.set(0,A.height*.5,0),n.rectArea[_]=k,_++}else if(A.isPointLight){let k=t.get(A);if(k.color.copy(A.color).multiplyScalar(A.intensity*b),k.distance=A.distance,k.decay=A.decay,A.castShadow){let G=A.shadow,Y=i.get(A);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,Y.shadowCameraNear=G.camera.near,Y.shadowCameraFar=G.camera.far,n.pointShadow[m]=Y,n.pointShadowMap[m]=z,n.pointShadowMatrix[m]=A.shadow.matrix,M++}n.point[m]=k,m++}else if(A.isHemisphereLight){let k=t.get(A);k.skyColor.copy(A.color).multiplyScalar(U*b),k.groundColor.copy(A.groundColor).multiplyScalar(U*b),n.hemi[y]=k,y++}}_>0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=vt.LTC_FLOAT_1,n.rectAreaLTC2=vt.LTC_FLOAT_2):(n.rectAreaLTC1=vt.LTC_HALF_1,n.rectAreaLTC2=vt.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=vt.LTC_FLOAT_1,n.rectAreaLTC2=vt.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(n.rectAreaLTC1=vt.LTC_HALF_1,n.rectAreaLTC2=vt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=f,n.ambient[1]=p,n.ambient[2]=d;let E=n.hash;(E.directionalLength!==g||E.pointLength!==m||E.spotLength!==v||E.rectAreaLength!==_||E.hemiLength!==y||E.numDirectionalShadows!==x||E.numPointShadows!==M||E.numSpotShadows!==S||E.numSpotMaps!==w||E.numLightProbes!==C)&&(n.directional.length=g,n.spot.length=v,n.rectArea.length=_,n.point.length=m,n.hemi.length=y,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=S+w-T,n.spotLightMap.length=w,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=C,E.directionalLength=g,E.pointLength=m,E.spotLength=v,E.rectAreaLength=_,E.hemiLength=y,E.numDirectionalShadows=x,E.numPointShadows=M,E.numSpotShadows=S,E.numSpotMaps=w,E.numLightProbes=C,n.version=hAe++)}function u(c,h){let f=0,p=0,d=0,g=0,m=0,v=h.matrixWorldInverse;for(let _=0,y=c.length;_<y;_++){let x=c[_];if(x.isDirectionalLight){let M=n.directional[f];M.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),M.direction.sub(a),M.direction.transformDirection(v),f++}else if(x.isSpotLight){let M=n.spot[d];M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(v),M.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),M.direction.sub(a),M.direction.transformDirection(v),d++}else if(x.isRectAreaLight){let M=n.rectArea[g];M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(v),s.identity(),o.copy(x.matrixWorld),o.premultiply(v),s.extractRotation(o),M.halfWidth.set(x.width*.5,0,0),M.halfHeight.set(0,x.height*.5,0),M.halfWidth.applyMatrix4(s),M.halfHeight.applyMatrix4(s),g++}else if(x.isPointLight){let M=n.point[p];M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(v),p++}else if(x.isHemisphereLight){let M=n.hemi[m];M.direction.setFromMatrixPosition(x.matrixWorld),M.direction.transformDirection(v),m++}}}return{setup:l,setupView:u,state:n}}function Pie(r,e){let t=new Die(r,e),i=[],n=[];function a(){i.length=0,n.length=0}function o(h){i.push(h)}function s(h){n.push(h)}function l(h){t.setup(i,h)}function u(h){t.setupView(i,h)}return{init:a,state:{lightsArray:i,shadowsArray:n,lights:t},setupLights:l,setupLightsView:u,pushLight:o,pushShadow:s}}function Iie(r,e){let t=new WeakMap;function i(a,o=0){let s=t.get(a),l;return s===void 0?(l=new Pie(r,e),t.set(a,[l])):o>=s.length?(l=new Pie(r,e),s.push(l)):l=s[o],l}function n(){t=new WeakMap}return{get:i,dispose:n}}var xC=class extends Gu{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=EQ,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};var SC=class extends Gu{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};var Nie=`
  6501. void main() {
  6502. gl_Position = vec4( position, 1.0 );
  6503. }
  6504. `,Uie=`
  6505. uniform sampler2D shadow_pass;
  6506. uniform vec2 resolution;
  6507. uniform float radius;
  6508. #include <packing>
  6509. void main() {
  6510. const float samples = float( VSM_SAMPLES );
  6511. float mean = 0.0;
  6512. float squared_mean = 0.0;
  6513. float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
  6514. float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
  6515. for ( float i = 0.0; i < samples; i ++ ) {
  6516. float uvOffset = uvStart + i * uvStride;
  6517. #ifdef HORIZONTAL_PASS
  6518. vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
  6519. mean += distribution.x;
  6520. squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
  6521. #else
  6522. float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
  6523. mean += depth;
  6524. squared_mean += depth * depth;
  6525. #endif
  6526. }
  6527. mean = mean / samples;
  6528. squared_mean = squared_mean / samples;
  6529. float std_dev = sqrt( squared_mean - mean * mean );
  6530. gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
  6531. }
  6532. `;function Oie(r,e,t){let i=new Tf,n=new Qt,a=new Qt,o=new li,s=new xC({depthPacking:AQ}),l=new SC,u={},c=t.maxTextureSize,h={[hs]:bi,[bi]:hs,[fs]:fs},f=new Ra({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Qt},radius:{value:4}},vertexShader:Nie,fragmentShader:Uie}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let d=new Vo;d.setAttribute("position",new Ca(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new an(d,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=wA;let v=this.type;this.render=function(S,w,T){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;let C=r.getRenderTarget(),b=r.getActiveCubeFace(),E=r.getActiveMipmapLevel(),I=r.state;I.setBlending(el),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);let R=v!==Hl&&this.type===Hl,A=v===Hl&&this.type!==Hl;for(let P=0,U=S.length;P<U;P++){let B=S[P],z=B.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",B,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;n.copy(z.mapSize);let k=z.getFrameExtents();if(n.multiply(k),a.copy(z.mapSize),(n.x>c||n.y>c)&&(n.x>c&&(a.x=Math.floor(c/k.x),n.x=a.x*k.x,z.mapSize.x=a.x),n.y>c&&(a.y=Math.floor(c/k.y),n.y=a.y*k.y,z.mapSize.y=a.y)),z.map===null||R===!0||A===!0){let Y=this.type!==Hl?{minFilter:Gi,magFilter:Gi}:{};z.map!==null&&z.map.dispose(),z.map=new ko(n.x,n.y,Y),z.map.texture.name=B.name+".shadowMap",z.camera.updateProjectionMatrix()}r.setRenderTarget(z.map),r.clear();let G=z.getViewportCount();for(let Y=0;Y<G;Y++){let J=z.getViewport(Y);o.set(a.x*J.x,a.y*J.y,a.x*J.z,a.y*J.w),I.viewport(o),z.updateMatrices(B,Y),i=z.getFrustum(),x(w,T,z.camera,B,this.type)}z.isPointLightShadow!==!0&&this.type===Hl&&_(z,T),z.needsUpdate=!1}v=this.type,m.needsUpdate=!1,r.setRenderTarget(C,b,E)};function _(S,w){let T=e.update(g);f.defines.VSM_SAMPLES!==S.blurSamples&&(f.defines.VSM_SAMPLES=S.blurSamples,p.defines.VSM_SAMPLES=S.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new ko(n.x,n.y)),f.uniforms.shadow_pass.value=S.map.texture,f.uniforms.resolution.value=S.mapSize,f.uniforms.radius.value=S.radius,r.setRenderTarget(S.mapPass),r.clear(),r.renderBufferDirect(w,null,T,f,g,null),p.uniforms.shadow_pass.value=S.mapPass.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,r.setRenderTarget(S.map),r.clear(),r.renderBufferDirect(w,null,T,p,g,null)}function y(S,w,T,C){let b=null,E=T.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(E!==void 0)b=E;else if(b=T.isPointLight===!0?l:s,r.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){let I=b.uuid,R=w.uuid,A=u[I];A===void 0&&(A={},u[I]=A);let P=A[R];P===void 0&&(P=b.clone(),A[R]=P,w.addEventListener("dispose",M)),b=P}if(b.visible=w.visible,b.wireframe=w.wireframe,C===Hl?b.side=w.shadowSide!==null?w.shadowSide:w.side:b.side=w.shadowSide!==null?w.shadowSide:h[w.side],b.alphaMap=w.alphaMap,b.alphaTest=w.alphaTest,b.map=w.map,b.clipShadows=w.clipShadows,b.clippingPlanes=w.clippingPlanes,b.clipIntersection=w.clipIntersection,b.displacementMap=w.displacementMap,b.displacementScale=w.displacementScale,b.displacementBias=w.displacementBias,b.wireframeLinewidth=w.wireframeLinewidth,b.linewidth=w.linewidth,T.isPointLight===!0&&b.isMeshDistanceMaterial===!0){let I=r.properties.get(b);I.light=T}return b}function x(S,w,T,C,b){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&b===Hl)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);let R=e.update(S),A=S.material;if(Array.isArray(A)){let P=R.groups;for(let U=0,B=P.length;U<B;U++){let z=P[U],k=A[z.materialIndex];if(k&&k.visible){let G=y(S,k,C,b);S.onBeforeShadow(r,S,w,T,R,G,z),r.renderBufferDirect(T,null,R,G,S,z),S.onAfterShadow(r,S,w,T,R,G,z)}}}else if(A.visible){let P=y(S,A,C,b);S.onBeforeShadow(r,S,w,T,R,P,null),r.renderBufferDirect(T,null,R,P,S,null),S.onAfterShadow(r,S,w,T,R,P,null)}}let I=S.children;for(let R=0,A=I.length;R<A;R++)x(I[R],w,T,C,b)}function M(S){S.target.removeEventListener("dispose",M);for(let T in u){let C=u[T],b=S.target.uuid;b in C&&(C[b].dispose(),delete C[b])}}}function zie(r,e,t){let i=t.isWebGL2;function n(){let X=!1,Te=new li,te=null,Me=new li(0,0,0,0);return{setMask:function(De){te!==De&&!X&&(r.colorMask(De,De,De,De),te=De)},setLocked:function(De){X=De},setClear:function(De,wt,kt,Tr,$r){$r===!0&&(De*=Tr,wt*=Tr,kt*=Tr),Te.set(De,wt,kt,Tr),Me.equals(Te)===!1&&(r.clearColor(De,wt,kt,Tr),Me.copy(Te))},reset:function(){X=!1,te=null,Me.set(-1,0,0,0)}}}function a(){let X=!1,Te=null,te=null,Me=null;return{setTest:function(De){De?se(r.DEPTH_TEST):Ee(r.DEPTH_TEST)},setMask:function(De){Te!==De&&!X&&(r.depthMask(De),Te=De)},setFunc:function(De){if(te!==De){switch(De){case rQ:r.depthFunc(r.NEVER);break;case iQ:r.depthFunc(r.ALWAYS);break;case nQ:r.depthFunc(r.LESS);break;case Zg:r.depthFunc(r.LEQUAL);break;case aQ:r.depthFunc(r.EQUAL);break;case oQ:r.depthFunc(r.GEQUAL);break;case sQ:r.depthFunc(r.GREATER);break;case lQ:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}te=De}},setLocked:function(De){X=De},setClear:function(De){Me!==De&&(r.clearDepth(De),Me=De)},reset:function(){X=!1,Te=null,te=null,Me=null}}}function o(){let X=!1,Te=null,te=null,Me=null,De=null,wt=null,kt=null,Tr=null,$r=null;return{setTest:function(Ht){X||(Ht?se(r.STENCIL_TEST):Ee(r.STENCIL_TEST))},setMask:function(Ht){Te!==Ht&&!X&&(r.stencilMask(Ht),Te=Ht)},setFunc:function(Ht,Or,hi){(te!==Ht||Me!==Or||De!==hi)&&(r.stencilFunc(Ht,Or,hi),te=Ht,Me=Or,De=hi)},setOp:function(Ht,Or,hi){(wt!==Ht||kt!==Or||Tr!==hi)&&(r.stencilOp(Ht,Or,hi),wt=Ht,kt=Or,Tr=hi)},setLocked:function(Ht){X=Ht},setClear:function(Ht){$r!==Ht&&(r.clearStencil(Ht),$r=Ht)},reset:function(){X=!1,Te=null,te=null,Me=null,De=null,wt=null,kt=null,Tr=null,$r=null}}}let s=new n,l=new a,u=new o,c=new WeakMap,h=new WeakMap,f={},p={},d=new WeakMap,g=[],m=null,v=!1,_=null,y=null,x=null,M=null,S=null,w=null,T=null,C=new or(0,0,0),b=0,E=!1,I=null,R=null,A=null,P=null,U=null,B=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),z=!1,k=0,G=r.getParameter(r.VERSION);G.indexOf("WebGL")!==-1?(k=parseFloat(/^WebGL (\d)/.exec(G)[1]),z=k>=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),z=k>=2);let Y=null,J={},Q=r.getParameter(r.SCISSOR_BOX),V=r.getParameter(r.VIEWPORT),K=new li().fromArray(Q),ae=new li().fromArray(V);function ve(X,Te,te,Me){let De=new Uint8Array(4),wt=r.createTexture();r.bindTexture(X,wt),r.texParameteri(X,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(X,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let kt=0;kt<te;kt++)i&&(X===r.TEXTURE_3D||X===r.TEXTURE_2D_ARRAY)?r.texImage3D(Te,0,r.RGBA,1,1,Me,0,r.RGBA,r.UNSIGNED_BYTE,De):r.texImage2D(Te+kt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,De);return wt}let ue={};ue[r.TEXTURE_2D]=ve(r.TEXTURE_2D,r.TEXTURE_2D,1),ue[r.TEXTURE_CUBE_MAP]=ve(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),i&&(ue[r.TEXTURE_2D_ARRAY]=ve(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ue[r.TEXTURE_3D]=ve(r.TEXTURE_3D,r.TEXTURE_3D,1,1)),s.setClear(0,0,0,1),l.setClear(1),u.setClear(0),se(r.DEPTH_TEST),l.setFunc(Zg),Ne(!1),Ve(lz),se(r.CULL_FACE),Le(el);function se(X){f[X]!==!0&&(r.enable(X),f[X]=!0)}function Ee(X){f[X]!==!1&&(r.disable(X),f[X]=!1)}function q(X,Te){return p[X]!==Te?(r.bindFramebuffer(X,Te),p[X]=Te,i&&(X===r.DRAW_FRAMEBUFFER&&(p[r.FRAMEBUFFER]=Te),X===r.FRAMEBUFFER&&(p[r.DRAW_FRAMEBUFFER]=Te)),!0):!1}function H(X,Te){let te=g,Me=!1;if(X){te=d.get(Te),te===void 0&&(te=[],d.set(Te,te));let De=X.textures;if(te.length!==De.length||te[0]!==r.COLOR_ATTACHMENT0){for(let wt=0,kt=De.length;wt<kt;wt++)te[wt]=r.COLOR_ATTACHMENT0+wt;te.length=De.length,Me=!0}}else te[0]!==r.BACK&&(te[0]=r.BACK,Me=!0);if(Me)if(t.isWebGL2)r.drawBuffers(te);else if(e.has("WEBGL_draw_buffers")===!0)e.get("WEBGL_draw_buffers").drawBuffersWEBGL(te);else throw new Error("THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension")}function We(X){return m!==X?(r.useProgram(X),m=X,!0):!1}let _e={[Rc]:r.FUNC_ADD,[V$]:r.FUNC_SUBTRACT,[G$]:r.FUNC_REVERSE_SUBTRACT};if(i)_e[fz]=r.MIN,_e[pz]=r.MAX;else{let X=e.get("EXT_blend_minmax");X!==null&&(_e[fz]=X.MIN_EXT,_e[pz]=X.MAX_EXT)}let xe={[H$]:r.ZERO,[W$]:r.ONE,[X$]:r.SRC_COLOR,[GS]:r.SRC_ALPHA,[J$]:r.SRC_ALPHA_SATURATE,[j$]:r.DST_COLOR,[q$]:r.DST_ALPHA,[Y$]:r.ONE_MINUS_SRC_COLOR,[HS]:r.ONE_MINUS_SRC_ALPHA,[K$]:r.ONE_MINUS_DST_COLOR,[Z$]:r.ONE_MINUS_DST_ALPHA,[$$]:r.CONSTANT_COLOR,[Q$]:r.ONE_MINUS_CONSTANT_COLOR,[eQ]:r.CONSTANT_ALPHA,[tQ]:r.ONE_MINUS_CONSTANT_ALPHA};function Le(X,Te,te,Me,De,wt,kt,Tr,$r,Ht){if(X===el){v===!0&&(Ee(r.BLEND),v=!1);return}if(v===!1&&(se(r.BLEND),v=!0),X!==k$){if(X!==_||Ht!==E){if((y!==Rc||S!==Rc)&&(r.blendEquation(r.FUNC_ADD),y=Rc,S=Rc),Ht)switch(X){case Cc:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case uz:r.blendFunc(r.ONE,r.ONE);break;case cz:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case hz:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",X);break}else switch(X){case Cc:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case uz:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case cz:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case hz:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",X);break}x=null,M=null,w=null,T=null,C.set(0,0,0),b=0,_=X,E=Ht}return}De=De||Te,wt=wt||te,kt=kt||Me,(Te!==y||De!==S)&&(r.blendEquationSeparate(_e[Te],_e[De]),y=Te,S=De),(te!==x||Me!==M||wt!==w||kt!==T)&&(r.blendFuncSeparate(xe[te],xe[Me],xe[wt],xe[kt]),x=te,M=Me,w=wt,T=kt),(Tr.equals(C)===!1||$r!==b)&&(r.blendColor(Tr.r,Tr.g,Tr.b,$r),C.copy(Tr),b=$r),_=X,E=!1}function Ue(X,Te){X.side===fs?Ee(r.CULL_FACE):se(r.CULL_FACE);let te=X.side===bi;Te&&(te=!te),Ne(te),X.blending===Cc&&X.transparent===!1?Le(el):Le(X.blending,X.blendEquation,X.blendSrc,X.blendDst,X.blendEquationAlpha,X.blendSrcAlpha,X.blendDstAlpha,X.blendColor,X.blendAlpha,X.premultipliedAlpha),l.setFunc(X.depthFunc),l.setTest(X.depthTest),l.setMask(X.depthWrite),s.setMask(X.colorWrite);let Me=X.stencilWrite;u.setTest(Me),Me&&(u.setMask(X.stencilWriteMask),u.setFunc(X.stencilFunc,X.stencilRef,X.stencilFuncMask),u.setOp(X.stencilFail,X.stencilZFail,X.stencilZPass)),F(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),X.alphaToCoverage===!0?se(r.SAMPLE_ALPHA_TO_COVERAGE):Ee(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ne(X){I!==X&&(X?r.frontFace(r.CW):r.frontFace(r.CCW),I=X)}function Ve(X){X!==z$?(se(r.CULL_FACE),X!==R&&(X===lz?r.cullFace(r.BACK):X===F$?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Ee(r.CULL_FACE),R=X}function dt(X){X!==A&&(z&&r.lineWidth(X),A=X)}function F(X,Te,te){X?(se(r.POLYGON_OFFSET_FILL),(P!==Te||U!==te)&&(r.polygonOffset(Te,te),P=Te,U=te)):Ee(r.POLYGON_OFFSET_FILL)}function L(X){X?se(r.SCISSOR_TEST):Ee(r.SCISSOR_TEST)}function ne(X){X===void 0&&(X=r.TEXTURE0+B-1),Y!==X&&(r.activeTexture(X),Y=X)}function le(X,Te,te){te===void 0&&(Y===null?te=r.TEXTURE0+B-1:te=Y);let Me=J[te];Me===void 0&&(Me={type:void 0,texture:void 0},J[te]=Me),(Me.type!==X||Me.texture!==Te)&&(Y!==te&&(r.activeTexture(te),Y=te),r.bindTexture(X,Te||ue[X]),Me.type=X,Me.texture=Te)}function me(){let X=J[Y];X!==void 0&&X.type!==void 0&&(r.bindTexture(X.type,null),X.type=void 0,X.texture=void 0)}function fe(){try{r.compressedTexImage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function et(){try{r.compressedTexImage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Ke(){try{r.texSubImage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Se(){try{r.texSubImage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Ae(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function at(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function $(){try{r.texStorage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function nt(){try{r.texStorage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Xe(){try{r.texImage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Fe(){try{r.texImage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function we(X){K.equals(X)===!1&&(r.scissor(X.x,X.y,X.z,X.w),K.copy(X))}function Ie(X){ae.equals(X)===!1&&(r.viewport(X.x,X.y,X.z,X.w),ae.copy(X))}function ct(X,Te){let te=h.get(Te);te===void 0&&(te=new WeakMap,h.set(Te,te));let Me=te.get(X);Me===void 0&&(Me=r.getUniformBlockIndex(Te,X.name),te.set(X,Me))}function Je(X,Te){let Me=h.get(Te).get(X);c.get(Te)!==Me&&(r.uniformBlockBinding(Te,Me,X.__bindingPointIndex),c.set(Te,Me))}function Gt(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),i===!0&&(r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null)),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),f={},Y=null,J={},p={},d=new WeakMap,g=[],m=null,v=!1,_=null,y=null,x=null,M=null,S=null,w=null,T=null,C=new or(0,0,0),b=0,E=!1,I=null,R=null,A=null,P=null,U=null,K.set(0,0,r.canvas.width,r.canvas.height),ae.set(0,0,r.canvas.width,r.canvas.height),s.reset(),l.reset(),u.reset()}return{buffers:{color:s,depth:l,stencil:u},enable:se,disable:Ee,bindFramebuffer:q,drawBuffers:H,useProgram:We,setBlending:Le,setMaterial:Ue,setFlipSided:Ne,setCullFace:Ve,setLineWidth:dt,setPolygonOffset:F,setScissorTest:L,activeTexture:ne,bindTexture:le,unbindTexture:me,compressedTexImage2D:fe,compressedTexImage3D:et,texImage2D:Xe,texImage3D:Fe,updateUBOMapping:ct,uniformBlockBinding:Je,texStorage2D:$,texStorage3D:nt,texSubImage2D:Ke,texSubImage3D:Se,compressedTexSubImage2D:Ae,compressedTexSubImage3D:at,scissor:we,viewport:Ie,reset:Gt}}function Fie(r,e,t,i,n,a,o){let s=n.isWebGL2,l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Qt,h=new WeakMap,f,p=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(F,L){return d?new OffscreenCanvas(F,L):ry("canvas")}function m(F,L,ne,le){let me=1,fe=dt(F);if((fe.width>le||fe.height>le)&&(me=le/Math.max(fe.width,fe.height)),me<1||L===!0)if(typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&F instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&F instanceof ImageBitmap||typeof VideoFrame<"u"&&F instanceof VideoFrame){let et=L?KS:Math.floor,Ke=et(me*fe.width),Se=et(me*fe.height);f===void 0&&(f=g(Ke,Se));let Ae=ne?g(Ke,Se):f;return Ae.width=Ke,Ae.height=Se,Ae.getContext("2d").drawImage(F,0,0,Ke,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+fe.width+"x"+fe.height+") to ("+Ke+"x"+Se+")."),Ae}else return"data"in F&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+fe.width+"x"+fe.height+")."),F;return F}function v(F){let L=dt(F);return Wz(L.width)&&Wz(L.height)}function _(F){return s?!1:F.wrapS!==Ea||F.wrapT!==Ea||F.minFilter!==Gi&&F.minFilter!==tn}function y(F,L){return F.generateMipmaps&&L&&F.minFilter!==Gi&&F.minFilter!==tn}function x(F){r.generateMipmap(F)}function M(F,L,ne,le,me=!1){if(s===!1)return L;if(F!==null){if(r[F]!==void 0)return r[F];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+F+"'")}let fe=L;if(L===r.RED&&(ne===r.FLOAT&&(fe=r.R32F),ne===r.HALF_FLOAT&&(fe=r.R16F),ne===r.UNSIGNED_BYTE&&(fe=r.R8)),L===r.RED_INTEGER&&(ne===r.UNSIGNED_BYTE&&(fe=r.R8UI),ne===r.UNSIGNED_SHORT&&(fe=r.R16UI),ne===r.UNSIGNED_INT&&(fe=r.R32UI),ne===r.BYTE&&(fe=r.R8I),ne===r.SHORT&&(fe=r.R16I),ne===r.INT&&(fe=r.R32I)),L===r.RG&&(ne===r.FLOAT&&(fe=r.RG32F),ne===r.HALF_FLOAT&&(fe=r.RG16F),ne===r.UNSIGNED_BYTE&&(fe=r.RG8)),L===r.RG_INTEGER&&(ne===r.UNSIGNED_BYTE&&(fe=r.RG8UI),ne===r.UNSIGNED_SHORT&&(fe=r.RG16UI),ne===r.UNSIGNED_INT&&(fe=r.RG32UI),ne===r.BYTE&&(fe=r.RG8I),ne===r.SHORT&&(fe=r.RG16I),ne===r.INT&&(fe=r.RG32I)),L===r.RGBA){let et=me?$g:Lr.getTransfer(le);ne===r.FLOAT&&(fe=r.RGBA32F),ne===r.HALF_FLOAT&&(fe=r.RGBA16F),ne===r.UNSIGNED_BYTE&&(fe=et===qr?r.SRGB8_ALPHA8:r.RGBA8),ne===r.UNSIGNED_SHORT_4_4_4_4&&(fe=r.RGBA4),ne===r.UNSIGNED_SHORT_5_5_5_1&&(fe=r.RGB5_A1)}return(fe===r.R16F||fe===r.R32F||fe===r.RG16F||fe===r.RG32F||fe===r.RGBA16F||fe===r.RGBA32F)&&e.get("EXT_color_buffer_float"),fe}function S(F,L,ne){return y(F,ne)===!0||F.isFramebufferTexture&&F.minFilter!==Gi&&F.minFilter!==tn?Math.log2(Math.max(L.width,L.height))+1:F.mipmaps!==void 0&&F.mipmaps.length>0?F.mipmaps.length:F.isCompressedTexture&&Array.isArray(F.image)?L.mipmaps.length:1}function w(F){return F===Gi||F===mz||F===jg?r.NEAREST:r.LINEAR}function T(F){let L=F.target;L.removeEventListener("dispose",T),b(L),L.isVideoTexture&&h.delete(L)}function C(F){let L=F.target;L.removeEventListener("dispose",C),I(L)}function b(F){let L=i.get(F);if(L.__webglInit===void 0)return;let ne=F.source,le=p.get(ne);if(le){let me=le[L.__cacheKey];me.usedTimes--,me.usedTimes===0&&E(F),Object.keys(le).length===0&&p.delete(ne)}i.remove(F)}function E(F){let L=i.get(F);r.deleteTexture(L.__webglTexture);let ne=F.source,le=p.get(ne);delete le[L.__cacheKey],o.memory.textures--}function I(F){let L=i.get(F);if(F.depthTexture&&F.depthTexture.dispose(),F.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(L.__webglFramebuffer[le]))for(let me=0;me<L.__webglFramebuffer[le].length;me++)r.deleteFramebuffer(L.__webglFramebuffer[le][me]);else r.deleteFramebuffer(L.__webglFramebuffer[le]);L.__webglDepthbuffer&&r.deleteRenderbuffer(L.__webglDepthbuffer[le])}else{if(Array.isArray(L.__webglFramebuffer))for(let le=0;le<L.__webglFramebuffer.length;le++)r.deleteFramebuffer(L.__webglFramebuffer[le]);else r.deleteFramebuffer(L.__webglFramebuffer);if(L.__webglDepthbuffer&&r.deleteRenderbuffer(L.__webglDepthbuffer),L.__webglMultisampledFramebuffer&&r.deleteFramebuffer(L.__webglMultisampledFramebuffer),L.__webglColorRenderbuffer)for(let le=0;le<L.__webglColorRenderbuffer.length;le++)L.__webglColorRenderbuffer[le]&&r.deleteRenderbuffer(L.__webglColorRenderbuffer[le]);L.__webglDepthRenderbuffer&&r.deleteRenderbuffer(L.__webglDepthRenderbuffer)}let ne=F.textures;for(let le=0,me=ne.length;le<me;le++){let fe=i.get(ne[le]);fe.__webglTexture&&(r.deleteTexture(fe.__webglTexture),o.memory.textures--),i.remove(ne[le])}i.remove(F)}let R=0;function A(){R=0}function P(){let F=R;return F>=n.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+F+" texture units while this GPU supports only "+n.maxTextures),R+=1,F}function U(F){let L=[];return L.push(F.wrapS),L.push(F.wrapT),L.push(F.wrapR||0),L.push(F.magFilter),L.push(F.minFilter),L.push(F.anisotropy),L.push(F.internalFormat),L.push(F.format),L.push(F.type),L.push(F.generateMipmaps),L.push(F.premultiplyAlpha),L.push(F.flipY),L.push(F.unpackAlignment),L.push(F.colorSpace),L.join()}function B(F,L){let ne=i.get(F);if(F.isVideoTexture&&Ne(F),F.isRenderTargetTexture===!1&&F.version>0&&ne.__version!==F.version){let le=F.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(ne,F,L);return}}t.bindTexture(r.TEXTURE_2D,ne.__webglTexture,r.TEXTURE0+L)}function z(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ae(ne,F,L);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ne.__webglTexture,r.TEXTURE0+L)}function k(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ae(ne,F,L);return}t.bindTexture(r.TEXTURE_3D,ne.__webglTexture,r.TEXTURE0+L)}function G(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ve(ne,F,L);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ne.__webglTexture,r.TEXTURE0+L)}let Y={[YS]:r.REPEAT,[Ea]:r.CLAMP_TO_EDGE,[qS]:r.MIRRORED_REPEAT},J={[Gi]:r.NEAREST,[mz]:r.NEAREST_MIPMAP_NEAREST,[jg]:r.NEAREST_MIPMAP_LINEAR,[tn]:r.LINEAR,[EA]:r.LINEAR_MIPMAP_NEAREST,[Xl]:r.LINEAR_MIPMAP_LINEAR},Q={[LQ]:r.NEVER,[OQ]:r.ALWAYS,[DQ]:r.LESS,[BA]:r.LEQUAL,[PQ]:r.EQUAL,[UQ]:r.GEQUAL,[IQ]:r.GREATER,[NQ]:r.NOTEQUAL};function V(F,L,ne){if(L.type===No&&e.has("OES_texture_float_linear")===!1&&(L.magFilter===tn||L.magFilter===EA||L.magFilter===jg||L.magFilter===Xl||L.minFilter===tn||L.minFilter===EA||L.minFilter===jg||L.minFilter===Xl)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ne?(r.texParameteri(F,r.TEXTURE_WRAP_S,Y[L.wrapS]),r.texParameteri(F,r.TEXTURE_WRAP_T,Y[L.wrapT]),(F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY)&&r.texParameteri(F,r.TEXTURE_WRAP_R,Y[L.wrapR]),r.texParameteri(F,r.TEXTURE_MAG_FILTER,J[L.magFilter]),r.texParameteri(F,r.TEXTURE_MIN_FILTER,J[L.minFilter])):(r.texParameteri(F,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(F,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY)&&r.texParameteri(F,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(L.wrapS!==Ea||L.wrapT!==Ea)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(F,r.TEXTURE_MAG_FILTER,w(L.magFilter)),r.texParameteri(F,r.TEXTURE_MIN_FILTER,w(L.minFilter)),L.minFilter!==Gi&&L.minFilter!==tn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),L.compareFunction&&(r.texParameteri(F,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(F,r.TEXTURE_COMPARE_FUNC,Q[L.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(L.magFilter===Gi||L.minFilter!==jg&&L.minFilter!==Xl||L.type===No&&e.has("OES_texture_float_linear")===!1||s===!1&&L.type===Lc&&e.has("OES_texture_half_float_linear")===!1)return;if(L.anisotropy>1||i.get(L).__currentAnisotropy){let le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(F,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,n.getMaxAnisotropy())),i.get(L).__currentAnisotropy=L.anisotropy}}}function K(F,L){let ne=!1;F.__webglInit===void 0&&(F.__webglInit=!0,L.addEventListener("dispose",T));let le=L.source,me=p.get(le);me===void 0&&(me={},p.set(le,me));let fe=U(L);if(fe!==F.__cacheKey){me[fe]===void 0&&(me[fe]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ne=!0),me[fe].usedTimes++;let et=me[F.__cacheKey];et!==void 0&&(me[F.__cacheKey].usedTimes--,et.usedTimes===0&&E(L)),F.__cacheKey=fe,F.__webglTexture=me[fe].texture}return ne}function ae(F,L,ne){let le=r.TEXTURE_2D;(L.isDataArrayTexture||L.isCompressedArrayTexture)&&(le=r.TEXTURE_2D_ARRAY),L.isData3DTexture&&(le=r.TEXTURE_3D);let me=K(F,L),fe=L.source;t.bindTexture(le,F.__webglTexture,r.TEXTURE0+ne);let et=i.get(fe);if(fe.version!==et.__version||me===!0){t.activeTexture(r.TEXTURE0+ne);let Ke=Lr.getPrimaries(Lr.workingColorSpace),Se=L.colorSpace===il?null:Lr.getPrimaries(L.colorSpace),Ae=L.colorSpace===il||Ke===Se?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,L.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,L.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ae);let at=_(L)&&v(L.image)===!1,$=m(L.image,at,!1,n.maxTextureSize);$=Ve(L,$);let nt=v($)||s,Xe=a.convert(L.format,L.colorSpace),Fe=a.convert(L.type),we=M(L.internalFormat,Xe,Fe,L.colorSpace,L.isVideoTexture);V(le,L,nt);let Ie,ct=L.mipmaps,Je=s&&L.isVideoTexture!==!0&&we!==zA,Gt=et.__version===void 0||me===!0,X=fe.dataReady,Te=S(L,$,nt);if(L.isDepthTexture)we=r.DEPTH_COMPONENT,s?L.type===No?we=r.DEPTH_COMPONENT32F:L.type===ds?we=r.DEPTH_COMPONENT24:L.type===rl?we=r.DEPTH24_STENCIL8:we=r.DEPTH_COMPONENT16:L.type===No&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===Yl&&we===r.DEPTH_COMPONENT&&L.type!==Kg&&L.type!==ds&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=ds,Fe=a.convert(L.type)),L.format===Fu&&we===r.DEPTH_COMPONENT&&(we=r.DEPTH_STENCIL,L.type!==rl&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=rl,Fe=a.convert(L.type))),Gt&&(Je?t.texStorage2D(r.TEXTURE_2D,1,we,$.width,$.height):t.texImage2D(r.TEXTURE_2D,0,we,$.width,$.height,0,Xe,Fe,null));else if(L.isDataTexture)if(ct.length>0&&nt){Je&&Gt&&t.texStorage2D(r.TEXTURE_2D,Te,we,ct[0].width,ct[0].height);for(let te=0,Me=ct.length;te<Me;te++)Ie=ct[te],Je?X&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,Ie.width,Ie.height,Xe,Fe,Ie.data):t.texImage2D(r.TEXTURE_2D,te,we,Ie.width,Ie.height,0,Xe,Fe,Ie.data);L.generateMipmaps=!1}else Je?(Gt&&t.texStorage2D(r.TEXTURE_2D,Te,we,$.width,$.height),X&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,$.width,$.height,Xe,Fe,$.data)):t.texImage2D(r.TEXTURE_2D,0,we,$.width,$.height,0,Xe,Fe,$.data);else if(L.isCompressedTexture)if(L.isCompressedArrayTexture){Je&&Gt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Te,we,ct[0].width,ct[0].height,$.depth);for(let te=0,Me=ct.length;te<Me;te++)Ie=ct[te],L.format!==Un?Xe!==null?Je?X&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,0,Ie.width,Ie.height,$.depth,Xe,Ie.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,te,we,Ie.width,Ie.height,$.depth,0,Ie.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Je?X&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,0,Ie.width,Ie.height,$.depth,Xe,Fe,Ie.data):t.texImage3D(r.TEXTURE_2D_ARRAY,te,we,Ie.width,Ie.height,$.depth,0,Xe,Fe,Ie.data)}else{Je&&Gt&&t.texStorage2D(r.TEXTURE_2D,Te,we,ct[0].width,ct[0].height);for(let te=0,Me=ct.length;te<Me;te++)Ie=ct[te],L.format!==Un?Xe!==null?Je?X&&t.compressedTexSubImage2D(r.TEXTURE_2D,te,0,0,Ie.width,Ie.height,Xe,Ie.data):t.compressedTexImage2D(r.TEXTURE_2D,te,we,Ie.width,Ie.height,0,Ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Je?X&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,Ie.width,Ie.height,Xe,Fe,Ie.data):t.texImage2D(r.TEXTURE_2D,te,we,Ie.width,Ie.height,0,Xe,Fe,Ie.data)}else if(L.isDataArrayTexture)Je?(Gt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Te,we,$.width,$.height,$.depth),X&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,$.width,$.height,$.depth,Xe,Fe,$.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,we,$.width,$.height,$.depth,0,Xe,Fe,$.data);else if(L.isData3DTexture)Je?(Gt&&t.texStorage3D(r.TEXTURE_3D,Te,we,$.width,$.height,$.depth),X&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,$.width,$.height,$.depth,Xe,Fe,$.data)):t.texImage3D(r.TEXTURE_3D,0,we,$.width,$.height,$.depth,0,Xe,Fe,$.data);else if(L.isFramebufferTexture){if(Gt)if(Je)t.texStorage2D(r.TEXTURE_2D,Te,we,$.width,$.height);else{let te=$.width,Me=$.height;for(let De=0;De<Te;De++)t.texImage2D(r.TEXTURE_2D,De,we,te,Me,0,Xe,Fe,null),te>>=1,Me>>=1}}else if(ct.length>0&&nt){if(Je&&Gt){let te=dt(ct[0]);t.texStorage2D(r.TEXTURE_2D,Te,we,te.width,te.height)}for(let te=0,Me=ct.length;te<Me;te++)Ie=ct[te],Je?X&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,Xe,Fe,Ie):t.texImage2D(r.TEXTURE_2D,te,we,Xe,Fe,Ie);L.generateMipmaps=!1}else if(Je){if(Gt){let te=dt($);t.texStorage2D(r.TEXTURE_2D,Te,we,te.width,te.height)}X&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Xe,Fe,$)}else t.texImage2D(r.TEXTURE_2D,0,we,Xe,Fe,$);y(L,nt)&&x(le),et.__version=fe.version,L.onUpdate&&L.onUpdate(L)}F.__version=L.version}function ve(F,L,ne){if(L.image.length!==6)return;let le=K(F,L),me=L.source;t.bindTexture(r.TEXTURE_CUBE_MAP,F.__webglTexture,r.TEXTURE0+ne);let fe=i.get(me);if(me.version!==fe.__version||le===!0){t.activeTexture(r.TEXTURE0+ne);let et=Lr.getPrimaries(Lr.workingColorSpace),Ke=L.colorSpace===il?null:Lr.getPrimaries(L.colorSpace),Se=L.colorSpace===il||et===Ke?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,L.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,L.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Se);let Ae=L.isCompressedTexture||L.image[0].isCompressedTexture,at=L.image[0]&&L.image[0].isDataTexture,$=[];for(let te=0;te<6;te++)!Ae&&!at?$[te]=m(L.image[te],!1,!0,n.maxCubemapSize):$[te]=at?L.image[te].image:L.image[te],$[te]=Ve(L,$[te]);let nt=$[0],Xe=v(nt)||s,Fe=a.convert(L.format,L.colorSpace),we=a.convert(L.type),Ie=M(L.internalFormat,Fe,we,L.colorSpace),ct=s&&L.isVideoTexture!==!0,Je=fe.__version===void 0||le===!0,Gt=me.dataReady,X=S(L,nt,Xe);V(r.TEXTURE_CUBE_MAP,L,Xe);let Te;if(Ae){ct&&Je&&t.texStorage2D(r.TEXTURE_CUBE_MAP,X,Ie,nt.width,nt.height);for(let te=0;te<6;te++){Te=$[te].mipmaps;for(let Me=0;Me<Te.length;Me++){let De=Te[Me];L.format!==Un?Fe!==null?ct?Gt&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me,0,0,De.width,De.height,Fe,De.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me,Ie,De.width,De.height,0,De.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me,0,0,De.width,De.height,Fe,we,De.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me,Ie,De.width,De.height,0,Fe,we,De.data)}}}else{if(Te=L.mipmaps,ct&&Je){Te.length>0&&X++;let te=dt($[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,X,Ie,te.width,te.height)}for(let te=0;te<6;te++)if(at){ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,$[te].width,$[te].height,Fe,we,$[te].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,Ie,$[te].width,$[te].height,0,Fe,we,$[te].data);for(let Me=0;Me<Te.length;Me++){let wt=Te[Me].image[te].image;ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me+1,0,0,wt.width,wt.height,Fe,we,wt.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me+1,Ie,wt.width,wt.height,0,Fe,we,wt.data)}}else{ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,Fe,we,$[te]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,Ie,Fe,we,$[te]);for(let Me=0;Me<Te.length;Me++){let De=Te[Me];ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me+1,0,0,Fe,we,De.image[te]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me+1,Ie,Fe,we,De.image[te])}}}y(L,Xe)&&x(r.TEXTURE_CUBE_MAP),fe.__version=me.version,L.onUpdate&&L.onUpdate(L)}F.__version=L.version}function ue(F,L,ne,le,me,fe){let et=a.convert(ne.format,ne.colorSpace),Ke=a.convert(ne.type),Se=M(ne.internalFormat,et,Ke,ne.colorSpace);if(!i.get(L).__hasExternalTextures){let at=Math.max(1,L.width>>fe),$=Math.max(1,L.height>>fe);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,fe,Se,at,$,L.depth,0,et,Ke,null):t.texImage2D(me,fe,Se,at,$,0,et,Ke,null)}t.bindFramebuffer(r.FRAMEBUFFER,F),Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,0,Le(L)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,fe),t.bindFramebuffer(r.FRAMEBUFFER,null)}function se(F,L,ne){if(r.bindRenderbuffer(r.RENDERBUFFER,F),L.depthBuffer&&!L.stencilBuffer){let le=s===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(ne||Ue(L)){let me=L.depthTexture;me&&me.isDepthTexture&&(me.type===No?le=r.DEPTH_COMPONENT32F:me.type===ds&&(le=r.DEPTH_COMPONENT24));let fe=Le(L);Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,fe,le,L.width,L.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,fe,le,L.width,L.height)}else r.renderbufferStorage(r.RENDERBUFFER,le,L.width,L.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,F)}else if(L.depthBuffer&&L.stencilBuffer){let le=Le(L);ne&&Ue(L)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,L.width,L.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,F)}else{let le=L.textures;for(let me=0;me<le.length;me++){let fe=le[me],et=a.convert(fe.format,fe.colorSpace),Ke=a.convert(fe.type),Se=M(fe.internalFormat,et,Ke,fe.colorSpace),Ae=Le(L);ne&&Ue(L)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,Se,L.width,L.height):Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,Se,L.width,L.height):r.renderbufferStorage(r.RENDERBUFFER,Se,L.width,L.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ee(F,L){if(L&&L.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,F),!(L.depthTexture&&L.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(L.depthTexture).__webglTexture||L.depthTexture.image.width!==L.width||L.depthTexture.image.height!==L.height)&&(L.depthTexture.image.width=L.width,L.depthTexture.image.height=L.height,L.depthTexture.needsUpdate=!0),B(L.depthTexture,0);let le=i.get(L.depthTexture).__webglTexture,me=Le(L);if(L.depthTexture.format===Yl)Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0,me):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0);else if(L.depthTexture.format===Fu)Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0,me):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0);else throw new Error("Unknown depthTexture format")}function q(F){let L=i.get(F),ne=F.isWebGLCubeRenderTarget===!0;if(F.depthTexture&&!L.__autoAllocateDepthBuffer){if(ne)throw new Error("target.depthTexture not supported in Cube render targets");Ee(L.__webglFramebuffer,F)}else if(ne){L.__webglDepthbuffer=[];for(let le=0;le<6;le++)t.bindFramebuffer(r.FRAMEBUFFER,L.__webglFramebuffer[le]),L.__webglDepthbuffer[le]=r.createRenderbuffer(),se(L.__webglDepthbuffer[le],F,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,L.__webglFramebuffer),L.__webglDepthbuffer=r.createRenderbuffer(),se(L.__webglDepthbuffer,F,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function H(F,L,ne){let le=i.get(F);L!==void 0&&ue(le.__webglFramebuffer,F,F.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),ne!==void 0&&q(F)}function We(F){let L=F.texture,ne=i.get(F),le=i.get(L);F.addEventListener("dispose",C);let me=F.textures,fe=F.isWebGLCubeRenderTarget===!0,et=me.length>1,Ke=v(F)||s;if(et||(le.__webglTexture===void 0&&(le.__webglTexture=r.createTexture()),le.__version=L.version,o.memory.textures++),fe){ne.__webglFramebuffer=[];for(let Se=0;Se<6;Se++)if(s&&L.mipmaps&&L.mipmaps.length>0){ne.__webglFramebuffer[Se]=[];for(let Ae=0;Ae<L.mipmaps.length;Ae++)ne.__webglFramebuffer[Se][Ae]=r.createFramebuffer()}else ne.__webglFramebuffer[Se]=r.createFramebuffer()}else{if(s&&L.mipmaps&&L.mipmaps.length>0){ne.__webglFramebuffer=[];for(let Se=0;Se<L.mipmaps.length;Se++)ne.__webglFramebuffer[Se]=r.createFramebuffer()}else ne.__webglFramebuffer=r.createFramebuffer();if(et)if(n.drawBuffers)for(let Se=0,Ae=me.length;Se<Ae;Se++){let at=i.get(me[Se]);at.__webglTexture===void 0&&(at.__webglTexture=r.createTexture(),o.memory.textures++)}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(s&&F.samples>0&&Ue(F)===!1){ne.__webglMultisampledFramebuffer=r.createFramebuffer(),ne.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ne.__webglMultisampledFramebuffer);for(let Se=0;Se<me.length;Se++){let Ae=me[Se];ne.__webglColorRenderbuffer[Se]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,ne.__webglColorRenderbuffer[Se]);let at=a.convert(Ae.format,Ae.colorSpace),$=a.convert(Ae.type),nt=M(Ae.internalFormat,at,$,Ae.colorSpace,F.isXRRenderTarget===!0),Xe=Le(F);r.renderbufferStorageMultisample(r.RENDERBUFFER,Xe,nt,F.width,F.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Se,r.RENDERBUFFER,ne.__webglColorRenderbuffer[Se])}r.bindRenderbuffer(r.RENDERBUFFER,null),F.depthBuffer&&(ne.__webglDepthRenderbuffer=r.createRenderbuffer(),se(ne.__webglDepthRenderbuffer,F,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(fe){t.bindTexture(r.TEXTURE_CUBE_MAP,le.__webglTexture),V(r.TEXTURE_CUBE_MAP,L,Ke);for(let Se=0;Se<6;Se++)if(s&&L.mipmaps&&L.mipmaps.length>0)for(let Ae=0;Ae<L.mipmaps.length;Ae++)ue(ne.__webglFramebuffer[Se][Ae],F,L,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Ae);else ue(ne.__webglFramebuffer[Se],F,L,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0);y(L,Ke)&&x(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(et){for(let Se=0,Ae=me.length;Se<Ae;Se++){let at=me[Se],$=i.get(at);t.bindTexture(r.TEXTURE_2D,$.__webglTexture),V(r.TEXTURE_2D,at,Ke),ue(ne.__webglFramebuffer,F,at,r.COLOR_ATTACHMENT0+Se,r.TEXTURE_2D,0),y(at,Ke)&&x(r.TEXTURE_2D)}t.unbindTexture()}else{let Se=r.TEXTURE_2D;if((F.isWebGL3DRenderTarget||F.isWebGLArrayRenderTarget)&&(s?Se=F.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(Se,le.__webglTexture),V(Se,L,Ke),s&&L.mipmaps&&L.mipmaps.length>0)for(let Ae=0;Ae<L.mipmaps.length;Ae++)ue(ne.__webglFramebuffer[Ae],F,L,r.COLOR_ATTACHMENT0,Se,Ae);else ue(ne.__webglFramebuffer,F,L,r.COLOR_ATTACHMENT0,Se,0);y(L,Ke)&&x(Se),t.unbindTexture()}F.depthBuffer&&q(F)}function _e(F){let L=v(F)||s,ne=F.textures;for(let le=0,me=ne.length;le<me;le++){let fe=ne[le];if(y(fe,L)){let et=F.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,Ke=i.get(fe).__webglTexture;t.bindTexture(et,Ke),x(et),t.unbindTexture()}}}function xe(F){if(s&&F.samples>0&&Ue(F)===!1){let L=F.textures,ne=F.width,le=F.height,me=r.COLOR_BUFFER_BIT,fe=[],et=F.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ke=i.get(F),Se=L.length>1;if(Se)for(let Ae=0;Ae<L.length;Ae++)t.bindFramebuffer(r.FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ke.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ke.__webglFramebuffer);for(let Ae=0;Ae<L.length;Ae++){fe.push(r.COLOR_ATTACHMENT0+Ae),F.depthBuffer&&fe.push(et);let at=Ke.__ignoreDepthValues!==void 0?Ke.__ignoreDepthValues:!1;if(at===!1&&(F.depthBuffer&&(me|=r.DEPTH_BUFFER_BIT),F.stencilBuffer&&(me|=r.STENCIL_BUFFER_BIT)),Se&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ke.__webglColorRenderbuffer[Ae]),at===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[et]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[et])),Se){let $=i.get(L[Ae]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,$,0)}r.blitFramebuffer(0,0,ne,le,0,0,ne,le,me,r.NEAREST),u&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,fe)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Se)for(let Ae=0;Ae<L.length;Ae++){t.bindFramebuffer(r.FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,Ke.__webglColorRenderbuffer[Ae]);let at=i.get(L[Ae]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ke.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,at,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ke.__webglMultisampledFramebuffer)}}function Le(F){return Math.min(n.maxSamples,F.samples)}function Ue(F){let L=i.get(F);return s&&F.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function Ne(F){let L=o.render.frame;h.get(F)!==L&&(h.set(F,L),F.update())}function Ve(F,L){let ne=F.colorSpace,le=F.format,me=F.type;return F.isCompressedTexture===!0||F.isVideoTexture===!0||F.format===ZS||ne!==Oo&&ne!==il&&(Lr.getTransfer(ne)===qr?s===!1?e.has("EXT_sRGB")===!0&&le===Un?(F.format=ZS,F.minFilter=tn,F.generateMipmaps=!1):L=ny.sRGBToLinear(L):(le!==Un||me!==ps)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ne)),L}function dt(F){return typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement?(c.width=F.naturalWidth||F.width,c.height=F.naturalHeight||F.height):typeof VideoFrame<"u"&&F instanceof VideoFrame?(c.width=F.displayWidth,c.height=F.displayHeight):(c.width=F.width,c.height=F.height),c}this.allocateTextureUnit=P,this.resetTextureUnits=A,this.setTexture2D=B,this.setTexture2DArray=z,this.setTexture3D=k,this.setTextureCube=G,this.rebindTextures=H,this.setupRenderTarget=We,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=Ue}function Bie(r,e,t){let i=t.isWebGL2;function n(a,o=il){let s,l=Lr.getTransfer(o);if(a===ps)return r.UNSIGNED_BYTE;if(a===CA)return r.UNSIGNED_SHORT_4_4_4_4;if(a===RA)return r.UNSIGNED_SHORT_5_5_5_1;if(a===yQ)return r.BYTE;if(a===_Q)return r.SHORT;if(a===Kg)return r.UNSIGNED_SHORT;if(a===AA)return r.INT;if(a===ds)return r.UNSIGNED_INT;if(a===No)return r.FLOAT;if(a===Lc)return i?r.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(a===xQ)return r.ALPHA;if(a===Un)return r.RGBA;if(a===SQ)return r.LUMINANCE;if(a===MQ)return r.LUMINANCE_ALPHA;if(a===Yl)return r.DEPTH_COMPONENT;if(a===Fu)return r.DEPTH_STENCIL;if(a===ZS)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(a===bQ)return r.RED;if(a===LA)return r.RED_INTEGER;if(a===wQ)return r.RG;if(a===DA)return r.RG_INTEGER;if(a===PA)return r.RGBA_INTEGER;if(a===IA||a===NA||a===UA||a===OA)if(l===qr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(a===IA)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===NA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===UA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===OA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(a===IA)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===NA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===UA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===OA)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===vz||a===gz||a===yz||a===_z)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(a===vz)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===gz)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===yz)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===_z)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===zA)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===xz||a===Sz)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(a===xz)return l===qr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(a===Sz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===Mz||a===bz||a===wz||a===Tz||a===Ez||a===Az||a===Cz||a===Rz||a===Lz||a===Dz||a===Pz||a===Iz||a===Nz||a===Uz)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(a===Mz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===bz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===wz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===Tz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===Ez)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===Az)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===Cz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===Rz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===Lz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===Dz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===Pz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===Iz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===Nz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===Uz)return l===qr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===FA||a===Oz||a===zz)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(a===FA)return l===qr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===Oz)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===zz)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===TQ||a===Fz||a===Bz||a===kz)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(a===FA)return s.COMPRESSED_RED_RGTC1_EXT;if(a===Fz)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===Bz)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===kz)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===rl?i?r.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):r[a]!==void 0?r[a]:null}return{convert:n}}var MC=class extends Wi{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}};var Fd=class extends nn{constructor(){super(),this.isGroup=!0,this.type="Group"}};var dAe={type:"move"},Py=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Fd,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Fd,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new be,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new be),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Fd,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new be,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new be),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let n=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(let g of e.hand.values()){let m=t.getJointPose(g,i),v=this._getHandJoint(u,g);m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=m.radius),v.visible=m!==null}let c=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],f=c.position.distanceTo(h.position),p=.02,d=.005;u.inputState.pinching&&f>p+d?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=p-d&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&a!==null&&(n=a),n!==null&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(dAe)))}return s!==null&&(s.visible=n!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new Fd;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}};var mAe=`
  6533. void main() {
  6534. gl_Position = vec4( position, 1.0 );
  6535. }`,vAe=`
  6536. uniform sampler2DArray depthColor;
  6537. uniform float depthWidth;
  6538. uniform float depthHeight;
  6539. void main() {
  6540. vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
  6541. if ( coord.x >= 1.0 ) {
  6542. gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
  6543. } else {
  6544. gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
  6545. }
  6546. }`,bC=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){let n=new Bo,a=e.properties.get(n);a.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}render(e,t){if(this.texture!==null){if(this.mesh===null){let i=t.cameras[0].viewport,n=new Ra({extensions:{fragDepth:!0},vertexShader:mAe,fragmentShader:vAe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new an(new Ty(20,20),n)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}};var wC=class extends Fo{constructor(e,t){super();let i=this,n=null,a=1,o=null,s="local-floor",l=1,u=null,c=null,h=null,f=null,p=null,d=null,g=new bC,m=t.getContextAttributes(),v=null,_=null,y=[],x=[],M=new Qt,S=null,w=new Wi;w.layers.enable(1),w.viewport=new li;let T=new Wi;T.layers.enable(2),T.viewport=new li;let C=[w,T],b=new MC;b.layers.enable(1),b.layers.enable(2);let E=null,I=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let K=y[V];return K===void 0&&(K=new Py,y[V]=K),K.getTargetRaySpace()},this.getControllerGrip=function(V){let K=y[V];return K===void 0&&(K=new Py,y[V]=K),K.getGripSpace()},this.getHand=function(V){let K=y[V];return K===void 0&&(K=new Py,y[V]=K),K.getHandSpace()};function R(V){let K=x.indexOf(V.inputSource);if(K===-1)return;let ae=y[K];ae!==void 0&&(ae.update(V.inputSource,V.frame,u||o),ae.dispatchEvent({type:V.type,data:V.inputSource}))}function A(){n.removeEventListener("select",R),n.removeEventListener("selectstart",R),n.removeEventListener("selectend",R),n.removeEventListener("squeeze",R),n.removeEventListener("squeezestart",R),n.removeEventListener("squeezeend",R),n.removeEventListener("end",A),n.removeEventListener("inputsourceschange",P);for(let V=0;V<y.length;V++){let K=x[V];K!==null&&(x[V]=null,y[V].disconnect(K))}E=null,I=null,g.reset(),e.setRenderTarget(v),p=null,f=null,h=null,n=null,_=null,Q.stop(),i.isPresenting=!1,e.setPixelRatio(S),e.setSize(M.width,M.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(V){a=V,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(V){s=V,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(V){u=V},this.getBaseLayer=function(){return f!==null?f:p},this.getBinding=function(){return h},this.getFrame=function(){return d},this.getSession=function(){return n},this.setSession=function(V){return Lb(this,null,function*(){if(n=V,n!==null){if(v=e.getRenderTarget(),n.addEventListener("select",R),n.addEventListener("selectstart",R),n.addEventListener("selectend",R),n.addEventListener("squeeze",R),n.addEventListener("squeezestart",R),n.addEventListener("squeezeend",R),n.addEventListener("end",A),n.addEventListener("inputsourceschange",P),m.xrCompatible!==!0&&(yield t.makeXRCompatible()),S=e.getPixelRatio(),e.getSize(M),n.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let K={antialias:n.renderState.layers===void 0?m.antialias:!0,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:a};p=new XRWebGLLayer(n,t,K),n.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),_=new ko(p.framebufferWidth,p.framebufferHeight,{format:Un,type:ps,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let K=null,ae=null,ve=null;m.depth&&(ve=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,K=m.stencil?Fu:Yl,ae=m.stencil?rl:ds);let ue={colorFormat:t.RGBA8,depthFormat:ve,scaleFactor:a};h=new XRWebGLBinding(n,t),f=h.createProjectionLayer(ue),n.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),_=new ko(f.textureWidth,f.textureHeight,{format:Un,type:ps,depthTexture:new Ry(f.textureWidth,f.textureHeight,ae,void 0,void 0,void 0,void 0,void 0,void 0,K),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0});let se=e.properties.get(_);se.__ignoreDepthValues=f.ignoreDepthValues}_.isXRRenderTarget=!0,this.setFoveation(l),u=null,o=yield n.requestReferenceSpace(s),Q.setContext(n),Q.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(n!==null)return n.environmentBlendMode};function P(V){for(let K=0;K<V.removed.length;K++){let ae=V.removed[K],ve=x.indexOf(ae);ve>=0&&(x[ve]=null,y[ve].disconnect(ae))}for(let K=0;K<V.added.length;K++){let ae=V.added[K],ve=x.indexOf(ae);if(ve===-1){for(let se=0;se<y.length;se++)if(se>=x.length){x.push(ae),ve=se;break}else if(x[se]===null){x[se]=ae,ve=se;break}if(ve===-1)break}let ue=y[ve];ue&&ue.connect(ae)}}let U=new be,B=new be;function z(V,K,ae){U.setFromMatrixPosition(K.matrixWorld),B.setFromMatrixPosition(ae.matrixWorld);let ve=U.distanceTo(B),ue=K.projectionMatrix.elements,se=ae.projectionMatrix.elements,Ee=ue[14]/(ue[10]-1),q=ue[14]/(ue[10]+1),H=(ue[9]+1)/ue[5],We=(ue[9]-1)/ue[5],_e=(ue[8]-1)/ue[0],xe=(se[8]+1)/se[0],Le=Ee*_e,Ue=Ee*xe,Ne=ve/(-_e+xe),Ve=Ne*-_e;K.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ve),V.translateZ(Ne),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert();let dt=Ee+Ne,F=q+Ne,L=Le-Ve,ne=Ue+(ve-Ve),le=H*q/F*dt,me=We*q/F*dt;V.projectionMatrix.makePerspective(L,ne,le,me,dt,F),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}function k(V,K){K===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(K.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(n===null)return;g.texture!==null&&(V.near=g.depthNear,V.far=g.depthFar),b.near=T.near=w.near=V.near,b.far=T.far=w.far=V.far,(E!==b.near||I!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),E=b.near,I=b.far,w.near=E,w.far=I,T.near=E,T.far=I,w.updateProjectionMatrix(),T.updateProjectionMatrix(),V.updateProjectionMatrix());let K=V.parent,ae=b.cameras;k(b,K);for(let ve=0;ve<ae.length;ve++)k(ae[ve],K);ae.length===2?z(b,w,T):b.projectionMatrix.copy(w.projectionMatrix),G(V,b,K)};function G(V,K,ae){ae===null?V.matrix.copy(K.matrixWorld):(V.matrix.copy(ae.matrixWorld),V.matrix.invert(),V.matrix.multiply(K.matrixWorld)),V.matrix.decompose(V.position,V.quaternion,V.scale),V.updateMatrixWorld(!0),V.projectionMatrix.copy(K.projectionMatrix),V.projectionMatrixInverse.copy(K.projectionMatrixInverse),V.isPerspectiveCamera&&(V.fov=jS*2*Math.atan(1/V.projectionMatrix.elements[5]),V.zoom=1)}this.getCamera=function(){return b},this.getFoveation=function(){if(!(f===null&&p===null))return l},this.setFoveation=function(V){l=V,f!==null&&(f.fixedFoveation=V),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=V)},this.hasDepthSensing=function(){return g.texture!==null};let Y=null;function J(V,K){if(c=K.getViewerPose(u||o),d=K,c!==null){let ae=c.views;p!==null&&(e.setRenderTargetFramebuffer(_,p.framebuffer),e.setRenderTarget(_));let ve=!1;ae.length!==b.cameras.length&&(b.cameras.length=0,ve=!0);for(let se=0;se<ae.length;se++){let Ee=ae[se],q=null;if(p!==null)q=p.getViewport(Ee);else{let We=h.getViewSubImage(f,Ee);q=We.viewport,se===0&&(e.setRenderTargetTextures(_,We.colorTexture,f.ignoreDepthValues?void 0:We.depthStencilTexture),e.setRenderTarget(_))}let H=C[se];H===void 0&&(H=new Wi,H.layers.enable(se),H.viewport=new li,C[se]=H),H.matrix.fromArray(Ee.transform.matrix),H.matrix.decompose(H.position,H.quaternion,H.scale),H.projectionMatrix.fromArray(Ee.projectionMatrix),H.projectionMatrixInverse.copy(H.projectionMatrix).invert(),H.viewport.set(q.x,q.y,q.width,q.height),se===0&&(b.matrix.copy(H.matrix),b.matrix.decompose(b.position,b.quaternion,b.scale)),ve===!0&&b.cameras.push(H)}let ue=n.enabledFeatures;if(ue&&ue.includes("depth-sensing")){let se=h.getDepthInformation(ae[0]);se&&se.isValid&&se.texture&&g.init(e,se,n.renderState)}}for(let ae=0;ae<y.length;ae++){let ve=x[ae],ue=y[ae];ve!==null&&ue!==void 0&&ue.update(ve,K,u||o)}g.render(e,b),Y&&Y(V,K),K.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:K}),d=null}let Q=new mC;Q.setAnimationLoop(J),this.setAnimationLoop=function(V){Y=V},this.dispose=function(){}}};var Bd=new jl,gAe=new Zr;function kie(r,e){function t(m,v){m.matrixAutoUpdate===!0&&m.updateMatrix(),v.value.copy(m.matrix)}function i(m,v){v.color.getRGB(m.fogColor.value,hC(r)),v.isFog?(m.fogNear.value=v.near,m.fogFar.value=v.far):v.isFogExp2&&(m.fogDensity.value=v.density)}function n(m,v,_,y,x){v.isMeshBasicMaterial||v.isMeshLambertMaterial?a(m,v):v.isMeshToonMaterial?(a(m,v),h(m,v)):v.isMeshPhongMaterial?(a(m,v),c(m,v)):v.isMeshStandardMaterial?(a(m,v),f(m,v),v.isMeshPhysicalMaterial&&p(m,v,x)):v.isMeshMatcapMaterial?(a(m,v),d(m,v)):v.isMeshDepthMaterial?a(m,v):v.isMeshDistanceMaterial?(a(m,v),g(m,v)):v.isMeshNormalMaterial?a(m,v):v.isLineBasicMaterial?(o(m,v),v.isLineDashedMaterial&&s(m,v)):v.isPointsMaterial?l(m,v,_,y):v.isSpriteMaterial?u(m,v):v.isShadowMaterial?(m.color.value.copy(v.color),m.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function a(m,v){m.opacity.value=v.opacity,v.color&&m.diffuse.value.copy(v.color),v.emissive&&m.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.bumpMap&&(m.bumpMap.value=v.bumpMap,t(v.bumpMap,m.bumpMapTransform),m.bumpScale.value=v.bumpScale,v.side===bi&&(m.bumpScale.value*=-1)),v.normalMap&&(m.normalMap.value=v.normalMap,t(v.normalMap,m.normalMapTransform),m.normalScale.value.copy(v.normalScale),v.side===bi&&m.normalScale.value.negate()),v.displacementMap&&(m.displacementMap.value=v.displacementMap,t(v.displacementMap,m.displacementMapTransform),m.displacementScale.value=v.displacementScale,m.displacementBias.value=v.displacementBias),v.emissiveMap&&(m.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,m.emissiveMapTransform)),v.specularMap&&(m.specularMap.value=v.specularMap,t(v.specularMap,m.specularMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest);let _=e.get(v),y=_.envMap,x=_.envMapRotation;if(y&&(m.envMap.value=y,Bd.copy(x),Bd.x*=-1,Bd.y*=-1,Bd.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Bd.y*=-1,Bd.z*=-1),m.envMapRotation.value.setFromMatrix4(gAe.makeRotationFromEuler(Bd)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=v.reflectivity,m.ior.value=v.ior,m.refractionRatio.value=v.refractionRatio),v.lightMap){m.lightMap.value=v.lightMap;let M=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=v.lightMapIntensity*M,t(v.lightMap,m.lightMapTransform)}v.aoMap&&(m.aoMap.value=v.aoMap,m.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,m.aoMapTransform))}function o(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform))}function s(m,v){m.dashSize.value=v.dashSize,m.totalSize.value=v.dashSize+v.gapSize,m.scale.value=v.scale}function l(m,v,_,y){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.size.value=v.size*_,m.scale.value=y*.5,v.map&&(m.map.value=v.map,t(v.map,m.uvTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function u(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.rotation.value=v.rotation,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function c(m,v){m.specular.value.copy(v.specular),m.shininess.value=Math.max(v.shininess,1e-4)}function h(m,v){v.gradientMap&&(m.gradientMap.value=v.gradientMap)}function f(m,v){m.metalness.value=v.metalness,v.metalnessMap&&(m.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,m.metalnessMapTransform)),m.roughness.value=v.roughness,v.roughnessMap&&(m.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,m.roughnessMapTransform)),e.get(v).envMap&&(m.envMapIntensity.value=v.envMapIntensity)}function p(m,v,_){m.ior.value=v.ior,v.sheen>0&&(m.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),m.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(m.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,m.sheenColorMapTransform)),v.sheenRoughnessMap&&(m.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,m.sheenRoughnessMapTransform))),v.clearcoat>0&&(m.clearcoat.value=v.clearcoat,m.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(m.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,m.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(m.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===bi&&m.clearcoatNormalScale.value.negate())),v.iridescence>0&&(m.iridescence.value=v.iridescence,m.iridescenceIOR.value=v.iridescenceIOR,m.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(m.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,m.iridescenceMapTransform)),v.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),v.transmission>0&&(m.transmission.value=v.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),v.transmissionMap&&(m.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,m.transmissionMapTransform)),m.thickness.value=v.thickness,v.thicknessMap&&(m.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=v.attenuationDistance,m.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(m.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(m.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=v.specularIntensity,m.specularColor.value.copy(v.specularColor),v.specularColorMap&&(m.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,m.specularColorMapTransform)),v.specularIntensityMap&&(m.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,m.specularIntensityMapTransform))}function d(m,v){v.matcap&&(m.matcap.value=v.matcap)}function g(m,v){let _=e.get(v).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function Vie(r,e,t,i){let n={},a={},o=[],s=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(_,y){let x=y.program;i.uniformBlockBinding(_,x)}function u(_,y){let x=n[_.id];x===void 0&&(d(_),x=c(_),n[_.id]=x,_.addEventListener("dispose",m));let M=y.program;i.updateUBOMapping(_,M);let S=e.render.frame;a[_.id]!==S&&(f(_),a[_.id]=S)}function c(_){let y=h();_.__bindingPointIndex=y;let x=r.createBuffer(),M=_.__size,S=_.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,M,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,x),x}function h(){for(let _=0;_<s;_++)if(o.indexOf(_)===-1)return o.push(_),_;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(_){let y=n[_.id],x=_.uniforms,M=_.__cache;r.bindBuffer(r.UNIFORM_BUFFER,y);for(let S=0,w=x.length;S<w;S++){let T=Array.isArray(x[S])?x[S]:[x[S]];for(let C=0,b=T.length;C<b;C++){let E=T[C];if(p(E,S,C,M)===!0){let I=E.__offset,R=Array.isArray(E.value)?E.value:[E.value],A=0;for(let P=0;P<R.length;P++){let U=R[P],B=g(U);typeof U=="number"||typeof U=="boolean"?(E.__data[0]=U,r.bufferSubData(r.UNIFORM_BUFFER,I+A,E.__data)):U.isMatrix3?(E.__data[0]=U.elements[0],E.__data[1]=U.elements[1],E.__data[2]=U.elements[2],E.__data[3]=0,E.__data[4]=U.elements[3],E.__data[5]=U.elements[4],E.__data[6]=U.elements[5],E.__data[7]=0,E.__data[8]=U.elements[6],E.__data[9]=U.elements[7],E.__data[10]=U.elements[8],E.__data[11]=0):(U.toArray(E.__data,A),A+=B.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,I,E.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function p(_,y,x,M){let S=_.value,w=y+"_"+x;if(M[w]===void 0)return typeof S=="number"||typeof S=="boolean"?M[w]=S:M[w]=S.clone(),!0;{let T=M[w];if(typeof S=="number"||typeof S=="boolean"){if(T!==S)return M[w]=S,!0}else if(T.equals(S)===!1)return T.copy(S),!0}return!1}function d(_){let y=_.uniforms,x=0,M=16;for(let w=0,T=y.length;w<T;w++){let C=Array.isArray(y[w])?y[w]:[y[w]];for(let b=0,E=C.length;b<E;b++){let I=C[b],R=Array.isArray(I.value)?I.value:[I.value];for(let A=0,P=R.length;A<P;A++){let U=R[A],B=g(U),z=x%M;z!==0&&M-z<B.boundary&&(x+=M-z),I.__data=new Float32Array(B.storage/Float32Array.BYTES_PER_ELEMENT),I.__offset=x,x+=B.storage}}}let S=x%M;return S>0&&(x+=M-S),_.__size=x,_.__cache={},this}function g(_){let y={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),y}function m(_){let y=_.target;y.removeEventListener("dispose",m);let x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),r.deleteBuffer(n[y.id]),delete n[y.id],delete a[y.id]}function v(){for(let _ in n)r.deleteBuffer(n[_]);o=[],n={},a={}}return{bind:l,update:u,dispose:v}}var rM=class{constructor(e={}){let{canvas:t=BQ(),context:i=null,depth:n=!0,stencil:a=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let f;i!==null?f=i.getContextAttributes().alpha:f=o;let p=new Uint32Array(4),d=new Int32Array(4),g=null,m=null,v=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Uo,this._useLegacyLights=!1,this.toneMapping=tl,this.toneMappingExposure=1;let y=this,x=!1,M=0,S=0,w=null,T=-1,C=null,b=new li,E=new li,I=null,R=new or(0),A=0,P=t.width,U=t.height,B=1,z=null,k=null,G=new li(0,0,P,U),Y=new li(0,0,P,U),J=!1,Q=new Tf,V=!1,K=!1,ae=null,ve=new Zr,ue=new Qt,se=new be,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return w===null?B:1}let H=i;function We(O,j){for(let re=0;re<O.length;re++){let ie=O[re],D=t.getContext(ie,j);if(D!==null)return D}return null}try{let O={alpha:!0,depth:n,stencil:a,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${VS}`),t.addEventListener("webglcontextlost",Gt,!1),t.addEventListener("webglcontextrestored",X,!1),t.addEventListener("webglcontextcreationerror",Te,!1),H===null){let j=["webgl2","webgl","experimental-webgl"];if(y.isWebGL1Renderer===!0&&j.shift(),H=We(j,O),H===null)throw We(j)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&H instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),H.getShaderPrecisionFormat===void 0&&(H.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let _e,xe,Le,Ue,Ne,Ve,dt,F,L,ne,le,me,fe,et,Ke,Se,Ae,at,$,nt,Xe,Fe,we,Ie;function ct(){_e=new iie(H),xe=new qre(H,_e,e),_e.init(xe),Fe=new Bie(H,_e,xe),Le=new zie(H,_e,xe),Ue=new oie(H),Ne=new Aie,Ve=new Fie(H,_e,Le,Ne,xe,Fe,Ue),dt=new jre(y),F=new rie(y),L=new uee(H,xe),we=new Xre(H,_e,L,xe),ne=new nie(H,L,Ue,we),le=new lie(H,ne,L,Ue),$=new sie(H,xe,Ve),Se=new Zre(Ne),me=new Eie(y,dt,F,_e,xe,we,Se),fe=new kie(y,Ne),et=new Lie,Ke=new Iie(_e,xe),at=new Wre(y,dt,F,Le,le,f,l),Ae=new Oie(y,le,xe),Ie=new Vie(H,Ue,xe,Le),nt=new Yre(H,_e,Ue,xe),Xe=new aie(H,_e,Ue,xe),Ue.programs=me.programs,y.capabilities=xe,y.extensions=_e,y.properties=Ne,y.renderLists=et,y.shadowMap=Ae,y.state=Le,y.info=Ue}ct();let Je=new wC(y,H);this.xr=Je,this.getContext=function(){return H},this.getContextAttributes=function(){return H.getContextAttributes()},this.forceContextLoss=function(){let O=_e.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){let O=_e.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return B},this.setPixelRatio=function(O){O!==void 0&&(B=O,this.setSize(P,U,!1))},this.getSize=function(O){return O.set(P,U)},this.setSize=function(O,j,re=!0){if(Je.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}P=O,U=j,t.width=Math.floor(O*B),t.height=Math.floor(j*B),re===!0&&(t.style.width=O+"px",t.style.height=j+"px"),this.setViewport(0,0,O,j)},this.getDrawingBufferSize=function(O){return O.set(P*B,U*B).floor()},this.setDrawingBufferSize=function(O,j,re){P=O,U=j,B=re,t.width=Math.floor(O*re),t.height=Math.floor(j*re),this.setViewport(0,0,O,j)},this.getCurrentViewport=function(O){return O.copy(b)},this.getViewport=function(O){return O.copy(G)},this.setViewport=function(O,j,re,ie){O.isVector4?G.set(O.x,O.y,O.z,O.w):G.set(O,j,re,ie),Le.viewport(b.copy(G).multiplyScalar(B).round())},this.getScissor=function(O){return O.copy(Y)},this.setScissor=function(O,j,re,ie){O.isVector4?Y.set(O.x,O.y,O.z,O.w):Y.set(O,j,re,ie),Le.scissor(E.copy(Y).multiplyScalar(B).round())},this.getScissorTest=function(){return J},this.setScissorTest=function(O){Le.setScissorTest(J=O)},this.setOpaqueSort=function(O){z=O},this.setTransparentSort=function(O){k=O},this.getClearColor=function(O){return O.copy(at.getClearColor())},this.setClearColor=function(){at.setClearColor.apply(at,arguments)},this.getClearAlpha=function(){return at.getClearAlpha()},this.setClearAlpha=function(){at.setClearAlpha.apply(at,arguments)},this.clear=function(O=!0,j=!0,re=!0){let ie=0;if(O){let D=!1;if(w!==null){let W=w.texture.format;D=W===PA||W===DA||W===LA}if(D){let W=w.texture.type,ee=W===ps||W===ds||W===Kg||W===rl||W===CA||W===RA,ge=at.getClearColor(),ce=at.getClearAlpha(),Oe=ge.r,Ge=ge.g,Re=ge.b;ee?(p[0]=Oe,p[1]=Ge,p[2]=Re,p[3]=ce,H.clearBufferuiv(H.COLOR,0,p)):(d[0]=Oe,d[1]=Ge,d[2]=Re,d[3]=ce,H.clearBufferiv(H.COLOR,0,d))}else ie|=H.COLOR_BUFFER_BIT}j&&(ie|=H.DEPTH_BUFFER_BIT),re&&(ie|=H.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),H.clear(ie)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Gt,!1),t.removeEventListener("webglcontextrestored",X,!1),t.removeEventListener("webglcontextcreationerror",Te,!1),et.dispose(),Ke.dispose(),Ne.dispose(),dt.dispose(),F.dispose(),le.dispose(),we.dispose(),Ie.dispose(),me.dispose(),Je.dispose(),Je.removeEventListener("sessionstart",$r),Je.removeEventListener("sessionend",Ht),ae&&(ae.dispose(),ae=null),Or.stop()};function Gt(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function X(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;let O=Ue.autoReset,j=Ae.enabled,re=Ae.autoUpdate,ie=Ae.needsUpdate,D=Ae.type;ct(),Ue.autoReset=O,Ae.enabled=j,Ae.autoUpdate=re,Ae.needsUpdate=ie,Ae.type=D}function Te(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function te(O){let j=O.target;j.removeEventListener("dispose",te),Me(j)}function Me(O){De(O),Ne.remove(O)}function De(O){let j=Ne.get(O).programs;j!==void 0&&(j.forEach(function(re){me.releaseProgram(re)}),O.isShaderMaterial&&me.releaseShaderCache(O))}this.renderBufferDirect=function(O,j,re,ie,D,W){j===null&&(j=Ee);let ee=D.isMesh&&D.matrixWorld.determinant()<0,ge=u_(O,j,re,ie,D);Le.setMaterial(ie,ee);let ce=re.index,Oe=1;if(ie.wireframe===!0){if(ce=ne.getWireframeAttribute(re),ce===void 0)return;Oe=2}let Ge=re.drawRange,Re=re.attributes.position,gt=Ge.start*Oe,_t=(Ge.start+Ge.count)*Oe;W!==null&&(gt=Math.max(gt,W.start*Oe),_t=Math.min(_t,(W.start+W.count)*Oe)),ce!==null?(gt=Math.max(gt,0),_t=Math.min(_t,ce.count)):Re!=null&&(gt=Math.max(gt,0),_t=Math.min(_t,Re.count));let $e=_t-gt;if($e<0||$e===1/0)return;we.setup(D,ie,ge,re,ce);let lt,Ct=nt;if(ce!==null&&(lt=L.get(ce),Ct=Xe,Ct.setIndex(lt)),D.isMesh)ie.wireframe===!0?(Le.setLineWidth(ie.wireframeLinewidth*q()),Ct.setMode(H.LINES)):Ct.setMode(H.TRIANGLES);else if(D.isLine){let je=ie.linewidth;je===void 0&&(je=1),Le.setLineWidth(je*q()),D.isLineSegments?Ct.setMode(H.LINES):D.isLineLoop?Ct.setMode(H.LINE_LOOP):Ct.setMode(H.LINE_STRIP)}else D.isPoints?Ct.setMode(H.POINTS):D.isSprite&&Ct.setMode(H.TRIANGLES);if(D.isBatchedMesh)Ct.renderMultiDraw(D._multiDrawStarts,D._multiDrawCounts,D._multiDrawCount);else if(D.isInstancedMesh)Ct.renderInstances(gt,$e,D.count);else if(re.isInstancedBufferGeometry){let je=re._maxInstanceCount!==void 0?re._maxInstanceCount:1/0,_i=Math.min(re.instanceCount,je);Ct.renderInstances(gt,$e,_i)}else Ct.render(gt,$e)};function wt(O,j,re){O.transparent===!0&&O.side===fs&&O.forceSinglePass===!1?(O.side=bi,O.needsUpdate=!0,Es(O,j,re),O.side=hs,O.needsUpdate=!0,Es(O,j,re),O.side=fs):Es(O,j,re)}this.compile=function(O,j,re=null){re===null&&(re=O),m=Ke.get(re),m.init(),_.push(m),re.traverseVisible(function(D){D.isLight&&D.layers.test(j.layers)&&(m.pushLight(D),D.castShadow&&m.pushShadow(D))}),O!==re&&O.traverseVisible(function(D){D.isLight&&D.layers.test(j.layers)&&(m.pushLight(D),D.castShadow&&m.pushShadow(D))}),m.setupLights(y._useLegacyLights);let ie=new Set;return O.traverse(function(D){let W=D.material;if(W)if(Array.isArray(W))for(let ee=0;ee<W.length;ee++){let ge=W[ee];wt(ge,re,D),ie.add(ge)}else wt(W,re,D),ie.add(W)}),_.pop(),m=null,ie},this.compileAsync=function(O,j,re=null){let ie=this.compile(O,j,re);return new Promise(D=>{function W(){if(ie.forEach(function(ee){Ne.get(ee).currentProgram.isReady()&&ie.delete(ee)}),ie.size===0){D(O);return}setTimeout(W,10)}_e.get("KHR_parallel_shader_compile")!==null?W():setTimeout(W,10)})};let kt=null;function Tr(O){kt&&kt(O)}function $r(){Or.stop()}function Ht(){Or.start()}let Or=new mC;Or.setAnimationLoop(Tr),typeof self<"u"&&Or.setContext(self),this.setAnimationLoop=function(O){kt=O,Je.setAnimationLoop(O),O===null?Or.stop():Or.start()},Je.addEventListener("sessionstart",$r),Je.addEventListener("sessionend",Ht),this.render=function(O,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Je.enabled===!0&&Je.isPresenting===!0&&(Je.cameraAutoUpdate===!0&&Je.updateCamera(j),j=Je.getCamera()),O.isScene===!0&&O.onBeforeRender(y,O,j,w),m=Ke.get(O,_.length),m.init(),_.push(m),ve.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),Q.setFromProjectionMatrix(ve),K=this.localClippingEnabled,V=Se.init(this.clippingPlanes,K),g=et.get(O,v.length),g.init(),v.push(g),hi(O,j,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(z,k),this.info.render.frame++,V===!0&&Se.beginShadows();let re=m.state.shadowsArray;if(Ae.render(re,O,j),V===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Je.enabled===!1||Je.isPresenting===!1||Je.hasDepthSensing()===!1)&&at.render(g,O),m.setupLights(y._useLegacyLights),j.isArrayCamera){let ie=j.cameras;for(let D=0,W=ie.length;D<W;D++){let ee=ie[D];tp(g,O,ee,ee.viewport)}}else tp(g,O,j);w!==null&&(Ve.updateMultisampleRenderTarget(w),Ve.updateRenderTargetMipmap(w)),O.isScene===!0&&O.onAfterRender(y,O,j),we.resetDefaultState(),T=-1,C=null,_.pop(),_.length>0?m=_[_.length-1]:m=null,v.pop(),v.length>0?g=v[v.length-1]:g=null};function hi(O,j,re,ie){if(O.visible===!1)return;if(O.layers.test(j.layers)){if(O.isGroup)re=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(j);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||Q.intersectsSprite(O)){ie&&se.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ve);let ee=le.update(O),ge=O.material;ge.visible&&g.push(O,ee,ge,re,se.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||Q.intersectsObject(O))){let ee=le.update(O),ge=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),se.copy(O.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),se.copy(ee.boundingSphere.center)),se.applyMatrix4(O.matrixWorld).applyMatrix4(ve)),Array.isArray(ge)){let ce=ee.groups;for(let Oe=0,Ge=ce.length;Oe<Ge;Oe++){let Re=ce[Oe],gt=ge[Re.materialIndex];gt&&gt.visible&&g.push(O,ee,gt,re,se.z,Re)}}else ge.visible&&g.push(O,ee,ge,re,se.z,null)}}let W=O.children;for(let ee=0,ge=W.length;ee<ge;ee++)hi(W[ee],j,re,ie)}function tp(O,j,re,ie){let D=O.opaque,W=O.transmissive,ee=O.transparent;m.setupLightsView(re),V===!0&&Se.setGlobalState(y.clippingPlanes,re),W.length>0&&l_(D,W,j,re),ie&&Le.viewport(b.copy(ie)),D.length>0&&gl(D,j,re),W.length>0&&gl(W,j,re),ee.length>0&&gl(ee,j,re),Le.buffers.depth.setTest(!0),Le.buffers.depth.setMask(!0),Le.buffers.color.setMask(!0),Le.setPolygonOffset(!1)}function l_(O,j,re,ie){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;let W=xe.isWebGL2;ae===null&&(ae=new ko(1,1,{generateMipmaps:!0,type:_e.has("EXT_color_buffer_half_float")?Lc:ps,minFilter:Xl,samples:W?4:0})),y.getDrawingBufferSize(ue),W?ae.setSize(ue.x,ue.y):ae.setSize(KS(ue.x),KS(ue.y));let ee=y.getRenderTarget();y.setRenderTarget(ae),y.getClearColor(R),A=y.getClearAlpha(),A<1&&y.setClearColor(16777215,.5),y.clear();let ge=y.toneMapping;y.toneMapping=tl,gl(O,re,ie),Ve.updateMultisampleRenderTarget(ae),Ve.updateRenderTargetMipmap(ae);let ce=!1;for(let Oe=0,Ge=j.length;Oe<Ge;Oe++){let Re=j[Oe],gt=Re.object,_t=Re.geometry,$e=Re.material,lt=Re.group;if($e.side===fs&&gt.layers.test(ie.layers)){let Ct=$e.side;$e.side=bi,$e.needsUpdate=!0,rp(gt,re,ie,_t,$e,lt),$e.side=Ct,$e.needsUpdate=!0,ce=!0}}ce===!0&&(Ve.updateMultisampleRenderTarget(ae),Ve.updateRenderTargetMipmap(ae)),y.setRenderTarget(ee),y.setClearColor(R,A),y.toneMapping=ge}function gl(O,j,re){let ie=j.isScene===!0?j.overrideMaterial:null;for(let D=0,W=O.length;D<W;D++){let ee=O[D],ge=ee.object,ce=ee.geometry,Oe=ie===null?ee.material:ie,Ge=ee.group;ge.layers.test(re.layers)&&rp(ge,j,re,ce,Oe,Ge)}}function rp(O,j,re,ie,D,W){O.onBeforeRender(y,j,re,ie,D,W),O.modelViewMatrix.multiplyMatrices(re.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),D.onBeforeRender(y,j,re,ie,O,W),D.transparent===!0&&D.side===fs&&D.forceSinglePass===!1?(D.side=bi,D.needsUpdate=!0,y.renderBufferDirect(re,j,ie,D,O,W),D.side=hs,D.needsUpdate=!0,y.renderBufferDirect(re,j,ie,D,O,W),D.side=fs):y.renderBufferDirect(re,j,ie,D,O,W),O.onAfterRender(y,j,re,ie,D,W)}function Es(O,j,re){j.isScene!==!0&&(j=Ee);let ie=Ne.get(O),D=m.state.lights,W=m.state.shadowsArray,ee=D.state.version,ge=me.getParameters(O,D.state,W,j,re),ce=me.getProgramCacheKey(ge),Oe=ie.programs;ie.environment=O.isMeshStandardMaterial?j.environment:null,ie.fog=j.fog,ie.envMap=(O.isMeshStandardMaterial?F:dt).get(O.envMap||ie.environment),ie.envMapRotation=ie.environment!==null&&O.envMap===null?j.environmentRotation:O.envMapRotation,Oe===void 0&&(O.addEventListener("dispose",te),Oe=new Map,ie.programs=Oe);let Ge=Oe.get(ce);if(Ge!==void 0){if(ie.currentProgram===Ge&&ie.lightsStateVersion===ee)return oh(O,ge),Ge}else ge.uniforms=me.getUniforms(O),O.onBuild(re,ge,y),O.onBeforeCompile(ge,y),Ge=me.acquireProgram(ge,ce),Oe.set(ce,Ge),ie.uniforms=ge.uniforms;let Re=ie.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(Re.clippingPlanes=Se.uniform),oh(O,ge),ie.needsLights=h_(O),ie.lightsStateVersion=ee,ie.needsLights&&(Re.ambientLightColor.value=D.state.ambient,Re.lightProbe.value=D.state.probe,Re.directionalLights.value=D.state.directional,Re.directionalLightShadows.value=D.state.directionalShadow,Re.spotLights.value=D.state.spot,Re.spotLightShadows.value=D.state.spotShadow,Re.rectAreaLights.value=D.state.rectArea,Re.ltc_1.value=D.state.rectAreaLTC1,Re.ltc_2.value=D.state.rectAreaLTC2,Re.pointLights.value=D.state.point,Re.pointLightShadows.value=D.state.pointShadow,Re.hemisphereLights.value=D.state.hemi,Re.directionalShadowMap.value=D.state.directionalShadowMap,Re.directionalShadowMatrix.value=D.state.directionalShadowMatrix,Re.spotShadowMap.value=D.state.spotShadowMap,Re.spotLightMatrix.value=D.state.spotLightMatrix,Re.spotLightMap.value=D.state.spotLightMap,Re.pointShadowMap.value=D.state.pointShadowMap,Re.pointShadowMatrix.value=D.state.pointShadowMatrix),ie.currentProgram=Ge,ie.uniformsList=null,Ge}function ip(O){if(O.uniformsList===null){let j=O.currentProgram.getUniforms();O.uniformsList=Ef.seqWithValue(j.seq,O.uniforms)}return O.uniformsList}function oh(O,j){let re=Ne.get(O);re.outputColorSpace=j.outputColorSpace,re.batching=j.batching,re.instancing=j.instancing,re.instancingColor=j.instancingColor,re.instancingMorph=j.instancingMorph,re.skinning=j.skinning,re.morphTargets=j.morphTargets,re.morphNormals=j.morphNormals,re.morphColors=j.morphColors,re.morphTargetsCount=j.morphTargetsCount,re.numClippingPlanes=j.numClippingPlanes,re.numIntersection=j.numClipIntersection,re.vertexAlphas=j.vertexAlphas,re.vertexTangents=j.vertexTangents,re.toneMapping=j.toneMapping}function u_(O,j,re,ie,D){j.isScene!==!0&&(j=Ee),Ve.resetTextureUnits();let W=j.fog,ee=ie.isMeshStandardMaterial?j.environment:null,ge=w===null?y.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:Oo,ce=(ie.isMeshStandardMaterial?F:dt).get(ie.envMap||ee),Oe=ie.vertexColors===!0&&!!re.attributes.color&&re.attributes.color.itemSize===4,Ge=!!re.attributes.tangent&&(!!ie.normalMap||ie.anisotropy>0),Re=!!re.morphAttributes.position,gt=!!re.morphAttributes.normal,_t=!!re.morphAttributes.color,$e=tl;ie.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&($e=y.toneMapping);let lt=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,Ct=lt!==void 0?lt.length:0,je=Ne.get(ie),_i=m.state.lights;if(V===!0&&(K===!0||O!==C)){let Qr=O===C&&ie.id===T;Se.setState(ie,O,Qr)}let Ft=!1;ie.version===je.__version?(je.needsLights&&je.lightsStateVersion!==_i.state.version||je.outputColorSpace!==ge||D.isBatchedMesh&&je.batching===!1||!D.isBatchedMesh&&je.batching===!0||D.isInstancedMesh&&je.instancing===!1||!D.isInstancedMesh&&je.instancing===!0||D.isSkinnedMesh&&je.skinning===!1||!D.isSkinnedMesh&&je.skinning===!0||D.isInstancedMesh&&je.instancingColor===!0&&D.instanceColor===null||D.isInstancedMesh&&je.instancingColor===!1&&D.instanceColor!==null||D.isInstancedMesh&&je.instancingMorph===!0&&D.morphTexture===null||D.isInstancedMesh&&je.instancingMorph===!1&&D.morphTexture!==null||je.envMap!==ce||ie.fog===!0&&je.fog!==W||je.numClippingPlanes!==void 0&&(je.numClippingPlanes!==Se.numPlanes||je.numIntersection!==Se.numIntersection)||je.vertexAlphas!==Oe||je.vertexTangents!==Ge||je.morphTargets!==Re||je.morphNormals!==gt||je.morphColors!==_t||je.toneMapping!==$e||xe.isWebGL2===!0&&je.morphTargetsCount!==Ct)&&(Ft=!0):(Ft=!0,je.__version=ie.version);let Nr=je.currentProgram;Ft===!0&&(Nr=Es(ie,j,D));let Yi=!1,Et=!1,Ei=!1,cr=Nr.getUniforms(),hn=je.uniforms;if(Le.useProgram(Nr.program)&&(Yi=!0,Et=!0,Ei=!0),ie.id!==T&&(T=ie.id,Et=!0),Yi||C!==O){cr.setValue(H,"projectionMatrix",O.projectionMatrix),cr.setValue(H,"viewMatrix",O.matrixWorldInverse);let Qr=cr.map.cameraPosition;Qr!==void 0&&Qr.setValue(H,se.setFromMatrixPosition(O.matrixWorld)),xe.logarithmicDepthBuffer&&cr.setValue(H,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&cr.setValue(H,"isOrthographic",O.isOrthographicCamera===!0),C!==O&&(C=O,Et=!0,Ei=!0)}if(D.isSkinnedMesh){cr.setOptional(H,D,"bindMatrix"),cr.setOptional(H,D,"bindMatrixInverse");let Qr=D.skeleton;Qr&&(xe.floatVertexTextures?(Qr.boneTexture===null&&Qr.computeBoneTexture(),cr.setValue(H,"boneTexture",Qr.boneTexture,Ve)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}D.isBatchedMesh&&(cr.setOptional(H,D,"batchingTexture"),cr.setValue(H,"batchingTexture",D._matricesTexture,Ve));let Ju=re.morphAttributes;if((Ju.position!==void 0||Ju.normal!==void 0||Ju.color!==void 0&&xe.isWebGL2===!0)&&$.update(D,re,Nr),(Et||je.receiveShadow!==D.receiveShadow)&&(je.receiveShadow=D.receiveShadow,cr.setValue(H,"receiveShadow",D.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(hn.envMap.value=ce,hn.flipEnvMap.value=ce.isCubeTexture&&ce.isRenderTargetTexture===!1?-1:1),Et&&(cr.setValue(H,"toneMappingExposure",y.toneMappingExposure),je.needsLights&&c_(hn,Ei),W&&ie.fog===!0&&fe.refreshFogUniforms(hn,W),fe.refreshMaterialUniforms(hn,ie,B,U,ae),Ef.upload(H,ip(je),hn,Ve)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(Ef.upload(H,ip(je),hn,Ve),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&cr.setValue(H,"center",D.center),cr.setValue(H,"modelViewMatrix",D.modelViewMatrix),cr.setValue(H,"normalMatrix",D.normalMatrix),cr.setValue(H,"modelMatrix",D.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){let Qr=ie.uniformsGroups;for(let $u=0,np=Qr.length;$u<np;$u++)if(xe.isWebGL2){let ap=Qr[$u];Ie.update(ap,Nr),Ie.bind(ap,Nr)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Nr}function c_(O,j){O.ambientLightColor.needsUpdate=j,O.lightProbe.needsUpdate=j,O.directionalLights.needsUpdate=j,O.directionalLightShadows.needsUpdate=j,O.pointLights.needsUpdate=j,O.pointLightShadows.needsUpdate=j,O.spotLights.needsUpdate=j,O.spotLightShadows.needsUpdate=j,O.rectAreaLights.needsUpdate=j,O.hemisphereLights.needsUpdate=j}function h_(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(O,j,re){Ne.get(O.texture).__webglTexture=j,Ne.get(O.depthTexture).__webglTexture=re;let ie=Ne.get(O);ie.__hasExternalTextures=!0,ie.__autoAllocateDepthBuffer=re===void 0,ie.__autoAllocateDepthBuffer||_e.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ie.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(O,j){let re=Ne.get(O);re.__webglFramebuffer=j,re.__useDefaultFramebuffer=j===void 0},this.setRenderTarget=function(O,j=0,re=0){w=O,M=j,S=re;let ie=!0,D=null,W=!1,ee=!1;if(O){let ce=Ne.get(O);ce.__useDefaultFramebuffer!==void 0?(Le.bindFramebuffer(H.FRAMEBUFFER,null),ie=!1):ce.__webglFramebuffer===void 0?Ve.setupRenderTarget(O):ce.__hasExternalTextures&&Ve.rebindTextures(O,Ne.get(O.texture).__webglTexture,Ne.get(O.depthTexture).__webglTexture);let Oe=O.texture;(Oe.isData3DTexture||Oe.isDataArrayTexture||Oe.isCompressedArrayTexture)&&(ee=!0);let Ge=Ne.get(O).__webglFramebuffer;O.isWebGLCubeRenderTarget?(Array.isArray(Ge[j])?D=Ge[j][re]:D=Ge[j],W=!0):xe.isWebGL2&&O.samples>0&&Ve.useMultisampledRTT(O)===!1?D=Ne.get(O).__webglMultisampledFramebuffer:Array.isArray(Ge)?D=Ge[re]:D=Ge,b.copy(O.viewport),E.copy(O.scissor),I=O.scissorTest}else b.copy(G).multiplyScalar(B).floor(),E.copy(Y).multiplyScalar(B).floor(),I=J;if(Le.bindFramebuffer(H.FRAMEBUFFER,D)&&xe.drawBuffers&&ie&&Le.drawBuffers(O,D),Le.viewport(b),Le.scissor(E),Le.setScissorTest(I),W){let ce=Ne.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce.__webglTexture,re)}else if(ee){let ce=Ne.get(O.texture),Oe=j||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,ce.__webglTexture,re||0,Oe)}T=-1},this.readRenderTargetPixels=function(O,j,re,ie,D,W,ee){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Ne.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&ee!==void 0&&(ge=ge[ee]),ge){Le.bindFramebuffer(H.FRAMEBUFFER,ge);try{let ce=O.texture,Oe=ce.format,Ge=ce.type;if(Oe!==Un&&Fe.convert(Oe)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Re=Ge===Lc&&(_e.has("EXT_color_buffer_half_float")||xe.isWebGL2&&_e.has("EXT_color_buffer_float"));if(Ge!==ps&&Fe.convert(Ge)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ge===No&&(xe.isWebGL2||_e.has("OES_texture_float")||_e.has("WEBGL_color_buffer_float")))&&!Re){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=O.width-ie&&re>=0&&re<=O.height-D&&H.readPixels(j,re,ie,D,Fe.convert(Oe),Fe.convert(Ge),W)}finally{let ce=w!==null?Ne.get(w).__webglFramebuffer:null;Le.bindFramebuffer(H.FRAMEBUFFER,ce)}}},this.copyFramebufferToTexture=function(O,j,re=0){let ie=Math.pow(2,-re),D=Math.floor(j.image.width*ie),W=Math.floor(j.image.height*ie);Ve.setTexture2D(j,0),H.copyTexSubImage2D(H.TEXTURE_2D,re,0,0,O.x,O.y,D,W),Le.unbindTexture()},this.copyTextureToTexture=function(O,j,re,ie=0){let D=j.image.width,W=j.image.height,ee=Fe.convert(re.format),ge=Fe.convert(re.type);Ve.setTexture2D(re,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,re.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,re.unpackAlignment),j.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,D,W,ee,ge,j.image.data):j.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,j.mipmaps[0].width,j.mipmaps[0].height,ee,j.mipmaps[0].data):H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,ee,ge,j.image),ie===0&&re.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),Le.unbindTexture()},this.copyTextureToTexture3D=function(O,j,re,ie,D=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let W=Math.round(O.max.x-O.min.x),ee=Math.round(O.max.y-O.min.y),ge=O.max.z-O.min.z+1,ce=Fe.convert(ie.format),Oe=Fe.convert(ie.type),Ge;if(ie.isData3DTexture)Ve.setTexture3D(ie,0),Ge=H.TEXTURE_3D;else if(ie.isDataArrayTexture||ie.isCompressedArrayTexture)Ve.setTexture2DArray(ie,0),Ge=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,ie.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,ie.unpackAlignment);let Re=H.getParameter(H.UNPACK_ROW_LENGTH),gt=H.getParameter(H.UNPACK_IMAGE_HEIGHT),_t=H.getParameter(H.UNPACK_SKIP_PIXELS),$e=H.getParameter(H.UNPACK_SKIP_ROWS),lt=H.getParameter(H.UNPACK_SKIP_IMAGES),Ct=re.isCompressedTexture?re.mipmaps[D]:re.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,Ct.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,Ct.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,O.min.x),H.pixelStorei(H.UNPACK_SKIP_ROWS,O.min.y),H.pixelStorei(H.UNPACK_SKIP_IMAGES,O.min.z),re.isDataTexture||re.isData3DTexture?H.texSubImage3D(Ge,D,j.x,j.y,j.z,W,ee,ge,ce,Oe,Ct.data):ie.isCompressedArrayTexture?H.compressedTexSubImage3D(Ge,D,j.x,j.y,j.z,W,ee,ge,ce,Ct.data):H.texSubImage3D(Ge,D,j.x,j.y,j.z,W,ee,ge,ce,Oe,Ct),H.pixelStorei(H.UNPACK_ROW_LENGTH,Re),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,gt),H.pixelStorei(H.UNPACK_SKIP_PIXELS,_t),H.pixelStorei(H.UNPACK_SKIP_ROWS,$e),H.pixelStorei(H.UNPACK_SKIP_IMAGES,lt),D===0&&ie.generateMipmaps&&H.generateMipmap(Ge),Le.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?Ve.setTextureCube(O,0):O.isData3DTexture?Ve.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?Ve.setTexture2DArray(O,0):Ve.setTexture2D(O,0),Le.unbindTexture()},this.resetState=function(){M=0,S=0,w=null,Le.reset(),we.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return zo}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===Jg?"display-p3":"srgb",t.unpackColorSpace=Lr.workingColorSpace===Ad?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}};var iM=class extends nn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new jl,this.environmentRotation=new jl,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),t.object.environmentRotation=this.environmentRotation.toArray(),t}};var TC=class r extends Vo{constructor(e=1,t=32,i=0,n=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},t=Math.max(3,t);let a=[],o=[],s=[],l=[],u=new be,c=new Qt;o.push(0,0,0),s.push(0,0,1),l.push(.5,.5);for(let h=0,f=3;h<=t;h++,f+=3){let p=i+h/t*n;u.x=e*Math.cos(p),u.y=e*Math.sin(p),o.push(u.x,u.y,u.z),s.push(0,0,1),c.x=(o[f]/e+1)/2,c.y=(o[f+1]/e+1)/2,l.push(c.x,c.y)}for(let h=1;h<=t;h++)a.push(h,h+1,0);this.setIndex(a),this.setAttribute("position",new ia(o,3)),this.setAttribute("normal",new ia(s,3)),this.setAttribute("uv",new ia(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new r(e.radius,e.segments,e.thetaStart,e.thetaLength)}};var Iy=class extends nn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new or(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}};var nM=class extends Iy{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(nn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new or(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}};var SF=new Zr,Gie=new be,Hie=new be,EC=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Qt(512,512),this.map=null,this.mapPass=null,this.matrix=new Zr,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Tf,this._frameExtents=new Qt(1,1),this._viewportCount=1,this._viewports=[new li(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;Gie.setFromMatrixPosition(e.matrixWorld),t.position.copy(Gie),Hie.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Hie),t.updateMatrixWorld(),SF.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(SF),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(SF)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}};var AC=class extends EC{constructor(){super(new Ey(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}};var aM=class extends Iy{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(nn.DEFAULT_UP),this.updateMatrix(),this.target=new nn,this.shadow=new AC}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}};var oM=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Wie(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=Wie();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function Wie(){return(typeof performance>"u"?Date:performance).now()}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:VS}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=VS);var VB="162";var _Ae=0,Xie=1,xAe=2;var Iae=1,SAe=2,Xc=3,Ff=0,Xo=1,qc=2,Uf=0,t0=1,Yie=2,qie=3,Zie=4,MAe=5,qd=100,bAe=101,wAe=102,jie=103,Kie=104,TAe=200,EAe=201,AAe=202,CAe=203,nB=204,aB=205,RAe=206,LAe=207,DAe=208,PAe=209,IAe=210,NAe=211,UAe=212,OAe=213,zAe=214,FAe=0,BAe=1,kAe=2,eR=3,VAe=4,GAe=5,HAe=6,WAe=7,NR=0,XAe=1,YAe=2,Of=0,qAe=1,ZAe=2,jAe=3,KAe=4,JAe=5,$Ae=6,QAe=7,Jie="attached",eCe="detached",$ie=300,n0=301,a0=302,vM=303,oB=304,UR=306,o0=1e3,Ho=1001,sB=1002,On=1003,Qie=1004;var sM=1005;var Go=1006,MF=1007;var jd=1008;var zf=1009,tCe=1010,rCe=1011,GB=1012,Nae=1013,Nf=1014,Wu=1015,gM=1016,Uae=1017,Oae=1018,Kd=1020,iCe=1021,sl=1023,nCe=1024,aCe=1025,Jd=1026,s0=1027,oCe=1028,zae=1029,sCe=1030,Fae=1031,Bae=1033,bF=33776,wF=33777,TF=33778,EF=33779,ene=35840,tne=35841,rne=35842,ine=35843,kae=36196,nne=37492,ane=37496,one=37808,sne=37809,lne=37810,une=37811,cne=37812,hne=37813,fne=37814,pne=37815,dne=37816,mne=37817,vne=37818,gne=37819,yne=37820,_ne=37821,AF=36492,xne=36494,Sne=36495,lCe=36283,Mne=36284,bne=36285,wne=36286;var tR=2300,rR=2301,CF=2302,Tne=2400,Ene=2401,Ane=2402,uCe=2500;var cCe=3200,hCe=3201,HB=0,fCe=1,If="",Pa="srgb",Yf="srgb-linear",WB="display-p3",OR="display-p3-linear",iR="linear",ui="srgb",nR="rec709",aR="p3";var Ny=7680;var Cne=519,pCe=512,dCe=513,mCe=514,Vae=515,vCe=516,gCe=517,yCe=518,_Ce=519,Rne=35044;var Lne="300 es",lB=1035,Zc=2e3,oR=2001,Bf=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let n=i.slice(0);for(let a=0,o=n.length;a<o;a++)n[a].call(this,e);e.target=null}}},aa=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Dne=1234567,pM=Math.PI/180,l0=180/Math.PI;function qf(){let r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(aa[r&255]+aa[r>>8&255]+aa[r>>16&255]+aa[r>>24&255]+"-"+aa[e&255]+aa[e>>8&255]+"-"+aa[e>>16&15|64]+aa[e>>24&255]+"-"+aa[t&63|128]+aa[t>>8&255]+"-"+aa[t>>16&255]+aa[t>>24&255]+aa[i&255]+aa[i>>8&255]+aa[i>>16&255]+aa[i>>24&255]).toLowerCase()}function zn(r,e,t){return Math.max(e,Math.min(t,r))}function XB(r,e){return(r%e+e)%e}function xCe(r,e,t,i,n){return i+(r-e)*(n-i)/(t-e)}function SCe(r,e,t){return r!==e?(t-r)/(e-r):0}function dM(r,e,t){return(1-t)*r+t*e}function MCe(r,e,t,i){return dM(r,e,1-Math.exp(-t*i))}function bCe(r,e=1){return e-Math.abs(XB(r,e*2)-e)}function wCe(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function TCe(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function ECe(r,e){return r+Math.floor(Math.random()*(e-r+1))}function ACe(r,e){return r+Math.random()*(e-r)}function CCe(r){return r*(.5-Math.random())}function RCe(r){r!==void 0&&(Dne=r);let e=Dne+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function LCe(r){return r*pM}function DCe(r){return r*l0}function uB(r){return(r&r-1)===0&&r!==0}function PCe(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function sR(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function ICe(r,e,t,i,n){let a=Math.cos,o=Math.sin,s=a(t/2),l=o(t/2),u=a((e+i)/2),c=o((e+i)/2),h=a((e-i)/2),f=o((e-i)/2),p=a((i-e)/2),d=o((i-e)/2);switch(n){case"XYX":r.set(s*c,l*h,l*f,s*u);break;case"YZY":r.set(l*f,s*c,l*h,s*u);break;case"ZXZ":r.set(l*h,l*f,s*c,s*u);break;case"XZX":r.set(s*c,l*d,l*p,s*u);break;case"YXY":r.set(l*p,s*c,l*d,s*u);break;case"ZYZ":r.set(l*d,l*p,s*c,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function Ky(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function La(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var la={DEG2RAD:pM,RAD2DEG:l0,generateUUID:qf,clamp:zn,euclideanModulo:XB,mapLinear:xCe,inverseLerp:SCe,lerp:dM,damp:MCe,pingpong:bCe,smoothstep:wCe,smootherstep:TCe,randInt:ECe,randFloat:ACe,randFloatSpread:CCe,seededRandom:RCe,degToRad:LCe,radToDeg:DCe,isPowerOfTwo:uB,ceilPowerOfTwo:PCe,floorPowerOfTwo:sR,setQuaternionFromProperEuler:ICe,normalize:La,denormalize:Ky},xr=class r{constructor(e=0,t=0){r.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(zn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),a=this.x-e.x,o=this.y-e.y;return this.x=a*i-o*n+e.x,this.y=a*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},vr=class r{constructor(e,t,i,n,a,o,s,l,u){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u)}set(e,t,i,n,a,o,s,l,u){let c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=a,c[5]=l,c[6]=i,c[7]=o,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[3],l=i[6],u=i[1],c=i[4],h=i[7],f=i[2],p=i[5],d=i[8],g=n[0],m=n[3],v=n[6],_=n[1],y=n[4],x=n[7],M=n[2],S=n[5],w=n[8];return a[0]=o*g+s*_+l*M,a[3]=o*m+s*y+l*S,a[6]=o*v+s*x+l*w,a[1]=u*g+c*_+h*M,a[4]=u*m+c*y+h*S,a[7]=u*v+c*x+h*w,a[2]=f*g+p*_+d*M,a[5]=f*m+p*y+d*S,a[8]=f*v+p*x+d*w,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t*o*c-t*s*u-i*a*c+i*s*l+n*a*u-n*o*l}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,f=s*l-c*a,p=u*a-o*l,d=t*h+i*f+n*p;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);let g=1/d;return e[0]=h*g,e[1]=(n*u-c*i)*g,e[2]=(s*i-n*o)*g,e[3]=f*g,e[4]=(c*t-n*l)*g,e[5]=(n*a-s*t)*g,e[6]=p*g,e[7]=(i*l-u*t)*g,e[8]=(o*t-i*a)*g,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,a,o,s){let l=Math.cos(a),u=Math.sin(a);return this.set(i*l,i*u,-i*(l*o+u*s)+o+e,-n*u,n*l,-n*(-u*o+l*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(RF.makeScale(e,t)),this}rotate(e){return this.premultiply(RF.makeRotation(-e)),this}translate(e,t){return this.premultiply(RF.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},RF=new vr;function Gae(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function yM(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function NCe(){let r=yM("canvas");return r.style.display="block",r}var Pne={};function UCe(r){r in Pne||(Pne[r]=!0,console.warn(r))}var Ine=new vr().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Nne=new vr().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),CC={[Yf]:{transfer:iR,primaries:nR,toReference:r=>r,fromReference:r=>r},[Pa]:{transfer:ui,primaries:nR,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[OR]:{transfer:iR,primaries:aR,toReference:r=>r.applyMatrix3(Nne),fromReference:r=>r.applyMatrix3(Ine)},[WB]:{transfer:ui,primaries:aR,toReference:r=>r.convertSRGBToLinear().applyMatrix3(Nne),fromReference:r=>r.applyMatrix3(Ine).convertLinearToSRGB()}},OCe=new Set([Yf,OR]),ti={enabled:!0,_workingColorSpace:Yf,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!OCe.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;let i=CC[e].toReference,n=CC[t].fromReference;return n(i(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return CC[r].primaries},getTransfer:function(r){return r===If?iR:CC[r].transfer}};function r0(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function LF(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var Uy,lR=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Uy===void 0&&(Uy=yM("canvas")),Uy.width=e.width,Uy.height=e.height;let i=Uy.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Uy}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=yM("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),a=n.data;for(let o=0;o<a.length;o++)a[o]=r0(a[o]/255)*255;return i.putImageData(n,0,0),t}else if(e.data){let t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(r0(t[i]/255)*255):t[i]=r0(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},zCe=0,uR=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:zCe++}),this.uuid=qf(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let i={uuid:this.uuid,url:""},n=this.data;if(n!==null){let a;if(Array.isArray(n)){a=[];for(let o=0,s=n.length;o<s;o++)n[o].isDataTexture?a.push(DF(n[o].image)):a.push(DF(n[o]))}else a=DF(n);i.url=a}return t||(e.images[this.uuid]=i),i}};function DF(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?lR.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var FCe=0,_s=(()=>{class r extends Bf{constructor(t=r.DEFAULT_IMAGE,i=r.DEFAULT_MAPPING,n=Ho,a=Ho,o=Go,s=jd,l=sl,u=zf,c=r.DEFAULT_ANISOTROPY,h=If){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:FCe++}),this.uuid=qf(),this.name="",this.source=new uR(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=n,this.wrapT=a,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=u,this.offset=new xr(0,0),this.repeat=new xr(1,1),this.center=new xr(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new vr,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,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.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),i||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==$ie)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case o0:t.x=t.x-Math.floor(t.x);break;case Ho:t.x=t.x<0?0:1;break;case sB:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case o0:t.y=t.y-Math.floor(t.y);break;case Ho:t.y=t.y<0?0:1;break;case sB:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}}return r.DEFAULT_IMAGE=null,r.DEFAULT_MAPPING=$ie,r.DEFAULT_ANISOTROPY=1,r})(),Ur=class r{constructor(e=0,t=0,i=0,n=1){r.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*a,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*a,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*a,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*a,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,a,l=e.elements,u=l[0],c=l[4],h=l[8],f=l[1],p=l[5],d=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(c-f)<.01&&Math.abs(h-g)<.01&&Math.abs(d-m)<.01){if(Math.abs(c+f)<.1&&Math.abs(h+g)<.1&&Math.abs(d+m)<.1&&Math.abs(u+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let y=(u+1)/2,x=(p+1)/2,M=(v+1)/2,S=(c+f)/4,w=(h+g)/4,T=(d+m)/4;return y>x&&y>M?y<.01?(i=0,n=.707106781,a=.707106781):(i=Math.sqrt(y),n=S/i,a=w/i):x>M?x<.01?(i=.707106781,n=0,a=.707106781):(n=Math.sqrt(x),i=S/n,a=T/n):M<.01?(i=.707106781,n=.707106781,a=0):(a=Math.sqrt(M),i=w/a,n=T/a),this.set(i,n,a,t),this}let _=Math.sqrt((m-d)*(m-d)+(h-g)*(h-g)+(f-c)*(f-c));return Math.abs(_)<.001&&(_=1),this.x=(m-d)/_,this.y=(h-g)/_,this.z=(f-c)/_,this.w=Math.acos((u+p+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){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(){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(){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(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},cB=class extends Bf{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ur(0,0,e,t),this.scissorTest=!1,this.viewport=new Ur(0,0,e,t);let n={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Go,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let a=new _s(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);a.flipY=!1,a.generateMipmaps=i.generateMipmaps,a.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let s=0;s<o;s++)this.textures[s]=a.clone(),this.textures[s].isRenderTargetTexture=!0;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,a=this.textures.length;n<a;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,n=e.textures.length;i<n;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new uR(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Kc=class extends cB{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}},cR=class extends _s{constructor(e=null,t=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=On,this.minFilter=On,this.wrapR=Ho,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var hB=class extends _s{constructor(e=null,t=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=On,this.minFilter=On,this.wrapR=Ho,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var kn=class{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,a,o,s){let l=i[n+0],u=i[n+1],c=i[n+2],h=i[n+3],f=a[o+0],p=a[o+1],d=a[o+2],g=a[o+3];if(s===0){e[t+0]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h;return}if(s===1){e[t+0]=f,e[t+1]=p,e[t+2]=d,e[t+3]=g;return}if(h!==g||l!==f||u!==p||c!==d){let m=1-s,v=l*f+u*p+c*d+h*g,_=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){let M=Math.sqrt(y),S=Math.atan2(M,v*_);m=Math.sin(m*S)/M,s=Math.sin(s*S)/M}let x=s*_;if(l=l*m+f*x,u=u*m+p*x,c=c*m+d*x,h=h*m+g*x,m===1-s){let M=1/Math.sqrt(l*l+u*u+c*c+h*h);l*=M,u*=M,c*=M,h*=M}}e[t]=l,e[t+1]=u,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,n,a,o){let s=i[n],l=i[n+1],u=i[n+2],c=i[n+3],h=a[o],f=a[o+1],p=a[o+2],d=a[o+3];return e[t]=s*d+c*h+l*p-u*f,e[t+1]=l*d+c*f+u*h-s*p,e[t+2]=u*d+c*p+s*f-l*h,e[t+3]=c*d-s*h-l*f-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let i=e._x,n=e._y,a=e._z,o=e._order,s=Math.cos,l=Math.sin,u=s(i/2),c=s(n/2),h=s(a/2),f=l(i/2),p=l(n/2),d=l(a/2);switch(o){case"XYZ":this._x=f*c*h+u*p*d,this._y=u*p*h-f*c*d,this._z=u*c*d+f*p*h,this._w=u*c*h-f*p*d;break;case"YXZ":this._x=f*c*h+u*p*d,this._y=u*p*h-f*c*d,this._z=u*c*d-f*p*h,this._w=u*c*h+f*p*d;break;case"ZXY":this._x=f*c*h-u*p*d,this._y=u*p*h+f*c*d,this._z=u*c*d+f*p*h,this._w=u*c*h-f*p*d;break;case"ZYX":this._x=f*c*h-u*p*d,this._y=u*p*h+f*c*d,this._z=u*c*d-f*p*h,this._w=u*c*h+f*p*d;break;case"YZX":this._x=f*c*h+u*p*d,this._y=u*p*h+f*c*d,this._z=u*c*d-f*p*h,this._w=u*c*h-f*p*d;break;case"XZY":this._x=f*c*h-u*p*d,this._y=u*p*h-f*c*d,this._z=u*c*d+f*p*h,this._w=u*c*h+f*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],a=t[8],o=t[1],s=t[5],l=t[9],u=t[2],c=t[6],h=t[10],f=i+s+h;if(f>0){let p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(c-l)*p,this._y=(a-u)*p,this._z=(o-n)*p}else if(i>s&&i>h){let p=2*Math.sqrt(1+i-s-h);this._w=(c-l)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(a+u)/p}else if(s>h){let p=2*Math.sqrt(1+s-i-h);this._w=(a-u)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(l+c)/p}else{let p=2*Math.sqrt(1+h-i-s);this._w=(o-n)/p,this._x=(a+u)/p,this._y=(l+c)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(zn(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,a=e._z,o=e._w,s=t._x,l=t._y,u=t._z,c=t._w;return this._x=i*c+o*s+n*u-a*l,this._y=n*c+o*l+a*s-i*u,this._z=a*c+o*u+i*l-n*s,this._w=o*c-i*s-n*l-a*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,n=this._y,a=this._z,o=this._w,s=o*e._w+i*e._x+n*e._y+a*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=n,this._z=a,this;let l=1-s*s;if(l<=Number.EPSILON){let p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*a+t*this._z,this.normalize(),this}let u=Math.sqrt(l),c=Math.atan2(u,s),h=Math.sin((1-t)*c)/u,f=Math.sin(t*c)/u;return this._w=o*h+this._w*f,this._x=i*h+this._x*f,this._y=n*h+this._y*f,this._z=a*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},ye=class r{constructor(e=0,t=0,i=0){r.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Une.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Une.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*n,this.y=a[1]*t+a[4]*i+a[7]*n,this.z=a[2]*t+a[5]*i+a[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,a=e.elements,o=1/(a[3]*t+a[7]*i+a[11]*n+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*n+a[12])*o,this.y=(a[1]*t+a[5]*i+a[9]*n+a[13])*o,this.z=(a[2]*t+a[6]*i+a[10]*n+a[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,a=e.x,o=e.y,s=e.z,l=e.w,u=2*(o*n-s*i),c=2*(s*t-a*n),h=2*(a*i-o*t);return this.x=t+l*u+o*h-s*c,this.y=i+l*c+s*u-a*h,this.z=n+l*h+a*c-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n,this.y=a[1]*t+a[5]*i+a[9]*n,this.z=a[2]*t+a[6]*i+a[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,a=e.z,o=t.x,s=t.y,l=t.z;return this.x=n*l-a*s,this.y=a*o-i*l,this.z=i*s-n*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return PF.copy(this).projectOnVector(e),this.sub(PF)}reflect(e){return this.sub(PF.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(zn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},PF=new ye,Une=new kn,kf=class{constructor(e=new ye(1/0,1/0,1/0),t=new ye(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint($l.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint($l.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=$l.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){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(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(i!==void 0){let a=i.getAttribute("position");if(t===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let o=0,s=a.count;o<s;o++)e.isMesh===!0?e.getVertexPosition(o,$l):$l.fromBufferAttribute(a,o),$l.applyMatrix4(e.matrixWorld),this.expandByPoint($l);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),RC.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),RC.copy(i.boundingBox)),RC.applyMatrix4(e.matrixWorld),this.union(RC)}let n=e.children;for(let a=0,o=n.length;a<o;a++)this.expandByObject(n[a],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,$l),$l.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(lM),LC.subVectors(this.max,lM),Oy.subVectors(e.a,lM),zy.subVectors(e.b,lM),Fy.subVectors(e.c,lM),Af.subVectors(zy,Oy),Cf.subVectors(Fy,zy),kd.subVectors(Oy,Fy);let t=[0,-Af.z,Af.y,0,-Cf.z,Cf.y,0,-kd.z,kd.y,Af.z,0,-Af.x,Cf.z,0,-Cf.x,kd.z,0,-kd.x,-Af.y,Af.x,0,-Cf.y,Cf.x,0,-kd.y,kd.x,0];return!IF(t,Oy,zy,Fy,LC)||(t=[1,0,0,0,1,0,0,0,1],!IF(t,Oy,zy,Fy,LC))?!1:(DC.crossVectors(Af,Cf),t=[DC.x,DC.y,DC.z],IF(t,Oy,zy,Fy,LC))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,$l).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize($l).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Bc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Bc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Bc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Bc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Bc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Bc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Bc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Bc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Bc),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},Bc=[new ye,new ye,new ye,new ye,new ye,new ye,new ye,new ye],$l=new ye,RC=new kf,Oy=new ye,zy=new ye,Fy=new ye,Af=new ye,Cf=new ye,kd=new ye,lM=new ye,LC=new ye,DC=new ye,Vd=new ye;function IF(r,e,t,i,n){for(let a=0,o=r.length-3;a<=o;a+=3){Vd.fromArray(r,a);let s=n.x*Math.abs(Vd.x)+n.y*Math.abs(Vd.y)+n.z*Math.abs(Vd.z),l=e.dot(Vd),u=t.dot(Vd),c=i.dot(Vd);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var BCe=new kf,uM=new ye,NF=new ye,Vf=class{constructor(e=new ye,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):BCe.setFromPoints(e).getCenter(i);let n=0;for(let a=0,o=e.length;a<o;a++)n=Math.max(n,i.distanceToSquared(e[a]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;uM.subVectors(e,this.center);let t=uM.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.addScaledVector(uM,n/i),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(NF.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(uM.copy(e.center).add(NF)),this.expandByPoint(uM.copy(e.center).sub(NF))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},kc=new ye,UF=new ye,PC=new ye,Rf=new ye,OF=new ye,IC=new ye,zF=new ye,_M=class{constructor(e=new ye,t=new ye(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,kc)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=kc.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(kc.copy(this.origin).addScaledVector(this.direction,t),kc.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){UF.copy(e).add(t).multiplyScalar(.5),PC.copy(t).sub(e).normalize(),Rf.copy(this.origin).sub(UF);let a=e.distanceTo(t)*.5,o=-this.direction.dot(PC),s=Rf.dot(this.direction),l=-Rf.dot(PC),u=Rf.lengthSq(),c=Math.abs(1-o*o),h,f,p,d;if(c>0)if(h=o*l-s,f=o*s-l,d=a*c,h>=0)if(f>=-d)if(f<=d){let g=1/c;h*=g,f*=g,p=h*(h+o*f+2*s)+f*(o*h+f+2*l)+u}else f=a,h=Math.max(0,-(o*f+s)),p=-h*h+f*(f+2*l)+u;else f=-a,h=Math.max(0,-(o*f+s)),p=-h*h+f*(f+2*l)+u;else f<=-d?(h=Math.max(0,-(-o*a+s)),f=h>0?-a:Math.min(Math.max(-a,-l),a),p=-h*h+f*(f+2*l)+u):f<=d?(h=0,f=Math.min(Math.max(-a,-l),a),p=f*(f+2*l)+u):(h=Math.max(0,-(o*a+s)),f=h>0?a:Math.min(Math.max(-a,-l),a),p=-h*h+f*(f+2*l)+u);else f=o>0?-a:a,h=Math.max(0,-(o*f+s)),p=-h*h+f*(f+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,h),n&&n.copy(UF).addScaledVector(PC,f),p}intersectSphere(e,t){kc.subVectors(e.center,this.origin);let i=kc.dot(this.direction),n=kc.dot(kc)-i*i,a=e.radius*e.radius;if(n>a)return null;let o=Math.sqrt(a-n),s=i-o,l=i+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,a,o,s,l,u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,f=this.origin;return u>=0?(i=(e.min.x-f.x)*u,n=(e.max.x-f.x)*u):(i=(e.max.x-f.x)*u,n=(e.min.x-f.x)*u),c>=0?(a=(e.min.y-f.y)*c,o=(e.max.y-f.y)*c):(a=(e.max.y-f.y)*c,o=(e.min.y-f.y)*c),i>o||a>n||((a>i||isNaN(i))&&(i=a),(o<n||isNaN(n))&&(n=o),h>=0?(s=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(s=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||s>n)||((s>i||i!==i)&&(i=s),(l<n||n!==n)&&(n=l),n<0)?null:this.at(i>=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,kc)!==null}intersectTriangle(e,t,i,n,a){OF.subVectors(t,e),IC.subVectors(i,e),zF.crossVectors(OF,IC);let o=this.direction.dot(zF),s;if(o>0){if(n)return null;s=1}else if(o<0)s=-1,o=-o;else return null;Rf.subVectors(this.origin,e);let l=s*this.direction.dot(IC.crossVectors(Rf,IC));if(l<0)return null;let u=s*this.direction.dot(OF.cross(Rf));if(u<0||l+u>o)return null;let c=-s*Rf.dot(zF);return c<0?null:this.at(c/o,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Xt=class r{constructor(e,t,i,n,a,o,s,l,u,c,h,f,p,d,g,m){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,n,a,o,s,l,u,c,h,f,p,d,g,m)}set(e,t,i,n,a,o,s,l,u,c,h,f,p,d,g,m){let v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=a,v[5]=o,v[9]=s,v[13]=l,v[2]=u,v[6]=c,v[10]=h,v[14]=f,v[3]=p,v[7]=d,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/By.setFromMatrixColumn(e,0).length(),a=1/By.setFromMatrixColumn(e,1).length(),o=1/By.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,a=e.z,o=Math.cos(i),s=Math.sin(i),l=Math.cos(n),u=Math.sin(n),c=Math.cos(a),h=Math.sin(a);if(e.order==="XYZ"){let f=o*c,p=o*h,d=s*c,g=s*h;t[0]=l*c,t[4]=-l*h,t[8]=u,t[1]=p+d*u,t[5]=f-g*u,t[9]=-s*l,t[2]=g-f*u,t[6]=d+p*u,t[10]=o*l}else if(e.order==="YXZ"){let f=l*c,p=l*h,d=u*c,g=u*h;t[0]=f+g*s,t[4]=d*s-p,t[8]=o*u,t[1]=o*h,t[5]=o*c,t[9]=-s,t[2]=p*s-d,t[6]=g+f*s,t[10]=o*l}else if(e.order==="ZXY"){let f=l*c,p=l*h,d=u*c,g=u*h;t[0]=f-g*s,t[4]=-o*h,t[8]=d+p*s,t[1]=p+d*s,t[5]=o*c,t[9]=g-f*s,t[2]=-o*u,t[6]=s,t[10]=o*l}else if(e.order==="ZYX"){let f=o*c,p=o*h,d=s*c,g=s*h;t[0]=l*c,t[4]=d*u-p,t[8]=f*u+g,t[1]=l*h,t[5]=g*u+f,t[9]=p*u-d,t[2]=-u,t[6]=s*l,t[10]=o*l}else if(e.order==="YZX"){let f=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=g-f*h,t[8]=d*h+p,t[1]=h,t[5]=o*c,t[9]=-s*c,t[2]=-u*c,t[6]=p*h+d,t[10]=f-g*h}else if(e.order==="XZY"){let f=o*l,p=o*u,d=s*l,g=s*u;t[0]=l*c,t[4]=-h,t[8]=u*c,t[1]=f*h+g,t[5]=o*c,t[9]=p*h-d,t[2]=d*h-p,t[6]=s*c,t[10]=g*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(kCe,e,VCe)}lookAt(e,t,i){let n=this.elements;return gs.subVectors(e,t),gs.lengthSq()===0&&(gs.z=1),gs.normalize(),Lf.crossVectors(i,gs),Lf.lengthSq()===0&&(Math.abs(i.z)===1?gs.x+=1e-4:gs.z+=1e-4,gs.normalize(),Lf.crossVectors(i,gs)),Lf.normalize(),NC.crossVectors(gs,Lf),n[0]=Lf.x,n[4]=NC.x,n[8]=gs.x,n[1]=Lf.y,n[5]=NC.y,n[9]=gs.y,n[2]=Lf.z,n[6]=NC.z,n[10]=gs.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,a=this.elements,o=i[0],s=i[4],l=i[8],u=i[12],c=i[1],h=i[5],f=i[9],p=i[13],d=i[2],g=i[6],m=i[10],v=i[14],_=i[3],y=i[7],x=i[11],M=i[15],S=n[0],w=n[4],T=n[8],C=n[12],b=n[1],E=n[5],I=n[9],R=n[13],A=n[2],P=n[6],U=n[10],B=n[14],z=n[3],k=n[7],G=n[11],Y=n[15];return a[0]=o*S+s*b+l*A+u*z,a[4]=o*w+s*E+l*P+u*k,a[8]=o*T+s*I+l*U+u*G,a[12]=o*C+s*R+l*B+u*Y,a[1]=c*S+h*b+f*A+p*z,a[5]=c*w+h*E+f*P+p*k,a[9]=c*T+h*I+f*U+p*G,a[13]=c*C+h*R+f*B+p*Y,a[2]=d*S+g*b+m*A+v*z,a[6]=d*w+g*E+m*P+v*k,a[10]=d*T+g*I+m*U+v*G,a[14]=d*C+g*R+m*B+v*Y,a[3]=_*S+y*b+x*A+M*z,a[7]=_*w+y*E+x*P+M*k,a[11]=_*T+y*I+x*U+M*G,a[15]=_*C+y*R+x*B+M*Y,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],a=e[12],o=e[1],s=e[5],l=e[9],u=e[13],c=e[2],h=e[6],f=e[10],p=e[14],d=e[3],g=e[7],m=e[11],v=e[15];return d*(+a*l*h-n*u*h-a*s*f+i*u*f+n*s*p-i*l*p)+g*(+t*l*p-t*u*f+a*o*f-n*o*p+n*u*c-a*l*c)+m*(+t*u*h-t*s*p-a*o*h+i*o*p+a*s*c-i*u*c)+v*(-n*s*c-t*l*h+t*s*f+n*o*h-i*o*f+i*l*c)}transpose(){let e=this.elements,t;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(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],g=e[13],m=e[14],v=e[15],_=h*m*u-g*f*u+g*l*p-s*m*p-h*l*v+s*f*v,y=d*f*u-c*m*u-d*l*p+o*m*p+c*l*v-o*f*v,x=c*g*u-d*h*u+d*s*p-o*g*p-c*s*v+o*h*v,M=d*h*l-c*g*l-d*s*f+o*g*f+c*s*m-o*h*m,S=t*_+i*y+n*x+a*M;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/S;return e[0]=_*w,e[1]=(g*f*a-h*m*a-g*n*p+i*m*p+h*n*v-i*f*v)*w,e[2]=(s*m*a-g*l*a+g*n*u-i*m*u-s*n*v+i*l*v)*w,e[3]=(h*l*a-s*f*a-h*n*u+i*f*u+s*n*p-i*l*p)*w,e[4]=y*w,e[5]=(c*m*a-d*f*a+d*n*p-t*m*p-c*n*v+t*f*v)*w,e[6]=(d*l*a-o*m*a-d*n*u+t*m*u+o*n*v-t*l*v)*w,e[7]=(o*f*a-c*l*a+c*n*u-t*f*u-o*n*p+t*l*p)*w,e[8]=x*w,e[9]=(d*h*a-c*g*a-d*i*p+t*g*p+c*i*v-t*h*v)*w,e[10]=(o*g*a-d*s*a+d*i*u-t*g*u-o*i*v+t*s*v)*w,e[11]=(c*s*a-o*h*a-c*i*u+t*h*u+o*i*p-t*s*p)*w,e[12]=M*w,e[13]=(c*g*n-d*h*n+d*i*f-t*g*f-c*i*m+t*h*m)*w,e[14]=(d*s*n-o*g*n-d*i*l+t*g*l+o*i*m-t*s*m)*w,e[15]=(o*h*n-c*s*n+c*i*l-t*h*l-o*i*f+t*s*f)*w,this}scale(e){let t=this.elements,i=e.x,n=e.y,a=e.z;return t[0]*=i,t[4]*=n,t[8]*=a,t[1]*=i,t[5]*=n,t[9]*=a,t[2]*=i,t[6]*=n,t[10]*=a,t[3]*=i,t[7]*=n,t[11]*=a,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),a=1-i,o=e.x,s=e.y,l=e.z,u=a*o,c=a*s;return this.set(u*o+i,u*s-n*l,u*l+n*s,0,u*s+n*l,c*s+i,c*l-n*o,0,u*l-n*s,c*l+n*o,a*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,a,o){return this.set(1,i,a,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,a=t._x,o=t._y,s=t._z,l=t._w,u=a+a,c=o+o,h=s+s,f=a*u,p=a*c,d=a*h,g=o*c,m=o*h,v=s*h,_=l*u,y=l*c,x=l*h,M=i.x,S=i.y,w=i.z;return n[0]=(1-(g+v))*M,n[1]=(p+x)*M,n[2]=(d-y)*M,n[3]=0,n[4]=(p-x)*S,n[5]=(1-(f+v))*S,n[6]=(m+_)*S,n[7]=0,n[8]=(d+y)*w,n[9]=(m-_)*w,n[10]=(1-(f+g))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,a=By.set(n[0],n[1],n[2]).length(),o=By.set(n[4],n[5],n[6]).length(),s=By.set(n[8],n[9],n[10]).length();this.determinant()<0&&(a=-a),e.x=n[12],e.y=n[13],e.z=n[14],Ql.copy(this);let u=1/a,c=1/o,h=1/s;return Ql.elements[0]*=u,Ql.elements[1]*=u,Ql.elements[2]*=u,Ql.elements[4]*=c,Ql.elements[5]*=c,Ql.elements[6]*=c,Ql.elements[8]*=h,Ql.elements[9]*=h,Ql.elements[10]*=h,t.setFromRotationMatrix(Ql),i.x=a,i.y=o,i.z=s,this}makePerspective(e,t,i,n,a,o,s=Zc){let l=this.elements,u=2*a/(t-e),c=2*a/(i-n),h=(t+e)/(t-e),f=(i+n)/(i-n),p,d;if(s===Zc)p=-(o+a)/(o-a),d=-2*o*a/(o-a);else if(s===oR)p=-o/(o-a),d=-o*a/(o-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=d,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,a,o,s=Zc){let l=this.elements,u=1/(t-e),c=1/(i-n),h=1/(o-a),f=(t+e)*u,p=(i+n)*c,d,g;if(s===Zc)d=(o+a)*h,g=-2*h;else if(s===oR)d=a*h,g=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=g,l[14]=-d,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},By=new ye,Ql=new Xt,kCe=new ye(0,0,0),VCe=new ye(1,1,1),Lf=new ye,NC=new ye,gs=new ye,One=new Xt,zne=new kn,Vn=(()=>{class r{constructor(t=0,i=0,n=0,a=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=a}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,n,a=this._order){return this._x=t,this._y=i,this._z=n,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,n=!0){let a=t.elements,o=a[0],s=a[4],l=a[8],u=a[1],c=a[5],h=a[9],f=a[2],p=a[6],d=a[10];switch(i){case"XYZ":this._y=Math.asin(zn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-zn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(l,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(zn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-zn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(zn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(l,d));break;case"XZY":this._z=Math.asin(-zn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,n){return One.makeRotationFromQuaternion(t),this.setFromRotationMatrix(One,i,n)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return zne.setFromEuler(this),this.setFromQuaternion(zne,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return r.DEFAULT_ORDER="XYZ",r})(),hR=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},GCe=0,Fne=new ye,ky=new kn,Vc=new Xt,UC=new ye,cM=new ye,HCe=new ye,WCe=new kn,Bne=new ye(1,0,0),kne=new ye(0,1,0),Vne=new ye(0,0,1),XCe={type:"added"},YCe={type:"removed"},FF={type:"childadded",child:null},BF={type:"childremoved",child:null},sa=(()=>{class r extends Bf{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:GCe++}),this.uuid=qf(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new ye,i=new Vn,n=new kn,a=new ye(1,1,1);function o(){n.setFromEuler(i,!1)}function s(){i.setFromQuaternion(n,void 0,!1)}i._onChange(o),n._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new Xt},normalMatrix:{value:new vr}}),this.matrix=new Xt,this.matrixWorld=new Xt,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new hR,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return ky.setFromAxisAngle(t,i),this.quaternion.multiply(ky),this}rotateOnWorldAxis(t,i){return ky.setFromAxisAngle(t,i),this.quaternion.premultiply(ky),this}rotateX(t){return this.rotateOnAxis(Bne,t)}rotateY(t){return this.rotateOnAxis(kne,t)}rotateZ(t){return this.rotateOnAxis(Vne,t)}translateOnAxis(t,i){return Fne.copy(t).applyQuaternion(this.quaternion),this.position.add(Fne.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(Bne,t)}translateY(t){return this.translateOnAxis(kne,t)}translateZ(t){return this.translateOnAxis(Vne,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Vc.copy(this.matrixWorld).invert())}lookAt(t,i,n){t.isVector3?UC.copy(t):UC.set(t,i,n);let a=this.parent;this.updateWorldMatrix(!0,!1),cM.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Vc.lookAt(cM,UC,this.up):Vc.lookAt(UC,cM,this.up),this.quaternion.setFromRotationMatrix(Vc),a&&(Vc.extractRotation(a.matrixWorld),ky.setFromRotationMatrix(Vc),this.quaternion.premultiply(ky.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);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?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(XCe),FF.child=t,this.dispatchEvent(FF),FF.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let i=this.children.indexOf(t);return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(YCe),BF.child=t,this.dispatchEvent(BF),BF.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Vc.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Vc.multiply(t.parent.matrixWorld)),t.applyMatrix4(Vc),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let n=0,a=this.children.length;n<a;n++){let s=this.children[n].getObjectByProperty(t,i);if(s!==void 0)return s}}getObjectsByProperty(t,i,n=[]){this[t]===i&&n.push(this);let a=this.children;for(let o=0,s=a.length;o<s;o++)a[o].getObjectsByProperty(t,i,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cM,t,HCe),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cM,WCe,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);let i=this.children;for(let n=0,a=i.length;n<a;n++)i[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let i=this.children;for(let n=0,a=i.length;n<a;n++)i[n].traverseVisible(t)}traverseAncestors(t){let i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let i=this.children;for(let n=0,a=i.length;n<a;n++){let o=i[n];(o.matrixWorldAutoUpdate===!0||t===!0)&&o.updateMatrixWorld(t)}}updateWorldMatrix(t,i){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),i===!0){let a=this.children;for(let o=0,s=a.length;o<s;o++){let l=a[o];l.matrixWorldAutoUpdate===!0&&l.updateWorldMatrix(!1,!0)}}}toJSON(t){let i=t===void 0||typeof t=="string",n={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let a={};a.uuid=this.uuid,a.type=this.type,this.name!==""&&(a.name=this.name),this.castShadow===!0&&(a.castShadow=!0),this.receiveShadow===!0&&(a.receiveShadow=!0),this.visible===!1&&(a.visible=!1),this.frustumCulled===!1&&(a.frustumCulled=!1),this.renderOrder!==0&&(a.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.visibility=this._visibility,a.active=this._active,a.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),a.maxGeometryCount=this._maxGeometryCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.geometryCount=this._geometryCount,a.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(a.boundingSphere={center:a.boundingSphere.center.toArray(),radius:a.boundingSphere.radius}),this.boundingBox!==null&&(a.boundingBox={min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}));function o(l,u){return l[u.uuid]===void 0&&(l[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=o(t.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let u=l.shapes;if(Array.isArray(u))for(let c=0,h=u.length;c<h;c++){let f=u[c];o(t.shapes,f)}else o(t.shapes,u)}}if(this.isSkinnedMesh&&(a.bindMode=this.bindMode,a.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(t.skeletons,this.skeleton),a.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let l=[];for(let u=0,c=this.material.length;u<c;u++)l.push(o(t.materials,this.material[u]));a.material=l}else a.material=o(t.materials,this.material);if(this.children.length>0){a.children=[];for(let l=0;l<this.children.length;l++)a.children.push(this.children[l].toJSON(t).object)}if(this.animations.length>0){a.animations=[];for(let l=0;l<this.animations.length;l++){let u=this.animations[l];a.animations.push(o(t.animations,u))}}if(i){let l=s(t.geometries),u=s(t.materials),c=s(t.textures),h=s(t.images),f=s(t.shapes),p=s(t.skeletons),d=s(t.animations),g=s(t.nodes);l.length>0&&(n.geometries=l),u.length>0&&(n.materials=u),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),p.length>0&&(n.skeletons=p),d.length>0&&(n.animations=d),g.length>0&&(n.nodes=g)}return n.object=a,n;function s(l){let u=[];for(let c in l){let h=l[c];delete h.metadata,u.push(h)}return u}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,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.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,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.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let n=0;n<t.children.length;n++){let a=t.children[n];this.add(a.clone())}return this}}return r.DEFAULT_UP=new ye(0,1,0),r.DEFAULT_MATRIX_AUTO_UPDATE=!0,r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,r})(),eu=new ye,Gc=new ye,kF=new ye,Hc=new ye,Vy=new ye,Gy=new ye,Gne=new ye,VF=new ye,GF=new ye,HF=new ye,Jy=class r{constructor(e=new ye,t=new ye,i=new ye){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),eu.subVectors(e,t),n.cross(eu);let a=n.lengthSq();return a>0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(e,t,i,n,a){eu.subVectors(n,t),Gc.subVectors(i,t),kF.subVectors(e,t);let o=eu.dot(eu),s=eu.dot(Gc),l=eu.dot(kF),u=Gc.dot(Gc),c=Gc.dot(kF),h=o*u-s*s;if(h===0)return a.set(0,0,0),null;let f=1/h,p=(u*l-s*c)*f,d=(o*c-s*l)*f;return a.set(1-p-d,d,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,Hc)===null?!1:Hc.x>=0&&Hc.y>=0&&Hc.x+Hc.y<=1}static getInterpolation(e,t,i,n,a,o,s,l){return this.getBarycoord(e,t,i,n,Hc)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,Hc.x),l.addScaledVector(o,Hc.y),l.addScaledVector(s,Hc.z),l)}static isFrontFacing(e,t,i,n){return eu.subVectors(i,t),Gc.subVectors(e,t),eu.cross(Gc).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return eu.subVectors(this.c,this.b),Gc.subVectors(this.a,this.b),eu.cross(Gc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return r.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return r.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,a){return r.getInterpolation(e,this.a,this.b,this.c,t,i,n,a)}containsPoint(e){return r.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return r.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,n=this.b,a=this.c,o,s;Vy.subVectors(n,i),Gy.subVectors(a,i),VF.subVectors(e,i);let l=Vy.dot(VF),u=Gy.dot(VF);if(l<=0&&u<=0)return t.copy(i);GF.subVectors(e,n);let c=Vy.dot(GF),h=Gy.dot(GF);if(c>=0&&h<=c)return t.copy(n);let f=l*h-c*u;if(f<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(i).addScaledVector(Vy,o);HF.subVectors(e,a);let p=Vy.dot(HF),d=Gy.dot(HF);if(d>=0&&p<=d)return t.copy(a);let g=p*u-l*d;if(g<=0&&u>=0&&d<=0)return s=u/(u-d),t.copy(i).addScaledVector(Gy,s);let m=c*d-p*h;if(m<=0&&h-c>=0&&p-d>=0)return Gne.subVectors(a,n),s=(h-c)/(h-c+(p-d)),t.copy(n).addScaledVector(Gne,s);let v=1/(m+g+f);return o=g*v,s=f*v,t.copy(i).addScaledVector(Vy,o).addScaledVector(Gy,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Hae={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Df={h:0,s:0,l:0},OC={h:0,s:0,l:0};function WF(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}var nr=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Pa){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ti.toWorkingColorSpace(this,t),this}setRGB(e,t,i,n=ti.workingColorSpace){return this.r=e,this.g=t,this.b=i,ti.toWorkingColorSpace(this,n),this}setHSL(e,t,i,n=ti.workingColorSpace){if(e=XB(e,1),t=zn(t,0,1),i=zn(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,o=2*i-a;this.r=WF(o,a,e+1/3),this.g=WF(o,a,e),this.b=WF(o,a,e-1/3)}return ti.toWorkingColorSpace(this,n),this}setStyle(e,t=Pa){function i(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let a,o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=n[1],o=a.length;if(o===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Pa){let i=Hae[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=r0(e.r),this.g=r0(e.g),this.b=r0(e.b),this}copyLinearToSRGB(e){return this.r=LF(e.r),this.g=LF(e.g),this.b=LF(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Pa){return ti.fromWorkingColorSpace(oa.copy(this),e),Math.round(zn(oa.r*255,0,255))*65536+Math.round(zn(oa.g*255,0,255))*256+Math.round(zn(oa.b*255,0,255))}getHexString(e=Pa){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ti.workingColorSpace){ti.fromWorkingColorSpace(oa.copy(this),t);let i=oa.r,n=oa.g,a=oa.b,o=Math.max(i,n,a),s=Math.min(i,n,a),l,u,c=(s+o)/2;if(s===o)l=0,u=0;else{let h=o-s;switch(u=c<=.5?h/(o+s):h/(2-o-s),o){case i:l=(n-a)/h+(n<a?6:0);break;case n:l=(a-i)/h+2;break;case a:l=(i-n)/h+4;break}l/=6}return e.h=l,e.s=u,e.l=c,e}getRGB(e,t=ti.workingColorSpace){return ti.fromWorkingColorSpace(oa.copy(this),t),e.r=oa.r,e.g=oa.g,e.b=oa.b,e}getStyle(e=Pa){ti.fromWorkingColorSpace(oa.copy(this),e);let t=oa.r,i=oa.g,n=oa.b;return e!==Pa?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(n*255)})`}offsetHSL(e,t,i){return this.getHSL(Df),this.setHSL(Df.h+e,Df.s+t,Df.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Df),e.getHSL(OC);let i=dM(Df.h,OC.h,t),n=dM(Df.s,OC.s,t),a=dM(Df.l,OC.l,t);return this.setHSL(i,n,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,n=this.b,a=e.elements;return this.r=a[0]*t+a[3]*i+a[6]*n,this.g=a[1]*t+a[4]*i+a[7]*n,this.b=a[2]*t+a[5]*i+a[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},oa=new nr;nr.NAMES=Hae;var qCe=0,Jc=class extends Bf{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:qCe++}),this.uuid=qf(),this.name="",this.type="Material",this.blending=t0,this.side=Ff,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=nB,this.blendDst=aB,this.blendEquation=qd,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new nr(0,0,0),this.blendAlpha=0,this.depthFunc=eR,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Cne,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ny,this.stencilZFail=Ny,this.stencilZPass=Ny,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let n=this[t];if(n===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==t0&&(i.blending=this.blending),this.side!==Ff&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==nB&&(i.blendSrc=this.blendSrc),this.blendDst!==aB&&(i.blendDst=this.blendDst),this.blendEquation!==qd&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==eR&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Cne&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ny&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ny&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ny&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function n(a){let o=[];for(let s in a){let l=a[s];delete l.metadata,o.push(l)}return o}if(t){let a=n(e.textures),o=n(e.images);a.length>0&&(i.textures=a),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let n=t.length;i=new Array(n);for(let a=0;a!==n;++a)i[a]=t[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},fR=class extends Jc{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new nr(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.envMapRotation=new Vn,this.combine=NR,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}};var Xi=new ye,zC=new xr,ll=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Rne,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Wu,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return UCe("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,a=this.itemSize;n<a;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)zC.fromBufferAttribute(this,t),zC.applyMatrix3(e),this.setXY(t,zC.x,zC.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)Xi.fromBufferAttribute(this,t),Xi.applyMatrix3(e),this.setXYZ(t,Xi.x,Xi.y,Xi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)Xi.fromBufferAttribute(this,t),Xi.applyMatrix4(e),this.setXYZ(t,Xi.x,Xi.y,Xi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Xi.fromBufferAttribute(this,t),Xi.applyNormalMatrix(e),this.setXYZ(t,Xi.x,Xi.y,Xi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Xi.fromBufferAttribute(this,t),Xi.transformDirection(e),this.setXYZ(t,Xi.x,Xi.y,Xi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Ky(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=La(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ky(t,this.array)),t}setX(e,t){return this.normalized&&(t=La(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ky(t,this.array)),t}setY(e,t){return this.normalized&&(t=La(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Ky(t,this.array)),t}setZ(e,t){return this.normalized&&(t=La(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Ky(t,this.array)),t}setW(e,t){return this.normalized&&(t=La(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=La(t,this.array),i=La(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=La(t,this.array),i=La(i,this.array),n=La(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,a){return e*=this.itemSize,this.normalized&&(t=La(t,this.array),i=La(i,this.array),n=La(n,this.array),a=La(a,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Rne&&(e.usage=this.usage),e}};var u0=class extends ll{constructor(e,t,i){super(new Uint16Array(e),t,i)}};var pR=class extends ll{constructor(e,t,i){super(new Uint32Array(e),t,i)}};var Bn=class extends ll{constructor(e,t,i){super(new Float32Array(e),t,i)}},ZCe=0,ol=new Xt,XF=new sa,Hy=new ye,ys=new kf,hM=new kf,yn=new ye,ul=class r extends Bf{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ZCe++}),this.uuid=qf(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Gae(e)?pR:u0)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(i!==void 0){let a=new vr().getNormalMatrix(e);i.applyNormalMatrix(a),i.needsUpdate=!0}let n=this.attributes.tangent;return n!==void 0&&(n.transformDirection(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ol.makeRotationFromQuaternion(e),this.applyMatrix4(ol),this}rotateX(e){return ol.makeRotationX(e),this.applyMatrix4(ol),this}rotateY(e){return ol.makeRotationY(e),this.applyMatrix4(ol),this}rotateZ(e){return ol.makeRotationZ(e),this.applyMatrix4(ol),this}translate(e,t,i){return ol.makeTranslation(e,t,i),this.applyMatrix4(ol),this}scale(e,t,i){return ol.makeScale(e,t,i),this.applyMatrix4(ol),this}lookAt(e){return XF.lookAt(e),XF.updateMatrix(),this.applyMatrix4(XF.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Hy).negate(),this.translate(Hy.x,Hy.y,Hy.z),this}setFromPoints(e){let t=[];for(let i=0,n=e.length;i<n;i++){let a=e[i];t.push(a.x,a.y,a.z||0)}return this.setAttribute("position",new Bn(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new kf);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ye(-1/0,-1/0,-1/0),new ye(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,n=t.length;i<n;i++){let a=t[i];ys.setFromBufferAttribute(a),this.morphTargetsRelative?(yn.addVectors(this.boundingBox.min,ys.min),this.boundingBox.expandByPoint(yn),yn.addVectors(this.boundingBox.max,ys.max),this.boundingBox.expandByPoint(yn)):(this.boundingBox.expandByPoint(ys.min),this.boundingBox.expandByPoint(ys.max))}}else 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(){this.boundingSphere===null&&(this.boundingSphere=new Vf);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new ye,1/0);return}if(e){let i=this.boundingSphere.center;if(ys.setFromBufferAttribute(e),t)for(let a=0,o=t.length;a<o;a++){let s=t[a];hM.setFromBufferAttribute(s),this.morphTargetsRelative?(yn.addVectors(ys.min,hM.min),ys.expandByPoint(yn),yn.addVectors(ys.max,hM.max),ys.expandByPoint(yn)):(ys.expandByPoint(hM.min),ys.expandByPoint(hM.max))}ys.getCenter(i);let n=0;for(let a=0,o=e.count;a<o;a++)yn.fromBufferAttribute(e,a),n=Math.max(n,i.distanceToSquared(yn));if(t)for(let a=0,o=t.length;a<o;a++){let s=t[a],l=this.morphTargetsRelative;for(let u=0,c=s.count;u<c;u++)yn.fromBufferAttribute(s,u),l&&(Hy.fromBufferAttribute(e,u),yn.add(Hy)),n=Math.max(n,i.distanceToSquared(yn))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let i=t.position,n=t.normal,a=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ll(new Float32Array(4*i.count),4));let o=this.getAttribute("tangent"),s=[],l=[];for(let T=0;T<i.count;T++)s[T]=new ye,l[T]=new ye;let u=new ye,c=new ye,h=new ye,f=new xr,p=new xr,d=new xr,g=new ye,m=new ye;function v(T,C,b){u.fromBufferAttribute(i,T),c.fromBufferAttribute(i,C),h.fromBufferAttribute(i,b),f.fromBufferAttribute(a,T),p.fromBufferAttribute(a,C),d.fromBufferAttribute(a,b),c.sub(u),h.sub(u),p.sub(f),d.sub(f);let E=1/(p.x*d.y-d.x*p.y);isFinite(E)&&(g.copy(c).multiplyScalar(d.y).addScaledVector(h,-p.y).multiplyScalar(E),m.copy(h).multiplyScalar(p.x).addScaledVector(c,-d.x).multiplyScalar(E),s[T].add(g),s[C].add(g),s[b].add(g),l[T].add(m),l[C].add(m),l[b].add(m))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let T=0,C=_.length;T<C;++T){let b=_[T],E=b.start,I=b.count;for(let R=E,A=E+I;R<A;R+=3)v(e.getX(R+0),e.getX(R+1),e.getX(R+2))}let y=new ye,x=new ye,M=new ye,S=new ye;function w(T){M.fromBufferAttribute(n,T),S.copy(M);let C=s[T];y.copy(C),y.sub(M.multiplyScalar(M.dot(C))).normalize(),x.crossVectors(S,C);let E=x.dot(l[T])<0?-1:1;o.setXYZW(T,y.x,y.y,y.z,E)}for(let T=0,C=_.length;T<C;++T){let b=_[T],E=b.start,I=b.count;for(let R=E,A=E+I;R<A;R+=3)w(e.getX(R+0)),w(e.getX(R+1)),w(e.getX(R+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new ll(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let f=0,p=i.count;f<p;f++)i.setXYZ(f,0,0,0);let n=new ye,a=new ye,o=new ye,s=new ye,l=new ye,u=new ye,c=new ye,h=new ye;if(e)for(let f=0,p=e.count;f<p;f+=3){let d=e.getX(f+0),g=e.getX(f+1),m=e.getX(f+2);n.fromBufferAttribute(t,d),a.fromBufferAttribute(t,g),o.fromBufferAttribute(t,m),c.subVectors(o,a),h.subVectors(n,a),c.cross(h),s.fromBufferAttribute(i,d),l.fromBufferAttribute(i,g),u.fromBufferAttribute(i,m),s.add(c),l.add(c),u.add(c),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(g,l.x,l.y,l.z),i.setXYZ(m,u.x,u.y,u.z)}else for(let f=0,p=t.count;f<p;f+=3)n.fromBufferAttribute(t,f+0),a.fromBufferAttribute(t,f+1),o.fromBufferAttribute(t,f+2),c.subVectors(o,a),h.subVectors(n,a),c.cross(h),i.setXYZ(f+0,c.x,c.y,c.z),i.setXYZ(f+1,c.x,c.y,c.z),i.setXYZ(f+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)yn.fromBufferAttribute(e,t),yn.normalize(),e.setXYZ(t,yn.x,yn.y,yn.z)}toNonIndexed(){function e(s,l){let u=s.array,c=s.itemSize,h=s.normalized,f=new u.constructor(l.length*c),p=0,d=0;for(let g=0,m=l.length;g<m;g++){s.isInterleavedBufferAttribute?p=l[g]*s.data.stride+s.offset:p=l[g]*c;for(let v=0;v<c;v++)f[d++]=u[p++]}return new ll(f,c,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new r,i=this.index.array,n=this.attributes;for(let s in n){let l=n[s],u=e(l,i);t.setAttribute(s,u)}let a=this.morphAttributes;for(let s in a){let l=[],u=a[s];for(let c=0,h=u.length;c<h;c++){let f=u[c],p=e(f,i);l.push(p)}t.morphAttributes[s]=l}t.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let s=0,l=o.length;s<l;s++){let u=o[s];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){let e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let l in i){let u=i[l];e.data.attributes[l]=u.toJSON(e.data)}let n={},a=!1;for(let l in this.morphAttributes){let u=this.morphAttributes[l],c=[];for(let h=0,f=u.length;h<f;h++){let p=u[h];c.push(p.toJSON(e.data))}c.length>0&&(n[l]=c,a=!0)}a&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let n=e.attributes;for(let u in n){let c=n[u];this.setAttribute(u,c.clone(t))}let a=e.morphAttributes;for(let u in a){let c=[],h=a[u];for(let f=0,p=h.length;f<p;f++)c.push(h[f].clone(t));this.morphAttributes[u]=c}this.morphTargetsRelative=e.morphTargetsRelative;let o=e.groups;for(let u=0,c=o.length;u<c;u++){let h=o[u];this.addGroup(h.start,h.count,h.materialIndex)}let s=e.boundingBox;s!==null&&(this.boundingBox=s.clone());let l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},Hne=new Xt,Gd=new _M,FC=new Vf,Wne=new ye,Wy=new ye,Xy=new ye,Yy=new ye,YF=new ye,BC=new ye,kC=new xr,VC=new xr,GC=new xr,Xne=new ye,Yne=new ye,qne=new ye,HC=new ye,WC=new ye,Wo=class extends sa{constructor(e=new ul,t=new fR){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a<o;a++){let s=n[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=a}}}}getVertexPosition(e,t){let i=this.geometry,n=i.attributes.position,a=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(n,e);let s=this.morphTargetInfluences;if(a&&s){BC.set(0,0,0);for(let l=0,u=a.length;l<u;l++){let c=s[l],h=a[l];c!==0&&(YF.fromBufferAttribute(h,e),o?BC.addScaledVector(YF,c):BC.addScaledVector(YF.sub(t),c))}t.add(BC)}return t}raycast(e,t){let i=this.geometry,n=this.material,a=this.matrixWorld;n!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),FC.copy(i.boundingSphere),FC.applyMatrix4(a),Gd.copy(e.ray).recast(e.near),!(FC.containsPoint(Gd.origin)===!1&&(Gd.intersectSphere(FC,Wne)===null||Gd.origin.distanceToSquared(Wne)>(e.far-e.near)**2))&&(Hne.copy(a).invert(),Gd.copy(e.ray).applyMatrix4(Hne),!(i.boundingBox!==null&&Gd.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Gd)))}_computeIntersections(e,t,i){let n,a=this.geometry,o=this.material,s=a.index,l=a.attributes.position,u=a.attributes.uv,c=a.attributes.uv1,h=a.attributes.normal,f=a.groups,p=a.drawRange;if(s!==null)if(Array.isArray(o))for(let d=0,g=f.length;d<g;d++){let m=f[d],v=o[m.materialIndex],_=Math.max(m.start,p.start),y=Math.min(s.count,Math.min(m.start+m.count,p.start+p.count));for(let x=_,M=y;x<M;x+=3){let S=s.getX(x),w=s.getX(x+1),T=s.getX(x+2);n=XC(this,v,e,i,u,c,h,S,w,T),n&&(n.faceIndex=Math.floor(x/3),n.face.materialIndex=m.materialIndex,t.push(n))}}else{let d=Math.max(0,p.start),g=Math.min(s.count,p.start+p.count);for(let m=d,v=g;m<v;m+=3){let _=s.getX(m),y=s.getX(m+1),x=s.getX(m+2);n=XC(this,o,e,i,u,c,h,_,y,x),n&&(n.faceIndex=Math.floor(m/3),t.push(n))}}else if(l!==void 0)if(Array.isArray(o))for(let d=0,g=f.length;d<g;d++){let m=f[d],v=o[m.materialIndex],_=Math.max(m.start,p.start),y=Math.min(l.count,Math.min(m.start+m.count,p.start+p.count));for(let x=_,M=y;x<M;x+=3){let S=x,w=x+1,T=x+2;n=XC(this,v,e,i,u,c,h,S,w,T),n&&(n.faceIndex=Math.floor(x/3),n.face.materialIndex=m.materialIndex,t.push(n))}}else{let d=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);for(let m=d,v=g;m<v;m+=3){let _=m,y=m+1,x=m+2;n=XC(this,o,e,i,u,c,h,_,y,x),n&&(n.faceIndex=Math.floor(m/3),t.push(n))}}}};function jCe(r,e,t,i,n,a,o,s){let l;if(e.side===Xo?l=i.intersectTriangle(o,a,n,!0,s):l=i.intersectTriangle(n,a,o,e.side===Ff,s),l===null)return null;WC.copy(s),WC.applyMatrix4(r.matrixWorld);let u=t.ray.origin.distanceTo(WC);return u<t.near||u>t.far?null:{distance:u,point:WC.clone(),object:r}}function XC(r,e,t,i,n,a,o,s,l,u){r.getVertexPosition(s,Wy),r.getVertexPosition(l,Xy),r.getVertexPosition(u,Yy);let c=jCe(r,e,t,i,Wy,Xy,Yy,HC);if(c){n&&(kC.fromBufferAttribute(n,s),VC.fromBufferAttribute(n,l),GC.fromBufferAttribute(n,u),c.uv=Jy.getInterpolation(HC,Wy,Xy,Yy,kC,VC,GC,new xr)),a&&(kC.fromBufferAttribute(a,s),VC.fromBufferAttribute(a,l),GC.fromBufferAttribute(a,u),c.uv1=Jy.getInterpolation(HC,Wy,Xy,Yy,kC,VC,GC,new xr)),o&&(Xne.fromBufferAttribute(o,s),Yne.fromBufferAttribute(o,l),qne.fromBufferAttribute(o,u),c.normal=Jy.getInterpolation(HC,Wy,Xy,Yy,Xne,Yne,qne,new ye),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));let h={a:s,b:l,c:u,normal:new ye,materialIndex:0};Jy.getNormal(Wy,Xy,Yy,h.normal),c.face=h}return c}var xM=class r extends ul{constructor(e=1,t=1,i=1,n=1,a=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:a,depthSegments:o};let s=this;n=Math.floor(n),a=Math.floor(a),o=Math.floor(o);let l=[],u=[],c=[],h=[],f=0,p=0;d("z","y","x",-1,-1,i,t,e,o,a,0),d("z","y","x",1,-1,i,t,-e,o,a,1),d("x","z","y",1,1,e,i,t,n,o,2),d("x","z","y",1,-1,e,i,-t,n,o,3),d("x","y","z",1,-1,e,t,i,n,a,4),d("x","y","z",-1,-1,e,t,-i,n,a,5),this.setIndex(l),this.setAttribute("position",new Bn(u,3)),this.setAttribute("normal",new Bn(c,3)),this.setAttribute("uv",new Bn(h,2));function d(g,m,v,_,y,x,M,S,w,T,C){let b=x/w,E=M/T,I=x/2,R=M/2,A=S/2,P=w+1,U=T+1,B=0,z=0,k=new ye;for(let G=0;G<U;G++){let Y=G*E-R;for(let J=0;J<P;J++){let Q=J*b-I;k[g]=Q*_,k[m]=Y*y,k[v]=A,u.push(k.x,k.y,k.z),k[g]=0,k[m]=0,k[v]=S>0?1:-1,c.push(k.x,k.y,k.z),h.push(J/w),h.push(1-G/T),B+=1}}for(let G=0;G<T;G++)for(let Y=0;Y<w;Y++){let J=f+Y+P*G,Q=f+Y+P*(G+1),V=f+(Y+1)+P*(G+1),K=f+(Y+1)+P*G;l.push(J,Q,K),l.push(Q,V,K),z+=6}s.addGroup(p,z,C),p+=z,f+=B}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new r(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function c0(r){let e={};for(let t in r){e[t]={};for(let i in r[t]){let n=r[t][i];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)?n.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=n.clone():Array.isArray(n)?e[t][i]=n.slice():e[t][i]=n}}return e}function Da(r){let e={};for(let t=0;t<r.length;t++){let i=c0(r[t]);for(let n in i)e[n]=i[n]}return e}function KCe(r){let e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function Wae(r){return r.getRenderTarget()===null?r.outputColorSpace:ti.workingColorSpace}var JCe={clone:c0,merge:Da},$Ce=`void main() {
  6547. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  6548. }`,QCe=`void main() {
  6549. gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
  6550. }`,Xu=class extends Jc{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=$Ce,this.fragmentShader=QCe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=c0(e.uniforms),this.uniformsGroups=KCe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let o=this.uniforms[n].value;o&&o.isTexture?t.uniforms[n]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[n]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[n]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[n]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[n]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[n]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[n]={type:"m4",value:o.toArray()}:t.uniforms[n]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},dR=class extends sa{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Xt,this.projectionMatrix=new Xt,this.projectionMatrixInverse=new Xt,this.coordinateSystem=Zc}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Pf=new ye,Zne=new xr,jne=new xr,Fn=class extends dR{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=l0*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(pM*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return l0*2*Math.atan(Math.tan(pM*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Pf.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Pf.x,Pf.y).multiplyScalar(-e/Pf.z),Pf.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Pf.x,Pf.y).multiplyScalar(-e/Pf.z)}getViewSize(e,t){return this.getViewBounds(e,Zne,jne),t.subVectors(jne,Zne)}setViewOffset(e,t,i,n,a,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(pM*.5*this.fov)/this.zoom,i=2*t,n=this.aspect*i,a=-.5*n,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,u=o.fullHeight;a+=o.offsetX*n/l,t-=o.offsetY*i/u,n*=o.width/l,i*=o.height/u}let s=this.filmOffset;s!==0&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},qy=-90,Zy=1,fB=class extends sa{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new Fn(qy,Zy,e,t);n.layers=this.layers,this.add(n);let a=new Fn(qy,Zy,e,t);a.layers=this.layers,this.add(a);let o=new Fn(qy,Zy,e,t);o.layers=this.layers,this.add(o);let s=new Fn(qy,Zy,e,t);s.layers=this.layers,this.add(s);let l=new Fn(qy,Zy,e,t);l.layers=this.layers,this.add(l);let u=new Fn(qy,Zy,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,a,o,s,l]=t;for(let u of t)this.remove(u);if(e===Zc)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===oR)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,o,s,l,u,c]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;let g=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,a),e.setRenderTarget(i,1,n),e.render(t,o),e.setRenderTarget(i,2,n),e.render(t,s),e.setRenderTarget(i,3,n),e.render(t,l),e.setRenderTarget(i,4,n),e.render(t,u),i.texture.generateMipmaps=g,e.setRenderTarget(i,5,n),e.render(t,c),e.setRenderTarget(h,f,p),e.xr.enabled=d,i.texture.needsPMREMUpdate=!0}},mR=class extends _s{constructor(e,t,i,n,a,o,s,l,u,c){e=e!==void 0?e:[],t=t!==void 0?t:n0,super(e,t,i,n,a,o,s,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},pB=class extends Kc{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},n=[i,i,i,i,i,i];this.texture=new mR(n,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Go}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
  6551. varying vec3 vWorldDirection;
  6552. vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
  6553. return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
  6554. }
  6555. void main() {
  6556. vWorldDirection = transformDirection( position, modelMatrix );
  6557. #include <begin_vertex>
  6558. #include <project_vertex>
  6559. }
  6560. `,fragmentShader:`
  6561. uniform sampler2D tEquirect;
  6562. varying vec3 vWorldDirection;
  6563. #include <common>
  6564. void main() {
  6565. vec3 direction = normalize( vWorldDirection );
  6566. vec2 sampleUV = equirectUv( direction );
  6567. gl_FragColor = texture2D( tEquirect, sampleUV );
  6568. }
  6569. `},n=new xM(5,5,5),a=new Xu({name:"CubemapFromEquirect",uniforms:c0(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Xo,blending:Uf});a.uniforms.tEquirect.value=t;let o=new Wo(n,a),s=t.minFilter;return t.minFilter===jd&&(t.minFilter=Go),new fB(1,10,this).update(e,o),t.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,n){let a=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,n);e.setRenderTarget(a)}},qF=new ye,eRe=new ye,tRe=new vr,Yc=class{constructor(e=new ye(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=qF.subVectors(i,t).cross(eRe.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let i=e.delta(qF),n=this.normal.dot(i);if(n===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/n;return a<0||a>1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||tRe.getNormalMatrix(e),n=this.coplanarPoint(qF).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},Hd=new Vf,YC=new ye,SM=class{constructor(e=new Yc,t=new Yc,i=new Yc,n=new Yc,a=new Yc,o=new Yc){this.planes=[e,t,i,n,a,o]}set(e,t,i,n,a,o){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(a),s[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Zc){let i=this.planes,n=e.elements,a=n[0],o=n[1],s=n[2],l=n[3],u=n[4],c=n[5],h=n[6],f=n[7],p=n[8],d=n[9],g=n[10],m=n[11],v=n[12],_=n[13],y=n[14],x=n[15];if(i[0].setComponents(l-a,f-u,m-p,x-v).normalize(),i[1].setComponents(l+a,f+u,m+p,x+v).normalize(),i[2].setComponents(l+o,f+c,m+d,x+_).normalize(),i[3].setComponents(l-o,f-c,m-d,x-_).normalize(),i[4].setComponents(l-s,f-h,m-g,x-y).normalize(),t===Zc)i[5].setComponents(l+s,f+h,m+g,x+y).normalize();else if(t===oR)i[5].setComponents(s,h,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Hd.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Hd.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Hd)}intersectsSprite(e){return Hd.center.set(0,0,0),Hd.radius=.7071067811865476,Hd.applyMatrix4(e.matrixWorld),this.intersectsSphere(Hd)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)<n)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let n=t[i];if(YC.x=n.normal.x>0?e.max.x:e.min.x,YC.y=n.normal.y>0?e.max.y:e.min.y,YC.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(YC)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function Xae(){let r=null,e=!1,t=null,i=null;function n(a,o){t(a,o),i=r.requestAnimationFrame(n)}return{start:function(){e!==!0&&t!==null&&(i=r.requestAnimationFrame(n),e=!0)},stop:function(){r.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){r=a}}}function rRe(r,e){let t=e.isWebGL2,i=new WeakMap;function n(u,c){let h=u.array,f=u.usage,p=h.byteLength,d=r.createBuffer();r.bindBuffer(c,d),r.bufferData(c,h,f),u.onUploadCallback();let g;if(h instanceof Float32Array)g=r.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)g=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else g=r.UNSIGNED_SHORT;else if(h instanceof Int16Array)g=r.SHORT;else if(h instanceof Uint32Array)g=r.UNSIGNED_INT;else if(h instanceof Int32Array)g=r.INT;else if(h instanceof Int8Array)g=r.BYTE;else if(h instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:d,type:g,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:p}}function a(u,c,h){let f=c.array,p=c._updateRange,d=c.updateRanges;if(r.bindBuffer(h,u),p.count===-1&&d.length===0&&r.bufferSubData(h,0,f),d.length!==0){for(let g=0,m=d.length;g<m;g++){let v=d[g];t?r.bufferSubData(h,v.start*f.BYTES_PER_ELEMENT,f,v.start,v.count):r.bufferSubData(h,v.start*f.BYTES_PER_ELEMENT,f.subarray(v.start,v.start+v.count))}c.clearUpdateRanges()}p.count!==-1&&(t?r.bufferSubData(h,p.offset*f.BYTES_PER_ELEMENT,f,p.offset,p.count):r.bufferSubData(h,p.offset*f.BYTES_PER_ELEMENT,f.subarray(p.offset,p.offset+p.count)),p.count=-1),c.onUploadCallback()}function o(u){return u.isInterleavedBufferAttribute&&(u=u.data),i.get(u)}function s(u){u.isInterleavedBufferAttribute&&(u=u.data);let c=i.get(u);c&&(r.deleteBuffer(c.buffer),i.delete(u))}function l(u,c){if(u.isGLBufferAttribute){let f=i.get(u);(!f||f.version<u.version)&&i.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}u.isInterleavedBufferAttribute&&(u=u.data);let h=i.get(u);if(h===void 0)i.set(u,n(u,c));else if(h.version<u.version){if(h.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");a(h.buffer,u,c),h.version=u.version}}return{get:o,remove:s,update:l}}var vR=class r extends ul{constructor(e=1,t=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};let a=e/2,o=t/2,s=Math.floor(i),l=Math.floor(n),u=s+1,c=l+1,h=e/s,f=t/l,p=[],d=[],g=[],m=[];for(let v=0;v<c;v++){let _=v*f-o;for(let y=0;y<u;y++){let x=y*h-a;d.push(x,-_,0),g.push(0,0,1),m.push(y/s),m.push(1-v/l)}}for(let v=0;v<l;v++)for(let _=0;_<s;_++){let y=_+u*v,x=_+u*(v+1),M=_+1+u*(v+1),S=_+1+u*v;p.push(y,x,S),p.push(x,M,S)}this.setIndex(p),this.setAttribute("position",new Bn(d,3)),this.setAttribute("normal",new Bn(g,3)),this.setAttribute("uv",new Bn(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new r(e.width,e.height,e.widthSegments,e.heightSegments)}},iRe=`#ifdef USE_ALPHAHASH
  6570. if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
  6571. #endif`,nRe=`#ifdef USE_ALPHAHASH
  6572. const float ALPHA_HASH_SCALE = 0.05;
  6573. float hash2D( vec2 value ) {
  6574. return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
  6575. }
  6576. float hash3D( vec3 value ) {
  6577. return hash2D( vec2( hash2D( value.xy ), value.z ) );
  6578. }
  6579. float getAlphaHashThreshold( vec3 position ) {
  6580. float maxDeriv = max(
  6581. length( dFdx( position.xyz ) ),
  6582. length( dFdy( position.xyz ) )
  6583. );
  6584. float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
  6585. vec2 pixScales = vec2(
  6586. exp2( floor( log2( pixScale ) ) ),
  6587. exp2( ceil( log2( pixScale ) ) )
  6588. );
  6589. vec2 alpha = vec2(
  6590. hash3D( floor( pixScales.x * position.xyz ) ),
  6591. hash3D( floor( pixScales.y * position.xyz ) )
  6592. );
  6593. float lerpFactor = fract( log2( pixScale ) );
  6594. float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
  6595. float a = min( lerpFactor, 1.0 - lerpFactor );
  6596. vec3 cases = vec3(
  6597. x * x / ( 2.0 * a * ( 1.0 - a ) ),
  6598. ( x - 0.5 * a ) / ( 1.0 - a ),
  6599. 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
  6600. );
  6601. float threshold = ( x < ( 1.0 - a ) )
  6602. ? ( ( x < a ) ? cases.x : cases.y )
  6603. : cases.z;
  6604. return clamp( threshold , 1.0e-6, 1.0 );
  6605. }
  6606. #endif`,aRe=`#ifdef USE_ALPHAMAP
  6607. diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
  6608. #endif`,oRe=`#ifdef USE_ALPHAMAP
  6609. uniform sampler2D alphaMap;
  6610. #endif`,sRe=`#ifdef USE_ALPHATEST
  6611. #ifdef ALPHA_TO_COVERAGE
  6612. diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
  6613. if ( diffuseColor.a == 0.0 ) discard;
  6614. #else
  6615. if ( diffuseColor.a < alphaTest ) discard;
  6616. #endif
  6617. #endif`,lRe=`#ifdef USE_ALPHATEST
  6618. uniform float alphaTest;
  6619. #endif`,uRe=`#ifdef USE_AOMAP
  6620. float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
  6621. reflectedLight.indirectDiffuse *= ambientOcclusion;
  6622. #if defined( USE_CLEARCOAT )
  6623. clearcoatSpecularIndirect *= ambientOcclusion;
  6624. #endif
  6625. #if defined( USE_SHEEN )
  6626. sheenSpecularIndirect *= ambientOcclusion;
  6627. #endif
  6628. #if defined( USE_ENVMAP ) && defined( STANDARD )
  6629. float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
  6630. reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
  6631. #endif
  6632. #endif`,cRe=`#ifdef USE_AOMAP
  6633. uniform sampler2D aoMap;
  6634. uniform float aoMapIntensity;
  6635. #endif`,hRe=`#ifdef USE_BATCHING
  6636. attribute float batchId;
  6637. uniform highp sampler2D batchingTexture;
  6638. mat4 getBatchingMatrix( const in float i ) {
  6639. int size = textureSize( batchingTexture, 0 ).x;
  6640. int j = int( i ) * 4;
  6641. int x = j % size;
  6642. int y = j / size;
  6643. vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
  6644. vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
  6645. vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
  6646. vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
  6647. return mat4( v1, v2, v3, v4 );
  6648. }
  6649. #endif`,fRe=`#ifdef USE_BATCHING
  6650. mat4 batchingMatrix = getBatchingMatrix( batchId );
  6651. #endif`,pRe=`vec3 transformed = vec3( position );
  6652. #ifdef USE_ALPHAHASH
  6653. vPosition = vec3( position );
  6654. #endif`,dRe=`vec3 objectNormal = vec3( normal );
  6655. #ifdef USE_TANGENT
  6656. vec3 objectTangent = vec3( tangent.xyz );
  6657. #endif`,mRe=`float G_BlinnPhong_Implicit( ) {
  6658. return 0.25;
  6659. }
  6660. float D_BlinnPhong( const in float shininess, const in float dotNH ) {
  6661. return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
  6662. }
  6663. vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
  6664. vec3 halfDir = normalize( lightDir + viewDir );
  6665. float dotNH = saturate( dot( normal, halfDir ) );
  6666. float dotVH = saturate( dot( viewDir, halfDir ) );
  6667. vec3 F = F_Schlick( specularColor, 1.0, dotVH );
  6668. float G = G_BlinnPhong_Implicit( );
  6669. float D = D_BlinnPhong( shininess, dotNH );
  6670. return F * ( G * D );
  6671. } // validated`,vRe=`#ifdef USE_IRIDESCENCE
  6672. const mat3 XYZ_TO_REC709 = mat3(
  6673. 3.2404542, -0.9692660, 0.0556434,
  6674. -1.5371385, 1.8760108, -0.2040259,
  6675. -0.4985314, 0.0415560, 1.0572252
  6676. );
  6677. vec3 Fresnel0ToIor( vec3 fresnel0 ) {
  6678. vec3 sqrtF0 = sqrt( fresnel0 );
  6679. return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
  6680. }
  6681. vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
  6682. return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
  6683. }
  6684. float IorToFresnel0( float transmittedIor, float incidentIor ) {
  6685. return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
  6686. }
  6687. vec3 evalSensitivity( float OPD, vec3 shift ) {
  6688. float phase = 2.0 * PI * OPD * 1.0e-9;
  6689. vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
  6690. vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
  6691. vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
  6692. vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
  6693. xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
  6694. xyz /= 1.0685e-7;
  6695. vec3 rgb = XYZ_TO_REC709 * xyz;
  6696. return rgb;
  6697. }
  6698. vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
  6699. vec3 I;
  6700. float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
  6701. float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
  6702. float cosTheta2Sq = 1.0 - sinTheta2Sq;
  6703. if ( cosTheta2Sq < 0.0 ) {
  6704. return vec3( 1.0 );
  6705. }
  6706. float cosTheta2 = sqrt( cosTheta2Sq );
  6707. float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
  6708. float R12 = F_Schlick( R0, 1.0, cosTheta1 );
  6709. float T121 = 1.0 - R12;
  6710. float phi12 = 0.0;
  6711. if ( iridescenceIOR < outsideIOR ) phi12 = PI;
  6712. float phi21 = PI - phi12;
  6713. vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
  6714. vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
  6715. vec3 phi23 = vec3( 0.0 );
  6716. if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
  6717. if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
  6718. if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
  6719. float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
  6720. vec3 phi = vec3( phi21 ) + phi23;
  6721. vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
  6722. vec3 r123 = sqrt( R123 );
  6723. vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
  6724. vec3 C0 = R12 + Rs;
  6725. I = C0;
  6726. vec3 Cm = Rs - T121;
  6727. for ( int m = 1; m <= 2; ++ m ) {
  6728. Cm *= r123;
  6729. vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
  6730. I += Cm * Sm;
  6731. }
  6732. return max( I, vec3( 0.0 ) );
  6733. }
  6734. #endif`,gRe=`#ifdef USE_BUMPMAP
  6735. uniform sampler2D bumpMap;
  6736. uniform float bumpScale;
  6737. vec2 dHdxy_fwd() {
  6738. vec2 dSTdx = dFdx( vBumpMapUv );
  6739. vec2 dSTdy = dFdy( vBumpMapUv );
  6740. float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
  6741. float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
  6742. float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
  6743. return vec2( dBx, dBy );
  6744. }
  6745. vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
  6746. vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
  6747. vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
  6748. vec3 vN = surf_norm;
  6749. vec3 R1 = cross( vSigmaY, vN );
  6750. vec3 R2 = cross( vN, vSigmaX );
  6751. float fDet = dot( vSigmaX, R1 ) * faceDirection;
  6752. vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
  6753. return normalize( abs( fDet ) * surf_norm - vGrad );
  6754. }
  6755. #endif`,yRe=`#if NUM_CLIPPING_PLANES > 0
  6756. vec4 plane;
  6757. #ifdef ALPHA_TO_COVERAGE
  6758. float distanceToPlane, distanceGradient;
  6759. float clipOpacity = 1.0;
  6760. #pragma unroll_loop_start
  6761. for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
  6762. plane = clippingPlanes[ i ];
  6763. distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
  6764. distanceGradient = fwidth( distanceToPlane ) / 2.0;
  6765. clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
  6766. if ( clipOpacity == 0.0 ) discard;
  6767. }
  6768. #pragma unroll_loop_end
  6769. #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
  6770. float unionClipOpacity = 1.0;
  6771. #pragma unroll_loop_start
  6772. for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
  6773. plane = clippingPlanes[ i ];
  6774. distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
  6775. distanceGradient = fwidth( distanceToPlane ) / 2.0;
  6776. unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
  6777. }
  6778. #pragma unroll_loop_end
  6779. clipOpacity *= 1.0 - unionClipOpacity;
  6780. #endif
  6781. diffuseColor.a *= clipOpacity;
  6782. if ( diffuseColor.a == 0.0 ) discard;
  6783. #else
  6784. #pragma unroll_loop_start
  6785. for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
  6786. plane = clippingPlanes[ i ];
  6787. if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
  6788. }
  6789. #pragma unroll_loop_end
  6790. #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
  6791. bool clipped = true;
  6792. #pragma unroll_loop_start
  6793. for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
  6794. plane = clippingPlanes[ i ];
  6795. clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
  6796. }
  6797. #pragma unroll_loop_end
  6798. if ( clipped ) discard;
  6799. #endif
  6800. #endif
  6801. #endif`,_Re=`#if NUM_CLIPPING_PLANES > 0
  6802. varying vec3 vClipPosition;
  6803. uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
  6804. #endif`,xRe=`#if NUM_CLIPPING_PLANES > 0
  6805. varying vec3 vClipPosition;
  6806. #endif`,SRe=`#if NUM_CLIPPING_PLANES > 0
  6807. vClipPosition = - mvPosition.xyz;
  6808. #endif`,MRe=`#if defined( USE_COLOR_ALPHA )
  6809. diffuseColor *= vColor;
  6810. #elif defined( USE_COLOR )
  6811. diffuseColor.rgb *= vColor;
  6812. #endif`,bRe=`#if defined( USE_COLOR_ALPHA )
  6813. varying vec4 vColor;
  6814. #elif defined( USE_COLOR )
  6815. varying vec3 vColor;
  6816. #endif`,wRe=`#if defined( USE_COLOR_ALPHA )
  6817. varying vec4 vColor;
  6818. #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
  6819. varying vec3 vColor;
  6820. #endif`,TRe=`#if defined( USE_COLOR_ALPHA )
  6821. vColor = vec4( 1.0 );
  6822. #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
  6823. vColor = vec3( 1.0 );
  6824. #endif
  6825. #ifdef USE_COLOR
  6826. vColor *= color;
  6827. #endif
  6828. #ifdef USE_INSTANCING_COLOR
  6829. vColor.xyz *= instanceColor.xyz;
  6830. #endif`,ERe=`#define PI 3.141592653589793
  6831. #define PI2 6.283185307179586
  6832. #define PI_HALF 1.5707963267948966
  6833. #define RECIPROCAL_PI 0.3183098861837907
  6834. #define RECIPROCAL_PI2 0.15915494309189535
  6835. #define EPSILON 1e-6
  6836. #ifndef saturate
  6837. #define saturate( a ) clamp( a, 0.0, 1.0 )
  6838. #endif
  6839. #define whiteComplement( a ) ( 1.0 - saturate( a ) )
  6840. float pow2( const in float x ) { return x*x; }
  6841. vec3 pow2( const in vec3 x ) { return x*x; }
  6842. float pow3( const in float x ) { return x*x*x; }
  6843. float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
  6844. float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
  6845. float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
  6846. highp float rand( const in vec2 uv ) {
  6847. const highp float a = 12.9898, b = 78.233, c = 43758.5453;
  6848. highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
  6849. return fract( sin( sn ) * c );
  6850. }
  6851. #ifdef HIGH_PRECISION
  6852. float precisionSafeLength( vec3 v ) { return length( v ); }
  6853. #else
  6854. float precisionSafeLength( vec3 v ) {
  6855. float maxComponent = max3( abs( v ) );
  6856. return length( v / maxComponent ) * maxComponent;
  6857. }
  6858. #endif
  6859. struct IncidentLight {
  6860. vec3 color;
  6861. vec3 direction;
  6862. bool visible;
  6863. };
  6864. struct ReflectedLight {
  6865. vec3 directDiffuse;
  6866. vec3 directSpecular;
  6867. vec3 indirectDiffuse;
  6868. vec3 indirectSpecular;
  6869. };
  6870. #ifdef USE_ALPHAHASH
  6871. varying vec3 vPosition;
  6872. #endif
  6873. vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
  6874. return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
  6875. }
  6876. vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
  6877. return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
  6878. }
  6879. mat3 transposeMat3( const in mat3 m ) {
  6880. mat3 tmp;
  6881. tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
  6882. tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
  6883. tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
  6884. return tmp;
  6885. }
  6886. float luminance( const in vec3 rgb ) {
  6887. const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
  6888. return dot( weights, rgb );
  6889. }
  6890. bool isPerspectiveMatrix( mat4 m ) {
  6891. return m[ 2 ][ 3 ] == - 1.0;
  6892. }
  6893. vec2 equirectUv( in vec3 dir ) {
  6894. float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
  6895. float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
  6896. return vec2( u, v );
  6897. }
  6898. vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
  6899. return RECIPROCAL_PI * diffuseColor;
  6900. }
  6901. vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
  6902. float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
  6903. return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
  6904. }
  6905. float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
  6906. float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
  6907. return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
  6908. } // validated`,ARe=`#ifdef ENVMAP_TYPE_CUBE_UV
  6909. #define cubeUV_minMipLevel 4.0
  6910. #define cubeUV_minTileSize 16.0
  6911. float getFace( vec3 direction ) {
  6912. vec3 absDirection = abs( direction );
  6913. float face = - 1.0;
  6914. if ( absDirection.x > absDirection.z ) {
  6915. if ( absDirection.x > absDirection.y )
  6916. face = direction.x > 0.0 ? 0.0 : 3.0;
  6917. else
  6918. face = direction.y > 0.0 ? 1.0 : 4.0;
  6919. } else {
  6920. if ( absDirection.z > absDirection.y )
  6921. face = direction.z > 0.0 ? 2.0 : 5.0;
  6922. else
  6923. face = direction.y > 0.0 ? 1.0 : 4.0;
  6924. }
  6925. return face;
  6926. }
  6927. vec2 getUV( vec3 direction, float face ) {
  6928. vec2 uv;
  6929. if ( face == 0.0 ) {
  6930. uv = vec2( direction.z, direction.y ) / abs( direction.x );
  6931. } else if ( face == 1.0 ) {
  6932. uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
  6933. } else if ( face == 2.0 ) {
  6934. uv = vec2( - direction.x, direction.y ) / abs( direction.z );
  6935. } else if ( face == 3.0 ) {
  6936. uv = vec2( - direction.z, direction.y ) / abs( direction.x );
  6937. } else if ( face == 4.0 ) {
  6938. uv = vec2( - direction.x, direction.z ) / abs( direction.y );
  6939. } else {
  6940. uv = vec2( direction.x, direction.y ) / abs( direction.z );
  6941. }
  6942. return 0.5 * ( uv + 1.0 );
  6943. }
  6944. vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
  6945. float face = getFace( direction );
  6946. float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
  6947. mipInt = max( mipInt, cubeUV_minMipLevel );
  6948. float faceSize = exp2( mipInt );
  6949. highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
  6950. if ( face > 2.0 ) {
  6951. uv.y += faceSize;
  6952. face -= 3.0;
  6953. }
  6954. uv.x += face * faceSize;
  6955. uv.x += filterInt * 3.0 * cubeUV_minTileSize;
  6956. uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
  6957. uv.x *= CUBEUV_TEXEL_WIDTH;
  6958. uv.y *= CUBEUV_TEXEL_HEIGHT;
  6959. #ifdef texture2DGradEXT
  6960. return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
  6961. #else
  6962. return texture2D( envMap, uv ).rgb;
  6963. #endif
  6964. }
  6965. #define cubeUV_r0 1.0
  6966. #define cubeUV_m0 - 2.0
  6967. #define cubeUV_r1 0.8
  6968. #define cubeUV_m1 - 1.0
  6969. #define cubeUV_r4 0.4
  6970. #define cubeUV_m4 2.0
  6971. #define cubeUV_r5 0.305
  6972. #define cubeUV_m5 3.0
  6973. #define cubeUV_r6 0.21
  6974. #define cubeUV_m6 4.0
  6975. float roughnessToMip( float roughness ) {
  6976. float mip = 0.0;
  6977. if ( roughness >= cubeUV_r1 ) {
  6978. mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
  6979. } else if ( roughness >= cubeUV_r4 ) {
  6980. mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
  6981. } else if ( roughness >= cubeUV_r5 ) {
  6982. mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
  6983. } else if ( roughness >= cubeUV_r6 ) {
  6984. mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
  6985. } else {
  6986. mip = - 2.0 * log2( 1.16 * roughness ); }
  6987. return mip;
  6988. }
  6989. vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
  6990. float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
  6991. float mipF = fract( mip );
  6992. float mipInt = floor( mip );
  6993. vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
  6994. if ( mipF == 0.0 ) {
  6995. return vec4( color0, 1.0 );
  6996. } else {
  6997. vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
  6998. return vec4( mix( color0, color1, mipF ), 1.0 );
  6999. }
  7000. }
  7001. #endif`,CRe=`vec3 transformedNormal = objectNormal;
  7002. #ifdef USE_TANGENT
  7003. vec3 transformedTangent = objectTangent;
  7004. #endif
  7005. #ifdef USE_BATCHING
  7006. mat3 bm = mat3( batchingMatrix );
  7007. transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
  7008. transformedNormal = bm * transformedNormal;
  7009. #ifdef USE_TANGENT
  7010. transformedTangent = bm * transformedTangent;
  7011. #endif
  7012. #endif
  7013. #ifdef USE_INSTANCING
  7014. mat3 im = mat3( instanceMatrix );
  7015. transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
  7016. transformedNormal = im * transformedNormal;
  7017. #ifdef USE_TANGENT
  7018. transformedTangent = im * transformedTangent;
  7019. #endif
  7020. #endif
  7021. transformedNormal = normalMatrix * transformedNormal;
  7022. #ifdef FLIP_SIDED
  7023. transformedNormal = - transformedNormal;
  7024. #endif
  7025. #ifdef USE_TANGENT
  7026. transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
  7027. #ifdef FLIP_SIDED
  7028. transformedTangent = - transformedTangent;
  7029. #endif
  7030. #endif`,RRe=`#ifdef USE_DISPLACEMENTMAP
  7031. uniform sampler2D displacementMap;
  7032. uniform float displacementScale;
  7033. uniform float displacementBias;
  7034. #endif`,LRe=`#ifdef USE_DISPLACEMENTMAP
  7035. transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
  7036. #endif`,DRe=`#ifdef USE_EMISSIVEMAP
  7037. vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
  7038. totalEmissiveRadiance *= emissiveColor.rgb;
  7039. #endif`,PRe=`#ifdef USE_EMISSIVEMAP
  7040. uniform sampler2D emissiveMap;
  7041. #endif`,IRe="gl_FragColor = linearToOutputTexel( gl_FragColor );",NRe=`
  7042. const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(
  7043. vec3( 0.8224621, 0.177538, 0.0 ),
  7044. vec3( 0.0331941, 0.9668058, 0.0 ),
  7045. vec3( 0.0170827, 0.0723974, 0.9105199 )
  7046. );
  7047. const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(
  7048. vec3( 1.2249401, - 0.2249404, 0.0 ),
  7049. vec3( - 0.0420569, 1.0420571, 0.0 ),
  7050. vec3( - 0.0196376, - 0.0786361, 1.0982735 )
  7051. );
  7052. vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {
  7053. return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );
  7054. }
  7055. vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {
  7056. return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );
  7057. }
  7058. vec4 LinearTransferOETF( in vec4 value ) {
  7059. return value;
  7060. }
  7061. vec4 sRGBTransferOETF( in vec4 value ) {
  7062. return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
  7063. }
  7064. vec4 LinearToLinear( in vec4 value ) {
  7065. return value;
  7066. }
  7067. vec4 LinearTosRGB( in vec4 value ) {
  7068. return sRGBTransferOETF( value );
  7069. }`,URe=`#ifdef USE_ENVMAP
  7070. #ifdef ENV_WORLDPOS
  7071. vec3 cameraToFrag;
  7072. if ( isOrthographic ) {
  7073. cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
  7074. } else {
  7075. cameraToFrag = normalize( vWorldPosition - cameraPosition );
  7076. }
  7077. vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
  7078. #ifdef ENVMAP_MODE_REFLECTION
  7079. vec3 reflectVec = reflect( cameraToFrag, worldNormal );
  7080. #else
  7081. vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
  7082. #endif
  7083. #else
  7084. vec3 reflectVec = vReflect;
  7085. #endif
  7086. #ifdef ENVMAP_TYPE_CUBE
  7087. vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
  7088. #else
  7089. vec4 envColor = vec4( 0.0 );
  7090. #endif
  7091. #ifdef ENVMAP_BLENDING_MULTIPLY
  7092. outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
  7093. #elif defined( ENVMAP_BLENDING_MIX )
  7094. outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
  7095. #elif defined( ENVMAP_BLENDING_ADD )
  7096. outgoingLight += envColor.xyz * specularStrength * reflectivity;
  7097. #endif
  7098. #endif`,ORe=`#ifdef USE_ENVMAP
  7099. uniform float envMapIntensity;
  7100. uniform float flipEnvMap;
  7101. uniform mat3 envMapRotation;
  7102. #ifdef ENVMAP_TYPE_CUBE
  7103. uniform samplerCube envMap;
  7104. #else
  7105. uniform sampler2D envMap;
  7106. #endif
  7107. #endif`,zRe=`#ifdef USE_ENVMAP
  7108. uniform float reflectivity;
  7109. #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
  7110. #define ENV_WORLDPOS
  7111. #endif
  7112. #ifdef ENV_WORLDPOS
  7113. varying vec3 vWorldPosition;
  7114. uniform float refractionRatio;
  7115. #else
  7116. varying vec3 vReflect;
  7117. #endif
  7118. #endif`,FRe=`#ifdef USE_ENVMAP
  7119. #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
  7120. #define ENV_WORLDPOS
  7121. #endif
  7122. #ifdef ENV_WORLDPOS
  7123. varying vec3 vWorldPosition;
  7124. #else
  7125. varying vec3 vReflect;
  7126. uniform float refractionRatio;
  7127. #endif
  7128. #endif`,BRe=`#ifdef USE_ENVMAP
  7129. #ifdef ENV_WORLDPOS
  7130. vWorldPosition = worldPosition.xyz;
  7131. #else
  7132. vec3 cameraToVertex;
  7133. if ( isOrthographic ) {
  7134. cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
  7135. } else {
  7136. cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
  7137. }
  7138. vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
  7139. #ifdef ENVMAP_MODE_REFLECTION
  7140. vReflect = reflect( cameraToVertex, worldNormal );
  7141. #else
  7142. vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
  7143. #endif
  7144. #endif
  7145. #endif`,kRe=`#ifdef USE_FOG
  7146. vFogDepth = - mvPosition.z;
  7147. #endif`,VRe=`#ifdef USE_FOG
  7148. varying float vFogDepth;
  7149. #endif`,GRe=`#ifdef USE_FOG
  7150. #ifdef FOG_EXP2
  7151. float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
  7152. #else
  7153. float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
  7154. #endif
  7155. gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
  7156. #endif`,HRe=`#ifdef USE_FOG
  7157. uniform vec3 fogColor;
  7158. varying float vFogDepth;
  7159. #ifdef FOG_EXP2
  7160. uniform float fogDensity;
  7161. #else
  7162. uniform float fogNear;
  7163. uniform float fogFar;
  7164. #endif
  7165. #endif`,WRe=`#ifdef USE_GRADIENTMAP
  7166. uniform sampler2D gradientMap;
  7167. #endif
  7168. vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
  7169. float dotNL = dot( normal, lightDirection );
  7170. vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
  7171. #ifdef USE_GRADIENTMAP
  7172. return vec3( texture2D( gradientMap, coord ).r );
  7173. #else
  7174. vec2 fw = fwidth( coord ) * 0.5;
  7175. return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
  7176. #endif
  7177. }`,XRe=`#ifdef USE_LIGHTMAP
  7178. vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
  7179. vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
  7180. reflectedLight.indirectDiffuse += lightMapIrradiance;
  7181. #endif`,YRe=`#ifdef USE_LIGHTMAP
  7182. uniform sampler2D lightMap;
  7183. uniform float lightMapIntensity;
  7184. #endif`,qRe=`LambertMaterial material;
  7185. material.diffuseColor = diffuseColor.rgb;
  7186. material.specularStrength = specularStrength;`,ZRe=`varying vec3 vViewPosition;
  7187. struct LambertMaterial {
  7188. vec3 diffuseColor;
  7189. float specularStrength;
  7190. };
  7191. void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
  7192. float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
  7193. vec3 irradiance = dotNL * directLight.color;
  7194. reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  7195. }
  7196. void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
  7197. reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  7198. }
  7199. #define RE_Direct RE_Direct_Lambert
  7200. #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,jRe=`uniform bool receiveShadow;
  7201. uniform vec3 ambientLightColor;
  7202. #if defined( USE_LIGHT_PROBES )
  7203. uniform vec3 lightProbe[ 9 ];
  7204. #endif
  7205. vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
  7206. float x = normal.x, y = normal.y, z = normal.z;
  7207. vec3 result = shCoefficients[ 0 ] * 0.886227;
  7208. result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
  7209. result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
  7210. result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
  7211. result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
  7212. result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
  7213. result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
  7214. result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
  7215. result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
  7216. return result;
  7217. }
  7218. vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
  7219. vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
  7220. vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
  7221. return irradiance;
  7222. }
  7223. vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
  7224. vec3 irradiance = ambientLightColor;
  7225. return irradiance;
  7226. }
  7227. float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
  7228. #if defined ( LEGACY_LIGHTS )
  7229. if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
  7230. return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
  7231. }
  7232. return 1.0;
  7233. #else
  7234. float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
  7235. if ( cutoffDistance > 0.0 ) {
  7236. distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
  7237. }
  7238. return distanceFalloff;
  7239. #endif
  7240. }
  7241. float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
  7242. return smoothstep( coneCosine, penumbraCosine, angleCosine );
  7243. }
  7244. #if NUM_DIR_LIGHTS > 0
  7245. struct DirectionalLight {
  7246. vec3 direction;
  7247. vec3 color;
  7248. };
  7249. uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
  7250. void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
  7251. light.color = directionalLight.color;
  7252. light.direction = directionalLight.direction;
  7253. light.visible = true;
  7254. }
  7255. #endif
  7256. #if NUM_POINT_LIGHTS > 0
  7257. struct PointLight {
  7258. vec3 position;
  7259. vec3 color;
  7260. float distance;
  7261. float decay;
  7262. };
  7263. uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
  7264. void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
  7265. vec3 lVector = pointLight.position - geometryPosition;
  7266. light.direction = normalize( lVector );
  7267. float lightDistance = length( lVector );
  7268. light.color = pointLight.color;
  7269. light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
  7270. light.visible = ( light.color != vec3( 0.0 ) );
  7271. }
  7272. #endif
  7273. #if NUM_SPOT_LIGHTS > 0
  7274. struct SpotLight {
  7275. vec3 position;
  7276. vec3 direction;
  7277. vec3 color;
  7278. float distance;
  7279. float decay;
  7280. float coneCos;
  7281. float penumbraCos;
  7282. };
  7283. uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
  7284. void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
  7285. vec3 lVector = spotLight.position - geometryPosition;
  7286. light.direction = normalize( lVector );
  7287. float angleCos = dot( light.direction, spotLight.direction );
  7288. float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
  7289. if ( spotAttenuation > 0.0 ) {
  7290. float lightDistance = length( lVector );
  7291. light.color = spotLight.color * spotAttenuation;
  7292. light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
  7293. light.visible = ( light.color != vec3( 0.0 ) );
  7294. } else {
  7295. light.color = vec3( 0.0 );
  7296. light.visible = false;
  7297. }
  7298. }
  7299. #endif
  7300. #if NUM_RECT_AREA_LIGHTS > 0
  7301. struct RectAreaLight {
  7302. vec3 color;
  7303. vec3 position;
  7304. vec3 halfWidth;
  7305. vec3 halfHeight;
  7306. };
  7307. uniform sampler2D ltc_1; uniform sampler2D ltc_2;
  7308. uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
  7309. #endif
  7310. #if NUM_HEMI_LIGHTS > 0
  7311. struct HemisphereLight {
  7312. vec3 direction;
  7313. vec3 skyColor;
  7314. vec3 groundColor;
  7315. };
  7316. uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
  7317. vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
  7318. float dotNL = dot( normal, hemiLight.direction );
  7319. float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
  7320. vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
  7321. return irradiance;
  7322. }
  7323. #endif`,KRe=`#ifdef USE_ENVMAP
  7324. vec3 getIBLIrradiance( const in vec3 normal ) {
  7325. #ifdef ENVMAP_TYPE_CUBE_UV
  7326. vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
  7327. vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
  7328. return PI * envMapColor.rgb * envMapIntensity;
  7329. #else
  7330. return vec3( 0.0 );
  7331. #endif
  7332. }
  7333. vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
  7334. #ifdef ENVMAP_TYPE_CUBE_UV
  7335. vec3 reflectVec = reflect( - viewDir, normal );
  7336. reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
  7337. reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
  7338. vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
  7339. return envMapColor.rgb * envMapIntensity;
  7340. #else
  7341. return vec3( 0.0 );
  7342. #endif
  7343. }
  7344. #ifdef USE_ANISOTROPY
  7345. vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
  7346. #ifdef ENVMAP_TYPE_CUBE_UV
  7347. vec3 bentNormal = cross( bitangent, viewDir );
  7348. bentNormal = normalize( cross( bentNormal, bitangent ) );
  7349. bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
  7350. return getIBLRadiance( viewDir, bentNormal, roughness );
  7351. #else
  7352. return vec3( 0.0 );
  7353. #endif
  7354. }
  7355. #endif
  7356. #endif`,JRe=`ToonMaterial material;
  7357. material.diffuseColor = diffuseColor.rgb;`,$Re=`varying vec3 vViewPosition;
  7358. struct ToonMaterial {
  7359. vec3 diffuseColor;
  7360. };
  7361. void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
  7362. vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
  7363. reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  7364. }
  7365. void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
  7366. reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  7367. }
  7368. #define RE_Direct RE_Direct_Toon
  7369. #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,QRe=`BlinnPhongMaterial material;
  7370. material.diffuseColor = diffuseColor.rgb;
  7371. material.specularColor = specular;
  7372. material.specularShininess = shininess;
  7373. material.specularStrength = specularStrength;`,eLe=`varying vec3 vViewPosition;
  7374. struct BlinnPhongMaterial {
  7375. vec3 diffuseColor;
  7376. vec3 specularColor;
  7377. float specularShininess;
  7378. float specularStrength;
  7379. };
  7380. void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
  7381. float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
  7382. vec3 irradiance = dotNL * directLight.color;
  7383. reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  7384. reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
  7385. }
  7386. void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
  7387. reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  7388. }
  7389. #define RE_Direct RE_Direct_BlinnPhong
  7390. #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,tLe=`PhysicalMaterial material;
  7391. material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
  7392. vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
  7393. float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
  7394. material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
  7395. material.roughness = min( material.roughness, 1.0 );
  7396. #ifdef IOR
  7397. material.ior = ior;
  7398. #ifdef USE_SPECULAR
  7399. float specularIntensityFactor = specularIntensity;
  7400. vec3 specularColorFactor = specularColor;
  7401. #ifdef USE_SPECULAR_COLORMAP
  7402. specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
  7403. #endif
  7404. #ifdef USE_SPECULAR_INTENSITYMAP
  7405. specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
  7406. #endif
  7407. material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
  7408. #else
  7409. float specularIntensityFactor = 1.0;
  7410. vec3 specularColorFactor = vec3( 1.0 );
  7411. material.specularF90 = 1.0;
  7412. #endif
  7413. material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
  7414. #else
  7415. material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
  7416. material.specularF90 = 1.0;
  7417. #endif
  7418. #ifdef USE_CLEARCOAT
  7419. material.clearcoat = clearcoat;
  7420. material.clearcoatRoughness = clearcoatRoughness;
  7421. material.clearcoatF0 = vec3( 0.04 );
  7422. material.clearcoatF90 = 1.0;
  7423. #ifdef USE_CLEARCOATMAP
  7424. material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
  7425. #endif
  7426. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  7427. material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
  7428. #endif
  7429. material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
  7430. material.clearcoatRoughness += geometryRoughness;
  7431. material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
  7432. #endif
  7433. #ifdef USE_IRIDESCENCE
  7434. material.iridescence = iridescence;
  7435. material.iridescenceIOR = iridescenceIOR;
  7436. #ifdef USE_IRIDESCENCEMAP
  7437. material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
  7438. #endif
  7439. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  7440. material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
  7441. #else
  7442. material.iridescenceThickness = iridescenceThicknessMaximum;
  7443. #endif
  7444. #endif
  7445. #ifdef USE_SHEEN
  7446. material.sheenColor = sheenColor;
  7447. #ifdef USE_SHEEN_COLORMAP
  7448. material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
  7449. #endif
  7450. material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
  7451. #ifdef USE_SHEEN_ROUGHNESSMAP
  7452. material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
  7453. #endif
  7454. #endif
  7455. #ifdef USE_ANISOTROPY
  7456. #ifdef USE_ANISOTROPYMAP
  7457. mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
  7458. vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
  7459. vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
  7460. #else
  7461. vec2 anisotropyV = anisotropyVector;
  7462. #endif
  7463. material.anisotropy = length( anisotropyV );
  7464. if( material.anisotropy == 0.0 ) {
  7465. anisotropyV = vec2( 1.0, 0.0 );
  7466. } else {
  7467. anisotropyV /= material.anisotropy;
  7468. material.anisotropy = saturate( material.anisotropy );
  7469. }
  7470. material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
  7471. material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
  7472. material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
  7473. #endif`,rLe=`struct PhysicalMaterial {
  7474. vec3 diffuseColor;
  7475. float roughness;
  7476. vec3 specularColor;
  7477. float specularF90;
  7478. #ifdef USE_CLEARCOAT
  7479. float clearcoat;
  7480. float clearcoatRoughness;
  7481. vec3 clearcoatF0;
  7482. float clearcoatF90;
  7483. #endif
  7484. #ifdef USE_IRIDESCENCE
  7485. float iridescence;
  7486. float iridescenceIOR;
  7487. float iridescenceThickness;
  7488. vec3 iridescenceFresnel;
  7489. vec3 iridescenceF0;
  7490. #endif
  7491. #ifdef USE_SHEEN
  7492. vec3 sheenColor;
  7493. float sheenRoughness;
  7494. #endif
  7495. #ifdef IOR
  7496. float ior;
  7497. #endif
  7498. #ifdef USE_TRANSMISSION
  7499. float transmission;
  7500. float transmissionAlpha;
  7501. float thickness;
  7502. float attenuationDistance;
  7503. vec3 attenuationColor;
  7504. #endif
  7505. #ifdef USE_ANISOTROPY
  7506. float anisotropy;
  7507. float alphaT;
  7508. vec3 anisotropyT;
  7509. vec3 anisotropyB;
  7510. #endif
  7511. };
  7512. vec3 clearcoatSpecularDirect = vec3( 0.0 );
  7513. vec3 clearcoatSpecularIndirect = vec3( 0.0 );
  7514. vec3 sheenSpecularDirect = vec3( 0.0 );
  7515. vec3 sheenSpecularIndirect = vec3(0.0 );
  7516. vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
  7517. float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
  7518. float x2 = x * x;
  7519. float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
  7520. return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
  7521. }
  7522. float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
  7523. float a2 = pow2( alpha );
  7524. float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
  7525. float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
  7526. return 0.5 / max( gv + gl, EPSILON );
  7527. }
  7528. float D_GGX( const in float alpha, const in float dotNH ) {
  7529. float a2 = pow2( alpha );
  7530. float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
  7531. return RECIPROCAL_PI * a2 / pow2( denom );
  7532. }
  7533. #ifdef USE_ANISOTROPY
  7534. float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
  7535. float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
  7536. float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
  7537. float v = 0.5 / ( gv + gl );
  7538. return saturate(v);
  7539. }
  7540. float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
  7541. float a2 = alphaT * alphaB;
  7542. highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
  7543. highp float v2 = dot( v, v );
  7544. float w2 = a2 / v2;
  7545. return RECIPROCAL_PI * a2 * pow2 ( w2 );
  7546. }
  7547. #endif
  7548. #ifdef USE_CLEARCOAT
  7549. vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
  7550. vec3 f0 = material.clearcoatF0;
  7551. float f90 = material.clearcoatF90;
  7552. float roughness = material.clearcoatRoughness;
  7553. float alpha = pow2( roughness );
  7554. vec3 halfDir = normalize( lightDir + viewDir );
  7555. float dotNL = saturate( dot( normal, lightDir ) );
  7556. float dotNV = saturate( dot( normal, viewDir ) );
  7557. float dotNH = saturate( dot( normal, halfDir ) );
  7558. float dotVH = saturate( dot( viewDir, halfDir ) );
  7559. vec3 F = F_Schlick( f0, f90, dotVH );
  7560. float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
  7561. float D = D_GGX( alpha, dotNH );
  7562. return F * ( V * D );
  7563. }
  7564. #endif
  7565. vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
  7566. vec3 f0 = material.specularColor;
  7567. float f90 = material.specularF90;
  7568. float roughness = material.roughness;
  7569. float alpha = pow2( roughness );
  7570. vec3 halfDir = normalize( lightDir + viewDir );
  7571. float dotNL = saturate( dot( normal, lightDir ) );
  7572. float dotNV = saturate( dot( normal, viewDir ) );
  7573. float dotNH = saturate( dot( normal, halfDir ) );
  7574. float dotVH = saturate( dot( viewDir, halfDir ) );
  7575. vec3 F = F_Schlick( f0, f90, dotVH );
  7576. #ifdef USE_IRIDESCENCE
  7577. F = mix( F, material.iridescenceFresnel, material.iridescence );
  7578. #endif
  7579. #ifdef USE_ANISOTROPY
  7580. float dotTL = dot( material.anisotropyT, lightDir );
  7581. float dotTV = dot( material.anisotropyT, viewDir );
  7582. float dotTH = dot( material.anisotropyT, halfDir );
  7583. float dotBL = dot( material.anisotropyB, lightDir );
  7584. float dotBV = dot( material.anisotropyB, viewDir );
  7585. float dotBH = dot( material.anisotropyB, halfDir );
  7586. float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
  7587. float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
  7588. #else
  7589. float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
  7590. float D = D_GGX( alpha, dotNH );
  7591. #endif
  7592. return F * ( V * D );
  7593. }
  7594. vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
  7595. const float LUT_SIZE = 64.0;
  7596. const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
  7597. const float LUT_BIAS = 0.5 / LUT_SIZE;
  7598. float dotNV = saturate( dot( N, V ) );
  7599. vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
  7600. uv = uv * LUT_SCALE + LUT_BIAS;
  7601. return uv;
  7602. }
  7603. float LTC_ClippedSphereFormFactor( const in vec3 f ) {
  7604. float l = length( f );
  7605. return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
  7606. }
  7607. vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
  7608. float x = dot( v1, v2 );
  7609. float y = abs( x );
  7610. float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
  7611. float b = 3.4175940 + ( 4.1616724 + y ) * y;
  7612. float v = a / b;
  7613. float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
  7614. return cross( v1, v2 ) * theta_sintheta;
  7615. }
  7616. vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
  7617. vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
  7618. vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
  7619. vec3 lightNormal = cross( v1, v2 );
  7620. if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
  7621. vec3 T1, T2;
  7622. T1 = normalize( V - N * dot( V, N ) );
  7623. T2 = - cross( N, T1 );
  7624. mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
  7625. vec3 coords[ 4 ];
  7626. coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
  7627. coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
  7628. coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
  7629. coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
  7630. coords[ 0 ] = normalize( coords[ 0 ] );
  7631. coords[ 1 ] = normalize( coords[ 1 ] );
  7632. coords[ 2 ] = normalize( coords[ 2 ] );
  7633. coords[ 3 ] = normalize( coords[ 3 ] );
  7634. vec3 vectorFormFactor = vec3( 0.0 );
  7635. vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
  7636. vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
  7637. vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
  7638. vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
  7639. float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
  7640. return vec3( result );
  7641. }
  7642. #if defined( USE_SHEEN )
  7643. float D_Charlie( float roughness, float dotNH ) {
  7644. float alpha = pow2( roughness );
  7645. float invAlpha = 1.0 / alpha;
  7646. float cos2h = dotNH * dotNH;
  7647. float sin2h = max( 1.0 - cos2h, 0.0078125 );
  7648. return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
  7649. }
  7650. float V_Neubelt( float dotNV, float dotNL ) {
  7651. return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
  7652. }
  7653. vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
  7654. vec3 halfDir = normalize( lightDir + viewDir );
  7655. float dotNL = saturate( dot( normal, lightDir ) );
  7656. float dotNV = saturate( dot( normal, viewDir ) );
  7657. float dotNH = saturate( dot( normal, halfDir ) );
  7658. float D = D_Charlie( sheenRoughness, dotNH );
  7659. float V = V_Neubelt( dotNV, dotNL );
  7660. return sheenColor * ( D * V );
  7661. }
  7662. #endif
  7663. float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
  7664. float dotNV = saturate( dot( normal, viewDir ) );
  7665. float r2 = roughness * roughness;
  7666. float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
  7667. float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
  7668. float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
  7669. return saturate( DG * RECIPROCAL_PI );
  7670. }
  7671. vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
  7672. float dotNV = saturate( dot( normal, viewDir ) );
  7673. const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
  7674. const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
  7675. vec4 r = roughness * c0 + c1;
  7676. float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
  7677. vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
  7678. return fab;
  7679. }
  7680. vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
  7681. vec2 fab = DFGApprox( normal, viewDir, roughness );
  7682. return specularColor * fab.x + specularF90 * fab.y;
  7683. }
  7684. #ifdef USE_IRIDESCENCE
  7685. void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
  7686. #else
  7687. void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
  7688. #endif
  7689. vec2 fab = DFGApprox( normal, viewDir, roughness );
  7690. #ifdef USE_IRIDESCENCE
  7691. vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
  7692. #else
  7693. vec3 Fr = specularColor;
  7694. #endif
  7695. vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
  7696. float Ess = fab.x + fab.y;
  7697. float Ems = 1.0 - Ess;
  7698. vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
  7699. singleScatter += FssEss;
  7700. multiScatter += Fms * Ems;
  7701. }
  7702. #if NUM_RECT_AREA_LIGHTS > 0
  7703. void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  7704. vec3 normal = geometryNormal;
  7705. vec3 viewDir = geometryViewDir;
  7706. vec3 position = geometryPosition;
  7707. vec3 lightPos = rectAreaLight.position;
  7708. vec3 halfWidth = rectAreaLight.halfWidth;
  7709. vec3 halfHeight = rectAreaLight.halfHeight;
  7710. vec3 lightColor = rectAreaLight.color;
  7711. float roughness = material.roughness;
  7712. vec3 rectCoords[ 4 ];
  7713. rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
  7714. rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
  7715. rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
  7716. vec2 uv = LTC_Uv( normal, viewDir, roughness );
  7717. vec4 t1 = texture2D( ltc_1, uv );
  7718. vec4 t2 = texture2D( ltc_2, uv );
  7719. mat3 mInv = mat3(
  7720. vec3( t1.x, 0, t1.y ),
  7721. vec3( 0, 1, 0 ),
  7722. vec3( t1.z, 0, t1.w )
  7723. );
  7724. vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
  7725. reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
  7726. reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
  7727. }
  7728. #endif
  7729. void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  7730. float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
  7731. vec3 irradiance = dotNL * directLight.color;
  7732. #ifdef USE_CLEARCOAT
  7733. float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
  7734. vec3 ccIrradiance = dotNLcc * directLight.color;
  7735. clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
  7736. #endif
  7737. #ifdef USE_SHEEN
  7738. sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
  7739. #endif
  7740. reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
  7741. reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  7742. }
  7743. void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
  7744. reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
  7745. }
  7746. void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
  7747. #ifdef USE_CLEARCOAT
  7748. clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
  7749. #endif
  7750. #ifdef USE_SHEEN
  7751. sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
  7752. #endif
  7753. vec3 singleScattering = vec3( 0.0 );
  7754. vec3 multiScattering = vec3( 0.0 );
  7755. vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
  7756. #ifdef USE_IRIDESCENCE
  7757. computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
  7758. #else
  7759. computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
  7760. #endif
  7761. vec3 totalScattering = singleScattering + multiScattering;
  7762. vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
  7763. reflectedLight.indirectSpecular += radiance * singleScattering;
  7764. reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
  7765. reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
  7766. }
  7767. #define RE_Direct RE_Direct_Physical
  7768. #define RE_Direct_RectArea RE_Direct_RectArea_Physical
  7769. #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
  7770. #define RE_IndirectSpecular RE_IndirectSpecular_Physical
  7771. float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
  7772. return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
  7773. }`,iLe=`
  7774. vec3 geometryPosition = - vViewPosition;
  7775. vec3 geometryNormal = normal;
  7776. vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
  7777. vec3 geometryClearcoatNormal = vec3( 0.0 );
  7778. #ifdef USE_CLEARCOAT
  7779. geometryClearcoatNormal = clearcoatNormal;
  7780. #endif
  7781. #ifdef USE_IRIDESCENCE
  7782. float dotNVi = saturate( dot( normal, geometryViewDir ) );
  7783. if ( material.iridescenceThickness == 0.0 ) {
  7784. material.iridescence = 0.0;
  7785. } else {
  7786. material.iridescence = saturate( material.iridescence );
  7787. }
  7788. if ( material.iridescence > 0.0 ) {
  7789. material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
  7790. material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
  7791. }
  7792. #endif
  7793. IncidentLight directLight;
  7794. #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
  7795. PointLight pointLight;
  7796. #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
  7797. PointLightShadow pointLightShadow;
  7798. #endif
  7799. #pragma unroll_loop_start
  7800. for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
  7801. pointLight = pointLights[ i ];
  7802. getPointLightInfo( pointLight, geometryPosition, directLight );
  7803. #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
  7804. pointLightShadow = pointLightShadows[ i ];
  7805. directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
  7806. #endif
  7807. RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  7808. }
  7809. #pragma unroll_loop_end
  7810. #endif
  7811. #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
  7812. SpotLight spotLight;
  7813. vec4 spotColor;
  7814. vec3 spotLightCoord;
  7815. bool inSpotLightMap;
  7816. #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
  7817. SpotLightShadow spotLightShadow;
  7818. #endif
  7819. #pragma unroll_loop_start
  7820. for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
  7821. spotLight = spotLights[ i ];
  7822. getSpotLightInfo( spotLight, geometryPosition, directLight );
  7823. #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
  7824. #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
  7825. #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
  7826. #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
  7827. #else
  7828. #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
  7829. #endif
  7830. #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
  7831. spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
  7832. inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
  7833. spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
  7834. directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
  7835. #endif
  7836. #undef SPOT_LIGHT_MAP_INDEX
  7837. #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
  7838. spotLightShadow = spotLightShadows[ i ];
  7839. directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
  7840. #endif
  7841. RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  7842. }
  7843. #pragma unroll_loop_end
  7844. #endif
  7845. #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
  7846. DirectionalLight directionalLight;
  7847. #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
  7848. DirectionalLightShadow directionalLightShadow;
  7849. #endif
  7850. #pragma unroll_loop_start
  7851. for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
  7852. directionalLight = directionalLights[ i ];
  7853. getDirectionalLightInfo( directionalLight, directLight );
  7854. #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
  7855. directionalLightShadow = directionalLightShadows[ i ];
  7856. directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
  7857. #endif
  7858. RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  7859. }
  7860. #pragma unroll_loop_end
  7861. #endif
  7862. #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
  7863. RectAreaLight rectAreaLight;
  7864. #pragma unroll_loop_start
  7865. for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
  7866. rectAreaLight = rectAreaLights[ i ];
  7867. RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  7868. }
  7869. #pragma unroll_loop_end
  7870. #endif
  7871. #if defined( RE_IndirectDiffuse )
  7872. vec3 iblIrradiance = vec3( 0.0 );
  7873. vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
  7874. #if defined( USE_LIGHT_PROBES )
  7875. irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
  7876. #endif
  7877. #if ( NUM_HEMI_LIGHTS > 0 )
  7878. #pragma unroll_loop_start
  7879. for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
  7880. irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
  7881. }
  7882. #pragma unroll_loop_end
  7883. #endif
  7884. #endif
  7885. #if defined( RE_IndirectSpecular )
  7886. vec3 radiance = vec3( 0.0 );
  7887. vec3 clearcoatRadiance = vec3( 0.0 );
  7888. #endif`,nLe=`#if defined( RE_IndirectDiffuse )
  7889. #ifdef USE_LIGHTMAP
  7890. vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
  7891. vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
  7892. irradiance += lightMapIrradiance;
  7893. #endif
  7894. #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
  7895. iblIrradiance += getIBLIrradiance( geometryNormal );
  7896. #endif
  7897. #endif
  7898. #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
  7899. #ifdef USE_ANISOTROPY
  7900. radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
  7901. #else
  7902. radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
  7903. #endif
  7904. #ifdef USE_CLEARCOAT
  7905. clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
  7906. #endif
  7907. #endif`,aLe=`#if defined( RE_IndirectDiffuse )
  7908. RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  7909. #endif
  7910. #if defined( RE_IndirectSpecular )
  7911. RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
  7912. #endif`,oLe=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
  7913. gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
  7914. #endif`,sLe=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
  7915. uniform float logDepthBufFC;
  7916. varying float vFragDepth;
  7917. varying float vIsPerspective;
  7918. #endif`,lLe=`#ifdef USE_LOGDEPTHBUF
  7919. #ifdef USE_LOGDEPTHBUF_EXT
  7920. varying float vFragDepth;
  7921. varying float vIsPerspective;
  7922. #else
  7923. uniform float logDepthBufFC;
  7924. #endif
  7925. #endif`,uLe=`#ifdef USE_LOGDEPTHBUF
  7926. #ifdef USE_LOGDEPTHBUF_EXT
  7927. vFragDepth = 1.0 + gl_Position.w;
  7928. vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
  7929. #else
  7930. if ( isPerspectiveMatrix( projectionMatrix ) ) {
  7931. gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
  7932. gl_Position.z *= gl_Position.w;
  7933. }
  7934. #endif
  7935. #endif`,cLe=`#ifdef USE_MAP
  7936. vec4 sampledDiffuseColor = texture2D( map, vMapUv );
  7937. #ifdef DECODE_VIDEO_TEXTURE
  7938. sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
  7939. #endif
  7940. diffuseColor *= sampledDiffuseColor;
  7941. #endif`,hLe=`#ifdef USE_MAP
  7942. uniform sampler2D map;
  7943. #endif`,fLe=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
  7944. #if defined( USE_POINTS_UV )
  7945. vec2 uv = vUv;
  7946. #else
  7947. vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
  7948. #endif
  7949. #endif
  7950. #ifdef USE_MAP
  7951. diffuseColor *= texture2D( map, uv );
  7952. #endif
  7953. #ifdef USE_ALPHAMAP
  7954. diffuseColor.a *= texture2D( alphaMap, uv ).g;
  7955. #endif`,pLe=`#if defined( USE_POINTS_UV )
  7956. varying vec2 vUv;
  7957. #else
  7958. #if defined( USE_MAP ) || defined( USE_ALPHAMAP )
  7959. uniform mat3 uvTransform;
  7960. #endif
  7961. #endif
  7962. #ifdef USE_MAP
  7963. uniform sampler2D map;
  7964. #endif
  7965. #ifdef USE_ALPHAMAP
  7966. uniform sampler2D alphaMap;
  7967. #endif`,dLe=`float metalnessFactor = metalness;
  7968. #ifdef USE_METALNESSMAP
  7969. vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
  7970. metalnessFactor *= texelMetalness.b;
  7971. #endif`,mLe=`#ifdef USE_METALNESSMAP
  7972. uniform sampler2D metalnessMap;
  7973. #endif`,vLe=`#ifdef USE_INSTANCING_MORPH
  7974. float morphTargetInfluences[MORPHTARGETS_COUNT];
  7975. float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
  7976. for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  7977. morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
  7978. }
  7979. #endif`,gLe=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
  7980. vColor *= morphTargetBaseInfluence;
  7981. for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  7982. #if defined( USE_COLOR_ALPHA )
  7983. if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
  7984. #elif defined( USE_COLOR )
  7985. if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
  7986. #endif
  7987. }
  7988. #endif`,yLe=`#ifdef USE_MORPHNORMALS
  7989. objectNormal *= morphTargetBaseInfluence;
  7990. #ifdef MORPHTARGETS_TEXTURE
  7991. for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  7992. if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
  7993. }
  7994. #else
  7995. objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
  7996. objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
  7997. objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
  7998. objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
  7999. #endif
  8000. #endif`,_Le=`#ifdef USE_MORPHTARGETS
  8001. #ifndef USE_INSTANCING_MORPH
  8002. uniform float morphTargetBaseInfluence;
  8003. #endif
  8004. #ifdef MORPHTARGETS_TEXTURE
  8005. #ifndef USE_INSTANCING_MORPH
  8006. uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
  8007. #endif
  8008. uniform sampler2DArray morphTargetsTexture;
  8009. uniform ivec2 morphTargetsTextureSize;
  8010. vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
  8011. int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
  8012. int y = texelIndex / morphTargetsTextureSize.x;
  8013. int x = texelIndex - y * morphTargetsTextureSize.x;
  8014. ivec3 morphUV = ivec3( x, y, morphTargetIndex );
  8015. return texelFetch( morphTargetsTexture, morphUV, 0 );
  8016. }
  8017. #else
  8018. #ifndef USE_MORPHNORMALS
  8019. uniform float morphTargetInfluences[ 8 ];
  8020. #else
  8021. uniform float morphTargetInfluences[ 4 ];
  8022. #endif
  8023. #endif
  8024. #endif`,xLe=`#ifdef USE_MORPHTARGETS
  8025. transformed *= morphTargetBaseInfluence;
  8026. #ifdef MORPHTARGETS_TEXTURE
  8027. for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  8028. if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
  8029. }
  8030. #else
  8031. transformed += morphTarget0 * morphTargetInfluences[ 0 ];
  8032. transformed += morphTarget1 * morphTargetInfluences[ 1 ];
  8033. transformed += morphTarget2 * morphTargetInfluences[ 2 ];
  8034. transformed += morphTarget3 * morphTargetInfluences[ 3 ];
  8035. #ifndef USE_MORPHNORMALS
  8036. transformed += morphTarget4 * morphTargetInfluences[ 4 ];
  8037. transformed += morphTarget5 * morphTargetInfluences[ 5 ];
  8038. transformed += morphTarget6 * morphTargetInfluences[ 6 ];
  8039. transformed += morphTarget7 * morphTargetInfluences[ 7 ];
  8040. #endif
  8041. #endif
  8042. #endif`,SLe=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
  8043. #ifdef FLAT_SHADED
  8044. vec3 fdx = dFdx( vViewPosition );
  8045. vec3 fdy = dFdy( vViewPosition );
  8046. vec3 normal = normalize( cross( fdx, fdy ) );
  8047. #else
  8048. vec3 normal = normalize( vNormal );
  8049. #ifdef DOUBLE_SIDED
  8050. normal *= faceDirection;
  8051. #endif
  8052. #endif
  8053. #if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
  8054. #ifdef USE_TANGENT
  8055. mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
  8056. #else
  8057. mat3 tbn = getTangentFrame( - vViewPosition, normal,
  8058. #if defined( USE_NORMALMAP )
  8059. vNormalMapUv
  8060. #elif defined( USE_CLEARCOAT_NORMALMAP )
  8061. vClearcoatNormalMapUv
  8062. #else
  8063. vUv
  8064. #endif
  8065. );
  8066. #endif
  8067. #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
  8068. tbn[0] *= faceDirection;
  8069. tbn[1] *= faceDirection;
  8070. #endif
  8071. #endif
  8072. #ifdef USE_CLEARCOAT_NORMALMAP
  8073. #ifdef USE_TANGENT
  8074. mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
  8075. #else
  8076. mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
  8077. #endif
  8078. #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
  8079. tbn2[0] *= faceDirection;
  8080. tbn2[1] *= faceDirection;
  8081. #endif
  8082. #endif
  8083. vec3 nonPerturbedNormal = normal;`,MLe=`#ifdef USE_NORMALMAP_OBJECTSPACE
  8084. normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
  8085. #ifdef FLIP_SIDED
  8086. normal = - normal;
  8087. #endif
  8088. #ifdef DOUBLE_SIDED
  8089. normal = normal * faceDirection;
  8090. #endif
  8091. normal = normalize( normalMatrix * normal );
  8092. #elif defined( USE_NORMALMAP_TANGENTSPACE )
  8093. vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
  8094. mapN.xy *= normalScale;
  8095. normal = normalize( tbn * mapN );
  8096. #elif defined( USE_BUMPMAP )
  8097. normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
  8098. #endif`,bLe=`#ifndef FLAT_SHADED
  8099. varying vec3 vNormal;
  8100. #ifdef USE_TANGENT
  8101. varying vec3 vTangent;
  8102. varying vec3 vBitangent;
  8103. #endif
  8104. #endif`,wLe=`#ifndef FLAT_SHADED
  8105. varying vec3 vNormal;
  8106. #ifdef USE_TANGENT
  8107. varying vec3 vTangent;
  8108. varying vec3 vBitangent;
  8109. #endif
  8110. #endif`,TLe=`#ifndef FLAT_SHADED
  8111. vNormal = normalize( transformedNormal );
  8112. #ifdef USE_TANGENT
  8113. vTangent = normalize( transformedTangent );
  8114. vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
  8115. #endif
  8116. #endif`,ELe=`#ifdef USE_NORMALMAP
  8117. uniform sampler2D normalMap;
  8118. uniform vec2 normalScale;
  8119. #endif
  8120. #ifdef USE_NORMALMAP_OBJECTSPACE
  8121. uniform mat3 normalMatrix;
  8122. #endif
  8123. #if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
  8124. mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
  8125. vec3 q0 = dFdx( eye_pos.xyz );
  8126. vec3 q1 = dFdy( eye_pos.xyz );
  8127. vec2 st0 = dFdx( uv.st );
  8128. vec2 st1 = dFdy( uv.st );
  8129. vec3 N = surf_norm;
  8130. vec3 q1perp = cross( q1, N );
  8131. vec3 q0perp = cross( N, q0 );
  8132. vec3 T = q1perp * st0.x + q0perp * st1.x;
  8133. vec3 B = q1perp * st0.y + q0perp * st1.y;
  8134. float det = max( dot( T, T ), dot( B, B ) );
  8135. float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
  8136. return mat3( T * scale, B * scale, N );
  8137. }
  8138. #endif`,ALe=`#ifdef USE_CLEARCOAT
  8139. vec3 clearcoatNormal = nonPerturbedNormal;
  8140. #endif`,CLe=`#ifdef USE_CLEARCOAT_NORMALMAP
  8141. vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
  8142. clearcoatMapN.xy *= clearcoatNormalScale;
  8143. clearcoatNormal = normalize( tbn2 * clearcoatMapN );
  8144. #endif`,RLe=`#ifdef USE_CLEARCOATMAP
  8145. uniform sampler2D clearcoatMap;
  8146. #endif
  8147. #ifdef USE_CLEARCOAT_NORMALMAP
  8148. uniform sampler2D clearcoatNormalMap;
  8149. uniform vec2 clearcoatNormalScale;
  8150. #endif
  8151. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  8152. uniform sampler2D clearcoatRoughnessMap;
  8153. #endif`,LLe=`#ifdef USE_IRIDESCENCEMAP
  8154. uniform sampler2D iridescenceMap;
  8155. #endif
  8156. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  8157. uniform sampler2D iridescenceThicknessMap;
  8158. #endif`,DLe=`#ifdef OPAQUE
  8159. diffuseColor.a = 1.0;
  8160. #endif
  8161. #ifdef USE_TRANSMISSION
  8162. diffuseColor.a *= material.transmissionAlpha;
  8163. #endif
  8164. gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,PLe=`vec3 packNormalToRGB( const in vec3 normal ) {
  8165. return normalize( normal ) * 0.5 + 0.5;
  8166. }
  8167. vec3 unpackRGBToNormal( const in vec3 rgb ) {
  8168. return 2.0 * rgb.xyz - 1.0;
  8169. }
  8170. const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
  8171. const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
  8172. const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
  8173. const float ShiftRight8 = 1. / 256.;
  8174. vec4 packDepthToRGBA( const in float v ) {
  8175. vec4 r = vec4( fract( v * PackFactors ), v );
  8176. r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
  8177. }
  8178. float unpackRGBAToDepth( const in vec4 v ) {
  8179. return dot( v, UnpackFactors );
  8180. }
  8181. vec2 packDepthToRG( in highp float v ) {
  8182. return packDepthToRGBA( v ).yx;
  8183. }
  8184. float unpackRGToDepth( const in highp vec2 v ) {
  8185. return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );
  8186. }
  8187. vec4 pack2HalfToRGBA( vec2 v ) {
  8188. vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
  8189. return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
  8190. }
  8191. vec2 unpackRGBATo2Half( vec4 v ) {
  8192. return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
  8193. }
  8194. float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
  8195. return ( viewZ + near ) / ( near - far );
  8196. }
  8197. float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
  8198. return depth * ( near - far ) - near;
  8199. }
  8200. float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
  8201. return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
  8202. }
  8203. float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
  8204. return ( near * far ) / ( ( far - near ) * depth - far );
  8205. }`,ILe=`#ifdef PREMULTIPLIED_ALPHA
  8206. gl_FragColor.rgb *= gl_FragColor.a;
  8207. #endif`,NLe=`vec4 mvPosition = vec4( transformed, 1.0 );
  8208. #ifdef USE_BATCHING
  8209. mvPosition = batchingMatrix * mvPosition;
  8210. #endif
  8211. #ifdef USE_INSTANCING
  8212. mvPosition = instanceMatrix * mvPosition;
  8213. #endif
  8214. mvPosition = modelViewMatrix * mvPosition;
  8215. gl_Position = projectionMatrix * mvPosition;`,ULe=`#ifdef DITHERING
  8216. gl_FragColor.rgb = dithering( gl_FragColor.rgb );
  8217. #endif`,OLe=`#ifdef DITHERING
  8218. vec3 dithering( vec3 color ) {
  8219. float grid_position = rand( gl_FragCoord.xy );
  8220. vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
  8221. dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
  8222. return color + dither_shift_RGB;
  8223. }
  8224. #endif`,zLe=`float roughnessFactor = roughness;
  8225. #ifdef USE_ROUGHNESSMAP
  8226. vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
  8227. roughnessFactor *= texelRoughness.g;
  8228. #endif`,FLe=`#ifdef USE_ROUGHNESSMAP
  8229. uniform sampler2D roughnessMap;
  8230. #endif`,BLe=`#if NUM_SPOT_LIGHT_COORDS > 0
  8231. varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
  8232. #endif
  8233. #if NUM_SPOT_LIGHT_MAPS > 0
  8234. uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
  8235. #endif
  8236. #ifdef USE_SHADOWMAP
  8237. #if NUM_DIR_LIGHT_SHADOWS > 0
  8238. uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
  8239. varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
  8240. struct DirectionalLightShadow {
  8241. float shadowBias;
  8242. float shadowNormalBias;
  8243. float shadowRadius;
  8244. vec2 shadowMapSize;
  8245. };
  8246. uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
  8247. #endif
  8248. #if NUM_SPOT_LIGHT_SHADOWS > 0
  8249. uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
  8250. struct SpotLightShadow {
  8251. float shadowBias;
  8252. float shadowNormalBias;
  8253. float shadowRadius;
  8254. vec2 shadowMapSize;
  8255. };
  8256. uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
  8257. #endif
  8258. #if NUM_POINT_LIGHT_SHADOWS > 0
  8259. uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
  8260. varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
  8261. struct PointLightShadow {
  8262. float shadowBias;
  8263. float shadowNormalBias;
  8264. float shadowRadius;
  8265. vec2 shadowMapSize;
  8266. float shadowCameraNear;
  8267. float shadowCameraFar;
  8268. };
  8269. uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
  8270. #endif
  8271. float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
  8272. return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
  8273. }
  8274. vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
  8275. return unpackRGBATo2Half( texture2D( shadow, uv ) );
  8276. }
  8277. float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
  8278. float occlusion = 1.0;
  8279. vec2 distribution = texture2DDistribution( shadow, uv );
  8280. float hard_shadow = step( compare , distribution.x );
  8281. if (hard_shadow != 1.0 ) {
  8282. float distance = compare - distribution.x ;
  8283. float variance = max( 0.00000, distribution.y * distribution.y );
  8284. float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
  8285. }
  8286. return occlusion;
  8287. }
  8288. float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
  8289. float shadow = 1.0;
  8290. shadowCoord.xyz /= shadowCoord.w;
  8291. shadowCoord.z += shadowBias;
  8292. bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
  8293. bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
  8294. if ( frustumTest ) {
  8295. #if defined( SHADOWMAP_TYPE_PCF )
  8296. vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
  8297. float dx0 = - texelSize.x * shadowRadius;
  8298. float dy0 = - texelSize.y * shadowRadius;
  8299. float dx1 = + texelSize.x * shadowRadius;
  8300. float dy1 = + texelSize.y * shadowRadius;
  8301. float dx2 = dx0 / 2.0;
  8302. float dy2 = dy0 / 2.0;
  8303. float dx3 = dx1 / 2.0;
  8304. float dy3 = dy1 / 2.0;
  8305. shadow = (
  8306. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
  8307. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
  8308. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
  8309. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
  8310. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
  8311. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
  8312. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
  8313. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
  8314. texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
  8315. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
  8316. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
  8317. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
  8318. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
  8319. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
  8320. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
  8321. texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
  8322. texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
  8323. ) * ( 1.0 / 17.0 );
  8324. #elif defined( SHADOWMAP_TYPE_PCF_SOFT )
  8325. vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
  8326. float dx = texelSize.x;
  8327. float dy = texelSize.y;
  8328. vec2 uv = shadowCoord.xy;
  8329. vec2 f = fract( uv * shadowMapSize + 0.5 );
  8330. uv -= f * texelSize;
  8331. shadow = (
  8332. texture2DCompare( shadowMap, uv, shadowCoord.z ) +
  8333. texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
  8334. texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
  8335. texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
  8336. mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
  8337. texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
  8338. f.x ) +
  8339. mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
  8340. texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
  8341. f.x ) +
  8342. mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
  8343. texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
  8344. f.y ) +
  8345. mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
  8346. texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
  8347. f.y ) +
  8348. mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
  8349. texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
  8350. f.x ),
  8351. mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
  8352. texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
  8353. f.x ),
  8354. f.y )
  8355. ) * ( 1.0 / 9.0 );
  8356. #elif defined( SHADOWMAP_TYPE_VSM )
  8357. shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
  8358. #else
  8359. shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
  8360. #endif
  8361. }
  8362. return shadow;
  8363. }
  8364. vec2 cubeToUV( vec3 v, float texelSizeY ) {
  8365. vec3 absV = abs( v );
  8366. float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
  8367. absV *= scaleToCube;
  8368. v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
  8369. vec2 planar = v.xy;
  8370. float almostATexel = 1.5 * texelSizeY;
  8371. float almostOne = 1.0 - almostATexel;
  8372. if ( absV.z >= almostOne ) {
  8373. if ( v.z > 0.0 )
  8374. planar.x = 4.0 - v.x;
  8375. } else if ( absV.x >= almostOne ) {
  8376. float signX = sign( v.x );
  8377. planar.x = v.z * signX + 2.0 * signX;
  8378. } else if ( absV.y >= almostOne ) {
  8379. float signY = sign( v.y );
  8380. planar.x = v.x + 2.0 * signY + 2.0;
  8381. planar.y = v.z * signY - 2.0;
  8382. }
  8383. return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
  8384. }
  8385. float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
  8386. vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
  8387. vec3 lightToPosition = shadowCoord.xyz;
  8388. float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
  8389. vec3 bd3D = normalize( lightToPosition );
  8390. #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
  8391. vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
  8392. return (
  8393. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
  8394. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
  8395. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
  8396. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
  8397. texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
  8398. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
  8399. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
  8400. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
  8401. texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
  8402. ) * ( 1.0 / 9.0 );
  8403. #else
  8404. return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
  8405. #endif
  8406. }
  8407. #endif`,kLe=`#if NUM_SPOT_LIGHT_COORDS > 0
  8408. uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
  8409. varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
  8410. #endif
  8411. #ifdef USE_SHADOWMAP
  8412. #if NUM_DIR_LIGHT_SHADOWS > 0
  8413. uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
  8414. varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
  8415. struct DirectionalLightShadow {
  8416. float shadowBias;
  8417. float shadowNormalBias;
  8418. float shadowRadius;
  8419. vec2 shadowMapSize;
  8420. };
  8421. uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
  8422. #endif
  8423. #if NUM_SPOT_LIGHT_SHADOWS > 0
  8424. struct SpotLightShadow {
  8425. float shadowBias;
  8426. float shadowNormalBias;
  8427. float shadowRadius;
  8428. vec2 shadowMapSize;
  8429. };
  8430. uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
  8431. #endif
  8432. #if NUM_POINT_LIGHT_SHADOWS > 0
  8433. uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
  8434. varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
  8435. struct PointLightShadow {
  8436. float shadowBias;
  8437. float shadowNormalBias;
  8438. float shadowRadius;
  8439. vec2 shadowMapSize;
  8440. float shadowCameraNear;
  8441. float shadowCameraFar;
  8442. };
  8443. uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
  8444. #endif
  8445. #endif`,VLe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
  8446. vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
  8447. vec4 shadowWorldPosition;
  8448. #endif
  8449. #if defined( USE_SHADOWMAP )
  8450. #if NUM_DIR_LIGHT_SHADOWS > 0
  8451. #pragma unroll_loop_start
  8452. for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
  8453. shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
  8454. vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
  8455. }
  8456. #pragma unroll_loop_end
  8457. #endif
  8458. #if NUM_POINT_LIGHT_SHADOWS > 0
  8459. #pragma unroll_loop_start
  8460. for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
  8461. shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
  8462. vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
  8463. }
  8464. #pragma unroll_loop_end
  8465. #endif
  8466. #endif
  8467. #if NUM_SPOT_LIGHT_COORDS > 0
  8468. #pragma unroll_loop_start
  8469. for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
  8470. shadowWorldPosition = worldPosition;
  8471. #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
  8472. shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
  8473. #endif
  8474. vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
  8475. }
  8476. #pragma unroll_loop_end
  8477. #endif`,GLe=`float getShadowMask() {
  8478. float shadow = 1.0;
  8479. #ifdef USE_SHADOWMAP
  8480. #if NUM_DIR_LIGHT_SHADOWS > 0
  8481. DirectionalLightShadow directionalLight;
  8482. #pragma unroll_loop_start
  8483. for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
  8484. directionalLight = directionalLightShadows[ i ];
  8485. shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
  8486. }
  8487. #pragma unroll_loop_end
  8488. #endif
  8489. #if NUM_SPOT_LIGHT_SHADOWS > 0
  8490. SpotLightShadow spotLight;
  8491. #pragma unroll_loop_start
  8492. for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
  8493. spotLight = spotLightShadows[ i ];
  8494. shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
  8495. }
  8496. #pragma unroll_loop_end
  8497. #endif
  8498. #if NUM_POINT_LIGHT_SHADOWS > 0
  8499. PointLightShadow pointLight;
  8500. #pragma unroll_loop_start
  8501. for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
  8502. pointLight = pointLightShadows[ i ];
  8503. shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
  8504. }
  8505. #pragma unroll_loop_end
  8506. #endif
  8507. #endif
  8508. return shadow;
  8509. }`,HLe=`#ifdef USE_SKINNING
  8510. mat4 boneMatX = getBoneMatrix( skinIndex.x );
  8511. mat4 boneMatY = getBoneMatrix( skinIndex.y );
  8512. mat4 boneMatZ = getBoneMatrix( skinIndex.z );
  8513. mat4 boneMatW = getBoneMatrix( skinIndex.w );
  8514. #endif`,WLe=`#ifdef USE_SKINNING
  8515. uniform mat4 bindMatrix;
  8516. uniform mat4 bindMatrixInverse;
  8517. uniform highp sampler2D boneTexture;
  8518. mat4 getBoneMatrix( const in float i ) {
  8519. int size = textureSize( boneTexture, 0 ).x;
  8520. int j = int( i ) * 4;
  8521. int x = j % size;
  8522. int y = j / size;
  8523. vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
  8524. vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
  8525. vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
  8526. vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
  8527. return mat4( v1, v2, v3, v4 );
  8528. }
  8529. #endif`,XLe=`#ifdef USE_SKINNING
  8530. vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
  8531. vec4 skinned = vec4( 0.0 );
  8532. skinned += boneMatX * skinVertex * skinWeight.x;
  8533. skinned += boneMatY * skinVertex * skinWeight.y;
  8534. skinned += boneMatZ * skinVertex * skinWeight.z;
  8535. skinned += boneMatW * skinVertex * skinWeight.w;
  8536. transformed = ( bindMatrixInverse * skinned ).xyz;
  8537. #endif`,YLe=`#ifdef USE_SKINNING
  8538. mat4 skinMatrix = mat4( 0.0 );
  8539. skinMatrix += skinWeight.x * boneMatX;
  8540. skinMatrix += skinWeight.y * boneMatY;
  8541. skinMatrix += skinWeight.z * boneMatZ;
  8542. skinMatrix += skinWeight.w * boneMatW;
  8543. skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
  8544. objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
  8545. #ifdef USE_TANGENT
  8546. objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
  8547. #endif
  8548. #endif`,qLe=`float specularStrength;
  8549. #ifdef USE_SPECULARMAP
  8550. vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
  8551. specularStrength = texelSpecular.r;
  8552. #else
  8553. specularStrength = 1.0;
  8554. #endif`,ZLe=`#ifdef USE_SPECULARMAP
  8555. uniform sampler2D specularMap;
  8556. #endif`,jLe=`#if defined( TONE_MAPPING )
  8557. gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
  8558. #endif`,KLe=`#ifndef saturate
  8559. #define saturate( a ) clamp( a, 0.0, 1.0 )
  8560. #endif
  8561. uniform float toneMappingExposure;
  8562. vec3 LinearToneMapping( vec3 color ) {
  8563. return saturate( toneMappingExposure * color );
  8564. }
  8565. vec3 ReinhardToneMapping( vec3 color ) {
  8566. color *= toneMappingExposure;
  8567. return saturate( color / ( vec3( 1.0 ) + color ) );
  8568. }
  8569. vec3 OptimizedCineonToneMapping( vec3 color ) {
  8570. color *= toneMappingExposure;
  8571. color = max( vec3( 0.0 ), color - 0.004 );
  8572. return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
  8573. }
  8574. vec3 RRTAndODTFit( vec3 v ) {
  8575. vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
  8576. vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
  8577. return a / b;
  8578. }
  8579. vec3 ACESFilmicToneMapping( vec3 color ) {
  8580. const mat3 ACESInputMat = mat3(
  8581. vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
  8582. vec3( 0.04823, 0.01566, 0.83777 )
  8583. );
  8584. const mat3 ACESOutputMat = mat3(
  8585. vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
  8586. vec3( -0.07367, -0.00605, 1.07602 )
  8587. );
  8588. color *= toneMappingExposure / 0.6;
  8589. color = ACESInputMat * color;
  8590. color = RRTAndODTFit( color );
  8591. color = ACESOutputMat * color;
  8592. return saturate( color );
  8593. }
  8594. const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
  8595. vec3( 1.6605, - 0.1246, - 0.0182 ),
  8596. vec3( - 0.5876, 1.1329, - 0.1006 ),
  8597. vec3( - 0.0728, - 0.0083, 1.1187 )
  8598. );
  8599. const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
  8600. vec3( 0.6274, 0.0691, 0.0164 ),
  8601. vec3( 0.3293, 0.9195, 0.0880 ),
  8602. vec3( 0.0433, 0.0113, 0.8956 )
  8603. );
  8604. vec3 agxDefaultContrastApprox( vec3 x ) {
  8605. vec3 x2 = x * x;
  8606. vec3 x4 = x2 * x2;
  8607. return + 15.5 * x4 * x2
  8608. - 40.14 * x4 * x
  8609. + 31.96 * x4
  8610. - 6.868 * x2 * x
  8611. + 0.4298 * x2
  8612. + 0.1191 * x
  8613. - 0.00232;
  8614. }
  8615. vec3 AgXToneMapping( vec3 color ) {
  8616. const mat3 AgXInsetMatrix = mat3(
  8617. vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
  8618. vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
  8619. vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
  8620. );
  8621. const mat3 AgXOutsetMatrix = mat3(
  8622. vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
  8623. vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
  8624. vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
  8625. );
  8626. const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;
  8627. color *= toneMappingExposure;
  8628. color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
  8629. color = AgXInsetMatrix * color;
  8630. color = max( color, 1e-10 ); color = log2( color );
  8631. color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
  8632. color = clamp( color, 0.0, 1.0 );
  8633. color = agxDefaultContrastApprox( color );
  8634. color = AgXOutsetMatrix * color;
  8635. color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
  8636. color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
  8637. color = clamp( color, 0.0, 1.0 );
  8638. return color;
  8639. }
  8640. vec3 NeutralToneMapping( vec3 color ) {
  8641. float startCompression = 0.8 - 0.04;
  8642. float desaturation = 0.15;
  8643. color *= toneMappingExposure;
  8644. float x = min(color.r, min(color.g, color.b));
  8645. float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
  8646. color -= offset;
  8647. float peak = max(color.r, max(color.g, color.b));
  8648. if (peak < startCompression) return color;
  8649. float d = 1. - startCompression;
  8650. float newPeak = 1. - d * d / (peak + d - startCompression);
  8651. color *= newPeak / peak;
  8652. float g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);
  8653. return mix(color, vec3(1, 1, 1), g);
  8654. }
  8655. vec3 CustomToneMapping( vec3 color ) { return color; }`,JLe=`#ifdef USE_TRANSMISSION
  8656. material.transmission = transmission;
  8657. material.transmissionAlpha = 1.0;
  8658. material.thickness = thickness;
  8659. material.attenuationDistance = attenuationDistance;
  8660. material.attenuationColor = attenuationColor;
  8661. #ifdef USE_TRANSMISSIONMAP
  8662. material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
  8663. #endif
  8664. #ifdef USE_THICKNESSMAP
  8665. material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
  8666. #endif
  8667. vec3 pos = vWorldPosition;
  8668. vec3 v = normalize( cameraPosition - pos );
  8669. vec3 n = inverseTransformDirection( normal, viewMatrix );
  8670. vec4 transmitted = getIBLVolumeRefraction(
  8671. n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
  8672. pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,
  8673. material.attenuationColor, material.attenuationDistance );
  8674. material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
  8675. totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
  8676. #endif`,$Le=`#ifdef USE_TRANSMISSION
  8677. uniform float transmission;
  8678. uniform float thickness;
  8679. uniform float attenuationDistance;
  8680. uniform vec3 attenuationColor;
  8681. #ifdef USE_TRANSMISSIONMAP
  8682. uniform sampler2D transmissionMap;
  8683. #endif
  8684. #ifdef USE_THICKNESSMAP
  8685. uniform sampler2D thicknessMap;
  8686. #endif
  8687. uniform vec2 transmissionSamplerSize;
  8688. uniform sampler2D transmissionSamplerMap;
  8689. uniform mat4 modelMatrix;
  8690. uniform mat4 projectionMatrix;
  8691. varying vec3 vWorldPosition;
  8692. float w0( float a ) {
  8693. return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
  8694. }
  8695. float w1( float a ) {
  8696. return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );
  8697. }
  8698. float w2( float a ){
  8699. return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
  8700. }
  8701. float w3( float a ) {
  8702. return ( 1.0 / 6.0 ) * ( a * a * a );
  8703. }
  8704. float g0( float a ) {
  8705. return w0( a ) + w1( a );
  8706. }
  8707. float g1( float a ) {
  8708. return w2( a ) + w3( a );
  8709. }
  8710. float h0( float a ) {
  8711. return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
  8712. }
  8713. float h1( float a ) {
  8714. return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
  8715. }
  8716. vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
  8717. uv = uv * texelSize.zw + 0.5;
  8718. vec2 iuv = floor( uv );
  8719. vec2 fuv = fract( uv );
  8720. float g0x = g0( fuv.x );
  8721. float g1x = g1( fuv.x );
  8722. float h0x = h0( fuv.x );
  8723. float h1x = h1( fuv.x );
  8724. float h0y = h0( fuv.y );
  8725. float h1y = h1( fuv.y );
  8726. vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
  8727. vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
  8728. vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
  8729. vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
  8730. return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
  8731. g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
  8732. }
  8733. vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
  8734. vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
  8735. vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
  8736. vec2 fLodSizeInv = 1.0 / fLodSize;
  8737. vec2 cLodSizeInv = 1.0 / cLodSize;
  8738. vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
  8739. vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
  8740. return mix( fSample, cSample, fract( lod ) );
  8741. }
  8742. vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
  8743. vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
  8744. vec3 modelScale;
  8745. modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
  8746. modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
  8747. modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
  8748. return normalize( refractionVector ) * thickness * modelScale;
  8749. }
  8750. float applyIorToRoughness( const in float roughness, const in float ior ) {
  8751. return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
  8752. }
  8753. vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
  8754. float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
  8755. return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
  8756. }
  8757. vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
  8758. if ( isinf( attenuationDistance ) ) {
  8759. return vec3( 1.0 );
  8760. } else {
  8761. vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
  8762. vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;
  8763. }
  8764. }
  8765. vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
  8766. const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
  8767. const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,
  8768. const in vec3 attenuationColor, const in float attenuationDistance ) {
  8769. vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
  8770. vec3 refractedRayExit = position + transmissionRay;
  8771. vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
  8772. vec2 refractionCoords = ndcPos.xy / ndcPos.w;
  8773. refractionCoords += 1.0;
  8774. refractionCoords /= 2.0;
  8775. vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
  8776. vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
  8777. vec3 attenuatedColor = transmittance * transmittedLight.rgb;
  8778. vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
  8779. float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
  8780. return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
  8781. }
  8782. #endif`,QLe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
  8783. varying vec2 vUv;
  8784. #endif
  8785. #ifdef USE_MAP
  8786. varying vec2 vMapUv;
  8787. #endif
  8788. #ifdef USE_ALPHAMAP
  8789. varying vec2 vAlphaMapUv;
  8790. #endif
  8791. #ifdef USE_LIGHTMAP
  8792. varying vec2 vLightMapUv;
  8793. #endif
  8794. #ifdef USE_AOMAP
  8795. varying vec2 vAoMapUv;
  8796. #endif
  8797. #ifdef USE_BUMPMAP
  8798. varying vec2 vBumpMapUv;
  8799. #endif
  8800. #ifdef USE_NORMALMAP
  8801. varying vec2 vNormalMapUv;
  8802. #endif
  8803. #ifdef USE_EMISSIVEMAP
  8804. varying vec2 vEmissiveMapUv;
  8805. #endif
  8806. #ifdef USE_METALNESSMAP
  8807. varying vec2 vMetalnessMapUv;
  8808. #endif
  8809. #ifdef USE_ROUGHNESSMAP
  8810. varying vec2 vRoughnessMapUv;
  8811. #endif
  8812. #ifdef USE_ANISOTROPYMAP
  8813. varying vec2 vAnisotropyMapUv;
  8814. #endif
  8815. #ifdef USE_CLEARCOATMAP
  8816. varying vec2 vClearcoatMapUv;
  8817. #endif
  8818. #ifdef USE_CLEARCOAT_NORMALMAP
  8819. varying vec2 vClearcoatNormalMapUv;
  8820. #endif
  8821. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  8822. varying vec2 vClearcoatRoughnessMapUv;
  8823. #endif
  8824. #ifdef USE_IRIDESCENCEMAP
  8825. varying vec2 vIridescenceMapUv;
  8826. #endif
  8827. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  8828. varying vec2 vIridescenceThicknessMapUv;
  8829. #endif
  8830. #ifdef USE_SHEEN_COLORMAP
  8831. varying vec2 vSheenColorMapUv;
  8832. #endif
  8833. #ifdef USE_SHEEN_ROUGHNESSMAP
  8834. varying vec2 vSheenRoughnessMapUv;
  8835. #endif
  8836. #ifdef USE_SPECULARMAP
  8837. varying vec2 vSpecularMapUv;
  8838. #endif
  8839. #ifdef USE_SPECULAR_COLORMAP
  8840. varying vec2 vSpecularColorMapUv;
  8841. #endif
  8842. #ifdef USE_SPECULAR_INTENSITYMAP
  8843. varying vec2 vSpecularIntensityMapUv;
  8844. #endif
  8845. #ifdef USE_TRANSMISSIONMAP
  8846. uniform mat3 transmissionMapTransform;
  8847. varying vec2 vTransmissionMapUv;
  8848. #endif
  8849. #ifdef USE_THICKNESSMAP
  8850. uniform mat3 thicknessMapTransform;
  8851. varying vec2 vThicknessMapUv;
  8852. #endif`,e2e=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
  8853. varying vec2 vUv;
  8854. #endif
  8855. #ifdef USE_MAP
  8856. uniform mat3 mapTransform;
  8857. varying vec2 vMapUv;
  8858. #endif
  8859. #ifdef USE_ALPHAMAP
  8860. uniform mat3 alphaMapTransform;
  8861. varying vec2 vAlphaMapUv;
  8862. #endif
  8863. #ifdef USE_LIGHTMAP
  8864. uniform mat3 lightMapTransform;
  8865. varying vec2 vLightMapUv;
  8866. #endif
  8867. #ifdef USE_AOMAP
  8868. uniform mat3 aoMapTransform;
  8869. varying vec2 vAoMapUv;
  8870. #endif
  8871. #ifdef USE_BUMPMAP
  8872. uniform mat3 bumpMapTransform;
  8873. varying vec2 vBumpMapUv;
  8874. #endif
  8875. #ifdef USE_NORMALMAP
  8876. uniform mat3 normalMapTransform;
  8877. varying vec2 vNormalMapUv;
  8878. #endif
  8879. #ifdef USE_DISPLACEMENTMAP
  8880. uniform mat3 displacementMapTransform;
  8881. varying vec2 vDisplacementMapUv;
  8882. #endif
  8883. #ifdef USE_EMISSIVEMAP
  8884. uniform mat3 emissiveMapTransform;
  8885. varying vec2 vEmissiveMapUv;
  8886. #endif
  8887. #ifdef USE_METALNESSMAP
  8888. uniform mat3 metalnessMapTransform;
  8889. varying vec2 vMetalnessMapUv;
  8890. #endif
  8891. #ifdef USE_ROUGHNESSMAP
  8892. uniform mat3 roughnessMapTransform;
  8893. varying vec2 vRoughnessMapUv;
  8894. #endif
  8895. #ifdef USE_ANISOTROPYMAP
  8896. uniform mat3 anisotropyMapTransform;
  8897. varying vec2 vAnisotropyMapUv;
  8898. #endif
  8899. #ifdef USE_CLEARCOATMAP
  8900. uniform mat3 clearcoatMapTransform;
  8901. varying vec2 vClearcoatMapUv;
  8902. #endif
  8903. #ifdef USE_CLEARCOAT_NORMALMAP
  8904. uniform mat3 clearcoatNormalMapTransform;
  8905. varying vec2 vClearcoatNormalMapUv;
  8906. #endif
  8907. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  8908. uniform mat3 clearcoatRoughnessMapTransform;
  8909. varying vec2 vClearcoatRoughnessMapUv;
  8910. #endif
  8911. #ifdef USE_SHEEN_COLORMAP
  8912. uniform mat3 sheenColorMapTransform;
  8913. varying vec2 vSheenColorMapUv;
  8914. #endif
  8915. #ifdef USE_SHEEN_ROUGHNESSMAP
  8916. uniform mat3 sheenRoughnessMapTransform;
  8917. varying vec2 vSheenRoughnessMapUv;
  8918. #endif
  8919. #ifdef USE_IRIDESCENCEMAP
  8920. uniform mat3 iridescenceMapTransform;
  8921. varying vec2 vIridescenceMapUv;
  8922. #endif
  8923. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  8924. uniform mat3 iridescenceThicknessMapTransform;
  8925. varying vec2 vIridescenceThicknessMapUv;
  8926. #endif
  8927. #ifdef USE_SPECULARMAP
  8928. uniform mat3 specularMapTransform;
  8929. varying vec2 vSpecularMapUv;
  8930. #endif
  8931. #ifdef USE_SPECULAR_COLORMAP
  8932. uniform mat3 specularColorMapTransform;
  8933. varying vec2 vSpecularColorMapUv;
  8934. #endif
  8935. #ifdef USE_SPECULAR_INTENSITYMAP
  8936. uniform mat3 specularIntensityMapTransform;
  8937. varying vec2 vSpecularIntensityMapUv;
  8938. #endif
  8939. #ifdef USE_TRANSMISSIONMAP
  8940. uniform mat3 transmissionMapTransform;
  8941. varying vec2 vTransmissionMapUv;
  8942. #endif
  8943. #ifdef USE_THICKNESSMAP
  8944. uniform mat3 thicknessMapTransform;
  8945. varying vec2 vThicknessMapUv;
  8946. #endif`,t2e=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
  8947. vUv = vec3( uv, 1 ).xy;
  8948. #endif
  8949. #ifdef USE_MAP
  8950. vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
  8951. #endif
  8952. #ifdef USE_ALPHAMAP
  8953. vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
  8954. #endif
  8955. #ifdef USE_LIGHTMAP
  8956. vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
  8957. #endif
  8958. #ifdef USE_AOMAP
  8959. vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
  8960. #endif
  8961. #ifdef USE_BUMPMAP
  8962. vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
  8963. #endif
  8964. #ifdef USE_NORMALMAP
  8965. vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
  8966. #endif
  8967. #ifdef USE_DISPLACEMENTMAP
  8968. vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
  8969. #endif
  8970. #ifdef USE_EMISSIVEMAP
  8971. vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
  8972. #endif
  8973. #ifdef USE_METALNESSMAP
  8974. vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
  8975. #endif
  8976. #ifdef USE_ROUGHNESSMAP
  8977. vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
  8978. #endif
  8979. #ifdef USE_ANISOTROPYMAP
  8980. vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
  8981. #endif
  8982. #ifdef USE_CLEARCOATMAP
  8983. vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
  8984. #endif
  8985. #ifdef USE_CLEARCOAT_NORMALMAP
  8986. vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
  8987. #endif
  8988. #ifdef USE_CLEARCOAT_ROUGHNESSMAP
  8989. vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
  8990. #endif
  8991. #ifdef USE_IRIDESCENCEMAP
  8992. vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
  8993. #endif
  8994. #ifdef USE_IRIDESCENCE_THICKNESSMAP
  8995. vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
  8996. #endif
  8997. #ifdef USE_SHEEN_COLORMAP
  8998. vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
  8999. #endif
  9000. #ifdef USE_SHEEN_ROUGHNESSMAP
  9001. vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
  9002. #endif
  9003. #ifdef USE_SPECULARMAP
  9004. vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
  9005. #endif
  9006. #ifdef USE_SPECULAR_COLORMAP
  9007. vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
  9008. #endif
  9009. #ifdef USE_SPECULAR_INTENSITYMAP
  9010. vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
  9011. #endif
  9012. #ifdef USE_TRANSMISSIONMAP
  9013. vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
  9014. #endif
  9015. #ifdef USE_THICKNESSMAP
  9016. vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
  9017. #endif`,r2e=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
  9018. vec4 worldPosition = vec4( transformed, 1.0 );
  9019. #ifdef USE_BATCHING
  9020. worldPosition = batchingMatrix * worldPosition;
  9021. #endif
  9022. #ifdef USE_INSTANCING
  9023. worldPosition = instanceMatrix * worldPosition;
  9024. #endif
  9025. worldPosition = modelMatrix * worldPosition;
  9026. #endif`,i2e=`varying vec2 vUv;
  9027. uniform mat3 uvTransform;
  9028. void main() {
  9029. vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
  9030. gl_Position = vec4( position.xy, 1.0, 1.0 );
  9031. }`,n2e=`uniform sampler2D t2D;
  9032. uniform float backgroundIntensity;
  9033. varying vec2 vUv;
  9034. void main() {
  9035. vec4 texColor = texture2D( t2D, vUv );
  9036. #ifdef DECODE_VIDEO_TEXTURE
  9037. texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
  9038. #endif
  9039. texColor.rgb *= backgroundIntensity;
  9040. gl_FragColor = texColor;
  9041. #include <tonemapping_fragment>
  9042. #include <colorspace_fragment>
  9043. }`,a2e=`varying vec3 vWorldDirection;
  9044. #include <common>
  9045. void main() {
  9046. vWorldDirection = transformDirection( position, modelMatrix );
  9047. #include <begin_vertex>
  9048. #include <project_vertex>
  9049. gl_Position.z = gl_Position.w;
  9050. }`,o2e=`#ifdef ENVMAP_TYPE_CUBE
  9051. uniform samplerCube envMap;
  9052. #elif defined( ENVMAP_TYPE_CUBE_UV )
  9053. uniform sampler2D envMap;
  9054. #endif
  9055. uniform float flipEnvMap;
  9056. uniform float backgroundBlurriness;
  9057. uniform float backgroundIntensity;
  9058. uniform mat3 backgroundRotation;
  9059. varying vec3 vWorldDirection;
  9060. #include <cube_uv_reflection_fragment>
  9061. void main() {
  9062. #ifdef ENVMAP_TYPE_CUBE
  9063. vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
  9064. #elif defined( ENVMAP_TYPE_CUBE_UV )
  9065. vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
  9066. #else
  9067. vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
  9068. #endif
  9069. texColor.rgb *= backgroundIntensity;
  9070. gl_FragColor = texColor;
  9071. #include <tonemapping_fragment>
  9072. #include <colorspace_fragment>
  9073. }`,s2e=`varying vec3 vWorldDirection;
  9074. #include <common>
  9075. void main() {
  9076. vWorldDirection = transformDirection( position, modelMatrix );
  9077. #include <begin_vertex>
  9078. #include <project_vertex>
  9079. gl_Position.z = gl_Position.w;
  9080. }`,l2e=`uniform samplerCube tCube;
  9081. uniform float tFlip;
  9082. uniform float opacity;
  9083. varying vec3 vWorldDirection;
  9084. void main() {
  9085. vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
  9086. gl_FragColor = texColor;
  9087. gl_FragColor.a *= opacity;
  9088. #include <tonemapping_fragment>
  9089. #include <colorspace_fragment>
  9090. }`,u2e=`#include <common>
  9091. #include <batching_pars_vertex>
  9092. #include <uv_pars_vertex>
  9093. #include <displacementmap_pars_vertex>
  9094. #include <morphtarget_pars_vertex>
  9095. #include <skinning_pars_vertex>
  9096. #include <logdepthbuf_pars_vertex>
  9097. #include <clipping_planes_pars_vertex>
  9098. varying vec2 vHighPrecisionZW;
  9099. void main() {
  9100. #include <uv_vertex>
  9101. #include <batching_vertex>
  9102. #include <skinbase_vertex>
  9103. #include <morphinstance_vertex>
  9104. #ifdef USE_DISPLACEMENTMAP
  9105. #include <beginnormal_vertex>
  9106. #include <morphnormal_vertex>
  9107. #include <skinnormal_vertex>
  9108. #endif
  9109. #include <begin_vertex>
  9110. #include <morphtarget_vertex>
  9111. #include <skinning_vertex>
  9112. #include <displacementmap_vertex>
  9113. #include <project_vertex>
  9114. #include <logdepthbuf_vertex>
  9115. #include <clipping_planes_vertex>
  9116. vHighPrecisionZW = gl_Position.zw;
  9117. }`,c2e=`#if DEPTH_PACKING == 3200
  9118. uniform float opacity;
  9119. #endif
  9120. #include <common>
  9121. #include <packing>
  9122. #include <uv_pars_fragment>
  9123. #include <map_pars_fragment>
  9124. #include <alphamap_pars_fragment>
  9125. #include <alphatest_pars_fragment>
  9126. #include <alphahash_pars_fragment>
  9127. #include <logdepthbuf_pars_fragment>
  9128. #include <clipping_planes_pars_fragment>
  9129. varying vec2 vHighPrecisionZW;
  9130. void main() {
  9131. vec4 diffuseColor = vec4( 1.0 );
  9132. #include <clipping_planes_fragment>
  9133. #if DEPTH_PACKING == 3200
  9134. diffuseColor.a = opacity;
  9135. #endif
  9136. #include <map_fragment>
  9137. #include <alphamap_fragment>
  9138. #include <alphatest_fragment>
  9139. #include <alphahash_fragment>
  9140. #include <logdepthbuf_fragment>
  9141. float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
  9142. #if DEPTH_PACKING == 3200
  9143. gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
  9144. #elif DEPTH_PACKING == 3201
  9145. gl_FragColor = packDepthToRGBA( fragCoordZ );
  9146. #endif
  9147. }`,h2e=`#define DISTANCE
  9148. varying vec3 vWorldPosition;
  9149. #include <common>
  9150. #include <batching_pars_vertex>
  9151. #include <uv_pars_vertex>
  9152. #include <displacementmap_pars_vertex>
  9153. #include <morphtarget_pars_vertex>
  9154. #include <skinning_pars_vertex>
  9155. #include <clipping_planes_pars_vertex>
  9156. void main() {
  9157. #include <uv_vertex>
  9158. #include <batching_vertex>
  9159. #include <skinbase_vertex>
  9160. #include <morphinstance_vertex>
  9161. #ifdef USE_DISPLACEMENTMAP
  9162. #include <beginnormal_vertex>
  9163. #include <morphnormal_vertex>
  9164. #include <skinnormal_vertex>
  9165. #endif
  9166. #include <begin_vertex>
  9167. #include <morphtarget_vertex>
  9168. #include <skinning_vertex>
  9169. #include <displacementmap_vertex>
  9170. #include <project_vertex>
  9171. #include <worldpos_vertex>
  9172. #include <clipping_planes_vertex>
  9173. vWorldPosition = worldPosition.xyz;
  9174. }`,f2e=`#define DISTANCE
  9175. uniform vec3 referencePosition;
  9176. uniform float nearDistance;
  9177. uniform float farDistance;
  9178. varying vec3 vWorldPosition;
  9179. #include <common>
  9180. #include <packing>
  9181. #include <uv_pars_fragment>
  9182. #include <map_pars_fragment>
  9183. #include <alphamap_pars_fragment>
  9184. #include <alphatest_pars_fragment>
  9185. #include <alphahash_pars_fragment>
  9186. #include <clipping_planes_pars_fragment>
  9187. void main () {
  9188. vec4 diffuseColor = vec4( 1.0 );
  9189. #include <clipping_planes_fragment>
  9190. #include <map_fragment>
  9191. #include <alphamap_fragment>
  9192. #include <alphatest_fragment>
  9193. #include <alphahash_fragment>
  9194. float dist = length( vWorldPosition - referencePosition );
  9195. dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
  9196. dist = saturate( dist );
  9197. gl_FragColor = packDepthToRGBA( dist );
  9198. }`,p2e=`varying vec3 vWorldDirection;
  9199. #include <common>
  9200. void main() {
  9201. vWorldDirection = transformDirection( position, modelMatrix );
  9202. #include <begin_vertex>
  9203. #include <project_vertex>
  9204. }`,d2e=`uniform sampler2D tEquirect;
  9205. varying vec3 vWorldDirection;
  9206. #include <common>
  9207. void main() {
  9208. vec3 direction = normalize( vWorldDirection );
  9209. vec2 sampleUV = equirectUv( direction );
  9210. gl_FragColor = texture2D( tEquirect, sampleUV );
  9211. #include <tonemapping_fragment>
  9212. #include <colorspace_fragment>
  9213. }`,m2e=`uniform float scale;
  9214. attribute float lineDistance;
  9215. varying float vLineDistance;
  9216. #include <common>
  9217. #include <uv_pars_vertex>
  9218. #include <color_pars_vertex>
  9219. #include <fog_pars_vertex>
  9220. #include <morphtarget_pars_vertex>
  9221. #include <logdepthbuf_pars_vertex>
  9222. #include <clipping_planes_pars_vertex>
  9223. void main() {
  9224. vLineDistance = scale * lineDistance;
  9225. #include <uv_vertex>
  9226. #include <color_vertex>
  9227. #include <morphinstance_vertex>
  9228. #include <morphcolor_vertex>
  9229. #include <begin_vertex>
  9230. #include <morphtarget_vertex>
  9231. #include <project_vertex>
  9232. #include <logdepthbuf_vertex>
  9233. #include <clipping_planes_vertex>
  9234. #include <fog_vertex>
  9235. }`,v2e=`uniform vec3 diffuse;
  9236. uniform float opacity;
  9237. uniform float dashSize;
  9238. uniform float totalSize;
  9239. varying float vLineDistance;
  9240. #include <common>
  9241. #include <color_pars_fragment>
  9242. #include <uv_pars_fragment>
  9243. #include <map_pars_fragment>
  9244. #include <fog_pars_fragment>
  9245. #include <logdepthbuf_pars_fragment>
  9246. #include <clipping_planes_pars_fragment>
  9247. void main() {
  9248. vec4 diffuseColor = vec4( diffuse, opacity );
  9249. #include <clipping_planes_fragment>
  9250. if ( mod( vLineDistance, totalSize ) > dashSize ) {
  9251. discard;
  9252. }
  9253. vec3 outgoingLight = vec3( 0.0 );
  9254. #include <logdepthbuf_fragment>
  9255. #include <map_fragment>
  9256. #include <color_fragment>
  9257. outgoingLight = diffuseColor.rgb;
  9258. #include <opaque_fragment>
  9259. #include <tonemapping_fragment>
  9260. #include <colorspace_fragment>
  9261. #include <fog_fragment>
  9262. #include <premultiplied_alpha_fragment>
  9263. }`,g2e=`#include <common>
  9264. #include <batching_pars_vertex>
  9265. #include <uv_pars_vertex>
  9266. #include <envmap_pars_vertex>
  9267. #include <color_pars_vertex>
  9268. #include <fog_pars_vertex>
  9269. #include <morphtarget_pars_vertex>
  9270. #include <skinning_pars_vertex>
  9271. #include <logdepthbuf_pars_vertex>
  9272. #include <clipping_planes_pars_vertex>
  9273. void main() {
  9274. #include <uv_vertex>
  9275. #include <color_vertex>
  9276. #include <morphinstance_vertex>
  9277. #include <morphcolor_vertex>
  9278. #include <batching_vertex>
  9279. #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
  9280. #include <beginnormal_vertex>
  9281. #include <morphnormal_vertex>
  9282. #include <skinbase_vertex>
  9283. #include <skinnormal_vertex>
  9284. #include <defaultnormal_vertex>
  9285. #endif
  9286. #include <begin_vertex>
  9287. #include <morphtarget_vertex>
  9288. #include <skinning_vertex>
  9289. #include <project_vertex>
  9290. #include <logdepthbuf_vertex>
  9291. #include <clipping_planes_vertex>
  9292. #include <worldpos_vertex>
  9293. #include <envmap_vertex>
  9294. #include <fog_vertex>
  9295. }`,y2e=`uniform vec3 diffuse;
  9296. uniform float opacity;
  9297. #ifndef FLAT_SHADED
  9298. varying vec3 vNormal;
  9299. #endif
  9300. #include <common>
  9301. #include <dithering_pars_fragment>
  9302. #include <color_pars_fragment>
  9303. #include <uv_pars_fragment>
  9304. #include <map_pars_fragment>
  9305. #include <alphamap_pars_fragment>
  9306. #include <alphatest_pars_fragment>
  9307. #include <alphahash_pars_fragment>
  9308. #include <aomap_pars_fragment>
  9309. #include <lightmap_pars_fragment>
  9310. #include <envmap_common_pars_fragment>
  9311. #include <envmap_pars_fragment>
  9312. #include <fog_pars_fragment>
  9313. #include <specularmap_pars_fragment>
  9314. #include <logdepthbuf_pars_fragment>
  9315. #include <clipping_planes_pars_fragment>
  9316. void main() {
  9317. vec4 diffuseColor = vec4( diffuse, opacity );
  9318. #include <clipping_planes_fragment>
  9319. #include <logdepthbuf_fragment>
  9320. #include <map_fragment>
  9321. #include <color_fragment>
  9322. #include <alphamap_fragment>
  9323. #include <alphatest_fragment>
  9324. #include <alphahash_fragment>
  9325. #include <specularmap_fragment>
  9326. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  9327. #ifdef USE_LIGHTMAP
  9328. vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
  9329. reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
  9330. #else
  9331. reflectedLight.indirectDiffuse += vec3( 1.0 );
  9332. #endif
  9333. #include <aomap_fragment>
  9334. reflectedLight.indirectDiffuse *= diffuseColor.rgb;
  9335. vec3 outgoingLight = reflectedLight.indirectDiffuse;
  9336. #include <envmap_fragment>
  9337. #include <opaque_fragment>
  9338. #include <tonemapping_fragment>
  9339. #include <colorspace_fragment>
  9340. #include <fog_fragment>
  9341. #include <premultiplied_alpha_fragment>
  9342. #include <dithering_fragment>
  9343. }`,_2e=`#define LAMBERT
  9344. varying vec3 vViewPosition;
  9345. #include <common>
  9346. #include <batching_pars_vertex>
  9347. #include <uv_pars_vertex>
  9348. #include <displacementmap_pars_vertex>
  9349. #include <envmap_pars_vertex>
  9350. #include <color_pars_vertex>
  9351. #include <fog_pars_vertex>
  9352. #include <normal_pars_vertex>
  9353. #include <morphtarget_pars_vertex>
  9354. #include <skinning_pars_vertex>
  9355. #include <shadowmap_pars_vertex>
  9356. #include <logdepthbuf_pars_vertex>
  9357. #include <clipping_planes_pars_vertex>
  9358. void main() {
  9359. #include <uv_vertex>
  9360. #include <color_vertex>
  9361. #include <morphinstance_vertex>
  9362. #include <morphcolor_vertex>
  9363. #include <batching_vertex>
  9364. #include <beginnormal_vertex>
  9365. #include <morphnormal_vertex>
  9366. #include <skinbase_vertex>
  9367. #include <skinnormal_vertex>
  9368. #include <defaultnormal_vertex>
  9369. #include <normal_vertex>
  9370. #include <begin_vertex>
  9371. #include <morphtarget_vertex>
  9372. #include <skinning_vertex>
  9373. #include <displacementmap_vertex>
  9374. #include <project_vertex>
  9375. #include <logdepthbuf_vertex>
  9376. #include <clipping_planes_vertex>
  9377. vViewPosition = - mvPosition.xyz;
  9378. #include <worldpos_vertex>
  9379. #include <envmap_vertex>
  9380. #include <shadowmap_vertex>
  9381. #include <fog_vertex>
  9382. }`,x2e=`#define LAMBERT
  9383. uniform vec3 diffuse;
  9384. uniform vec3 emissive;
  9385. uniform float opacity;
  9386. #include <common>
  9387. #include <packing>
  9388. #include <dithering_pars_fragment>
  9389. #include <color_pars_fragment>
  9390. #include <uv_pars_fragment>
  9391. #include <map_pars_fragment>
  9392. #include <alphamap_pars_fragment>
  9393. #include <alphatest_pars_fragment>
  9394. #include <alphahash_pars_fragment>
  9395. #include <aomap_pars_fragment>
  9396. #include <lightmap_pars_fragment>
  9397. #include <emissivemap_pars_fragment>
  9398. #include <envmap_common_pars_fragment>
  9399. #include <envmap_pars_fragment>
  9400. #include <fog_pars_fragment>
  9401. #include <bsdfs>
  9402. #include <lights_pars_begin>
  9403. #include <normal_pars_fragment>
  9404. #include <lights_lambert_pars_fragment>
  9405. #include <shadowmap_pars_fragment>
  9406. #include <bumpmap_pars_fragment>
  9407. #include <normalmap_pars_fragment>
  9408. #include <specularmap_pars_fragment>
  9409. #include <logdepthbuf_pars_fragment>
  9410. #include <clipping_planes_pars_fragment>
  9411. void main() {
  9412. vec4 diffuseColor = vec4( diffuse, opacity );
  9413. #include <clipping_planes_fragment>
  9414. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  9415. vec3 totalEmissiveRadiance = emissive;
  9416. #include <logdepthbuf_fragment>
  9417. #include <map_fragment>
  9418. #include <color_fragment>
  9419. #include <alphamap_fragment>
  9420. #include <alphatest_fragment>
  9421. #include <alphahash_fragment>
  9422. #include <specularmap_fragment>
  9423. #include <normal_fragment_begin>
  9424. #include <normal_fragment_maps>
  9425. #include <emissivemap_fragment>
  9426. #include <lights_lambert_fragment>
  9427. #include <lights_fragment_begin>
  9428. #include <lights_fragment_maps>
  9429. #include <lights_fragment_end>
  9430. #include <aomap_fragment>
  9431. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
  9432. #include <envmap_fragment>
  9433. #include <opaque_fragment>
  9434. #include <tonemapping_fragment>
  9435. #include <colorspace_fragment>
  9436. #include <fog_fragment>
  9437. #include <premultiplied_alpha_fragment>
  9438. #include <dithering_fragment>
  9439. }`,S2e=`#define MATCAP
  9440. varying vec3 vViewPosition;
  9441. #include <common>
  9442. #include <batching_pars_vertex>
  9443. #include <uv_pars_vertex>
  9444. #include <color_pars_vertex>
  9445. #include <displacementmap_pars_vertex>
  9446. #include <fog_pars_vertex>
  9447. #include <normal_pars_vertex>
  9448. #include <morphtarget_pars_vertex>
  9449. #include <skinning_pars_vertex>
  9450. #include <logdepthbuf_pars_vertex>
  9451. #include <clipping_planes_pars_vertex>
  9452. void main() {
  9453. #include <uv_vertex>
  9454. #include <color_vertex>
  9455. #include <morphinstance_vertex>
  9456. #include <morphcolor_vertex>
  9457. #include <batching_vertex>
  9458. #include <beginnormal_vertex>
  9459. #include <morphnormal_vertex>
  9460. #include <skinbase_vertex>
  9461. #include <skinnormal_vertex>
  9462. #include <defaultnormal_vertex>
  9463. #include <normal_vertex>
  9464. #include <begin_vertex>
  9465. #include <morphtarget_vertex>
  9466. #include <skinning_vertex>
  9467. #include <displacementmap_vertex>
  9468. #include <project_vertex>
  9469. #include <logdepthbuf_vertex>
  9470. #include <clipping_planes_vertex>
  9471. #include <fog_vertex>
  9472. vViewPosition = - mvPosition.xyz;
  9473. }`,M2e=`#define MATCAP
  9474. uniform vec3 diffuse;
  9475. uniform float opacity;
  9476. uniform sampler2D matcap;
  9477. varying vec3 vViewPosition;
  9478. #include <common>
  9479. #include <dithering_pars_fragment>
  9480. #include <color_pars_fragment>
  9481. #include <uv_pars_fragment>
  9482. #include <map_pars_fragment>
  9483. #include <alphamap_pars_fragment>
  9484. #include <alphatest_pars_fragment>
  9485. #include <alphahash_pars_fragment>
  9486. #include <fog_pars_fragment>
  9487. #include <normal_pars_fragment>
  9488. #include <bumpmap_pars_fragment>
  9489. #include <normalmap_pars_fragment>
  9490. #include <logdepthbuf_pars_fragment>
  9491. #include <clipping_planes_pars_fragment>
  9492. void main() {
  9493. vec4 diffuseColor = vec4( diffuse, opacity );
  9494. #include <clipping_planes_fragment>
  9495. #include <logdepthbuf_fragment>
  9496. #include <map_fragment>
  9497. #include <color_fragment>
  9498. #include <alphamap_fragment>
  9499. #include <alphatest_fragment>
  9500. #include <alphahash_fragment>
  9501. #include <normal_fragment_begin>
  9502. #include <normal_fragment_maps>
  9503. vec3 viewDir = normalize( vViewPosition );
  9504. vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
  9505. vec3 y = cross( viewDir, x );
  9506. vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
  9507. #ifdef USE_MATCAP
  9508. vec4 matcapColor = texture2D( matcap, uv );
  9509. #else
  9510. vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
  9511. #endif
  9512. vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
  9513. #include <opaque_fragment>
  9514. #include <tonemapping_fragment>
  9515. #include <colorspace_fragment>
  9516. #include <fog_fragment>
  9517. #include <premultiplied_alpha_fragment>
  9518. #include <dithering_fragment>
  9519. }`,b2e=`#define NORMAL
  9520. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
  9521. varying vec3 vViewPosition;
  9522. #endif
  9523. #include <common>
  9524. #include <batching_pars_vertex>
  9525. #include <uv_pars_vertex>
  9526. #include <displacementmap_pars_vertex>
  9527. #include <normal_pars_vertex>
  9528. #include <morphtarget_pars_vertex>
  9529. #include <skinning_pars_vertex>
  9530. #include <logdepthbuf_pars_vertex>
  9531. #include <clipping_planes_pars_vertex>
  9532. void main() {
  9533. #include <uv_vertex>
  9534. #include <batching_vertex>
  9535. #include <beginnormal_vertex>
  9536. #include <morphinstance_vertex>
  9537. #include <morphnormal_vertex>
  9538. #include <skinbase_vertex>
  9539. #include <skinnormal_vertex>
  9540. #include <defaultnormal_vertex>
  9541. #include <normal_vertex>
  9542. #include <begin_vertex>
  9543. #include <morphtarget_vertex>
  9544. #include <skinning_vertex>
  9545. #include <displacementmap_vertex>
  9546. #include <project_vertex>
  9547. #include <logdepthbuf_vertex>
  9548. #include <clipping_planes_vertex>
  9549. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
  9550. vViewPosition = - mvPosition.xyz;
  9551. #endif
  9552. }`,w2e=`#define NORMAL
  9553. uniform float opacity;
  9554. #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
  9555. varying vec3 vViewPosition;
  9556. #endif
  9557. #include <packing>
  9558. #include <uv_pars_fragment>
  9559. #include <normal_pars_fragment>
  9560. #include <bumpmap_pars_fragment>
  9561. #include <normalmap_pars_fragment>
  9562. #include <logdepthbuf_pars_fragment>
  9563. #include <clipping_planes_pars_fragment>
  9564. void main() {
  9565. vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
  9566. #include <clipping_planes_fragment>
  9567. #include <logdepthbuf_fragment>
  9568. #include <normal_fragment_begin>
  9569. #include <normal_fragment_maps>
  9570. gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
  9571. #ifdef OPAQUE
  9572. gl_FragColor.a = 1.0;
  9573. #endif
  9574. }`,T2e=`#define PHONG
  9575. varying vec3 vViewPosition;
  9576. #include <common>
  9577. #include <batching_pars_vertex>
  9578. #include <uv_pars_vertex>
  9579. #include <displacementmap_pars_vertex>
  9580. #include <envmap_pars_vertex>
  9581. #include <color_pars_vertex>
  9582. #include <fog_pars_vertex>
  9583. #include <normal_pars_vertex>
  9584. #include <morphtarget_pars_vertex>
  9585. #include <skinning_pars_vertex>
  9586. #include <shadowmap_pars_vertex>
  9587. #include <logdepthbuf_pars_vertex>
  9588. #include <clipping_planes_pars_vertex>
  9589. void main() {
  9590. #include <uv_vertex>
  9591. #include <color_vertex>
  9592. #include <morphcolor_vertex>
  9593. #include <batching_vertex>
  9594. #include <beginnormal_vertex>
  9595. #include <morphinstance_vertex>
  9596. #include <morphnormal_vertex>
  9597. #include <skinbase_vertex>
  9598. #include <skinnormal_vertex>
  9599. #include <defaultnormal_vertex>
  9600. #include <normal_vertex>
  9601. #include <begin_vertex>
  9602. #include <morphtarget_vertex>
  9603. #include <skinning_vertex>
  9604. #include <displacementmap_vertex>
  9605. #include <project_vertex>
  9606. #include <logdepthbuf_vertex>
  9607. #include <clipping_planes_vertex>
  9608. vViewPosition = - mvPosition.xyz;
  9609. #include <worldpos_vertex>
  9610. #include <envmap_vertex>
  9611. #include <shadowmap_vertex>
  9612. #include <fog_vertex>
  9613. }`,E2e=`#define PHONG
  9614. uniform vec3 diffuse;
  9615. uniform vec3 emissive;
  9616. uniform vec3 specular;
  9617. uniform float shininess;
  9618. uniform float opacity;
  9619. #include <common>
  9620. #include <packing>
  9621. #include <dithering_pars_fragment>
  9622. #include <color_pars_fragment>
  9623. #include <uv_pars_fragment>
  9624. #include <map_pars_fragment>
  9625. #include <alphamap_pars_fragment>
  9626. #include <alphatest_pars_fragment>
  9627. #include <alphahash_pars_fragment>
  9628. #include <aomap_pars_fragment>
  9629. #include <lightmap_pars_fragment>
  9630. #include <emissivemap_pars_fragment>
  9631. #include <envmap_common_pars_fragment>
  9632. #include <envmap_pars_fragment>
  9633. #include <fog_pars_fragment>
  9634. #include <bsdfs>
  9635. #include <lights_pars_begin>
  9636. #include <normal_pars_fragment>
  9637. #include <lights_phong_pars_fragment>
  9638. #include <shadowmap_pars_fragment>
  9639. #include <bumpmap_pars_fragment>
  9640. #include <normalmap_pars_fragment>
  9641. #include <specularmap_pars_fragment>
  9642. #include <logdepthbuf_pars_fragment>
  9643. #include <clipping_planes_pars_fragment>
  9644. void main() {
  9645. vec4 diffuseColor = vec4( diffuse, opacity );
  9646. #include <clipping_planes_fragment>
  9647. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  9648. vec3 totalEmissiveRadiance = emissive;
  9649. #include <logdepthbuf_fragment>
  9650. #include <map_fragment>
  9651. #include <color_fragment>
  9652. #include <alphamap_fragment>
  9653. #include <alphatest_fragment>
  9654. #include <alphahash_fragment>
  9655. #include <specularmap_fragment>
  9656. #include <normal_fragment_begin>
  9657. #include <normal_fragment_maps>
  9658. #include <emissivemap_fragment>
  9659. #include <lights_phong_fragment>
  9660. #include <lights_fragment_begin>
  9661. #include <lights_fragment_maps>
  9662. #include <lights_fragment_end>
  9663. #include <aomap_fragment>
  9664. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
  9665. #include <envmap_fragment>
  9666. #include <opaque_fragment>
  9667. #include <tonemapping_fragment>
  9668. #include <colorspace_fragment>
  9669. #include <fog_fragment>
  9670. #include <premultiplied_alpha_fragment>
  9671. #include <dithering_fragment>
  9672. }`,A2e=`#define STANDARD
  9673. varying vec3 vViewPosition;
  9674. #ifdef USE_TRANSMISSION
  9675. varying vec3 vWorldPosition;
  9676. #endif
  9677. #include <common>
  9678. #include <batching_pars_vertex>
  9679. #include <uv_pars_vertex>
  9680. #include <displacementmap_pars_vertex>
  9681. #include <color_pars_vertex>
  9682. #include <fog_pars_vertex>
  9683. #include <normal_pars_vertex>
  9684. #include <morphtarget_pars_vertex>
  9685. #include <skinning_pars_vertex>
  9686. #include <shadowmap_pars_vertex>
  9687. #include <logdepthbuf_pars_vertex>
  9688. #include <clipping_planes_pars_vertex>
  9689. void main() {
  9690. #include <uv_vertex>
  9691. #include <color_vertex>
  9692. #include <morphinstance_vertex>
  9693. #include <morphcolor_vertex>
  9694. #include <batching_vertex>
  9695. #include <beginnormal_vertex>
  9696. #include <morphnormal_vertex>
  9697. #include <skinbase_vertex>
  9698. #include <skinnormal_vertex>
  9699. #include <defaultnormal_vertex>
  9700. #include <normal_vertex>
  9701. #include <begin_vertex>
  9702. #include <morphtarget_vertex>
  9703. #include <skinning_vertex>
  9704. #include <displacementmap_vertex>
  9705. #include <project_vertex>
  9706. #include <logdepthbuf_vertex>
  9707. #include <clipping_planes_vertex>
  9708. vViewPosition = - mvPosition.xyz;
  9709. #include <worldpos_vertex>
  9710. #include <shadowmap_vertex>
  9711. #include <fog_vertex>
  9712. #ifdef USE_TRANSMISSION
  9713. vWorldPosition = worldPosition.xyz;
  9714. #endif
  9715. }`,C2e=`#define STANDARD
  9716. #ifdef PHYSICAL
  9717. #define IOR
  9718. #define USE_SPECULAR
  9719. #endif
  9720. uniform vec3 diffuse;
  9721. uniform vec3 emissive;
  9722. uniform float roughness;
  9723. uniform float metalness;
  9724. uniform float opacity;
  9725. #ifdef IOR
  9726. uniform float ior;
  9727. #endif
  9728. #ifdef USE_SPECULAR
  9729. uniform float specularIntensity;
  9730. uniform vec3 specularColor;
  9731. #ifdef USE_SPECULAR_COLORMAP
  9732. uniform sampler2D specularColorMap;
  9733. #endif
  9734. #ifdef USE_SPECULAR_INTENSITYMAP
  9735. uniform sampler2D specularIntensityMap;
  9736. #endif
  9737. #endif
  9738. #ifdef USE_CLEARCOAT
  9739. uniform float clearcoat;
  9740. uniform float clearcoatRoughness;
  9741. #endif
  9742. #ifdef USE_IRIDESCENCE
  9743. uniform float iridescence;
  9744. uniform float iridescenceIOR;
  9745. uniform float iridescenceThicknessMinimum;
  9746. uniform float iridescenceThicknessMaximum;
  9747. #endif
  9748. #ifdef USE_SHEEN
  9749. uniform vec3 sheenColor;
  9750. uniform float sheenRoughness;
  9751. #ifdef USE_SHEEN_COLORMAP
  9752. uniform sampler2D sheenColorMap;
  9753. #endif
  9754. #ifdef USE_SHEEN_ROUGHNESSMAP
  9755. uniform sampler2D sheenRoughnessMap;
  9756. #endif
  9757. #endif
  9758. #ifdef USE_ANISOTROPY
  9759. uniform vec2 anisotropyVector;
  9760. #ifdef USE_ANISOTROPYMAP
  9761. uniform sampler2D anisotropyMap;
  9762. #endif
  9763. #endif
  9764. varying vec3 vViewPosition;
  9765. #include <common>
  9766. #include <packing>
  9767. #include <dithering_pars_fragment>
  9768. #include <color_pars_fragment>
  9769. #include <uv_pars_fragment>
  9770. #include <map_pars_fragment>
  9771. #include <alphamap_pars_fragment>
  9772. #include <alphatest_pars_fragment>
  9773. #include <alphahash_pars_fragment>
  9774. #include <aomap_pars_fragment>
  9775. #include <lightmap_pars_fragment>
  9776. #include <emissivemap_pars_fragment>
  9777. #include <iridescence_fragment>
  9778. #include <cube_uv_reflection_fragment>
  9779. #include <envmap_common_pars_fragment>
  9780. #include <envmap_physical_pars_fragment>
  9781. #include <fog_pars_fragment>
  9782. #include <lights_pars_begin>
  9783. #include <normal_pars_fragment>
  9784. #include <lights_physical_pars_fragment>
  9785. #include <transmission_pars_fragment>
  9786. #include <shadowmap_pars_fragment>
  9787. #include <bumpmap_pars_fragment>
  9788. #include <normalmap_pars_fragment>
  9789. #include <clearcoat_pars_fragment>
  9790. #include <iridescence_pars_fragment>
  9791. #include <roughnessmap_pars_fragment>
  9792. #include <metalnessmap_pars_fragment>
  9793. #include <logdepthbuf_pars_fragment>
  9794. #include <clipping_planes_pars_fragment>
  9795. void main() {
  9796. vec4 diffuseColor = vec4( diffuse, opacity );
  9797. #include <clipping_planes_fragment>
  9798. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  9799. vec3 totalEmissiveRadiance = emissive;
  9800. #include <logdepthbuf_fragment>
  9801. #include <map_fragment>
  9802. #include <color_fragment>
  9803. #include <alphamap_fragment>
  9804. #include <alphatest_fragment>
  9805. #include <alphahash_fragment>
  9806. #include <roughnessmap_fragment>
  9807. #include <metalnessmap_fragment>
  9808. #include <normal_fragment_begin>
  9809. #include <normal_fragment_maps>
  9810. #include <clearcoat_normal_fragment_begin>
  9811. #include <clearcoat_normal_fragment_maps>
  9812. #include <emissivemap_fragment>
  9813. #include <lights_physical_fragment>
  9814. #include <lights_fragment_begin>
  9815. #include <lights_fragment_maps>
  9816. #include <lights_fragment_end>
  9817. #include <aomap_fragment>
  9818. vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
  9819. vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
  9820. #include <transmission_fragment>
  9821. vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
  9822. #ifdef USE_SHEEN
  9823. float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
  9824. outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
  9825. #endif
  9826. #ifdef USE_CLEARCOAT
  9827. float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
  9828. vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
  9829. outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
  9830. #endif
  9831. #include <opaque_fragment>
  9832. #include <tonemapping_fragment>
  9833. #include <colorspace_fragment>
  9834. #include <fog_fragment>
  9835. #include <premultiplied_alpha_fragment>
  9836. #include <dithering_fragment>
  9837. }`,R2e=`#define TOON
  9838. varying vec3 vViewPosition;
  9839. #include <common>
  9840. #include <batching_pars_vertex>
  9841. #include <uv_pars_vertex>
  9842. #include <displacementmap_pars_vertex>
  9843. #include <color_pars_vertex>
  9844. #include <fog_pars_vertex>
  9845. #include <normal_pars_vertex>
  9846. #include <morphtarget_pars_vertex>
  9847. #include <skinning_pars_vertex>
  9848. #include <shadowmap_pars_vertex>
  9849. #include <logdepthbuf_pars_vertex>
  9850. #include <clipping_planes_pars_vertex>
  9851. void main() {
  9852. #include <uv_vertex>
  9853. #include <color_vertex>
  9854. #include <morphinstance_vertex>
  9855. #include <morphcolor_vertex>
  9856. #include <batching_vertex>
  9857. #include <beginnormal_vertex>
  9858. #include <morphnormal_vertex>
  9859. #include <skinbase_vertex>
  9860. #include <skinnormal_vertex>
  9861. #include <defaultnormal_vertex>
  9862. #include <normal_vertex>
  9863. #include <begin_vertex>
  9864. #include <morphtarget_vertex>
  9865. #include <skinning_vertex>
  9866. #include <displacementmap_vertex>
  9867. #include <project_vertex>
  9868. #include <logdepthbuf_vertex>
  9869. #include <clipping_planes_vertex>
  9870. vViewPosition = - mvPosition.xyz;
  9871. #include <worldpos_vertex>
  9872. #include <shadowmap_vertex>
  9873. #include <fog_vertex>
  9874. }`,L2e=`#define TOON
  9875. uniform vec3 diffuse;
  9876. uniform vec3 emissive;
  9877. uniform float opacity;
  9878. #include <common>
  9879. #include <packing>
  9880. #include <dithering_pars_fragment>
  9881. #include <color_pars_fragment>
  9882. #include <uv_pars_fragment>
  9883. #include <map_pars_fragment>
  9884. #include <alphamap_pars_fragment>
  9885. #include <alphatest_pars_fragment>
  9886. #include <alphahash_pars_fragment>
  9887. #include <aomap_pars_fragment>
  9888. #include <lightmap_pars_fragment>
  9889. #include <emissivemap_pars_fragment>
  9890. #include <gradientmap_pars_fragment>
  9891. #include <fog_pars_fragment>
  9892. #include <bsdfs>
  9893. #include <lights_pars_begin>
  9894. #include <normal_pars_fragment>
  9895. #include <lights_toon_pars_fragment>
  9896. #include <shadowmap_pars_fragment>
  9897. #include <bumpmap_pars_fragment>
  9898. #include <normalmap_pars_fragment>
  9899. #include <logdepthbuf_pars_fragment>
  9900. #include <clipping_planes_pars_fragment>
  9901. void main() {
  9902. vec4 diffuseColor = vec4( diffuse, opacity );
  9903. #include <clipping_planes_fragment>
  9904. ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
  9905. vec3 totalEmissiveRadiance = emissive;
  9906. #include <logdepthbuf_fragment>
  9907. #include <map_fragment>
  9908. #include <color_fragment>
  9909. #include <alphamap_fragment>
  9910. #include <alphatest_fragment>
  9911. #include <alphahash_fragment>
  9912. #include <normal_fragment_begin>
  9913. #include <normal_fragment_maps>
  9914. #include <emissivemap_fragment>
  9915. #include <lights_toon_fragment>
  9916. #include <lights_fragment_begin>
  9917. #include <lights_fragment_maps>
  9918. #include <lights_fragment_end>
  9919. #include <aomap_fragment>
  9920. vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
  9921. #include <opaque_fragment>
  9922. #include <tonemapping_fragment>
  9923. #include <colorspace_fragment>
  9924. #include <fog_fragment>
  9925. #include <premultiplied_alpha_fragment>
  9926. #include <dithering_fragment>
  9927. }`,D2e=`uniform float size;
  9928. uniform float scale;
  9929. #include <common>
  9930. #include <color_pars_vertex>
  9931. #include <fog_pars_vertex>
  9932. #include <morphtarget_pars_vertex>
  9933. #include <logdepthbuf_pars_vertex>
  9934. #include <clipping_planes_pars_vertex>
  9935. #ifdef USE_POINTS_UV
  9936. varying vec2 vUv;
  9937. uniform mat3 uvTransform;
  9938. #endif
  9939. void main() {
  9940. #ifdef USE_POINTS_UV
  9941. vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
  9942. #endif
  9943. #include <color_vertex>
  9944. #include <morphinstance_vertex>
  9945. #include <morphcolor_vertex>
  9946. #include <begin_vertex>
  9947. #include <morphtarget_vertex>
  9948. #include <project_vertex>
  9949. gl_PointSize = size;
  9950. #ifdef USE_SIZEATTENUATION
  9951. bool isPerspective = isPerspectiveMatrix( projectionMatrix );
  9952. if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
  9953. #endif
  9954. #include <logdepthbuf_vertex>
  9955. #include <clipping_planes_vertex>
  9956. #include <worldpos_vertex>
  9957. #include <fog_vertex>
  9958. }`,P2e=`uniform vec3 diffuse;
  9959. uniform float opacity;
  9960. #include <common>
  9961. #include <color_pars_fragment>
  9962. #include <map_particle_pars_fragment>
  9963. #include <alphatest_pars_fragment>
  9964. #include <alphahash_pars_fragment>
  9965. #include <fog_pars_fragment>
  9966. #include <logdepthbuf_pars_fragment>
  9967. #include <clipping_planes_pars_fragment>
  9968. void main() {
  9969. vec4 diffuseColor = vec4( diffuse, opacity );
  9970. #include <clipping_planes_fragment>
  9971. vec3 outgoingLight = vec3( 0.0 );
  9972. #include <logdepthbuf_fragment>
  9973. #include <map_particle_fragment>
  9974. #include <color_fragment>
  9975. #include <alphatest_fragment>
  9976. #include <alphahash_fragment>
  9977. outgoingLight = diffuseColor.rgb;
  9978. #include <opaque_fragment>
  9979. #include <tonemapping_fragment>
  9980. #include <colorspace_fragment>
  9981. #include <fog_fragment>
  9982. #include <premultiplied_alpha_fragment>
  9983. }`,I2e=`#include <common>
  9984. #include <batching_pars_vertex>
  9985. #include <fog_pars_vertex>
  9986. #include <morphtarget_pars_vertex>
  9987. #include <skinning_pars_vertex>
  9988. #include <logdepthbuf_pars_vertex>
  9989. #include <shadowmap_pars_vertex>
  9990. void main() {
  9991. #include <batching_vertex>
  9992. #include <beginnormal_vertex>
  9993. #include <morphinstance_vertex>
  9994. #include <morphnormal_vertex>
  9995. #include <skinbase_vertex>
  9996. #include <skinnormal_vertex>
  9997. #include <defaultnormal_vertex>
  9998. #include <begin_vertex>
  9999. #include <morphtarget_vertex>
  10000. #include <skinning_vertex>
  10001. #include <project_vertex>
  10002. #include <logdepthbuf_vertex>
  10003. #include <worldpos_vertex>
  10004. #include <shadowmap_vertex>
  10005. #include <fog_vertex>
  10006. }`,N2e=`uniform vec3 color;
  10007. uniform float opacity;
  10008. #include <common>
  10009. #include <packing>
  10010. #include <fog_pars_fragment>
  10011. #include <bsdfs>
  10012. #include <lights_pars_begin>
  10013. #include <logdepthbuf_pars_fragment>
  10014. #include <shadowmap_pars_fragment>
  10015. #include <shadowmask_pars_fragment>
  10016. void main() {
  10017. #include <logdepthbuf_fragment>
  10018. gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
  10019. #include <tonemapping_fragment>
  10020. #include <colorspace_fragment>
  10021. #include <fog_fragment>
  10022. }`,U2e=`uniform float rotation;
  10023. uniform vec2 center;
  10024. #include <common>
  10025. #include <uv_pars_vertex>
  10026. #include <fog_pars_vertex>
  10027. #include <logdepthbuf_pars_vertex>
  10028. #include <clipping_planes_pars_vertex>
  10029. void main() {
  10030. #include <uv_vertex>
  10031. vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
  10032. vec2 scale;
  10033. scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
  10034. scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
  10035. #ifndef USE_SIZEATTENUATION
  10036. bool isPerspective = isPerspectiveMatrix( projectionMatrix );
  10037. if ( isPerspective ) scale *= - mvPosition.z;
  10038. #endif
  10039. vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
  10040. vec2 rotatedPosition;
  10041. rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
  10042. rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
  10043. mvPosition.xy += rotatedPosition;
  10044. gl_Position = projectionMatrix * mvPosition;
  10045. #include <logdepthbuf_vertex>
  10046. #include <clipping_planes_vertex>
  10047. #include <fog_vertex>
  10048. }`,O2e=`uniform vec3 diffuse;
  10049. uniform float opacity;
  10050. #include <common>
  10051. #include <uv_pars_fragment>
  10052. #include <map_pars_fragment>
  10053. #include <alphamap_pars_fragment>
  10054. #include <alphatest_pars_fragment>
  10055. #include <alphahash_pars_fragment>
  10056. #include <fog_pars_fragment>
  10057. #include <logdepthbuf_pars_fragment>
  10058. #include <clipping_planes_pars_fragment>
  10059. void main() {
  10060. vec4 diffuseColor = vec4( diffuse, opacity );
  10061. #include <clipping_planes_fragment>
  10062. vec3 outgoingLight = vec3( 0.0 );
  10063. #include <logdepthbuf_fragment>
  10064. #include <map_fragment>
  10065. #include <alphamap_fragment>
  10066. #include <alphatest_fragment>
  10067. #include <alphahash_fragment>
  10068. outgoingLight = diffuseColor.rgb;
  10069. #include <opaque_fragment>
  10070. #include <tonemapping_fragment>
  10071. #include <colorspace_fragment>
  10072. #include <fog_fragment>
  10073. }`,yr={alphahash_fragment:iRe,alphahash_pars_fragment:nRe,alphamap_fragment:aRe,alphamap_pars_fragment:oRe,alphatest_fragment:sRe,alphatest_pars_fragment:lRe,aomap_fragment:uRe,aomap_pars_fragment:cRe,batching_pars_vertex:hRe,batching_vertex:fRe,begin_vertex:pRe,beginnormal_vertex:dRe,bsdfs:mRe,iridescence_fragment:vRe,bumpmap_pars_fragment:gRe,clipping_planes_fragment:yRe,clipping_planes_pars_fragment:_Re,clipping_planes_pars_vertex:xRe,clipping_planes_vertex:SRe,color_fragment:MRe,color_pars_fragment:bRe,color_pars_vertex:wRe,color_vertex:TRe,common:ERe,cube_uv_reflection_fragment:ARe,defaultnormal_vertex:CRe,displacementmap_pars_vertex:RRe,displacementmap_vertex:LRe,emissivemap_fragment:DRe,emissivemap_pars_fragment:PRe,colorspace_fragment:IRe,colorspace_pars_fragment:NRe,envmap_fragment:URe,envmap_common_pars_fragment:ORe,envmap_pars_fragment:zRe,envmap_pars_vertex:FRe,envmap_physical_pars_fragment:KRe,envmap_vertex:BRe,fog_vertex:kRe,fog_pars_vertex:VRe,fog_fragment:GRe,fog_pars_fragment:HRe,gradientmap_pars_fragment:WRe,lightmap_fragment:XRe,lightmap_pars_fragment:YRe,lights_lambert_fragment:qRe,lights_lambert_pars_fragment:ZRe,lights_pars_begin:jRe,lights_toon_fragment:JRe,lights_toon_pars_fragment:$Re,lights_phong_fragment:QRe,lights_phong_pars_fragment:eLe,lights_physical_fragment:tLe,lights_physical_pars_fragment:rLe,lights_fragment_begin:iLe,lights_fragment_maps:nLe,lights_fragment_end:aLe,logdepthbuf_fragment:oLe,logdepthbuf_pars_fragment:sLe,logdepthbuf_pars_vertex:lLe,logdepthbuf_vertex:uLe,map_fragment:cLe,map_pars_fragment:hLe,map_particle_fragment:fLe,map_particle_pars_fragment:pLe,metalnessmap_fragment:dLe,metalnessmap_pars_fragment:mLe,morphinstance_vertex:vLe,morphcolor_vertex:gLe,morphnormal_vertex:yLe,morphtarget_pars_vertex:_Le,morphtarget_vertex:xLe,normal_fragment_begin:SLe,normal_fragment_maps:MLe,normal_pars_fragment:bLe,normal_pars_vertex:wLe,normal_vertex:TLe,normalmap_pars_fragment:ELe,clearcoat_normal_fragment_begin:ALe,clearcoat_normal_fragment_maps:CLe,clearcoat_pars_fragment:RLe,iridescence_pars_fragment:LLe,opaque_fragment:DLe,packing:PLe,premultiplied_alpha_fragment:ILe,project_vertex:NLe,dithering_fragment:ULe,dithering_pars_fragment:OLe,roughnessmap_fragment:zLe,roughnessmap_pars_fragment:FLe,shadowmap_pars_fragment:BLe,shadowmap_pars_vertex:kLe,shadowmap_vertex:VLe,shadowmask_pars_fragment:GLe,skinbase_vertex:HLe,skinning_pars_vertex:WLe,skinning_vertex:XLe,skinnormal_vertex:YLe,specularmap_fragment:qLe,specularmap_pars_fragment:ZLe,tonemapping_fragment:jLe,tonemapping_pars_fragment:KLe,transmission_fragment:JLe,transmission_pars_fragment:$Le,uv_pars_fragment:QLe,uv_pars_vertex:e2e,uv_vertex:t2e,worldpos_vertex:r2e,background_vert:i2e,background_frag:n2e,backgroundCube_vert:a2e,backgroundCube_frag:o2e,cube_vert:s2e,cube_frag:l2e,depth_vert:u2e,depth_frag:c2e,distanceRGBA_vert:h2e,distanceRGBA_frag:f2e,equirect_vert:p2e,equirect_frag:d2e,linedashed_vert:m2e,linedashed_frag:v2e,meshbasic_vert:g2e,meshbasic_frag:y2e,meshlambert_vert:_2e,meshlambert_frag:x2e,meshmatcap_vert:S2e,meshmatcap_frag:M2e,meshnormal_vert:b2e,meshnormal_frag:w2e,meshphong_vert:T2e,meshphong_frag:E2e,meshphysical_vert:A2e,meshphysical_frag:C2e,meshtoon_vert:R2e,meshtoon_frag:L2e,points_vert:D2e,points_frag:P2e,shadow_vert:I2e,shadow_frag:N2e,sprite_vert:U2e,sprite_frag:O2e},St={common:{diffuse:{value:new nr(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new vr},alphaMap:{value:null},alphaMapTransform:{value:new vr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new vr}},envmap:{envMap:{value:null},envMapRotation:{value:new vr},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new vr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new vr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new vr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new vr},normalScale:{value:new xr(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new vr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new vr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new vr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new vr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new nr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new nr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new vr},alphaTest:{value:0},uvTransform:{value:new vr}},sprite:{diffuse:{value:new nr(16777215)},opacity:{value:1},center:{value:new xr(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new vr},alphaMap:{value:null},alphaMapTransform:{value:new vr},alphaTest:{value:0}}},Hu={basic:{uniforms:Da([St.common,St.specularmap,St.envmap,St.aomap,St.lightmap,St.fog]),vertexShader:yr.meshbasic_vert,fragmentShader:yr.meshbasic_frag},lambert:{uniforms:Da([St.common,St.specularmap,St.envmap,St.aomap,St.lightmap,St.emissivemap,St.bumpmap,St.normalmap,St.displacementmap,St.fog,St.lights,{emissive:{value:new nr(0)}}]),vertexShader:yr.meshlambert_vert,fragmentShader:yr.meshlambert_frag},phong:{uniforms:Da([St.common,St.specularmap,St.envmap,St.aomap,St.lightmap,St.emissivemap,St.bumpmap,St.normalmap,St.displacementmap,St.fog,St.lights,{emissive:{value:new nr(0)},specular:{value:new nr(1118481)},shininess:{value:30}}]),vertexShader:yr.meshphong_vert,fragmentShader:yr.meshphong_frag},standard:{uniforms:Da([St.common,St.envmap,St.aomap,St.lightmap,St.emissivemap,St.bumpmap,St.normalmap,St.displacementmap,St.roughnessmap,St.metalnessmap,St.fog,St.lights,{emissive:{value:new nr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yr.meshphysical_vert,fragmentShader:yr.meshphysical_frag},toon:{uniforms:Da([St.common,St.aomap,St.lightmap,St.emissivemap,St.bumpmap,St.normalmap,St.displacementmap,St.gradientmap,St.fog,St.lights,{emissive:{value:new nr(0)}}]),vertexShader:yr.meshtoon_vert,fragmentShader:yr.meshtoon_frag},matcap:{uniforms:Da([St.common,St.bumpmap,St.normalmap,St.displacementmap,St.fog,{matcap:{value:null}}]),vertexShader:yr.meshmatcap_vert,fragmentShader:yr.meshmatcap_frag},points:{uniforms:Da([St.points,St.fog]),vertexShader:yr.points_vert,fragmentShader:yr.points_frag},dashed:{uniforms:Da([St.common,St.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yr.linedashed_vert,fragmentShader:yr.linedashed_frag},depth:{uniforms:Da([St.common,St.displacementmap]),vertexShader:yr.depth_vert,fragmentShader:yr.depth_frag},normal:{uniforms:Da([St.common,St.bumpmap,St.normalmap,St.displacementmap,{opacity:{value:1}}]),vertexShader:yr.meshnormal_vert,fragmentShader:yr.meshnormal_frag},sprite:{uniforms:Da([St.sprite,St.fog]),vertexShader:yr.sprite_vert,fragmentShader:yr.sprite_frag},background:{uniforms:{uvTransform:{value:new vr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yr.background_vert,fragmentShader:yr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new vr}},vertexShader:yr.backgroundCube_vert,fragmentShader:yr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yr.cube_vert,fragmentShader:yr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yr.equirect_vert,fragmentShader:yr.equirect_frag},distanceRGBA:{uniforms:Da([St.common,St.displacementmap,{referencePosition:{value:new ye},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yr.distanceRGBA_vert,fragmentShader:yr.distanceRGBA_frag},shadow:{uniforms:Da([St.lights,St.fog,{color:{value:new nr(0)},opacity:{value:1}}]),vertexShader:yr.shadow_vert,fragmentShader:yr.shadow_frag}};Hu.physical={uniforms:Da([Hu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new vr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new vr},clearcoatNormalScale:{value:new xr(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new vr},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new vr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new vr},sheen:{value:0},sheenColor:{value:new nr(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new vr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new vr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new vr},transmissionSamplerSize:{value:new xr},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new vr},attenuationDistance:{value:0},attenuationColor:{value:new nr(0)},specularColor:{value:new nr(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new vr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new vr},anisotropyVector:{value:new xr},anisotropyMap:{value:null},anisotropyMapTransform:{value:new vr}}]),vertexShader:yr.meshphysical_vert,fragmentShader:yr.meshphysical_frag};var qC={r:0,b:0,g:0},Wd=new Vn,z2e=new Xt;function F2e(r,e,t,i,n,a,o){let s=new nr(0),l=a===!0?0:1,u,c,h=null,f=0,p=null;function d(m,v){let _=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?t:e).get(y)),y===null?g(s,l):y&&y.isColor&&(g(y,1),_=!0);let x=r.xr.getEnvironmentBlendMode();x==="additive"?i.buffers.color.setClear(0,0,0,1,o):x==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(r.autoClear||_)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),y&&(y.isCubeTexture||y.mapping===UR)?(c===void 0&&(c=new Wo(new xM(1,1,1),new Xu({name:"BackgroundCubeMaterial",uniforms:c0(Hu.backgroundCube.uniforms),vertexShader:Hu.backgroundCube.vertexShader,fragmentShader:Hu.backgroundCube.fragmentShader,side:Xo,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(M,S,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),Wd.copy(v.backgroundRotation),Wd.x*=-1,Wd.y*=-1,Wd.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Wd.y*=-1,Wd.z*=-1),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(z2e.makeRotationFromEuler(Wd)),c.material.toneMapped=ti.getTransfer(y.colorSpace)!==ui,(h!==y||f!==y.version||p!==r.toneMapping)&&(c.material.needsUpdate=!0,h=y,f=y.version,p=r.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(u===void 0&&(u=new Wo(new vR(2,2),new Xu({name:"BackgroundMaterial",uniforms:c0(Hu.background.uniforms),vertexShader:Hu.background.vertexShader,fragmentShader:Hu.background.fragmentShader,side:Ff,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(u)),u.material.uniforms.t2D.value=y,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=ti.getTransfer(y.colorSpace)!==ui,y.matrixAutoUpdate===!0&&y.updateMatrix(),u.material.uniforms.uvTransform.value.copy(y.matrix),(h!==y||f!==y.version||p!==r.toneMapping)&&(u.material.needsUpdate=!0,h=y,f=y.version,p=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function g(m,v){m.getRGB(qC,Wae(r)),i.buffers.color.setClear(qC.r,qC.g,qC.b,v,o)}return{getClearColor:function(){return s},setClearColor:function(m,v=1){s.set(m),l=v,g(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(m){l=m,g(s,l)},render:d}}function B2e(r,e,t,i){let n=r.getParameter(r.MAX_VERTEX_ATTRIBS),a=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||a!==null,s={},l=m(null),u=l,c=!1;function h(A,P,U,B,z){let k=!1;if(o){let G=g(B,U,P);u!==G&&(u=G,p(u.object)),k=v(A,B,U,z),k&&_(A,B,U,z)}else{let G=P.wireframe===!0;(u.geometry!==B.id||u.program!==U.id||u.wireframe!==G)&&(u.geometry=B.id,u.program=U.id,u.wireframe=G,k=!0)}z!==null&&t.update(z,r.ELEMENT_ARRAY_BUFFER),(k||c)&&(c=!1,T(A,P,U,B),z!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(z).buffer))}function f(){return i.isWebGL2?r.createVertexArray():a.createVertexArrayOES()}function p(A){return i.isWebGL2?r.bindVertexArray(A):a.bindVertexArrayOES(A)}function d(A){return i.isWebGL2?r.deleteVertexArray(A):a.deleteVertexArrayOES(A)}function g(A,P,U){let B=U.wireframe===!0,z=s[A.id];z===void 0&&(z={},s[A.id]=z);let k=z[P.id];k===void 0&&(k={},z[P.id]=k);let G=k[B];return G===void 0&&(G=m(f()),k[B]=G),G}function m(A){let P=[],U=[],B=[];for(let z=0;z<n;z++)P[z]=0,U[z]=0,B[z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:P,enabledAttributes:U,attributeDivisors:B,object:A,attributes:{},index:null}}function v(A,P,U,B){let z=u.attributes,k=P.attributes,G=0,Y=U.getAttributes();for(let J in Y)if(Y[J].location>=0){let V=z[J],K=k[J];if(K===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(K=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(K=A.instanceColor)),V===void 0||V.attribute!==K||K&&V.data!==K.data)return!0;G++}return u.attributesNum!==G||u.index!==B}function _(A,P,U,B){let z={},k=P.attributes,G=0,Y=U.getAttributes();for(let J in Y)if(Y[J].location>=0){let V=k[J];V===void 0&&(J==="instanceMatrix"&&A.instanceMatrix&&(V=A.instanceMatrix),J==="instanceColor"&&A.instanceColor&&(V=A.instanceColor));let K={};K.attribute=V,V&&V.data&&(K.data=V.data),z[J]=K,G++}u.attributes=z,u.attributesNum=G,u.index=B}function y(){let A=u.newAttributes;for(let P=0,U=A.length;P<U;P++)A[P]=0}function x(A){M(A,0)}function M(A,P){let U=u.newAttributes,B=u.enabledAttributes,z=u.attributeDivisors;U[A]=1,B[A]===0&&(r.enableVertexAttribArray(A),B[A]=1),z[A]!==P&&((i.isWebGL2?r:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](A,P),z[A]=P)}function S(){let A=u.newAttributes,P=u.enabledAttributes;for(let U=0,B=P.length;U<B;U++)P[U]!==A[U]&&(r.disableVertexAttribArray(U),P[U]=0)}function w(A,P,U,B,z,k,G){G===!0?r.vertexAttribIPointer(A,P,U,z,k):r.vertexAttribPointer(A,P,U,B,z,k)}function T(A,P,U,B){if(i.isWebGL2===!1&&(A.isInstancedMesh||B.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;y();let z=B.attributes,k=U.getAttributes(),G=P.defaultAttributeValues;for(let Y in k){let J=k[Y];if(J.location>=0){let Q=z[Y];if(Q===void 0&&(Y==="instanceMatrix"&&A.instanceMatrix&&(Q=A.instanceMatrix),Y==="instanceColor"&&A.instanceColor&&(Q=A.instanceColor)),Q!==void 0){let V=Q.normalized,K=Q.itemSize,ae=t.get(Q);if(ae===void 0)continue;let ve=ae.buffer,ue=ae.type,se=ae.bytesPerElement,Ee=i.isWebGL2===!0&&(ue===r.INT||ue===r.UNSIGNED_INT||Q.gpuType===Nae);if(Q.isInterleavedBufferAttribute){let q=Q.data,H=q.stride,We=Q.offset;if(q.isInstancedInterleavedBuffer){for(let _e=0;_e<J.locationSize;_e++)M(J.location+_e,q.meshPerAttribute);A.isInstancedMesh!==!0&&B._maxInstanceCount===void 0&&(B._maxInstanceCount=q.meshPerAttribute*q.count)}else for(let _e=0;_e<J.locationSize;_e++)x(J.location+_e);r.bindBuffer(r.ARRAY_BUFFER,ve);for(let _e=0;_e<J.locationSize;_e++)w(J.location+_e,K/J.locationSize,ue,V,H*se,(We+K/J.locationSize*_e)*se,Ee)}else{if(Q.isInstancedBufferAttribute){for(let q=0;q<J.locationSize;q++)M(J.location+q,Q.meshPerAttribute);A.isInstancedMesh!==!0&&B._maxInstanceCount===void 0&&(B._maxInstanceCount=Q.meshPerAttribute*Q.count)}else for(let q=0;q<J.locationSize;q++)x(J.location+q);r.bindBuffer(r.ARRAY_BUFFER,ve);for(let q=0;q<J.locationSize;q++)w(J.location+q,K/J.locationSize,ue,V,K*se,K/J.locationSize*q*se,Ee)}}else if(G!==void 0){let V=G[Y];if(V!==void 0)switch(V.length){case 2:r.vertexAttrib2fv(J.location,V);break;case 3:r.vertexAttrib3fv(J.location,V);break;case 4:r.vertexAttrib4fv(J.location,V);break;default:r.vertexAttrib1fv(J.location,V)}}}}S()}function C(){I();for(let A in s){let P=s[A];for(let U in P){let B=P[U];for(let z in B)d(B[z].object),delete B[z];delete P[U]}delete s[A]}}function b(A){if(s[A.id]===void 0)return;let P=s[A.id];for(let U in P){let B=P[U];for(let z in B)d(B[z].object),delete B[z];delete P[U]}delete s[A.id]}function E(A){for(let P in s){let U=s[P];if(U[A.id]===void 0)continue;let B=U[A.id];for(let z in B)d(B[z].object),delete B[z];delete U[A.id]}}function I(){R(),c=!0,u!==l&&(u=l,p(u.object))}function R(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:I,resetDefaultState:R,dispose:C,releaseStatesOfGeometry:b,releaseStatesOfProgram:E,initAttributes:y,enableAttribute:x,disableUnusedAttributes:S}}function k2e(r,e,t,i){let n=i.isWebGL2,a;function o(c){a=c}function s(c,h){r.drawArrays(a,c,h),t.update(h,a,1)}function l(c,h,f){if(f===0)return;let p,d;if(n)p=r,d="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),d="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[d](a,c,h,f),t.update(h,a,f)}function u(c,h,f){if(f===0)return;let p=e.get("WEBGL_multi_draw");if(p===null)for(let d=0;d<f;d++)this.render(c[d],h[d]);else{p.multiDrawArraysWEBGL(a,c,0,h,0,f);let d=0;for(let g=0;g<f;g++)d+=h[g];t.update(d,a,1)}}this.setMode=o,this.render=s,this.renderInstances=l,this.renderMultiDraw=u}function V2e(r,e,t){let i;function n(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){let w=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(w.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(w){if(w==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext",s=t.precision!==void 0?t.precision:"highp",l=a(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);let u=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,h=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),f=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=r.getParameter(r.MAX_TEXTURE_SIZE),d=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),m=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),v=r.getParameter(r.MAX_VARYING_VECTORS),_=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),y=f>0,x=o||e.has("OES_texture_float"),M=y&&x,S=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:n,getMaxPrecision:a,precision:s,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:f,maxTextureSize:p,maxCubemapSize:d,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:M,maxSamples:S}}function G2e(r){let e=this,t=null,i=0,n=!1,a=!1,o=new Yc,s=new vr,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){let p=h.length!==0||f||i!==0||n;return n=f,i=h.length,p},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(h,f){t=c(h,f,0)},this.setState=function(h,f,p){let d=h.clippingPlanes,g=h.clipIntersection,m=h.clipShadows,v=r.get(h);if(!n||d===null||d.length===0||a&&!m)a?c(null):u();else{let _=a?0:i,y=_*4,x=v.clippingState||null;l.value=x,x=c(d,f,y,p);for(let M=0;M!==y;++M)x[M]=t[M];v.clippingState=x,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(h,f,p,d){let g=h!==null?h.length:0,m=null;if(g!==0){if(m=l.value,d!==!0||m===null){let v=p+g*4,_=f.matrixWorldInverse;s.getNormalMatrix(_),(m===null||m.length<v)&&(m=new Float32Array(v));for(let y=0,x=p;y!==g;++y,x+=4)o.copy(h[y]).applyMatrix4(_,s),o.normal.toArray(m,x),m[x+3]=o.constant}l.value=m,l.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,m}}function H2e(r){let e=new WeakMap;function t(o,s){return s===vM?o.mapping=n0:s===oB&&(o.mapping=a0),o}function i(o){if(o&&o.isTexture){let s=o.mapping;if(s===vM||s===oB)if(e.has(o)){let l=e.get(o).texture;return t(l,o.mapping)}else{let l=o.image;if(l&&l.height>0){let u=new pB(l.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",n),t(u.texture,o.mapping)}else return null}}return o}function n(o){let s=o.target;s.removeEventListener("dispose",n);let l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}var h0=class extends dR{constructor(e=-1,t=1,i=1,n=-1,a=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=a,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,a,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,a=i-e,o=i+e,s=n+t,l=n-t;if(this.view!==null&&this.view.enabled){let u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=u*this.view.offsetX,o=a+u*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(a,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},$y=4,Kne=[.125,.215,.35,.446,.526,.582],Zd=20,ZF=new h0,Jne=new nr,jF=null,KF=0,JF=0,Yd=(1+Math.sqrt(5))/2,jy=1/Yd,$ne=[new ye(1,1,1),new ye(-1,1,1),new ye(1,1,-1),new ye(-1,1,-1),new ye(0,Yd,jy),new ye(0,Yd,-jy),new ye(jy,0,Yd),new ye(-jy,0,Yd),new ye(Yd,jy,0),new ye(-Yd,jy,0)],gR=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){jF=this._renderer.getRenderTarget(),KF=this._renderer.getActiveCubeFace(),JF=this._renderer.getActiveMipmapLevel(),this._setSize(256);let a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(e,i,n,a),t>0&&this._blur(a,0,0,t),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=tae(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=eae(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(jF,KF,JF),e.scissorTest=!1,ZC(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===n0||e.mapping===a0?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),jF=this._renderer.getRenderTarget(),KF=this._renderer.getActiveCubeFace(),JF=this._renderer.getActiveMipmapLevel();let i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:Go,minFilter:Go,generateMipmaps:!1,type:gM,format:sl,colorSpace:Yf,depthBuffer:!1},n=Qne(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Qne(e,t,i);let{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=W2e(a)),this._blurMaterial=X2e(a,e,t)}return n}_compileMaterial(e){let t=new Wo(this._lodPlanes[0],e);this._renderer.compile(t,ZF)}_sceneToCubeUV(e,t,i,n){let s=new Fn(90,1,t,i),l=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],c=this._renderer,h=c.autoClear,f=c.toneMapping;c.getClearColor(Jne),c.toneMapping=Of,c.autoClear=!1;let p=new fR({name:"PMREM.Background",side:Xo,depthWrite:!1,depthTest:!1}),d=new Wo(new xM,p),g=!1,m=e.background;m?m.isColor&&(p.color.copy(m),e.background=null,g=!0):(p.color.copy(Jne),g=!0);for(let v=0;v<6;v++){let _=v%3;_===0?(s.up.set(0,l[v],0),s.lookAt(u[v],0,0)):_===1?(s.up.set(0,0,l[v]),s.lookAt(0,u[v],0)):(s.up.set(0,l[v],0),s.lookAt(0,0,u[v]));let y=this._cubeSize;ZC(n,_*y,v>2?y:0,y,y),c.setRenderTarget(n),g&&c.render(d,s),c.render(e,s)}d.geometry.dispose(),d.material.dispose(),c.toneMapping=f,c.autoClear=h,e.background=m}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===n0||e.mapping===a0;n?(this._cubemapMaterial===null&&(this._cubemapMaterial=tae()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=eae());let a=n?this._cubemapMaterial:this._equirectMaterial,o=new Wo(this._lodPlanes[0],a),s=a.uniforms;s.envMap.value=e;let l=this._cubeSize;ZC(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,ZF)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;n<this._lodPlanes.length;n++){let a=Math.sqrt(this._sigmas[n]*this._sigmas[n]-this._sigmas[n-1]*this._sigmas[n-1]),o=$ne[(n-1)%$ne.length];this._blur(e,n-1,n,a,o)}t.autoClear=i}_blur(e,t,i,n,a){let o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,n,"latitudinal",a),this._halfBlur(o,e,i,i,n,"longitudinal",a)}_halfBlur(e,t,i,n,a,o,s){let l=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let c=3,h=new Wo(this._lodPlanes[n],u),f=u.uniforms,p=this._sizeLods[i]-1,d=isFinite(a)?Math.PI/(2*p):2*Math.PI/(2*Zd-1),g=a/d,m=isFinite(a)?1+Math.floor(c*g):Zd;m>Zd&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Zd}`);let v=[],_=0;for(let w=0;w<Zd;++w){let T=w/g,C=Math.exp(-T*T/2);v.push(C),w===0?_+=C:w<m&&(_+=2*C)}for(let w=0;w<v.length;w++)v[w]=v[w]/_;f.envMap.value=e.texture,f.samples.value=m,f.weights.value=v,f.latitudinal.value=o==="latitudinal",s&&(f.poleAxis.value=s);let{_lodMax:y}=this;f.dTheta.value=d,f.mipInt.value=y-i;let x=this._sizeLods[n],M=3*x*(n>y-$y?n-y+$y:0),S=4*(this._cubeSize-x);ZC(t,M,S,3*x,2*x),l.setRenderTarget(t),l.render(h,ZF)}};function W2e(r){let e=[],t=[],i=[],n=r,a=r-$y+1+Kne.length;for(let o=0;o<a;o++){let s=Math.pow(2,n);t.push(s);let l=1/s;o>r-$y?l=Kne[o-r+$y-1]:o===0&&(l=0),i.push(l);let u=1/(s-2),c=-u,h=1+u,f=[c,c,h,c,h,h,c,c,h,h,c,h],p=6,d=6,g=3,m=2,v=1,_=new Float32Array(g*d*p),y=new Float32Array(m*d*p),x=new Float32Array(v*d*p);for(let S=0;S<p;S++){let w=S%3*2/3-1,T=S>2?0:-1,C=[w,T,0,w+2/3,T,0,w+2/3,T+1,0,w,T,0,w+2/3,T+1,0,w,T+1,0];_.set(C,g*d*S),y.set(f,m*d*S);let b=[S,S,S,S,S,S];x.set(b,v*d*S)}let M=new ul;M.setAttribute("position",new ll(_,g)),M.setAttribute("uv",new ll(y,m)),M.setAttribute("faceIndex",new ll(x,v)),e.push(M),n>$y&&n--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function Qne(r,e,t){let i=new Kc(r,e,t);return i.texture.mapping=UR,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ZC(r,e,t,i,n){r.viewport.set(e,t,i,n),r.scissor.set(e,t,i,n)}function X2e(r,e,t){let i=new Float32Array(Zd),n=new ye(0,1,0);return new Xu({name:"SphericalGaussianBlur",defines:{n:Zd,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:YB(),fragmentShader:`
  10074. precision mediump float;
  10075. precision mediump int;
  10076. varying vec3 vOutputDirection;
  10077. uniform sampler2D envMap;
  10078. uniform int samples;
  10079. uniform float weights[ n ];
  10080. uniform bool latitudinal;
  10081. uniform float dTheta;
  10082. uniform float mipInt;
  10083. uniform vec3 poleAxis;
  10084. #define ENVMAP_TYPE_CUBE_UV
  10085. #include <cube_uv_reflection_fragment>
  10086. vec3 getSample( float theta, vec3 axis ) {
  10087. float cosTheta = cos( theta );
  10088. // Rodrigues' axis-angle rotation
  10089. vec3 sampleDirection = vOutputDirection * cosTheta
  10090. + cross( axis, vOutputDirection ) * sin( theta )
  10091. + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
  10092. return bilinearCubeUV( envMap, sampleDirection, mipInt );
  10093. }
  10094. void main() {
  10095. vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
  10096. if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
  10097. axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
  10098. }
  10099. axis = normalize( axis );
  10100. gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
  10101. gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
  10102. for ( int i = 1; i < n; i++ ) {
  10103. if ( i >= samples ) {
  10104. break;
  10105. }
  10106. float theta = dTheta * float( i );
  10107. gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
  10108. gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
  10109. }
  10110. }
  10111. `,blending:Uf,depthTest:!1,depthWrite:!1})}function eae(){return new Xu({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:YB(),fragmentShader:`
  10112. precision mediump float;
  10113. precision mediump int;
  10114. varying vec3 vOutputDirection;
  10115. uniform sampler2D envMap;
  10116. #include <common>
  10117. void main() {
  10118. vec3 outputDirection = normalize( vOutputDirection );
  10119. vec2 uv = equirectUv( outputDirection );
  10120. gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
  10121. }
  10122. `,blending:Uf,depthTest:!1,depthWrite:!1})}function tae(){return new Xu({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:YB(),fragmentShader:`
  10123. precision mediump float;
  10124. precision mediump int;
  10125. uniform float flipEnvMap;
  10126. varying vec3 vOutputDirection;
  10127. uniform samplerCube envMap;
  10128. void main() {
  10129. gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
  10130. }
  10131. `,blending:Uf,depthTest:!1,depthWrite:!1})}function YB(){return`
  10132. precision mediump float;
  10133. precision mediump int;
  10134. attribute float faceIndex;
  10135. varying vec3 vOutputDirection;
  10136. // RH coordinate system; PMREM face-indexing convention
  10137. vec3 getDirection( vec2 uv, float face ) {
  10138. uv = 2.0 * uv - 1.0;
  10139. vec3 direction = vec3( uv, 1.0 );
  10140. if ( face == 0.0 ) {
  10141. direction = direction.zyx; // ( 1, v, u ) pos x
  10142. } else if ( face == 1.0 ) {
  10143. direction = direction.xzy;
  10144. direction.xz *= -1.0; // ( -u, 1, -v ) pos y
  10145. } else if ( face == 2.0 ) {
  10146. direction.x *= -1.0; // ( -u, v, 1 ) pos z
  10147. } else if ( face == 3.0 ) {
  10148. direction = direction.zyx;
  10149. direction.xz *= -1.0; // ( -1, v, -u ) neg x
  10150. } else if ( face == 4.0 ) {
  10151. direction = direction.xzy;
  10152. direction.xy *= -1.0; // ( -u, -1, v ) neg y
  10153. } else if ( face == 5.0 ) {
  10154. direction.z *= -1.0; // ( u, v, -1 ) neg z
  10155. }
  10156. return direction;
  10157. }
  10158. void main() {
  10159. vOutputDirection = getDirection( uv, faceIndex );
  10160. gl_Position = vec4( position, 1.0 );
  10161. }
  10162. `}function Y2e(r){let e=new WeakMap,t=null;function i(s){if(s&&s.isTexture){let l=s.mapping,u=l===vM||l===oB,c=l===n0||l===a0;if(u||c)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let h=e.get(s);return t===null&&(t=new gR(r)),h=u?t.fromEquirectangular(s,h):t.fromCubemap(s,h),e.set(s,h),h.texture}else{if(e.has(s))return e.get(s).texture;{let h=s.image;if(u&&h&&h.height>0||c&&h&&n(h)){t===null&&(t=new gR(r));let f=u?t.fromEquirectangular(s):t.fromCubemap(s);return e.set(s,f),s.addEventListener("dispose",a),f.texture}else return null}}}return s}function n(s){let l=0,u=6;for(let c=0;c<u;c++)s[c]!==void 0&&l++;return l===u}function a(s){let l=s.target;l.removeEventListener("dispose",a);let u=e.get(l);u!==void 0&&(e.delete(l),u.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:o}}function q2e(r){let e={};function t(i){if(e[i]!==void 0)return e[i];let n;switch(i){case"WEBGL_depth_texture":n=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=r.getExtension(i)}return e[i]=n,n}return{has:function(i){return t(i)!==null},init:function(i){i.isWebGL2?(t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance")):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(i){let n=t(i);return n===null&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),n}}}function Z2e(r,e,t,i){let n={},a=new WeakMap;function o(h){let f=h.target;f.index!==null&&e.remove(f.index);for(let d in f.attributes)e.remove(f.attributes[d]);for(let d in f.morphAttributes){let g=f.morphAttributes[d];for(let m=0,v=g.length;m<v;m++)e.remove(g[m])}f.removeEventListener("dispose",o),delete n[f.id];let p=a.get(f);p&&(e.remove(p),a.delete(f)),i.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function s(h,f){return n[f.id]===!0||(f.addEventListener("dispose",o),n[f.id]=!0,t.memory.geometries++),f}function l(h){let f=h.attributes;for(let d in f)e.update(f[d],r.ARRAY_BUFFER);let p=h.morphAttributes;for(let d in p){let g=p[d];for(let m=0,v=g.length;m<v;m++)e.update(g[m],r.ARRAY_BUFFER)}}function u(h){let f=[],p=h.index,d=h.attributes.position,g=0;if(p!==null){let _=p.array;g=p.version;for(let y=0,x=_.length;y<x;y+=3){let M=_[y+0],S=_[y+1],w=_[y+2];f.push(M,S,S,w,w,M)}}else if(d!==void 0){let _=d.array;g=d.version;for(let y=0,x=_.length/3-1;y<x;y+=3){let M=y+0,S=y+1,w=y+2;f.push(M,S,S,w,w,M)}}else return;let m=new(Gae(f)?pR:u0)(f,1);m.version=g;let v=a.get(h);v&&e.remove(v),a.set(h,m)}function c(h){let f=a.get(h);if(f){let p=h.index;p!==null&&f.version<p.version&&u(h)}else u(h);return a.get(h)}return{get:s,update:l,getWireframeAttribute:c}}function j2e(r,e,t,i){let n=i.isWebGL2,a;function o(p){a=p}let s,l;function u(p){s=p.type,l=p.bytesPerElement}function c(p,d){r.drawElements(a,d,s,p*l),t.update(d,a,1)}function h(p,d,g){if(g===0)return;let m,v;if(n)m=r,v="drawElementsInstanced";else if(m=e.get("ANGLE_instanced_arrays"),v="drawElementsInstancedANGLE",m===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}m[v](a,d,s,p*l,g),t.update(d,a,g)}function f(p,d,g){if(g===0)return;let m=e.get("WEBGL_multi_draw");if(m===null)for(let v=0;v<g;v++)this.render(p[v]/l,d[v]);else{m.multiDrawElementsWEBGL(a,d,0,s,p,0,g);let v=0;for(let _=0;_<g;_++)v+=d[_];t.update(v,a,1)}}this.setMode=o,this.setIndex=u,this.render=c,this.renderInstances=h,this.renderMultiDraw=f}function K2e(r){let e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(a,o,s){switch(t.calls++,o){case r.TRIANGLES:t.triangles+=s*(a/3);break;case r.LINES:t.lines+=s*(a/2);break;case r.LINE_STRIP:t.lines+=s*(a-1);break;case r.LINE_LOOP:t.lines+=s*a;break;case r.POINTS:t.points+=s*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function n(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:n,update:i}}function J2e(r,e){return r[0]-e[0]}function $2e(r,e){return Math.abs(e[1])-Math.abs(r[1])}function Q2e(r,e,t){let i={},n=new Float32Array(8),a=new WeakMap,o=new Ur,s=[];for(let u=0;u<8;u++)s[u]=[u,0];function l(u,c,h){let f=u.morphTargetInfluences;if(e.isWebGL2===!0){let d=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,g=d!==void 0?d.length:0,m=a.get(c);if(m===void 0||m.count!==g){let R=function(){E.dispose(),a.delete(c),c.removeEventListener("dispose",R)};var p=R;m!==void 0&&m.texture.dispose();let v=c.morphAttributes.position!==void 0,_=c.morphAttributes.normal!==void 0,y=c.morphAttributes.color!==void 0,x=c.morphAttributes.position||[],M=c.morphAttributes.normal||[],S=c.morphAttributes.color||[],w=0;v===!0&&(w=1),_===!0&&(w=2),y===!0&&(w=3);let T=c.attributes.position.count*w,C=1;T>e.maxTextureSize&&(C=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let b=new Float32Array(T*C*4*g),E=new cR(b,T,C,g);E.type=Wu,E.needsUpdate=!0;let I=w*4;for(let A=0;A<g;A++){let P=x[A],U=M[A],B=S[A],z=T*C*4*A;for(let k=0;k<P.count;k++){let G=k*I;v===!0&&(o.fromBufferAttribute(P,k),b[z+G+0]=o.x,b[z+G+1]=o.y,b[z+G+2]=o.z,b[z+G+3]=0),_===!0&&(o.fromBufferAttribute(U,k),b[z+G+4]=o.x,b[z+G+5]=o.y,b[z+G+6]=o.z,b[z+G+7]=0),y===!0&&(o.fromBufferAttribute(B,k),b[z+G+8]=o.x,b[z+G+9]=o.y,b[z+G+10]=o.z,b[z+G+11]=B.itemSize===4?o.w:1)}}m={count:g,texture:E,size:new xr(T,C)},a.set(c,m),c.addEventListener("dispose",R)}if(u.isInstancedMesh===!0&&u.morphTexture!==null)h.getUniforms().setValue(r,"morphTexture",u.morphTexture,t);else{let v=0;for(let y=0;y<f.length;y++)v+=f[y];let _=c.morphTargetsRelative?1:1-v;h.getUniforms().setValue(r,"morphTargetBaseInfluence",_),h.getUniforms().setValue(r,"morphTargetInfluences",f)}h.getUniforms().setValue(r,"morphTargetsTexture",m.texture,t),h.getUniforms().setValue(r,"morphTargetsTextureSize",m.size)}else{let d=f===void 0?0:f.length,g=i[c.id];if(g===void 0||g.length!==d){g=[];for(let x=0;x<d;x++)g[x]=[x,0];i[c.id]=g}for(let x=0;x<d;x++){let M=g[x];M[0]=x,M[1]=f[x]}g.sort($2e);for(let x=0;x<8;x++)x<d&&g[x][1]?(s[x][0]=g[x][0],s[x][1]=g[x][1]):(s[x][0]=Number.MAX_SAFE_INTEGER,s[x][1]=0);s.sort(J2e);let m=c.morphAttributes.position,v=c.morphAttributes.normal,_=0;for(let x=0;x<8;x++){let M=s[x],S=M[0],w=M[1];S!==Number.MAX_SAFE_INTEGER&&w?(m&&c.getAttribute("morphTarget"+x)!==m[S]&&c.setAttribute("morphTarget"+x,m[S]),v&&c.getAttribute("morphNormal"+x)!==v[S]&&c.setAttribute("morphNormal"+x,v[S]),n[x]=w,_+=w):(m&&c.hasAttribute("morphTarget"+x)===!0&&c.deleteAttribute("morphTarget"+x),v&&c.hasAttribute("morphNormal"+x)===!0&&c.deleteAttribute("morphNormal"+x),n[x]=0)}let y=c.morphTargetsRelative?1:1-_;h.getUniforms().setValue(r,"morphTargetBaseInfluence",y),h.getUniforms().setValue(r,"morphTargetInfluences",n)}}return{update:l}}function eDe(r,e,t,i){let n=new WeakMap;function a(l){let u=i.render.frame,c=l.geometry,h=e.get(l,c);if(n.get(h)!==u&&(e.update(h),n.set(h,u)),l.isInstancedMesh&&(l.hasEventListener("dispose",s)===!1&&l.addEventListener("dispose",s),n.get(l)!==u&&(t.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,r.ARRAY_BUFFER),n.set(l,u))),l.isSkinnedMesh){let f=l.skeleton;n.get(f)!==u&&(f.update(),n.set(f,u))}return h}function o(){n=new WeakMap}function s(l){let u=l.target;u.removeEventListener("dispose",s),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:a,dispose:o}}var yR=class extends _s{constructor(e,t,i,n,a,o,s,l,u,c){if(c=c!==void 0?c:Jd,c!==Jd&&c!==s0)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&c===Jd&&(i=Nf),i===void 0&&c===s0&&(i=Kd),super(null,n,a,o,s,l,c,i,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=s!==void 0?s:On,this.minFilter=l!==void 0?l:On,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Yae=new _s,qae=new yR(1,1);qae.compareFunction=Vae;var Zae=new cR,jae=new hB,Kae=new mR,rae=[],iae=[],nae=new Float32Array(16),aae=new Float32Array(9),oae=new Float32Array(4);function v0(r,e,t){let i=r[0];if(i<=0||i>0)return r;let n=e*t,a=rae[n];if(a===void 0&&(a=new Float32Array(n),rae[n]=a),e!==0){i.toArray(a,0);for(let o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function ln(r,e){if(r.length!==e.length)return!1;for(let t=0,i=r.length;t<i;t++)if(r[t]!==e[t])return!1;return!0}function un(r,e){for(let t=0,i=e.length;t<i;t++)r[t]=e[t]}function zR(r,e){let t=iae[e];t===void 0&&(t=new Int32Array(e),iae[e]=t);for(let i=0;i!==e;++i)t[i]=r.allocateTextureUnit();return t}function tDe(r,e){let t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function rDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ln(t,e))return;r.uniform2fv(this.addr,e),un(t,e)}}function iDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(ln(t,e))return;r.uniform3fv(this.addr,e),un(t,e)}}function nDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ln(t,e))return;r.uniform4fv(this.addr,e),un(t,e)}}function aDe(r,e){let t=this.cache,i=e.elements;if(i===void 0){if(ln(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),un(t,e)}else{if(ln(t,i))return;oae.set(i),r.uniformMatrix2fv(this.addr,!1,oae),un(t,i)}}function oDe(r,e){let t=this.cache,i=e.elements;if(i===void 0){if(ln(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),un(t,e)}else{if(ln(t,i))return;aae.set(i),r.uniformMatrix3fv(this.addr,!1,aae),un(t,i)}}function sDe(r,e){let t=this.cache,i=e.elements;if(i===void 0){if(ln(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),un(t,e)}else{if(ln(t,i))return;nae.set(i),r.uniformMatrix4fv(this.addr,!1,nae),un(t,i)}}function lDe(r,e){let t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function uDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ln(t,e))return;r.uniform2iv(this.addr,e),un(t,e)}}function cDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(ln(t,e))return;r.uniform3iv(this.addr,e),un(t,e)}}function hDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ln(t,e))return;r.uniform4iv(this.addr,e),un(t,e)}}function fDe(r,e){let t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function pDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(ln(t,e))return;r.uniform2uiv(this.addr,e),un(t,e)}}function dDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(ln(t,e))return;r.uniform3uiv(this.addr,e),un(t,e)}}function mDe(r,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(ln(t,e))return;r.uniform4uiv(this.addr,e),un(t,e)}}function vDe(r,e,t){let i=this.cache,n=t.allocateTextureUnit();i[0]!==n&&(r.uniform1i(this.addr,n),i[0]=n);let a=this.type===r.SAMPLER_2D_SHADOW?qae:Yae;t.setTexture2D(e||a,n)}function gDe(r,e,t){let i=this.cache,n=t.allocateTextureUnit();i[0]!==n&&(r.uniform1i(this.addr,n),i[0]=n),t.setTexture3D(e||jae,n)}function yDe(r,e,t){let i=this.cache,n=t.allocateTextureUnit();i[0]!==n&&(r.uniform1i(this.addr,n),i[0]=n),t.setTextureCube(e||Kae,n)}function _De(r,e,t){let i=this.cache,n=t.allocateTextureUnit();i[0]!==n&&(r.uniform1i(this.addr,n),i[0]=n),t.setTexture2DArray(e||Zae,n)}function xDe(r){switch(r){case 5126:return tDe;case 35664:return rDe;case 35665:return iDe;case 35666:return nDe;case 35674:return aDe;case 35675:return oDe;case 35676:return sDe;case 5124:case 35670:return lDe;case 35667:case 35671:return uDe;case 35668:case 35672:return cDe;case 35669:case 35673:return hDe;case 5125:return fDe;case 36294:return pDe;case 36295:return dDe;case 36296:return mDe;case 35678:case 36198:case 36298:case 36306:case 35682:return vDe;case 35679:case 36299:case 36307:return gDe;case 35680:case 36300:case 36308:case 36293:return yDe;case 36289:case 36303:case 36311:case 36292:return _De}}function SDe(r,e){r.uniform1fv(this.addr,e)}function MDe(r,e){let t=v0(e,this.size,2);r.uniform2fv(this.addr,t)}function bDe(r,e){let t=v0(e,this.size,3);r.uniform3fv(this.addr,t)}function wDe(r,e){let t=v0(e,this.size,4);r.uniform4fv(this.addr,t)}function TDe(r,e){let t=v0(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function EDe(r,e){let t=v0(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function ADe(r,e){let t=v0(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function CDe(r,e){r.uniform1iv(this.addr,e)}function RDe(r,e){r.uniform2iv(this.addr,e)}function LDe(r,e){r.uniform3iv(this.addr,e)}function DDe(r,e){r.uniform4iv(this.addr,e)}function PDe(r,e){r.uniform1uiv(this.addr,e)}function IDe(r,e){r.uniform2uiv(this.addr,e)}function NDe(r,e){r.uniform3uiv(this.addr,e)}function UDe(r,e){r.uniform4uiv(this.addr,e)}function ODe(r,e,t){let i=this.cache,n=e.length,a=zR(t,n);ln(i,a)||(r.uniform1iv(this.addr,a),un(i,a));for(let o=0;o!==n;++o)t.setTexture2D(e[o]||Yae,a[o])}function zDe(r,e,t){let i=this.cache,n=e.length,a=zR(t,n);ln(i,a)||(r.uniform1iv(this.addr,a),un(i,a));for(let o=0;o!==n;++o)t.setTexture3D(e[o]||jae,a[o])}function FDe(r,e,t){let i=this.cache,n=e.length,a=zR(t,n);ln(i,a)||(r.uniform1iv(this.addr,a),un(i,a));for(let o=0;o!==n;++o)t.setTextureCube(e[o]||Kae,a[o])}function BDe(r,e,t){let i=this.cache,n=e.length,a=zR(t,n);ln(i,a)||(r.uniform1iv(this.addr,a),un(i,a));for(let o=0;o!==n;++o)t.setTexture2DArray(e[o]||Zae,a[o])}function kDe(r){switch(r){case 5126:return SDe;case 35664:return MDe;case 35665:return bDe;case 35666:return wDe;case 35674:return TDe;case 35675:return EDe;case 35676:return ADe;case 5124:case 35670:return CDe;case 35667:case 35671:return RDe;case 35668:case 35672:return LDe;case 35669:case 35673:return DDe;case 5125:return PDe;case 36294:return IDe;case 36295:return NDe;case 36296:return UDe;case 35678:case 36198:case 36298:case 36306:case 35682:return ODe;case 35679:case 36299:case 36307:return zDe;case 35680:case 36300:case 36308:case 36293:return FDe;case 36289:case 36303:case 36311:case 36292:return BDe}}var dB=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=xDe(t.type)}},mB=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=kDe(t.type)}},vB=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){let n=this.seq;for(let a=0,o=n.length;a!==o;++a){let s=n[a];s.setValue(e,t[s.id],i)}}},$F=/(\w+)(\])?(\[|\.)?/g;function sae(r,e){r.seq.push(e),r.map[e.id]=e}function VDe(r,e,t){let i=r.name,n=i.length;for($F.lastIndex=0;;){let a=$F.exec(i),o=$F.lastIndex,s=a[1],l=a[2]==="]",u=a[3];if(l&&(s=s|0),u===void 0||u==="["&&o+2===n){sae(t,u===void 0?new dB(s,r,e):new mB(s,r,e));break}else{let h=t.map[s];h===void 0&&(h=new vB(s),sae(t,h)),t=h}}}var i0=class{constructor(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<i;++n){let a=e.getActiveUniform(t,n),o=e.getUniformLocation(t,a.name);VDe(a,o,this)}}setValue(e,t,i,n){let a=this.map[t];a!==void 0&&a.setValue(e,i,n)}setOptional(e,t,i){let n=t[i];n!==void 0&&this.setValue(e,i,n)}static upload(e,t,i,n){for(let a=0,o=t.length;a!==o;++a){let s=t[a],l=i[s.id];l.needsUpdate!==!1&&s.setValue(e,l.value,n)}}static seqWithValue(e,t){let i=[];for(let n=0,a=e.length;n!==a;++n){let o=e[n];o.id in t&&i.push(o)}return i}};function lae(r,e,t){let i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i}var GDe=37297,HDe=0;function WDe(r,e){let t=r.split(`
  10163. `),i=[],n=Math.max(e-6,0),a=Math.min(e+6,t.length);for(let o=n;o<a;o++){let s=o+1;i.push(`${s===e?">":" "} ${s}: ${t[o]}`)}return i.join(`
  10164. `)}function XDe(r){let e=ti.getPrimaries(ti.workingColorSpace),t=ti.getPrimaries(r),i;switch(e===t?i="":e===aR&&t===nR?i="LinearDisplayP3ToLinearSRGB":e===nR&&t===aR&&(i="LinearSRGBToLinearDisplayP3"),r){case Yf:case OR:return[i,"LinearTransferOETF"];case Pa:case WB:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[i,"LinearTransferOETF"]}}function uae(r,e,t){let i=r.getShaderParameter(e,r.COMPILE_STATUS),n=r.getShaderInfoLog(e).trim();if(i&&n==="")return"";let a=/ERROR: 0:(\d+)/.exec(n);if(a){let o=parseInt(a[1]);return t.toUpperCase()+`
  10165. `+n+`
  10166. `+WDe(r.getShaderSource(e),o)}else return n}function YDe(r,e){let t=XDe(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function qDe(r,e){let t;switch(e){case qAe:t="Linear";break;case ZAe:t="Reinhard";break;case jAe:t="OptimizedCineon";break;case KAe:t="ACESFilmic";break;case $Ae:t="AgX";break;case QAe:t="Neutral";break;case JAe:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function ZDe(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.normalMapTangentSpace||r.clearcoatNormalMap||r.flatShading||r.alphaToCoverage||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Qy).join(`
  10167. `)}function jDe(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Qy).join(`
  10168. `)}function KDe(r){let e=[];for(let t in r){let i=r[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(`
  10169. `)}function JDe(r,e){let t={},i=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let n=0;n<i;n++){let a=r.getActiveAttrib(e,n),o=a.name,s=1;a.type===r.FLOAT_MAT2&&(s=2),a.type===r.FLOAT_MAT3&&(s=3),a.type===r.FLOAT_MAT4&&(s=4),t[o]={type:a.type,location:r.getAttribLocation(e,o),locationSize:s}}return t}function Qy(r){return r!==""}function cae(r,e){let t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function hae(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var $De=/^[ \t]*#include +<([\w\d./]+)>/gm;function gB(r){return r.replace($De,ePe)}var QDe=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function ePe(r,e){let t=yr[e];if(t===void 0){let i=QDe.get(e);if(i!==void 0)t=yr[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return gB(t)}var tPe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function fae(r){return r.replace(tPe,rPe)}function rPe(r,e,t,i){let n="";for(let a=parseInt(e);a<parseInt(t);a++)n+=i.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return n}function pae(r){let e=`precision ${r.precision} float;
  10170. precision ${r.precision} int;
  10171. precision ${r.precision} sampler2D;
  10172. precision ${r.precision} samplerCube;
  10173. `;return r.isWebGL2&&(e+=`precision ${r.precision} sampler3D;
  10174. precision ${r.precision} sampler2DArray;
  10175. precision ${r.precision} sampler2DShadow;
  10176. precision ${r.precision} samplerCubeShadow;
  10177. precision ${r.precision} sampler2DArrayShadow;
  10178. precision ${r.precision} isampler2D;
  10179. precision ${r.precision} isampler3D;
  10180. precision ${r.precision} isamplerCube;
  10181. precision ${r.precision} isampler2DArray;
  10182. precision ${r.precision} usampler2D;
  10183. precision ${r.precision} usampler3D;
  10184. precision ${r.precision} usamplerCube;
  10185. precision ${r.precision} usampler2DArray;
  10186. `),r.precision==="highp"?e+=`
  10187. #define HIGH_PRECISION`:r.precision==="mediump"?e+=`
  10188. #define MEDIUM_PRECISION`:r.precision==="lowp"&&(e+=`
  10189. #define LOW_PRECISION`),e}function iPe(r){let e="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===Iae?e="SHADOWMAP_TYPE_PCF":r.shadowMapType===SAe?e="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===Xc&&(e="SHADOWMAP_TYPE_VSM"),e}function nPe(r){let e="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case n0:case a0:e="ENVMAP_TYPE_CUBE";break;case UR:e="ENVMAP_TYPE_CUBE_UV";break}return e}function aPe(r){let e="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case a0:e="ENVMAP_MODE_REFRACTION";break}return e}function oPe(r){let e="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case NR:e="ENVMAP_BLENDING_MULTIPLY";break;case XAe:e="ENVMAP_BLENDING_MIX";break;case YAe:e="ENVMAP_BLENDING_ADD";break}return e}function sPe(r){let e=r.envMapCubeUVHeight;if(e===null)return null;let t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}}function lPe(r,e,t,i){let n=r.getContext(),a=t.defines,o=t.vertexShader,s=t.fragmentShader,l=iPe(t),u=nPe(t),c=aPe(t),h=oPe(t),f=sPe(t),p=t.isWebGL2?"":ZDe(t),d=jDe(t),g=KDe(a),m=n.createProgram(),v,_,y=t.glslVersion?"#version "+t.glslVersion+`
  10190. `:"";t.isRawShaderMaterial?(v=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Qy).join(`
  10191. `),v.length>0&&(v+=`
  10192. `),_=[p,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g].filter(Qy).join(`
  10193. `),_.length>0&&(_+=`
  10194. `)):(v=[pae(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
  10195. `].filter(Qy).join(`
  10196. `),_=[p,pae(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,g,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Of?"#define TONE_MAPPING":"",t.toneMapping!==Of?yr.tonemapping_pars_fragment:"",t.toneMapping!==Of?qDe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",yr.colorspace_pars_fragment,YDe("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
  10197. `].filter(Qy).join(`
  10198. `)),o=gB(o),o=cae(o,t),o=hae(o,t),s=gB(s),s=cae(s,t),s=hae(s,t),o=fae(o),s=fae(s),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es
  10199. `,v=[d,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
  10200. `)+`
  10201. `+v,_=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===Lne?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Lne?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
  10202. `)+`
  10203. `+_);let x=y+v+o,M=y+_+s,S=lae(n,n.VERTEX_SHADER,x),w=lae(n,n.FRAGMENT_SHADER,M);n.attachShader(m,S),n.attachShader(m,w),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);function T(I){if(r.debug.checkShaderErrors){let R=n.getProgramInfoLog(m).trim(),A=n.getShaderInfoLog(S).trim(),P=n.getShaderInfoLog(w).trim(),U=!0,B=!0;if(n.getProgramParameter(m,n.LINK_STATUS)===!1)if(U=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(n,m,S,w);else{let z=uae(n,S,"vertex"),k=uae(n,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(m,n.VALIDATE_STATUS)+`
  10204. Material Name: `+I.name+`
  10205. Material Type: `+I.type+`
  10206. Program Info Log: `+R+`
  10207. `+z+`
  10208. `+k)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(A===""||P==="")&&(B=!1);B&&(I.diagnostics={runnable:U,programLog:R,vertexShader:{log:A,prefix:v},fragmentShader:{log:P,prefix:_}})}n.deleteShader(S),n.deleteShader(w),C=new i0(n,m),b=JDe(n,m)}let C;this.getUniforms=function(){return C===void 0&&T(this),C};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let E=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=n.getProgramParameter(m,GDe)),E},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(m),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=HDe++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=S,this.fragmentShader=w,this}var uPe=0,yB=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),a=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(n)===!1&&(o.add(n),n.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new _B(e),t.set(e,i)),i}},_B=class{constructor(e){this.id=uPe++,this.code=e,this.usedTimes=0}};function cPe(r,e,t,i,n,a,o){let s=new hR,l=new yB,u=new Set,c=[],h=n.isWebGL2,f=n.logarithmicDepthBuffer,p=n.vertexTextures,d=n.precision,g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(b){return u.add(b),b===0?"uv":`uv${b}`}function v(b,E,I,R,A){let P=R.fog,U=A.geometry,B=b.isMeshStandardMaterial?R.environment:null,z=(b.isMeshStandardMaterial?t:e).get(b.envMap||B),k=z&&z.mapping===UR?z.image.height:null,G=g[b.type];b.precision!==null&&(d=n.getMaxPrecision(b.precision),d!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",d,"instead."));let Y=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,J=Y!==void 0?Y.length:0,Q=0;U.morphAttributes.position!==void 0&&(Q=1),U.morphAttributes.normal!==void 0&&(Q=2),U.morphAttributes.color!==void 0&&(Q=3);let V,K,ae,ve;if(G){let kt=Hu[G];V=kt.vertexShader,K=kt.fragmentShader}else V=b.vertexShader,K=b.fragmentShader,l.update(b),ae=l.getVertexShaderID(b),ve=l.getFragmentShaderID(b);let ue=r.getRenderTarget(),se=A.isInstancedMesh===!0,Ee=A.isBatchedMesh===!0,q=!!b.map,H=!!b.matcap,We=!!z,_e=!!b.aoMap,xe=!!b.lightMap,Le=!!b.bumpMap,Ue=!!b.normalMap,Ne=!!b.displacementMap,Ve=!!b.emissiveMap,dt=!!b.metalnessMap,F=!!b.roughnessMap,L=b.anisotropy>0,ne=b.clearcoat>0,le=b.iridescence>0,me=b.sheen>0,fe=b.transmission>0,et=L&&!!b.anisotropyMap,Ke=ne&&!!b.clearcoatMap,Se=ne&&!!b.clearcoatNormalMap,Ae=ne&&!!b.clearcoatRoughnessMap,at=le&&!!b.iridescenceMap,$=le&&!!b.iridescenceThicknessMap,nt=me&&!!b.sheenColorMap,Xe=me&&!!b.sheenRoughnessMap,Fe=!!b.specularMap,we=!!b.specularColorMap,Ie=!!b.specularIntensityMap,ct=fe&&!!b.transmissionMap,Je=fe&&!!b.thicknessMap,Gt=!!b.gradientMap,X=!!b.alphaMap,Te=b.alphaTest>0,te=!!b.alphaHash,Me=!!b.extensions,De=Of;b.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(De=r.toneMapping);let wt={isWebGL2:h,shaderID:G,shaderType:b.type,shaderName:b.name,vertexShader:V,fragmentShader:K,defines:b.defines,customVertexShaderID:ae,customFragmentShaderID:ve,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:d,batching:Ee,instancing:se,instancingColor:se&&A.instanceColor!==null,instancingMorph:se&&A.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:ue===null?r.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Yf,alphaToCoverage:!!b.alphaToCoverage,map:q,matcap:H,envMap:We,envMapMode:We&&z.mapping,envMapCubeUVHeight:k,aoMap:_e,lightMap:xe,bumpMap:Le,normalMap:Ue,displacementMap:p&&Ne,emissiveMap:Ve,normalMapObjectSpace:Ue&&b.normalMapType===fCe,normalMapTangentSpace:Ue&&b.normalMapType===HB,metalnessMap:dt,roughnessMap:F,anisotropy:L,anisotropyMap:et,clearcoat:ne,clearcoatMap:Ke,clearcoatNormalMap:Se,clearcoatRoughnessMap:Ae,iridescence:le,iridescenceMap:at,iridescenceThicknessMap:$,sheen:me,sheenColorMap:nt,sheenRoughnessMap:Xe,specularMap:Fe,specularColorMap:we,specularIntensityMap:Ie,transmission:fe,transmissionMap:ct,thicknessMap:Je,gradientMap:Gt,opaque:b.transparent===!1&&b.blending===t0&&b.alphaToCoverage===!1,alphaMap:X,alphaTest:Te,alphaHash:te,combine:b.combine,mapUv:q&&m(b.map.channel),aoMapUv:_e&&m(b.aoMap.channel),lightMapUv:xe&&m(b.lightMap.channel),bumpMapUv:Le&&m(b.bumpMap.channel),normalMapUv:Ue&&m(b.normalMap.channel),displacementMapUv:Ne&&m(b.displacementMap.channel),emissiveMapUv:Ve&&m(b.emissiveMap.channel),metalnessMapUv:dt&&m(b.metalnessMap.channel),roughnessMapUv:F&&m(b.roughnessMap.channel),anisotropyMapUv:et&&m(b.anisotropyMap.channel),clearcoatMapUv:Ke&&m(b.clearcoatMap.channel),clearcoatNormalMapUv:Se&&m(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&m(b.clearcoatRoughnessMap.channel),iridescenceMapUv:at&&m(b.iridescenceMap.channel),iridescenceThicknessMapUv:$&&m(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&m(b.sheenColorMap.channel),sheenRoughnessMapUv:Xe&&m(b.sheenRoughnessMap.channel),specularMapUv:Fe&&m(b.specularMap.channel),specularColorMapUv:we&&m(b.specularColorMap.channel),specularIntensityMapUv:Ie&&m(b.specularIntensityMap.channel),transmissionMapUv:ct&&m(b.transmissionMap.channel),thicknessMapUv:Je&&m(b.thicknessMap.channel),alphaMapUv:X&&m(b.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(Ue||L),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:A.isPoints===!0&&!!U.attributes.uv&&(q||X),fog:!!P,useFog:b.fog===!0,fogExp2:!!P&&P.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:A.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:J,morphTextureStride:Q,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numLightProbes:E.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:De,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&b.map.isVideoTexture===!0&&ti.getTransfer(b.map.colorSpace)===ui,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===qc,flipSided:b.side===Xo,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionDerivatives:Me&&b.extensions.derivatives===!0,extensionFragDepth:Me&&b.extensions.fragDepth===!0,extensionDrawBuffers:Me&&b.extensions.drawBuffers===!0,extensionShaderTextureLOD:Me&&b.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Me&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Me&&b.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return wt.vertexUv1s=u.has(1),wt.vertexUv2s=u.has(2),wt.vertexUv3s=u.has(3),u.clear(),wt}function _(b){let E=[];if(b.shaderID?E.push(b.shaderID):(E.push(b.customVertexShaderID),E.push(b.customFragmentShaderID)),b.defines!==void 0)for(let I in b.defines)E.push(I),E.push(b.defines[I]);return b.isRawShaderMaterial===!1&&(y(E,b),x(E,b),E.push(r.outputColorSpace)),E.push(b.customProgramCacheKey),E.join()}function y(b,E){b.push(E.precision),b.push(E.outputColorSpace),b.push(E.envMapMode),b.push(E.envMapCubeUVHeight),b.push(E.mapUv),b.push(E.alphaMapUv),b.push(E.lightMapUv),b.push(E.aoMapUv),b.push(E.bumpMapUv),b.push(E.normalMapUv),b.push(E.displacementMapUv),b.push(E.emissiveMapUv),b.push(E.metalnessMapUv),b.push(E.roughnessMapUv),b.push(E.anisotropyMapUv),b.push(E.clearcoatMapUv),b.push(E.clearcoatNormalMapUv),b.push(E.clearcoatRoughnessMapUv),b.push(E.iridescenceMapUv),b.push(E.iridescenceThicknessMapUv),b.push(E.sheenColorMapUv),b.push(E.sheenRoughnessMapUv),b.push(E.specularMapUv),b.push(E.specularColorMapUv),b.push(E.specularIntensityMapUv),b.push(E.transmissionMapUv),b.push(E.thicknessMapUv),b.push(E.combine),b.push(E.fogExp2),b.push(E.sizeAttenuation),b.push(E.morphTargetsCount),b.push(E.morphAttributeCount),b.push(E.numDirLights),b.push(E.numPointLights),b.push(E.numSpotLights),b.push(E.numSpotLightMaps),b.push(E.numHemiLights),b.push(E.numRectAreaLights),b.push(E.numDirLightShadows),b.push(E.numPointLightShadows),b.push(E.numSpotLightShadows),b.push(E.numSpotLightShadowsWithMaps),b.push(E.numLightProbes),b.push(E.shadowMapType),b.push(E.toneMapping),b.push(E.numClippingPlanes),b.push(E.numClipIntersection),b.push(E.depthPacking)}function x(b,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.instancingMorph&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.normalMapObjectSpace&&s.enable(7),E.normalMapTangentSpace&&s.enable(8),E.clearcoat&&s.enable(9),E.iridescence&&s.enable(10),E.alphaTest&&s.enable(11),E.vertexColors&&s.enable(12),E.vertexAlphas&&s.enable(13),E.vertexUv1s&&s.enable(14),E.vertexUv2s&&s.enable(15),E.vertexUv3s&&s.enable(16),E.vertexTangents&&s.enable(17),E.anisotropy&&s.enable(18),E.alphaHash&&s.enable(19),E.batching&&s.enable(20),b.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.useLegacyLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.transmission&&s.enable(15),E.sheen&&s.enable(16),E.opaque&&s.enable(17),E.pointsUvs&&s.enable(18),E.decodeVideoTexture&&s.enable(19),E.alphaToCoverage&&s.enable(20),b.push(s.mask)}function M(b){let E=g[b.type],I;if(E){let R=Hu[E];I=JCe.clone(R.uniforms)}else I=b.uniforms;return I}function S(b,E){let I;for(let R=0,A=c.length;R<A;R++){let P=c[R];if(P.cacheKey===E){I=P,++I.usedTimes;break}}return I===void 0&&(I=new lPe(r,E,b,a),c.push(I)),I}function w(b){if(--b.usedTimes===0){let E=c.indexOf(b);c[E]=c[c.length-1],c.pop(),b.destroy()}}function T(b){l.remove(b)}function C(){l.dispose()}return{getParameters:v,getProgramCacheKey:_,getUniforms:M,acquireProgram:S,releaseProgram:w,releaseShaderCache:T,programs:c,dispose:C}}function hPe(){let r=new WeakMap;function e(a){let o=r.get(a);return o===void 0&&(o={},r.set(a,o)),o}function t(a){r.delete(a)}function i(a,o,s){r.get(a)[o]=s}function n(){r=new WeakMap}return{get:e,remove:t,update:i,dispose:n}}function fPe(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function dae(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function mae(){let r=[],e=0,t=[],i=[],n=[];function a(){e=0,t.length=0,i.length=0,n.length=0}function o(h,f,p,d,g,m){let v=r[e];return v===void 0?(v={id:h.id,object:h,geometry:f,material:p,groupOrder:d,renderOrder:h.renderOrder,z:g,group:m},r[e]=v):(v.id=h.id,v.object=h,v.geometry=f,v.material=p,v.groupOrder=d,v.renderOrder=h.renderOrder,v.z=g,v.group=m),e++,v}function s(h,f,p,d,g,m){let v=o(h,f,p,d,g,m);p.transmission>0?i.push(v):p.transparent===!0?n.push(v):t.push(v)}function l(h,f,p,d,g,m){let v=o(h,f,p,d,g,m);p.transmission>0?i.unshift(v):p.transparent===!0?n.unshift(v):t.unshift(v)}function u(h,f){t.length>1&&t.sort(h||fPe),i.length>1&&i.sort(f||dae),n.length>1&&n.sort(f||dae)}function c(){for(let h=e,f=r.length;h<f;h++){let p=r[h];if(p.id===null)break;p.id=null,p.object=null,p.geometry=null,p.material=null,p.group=null}}return{opaque:t,transmissive:i,transparent:n,init:a,push:s,unshift:l,finish:c,sort:u}}function pPe(){let r=new WeakMap;function e(i,n){let a=r.get(i),o;return a===void 0?(o=new mae,r.set(i,[o])):n>=a.length?(o=new mae,a.push(o)):o=a[n],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function dPe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ye,color:new nr};break;case"SpotLight":t={position:new ye,direction:new ye,color:new nr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ye,color:new nr,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ye,skyColor:new nr,groundColor:new nr};break;case"RectAreaLight":t={color:new nr,position:new ye,halfWidth:new ye,halfHeight:new ye};break}return r[e.id]=t,t}}}function mPe(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xr};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xr};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xr,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var vPe=0;function gPe(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function yPe(r,e){let t=new dPe,i=mPe(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new ye);let a=new ye,o=new Xt,s=new Xt;function l(c,h){let f=0,p=0,d=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let g=0,m=0,v=0,_=0,y=0,x=0,M=0,S=0,w=0,T=0,C=0;c.sort(gPe);let b=h===!0?Math.PI:1;for(let I=0,R=c.length;I<R;I++){let A=c[I],P=A.color,U=A.intensity,B=A.distance,z=A.shadow&&A.shadow.map?A.shadow.map.texture:null;if(A.isAmbientLight)f+=P.r*U*b,p+=P.g*U*b,d+=P.b*U*b;else if(A.isLightProbe){for(let k=0;k<9;k++)n.probe[k].addScaledVector(A.sh.coefficients[k],U);C++}else if(A.isDirectionalLight){let k=t.get(A);if(k.color.copy(A.color).multiplyScalar(A.intensity*b),A.castShadow){let G=A.shadow,Y=i.get(A);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,n.directionalShadow[g]=Y,n.directionalShadowMap[g]=z,n.directionalShadowMatrix[g]=A.shadow.matrix,x++}n.directional[g]=k,g++}else if(A.isSpotLight){let k=t.get(A);k.position.setFromMatrixPosition(A.matrixWorld),k.color.copy(P).multiplyScalar(U*b),k.distance=B,k.coneCos=Math.cos(A.angle),k.penumbraCos=Math.cos(A.angle*(1-A.penumbra)),k.decay=A.decay,n.spot[v]=k;let G=A.shadow;if(A.map&&(n.spotLightMap[w]=A.map,w++,G.updateMatrices(A),A.castShadow&&T++),n.spotLightMatrix[v]=G.matrix,A.castShadow){let Y=i.get(A);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,n.spotShadow[v]=Y,n.spotShadowMap[v]=z,S++}v++}else if(A.isRectAreaLight){let k=t.get(A);k.color.copy(P).multiplyScalar(U),k.halfWidth.set(A.width*.5,0,0),k.halfHeight.set(0,A.height*.5,0),n.rectArea[_]=k,_++}else if(A.isPointLight){let k=t.get(A);if(k.color.copy(A.color).multiplyScalar(A.intensity*b),k.distance=A.distance,k.decay=A.decay,A.castShadow){let G=A.shadow,Y=i.get(A);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,Y.shadowCameraNear=G.camera.near,Y.shadowCameraFar=G.camera.far,n.pointShadow[m]=Y,n.pointShadowMap[m]=z,n.pointShadowMatrix[m]=A.shadow.matrix,M++}n.point[m]=k,m++}else if(A.isHemisphereLight){let k=t.get(A);k.skyColor.copy(A.color).multiplyScalar(U*b),k.groundColor.copy(A.groundColor).multiplyScalar(U*b),n.hemi[y]=k,y++}}_>0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=St.LTC_FLOAT_1,n.rectAreaLTC2=St.LTC_FLOAT_2):(n.rectAreaLTC1=St.LTC_HALF_1,n.rectAreaLTC2=St.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=St.LTC_FLOAT_1,n.rectAreaLTC2=St.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(n.rectAreaLTC1=St.LTC_HALF_1,n.rectAreaLTC2=St.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=f,n.ambient[1]=p,n.ambient[2]=d;let E=n.hash;(E.directionalLength!==g||E.pointLength!==m||E.spotLength!==v||E.rectAreaLength!==_||E.hemiLength!==y||E.numDirectionalShadows!==x||E.numPointShadows!==M||E.numSpotShadows!==S||E.numSpotMaps!==w||E.numLightProbes!==C)&&(n.directional.length=g,n.spot.length=v,n.rectArea.length=_,n.point.length=m,n.hemi.length=y,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=M,n.pointShadowMap.length=M,n.spotShadow.length=S,n.spotShadowMap.length=S,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=M,n.spotLightMatrix.length=S+w-T,n.spotLightMap.length=w,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=C,E.directionalLength=g,E.pointLength=m,E.spotLength=v,E.rectAreaLength=_,E.hemiLength=y,E.numDirectionalShadows=x,E.numPointShadows=M,E.numSpotShadows=S,E.numSpotMaps=w,E.numLightProbes=C,n.version=vPe++)}function u(c,h){let f=0,p=0,d=0,g=0,m=0,v=h.matrixWorldInverse;for(let _=0,y=c.length;_<y;_++){let x=c[_];if(x.isDirectionalLight){let M=n.directional[f];M.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),M.direction.sub(a),M.direction.transformDirection(v),f++}else if(x.isSpotLight){let M=n.spot[d];M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(v),M.direction.setFromMatrixPosition(x.matrixWorld),a.setFromMatrixPosition(x.target.matrixWorld),M.direction.sub(a),M.direction.transformDirection(v),d++}else if(x.isRectAreaLight){let M=n.rectArea[g];M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(v),s.identity(),o.copy(x.matrixWorld),o.premultiply(v),s.extractRotation(o),M.halfWidth.set(x.width*.5,0,0),M.halfHeight.set(0,x.height*.5,0),M.halfWidth.applyMatrix4(s),M.halfHeight.applyMatrix4(s),g++}else if(x.isPointLight){let M=n.point[p];M.position.setFromMatrixPosition(x.matrixWorld),M.position.applyMatrix4(v),p++}else if(x.isHemisphereLight){let M=n.hemi[m];M.direction.setFromMatrixPosition(x.matrixWorld),M.direction.transformDirection(v),m++}}}return{setup:l,setupView:u,state:n}}function vae(r,e){let t=new yPe(r,e),i=[],n=[];function a(){i.length=0,n.length=0}function o(h){i.push(h)}function s(h){n.push(h)}function l(h){t.setup(i,h)}function u(h){t.setupView(i,h)}return{init:a,state:{lightsArray:i,shadowsArray:n,lights:t},setupLights:l,setupLightsView:u,pushLight:o,pushShadow:s}}function _Pe(r,e){let t=new WeakMap;function i(a,o=0){let s=t.get(a),l;return s===void 0?(l=new vae(r,e),t.set(a,[l])):o>=s.length?(l=new vae(r,e),s.push(l)):l=s[o],l}function n(){t=new WeakMap}return{get:i,dispose:n}}var xB=class extends Jc{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=cCe,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},SB=class extends Jc{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},xPe=`void main() {
  10209. gl_Position = vec4( position, 1.0 );
  10210. }`,SPe=`uniform sampler2D shadow_pass;
  10211. uniform vec2 resolution;
  10212. uniform float radius;
  10213. #include <packing>
  10214. void main() {
  10215. const float samples = float( VSM_SAMPLES );
  10216. float mean = 0.0;
  10217. float squared_mean = 0.0;
  10218. float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
  10219. float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
  10220. for ( float i = 0.0; i < samples; i ++ ) {
  10221. float uvOffset = uvStart + i * uvStride;
  10222. #ifdef HORIZONTAL_PASS
  10223. vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
  10224. mean += distribution.x;
  10225. squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
  10226. #else
  10227. float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
  10228. mean += depth;
  10229. squared_mean += depth * depth;
  10230. #endif
  10231. }
  10232. mean = mean / samples;
  10233. squared_mean = squared_mean / samples;
  10234. float std_dev = sqrt( squared_mean - mean * mean );
  10235. gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
  10236. }`;function MPe(r,e,t){let i=new SM,n=new xr,a=new xr,o=new Ur,s=new xB({depthPacking:hCe}),l=new SB,u={},c=t.maxTextureSize,h={[Ff]:Xo,[Xo]:Ff,[qc]:qc},f=new Xu({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xr},radius:{value:4}},vertexShader:xPe,fragmentShader:SPe}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let d=new ul;d.setAttribute("position",new ll(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new Wo(d,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Iae;let v=this.type;this.render=function(S,w,T){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;let C=r.getRenderTarget(),b=r.getActiveCubeFace(),E=r.getActiveMipmapLevel(),I=r.state;I.setBlending(Uf),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);let R=v!==Xc&&this.type===Xc,A=v===Xc&&this.type!==Xc;for(let P=0,U=S.length;P<U;P++){let B=S[P],z=B.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",B,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;n.copy(z.mapSize);let k=z.getFrameExtents();if(n.multiply(k),a.copy(z.mapSize),(n.x>c||n.y>c)&&(n.x>c&&(a.x=Math.floor(c/k.x),n.x=a.x*k.x,z.mapSize.x=a.x),n.y>c&&(a.y=Math.floor(c/k.y),n.y=a.y*k.y,z.mapSize.y=a.y)),z.map===null||R===!0||A===!0){let Y=this.type!==Xc?{minFilter:On,magFilter:On}:{};z.map!==null&&z.map.dispose(),z.map=new Kc(n.x,n.y,Y),z.map.texture.name=B.name+".shadowMap",z.camera.updateProjectionMatrix()}r.setRenderTarget(z.map),r.clear();let G=z.getViewportCount();for(let Y=0;Y<G;Y++){let J=z.getViewport(Y);o.set(a.x*J.x,a.y*J.y,a.x*J.z,a.y*J.w),I.viewport(o),z.updateMatrices(B,Y),i=z.getFrustum(),x(w,T,z.camera,B,this.type)}z.isPointLightShadow!==!0&&this.type===Xc&&_(z,T),z.needsUpdate=!1}v=this.type,m.needsUpdate=!1,r.setRenderTarget(C,b,E)};function _(S,w){let T=e.update(g);f.defines.VSM_SAMPLES!==S.blurSamples&&(f.defines.VSM_SAMPLES=S.blurSamples,p.defines.VSM_SAMPLES=S.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new Kc(n.x,n.y)),f.uniforms.shadow_pass.value=S.map.texture,f.uniforms.resolution.value=S.mapSize,f.uniforms.radius.value=S.radius,r.setRenderTarget(S.mapPass),r.clear(),r.renderBufferDirect(w,null,T,f,g,null),p.uniforms.shadow_pass.value=S.mapPass.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,r.setRenderTarget(S.map),r.clear(),r.renderBufferDirect(w,null,T,p,g,null)}function y(S,w,T,C){let b=null,E=T.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(E!==void 0)b=E;else if(b=T.isPointLight===!0?l:s,r.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){let I=b.uuid,R=w.uuid,A=u[I];A===void 0&&(A={},u[I]=A);let P=A[R];P===void 0&&(P=b.clone(),A[R]=P,w.addEventListener("dispose",M)),b=P}if(b.visible=w.visible,b.wireframe=w.wireframe,C===Xc?b.side=w.shadowSide!==null?w.shadowSide:w.side:b.side=w.shadowSide!==null?w.shadowSide:h[w.side],b.alphaMap=w.alphaMap,b.alphaTest=w.alphaTest,b.map=w.map,b.clipShadows=w.clipShadows,b.clippingPlanes=w.clippingPlanes,b.clipIntersection=w.clipIntersection,b.displacementMap=w.displacementMap,b.displacementScale=w.displacementScale,b.displacementBias=w.displacementBias,b.wireframeLinewidth=w.wireframeLinewidth,b.linewidth=w.linewidth,T.isPointLight===!0&&b.isMeshDistanceMaterial===!0){let I=r.properties.get(b);I.light=T}return b}function x(S,w,T,C,b){if(S.visible===!1)return;if(S.layers.test(w.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&b===Xc)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,S.matrixWorld);let R=e.update(S),A=S.material;if(Array.isArray(A)){let P=R.groups;for(let U=0,B=P.length;U<B;U++){let z=P[U],k=A[z.materialIndex];if(k&&k.visible){let G=y(S,k,C,b);S.onBeforeShadow(r,S,w,T,R,G,z),r.renderBufferDirect(T,null,R,G,S,z),S.onAfterShadow(r,S,w,T,R,G,z)}}}else if(A.visible){let P=y(S,A,C,b);S.onBeforeShadow(r,S,w,T,R,P,null),r.renderBufferDirect(T,null,R,P,S,null),S.onAfterShadow(r,S,w,T,R,P,null)}}let I=S.children;for(let R=0,A=I.length;R<A;R++)x(I[R],w,T,C,b)}function M(S){S.target.removeEventListener("dispose",M);for(let T in u){let C=u[T],b=S.target.uuid;b in C&&(C[b].dispose(),delete C[b])}}}function bPe(r,e,t){let i=t.isWebGL2;function n(){let X=!1,Te=new Ur,te=null,Me=new Ur(0,0,0,0);return{setMask:function(De){te!==De&&!X&&(r.colorMask(De,De,De,De),te=De)},setLocked:function(De){X=De},setClear:function(De,wt,kt,Tr,$r){$r===!0&&(De*=Tr,wt*=Tr,kt*=Tr),Te.set(De,wt,kt,Tr),Me.equals(Te)===!1&&(r.clearColor(De,wt,kt,Tr),Me.copy(Te))},reset:function(){X=!1,te=null,Me.set(-1,0,0,0)}}}function a(){let X=!1,Te=null,te=null,Me=null;return{setTest:function(De){De?se(r.DEPTH_TEST):Ee(r.DEPTH_TEST)},setMask:function(De){Te!==De&&!X&&(r.depthMask(De),Te=De)},setFunc:function(De){if(te!==De){switch(De){case FAe:r.depthFunc(r.NEVER);break;case BAe:r.depthFunc(r.ALWAYS);break;case kAe:r.depthFunc(r.LESS);break;case eR:r.depthFunc(r.LEQUAL);break;case VAe:r.depthFunc(r.EQUAL);break;case GAe:r.depthFunc(r.GEQUAL);break;case HAe:r.depthFunc(r.GREATER);break;case WAe:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}te=De}},setLocked:function(De){X=De},setClear:function(De){Me!==De&&(r.clearDepth(De),Me=De)},reset:function(){X=!1,Te=null,te=null,Me=null}}}function o(){let X=!1,Te=null,te=null,Me=null,De=null,wt=null,kt=null,Tr=null,$r=null;return{setTest:function(Ht){X||(Ht?se(r.STENCIL_TEST):Ee(r.STENCIL_TEST))},setMask:function(Ht){Te!==Ht&&!X&&(r.stencilMask(Ht),Te=Ht)},setFunc:function(Ht,Or,hi){(te!==Ht||Me!==Or||De!==hi)&&(r.stencilFunc(Ht,Or,hi),te=Ht,Me=Or,De=hi)},setOp:function(Ht,Or,hi){(wt!==Ht||kt!==Or||Tr!==hi)&&(r.stencilOp(Ht,Or,hi),wt=Ht,kt=Or,Tr=hi)},setLocked:function(Ht){X=Ht},setClear:function(Ht){$r!==Ht&&(r.clearStencil(Ht),$r=Ht)},reset:function(){X=!1,Te=null,te=null,Me=null,De=null,wt=null,kt=null,Tr=null,$r=null}}}let s=new n,l=new a,u=new o,c=new WeakMap,h=new WeakMap,f={},p={},d=new WeakMap,g=[],m=null,v=!1,_=null,y=null,x=null,M=null,S=null,w=null,T=null,C=new nr(0,0,0),b=0,E=!1,I=null,R=null,A=null,P=null,U=null,B=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),z=!1,k=0,G=r.getParameter(r.VERSION);G.indexOf("WebGL")!==-1?(k=parseFloat(/^WebGL (\d)/.exec(G)[1]),z=k>=1):G.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),z=k>=2);let Y=null,J={},Q=r.getParameter(r.SCISSOR_BOX),V=r.getParameter(r.VIEWPORT),K=new Ur().fromArray(Q),ae=new Ur().fromArray(V);function ve(X,Te,te,Me){let De=new Uint8Array(4),wt=r.createTexture();r.bindTexture(X,wt),r.texParameteri(X,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(X,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let kt=0;kt<te;kt++)i&&(X===r.TEXTURE_3D||X===r.TEXTURE_2D_ARRAY)?r.texImage3D(Te,0,r.RGBA,1,1,Me,0,r.RGBA,r.UNSIGNED_BYTE,De):r.texImage2D(Te+kt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,De);return wt}let ue={};ue[r.TEXTURE_2D]=ve(r.TEXTURE_2D,r.TEXTURE_2D,1),ue[r.TEXTURE_CUBE_MAP]=ve(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),i&&(ue[r.TEXTURE_2D_ARRAY]=ve(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ue[r.TEXTURE_3D]=ve(r.TEXTURE_3D,r.TEXTURE_3D,1,1)),s.setClear(0,0,0,1),l.setClear(1),u.setClear(0),se(r.DEPTH_TEST),l.setFunc(eR),Ne(!1),Ve(Xie),se(r.CULL_FACE),Le(Uf);function se(X){f[X]!==!0&&(r.enable(X),f[X]=!0)}function Ee(X){f[X]!==!1&&(r.disable(X),f[X]=!1)}function q(X,Te){return p[X]!==Te?(r.bindFramebuffer(X,Te),p[X]=Te,i&&(X===r.DRAW_FRAMEBUFFER&&(p[r.FRAMEBUFFER]=Te),X===r.FRAMEBUFFER&&(p[r.DRAW_FRAMEBUFFER]=Te)),!0):!1}function H(X,Te){let te=g,Me=!1;if(X){te=d.get(Te),te===void 0&&(te=[],d.set(Te,te));let De=X.textures;if(te.length!==De.length||te[0]!==r.COLOR_ATTACHMENT0){for(let wt=0,kt=De.length;wt<kt;wt++)te[wt]=r.COLOR_ATTACHMENT0+wt;te.length=De.length,Me=!0}}else te[0]!==r.BACK&&(te[0]=r.BACK,Me=!0);if(Me)if(t.isWebGL2)r.drawBuffers(te);else if(e.has("WEBGL_draw_buffers")===!0)e.get("WEBGL_draw_buffers").drawBuffersWEBGL(te);else throw new Error("THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension")}function We(X){return m!==X?(r.useProgram(X),m=X,!0):!1}let _e={[qd]:r.FUNC_ADD,[bAe]:r.FUNC_SUBTRACT,[wAe]:r.FUNC_REVERSE_SUBTRACT};if(i)_e[jie]=r.MIN,_e[Kie]=r.MAX;else{let X=e.get("EXT_blend_minmax");X!==null&&(_e[jie]=X.MIN_EXT,_e[Kie]=X.MAX_EXT)}let xe={[TAe]:r.ZERO,[EAe]:r.ONE,[AAe]:r.SRC_COLOR,[nB]:r.SRC_ALPHA,[IAe]:r.SRC_ALPHA_SATURATE,[DAe]:r.DST_COLOR,[RAe]:r.DST_ALPHA,[CAe]:r.ONE_MINUS_SRC_COLOR,[aB]:r.ONE_MINUS_SRC_ALPHA,[PAe]:r.ONE_MINUS_DST_COLOR,[LAe]:r.ONE_MINUS_DST_ALPHA,[NAe]:r.CONSTANT_COLOR,[UAe]:r.ONE_MINUS_CONSTANT_COLOR,[OAe]:r.CONSTANT_ALPHA,[zAe]:r.ONE_MINUS_CONSTANT_ALPHA};function Le(X,Te,te,Me,De,wt,kt,Tr,$r,Ht){if(X===Uf){v===!0&&(Ee(r.BLEND),v=!1);return}if(v===!1&&(se(r.BLEND),v=!0),X!==MAe){if(X!==_||Ht!==E){if((y!==qd||S!==qd)&&(r.blendEquation(r.FUNC_ADD),y=qd,S=qd),Ht)switch(X){case t0:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Yie:r.blendFunc(r.ONE,r.ONE);break;case qie:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Zie:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",X);break}else switch(X){case t0:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Yie:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case qie:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Zie:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",X);break}x=null,M=null,w=null,T=null,C.set(0,0,0),b=0,_=X,E=Ht}return}De=De||Te,wt=wt||te,kt=kt||Me,(Te!==y||De!==S)&&(r.blendEquationSeparate(_e[Te],_e[De]),y=Te,S=De),(te!==x||Me!==M||wt!==w||kt!==T)&&(r.blendFuncSeparate(xe[te],xe[Me],xe[wt],xe[kt]),x=te,M=Me,w=wt,T=kt),(Tr.equals(C)===!1||$r!==b)&&(r.blendColor(Tr.r,Tr.g,Tr.b,$r),C.copy(Tr),b=$r),_=X,E=!1}function Ue(X,Te){X.side===qc?Ee(r.CULL_FACE):se(r.CULL_FACE);let te=X.side===Xo;Te&&(te=!te),Ne(te),X.blending===t0&&X.transparent===!1?Le(Uf):Le(X.blending,X.blendEquation,X.blendSrc,X.blendDst,X.blendEquationAlpha,X.blendSrcAlpha,X.blendDstAlpha,X.blendColor,X.blendAlpha,X.premultipliedAlpha),l.setFunc(X.depthFunc),l.setTest(X.depthTest),l.setMask(X.depthWrite),s.setMask(X.colorWrite);let Me=X.stencilWrite;u.setTest(Me),Me&&(u.setMask(X.stencilWriteMask),u.setFunc(X.stencilFunc,X.stencilRef,X.stencilFuncMask),u.setOp(X.stencilFail,X.stencilZFail,X.stencilZPass)),F(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),X.alphaToCoverage===!0?se(r.SAMPLE_ALPHA_TO_COVERAGE):Ee(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ne(X){I!==X&&(X?r.frontFace(r.CW):r.frontFace(r.CCW),I=X)}function Ve(X){X!==_Ae?(se(r.CULL_FACE),X!==R&&(X===Xie?r.cullFace(r.BACK):X===xAe?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Ee(r.CULL_FACE),R=X}function dt(X){X!==A&&(z&&r.lineWidth(X),A=X)}function F(X,Te,te){X?(se(r.POLYGON_OFFSET_FILL),(P!==Te||U!==te)&&(r.polygonOffset(Te,te),P=Te,U=te)):Ee(r.POLYGON_OFFSET_FILL)}function L(X){X?se(r.SCISSOR_TEST):Ee(r.SCISSOR_TEST)}function ne(X){X===void 0&&(X=r.TEXTURE0+B-1),Y!==X&&(r.activeTexture(X),Y=X)}function le(X,Te,te){te===void 0&&(Y===null?te=r.TEXTURE0+B-1:te=Y);let Me=J[te];Me===void 0&&(Me={type:void 0,texture:void 0},J[te]=Me),(Me.type!==X||Me.texture!==Te)&&(Y!==te&&(r.activeTexture(te),Y=te),r.bindTexture(X,Te||ue[X]),Me.type=X,Me.texture=Te)}function me(){let X=J[Y];X!==void 0&&X.type!==void 0&&(r.bindTexture(X.type,null),X.type=void 0,X.texture=void 0)}function fe(){try{r.compressedTexImage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function et(){try{r.compressedTexImage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Ke(){try{r.texSubImage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Se(){try{r.texSubImage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Ae(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function at(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function $(){try{r.texStorage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function nt(){try{r.texStorage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Xe(){try{r.texImage2D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function Fe(){try{r.texImage3D.apply(r,arguments)}catch(X){console.error("THREE.WebGLState:",X)}}function we(X){K.equals(X)===!1&&(r.scissor(X.x,X.y,X.z,X.w),K.copy(X))}function Ie(X){ae.equals(X)===!1&&(r.viewport(X.x,X.y,X.z,X.w),ae.copy(X))}function ct(X,Te){let te=h.get(Te);te===void 0&&(te=new WeakMap,h.set(Te,te));let Me=te.get(X);Me===void 0&&(Me=r.getUniformBlockIndex(Te,X.name),te.set(X,Me))}function Je(X,Te){let Me=h.get(Te).get(X);c.get(Te)!==Me&&(r.uniformBlockBinding(Te,Me,X.__bindingPointIndex),c.set(Te,Me))}function Gt(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),i===!0&&(r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null)),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),f={},Y=null,J={},p={},d=new WeakMap,g=[],m=null,v=!1,_=null,y=null,x=null,M=null,S=null,w=null,T=null,C=new nr(0,0,0),b=0,E=!1,I=null,R=null,A=null,P=null,U=null,K.set(0,0,r.canvas.width,r.canvas.height),ae.set(0,0,r.canvas.width,r.canvas.height),s.reset(),l.reset(),u.reset()}return{buffers:{color:s,depth:l,stencil:u},enable:se,disable:Ee,bindFramebuffer:q,drawBuffers:H,useProgram:We,setBlending:Le,setMaterial:Ue,setFlipSided:Ne,setCullFace:Ve,setLineWidth:dt,setPolygonOffset:F,setScissorTest:L,activeTexture:ne,bindTexture:le,unbindTexture:me,compressedTexImage2D:fe,compressedTexImage3D:et,texImage2D:Xe,texImage3D:Fe,updateUBOMapping:ct,uniformBlockBinding:Je,texStorage2D:$,texStorage3D:nt,texSubImage2D:Ke,texSubImage3D:Se,compressedTexSubImage2D:Ae,compressedTexSubImage3D:at,scissor:we,viewport:Ie,reset:Gt}}function wPe(r,e,t,i,n,a,o){let s=n.isWebGL2,l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xr,h=new WeakMap,f,p=new WeakMap,d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(F,L){return d?new OffscreenCanvas(F,L):yM("canvas")}function m(F,L,ne,le){let me=1,fe=dt(F);if((fe.width>le||fe.height>le)&&(me=le/Math.max(fe.width,fe.height)),me<1||L===!0)if(typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&F instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&F instanceof ImageBitmap||typeof VideoFrame<"u"&&F instanceof VideoFrame){let et=L?sR:Math.floor,Ke=et(me*fe.width),Se=et(me*fe.height);f===void 0&&(f=g(Ke,Se));let Ae=ne?g(Ke,Se):f;return Ae.width=Ke,Ae.height=Se,Ae.getContext("2d").drawImage(F,0,0,Ke,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+fe.width+"x"+fe.height+") to ("+Ke+"x"+Se+")."),Ae}else return"data"in F&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+fe.width+"x"+fe.height+")."),F;return F}function v(F){let L=dt(F);return uB(L.width)&&uB(L.height)}function _(F){return s?!1:F.wrapS!==Ho||F.wrapT!==Ho||F.minFilter!==On&&F.minFilter!==Go}function y(F,L){return F.generateMipmaps&&L&&F.minFilter!==On&&F.minFilter!==Go}function x(F){r.generateMipmap(F)}function M(F,L,ne,le,me=!1){if(s===!1)return L;if(F!==null){if(r[F]!==void 0)return r[F];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+F+"'")}let fe=L;if(L===r.RED&&(ne===r.FLOAT&&(fe=r.R32F),ne===r.HALF_FLOAT&&(fe=r.R16F),ne===r.UNSIGNED_BYTE&&(fe=r.R8)),L===r.RED_INTEGER&&(ne===r.UNSIGNED_BYTE&&(fe=r.R8UI),ne===r.UNSIGNED_SHORT&&(fe=r.R16UI),ne===r.UNSIGNED_INT&&(fe=r.R32UI),ne===r.BYTE&&(fe=r.R8I),ne===r.SHORT&&(fe=r.R16I),ne===r.INT&&(fe=r.R32I)),L===r.RG&&(ne===r.FLOAT&&(fe=r.RG32F),ne===r.HALF_FLOAT&&(fe=r.RG16F),ne===r.UNSIGNED_BYTE&&(fe=r.RG8)),L===r.RG_INTEGER&&(ne===r.UNSIGNED_BYTE&&(fe=r.RG8UI),ne===r.UNSIGNED_SHORT&&(fe=r.RG16UI),ne===r.UNSIGNED_INT&&(fe=r.RG32UI),ne===r.BYTE&&(fe=r.RG8I),ne===r.SHORT&&(fe=r.RG16I),ne===r.INT&&(fe=r.RG32I)),L===r.RGBA){let et=me?iR:ti.getTransfer(le);ne===r.FLOAT&&(fe=r.RGBA32F),ne===r.HALF_FLOAT&&(fe=r.RGBA16F),ne===r.UNSIGNED_BYTE&&(fe=et===ui?r.SRGB8_ALPHA8:r.RGBA8),ne===r.UNSIGNED_SHORT_4_4_4_4&&(fe=r.RGBA4),ne===r.UNSIGNED_SHORT_5_5_5_1&&(fe=r.RGB5_A1)}return(fe===r.R16F||fe===r.R32F||fe===r.RG16F||fe===r.RG32F||fe===r.RGBA16F||fe===r.RGBA32F)&&e.get("EXT_color_buffer_float"),fe}function S(F,L,ne){return y(F,ne)===!0||F.isFramebufferTexture&&F.minFilter!==On&&F.minFilter!==Go?Math.log2(Math.max(L.width,L.height))+1:F.mipmaps!==void 0&&F.mipmaps.length>0?F.mipmaps.length:F.isCompressedTexture&&Array.isArray(F.image)?L.mipmaps.length:1}function w(F){return F===On||F===Qie||F===sM?r.NEAREST:r.LINEAR}function T(F){let L=F.target;L.removeEventListener("dispose",T),b(L),L.isVideoTexture&&h.delete(L)}function C(F){let L=F.target;L.removeEventListener("dispose",C),I(L)}function b(F){let L=i.get(F);if(L.__webglInit===void 0)return;let ne=F.source,le=p.get(ne);if(le){let me=le[L.__cacheKey];me.usedTimes--,me.usedTimes===0&&E(F),Object.keys(le).length===0&&p.delete(ne)}i.remove(F)}function E(F){let L=i.get(F);r.deleteTexture(L.__webglTexture);let ne=F.source,le=p.get(ne);delete le[L.__cacheKey],o.memory.textures--}function I(F){let L=i.get(F);if(F.depthTexture&&F.depthTexture.dispose(),F.isWebGLCubeRenderTarget)for(let le=0;le<6;le++){if(Array.isArray(L.__webglFramebuffer[le]))for(let me=0;me<L.__webglFramebuffer[le].length;me++)r.deleteFramebuffer(L.__webglFramebuffer[le][me]);else r.deleteFramebuffer(L.__webglFramebuffer[le]);L.__webglDepthbuffer&&r.deleteRenderbuffer(L.__webglDepthbuffer[le])}else{if(Array.isArray(L.__webglFramebuffer))for(let le=0;le<L.__webglFramebuffer.length;le++)r.deleteFramebuffer(L.__webglFramebuffer[le]);else r.deleteFramebuffer(L.__webglFramebuffer);if(L.__webglDepthbuffer&&r.deleteRenderbuffer(L.__webglDepthbuffer),L.__webglMultisampledFramebuffer&&r.deleteFramebuffer(L.__webglMultisampledFramebuffer),L.__webglColorRenderbuffer)for(let le=0;le<L.__webglColorRenderbuffer.length;le++)L.__webglColorRenderbuffer[le]&&r.deleteRenderbuffer(L.__webglColorRenderbuffer[le]);L.__webglDepthRenderbuffer&&r.deleteRenderbuffer(L.__webglDepthRenderbuffer)}let ne=F.textures;for(let le=0,me=ne.length;le<me;le++){let fe=i.get(ne[le]);fe.__webglTexture&&(r.deleteTexture(fe.__webglTexture),o.memory.textures--),i.remove(ne[le])}i.remove(F)}let R=0;function A(){R=0}function P(){let F=R;return F>=n.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+F+" texture units while this GPU supports only "+n.maxTextures),R+=1,F}function U(F){let L=[];return L.push(F.wrapS),L.push(F.wrapT),L.push(F.wrapR||0),L.push(F.magFilter),L.push(F.minFilter),L.push(F.anisotropy),L.push(F.internalFormat),L.push(F.format),L.push(F.type),L.push(F.generateMipmaps),L.push(F.premultiplyAlpha),L.push(F.flipY),L.push(F.unpackAlignment),L.push(F.colorSpace),L.join()}function B(F,L){let ne=i.get(F);if(F.isVideoTexture&&Ne(F),F.isRenderTargetTexture===!1&&F.version>0&&ne.__version!==F.version){let le=F.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(ne,F,L);return}}t.bindTexture(r.TEXTURE_2D,ne.__webglTexture,r.TEXTURE0+L)}function z(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ae(ne,F,L);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ne.__webglTexture,r.TEXTURE0+L)}function k(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ae(ne,F,L);return}t.bindTexture(r.TEXTURE_3D,ne.__webglTexture,r.TEXTURE0+L)}function G(F,L){let ne=i.get(F);if(F.version>0&&ne.__version!==F.version){ve(ne,F,L);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ne.__webglTexture,r.TEXTURE0+L)}let Y={[o0]:r.REPEAT,[Ho]:r.CLAMP_TO_EDGE,[sB]:r.MIRRORED_REPEAT},J={[On]:r.NEAREST,[Qie]:r.NEAREST_MIPMAP_NEAREST,[sM]:r.NEAREST_MIPMAP_LINEAR,[Go]:r.LINEAR,[MF]:r.LINEAR_MIPMAP_NEAREST,[jd]:r.LINEAR_MIPMAP_LINEAR},Q={[pCe]:r.NEVER,[_Ce]:r.ALWAYS,[dCe]:r.LESS,[Vae]:r.LEQUAL,[mCe]:r.EQUAL,[yCe]:r.GEQUAL,[vCe]:r.GREATER,[gCe]:r.NOTEQUAL};function V(F,L,ne){if(L.type===Wu&&e.has("OES_texture_float_linear")===!1&&(L.magFilter===Go||L.magFilter===MF||L.magFilter===sM||L.magFilter===jd||L.minFilter===Go||L.minFilter===MF||L.minFilter===sM||L.minFilter===jd)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ne?(r.texParameteri(F,r.TEXTURE_WRAP_S,Y[L.wrapS]),r.texParameteri(F,r.TEXTURE_WRAP_T,Y[L.wrapT]),(F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY)&&r.texParameteri(F,r.TEXTURE_WRAP_R,Y[L.wrapR]),r.texParameteri(F,r.TEXTURE_MAG_FILTER,J[L.magFilter]),r.texParameteri(F,r.TEXTURE_MIN_FILTER,J[L.minFilter])):(r.texParameteri(F,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(F,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY)&&r.texParameteri(F,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(L.wrapS!==Ho||L.wrapT!==Ho)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(F,r.TEXTURE_MAG_FILTER,w(L.magFilter)),r.texParameteri(F,r.TEXTURE_MIN_FILTER,w(L.minFilter)),L.minFilter!==On&&L.minFilter!==Go&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),L.compareFunction&&(r.texParameteri(F,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(F,r.TEXTURE_COMPARE_FUNC,Q[L.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(L.magFilter===On||L.minFilter!==sM&&L.minFilter!==jd||L.type===Wu&&e.has("OES_texture_float_linear")===!1||s===!1&&L.type===gM&&e.has("OES_texture_half_float_linear")===!1)return;if(L.anisotropy>1||i.get(L).__currentAnisotropy){let le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(F,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(L.anisotropy,n.getMaxAnisotropy())),i.get(L).__currentAnisotropy=L.anisotropy}}}function K(F,L){let ne=!1;F.__webglInit===void 0&&(F.__webglInit=!0,L.addEventListener("dispose",T));let le=L.source,me=p.get(le);me===void 0&&(me={},p.set(le,me));let fe=U(L);if(fe!==F.__cacheKey){me[fe]===void 0&&(me[fe]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ne=!0),me[fe].usedTimes++;let et=me[F.__cacheKey];et!==void 0&&(me[F.__cacheKey].usedTimes--,et.usedTimes===0&&E(L)),F.__cacheKey=fe,F.__webglTexture=me[fe].texture}return ne}function ae(F,L,ne){let le=r.TEXTURE_2D;(L.isDataArrayTexture||L.isCompressedArrayTexture)&&(le=r.TEXTURE_2D_ARRAY),L.isData3DTexture&&(le=r.TEXTURE_3D);let me=K(F,L),fe=L.source;t.bindTexture(le,F.__webglTexture,r.TEXTURE0+ne);let et=i.get(fe);if(fe.version!==et.__version||me===!0){t.activeTexture(r.TEXTURE0+ne);let Ke=ti.getPrimaries(ti.workingColorSpace),Se=L.colorSpace===If?null:ti.getPrimaries(L.colorSpace),Ae=L.colorSpace===If||Ke===Se?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,L.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,L.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ae);let at=_(L)&&v(L.image)===!1,$=m(L.image,at,!1,n.maxTextureSize);$=Ve(L,$);let nt=v($)||s,Xe=a.convert(L.format,L.colorSpace),Fe=a.convert(L.type),we=M(L.internalFormat,Xe,Fe,L.colorSpace,L.isVideoTexture);V(le,L,nt);let Ie,ct=L.mipmaps,Je=s&&L.isVideoTexture!==!0&&we!==kae,Gt=et.__version===void 0||me===!0,X=fe.dataReady,Te=S(L,$,nt);if(L.isDepthTexture)we=r.DEPTH_COMPONENT,s?L.type===Wu?we=r.DEPTH_COMPONENT32F:L.type===Nf?we=r.DEPTH_COMPONENT24:L.type===Kd?we=r.DEPTH24_STENCIL8:we=r.DEPTH_COMPONENT16:L.type===Wu&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),L.format===Jd&&we===r.DEPTH_COMPONENT&&L.type!==GB&&L.type!==Nf&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),L.type=Nf,Fe=a.convert(L.type)),L.format===s0&&we===r.DEPTH_COMPONENT&&(we=r.DEPTH_STENCIL,L.type!==Kd&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),L.type=Kd,Fe=a.convert(L.type))),Gt&&(Je?t.texStorage2D(r.TEXTURE_2D,1,we,$.width,$.height):t.texImage2D(r.TEXTURE_2D,0,we,$.width,$.height,0,Xe,Fe,null));else if(L.isDataTexture)if(ct.length>0&&nt){Je&&Gt&&t.texStorage2D(r.TEXTURE_2D,Te,we,ct[0].width,ct[0].height);for(let te=0,Me=ct.length;te<Me;te++)Ie=ct[te],Je?X&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,Ie.width,Ie.height,Xe,Fe,Ie.data):t.texImage2D(r.TEXTURE_2D,te,we,Ie.width,Ie.height,0,Xe,Fe,Ie.data);L.generateMipmaps=!1}else Je?(Gt&&t.texStorage2D(r.TEXTURE_2D,Te,we,$.width,$.height),X&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,$.width,$.height,Xe,Fe,$.data)):t.texImage2D(r.TEXTURE_2D,0,we,$.width,$.height,0,Xe,Fe,$.data);else if(L.isCompressedTexture)if(L.isCompressedArrayTexture){Je&&Gt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Te,we,ct[0].width,ct[0].height,$.depth);for(let te=0,Me=ct.length;te<Me;te++)Ie=ct[te],L.format!==sl?Xe!==null?Je?X&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,0,Ie.width,Ie.height,$.depth,Xe,Ie.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,te,we,Ie.width,Ie.height,$.depth,0,Ie.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Je?X&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,te,0,0,0,Ie.width,Ie.height,$.depth,Xe,Fe,Ie.data):t.texImage3D(r.TEXTURE_2D_ARRAY,te,we,Ie.width,Ie.height,$.depth,0,Xe,Fe,Ie.data)}else{Je&&Gt&&t.texStorage2D(r.TEXTURE_2D,Te,we,ct[0].width,ct[0].height);for(let te=0,Me=ct.length;te<Me;te++)Ie=ct[te],L.format!==sl?Xe!==null?Je?X&&t.compressedTexSubImage2D(r.TEXTURE_2D,te,0,0,Ie.width,Ie.height,Xe,Ie.data):t.compressedTexImage2D(r.TEXTURE_2D,te,we,Ie.width,Ie.height,0,Ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Je?X&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,Ie.width,Ie.height,Xe,Fe,Ie.data):t.texImage2D(r.TEXTURE_2D,te,we,Ie.width,Ie.height,0,Xe,Fe,Ie.data)}else if(L.isDataArrayTexture)Je?(Gt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Te,we,$.width,$.height,$.depth),X&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,$.width,$.height,$.depth,Xe,Fe,$.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,we,$.width,$.height,$.depth,0,Xe,Fe,$.data);else if(L.isData3DTexture)Je?(Gt&&t.texStorage3D(r.TEXTURE_3D,Te,we,$.width,$.height,$.depth),X&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,$.width,$.height,$.depth,Xe,Fe,$.data)):t.texImage3D(r.TEXTURE_3D,0,we,$.width,$.height,$.depth,0,Xe,Fe,$.data);else if(L.isFramebufferTexture){if(Gt)if(Je)t.texStorage2D(r.TEXTURE_2D,Te,we,$.width,$.height);else{let te=$.width,Me=$.height;for(let De=0;De<Te;De++)t.texImage2D(r.TEXTURE_2D,De,we,te,Me,0,Xe,Fe,null),te>>=1,Me>>=1}}else if(ct.length>0&&nt){if(Je&&Gt){let te=dt(ct[0]);t.texStorage2D(r.TEXTURE_2D,Te,we,te.width,te.height)}for(let te=0,Me=ct.length;te<Me;te++)Ie=ct[te],Je?X&&t.texSubImage2D(r.TEXTURE_2D,te,0,0,Xe,Fe,Ie):t.texImage2D(r.TEXTURE_2D,te,we,Xe,Fe,Ie);L.generateMipmaps=!1}else if(Je){if(Gt){let te=dt($);t.texStorage2D(r.TEXTURE_2D,Te,we,te.width,te.height)}X&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Xe,Fe,$)}else t.texImage2D(r.TEXTURE_2D,0,we,Xe,Fe,$);y(L,nt)&&x(le),et.__version=fe.version,L.onUpdate&&L.onUpdate(L)}F.__version=L.version}function ve(F,L,ne){if(L.image.length!==6)return;let le=K(F,L),me=L.source;t.bindTexture(r.TEXTURE_CUBE_MAP,F.__webglTexture,r.TEXTURE0+ne);let fe=i.get(me);if(me.version!==fe.__version||le===!0){t.activeTexture(r.TEXTURE0+ne);let et=ti.getPrimaries(ti.workingColorSpace),Ke=L.colorSpace===If?null:ti.getPrimaries(L.colorSpace),Se=L.colorSpace===If||et===Ke?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,L.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,L.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,L.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Se);let Ae=L.isCompressedTexture||L.image[0].isCompressedTexture,at=L.image[0]&&L.image[0].isDataTexture,$=[];for(let te=0;te<6;te++)!Ae&&!at?$[te]=m(L.image[te],!1,!0,n.maxCubemapSize):$[te]=at?L.image[te].image:L.image[te],$[te]=Ve(L,$[te]);let nt=$[0],Xe=v(nt)||s,Fe=a.convert(L.format,L.colorSpace),we=a.convert(L.type),Ie=M(L.internalFormat,Fe,we,L.colorSpace),ct=s&&L.isVideoTexture!==!0,Je=fe.__version===void 0||le===!0,Gt=me.dataReady,X=S(L,nt,Xe);V(r.TEXTURE_CUBE_MAP,L,Xe);let Te;if(Ae){ct&&Je&&t.texStorage2D(r.TEXTURE_CUBE_MAP,X,Ie,nt.width,nt.height);for(let te=0;te<6;te++){Te=$[te].mipmaps;for(let Me=0;Me<Te.length;Me++){let De=Te[Me];L.format!==sl?Fe!==null?ct?Gt&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me,0,0,De.width,De.height,Fe,De.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me,Ie,De.width,De.height,0,De.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me,0,0,De.width,De.height,Fe,we,De.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me,Ie,De.width,De.height,0,Fe,we,De.data)}}}else{if(Te=L.mipmaps,ct&&Je){Te.length>0&&X++;let te=dt($[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,X,Ie,te.width,te.height)}for(let te=0;te<6;te++)if(at){ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,$[te].width,$[te].height,Fe,we,$[te].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,Ie,$[te].width,$[te].height,0,Fe,we,$[te].data);for(let Me=0;Me<Te.length;Me++){let wt=Te[Me].image[te].image;ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me+1,0,0,wt.width,wt.height,Fe,we,wt.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me+1,Ie,wt.width,wt.height,0,Fe,we,wt.data)}}else{ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,0,0,Fe,we,$[te]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,0,Ie,Fe,we,$[te]);for(let Me=0;Me<Te.length;Me++){let De=Te[Me];ct?Gt&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me+1,0,0,Fe,we,De.image[te]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+te,Me+1,Ie,Fe,we,De.image[te])}}}y(L,Xe)&&x(r.TEXTURE_CUBE_MAP),fe.__version=me.version,L.onUpdate&&L.onUpdate(L)}F.__version=L.version}function ue(F,L,ne,le,me,fe){let et=a.convert(ne.format,ne.colorSpace),Ke=a.convert(ne.type),Se=M(ne.internalFormat,et,Ke,ne.colorSpace);if(!i.get(L).__hasExternalTextures){let at=Math.max(1,L.width>>fe),$=Math.max(1,L.height>>fe);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,fe,Se,at,$,L.depth,0,et,Ke,null):t.texImage2D(me,fe,Se,at,$,0,et,Ke,null)}t.bindFramebuffer(r.FRAMEBUFFER,F),Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,0,Le(L)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,le,me,i.get(ne).__webglTexture,fe),t.bindFramebuffer(r.FRAMEBUFFER,null)}function se(F,L,ne){if(r.bindRenderbuffer(r.RENDERBUFFER,F),L.depthBuffer&&!L.stencilBuffer){let le=s===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(ne||Ue(L)){let me=L.depthTexture;me&&me.isDepthTexture&&(me.type===Wu?le=r.DEPTH_COMPONENT32F:me.type===Nf&&(le=r.DEPTH_COMPONENT24));let fe=Le(L);Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,fe,le,L.width,L.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,fe,le,L.width,L.height)}else r.renderbufferStorage(r.RENDERBUFFER,le,L.width,L.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,F)}else if(L.depthBuffer&&L.stencilBuffer){let le=Le(L);ne&&Ue(L)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,le,r.DEPTH24_STENCIL8,L.width,L.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,L.width,L.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,F)}else{let le=L.textures;for(let me=0;me<le.length;me++){let fe=le[me],et=a.convert(fe.format,fe.colorSpace),Ke=a.convert(fe.type),Se=M(fe.internalFormat,et,Ke,fe.colorSpace),Ae=Le(L);ne&&Ue(L)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,Se,L.width,L.height):Ue(L)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,Se,L.width,L.height):r.renderbufferStorage(r.RENDERBUFFER,Se,L.width,L.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ee(F,L){if(L&&L.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,F),!(L.depthTexture&&L.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(L.depthTexture).__webglTexture||L.depthTexture.image.width!==L.width||L.depthTexture.image.height!==L.height)&&(L.depthTexture.image.width=L.width,L.depthTexture.image.height=L.height,L.depthTexture.needsUpdate=!0),B(L.depthTexture,0);let le=i.get(L.depthTexture).__webglTexture,me=Le(L);if(L.depthTexture.format===Jd)Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0,me):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0);else if(L.depthTexture.format===s0)Ue(L)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0,me):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0);else throw new Error("Unknown depthTexture format")}function q(F){let L=i.get(F),ne=F.isWebGLCubeRenderTarget===!0;if(F.depthTexture&&!L.__autoAllocateDepthBuffer){if(ne)throw new Error("target.depthTexture not supported in Cube render targets");Ee(L.__webglFramebuffer,F)}else if(ne){L.__webglDepthbuffer=[];for(let le=0;le<6;le++)t.bindFramebuffer(r.FRAMEBUFFER,L.__webglFramebuffer[le]),L.__webglDepthbuffer[le]=r.createRenderbuffer(),se(L.__webglDepthbuffer[le],F,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,L.__webglFramebuffer),L.__webglDepthbuffer=r.createRenderbuffer(),se(L.__webglDepthbuffer,F,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function H(F,L,ne){let le=i.get(F);L!==void 0&&ue(le.__webglFramebuffer,F,F.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),ne!==void 0&&q(F)}function We(F){let L=F.texture,ne=i.get(F),le=i.get(L);F.addEventListener("dispose",C);let me=F.textures,fe=F.isWebGLCubeRenderTarget===!0,et=me.length>1,Ke=v(F)||s;if(et||(le.__webglTexture===void 0&&(le.__webglTexture=r.createTexture()),le.__version=L.version,o.memory.textures++),fe){ne.__webglFramebuffer=[];for(let Se=0;Se<6;Se++)if(s&&L.mipmaps&&L.mipmaps.length>0){ne.__webglFramebuffer[Se]=[];for(let Ae=0;Ae<L.mipmaps.length;Ae++)ne.__webglFramebuffer[Se][Ae]=r.createFramebuffer()}else ne.__webglFramebuffer[Se]=r.createFramebuffer()}else{if(s&&L.mipmaps&&L.mipmaps.length>0){ne.__webglFramebuffer=[];for(let Se=0;Se<L.mipmaps.length;Se++)ne.__webglFramebuffer[Se]=r.createFramebuffer()}else ne.__webglFramebuffer=r.createFramebuffer();if(et)if(n.drawBuffers)for(let Se=0,Ae=me.length;Se<Ae;Se++){let at=i.get(me[Se]);at.__webglTexture===void 0&&(at.__webglTexture=r.createTexture(),o.memory.textures++)}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(s&&F.samples>0&&Ue(F)===!1){ne.__webglMultisampledFramebuffer=r.createFramebuffer(),ne.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ne.__webglMultisampledFramebuffer);for(let Se=0;Se<me.length;Se++){let Ae=me[Se];ne.__webglColorRenderbuffer[Se]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,ne.__webglColorRenderbuffer[Se]);let at=a.convert(Ae.format,Ae.colorSpace),$=a.convert(Ae.type),nt=M(Ae.internalFormat,at,$,Ae.colorSpace,F.isXRRenderTarget===!0),Xe=Le(F);r.renderbufferStorageMultisample(r.RENDERBUFFER,Xe,nt,F.width,F.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Se,r.RENDERBUFFER,ne.__webglColorRenderbuffer[Se])}r.bindRenderbuffer(r.RENDERBUFFER,null),F.depthBuffer&&(ne.__webglDepthRenderbuffer=r.createRenderbuffer(),se(ne.__webglDepthRenderbuffer,F,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(fe){t.bindTexture(r.TEXTURE_CUBE_MAP,le.__webglTexture),V(r.TEXTURE_CUBE_MAP,L,Ke);for(let Se=0;Se<6;Se++)if(s&&L.mipmaps&&L.mipmaps.length>0)for(let Ae=0;Ae<L.mipmaps.length;Ae++)ue(ne.__webglFramebuffer[Se][Ae],F,L,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Ae);else ue(ne.__webglFramebuffer[Se],F,L,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0);y(L,Ke)&&x(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(et){for(let Se=0,Ae=me.length;Se<Ae;Se++){let at=me[Se],$=i.get(at);t.bindTexture(r.TEXTURE_2D,$.__webglTexture),V(r.TEXTURE_2D,at,Ke),ue(ne.__webglFramebuffer,F,at,r.COLOR_ATTACHMENT0+Se,r.TEXTURE_2D,0),y(at,Ke)&&x(r.TEXTURE_2D)}t.unbindTexture()}else{let Se=r.TEXTURE_2D;if((F.isWebGL3DRenderTarget||F.isWebGLArrayRenderTarget)&&(s?Se=F.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(Se,le.__webglTexture),V(Se,L,Ke),s&&L.mipmaps&&L.mipmaps.length>0)for(let Ae=0;Ae<L.mipmaps.length;Ae++)ue(ne.__webglFramebuffer[Ae],F,L,r.COLOR_ATTACHMENT0,Se,Ae);else ue(ne.__webglFramebuffer,F,L,r.COLOR_ATTACHMENT0,Se,0);y(L,Ke)&&x(Se),t.unbindTexture()}F.depthBuffer&&q(F)}function _e(F){let L=v(F)||s,ne=F.textures;for(let le=0,me=ne.length;le<me;le++){let fe=ne[le];if(y(fe,L)){let et=F.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,Ke=i.get(fe).__webglTexture;t.bindTexture(et,Ke),x(et),t.unbindTexture()}}}function xe(F){if(s&&F.samples>0&&Ue(F)===!1){let L=F.textures,ne=F.width,le=F.height,me=r.COLOR_BUFFER_BIT,fe=[],et=F.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ke=i.get(F),Se=L.length>1;if(Se)for(let Ae=0;Ae<L.length;Ae++)t.bindFramebuffer(r.FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ke.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ke.__webglFramebuffer);for(let Ae=0;Ae<L.length;Ae++){fe.push(r.COLOR_ATTACHMENT0+Ae),F.depthBuffer&&fe.push(et);let at=Ke.__ignoreDepthValues!==void 0?Ke.__ignoreDepthValues:!1;if(at===!1&&(F.depthBuffer&&(me|=r.DEPTH_BUFFER_BIT),F.stencilBuffer&&(me|=r.STENCIL_BUFFER_BIT)),Se&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ke.__webglColorRenderbuffer[Ae]),at===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[et]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[et])),Se){let $=i.get(L[Ae]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,$,0)}r.blitFramebuffer(0,0,ne,le,0,0,ne,le,me,r.NEAREST),u&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,fe)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Se)for(let Ae=0;Ae<L.length;Ae++){t.bindFramebuffer(r.FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,Ke.__webglColorRenderbuffer[Ae]);let at=i.get(L[Ae]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ke.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,at,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ke.__webglMultisampledFramebuffer)}}function Le(F){return Math.min(n.maxSamples,F.samples)}function Ue(F){let L=i.get(F);return s&&F.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&L.__useRenderToTexture!==!1}function Ne(F){let L=o.render.frame;h.get(F)!==L&&(h.set(F,L),F.update())}function Ve(F,L){let ne=F.colorSpace,le=F.format,me=F.type;return F.isCompressedTexture===!0||F.isVideoTexture===!0||F.format===lB||ne!==Yf&&ne!==If&&(ti.getTransfer(ne)===ui?s===!1?e.has("EXT_sRGB")===!0&&le===sl?(F.format=lB,F.minFilter=Go,F.generateMipmaps=!1):L=lR.sRGBToLinear(L):(le!==sl||me!==zf)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ne)),L}function dt(F){return typeof HTMLImageElement<"u"&&F instanceof HTMLImageElement?(c.width=F.naturalWidth||F.width,c.height=F.naturalHeight||F.height):typeof VideoFrame<"u"&&F instanceof VideoFrame?(c.width=F.displayWidth,c.height=F.displayHeight):(c.width=F.width,c.height=F.height),c}this.allocateTextureUnit=P,this.resetTextureUnits=A,this.setTexture2D=B,this.setTexture2DArray=z,this.setTexture3D=k,this.setTextureCube=G,this.rebindTextures=H,this.setupRenderTarget=We,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=Ue}function TPe(r,e,t){let i=t.isWebGL2;function n(a,o=If){let s,l=ti.getTransfer(o);if(a===zf)return r.UNSIGNED_BYTE;if(a===Uae)return r.UNSIGNED_SHORT_4_4_4_4;if(a===Oae)return r.UNSIGNED_SHORT_5_5_5_1;if(a===tCe)return r.BYTE;if(a===rCe)return r.SHORT;if(a===GB)return r.UNSIGNED_SHORT;if(a===Nae)return r.INT;if(a===Nf)return r.UNSIGNED_INT;if(a===Wu)return r.FLOAT;if(a===gM)return i?r.HALF_FLOAT:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(a===iCe)return r.ALPHA;if(a===sl)return r.RGBA;if(a===nCe)return r.LUMINANCE;if(a===aCe)return r.LUMINANCE_ALPHA;if(a===Jd)return r.DEPTH_COMPONENT;if(a===s0)return r.DEPTH_STENCIL;if(a===lB)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(a===oCe)return r.RED;if(a===zae)return r.RED_INTEGER;if(a===sCe)return r.RG;if(a===Fae)return r.RG_INTEGER;if(a===Bae)return r.RGBA_INTEGER;if(a===bF||a===wF||a===TF||a===EF)if(l===ui)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(a===bF)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(a===wF)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(a===TF)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(a===EF)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(a===bF)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===wF)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===TF)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===EF)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(a===ene||a===tne||a===rne||a===ine)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(a===ene)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===tne)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===rne)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===ine)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(a===kae)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(a===nne||a===ane)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(a===nne)return l===ui?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(a===ane)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(a===one||a===sne||a===lne||a===une||a===cne||a===hne||a===fne||a===pne||a===dne||a===mne||a===vne||a===gne||a===yne||a===_ne)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(a===one)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(a===sne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(a===lne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(a===une)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(a===cne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(a===hne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(a===fne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(a===pne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(a===dne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(a===mne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(a===vne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(a===gne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(a===yne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(a===_ne)return l===ui?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(a===AF||a===xne||a===Sne)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(a===AF)return l===ui?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(a===xne)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(a===Sne)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(a===lCe||a===Mne||a===bne||a===wne)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(a===AF)return s.COMPRESSED_RED_RGTC1_EXT;if(a===Mne)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(a===bne)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(a===wne)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return a===Kd?i?r.UNSIGNED_INT_24_8:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):r[a]!==void 0?r[a]:null}return{convert:n}}var MB=class extends Fn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},jc=class extends sa{constructor(){super(),this.isGroup=!0,this.type="Group"}},EPe={type:"move"},mM=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new jc,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new jc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ye,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ye),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new jc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ye,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ye),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let n=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(let g of e.hand.values()){let m=t.getJointPose(g,i),v=this._getHandJoint(u,g);m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=m.radius),v.visible=m!==null}let c=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],f=c.position.distanceTo(h.position),p=.02,d=.005;u.inputState.pinching&&f>p+d?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=p-d&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&a!==null&&(n=a),n!==null&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(EPe)))}return s!==null&&(s.visible=n!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new jc;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}},APe=`
  10237. void main() {
  10238. gl_Position = vec4( position, 1.0 );
  10239. }`,CPe=`
  10240. uniform sampler2DArray depthColor;
  10241. uniform float depthWidth;
  10242. uniform float depthHeight;
  10243. void main() {
  10244. vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
  10245. if ( coord.x >= 1.0 ) {
  10246. gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
  10247. } else {
  10248. gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
  10249. }
  10250. }`,bB=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){let n=new _s,a=e.properties.get(n);a.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}render(e,t){if(this.texture!==null){if(this.mesh===null){let i=t.cameras[0].viewport,n=new Xu({extensions:{fragDepth:!0},vertexShader:APe,fragmentShader:CPe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new Wo(new vR(20,20),n)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}},wB=class extends Bf{constructor(e,t){super();let i=this,n=null,a=1,o=null,s="local-floor",l=1,u=null,c=null,h=null,f=null,p=null,d=null,g=new bB,m=t.getContextAttributes(),v=null,_=null,y=[],x=[],M=new xr,S=null,w=new Fn;w.layers.enable(1),w.viewport=new Ur;let T=new Fn;T.layers.enable(2),T.viewport=new Ur;let C=[w,T],b=new MB;b.layers.enable(1),b.layers.enable(2);let E=null,I=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(V){let K=y[V];return K===void 0&&(K=new mM,y[V]=K),K.getTargetRaySpace()},this.getControllerGrip=function(V){let K=y[V];return K===void 0&&(K=new mM,y[V]=K),K.getGripSpace()},this.getHand=function(V){let K=y[V];return K===void 0&&(K=new mM,y[V]=K),K.getHandSpace()};function R(V){let K=x.indexOf(V.inputSource);if(K===-1)return;let ae=y[K];ae!==void 0&&(ae.update(V.inputSource,V.frame,u||o),ae.dispatchEvent({type:V.type,data:V.inputSource}))}function A(){n.removeEventListener("select",R),n.removeEventListener("selectstart",R),n.removeEventListener("selectend",R),n.removeEventListener("squeeze",R),n.removeEventListener("squeezestart",R),n.removeEventListener("squeezeend",R),n.removeEventListener("end",A),n.removeEventListener("inputsourceschange",P);for(let V=0;V<y.length;V++){let K=x[V];K!==null&&(x[V]=null,y[V].disconnect(K))}E=null,I=null,g.reset(),e.setRenderTarget(v),p=null,f=null,h=null,n=null,_=null,Q.stop(),i.isPresenting=!1,e.setPixelRatio(S),e.setSize(M.width,M.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(V){a=V,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(V){s=V,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(V){u=V},this.getBaseLayer=function(){return f!==null?f:p},this.getBinding=function(){return h},this.getFrame=function(){return d},this.getSession=function(){return n},this.setSession=function(V){return Lb(this,null,function*(){if(n=V,n!==null){if(v=e.getRenderTarget(),n.addEventListener("select",R),n.addEventListener("selectstart",R),n.addEventListener("selectend",R),n.addEventListener("squeeze",R),n.addEventListener("squeezestart",R),n.addEventListener("squeezeend",R),n.addEventListener("end",A),n.addEventListener("inputsourceschange",P),m.xrCompatible!==!0&&(yield t.makeXRCompatible()),S=e.getPixelRatio(),e.getSize(M),n.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let K={antialias:n.renderState.layers===void 0?m.antialias:!0,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:a};p=new XRWebGLLayer(n,t,K),n.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),_=new Kc(p.framebufferWidth,p.framebufferHeight,{format:sl,type:zf,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let K=null,ae=null,ve=null;m.depth&&(ve=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,K=m.stencil?s0:Jd,ae=m.stencil?Kd:Nf);let ue={colorFormat:t.RGBA8,depthFormat:ve,scaleFactor:a};h=new XRWebGLBinding(n,t),f=h.createProjectionLayer(ue),n.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),_=new Kc(f.textureWidth,f.textureHeight,{format:sl,type:zf,depthTexture:new yR(f.textureWidth,f.textureHeight,ae,void 0,void 0,void 0,void 0,void 0,void 0,K),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0});let se=e.properties.get(_);se.__ignoreDepthValues=f.ignoreDepthValues}_.isXRRenderTarget=!0,this.setFoveation(l),u=null,o=yield n.requestReferenceSpace(s),Q.setContext(n),Q.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(n!==null)return n.environmentBlendMode};function P(V){for(let K=0;K<V.removed.length;K++){let ae=V.removed[K],ve=x.indexOf(ae);ve>=0&&(x[ve]=null,y[ve].disconnect(ae))}for(let K=0;K<V.added.length;K++){let ae=V.added[K],ve=x.indexOf(ae);if(ve===-1){for(let se=0;se<y.length;se++)if(se>=x.length){x.push(ae),ve=se;break}else if(x[se]===null){x[se]=ae,ve=se;break}if(ve===-1)break}let ue=y[ve];ue&&ue.connect(ae)}}let U=new ye,B=new ye;function z(V,K,ae){U.setFromMatrixPosition(K.matrixWorld),B.setFromMatrixPosition(ae.matrixWorld);let ve=U.distanceTo(B),ue=K.projectionMatrix.elements,se=ae.projectionMatrix.elements,Ee=ue[14]/(ue[10]-1),q=ue[14]/(ue[10]+1),H=(ue[9]+1)/ue[5],We=(ue[9]-1)/ue[5],_e=(ue[8]-1)/ue[0],xe=(se[8]+1)/se[0],Le=Ee*_e,Ue=Ee*xe,Ne=ve/(-_e+xe),Ve=Ne*-_e;K.matrixWorld.decompose(V.position,V.quaternion,V.scale),V.translateX(Ve),V.translateZ(Ne),V.matrixWorld.compose(V.position,V.quaternion,V.scale),V.matrixWorldInverse.copy(V.matrixWorld).invert();let dt=Ee+Ne,F=q+Ne,L=Le-Ve,ne=Ue+(ve-Ve),le=H*q/F*dt,me=We*q/F*dt;V.projectionMatrix.makePerspective(L,ne,le,me,dt,F),V.projectionMatrixInverse.copy(V.projectionMatrix).invert()}function k(V,K){K===null?V.matrixWorld.copy(V.matrix):V.matrixWorld.multiplyMatrices(K.matrixWorld,V.matrix),V.matrixWorldInverse.copy(V.matrixWorld).invert()}this.updateCamera=function(V){if(n===null)return;g.texture!==null&&(V.near=g.depthNear,V.far=g.depthFar),b.near=T.near=w.near=V.near,b.far=T.far=w.far=V.far,(E!==b.near||I!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),E=b.near,I=b.far,w.near=E,w.far=I,T.near=E,T.far=I,w.updateProjectionMatrix(),T.updateProjectionMatrix(),V.updateProjectionMatrix());let K=V.parent,ae=b.cameras;k(b,K);for(let ve=0;ve<ae.length;ve++)k(ae[ve],K);ae.length===2?z(b,w,T):b.projectionMatrix.copy(w.projectionMatrix),G(V,b,K)};function G(V,K,ae){ae===null?V.matrix.copy(K.matrixWorld):(V.matrix.copy(ae.matrixWorld),V.matrix.invert(),V.matrix.multiply(K.matrixWorld)),V.matrix.decompose(V.position,V.quaternion,V.scale),V.updateMatrixWorld(!0),V.projectionMatrix.copy(K.projectionMatrix),V.projectionMatrixInverse.copy(K.projectionMatrixInverse),V.isPerspectiveCamera&&(V.fov=l0*2*Math.atan(1/V.projectionMatrix.elements[5]),V.zoom=1)}this.getCamera=function(){return b},this.getFoveation=function(){if(!(f===null&&p===null))return l},this.setFoveation=function(V){l=V,f!==null&&(f.fixedFoveation=V),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=V)},this.hasDepthSensing=function(){return g.texture!==null};let Y=null;function J(V,K){if(c=K.getViewerPose(u||o),d=K,c!==null){let ae=c.views;p!==null&&(e.setRenderTargetFramebuffer(_,p.framebuffer),e.setRenderTarget(_));let ve=!1;ae.length!==b.cameras.length&&(b.cameras.length=0,ve=!0);for(let se=0;se<ae.length;se++){let Ee=ae[se],q=null;if(p!==null)q=p.getViewport(Ee);else{let We=h.getViewSubImage(f,Ee);q=We.viewport,se===0&&(e.setRenderTargetTextures(_,We.colorTexture,f.ignoreDepthValues?void 0:We.depthStencilTexture),e.setRenderTarget(_))}let H=C[se];H===void 0&&(H=new Fn,H.layers.enable(se),H.viewport=new Ur,C[se]=H),H.matrix.fromArray(Ee.transform.matrix),H.matrix.decompose(H.position,H.quaternion,H.scale),H.projectionMatrix.fromArray(Ee.projectionMatrix),H.projectionMatrixInverse.copy(H.projectionMatrix).invert(),H.viewport.set(q.x,q.y,q.width,q.height),se===0&&(b.matrix.copy(H.matrix),b.matrix.decompose(b.position,b.quaternion,b.scale)),ve===!0&&b.cameras.push(H)}let ue=n.enabledFeatures;if(ue&&ue.includes("depth-sensing")){let se=h.getDepthInformation(ae[0]);se&&se.isValid&&se.texture&&g.init(e,se,n.renderState)}}for(let ae=0;ae<y.length;ae++){let ve=x[ae],ue=y[ae];ve!==null&&ue!==void 0&&ue.update(ve,K,u||o)}g.render(e,b),Y&&Y(V,K),K.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:K}),d=null}let Q=new Xae;Q.setAnimationLoop(J),this.setAnimationLoop=function(V){Y=V},this.dispose=function(){}}},Xd=new Vn,RPe=new Xt;function LPe(r,e){function t(m,v){m.matrixAutoUpdate===!0&&m.updateMatrix(),v.value.copy(m.matrix)}function i(m,v){v.color.getRGB(m.fogColor.value,Wae(r)),v.isFog?(m.fogNear.value=v.near,m.fogFar.value=v.far):v.isFogExp2&&(m.fogDensity.value=v.density)}function n(m,v,_,y,x){v.isMeshBasicMaterial||v.isMeshLambertMaterial?a(m,v):v.isMeshToonMaterial?(a(m,v),h(m,v)):v.isMeshPhongMaterial?(a(m,v),c(m,v)):v.isMeshStandardMaterial?(a(m,v),f(m,v),v.isMeshPhysicalMaterial&&p(m,v,x)):v.isMeshMatcapMaterial?(a(m,v),d(m,v)):v.isMeshDepthMaterial?a(m,v):v.isMeshDistanceMaterial?(a(m,v),g(m,v)):v.isMeshNormalMaterial?a(m,v):v.isLineBasicMaterial?(o(m,v),v.isLineDashedMaterial&&s(m,v)):v.isPointsMaterial?l(m,v,_,y):v.isSpriteMaterial?u(m,v):v.isShadowMaterial?(m.color.value.copy(v.color),m.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function a(m,v){m.opacity.value=v.opacity,v.color&&m.diffuse.value.copy(v.color),v.emissive&&m.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.bumpMap&&(m.bumpMap.value=v.bumpMap,t(v.bumpMap,m.bumpMapTransform),m.bumpScale.value=v.bumpScale,v.side===Xo&&(m.bumpScale.value*=-1)),v.normalMap&&(m.normalMap.value=v.normalMap,t(v.normalMap,m.normalMapTransform),m.normalScale.value.copy(v.normalScale),v.side===Xo&&m.normalScale.value.negate()),v.displacementMap&&(m.displacementMap.value=v.displacementMap,t(v.displacementMap,m.displacementMapTransform),m.displacementScale.value=v.displacementScale,m.displacementBias.value=v.displacementBias),v.emissiveMap&&(m.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,m.emissiveMapTransform)),v.specularMap&&(m.specularMap.value=v.specularMap,t(v.specularMap,m.specularMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest);let _=e.get(v),y=_.envMap,x=_.envMapRotation;if(y&&(m.envMap.value=y,Xd.copy(x),Xd.x*=-1,Xd.y*=-1,Xd.z*=-1,y.isCubeTexture&&y.isRenderTargetTexture===!1&&(Xd.y*=-1,Xd.z*=-1),m.envMapRotation.value.setFromMatrix4(RPe.makeRotationFromEuler(Xd)),m.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=v.reflectivity,m.ior.value=v.ior,m.refractionRatio.value=v.refractionRatio),v.lightMap){m.lightMap.value=v.lightMap;let M=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=v.lightMapIntensity*M,t(v.lightMap,m.lightMapTransform)}v.aoMap&&(m.aoMap.value=v.aoMap,m.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,m.aoMapTransform))}function o(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform))}function s(m,v){m.dashSize.value=v.dashSize,m.totalSize.value=v.dashSize+v.gapSize,m.scale.value=v.scale}function l(m,v,_,y){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.size.value=v.size*_,m.scale.value=y*.5,v.map&&(m.map.value=v.map,t(v.map,m.uvTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function u(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.rotation.value=v.rotation,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function c(m,v){m.specular.value.copy(v.specular),m.shininess.value=Math.max(v.shininess,1e-4)}function h(m,v){v.gradientMap&&(m.gradientMap.value=v.gradientMap)}function f(m,v){m.metalness.value=v.metalness,v.metalnessMap&&(m.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,m.metalnessMapTransform)),m.roughness.value=v.roughness,v.roughnessMap&&(m.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,m.roughnessMapTransform)),e.get(v).envMap&&(m.envMapIntensity.value=v.envMapIntensity)}function p(m,v,_){m.ior.value=v.ior,v.sheen>0&&(m.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),m.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(m.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,m.sheenColorMapTransform)),v.sheenRoughnessMap&&(m.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,m.sheenRoughnessMapTransform))),v.clearcoat>0&&(m.clearcoat.value=v.clearcoat,m.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(m.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,m.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(m.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Xo&&m.clearcoatNormalScale.value.negate())),v.iridescence>0&&(m.iridescence.value=v.iridescence,m.iridescenceIOR.value=v.iridescenceIOR,m.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(m.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,m.iridescenceMapTransform)),v.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),v.transmission>0&&(m.transmission.value=v.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),v.transmissionMap&&(m.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,m.transmissionMapTransform)),m.thickness.value=v.thickness,v.thicknessMap&&(m.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=v.attenuationDistance,m.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(m.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(m.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=v.specularIntensity,m.specularColor.value.copy(v.specularColor),v.specularColorMap&&(m.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,m.specularColorMapTransform)),v.specularIntensityMap&&(m.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,m.specularIntensityMapTransform))}function d(m,v){v.matcap&&(m.matcap.value=v.matcap)}function g(m,v){let _=e.get(v).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:n}}function DPe(r,e,t,i){let n={},a={},o=[],s=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(_,y){let x=y.program;i.uniformBlockBinding(_,x)}function u(_,y){let x=n[_.id];x===void 0&&(d(_),x=c(_),n[_.id]=x,_.addEventListener("dispose",m));let M=y.program;i.updateUBOMapping(_,M);let S=e.render.frame;a[_.id]!==S&&(f(_),a[_.id]=S)}function c(_){let y=h();_.__bindingPointIndex=y;let x=r.createBuffer(),M=_.__size,S=_.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,M,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,y,x),x}function h(){for(let _=0;_<s;_++)if(o.indexOf(_)===-1)return o.push(_),_;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(_){let y=n[_.id],x=_.uniforms,M=_.__cache;r.bindBuffer(r.UNIFORM_BUFFER,y);for(let S=0,w=x.length;S<w;S++){let T=Array.isArray(x[S])?x[S]:[x[S]];for(let C=0,b=T.length;C<b;C++){let E=T[C];if(p(E,S,C,M)===!0){let I=E.__offset,R=Array.isArray(E.value)?E.value:[E.value],A=0;for(let P=0;P<R.length;P++){let U=R[P],B=g(U);typeof U=="number"||typeof U=="boolean"?(E.__data[0]=U,r.bufferSubData(r.UNIFORM_BUFFER,I+A,E.__data)):U.isMatrix3?(E.__data[0]=U.elements[0],E.__data[1]=U.elements[1],E.__data[2]=U.elements[2],E.__data[3]=0,E.__data[4]=U.elements[3],E.__data[5]=U.elements[4],E.__data[6]=U.elements[5],E.__data[7]=0,E.__data[8]=U.elements[6],E.__data[9]=U.elements[7],E.__data[10]=U.elements[8],E.__data[11]=0):(U.toArray(E.__data,A),A+=B.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,I,E.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function p(_,y,x,M){let S=_.value,w=y+"_"+x;if(M[w]===void 0)return typeof S=="number"||typeof S=="boolean"?M[w]=S:M[w]=S.clone(),!0;{let T=M[w];if(typeof S=="number"||typeof S=="boolean"){if(T!==S)return M[w]=S,!0}else if(T.equals(S)===!1)return T.copy(S),!0}return!1}function d(_){let y=_.uniforms,x=0,M=16;for(let w=0,T=y.length;w<T;w++){let C=Array.isArray(y[w])?y[w]:[y[w]];for(let b=0,E=C.length;b<E;b++){let I=C[b],R=Array.isArray(I.value)?I.value:[I.value];for(let A=0,P=R.length;A<P;A++){let U=R[A],B=g(U),z=x%M;z!==0&&M-z<B.boundary&&(x+=M-z),I.__data=new Float32Array(B.storage/Float32Array.BYTES_PER_ELEMENT),I.__offset=x,x+=B.storage}}}let S=x%M;return S>0&&(x+=M-S),_.__size=x,_.__cache={},this}function g(_){let y={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),y}function m(_){let y=_.target;y.removeEventListener("dispose",m);let x=o.indexOf(y.__bindingPointIndex);o.splice(x,1),r.deleteBuffer(n[y.id]),delete n[y.id],delete a[y.id]}function v(){for(let _ in n)r.deleteBuffer(n[_]);o=[],n={},a={}}return{bind:l,update:u,dispose:v}}var TB=class{constructor(e={}){let{canvas:t=NCe(),context:i=null,depth:n=!0,stencil:a=!0,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let f;i!==null?f=i.getContextAttributes().alpha:f=o;let p=new Uint32Array(4),d=new Int32Array(4),g=null,m=null,v=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Pa,this._useLegacyLights=!1,this.toneMapping=Of,this.toneMappingExposure=1;let y=this,x=!1,M=0,S=0,w=null,T=-1,C=null,b=new Ur,E=new Ur,I=null,R=new nr(0),A=0,P=t.width,U=t.height,B=1,z=null,k=null,G=new Ur(0,0,P,U),Y=new Ur(0,0,P,U),J=!1,Q=new SM,V=!1,K=!1,ae=null,ve=new Xt,ue=new xr,se=new ye,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return w===null?B:1}let H=i;function We(O,j){for(let re=0;re<O.length;re++){let ie=O[re],D=t.getContext(ie,j);if(D!==null)return D}return null}try{let O={alpha:!0,depth:n,stencil:a,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${VB}`),t.addEventListener("webglcontextlost",Gt,!1),t.addEventListener("webglcontextrestored",X,!1),t.addEventListener("webglcontextcreationerror",Te,!1),H===null){let j=["webgl2","webgl","experimental-webgl"];if(y.isWebGL1Renderer===!0&&j.shift(),H=We(j,O),H===null)throw We(j)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&H instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),H.getShaderPrecisionFormat===void 0&&(H.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let _e,xe,Le,Ue,Ne,Ve,dt,F,L,ne,le,me,fe,et,Ke,Se,Ae,at,$,nt,Xe,Fe,we,Ie;function ct(){_e=new q2e(H),xe=new V2e(H,_e,e),_e.init(xe),Fe=new TPe(H,_e,xe),Le=new bPe(H,_e,xe),Ue=new K2e(H),Ne=new hPe,Ve=new wPe(H,_e,Le,Ne,xe,Fe,Ue),dt=new H2e(y),F=new Y2e(y),L=new rRe(H,xe),we=new B2e(H,_e,L,xe),ne=new Z2e(H,L,Ue,we),le=new eDe(H,ne,L,Ue),$=new Q2e(H,xe,Ve),Se=new G2e(Ne),me=new cPe(y,dt,F,_e,xe,we,Se),fe=new LPe(y,Ne),et=new pPe,Ke=new _Pe(_e,xe),at=new F2e(y,dt,F,Le,le,f,l),Ae=new MPe(y,le,xe),Ie=new DPe(H,Ue,xe,Le),nt=new k2e(H,_e,Ue,xe),Xe=new j2e(H,_e,Ue,xe),Ue.programs=me.programs,y.capabilities=xe,y.extensions=_e,y.properties=Ne,y.renderLists=et,y.shadowMap=Ae,y.state=Le,y.info=Ue}ct();let Je=new wB(y,H);this.xr=Je,this.getContext=function(){return H},this.getContextAttributes=function(){return H.getContextAttributes()},this.forceContextLoss=function(){let O=_e.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){let O=_e.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return B},this.setPixelRatio=function(O){O!==void 0&&(B=O,this.setSize(P,U,!1))},this.getSize=function(O){return O.set(P,U)},this.setSize=function(O,j,re=!0){if(Je.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}P=O,U=j,t.width=Math.floor(O*B),t.height=Math.floor(j*B),re===!0&&(t.style.width=O+"px",t.style.height=j+"px"),this.setViewport(0,0,O,j)},this.getDrawingBufferSize=function(O){return O.set(P*B,U*B).floor()},this.setDrawingBufferSize=function(O,j,re){P=O,U=j,B=re,t.width=Math.floor(O*re),t.height=Math.floor(j*re),this.setViewport(0,0,O,j)},this.getCurrentViewport=function(O){return O.copy(b)},this.getViewport=function(O){return O.copy(G)},this.setViewport=function(O,j,re,ie){O.isVector4?G.set(O.x,O.y,O.z,O.w):G.set(O,j,re,ie),Le.viewport(b.copy(G).multiplyScalar(B).round())},this.getScissor=function(O){return O.copy(Y)},this.setScissor=function(O,j,re,ie){O.isVector4?Y.set(O.x,O.y,O.z,O.w):Y.set(O,j,re,ie),Le.scissor(E.copy(Y).multiplyScalar(B).round())},this.getScissorTest=function(){return J},this.setScissorTest=function(O){Le.setScissorTest(J=O)},this.setOpaqueSort=function(O){z=O},this.setTransparentSort=function(O){k=O},this.getClearColor=function(O){return O.copy(at.getClearColor())},this.setClearColor=function(){at.setClearColor.apply(at,arguments)},this.getClearAlpha=function(){return at.getClearAlpha()},this.setClearAlpha=function(){at.setClearAlpha.apply(at,arguments)},this.clear=function(O=!0,j=!0,re=!0){let ie=0;if(O){let D=!1;if(w!==null){let W=w.texture.format;D=W===Bae||W===Fae||W===zae}if(D){let W=w.texture.type,ee=W===zf||W===Nf||W===GB||W===Kd||W===Uae||W===Oae,ge=at.getClearColor(),ce=at.getClearAlpha(),Oe=ge.r,Ge=ge.g,Re=ge.b;ee?(p[0]=Oe,p[1]=Ge,p[2]=Re,p[3]=ce,H.clearBufferuiv(H.COLOR,0,p)):(d[0]=Oe,d[1]=Ge,d[2]=Re,d[3]=ce,H.clearBufferiv(H.COLOR,0,d))}else ie|=H.COLOR_BUFFER_BIT}j&&(ie|=H.DEPTH_BUFFER_BIT),re&&(ie|=H.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),H.clear(ie)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",Gt,!1),t.removeEventListener("webglcontextrestored",X,!1),t.removeEventListener("webglcontextcreationerror",Te,!1),et.dispose(),Ke.dispose(),Ne.dispose(),dt.dispose(),F.dispose(),le.dispose(),we.dispose(),Ie.dispose(),me.dispose(),Je.dispose(),Je.removeEventListener("sessionstart",$r),Je.removeEventListener("sessionend",Ht),ae&&(ae.dispose(),ae=null),Or.stop()};function Gt(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function X(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;let O=Ue.autoReset,j=Ae.enabled,re=Ae.autoUpdate,ie=Ae.needsUpdate,D=Ae.type;ct(),Ue.autoReset=O,Ae.enabled=j,Ae.autoUpdate=re,Ae.needsUpdate=ie,Ae.type=D}function Te(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function te(O){let j=O.target;j.removeEventListener("dispose",te),Me(j)}function Me(O){De(O),Ne.remove(O)}function De(O){let j=Ne.get(O).programs;j!==void 0&&(j.forEach(function(re){me.releaseProgram(re)}),O.isShaderMaterial&&me.releaseShaderCache(O))}this.renderBufferDirect=function(O,j,re,ie,D,W){j===null&&(j=Ee);let ee=D.isMesh&&D.matrixWorld.determinant()<0,ge=u_(O,j,re,ie,D);Le.setMaterial(ie,ee);let ce=re.index,Oe=1;if(ie.wireframe===!0){if(ce=ne.getWireframeAttribute(re),ce===void 0)return;Oe=2}let Ge=re.drawRange,Re=re.attributes.position,gt=Ge.start*Oe,_t=(Ge.start+Ge.count)*Oe;W!==null&&(gt=Math.max(gt,W.start*Oe),_t=Math.min(_t,(W.start+W.count)*Oe)),ce!==null?(gt=Math.max(gt,0),_t=Math.min(_t,ce.count)):Re!=null&&(gt=Math.max(gt,0),_t=Math.min(_t,Re.count));let $e=_t-gt;if($e<0||$e===1/0)return;we.setup(D,ie,ge,re,ce);let lt,Ct=nt;if(ce!==null&&(lt=L.get(ce),Ct=Xe,Ct.setIndex(lt)),D.isMesh)ie.wireframe===!0?(Le.setLineWidth(ie.wireframeLinewidth*q()),Ct.setMode(H.LINES)):Ct.setMode(H.TRIANGLES);else if(D.isLine){let je=ie.linewidth;je===void 0&&(je=1),Le.setLineWidth(je*q()),D.isLineSegments?Ct.setMode(H.LINES):D.isLineLoop?Ct.setMode(H.LINE_LOOP):Ct.setMode(H.LINE_STRIP)}else D.isPoints?Ct.setMode(H.POINTS):D.isSprite&&Ct.setMode(H.TRIANGLES);if(D.isBatchedMesh)Ct.renderMultiDraw(D._multiDrawStarts,D._multiDrawCounts,D._multiDrawCount);else if(D.isInstancedMesh)Ct.renderInstances(gt,$e,D.count);else if(re.isInstancedBufferGeometry){let je=re._maxInstanceCount!==void 0?re._maxInstanceCount:1/0,_i=Math.min(re.instanceCount,je);Ct.renderInstances(gt,$e,_i)}else Ct.render(gt,$e)};function wt(O,j,re){O.transparent===!0&&O.side===qc&&O.forceSinglePass===!1?(O.side=Xo,O.needsUpdate=!0,Es(O,j,re),O.side=Ff,O.needsUpdate=!0,Es(O,j,re),O.side=qc):Es(O,j,re)}this.compile=function(O,j,re=null){re===null&&(re=O),m=Ke.get(re),m.init(),_.push(m),re.traverseVisible(function(D){D.isLight&&D.layers.test(j.layers)&&(m.pushLight(D),D.castShadow&&m.pushShadow(D))}),O!==re&&O.traverseVisible(function(D){D.isLight&&D.layers.test(j.layers)&&(m.pushLight(D),D.castShadow&&m.pushShadow(D))}),m.setupLights(y._useLegacyLights);let ie=new Set;return O.traverse(function(D){let W=D.material;if(W)if(Array.isArray(W))for(let ee=0;ee<W.length;ee++){let ge=W[ee];wt(ge,re,D),ie.add(ge)}else wt(W,re,D),ie.add(W)}),_.pop(),m=null,ie},this.compileAsync=function(O,j,re=null){let ie=this.compile(O,j,re);return new Promise(D=>{function W(){if(ie.forEach(function(ee){Ne.get(ee).currentProgram.isReady()&&ie.delete(ee)}),ie.size===0){D(O);return}setTimeout(W,10)}_e.get("KHR_parallel_shader_compile")!==null?W():setTimeout(W,10)})};let kt=null;function Tr(O){kt&&kt(O)}function $r(){Or.stop()}function Ht(){Or.start()}let Or=new Xae;Or.setAnimationLoop(Tr),typeof self<"u"&&Or.setContext(self),this.setAnimationLoop=function(O){kt=O,Je.setAnimationLoop(O),O===null?Or.stop():Or.start()},Je.addEventListener("sessionstart",$r),Je.addEventListener("sessionend",Ht),this.render=function(O,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Je.enabled===!0&&Je.isPresenting===!0&&(Je.cameraAutoUpdate===!0&&Je.updateCamera(j),j=Je.getCamera()),O.isScene===!0&&O.onBeforeRender(y,O,j,w),m=Ke.get(O,_.length),m.init(),_.push(m),ve.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),Q.setFromProjectionMatrix(ve),K=this.localClippingEnabled,V=Se.init(this.clippingPlanes,K),g=et.get(O,v.length),g.init(),v.push(g),hi(O,j,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(z,k),this.info.render.frame++,V===!0&&Se.beginShadows();let re=m.state.shadowsArray;if(Ae.render(re,O,j),V===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Je.enabled===!1||Je.isPresenting===!1||Je.hasDepthSensing()===!1)&&at.render(g,O),m.setupLights(y._useLegacyLights),j.isArrayCamera){let ie=j.cameras;for(let D=0,W=ie.length;D<W;D++){let ee=ie[D];tp(g,O,ee,ee.viewport)}}else tp(g,O,j);w!==null&&(Ve.updateMultisampleRenderTarget(w),Ve.updateRenderTargetMipmap(w)),O.isScene===!0&&O.onAfterRender(y,O,j),we.resetDefaultState(),T=-1,C=null,_.pop(),_.length>0?m=_[_.length-1]:m=null,v.pop(),v.length>0?g=v[v.length-1]:g=null};function hi(O,j,re,ie){if(O.visible===!1)return;if(O.layers.test(j.layers)){if(O.isGroup)re=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(j);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||Q.intersectsSprite(O)){ie&&se.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ve);let ee=le.update(O),ge=O.material;ge.visible&&g.push(O,ee,ge,re,se.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||Q.intersectsObject(O))){let ee=le.update(O),ge=O.material;if(ie&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),se.copy(O.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),se.copy(ee.boundingSphere.center)),se.applyMatrix4(O.matrixWorld).applyMatrix4(ve)),Array.isArray(ge)){let ce=ee.groups;for(let Oe=0,Ge=ce.length;Oe<Ge;Oe++){let Re=ce[Oe],gt=ge[Re.materialIndex];gt&&gt.visible&&g.push(O,ee,gt,re,se.z,Re)}}else ge.visible&&g.push(O,ee,ge,re,se.z,null)}}let W=O.children;for(let ee=0,ge=W.length;ee<ge;ee++)hi(W[ee],j,re,ie)}function tp(O,j,re,ie){let D=O.opaque,W=O.transmissive,ee=O.transparent;m.setupLightsView(re),V===!0&&Se.setGlobalState(y.clippingPlanes,re),W.length>0&&l_(D,W,j,re),ie&&Le.viewport(b.copy(ie)),D.length>0&&gl(D,j,re),W.length>0&&gl(W,j,re),ee.length>0&&gl(ee,j,re),Le.buffers.depth.setTest(!0),Le.buffers.depth.setMask(!0),Le.buffers.color.setMask(!0),Le.setPolygonOffset(!1)}function l_(O,j,re,ie){if((re.isScene===!0?re.overrideMaterial:null)!==null)return;let W=xe.isWebGL2;ae===null&&(ae=new Kc(1,1,{generateMipmaps:!0,type:_e.has("EXT_color_buffer_half_float")?gM:zf,minFilter:jd,samples:W?4:0})),y.getDrawingBufferSize(ue),W?ae.setSize(ue.x,ue.y):ae.setSize(sR(ue.x),sR(ue.y));let ee=y.getRenderTarget();y.setRenderTarget(ae),y.getClearColor(R),A=y.getClearAlpha(),A<1&&y.setClearColor(16777215,.5),y.clear();let ge=y.toneMapping;y.toneMapping=Of,gl(O,re,ie),Ve.updateMultisampleRenderTarget(ae),Ve.updateRenderTargetMipmap(ae);let ce=!1;for(let Oe=0,Ge=j.length;Oe<Ge;Oe++){let Re=j[Oe],gt=Re.object,_t=Re.geometry,$e=Re.material,lt=Re.group;if($e.side===qc&&gt.layers.test(ie.layers)){let Ct=$e.side;$e.side=Xo,$e.needsUpdate=!0,rp(gt,re,ie,_t,$e,lt),$e.side=Ct,$e.needsUpdate=!0,ce=!0}}ce===!0&&(Ve.updateMultisampleRenderTarget(ae),Ve.updateRenderTargetMipmap(ae)),y.setRenderTarget(ee),y.setClearColor(R,A),y.toneMapping=ge}function gl(O,j,re){let ie=j.isScene===!0?j.overrideMaterial:null;for(let D=0,W=O.length;D<W;D++){let ee=O[D],ge=ee.object,ce=ee.geometry,Oe=ie===null?ee.material:ie,Ge=ee.group;ge.layers.test(re.layers)&&rp(ge,j,re,ce,Oe,Ge)}}function rp(O,j,re,ie,D,W){O.onBeforeRender(y,j,re,ie,D,W),O.modelViewMatrix.multiplyMatrices(re.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),D.onBeforeRender(y,j,re,ie,O,W),D.transparent===!0&&D.side===qc&&D.forceSinglePass===!1?(D.side=Xo,D.needsUpdate=!0,y.renderBufferDirect(re,j,ie,D,O,W),D.side=Ff,D.needsUpdate=!0,y.renderBufferDirect(re,j,ie,D,O,W),D.side=qc):y.renderBufferDirect(re,j,ie,D,O,W),O.onAfterRender(y,j,re,ie,D,W)}function Es(O,j,re){j.isScene!==!0&&(j=Ee);let ie=Ne.get(O),D=m.state.lights,W=m.state.shadowsArray,ee=D.state.version,ge=me.getParameters(O,D.state,W,j,re),ce=me.getProgramCacheKey(ge),Oe=ie.programs;ie.environment=O.isMeshStandardMaterial?j.environment:null,ie.fog=j.fog,ie.envMap=(O.isMeshStandardMaterial?F:dt).get(O.envMap||ie.environment),ie.envMapRotation=ie.environment!==null&&O.envMap===null?j.environmentRotation:O.envMapRotation,Oe===void 0&&(O.addEventListener("dispose",te),Oe=new Map,ie.programs=Oe);let Ge=Oe.get(ce);if(Ge!==void 0){if(ie.currentProgram===Ge&&ie.lightsStateVersion===ee)return oh(O,ge),Ge}else ge.uniforms=me.getUniforms(O),O.onBuild(re,ge,y),O.onBeforeCompile(ge,y),Ge=me.acquireProgram(ge,ce),Oe.set(ce,Ge),ie.uniforms=ge.uniforms;let Re=ie.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(Re.clippingPlanes=Se.uniform),oh(O,ge),ie.needsLights=h_(O),ie.lightsStateVersion=ee,ie.needsLights&&(Re.ambientLightColor.value=D.state.ambient,Re.lightProbe.value=D.state.probe,Re.directionalLights.value=D.state.directional,Re.directionalLightShadows.value=D.state.directionalShadow,Re.spotLights.value=D.state.spot,Re.spotLightShadows.value=D.state.spotShadow,Re.rectAreaLights.value=D.state.rectArea,Re.ltc_1.value=D.state.rectAreaLTC1,Re.ltc_2.value=D.state.rectAreaLTC2,Re.pointLights.value=D.state.point,Re.pointLightShadows.value=D.state.pointShadow,Re.hemisphereLights.value=D.state.hemi,Re.directionalShadowMap.value=D.state.directionalShadowMap,Re.directionalShadowMatrix.value=D.state.directionalShadowMatrix,Re.spotShadowMap.value=D.state.spotShadowMap,Re.spotLightMatrix.value=D.state.spotLightMatrix,Re.spotLightMap.value=D.state.spotLightMap,Re.pointShadowMap.value=D.state.pointShadowMap,Re.pointShadowMatrix.value=D.state.pointShadowMatrix),ie.currentProgram=Ge,ie.uniformsList=null,Ge}function ip(O){if(O.uniformsList===null){let j=O.currentProgram.getUniforms();O.uniformsList=i0.seqWithValue(j.seq,O.uniforms)}return O.uniformsList}function oh(O,j){let re=Ne.get(O);re.outputColorSpace=j.outputColorSpace,re.batching=j.batching,re.instancing=j.instancing,re.instancingColor=j.instancingColor,re.instancingMorph=j.instancingMorph,re.skinning=j.skinning,re.morphTargets=j.morphTargets,re.morphNormals=j.morphNormals,re.morphColors=j.morphColors,re.morphTargetsCount=j.morphTargetsCount,re.numClippingPlanes=j.numClippingPlanes,re.numIntersection=j.numClipIntersection,re.vertexAlphas=j.vertexAlphas,re.vertexTangents=j.vertexTangents,re.toneMapping=j.toneMapping}function u_(O,j,re,ie,D){j.isScene!==!0&&(j=Ee),Ve.resetTextureUnits();let W=j.fog,ee=ie.isMeshStandardMaterial?j.environment:null,ge=w===null?y.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:Yf,ce=(ie.isMeshStandardMaterial?F:dt).get(ie.envMap||ee),Oe=ie.vertexColors===!0&&!!re.attributes.color&&re.attributes.color.itemSize===4,Ge=!!re.attributes.tangent&&(!!ie.normalMap||ie.anisotropy>0),Re=!!re.morphAttributes.position,gt=!!re.morphAttributes.normal,_t=!!re.morphAttributes.color,$e=Of;ie.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&($e=y.toneMapping);let lt=re.morphAttributes.position||re.morphAttributes.normal||re.morphAttributes.color,Ct=lt!==void 0?lt.length:0,je=Ne.get(ie),_i=m.state.lights;if(V===!0&&(K===!0||O!==C)){let Qr=O===C&&ie.id===T;Se.setState(ie,O,Qr)}let Ft=!1;ie.version===je.__version?(je.needsLights&&je.lightsStateVersion!==_i.state.version||je.outputColorSpace!==ge||D.isBatchedMesh&&je.batching===!1||!D.isBatchedMesh&&je.batching===!0||D.isInstancedMesh&&je.instancing===!1||!D.isInstancedMesh&&je.instancing===!0||D.isSkinnedMesh&&je.skinning===!1||!D.isSkinnedMesh&&je.skinning===!0||D.isInstancedMesh&&je.instancingColor===!0&&D.instanceColor===null||D.isInstancedMesh&&je.instancingColor===!1&&D.instanceColor!==null||D.isInstancedMesh&&je.instancingMorph===!0&&D.morphTexture===null||D.isInstancedMesh&&je.instancingMorph===!1&&D.morphTexture!==null||je.envMap!==ce||ie.fog===!0&&je.fog!==W||je.numClippingPlanes!==void 0&&(je.numClippingPlanes!==Se.numPlanes||je.numIntersection!==Se.numIntersection)||je.vertexAlphas!==Oe||je.vertexTangents!==Ge||je.morphTargets!==Re||je.morphNormals!==gt||je.morphColors!==_t||je.toneMapping!==$e||xe.isWebGL2===!0&&je.morphTargetsCount!==Ct)&&(Ft=!0):(Ft=!0,je.__version=ie.version);let Nr=je.currentProgram;Ft===!0&&(Nr=Es(ie,j,D));let Yi=!1,Et=!1,Ei=!1,cr=Nr.getUniforms(),hn=je.uniforms;if(Le.useProgram(Nr.program)&&(Yi=!0,Et=!0,Ei=!0),ie.id!==T&&(T=ie.id,Et=!0),Yi||C!==O){cr.setValue(H,"projectionMatrix",O.projectionMatrix),cr.setValue(H,"viewMatrix",O.matrixWorldInverse);let Qr=cr.map.cameraPosition;Qr!==void 0&&Qr.setValue(H,se.setFromMatrixPosition(O.matrixWorld)),xe.logarithmicDepthBuffer&&cr.setValue(H,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&cr.setValue(H,"isOrthographic",O.isOrthographicCamera===!0),C!==O&&(C=O,Et=!0,Ei=!0)}if(D.isSkinnedMesh){cr.setOptional(H,D,"bindMatrix"),cr.setOptional(H,D,"bindMatrixInverse");let Qr=D.skeleton;Qr&&(xe.floatVertexTextures?(Qr.boneTexture===null&&Qr.computeBoneTexture(),cr.setValue(H,"boneTexture",Qr.boneTexture,Ve)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}D.isBatchedMesh&&(cr.setOptional(H,D,"batchingTexture"),cr.setValue(H,"batchingTexture",D._matricesTexture,Ve));let Ju=re.morphAttributes;if((Ju.position!==void 0||Ju.normal!==void 0||Ju.color!==void 0&&xe.isWebGL2===!0)&&$.update(D,re,Nr),(Et||je.receiveShadow!==D.receiveShadow)&&(je.receiveShadow=D.receiveShadow,cr.setValue(H,"receiveShadow",D.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(hn.envMap.value=ce,hn.flipEnvMap.value=ce.isCubeTexture&&ce.isRenderTargetTexture===!1?-1:1),Et&&(cr.setValue(H,"toneMappingExposure",y.toneMappingExposure),je.needsLights&&c_(hn,Ei),W&&ie.fog===!0&&fe.refreshFogUniforms(hn,W),fe.refreshMaterialUniforms(hn,ie,B,U,ae),i0.upload(H,ip(je),hn,Ve)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(i0.upload(H,ip(je),hn,Ve),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&cr.setValue(H,"center",D.center),cr.setValue(H,"modelViewMatrix",D.modelViewMatrix),cr.setValue(H,"normalMatrix",D.normalMatrix),cr.setValue(H,"modelMatrix",D.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){let Qr=ie.uniformsGroups;for(let $u=0,np=Qr.length;$u<np;$u++)if(xe.isWebGL2){let ap=Qr[$u];Ie.update(ap,Nr),Ie.bind(ap,Nr)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Nr}function c_(O,j){O.ambientLightColor.needsUpdate=j,O.lightProbe.needsUpdate=j,O.directionalLights.needsUpdate=j,O.directionalLightShadows.needsUpdate=j,O.pointLights.needsUpdate=j,O.pointLightShadows.needsUpdate=j,O.spotLights.needsUpdate=j,O.spotLightShadows.needsUpdate=j,O.rectAreaLights.needsUpdate=j,O.hemisphereLights.needsUpdate=j}function h_(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(O,j,re){Ne.get(O.texture).__webglTexture=j,Ne.get(O.depthTexture).__webglTexture=re;let ie=Ne.get(O);ie.__hasExternalTextures=!0,ie.__autoAllocateDepthBuffer=re===void 0,ie.__autoAllocateDepthBuffer||_e.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ie.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(O,j){let re=Ne.get(O);re.__webglFramebuffer=j,re.__useDefaultFramebuffer=j===void 0},this.setRenderTarget=function(O,j=0,re=0){w=O,M=j,S=re;let ie=!0,D=null,W=!1,ee=!1;if(O){let ce=Ne.get(O);ce.__useDefaultFramebuffer!==void 0?(Le.bindFramebuffer(H.FRAMEBUFFER,null),ie=!1):ce.__webglFramebuffer===void 0?Ve.setupRenderTarget(O):ce.__hasExternalTextures&&Ve.rebindTextures(O,Ne.get(O.texture).__webglTexture,Ne.get(O.depthTexture).__webglTexture);let Oe=O.texture;(Oe.isData3DTexture||Oe.isDataArrayTexture||Oe.isCompressedArrayTexture)&&(ee=!0);let Ge=Ne.get(O).__webglFramebuffer;O.isWebGLCubeRenderTarget?(Array.isArray(Ge[j])?D=Ge[j][re]:D=Ge[j],W=!0):xe.isWebGL2&&O.samples>0&&Ve.useMultisampledRTT(O)===!1?D=Ne.get(O).__webglMultisampledFramebuffer:Array.isArray(Ge)?D=Ge[re]:D=Ge,b.copy(O.viewport),E.copy(O.scissor),I=O.scissorTest}else b.copy(G).multiplyScalar(B).floor(),E.copy(Y).multiplyScalar(B).floor(),I=J;if(Le.bindFramebuffer(H.FRAMEBUFFER,D)&&xe.drawBuffers&&ie&&Le.drawBuffers(O,D),Le.viewport(b),Le.scissor(E),Le.setScissorTest(I),W){let ce=Ne.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+j,ce.__webglTexture,re)}else if(ee){let ce=Ne.get(O.texture),Oe=j||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,ce.__webglTexture,re||0,Oe)}T=-1},this.readRenderTargetPixels=function(O,j,re,ie,D,W,ee){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ge=Ne.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&ee!==void 0&&(ge=ge[ee]),ge){Le.bindFramebuffer(H.FRAMEBUFFER,ge);try{let ce=O.texture,Oe=ce.format,Ge=ce.type;if(Oe!==sl&&Fe.convert(Oe)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Re=Ge===gM&&(_e.has("EXT_color_buffer_half_float")||xe.isWebGL2&&_e.has("EXT_color_buffer_float"));if(Ge!==zf&&Fe.convert(Ge)!==H.getParameter(H.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ge===Wu&&(xe.isWebGL2||_e.has("OES_texture_float")||_e.has("WEBGL_color_buffer_float")))&&!Re){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=O.width-ie&&re>=0&&re<=O.height-D&&H.readPixels(j,re,ie,D,Fe.convert(Oe),Fe.convert(Ge),W)}finally{let ce=w!==null?Ne.get(w).__webglFramebuffer:null;Le.bindFramebuffer(H.FRAMEBUFFER,ce)}}},this.copyFramebufferToTexture=function(O,j,re=0){let ie=Math.pow(2,-re),D=Math.floor(j.image.width*ie),W=Math.floor(j.image.height*ie);Ve.setTexture2D(j,0),H.copyTexSubImage2D(H.TEXTURE_2D,re,0,0,O.x,O.y,D,W),Le.unbindTexture()},this.copyTextureToTexture=function(O,j,re,ie=0){let D=j.image.width,W=j.image.height,ee=Fe.convert(re.format),ge=Fe.convert(re.type);Ve.setTexture2D(re,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,re.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,re.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,re.unpackAlignment),j.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,D,W,ee,ge,j.image.data):j.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,j.mipmaps[0].width,j.mipmaps[0].height,ee,j.mipmaps[0].data):H.texSubImage2D(H.TEXTURE_2D,ie,O.x,O.y,ee,ge,j.image),ie===0&&re.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),Le.unbindTexture()},this.copyTextureToTexture3D=function(O,j,re,ie,D=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let W=Math.round(O.max.x-O.min.x),ee=Math.round(O.max.y-O.min.y),ge=O.max.z-O.min.z+1,ce=Fe.convert(ie.format),Oe=Fe.convert(ie.type),Ge;if(ie.isData3DTexture)Ve.setTexture3D(ie,0),Ge=H.TEXTURE_3D;else if(ie.isDataArrayTexture||ie.isCompressedArrayTexture)Ve.setTexture2DArray(ie,0),Ge=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,ie.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,ie.unpackAlignment);let Re=H.getParameter(H.UNPACK_ROW_LENGTH),gt=H.getParameter(H.UNPACK_IMAGE_HEIGHT),_t=H.getParameter(H.UNPACK_SKIP_PIXELS),$e=H.getParameter(H.UNPACK_SKIP_ROWS),lt=H.getParameter(H.UNPACK_SKIP_IMAGES),Ct=re.isCompressedTexture?re.mipmaps[D]:re.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,Ct.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,Ct.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,O.min.x),H.pixelStorei(H.UNPACK_SKIP_ROWS,O.min.y),H.pixelStorei(H.UNPACK_SKIP_IMAGES,O.min.z),re.isDataTexture||re.isData3DTexture?H.texSubImage3D(Ge,D,j.x,j.y,j.z,W,ee,ge,ce,Oe,Ct.data):ie.isCompressedArrayTexture?H.compressedTexSubImage3D(Ge,D,j.x,j.y,j.z,W,ee,ge,ce,Ct.data):H.texSubImage3D(Ge,D,j.x,j.y,j.z,W,ee,ge,ce,Oe,Ct),H.pixelStorei(H.UNPACK_ROW_LENGTH,Re),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,gt),H.pixelStorei(H.UNPACK_SKIP_PIXELS,_t),H.pixelStorei(H.UNPACK_SKIP_ROWS,$e),H.pixelStorei(H.UNPACK_SKIP_IMAGES,lt),D===0&&ie.generateMipmaps&&H.generateMipmap(Ge),Le.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?Ve.setTextureCube(O,0):O.isData3DTexture?Ve.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?Ve.setTexture2DArray(O,0):Ve.setTexture2D(O,0),Le.unbindTexture()},this.resetState=function(){M=0,S=0,w=null,Le.reset(),we.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Zc}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===WB?"display-p3":"srgb",t.unpackColorSpace=ti.workingColorSpace===OR?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}},EB=class extends TB{};EB.prototype.isWebGL1Renderer=!0;var gae=new ye,yae=new Ur,_ae=new Ur,PPe=new ye,xae=new Xt,jC=new ye,QF=new Vf,Sae=new Xt,eB=new _M,_R=class extends Wo{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Jie,this.bindMatrix=new Xt,this.bindMatrixInverse=new Xt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new kf),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,jC),this.boundingBox.expandByPoint(jC)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Vf),this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,jC),this.boundingSphere.expandByPoint(jC)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let i=this.material,n=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),QF.copy(this.boundingSphere),QF.applyMatrix4(n),e.ray.intersectsSphere(QF)!==!1&&(Sae.copy(n).invert(),eB.copy(e.ray).applyMatrix4(Sae),!(this.boundingBox!==null&&eB.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,eB)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new Ur,t=this.geometry.attributes.skinWeight;for(let i=0,n=t.count;i<n;i++){e.fromBufferAttribute(t,i);let a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Jie?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===eCe?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let i=this.skeleton,n=this.geometry;yae.fromBufferAttribute(n.attributes.skinIndex,e),_ae.fromBufferAttribute(n.attributes.skinWeight,e),gae.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let a=0;a<4;a++){let o=_ae.getComponent(a);if(o!==0){let s=yae.getComponent(a);xae.multiplyMatrices(i.bones[s].matrixWorld,i.boneInverses[s]),t.addScaledVector(PPe.copy(gae).applyMatrix4(xae),o)}}return t.applyMatrix4(this.bindMatrixInverse)}},f0=class extends sa{constructor(){super(),this.isBone=!0,this.type="Bone"}},AB=class extends _s{constructor(e=null,t=1,i=1,n,a,o,s,l,u=On,c=On,h,f){super(null,o,s,l,u,c,n,a,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Mae=new Xt,IPe=new Xt,xR=class r{constructor(e=[],t=[]){this.uuid=qf(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,n=this.bones.length;i<n;i++)this.boneInverses.push(new Xt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let i=new Xt;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){let e=this.bones,t=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let a=0,o=e.length;a<o;a++){let s=e[a]?e[a].matrixWorld:IPe;Mae.multiplyMatrices(s,t[a]),Mae.toArray(i,a*16)}n!==null&&(n.needsUpdate=!0)}clone(){return new r(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let i=new AB(t,e,e,sl,Wu);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){let n=this.bones[t];if(n.name===e)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,n=e.bones.length;i<n;i++){let a=e.bones[i],o=t[a];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",a),o=new f0),this.bones.push(o),this.boneInverses.push(new Xt().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){let e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,i=this.boneInverses;for(let n=0,a=t.length;n<a;n++){let o=t[n];e.bones.push(o.uuid);let s=i[n];e.boneInverses.push(s.toArray())}return e}};var MM=class extends Jc{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new nr(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},bae=new ye,wae=new ye,Tae=new Xt,tB=new _M,KC=new Vf,SR=class extends sa{constructor(e=new ul,t=new MM){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,i=[0];for(let n=1,a=t.count;n<a;n++)bae.fromBufferAttribute(t,n-1),wae.fromBufferAttribute(t,n),i[n]=i[n-1],i[n]+=bae.distanceTo(wae);e.setAttribute("lineDistance",new Bn(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let i=this.geometry,n=this.matrixWorld,a=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),KC.copy(i.boundingSphere),KC.applyMatrix4(n),KC.radius+=a,e.ray.intersectsSphere(KC)===!1)return;Tae.copy(n).invert(),tB.copy(e.ray).applyMatrix4(Tae);let s=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,u=new ye,c=new ye,h=new ye,f=new ye,p=this.isLineSegments?2:1,d=i.index,m=i.attributes.position;if(d!==null){let v=Math.max(0,o.start),_=Math.min(d.count,o.start+o.count);for(let y=v,x=_-1;y<x;y+=p){let M=d.getX(y),S=d.getX(y+1);if(u.fromBufferAttribute(m,M),c.fromBufferAttribute(m,S),tB.distanceSqToSegment(u,c,f,h)>l)continue;f.applyMatrix4(this.matrixWorld);let T=e.ray.origin.distanceTo(f);T<e.near||T>e.far||t.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{let v=Math.max(0,o.start),_=Math.min(m.count,o.start+o.count);for(let y=v,x=_-1;y<x;y+=p){if(u.fromBufferAttribute(m,y),c.fromBufferAttribute(m,y+1),tB.distanceSqToSegment(u,c,f,h)>l)continue;f.applyMatrix4(this.matrixWorld);let S=e.ray.origin.distanceTo(f);S<e.near||S>e.far||t.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=n.length;a<o;a++){let s=n[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=a}}}}};var MR=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],i,n=this.getPoint(0),a=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),a+=i.distanceTo(n),t.push(a),n=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let i=this.getLengths(),n=0,a=i.length,o;t?o=t:o=e*i[a-1];let s=0,l=a-1,u;for(;s<=l;)if(n=Math.floor(s+(l-s)/2),u=i[n]-o,u<0)s=n+1;else if(u>0)l=n-1;else{l=n;break}if(n=l,i[n]===o)return n/(a-1);let c=i[n],f=i[n+1]-c,p=(o-c)/f;return(n+p)/(a-1)}getTangent(e,t){let n=e-1e-4,a=e+1e-4;n<0&&(n=0),a>1&&(a=1);let o=this.getPoint(n),s=this.getPoint(a),l=t||(o.isVector2?new xr:new ye);return l.copy(s).sub(o).normalize(),l}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new ye,n=[],a=[],o=[],s=new ye,l=new Xt;for(let p=0;p<=e;p++){let d=p/e;n[p]=this.getTangentAt(d,new ye)}a[0]=new ye,o[0]=new ye;let u=Number.MAX_VALUE,c=Math.abs(n[0].x),h=Math.abs(n[0].y),f=Math.abs(n[0].z);c<=u&&(u=c,i.set(1,0,0)),h<=u&&(u=h,i.set(0,1,0)),f<=u&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),a[0].crossVectors(n[0],s),o[0].crossVectors(n[0],a[0]);for(let p=1;p<=e;p++){if(a[p]=a[p-1].clone(),o[p]=o[p-1].clone(),s.crossVectors(n[p-1],n[p]),s.length()>Number.EPSILON){s.normalize();let d=Math.acos(zn(n[p-1].dot(n[p]),-1,1));a[p].applyMatrix4(l.makeRotationAxis(s,d))}o[p].crossVectors(n[p],a[p])}if(t===!0){let p=Math.acos(zn(a[0].dot(a[e]),-1,1));p/=e,n[0].dot(s.crossVectors(a[0],a[e]))>0&&(p=-p);for(let d=1;d<=e;d++)a[d].applyMatrix4(l.makeRotationAxis(n[d],p*d)),o[d].crossVectors(n[d],a[d])}return{tangents:n,normals:a,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}};var NPe={triangulate:function(r,e,t=2){let i=e&&e.length,n=i?e[0]*t:r.length,a=Jae(r,0,n,t,!0),o=[];if(!a||a.next===a.prev)return o;let s,l,u,c,h,f,p;if(i&&(a=BPe(r,e,a,t)),r.length>80*t){s=u=r[0],l=c=r[1];for(let d=t;d<n;d+=t)h=r[d],f=r[d+1],h<s&&(s=h),f<l&&(l=f),h>u&&(u=h),f>c&&(c=f);p=Math.max(u-s,c-l),p=p!==0?32767/p:0}return bM(a,o,t,s,l,p,0),o}};function Jae(r,e,t,i,n){let a,o;if(n===KPe(r,e,t,i)>0)for(a=e;a<t;a+=i)o=Eae(a,r[a],r[a+1],o);else for(a=t-i;a>=e;a-=i)o=Eae(a,r[a],r[a+1],o);return o&&FR(o,o.next)&&(TM(o),o=o.next),o}function $d(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=!1,!t.steiner&&(FR(t,t.next)||wi(t.prev,t,t.next)===0)){if(TM(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function bM(r,e,t,i,n,a,o){if(!r)return;!o&&a&&WPe(r,i,n,a);let s=r,l,u;for(;r.prev!==r.next;){if(l=r.prev,u=r.next,a?OPe(r,i,n,a):UPe(r)){e.push(l.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),TM(r),r=u.next,s=u.next;continue}if(r=u,r===s){o?o===1?(r=zPe($d(r),e,t),bM(r,e,t,i,n,a,2)):o===2&&FPe(r,e,t,i,n,a):bM($d(r),e,t,i,n,a,1);break}}}function UPe(r){let e=r.prev,t=r,i=r.next;if(wi(e,t,i)>=0)return!1;let n=e.x,a=t.x,o=i.x,s=e.y,l=t.y,u=i.y,c=n<a?n<o?n:o:a<o?a:o,h=s<l?s<u?s:u:l<u?l:u,f=n>a?n>o?n:o:a>o?a:o,p=s>l?s>u?s:u:l>u?l:u,d=i.next;for(;d!==e;){if(d.x>=c&&d.x<=f&&d.y>=h&&d.y<=p&&e0(n,s,a,l,o,u,d.x,d.y)&&wi(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function OPe(r,e,t,i){let n=r.prev,a=r,o=r.next;if(wi(n,a,o)>=0)return!1;let s=n.x,l=a.x,u=o.x,c=n.y,h=a.y,f=o.y,p=s<l?s<u?s:u:l<u?l:u,d=c<h?c<f?c:f:h<f?h:f,g=s>l?s>u?s:u:l>u?l:u,m=c>h?c>f?c:f:h>f?h:f,v=CB(p,d,e,t,i),_=CB(g,m,e,t,i),y=r.prevZ,x=r.nextZ;for(;y&&y.z>=v&&x&&x.z<=_;){if(y.x>=p&&y.x<=g&&y.y>=d&&y.y<=m&&y!==n&&y!==o&&e0(s,c,l,h,u,f,y.x,y.y)&&wi(y.prev,y,y.next)>=0||(y=y.prevZ,x.x>=p&&x.x<=g&&x.y>=d&&x.y<=m&&x!==n&&x!==o&&e0(s,c,l,h,u,f,x.x,x.y)&&wi(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;y&&y.z>=v;){if(y.x>=p&&y.x<=g&&y.y>=d&&y.y<=m&&y!==n&&y!==o&&e0(s,c,l,h,u,f,y.x,y.y)&&wi(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;x&&x.z<=_;){if(x.x>=p&&x.x<=g&&x.y>=d&&x.y<=m&&x!==n&&x!==o&&e0(s,c,l,h,u,f,x.x,x.y)&&wi(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function zPe(r,e,t){let i=r;do{let n=i.prev,a=i.next.next;!FR(n,a)&&$ae(n,i,i.next,a)&&wM(n,a)&&wM(a,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(a.i/t|0),TM(i),TM(i.next),i=r=a),i=i.next}while(i!==r);return $d(i)}function FPe(r,e,t,i,n,a){let o=r;do{let s=o.next.next;for(;s!==o.prev;){if(o.i!==s.i&&qPe(o,s)){let l=Qae(o,s);o=$d(o,o.next),l=$d(l,l.next),bM(o,e,t,i,n,a,0),bM(l,e,t,i,n,a,0);return}s=s.next}o=o.next}while(o!==r)}function BPe(r,e,t,i){let n=[],a,o,s,l,u;for(a=0,o=e.length;a<o;a++)s=e[a]*i,l=a<o-1?e[a+1]*i:r.length,u=Jae(r,s,l,i,!1),u===u.next&&(u.steiner=!0),n.push(YPe(u));for(n.sort(kPe),a=0;a<n.length;a++)t=VPe(n[a],t);return t}function kPe(r,e){return r.x-e.x}function VPe(r,e){let t=GPe(r,e);if(!t)return e;let i=Qae(t,r);return $d(i,i.next),$d(t,t.next)}function GPe(r,e){let t=e,i=-1/0,n,a=r.x,o=r.y;do{if(o<=t.y&&o>=t.next.y&&t.next.y!==t.y){let f=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=a&&f>i&&(i=f,n=t.x<t.next.x?t:t.next,f===a))return n}t=t.next}while(t!==e);if(!n)return null;let s=n,l=n.x,u=n.y,c=1/0,h;t=n;do a>=t.x&&t.x>=l&&a!==t.x&&e0(o<u?a:i,o,l,u,o<u?i:a,o,t.x,t.y)&&(h=Math.abs(o-t.y)/(a-t.x),wM(t,r)&&(h<c||h===c&&(t.x>n.x||t.x===n.x&&HPe(n,t)))&&(n=t,c=h)),t=t.next;while(t!==s);return n}function HPe(r,e){return wi(r.prev,r,e.prev)<0&&wi(e.next,r,r.next)<0}function WPe(r,e,t,i){let n=r;do n.z===0&&(n.z=CB(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,XPe(n)}function XPe(r){let e,t,i,n,a,o,s,l,u=1;do{for(t=r,r=null,a=null,o=0;t;){for(o++,i=t,s=0,e=0;e<u&&(s++,i=i.nextZ,!!i);e++);for(l=u;s>0||l>0&&i;)s!==0&&(l===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,s--):(n=i,i=i.nextZ,l--),a?a.nextZ=n:r=n,n.prevZ=a,a=n;t=i}a.nextZ=null,u*=2}while(o>1);return r}function CB(r,e,t,i,n){return r=(r-t)*n|0,e=(e-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function YPe(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function e0(r,e,t,i,n,a,o,s){return(n-o)*(e-s)>=(r-o)*(a-s)&&(r-o)*(i-s)>=(t-o)*(e-s)&&(t-o)*(a-s)>=(n-o)*(i-s)}function qPe(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!ZPe(r,e)&&(wM(r,e)&&wM(e,r)&&jPe(r,e)&&(wi(r.prev,r,e.prev)||wi(r,e.prev,e))||FR(r,e)&&wi(r.prev,r,r.next)>0&&wi(e.prev,e,e.next)>0)}function wi(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function FR(r,e){return r.x===e.x&&r.y===e.y}function $ae(r,e,t,i){let n=$C(wi(r,e,t)),a=$C(wi(r,e,i)),o=$C(wi(t,i,r)),s=$C(wi(t,i,e));return!!(n!==a&&o!==s||n===0&&JC(r,t,e)||a===0&&JC(r,i,e)||o===0&&JC(t,r,i)||s===0&&JC(t,e,i))}function JC(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function $C(r){return r>0?1:r<0?-1:0}function ZPe(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&$ae(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function wM(r,e){return wi(r.prev,r,r.next)<0?wi(r,e,r.next)>=0&&wi(r,r.prev,e)>=0:wi(r,e,r.prev)<0||wi(r,r.next,e)<0}function jPe(r,e){let t=r,i=!1,n=(r.x+e.x)/2,a=(r.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&n<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function Qae(r,e){let t=new RB(r.i,r.x,r.y),i=new RB(e.i,e.x,e.y),n=r.next,a=e.prev;return r.next=e,e.prev=r,t.next=n,n.prev=t,i.next=t,t.prev=i,a.next=i,i.prev=a,i}function Eae(r,e,t,i){let n=new RB(r,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function TM(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function RB(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function KPe(r,e,t,i){let n=0;for(let a=e,o=t-i;a<t;a+=i)n+=(r[o]-r[a])*(r[a+1]+r[o+1]),o=a;return n}var bR=class r{static area(e){let t=e.length,i=0;for(let n=t-1,a=0;a<t;n=a++)i+=e[n].x*e[a].y-e[a].x*e[n].y;return i*.5}static isClockWise(e){return r.area(e)<0}static triangulateShape(e,t){let i=[],n=[],a=[];Aae(e),Cae(i,e);let o=e.length;t.forEach(Aae);for(let l=0;l<t.length;l++)n.push(o),o+=t[l].length,Cae(i,t[l]);let s=NPe.triangulate(i,n);for(let l=0;l<s.length;l+=3)a.push(s.slice(l,l+3));return a}};function Aae(r){let e=r.length;e>2&&r[e-1].equals(r[0])&&r.pop()}function Cae(r,e){for(let t=0;t<e.length;t++)r.push(e[t].x),r.push(e[t].y)}var p0=class extends Jc{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new nr(16777215),this.specular=new nr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new nr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=HB,this.normalScale=new xr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Vn,this.combine=NR,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}};var wR=class extends Jc{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new nr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new nr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=HB,this.normalScale=new xr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Vn,this.combine=NR,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}};function QC(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function JPe(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function $Pe(r){function e(n,a){return r[n]-r[a]}let t=r.length,i=new Array(t);for(let n=0;n!==t;++n)i[n]=n;return i.sort(e),i}function Rae(r,e,t){let i=r.length,n=new r.constructor(i);for(let a=0,o=0;o!==i;++a){let s=t[a]*e;for(let l=0;l!==e;++l)n[o++]=r[s+l]}return n}function eoe(r,e,t,i){let n=1,a=r[0];for(;a!==void 0&&a[i]===void 0;)a=r[n++];if(a===void 0)return;let o=a[i];if(o!==void 0)if(Array.isArray(o))do o=a[i],o!==void 0&&(e.push(a.time),t.push.apply(t,o)),a=r[n++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[i],o!==void 0&&(e.push(a.time),o.toArray(t,t.length)),a=r[n++];while(a!==void 0);else do o=a[i],o!==void 0&&(e.push(a.time),t.push(o)),a=r[n++];while(a!==void 0)}var d0=class{constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=n!==void 0?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,n=t[i],a=t[i-1];e:{t:{let o;r:{i:if(!(e<n)){for(let s=i+2;;){if(n===void 0){if(e<a)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===s)break;if(a=n,n=t[++i],e<n)break t}o=t.length;break r}if(!(e>=a)){let s=t[1];e<s&&(i=2,a=s);for(let l=i-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(n=a,a=t[--i-1],e>=a)break t}o=i,i=0;break r}break e}for(;i<o;){let s=i+o>>>1;e<t[s]?o=s:i=s+1}if(n=t[i],a=t[i-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,a,n)}return this.interpolate_(i,a,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,a=e*n;for(let o=0;o!==n;++o)t[o]=i[a+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},LB=class extends d0{constructor(e,t,i,n){super(e,t,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Tne,endingEnd:Tne}}intervalChanged_(e,t,i){let n=this.parameterPositions,a=e-2,o=e+1,s=n[a],l=n[o];if(s===void 0)switch(this.getSettings_().endingStart){case Ene:a=e,s=2*t-i;break;case Ane:a=n.length-2,s=t+n[a]-n[a+1];break;default:a=e,s=i}if(l===void 0)switch(this.getSettings_().endingEnd){case Ene:o=e,l=2*i-t;break;case Ane:o=1,l=i+n[1]-n[0];break;default:o=e-1,l=t}let u=(i-t)*.5,c=this.valueSize;this._weightPrev=u/(t-s),this._weightNext=u/(l-i),this._offsetPrev=a*c,this._offsetNext=o*c}interpolate_(e,t,i,n){let a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,u=l-s,c=this._offsetPrev,h=this._offsetNext,f=this._weightPrev,p=this._weightNext,d=(i-t)/(n-t),g=d*d,m=g*d,v=-f*m+2*f*g-f*d,_=(1+f)*m+(-1.5-2*f)*g+(-.5+f)*d+1,y=(-1-p)*m+(1.5+p)*g+.5*d,x=p*m-p*g;for(let M=0;M!==s;++M)a[M]=v*o[c+M]+_*o[u+M]+y*o[l+M]+x*o[h+M];return a}},DB=class extends d0{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,u=l-s,c=(i-t)/(n-t),h=1-c;for(let f=0;f!==s;++f)a[f]=o[u+f]*h+o[l+f]*c;return a}},PB=class extends d0{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e){return this.copySampleValue_(e-1)}},cl=class{constructor(e,t,i,n){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=QC(t,this.TimeBufferType),this.values=QC(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:QC(e.times,Array),values:QC(e.values,Array)};let n=e.getInterpolation();n!==e.DefaultInterpolation&&(i.interpolation=n)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new PB(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new DB(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new LB(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case tR:t=this.InterpolantFactoryMethodDiscrete;break;case rR:t=this.InterpolantFactoryMethodLinear;break;case CF:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return tR;case this.InterpolantFactoryMethodLinear:return rR;case this.InterpolantFactoryMethodSmooth:return CF}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]*=e}return this}trim(e,t){let i=this.times,n=i.length,a=0,o=n-1;for(;a!==n&&i[a]<e;)++a;for(;o!==-1&&i[o]>t;)--o;if(++o,a!==0||o!==n){a>=o&&(o=Math.max(o,1),a=o-1);let s=this.getValueSize();this.times=i.slice(a,o),this.values=this.values.slice(a*s,o*s)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,n=this.values,a=i.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let s=0;s!==a;s++){let l=i[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,o),e=!1;break}o=l}if(n!==void 0&&JPe(n))for(let s=0,l=n.length;s!==l;++s){let u=n[s];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,u),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),n=this.getInterpolation()===CF,a=e.length-1,o=1;for(let s=1;s<a;++s){let l=!1,u=e[s],c=e[s+1];if(u!==c&&(s!==1||u!==e[0]))if(n)l=!0;else{let h=s*i,f=h-i,p=h+i;for(let d=0;d!==i;++d){let g=t[h+d];if(g!==t[f+d]||g!==t[p+d]){l=!0;break}}}if(l){if(s!==o){e[o]=e[s];let h=s*i,f=o*i;for(let p=0;p!==i;++p)t[f+p]=t[h+p]}++o}}if(a>0){e[o]=e[a];for(let s=a*i,l=o*i,u=0;u!==i;++u)t[l+u]=t[s+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),i=this.constructor,n=new i(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}};cl.prototype.TimeBufferType=Float32Array;cl.prototype.ValueBufferType=Float32Array;cl.prototype.DefaultInterpolation=rR;var Gf=class extends cl{};Gf.prototype.ValueTypeName="bool";Gf.prototype.ValueBufferType=Array;Gf.prototype.DefaultInterpolation=tR;Gf.prototype.InterpolantFactoryMethodLinear=void 0;Gf.prototype.InterpolantFactoryMethodSmooth=void 0;var TR=class extends cl{};TR.prototype.ValueTypeName="color";var Hf=class extends cl{};Hf.prototype.ValueTypeName="number";var IB=class extends d0{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=(i-t)/(n-t),u=e*s;for(let c=u+s;u!==c;u+=4)kn.slerpFlat(a,0,o,u-s,o,u,l);return a}},Yu=class extends cl{InterpolantFactoryMethodLinear(e){return new IB(this.times,this.values,this.getValueSize(),e)}};Yu.prototype.ValueTypeName="quaternion";Yu.prototype.DefaultInterpolation=rR;Yu.prototype.InterpolantFactoryMethodSmooth=void 0;var Wf=class extends cl{};Wf.prototype.ValueTypeName="string";Wf.prototype.ValueBufferType=Array;Wf.prototype.DefaultInterpolation=tR;Wf.prototype.InterpolantFactoryMethodLinear=void 0;Wf.prototype.InterpolantFactoryMethodSmooth=void 0;var Xf=class extends cl{};Xf.prototype.ValueTypeName="vector";var ER=class{constructor(e,t=-1,i,n=uCe){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=qf(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,n=1/(e.fps||1);for(let o=0,s=i.length;o!==s;++o)t.push(eIe(i[o]).scale(n));let a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){let t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,o=i.length;a!==o;++a)t.push(cl.toJSON(i[a]));return n}static CreateFromMorphTargetSequence(e,t,i,n){let a=t.length,o=[];for(let s=0;s<a;s++){let l=[],u=[];l.push((s+a-1)%a,s,(s+1)%a),u.push(0,1,0);let c=$Pe(l);l=Rae(l,1,c),u=Rae(u,1,c),!n&&l[0]===0&&(l.push(a),u.push(u[0])),o.push(new Hf(".morphTargetInfluences["+t[s].name+"]",l,u).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){let n=e;i=n.geometry&&n.geometry.animations||n.animations}for(let n=0;n<i.length;n++)if(i[n].name===t)return i[n];return null}static CreateClipsFromMorphTargetSequences(e,t,i){let n={},a=/^([\w-]*?)([\d]+)$/;for(let s=0,l=e.length;s<l;s++){let u=e[s],c=u.name.match(a);if(c&&c.length>1){let h=c[1],f=n[h];f||(n[h]=f=[]),f.push(u)}}let o=[];for(let s in n)o.push(this.CreateFromMorphTargetSequence(s,n[s],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(h,f,p,d,g){if(p.length!==0){let m=[],v=[];eoe(p,m,v,d),m.length!==0&&g.push(new h(f,m,v))}},n=[],a=e.name||"default",o=e.fps||30,s=e.blendMode,l=e.length||-1,u=e.hierarchy||[];for(let h=0;h<u.length;h++){let f=u[h].keys;if(!(!f||f.length===0))if(f[0].morphTargets){let p={},d;for(d=0;d<f.length;d++)if(f[d].morphTargets)for(let g=0;g<f[d].morphTargets.length;g++)p[f[d].morphTargets[g]]=-1;for(let g in p){let m=[],v=[];for(let _=0;_!==f[d].morphTargets.length;++_){let y=f[d];m.push(y.time),v.push(y.morphTarget===g?1:0)}n.push(new Hf(".morphTargetInfluence["+g+"]",m,v))}l=p.length*o}else{let p=".bones["+t[h].name+"]";i(Xf,p+".position",f,"pos",n),i(Yu,p+".quaternion",f,"rot",n),i(Xf,p+".scale",f,"scl",n)}}return n.length===0?null:new this(a,l,n,s)}resetDuration(){let e=this.tracks,t=0;for(let i=0,n=e.length;i!==n;++i){let a=this.tracks[i];t=Math.max(t,a.times[a.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}};function QPe(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Hf;case"vector":case"vector2":case"vector3":case"vector4":return Xf;case"color":return TR;case"quaternion":return Yu;case"bool":case"boolean":return Gf;case"string":return Wf}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function eIe(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=QPe(r.type);if(r.times===void 0){let t=[],i=[];eoe(r.keys,t,i,"value"),r.times=t,r.values=i}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}var AR={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}},NB=class{constructor(e,t,i){let n=this,a=!1,o=0,s=0,l,u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(c){s++,a===!1&&n.onStart!==void 0&&n.onStart(c,o,s),a=!0},this.itemEnd=function(c){o++,n.onProgress!==void 0&&n.onProgress(c,o,s),o===s&&(a=!1,n.onLoad!==void 0&&n.onLoad())},this.itemError=function(c){n.onError!==void 0&&n.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,h){return u.push(c,h),this},this.removeHandler=function(c){let h=u.indexOf(c);return h!==-1&&u.splice(h,2),this},this.getHandler=function(c){for(let h=0,f=u.length;h<f;h+=2){let p=u[h],d=u[h+1];if(p.global&&(p.lastIndex=0),p.test(c))return d}return null}}},tIe=new NB,Qd=(()=>{class r{constructor(t){this.manager=t!==void 0?t:tIe,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,i){let n=this;return new Promise(function(a,o){n.load(t,a,i,o)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}return r.DEFAULT_MATERIAL_NAME="__DEFAULT",r})(),Wc={},UB=class extends Error{constructor(e,t){super(e),this.response=t}},CR=class extends Qd{constructor(e){super(e)}load(e,t,i,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let a=AR.get(e);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0),a;if(Wc[e]!==void 0){Wc[e].push({onLoad:t,onProgress:i,onError:n});return}Wc[e]=[],Wc[e].push({onLoad:t,onProgress:i,onError:n});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;let c=Wc[e],h=u.body.getReader(),f=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),p=f?parseInt(f):0,d=p!==0,g=0,m=new ReadableStream({start(v){_();function _(){h.read().then(({done:y,value:x})=>{if(y)v.close();else{g+=x.byteLength;let M=new ProgressEvent("progress",{lengthComputable:d,loaded:g,total:p});for(let S=0,w=c.length;S<w;S++){let T=c[S];T.onProgress&&T.onProgress(M)}v.enqueue(x),_()}})}}});return new Response(m)}else throw new UB(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,s));case"json":return u.json();default:if(s===void 0)return u.text();{let h=/charset="?([^;"\s]*)"?/i.exec(s),f=h&&h[1]?h[1].toLowerCase():void 0,p=new TextDecoder(f);return u.arrayBuffer().then(d=>p.decode(d))}}}).then(u=>{AR.add(e,u);let c=Wc[e];delete Wc[e];for(let h=0,f=c.length;h<f;h++){let p=c[h];p.onLoad&&p.onLoad(u)}}).catch(u=>{let c=Wc[e];if(c===void 0)throw this.manager.itemError(e),u;delete Wc[e];for(let h=0,f=c.length;h<f;h++){let p=c[h];p.onError&&p.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}};var OB=class extends Qd{constructor(e){super(e)}load(e,t,i,n){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let a=this,o=AR.get(e);if(o!==void 0)return a.manager.itemStart(e),setTimeout(function(){t&&t(o),a.manager.itemEnd(e)},0),o;let s=yM("img");function l(){c(),AR.add(e,this),t&&t(this),a.manager.itemEnd(e)}function u(h){c(),n&&n(h),a.manager.itemError(e),a.manager.itemEnd(e)}function c(){s.removeEventListener("load",l,!1),s.removeEventListener("error",u,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),a.manager.itemStart(e),s.src=e,s}};var RR=class extends Qd{constructor(e){super(e)}load(e,t,i,n){let a=new _s,o=new OB(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(s){a.image=s,a.needsUpdate=!0,t!==void 0&&t(a)},i,n),a}},m0=class extends sa{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new nr(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}};var rB=new Xt,Lae=new ye,Dae=new ye,EM=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xr(512,512),this.map=null,this.mapPass=null,this.matrix=new Xt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new SM,this._frameExtents=new xr(1,1),this._viewportCount=1,this._viewports=[new Ur(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;Lae.setFromMatrixPosition(e.matrixWorld),t.position.copy(Lae),Dae.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Dae),t.updateMatrixWorld(),rB.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(rB),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(rB)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},zB=class extends EM{constructor(){super(new Fn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,i=l0*2*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,a=e.distance||t.far;(i!==t.fov||n!==t.aspect||a!==t.far)&&(t.fov=i,t.aspect=n,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},LR=class extends m0{constructor(e,t,i=0,n=Math.PI/3,a=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(sa.DEFAULT_UP),this.updateMatrix(),this.target=new sa,this.distance=i,this.angle=n,this.penumbra=a,this.decay=o,this.map=null,this.shadow=new zB}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},Pae=new Xt,fM=new ye,iB=new ye,FB=class extends EM{constructor(){super(new Fn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new xr(4,2),this._viewportCount=6,this._viewports=[new Ur(2,1,1,1),new Ur(0,1,1,1),new Ur(3,1,1,1),new Ur(1,1,1,1),new Ur(3,0,1,1),new Ur(1,0,1,1)],this._cubeDirections=[new ye(1,0,0),new ye(-1,0,0),new ye(0,0,1),new ye(0,0,-1),new ye(0,1,0),new ye(0,-1,0)],this._cubeUps=[new ye(0,1,0),new ye(0,1,0),new ye(0,1,0),new ye(0,1,0),new ye(0,0,1),new ye(0,0,-1)]}updateMatrices(e,t=0){let i=this.camera,n=this.matrix,a=e.distance||i.far;a!==i.far&&(i.far=a,i.updateProjectionMatrix()),fM.setFromMatrixPosition(e.matrixWorld),i.position.copy(fM),iB.copy(i.position),iB.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(iB),i.updateMatrixWorld(),n.makeTranslation(-fM.x,-fM.y,-fM.z),Pae.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Pae)}},AM=class extends m0{constructor(e,t,i=0,n=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new FB}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},BB=class extends EM{constructor(){super(new h0(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},DR=class extends m0{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(sa.DEFAULT_UP),this.updateMatrix(),this.target=new sa,this.shadow=new BB}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},PR=class extends m0{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}};var IR=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,n=e.length;i<n;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}};var qB="\\[\\]\\.:\\/",rIe=new RegExp("["+qB+"]","g"),ZB="[^"+qB+"]",iIe="[^"+qB.replace("\\.","")+"]",nIe=/((?:WC+[\/:])*)/.source.replace("WC",ZB),aIe=/(WCOD+)?/.source.replace("WCOD",iIe),oIe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ZB),sIe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ZB),lIe=new RegExp("^"+nIe+aIe+oIe+sIe+"$"),uIe=["material","materials","bones","map"],kB=class{constructor(e,t,i){let n=i||si.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];n!==void 0&&n.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,a=i.length;n!==a;++n)i[n].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},si=(()=>{class r{constructor(t,i,n){this.path=i,this.parsedPath=n||r.parseTrackName(i),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,i,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,i,n):new r(t,i,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(rIe,"")}static parseTrackName(t){let i=lIe.exec(t);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},a=n.nodeName&&n.nodeName.lastIndexOf(".");if(a!==void 0&&a!==-1){let o=n.nodeName.substring(a+1);uIe.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,a),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,i){if(i===void 0||i===""||i==="."||i===-1||i===t.name||i===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(i);if(n!==void 0)return n}if(t.children){let n=function(o){for(let s=0;s<o.length;s++){let l=o[s];if(l.name===i||l.uuid===i)return l;let u=n(l.children);if(u)return u}return null},a=n(t.children);if(a)return a}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,i){t[i]=this.targetObject[this.propertyName]}_getValue_array(t,i){let n=this.resolvedProperty;for(let a=0,o=n.length;a!==o;++a)t[i++]=n[a]}_getValue_arrayElement(t,i){t[i]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,i){this.resolvedProperty.toArray(t,i)}_setValue_direct(t,i){this.targetObject[this.propertyName]=t[i]}_setValue_direct_setNeedsUpdate(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,i){let n=this.resolvedProperty;for(let a=0,o=n.length;a!==o;++a)n[a]=t[i++]}_setValue_array_setNeedsUpdate(t,i){let n=this.resolvedProperty;for(let a=0,o=n.length;a!==o;++a)n[a]=t[i++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,i){let n=this.resolvedProperty;for(let a=0,o=n.length;a!==o;++a)n[a]=t[i++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,i){this.resolvedProperty[this.propertyIndex]=t[i]}_setValue_arrayElement_setNeedsUpdate(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,i){this.resolvedProperty.fromArray(t,i)}_setValue_fromArray_setNeedsUpdate(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,i){this.bind(),this.getValue(t,i)}_setValue_unbound(t,i){this.bind(),this.setValue(t,i)}bind(){let t=this.node,i=this.parsedPath,n=i.objectName,a=i.propertyName,o=i.propertyIndex;if(t||(t=r.findNode(this.rootNode,i.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=i.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let h=0;h<t.length;h++)if(t[h].name===c){c=h;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let s=t[a];if(s===void 0){let c=i.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+a+" but it wasn't found.",t);return}let l=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(o!==void 0){if(a==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[o]!==void 0&&(o=t.morphTargetDictionary[o])}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=o}else s.fromArray!==void 0&&s.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=a;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}return r.Composite=kB,r})();si.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};si.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};si.prototype.GetterByBindingType=[si.prototype._getValue_direct,si.prototype._getValue_array,si.prototype._getValue_arrayElement,si.prototype._getValue_toArray];si.prototype.SetterByBindingTypeAndVersioning=[[si.prototype._setValue_direct,si.prototype._setValue_direct_setNeedsUpdate,si.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[si.prototype._setValue_array,si.prototype._setValue_array_setNeedsUpdate,si.prototype._setValue_array_setMatrixWorldNeedsUpdate],[si.prototype._setValue_arrayElement,si.prototype._setValue_arrayElement_setNeedsUpdate,si.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[si.prototype._setValue_fromArray,si.prototype._setValue_fromArray_setNeedsUpdate,si.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var dPt=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:VB}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=VB);var toe=function(r){return URL.createObjectURL(new Blob([r],{type:"text/javascript"}))},cIe=function(r){return new Worker(r)};try{URL.revokeObjectURL(toe(""))}catch{toe=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},cIe=function(e){return new Worker(e,{type:"module"})}}var hl=Uint8Array,Zf=Uint16Array,JB=Uint32Array,roe=new hl([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ioe=new hl([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),hIe=new hl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),noe=function(r,e){for(var t=new Zf(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];for(var n=new JB(t[30]),i=1;i<30;++i)for(var a=t[i];a<t[i+1];++a)n[a]=a-t[i]<<5|i;return[t,n]},aoe=noe(roe,2),ooe=aoe[0],fIe=aoe[1];ooe[28]=258,fIe[258]=28;var soe=noe(ioe,0),pIe=soe[0],gPt=soe[1],$B=new Zf(32768);for(Vr=0;Vr<32768;++Vr)$c=(Vr&43690)>>>1|(Vr&21845)<<1,$c=($c&52428)>>>2|($c&13107)<<2,$c=($c&61680)>>>4|($c&3855)<<4,$B[Vr]=(($c&65280)>>>8|($c&255)<<8)>>>1;var $c,Vr,CM=function(r,e,t){for(var i=r.length,n=0,a=new Zf(e);n<i;++n)++a[r[n]-1];var o=new Zf(e);for(n=0;n<e;++n)o[n]=o[n-1]+a[n-1]<<1;var s;if(t){s=new Zf(1<<e);var l=15-e;for(n=0;n<i;++n)if(r[n])for(var u=n<<4|r[n],c=e-r[n],h=o[r[n]-1]++<<c,f=h|(1<<c)-1;h<=f;++h)s[$B[h]>>>l]=u}else for(s=new Zf(i),n=0;n<i;++n)r[n]&&(s[n]=$B[o[r[n]-1]++]>>>15-r[n]);return s},RM=new hl(288);for(Vr=0;Vr<144;++Vr)RM[Vr]=8;var Vr;for(Vr=144;Vr<256;++Vr)RM[Vr]=9;var Vr;for(Vr=256;Vr<280;++Vr)RM[Vr]=7;var Vr;for(Vr=280;Vr<288;++Vr)RM[Vr]=8;var Vr,loe=new hl(32);for(Vr=0;Vr<32;++Vr)loe[Vr]=5;var Vr;var dIe=CM(RM,9,1);var mIe=CM(loe,5,1),jB=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},tu=function(r,e,t){var i=e/8|0;return(r[i]|r[i+1]<<8)>>(e&7)&t},KB=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},vIe=function(r){return(r/8|0)+(r&7&&1)},gIe=function(r,e,t){(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof Zf?Zf:r instanceof JB?JB:hl)(t-e);return i.set(r.subarray(e,t)),i},yIe=function(r,e,t){var i=r.length;if(!i||t&&!t.l&&i<5)return e||new hl(0);var n=!e||t,a=!t||t.i;t||(t={}),e||(e=new hl(i*3));var o=function(ae){var ve=e.length;if(ae>ve){var ue=new hl(Math.max(ve*2,ae));ue.set(e),e=ue}},s=t.f||0,l=t.p||0,u=t.b||0,c=t.l,h=t.d,f=t.m,p=t.n,d=i*8;do{if(!c){t.f=s=tu(r,l,1);var g=tu(r,l+1,3);if(l+=3,g)if(g==1)c=dIe,h=mIe,f=9,p=5;else if(g==2){var y=tu(r,l,31)+257,x=tu(r,l+10,15)+4,M=y+tu(r,l+5,31)+1;l+=14;for(var S=new hl(M),w=new hl(19),T=0;T<x;++T)w[hIe[T]]=tu(r,l+T*3,7);l+=x*3;for(var C=jB(w),b=(1<<C)-1,E=CM(w,C,1),T=0;T<M;){var I=E[tu(r,l,b)];l+=I&15;var m=I>>>4;if(m<16)S[T++]=m;else{var R=0,A=0;for(m==16?(A=3+tu(r,l,3),l+=2,R=S[T-1]):m==17?(A=3+tu(r,l,7),l+=3):m==18&&(A=11+tu(r,l,127),l+=7);A--;)S[T++]=R}}var P=S.subarray(0,y),U=S.subarray(y);f=jB(P),p=jB(U),c=CM(P,f,1),h=CM(U,p,1)}else throw"invalid block type";else{var m=vIe(l)+4,v=r[m-4]|r[m-3]<<8,_=m+v;if(_>i){if(a)throw"unexpected EOF";break}n&&o(u+v),e.set(r.subarray(m,_),u),t.b=u+=v,t.p=l=_*8;continue}if(l>d){if(a)throw"unexpected EOF";break}}n&&o(u+131072);for(var B=(1<<f)-1,z=(1<<p)-1,k=l;;k=l){var R=c[KB(r,l)&B],G=R>>>4;if(l+=R&15,l>d){if(a)throw"unexpected EOF";break}if(!R)throw"invalid length/literal";if(G<256)e[u++]=G;else if(G==256){k=l,c=null;break}else{var Y=G-254;if(G>264){var T=G-257,J=roe[T];Y=tu(r,l,(1<<J)-1)+ooe[T],l+=J}var Q=h[KB(r,l)&z],V=Q>>>4;if(!Q)throw"invalid distance";l+=Q&15;var U=pIe[V];if(V>3){var J=ioe[V];U+=KB(r,l)&(1<<J)-1,l+=J}if(l>d){if(a)throw"unexpected EOF";break}n&&o(u+131072);for(var K=u+Y;u<K;u+=4)e[u]=e[u-U],e[u+1]=e[u+1-U],e[u+2]=e[u+2-U],e[u+3]=e[u+3-U];u=K}}t.l=c,t.p=k,t.b=u,c&&(s=1,t.m=f,t.d=h,t.n=p)}while(!s);return u==e.length?e:gIe(e,0,u)};var _Ie=new hl(0);var xIe=function(r){if((r[0]&15)!=8||r[0]>>>4>7||(r[0]<<8|r[1])%31)throw"invalid zlib data";if(r[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function uoe(r,e){return yIe((xIe(r),r.subarray(2,-4)),e)}var SIe=typeof TextDecoder<"u"&&new TextDecoder,MIe=0;try{SIe.decode(_Ie,{stream:!0}),MIe=1}catch{}function coe(r,e,t){let i=t.length-r-1;if(e>=t[i])return i-1;if(e<=t[r])return r;let n=r,a=i,o=Math.floor((n+a)/2);for(;e<t[o]||e>=t[o+1];)e<t[o]?a=o:n=o,o=Math.floor((n+a)/2);return o}function wIe(r,e,t,i){let n=[],a=[],o=[];n[0]=1;for(let s=1;s<=t;++s){a[s]=e-i[r+1-s],o[s]=i[r+s]-e;let l=0;for(let u=0;u<s;++u){let c=o[u+1],h=a[s-u],f=n[u]/(c+h);n[u]=l+c*f,l=h*f}n[s]=l}return n}function hoe(r,e,t,i){let n=coe(r,i,e),a=wIe(n,i,r,e),o=new Ur(0,0,0,0);for(let s=0;s<=r;++s){let l=t[n-r+s],u=a[s],c=l.w*u;o.x+=l.x*c,o.y+=l.y*c,o.z+=l.z*c,o.w+=l.w*u}return o}function TIe(r,e,t,i,n){let a=[];for(let h=0;h<=t;++h)a[h]=0;let o=[];for(let h=0;h<=i;++h)o[h]=a.slice(0);let s=[];for(let h=0;h<=t;++h)s[h]=a.slice(0);s[0][0]=1;let l=a.slice(0),u=a.slice(0);for(let h=1;h<=t;++h){l[h]=e-n[r+1-h],u[h]=n[r+h]-e;let f=0;for(let p=0;p<h;++p){let d=u[p+1],g=l[h-p];s[h][p]=d+g;let m=s[p][h-1]/s[h][p];s[p][h]=f+d*m,f=g*m}s[h][h]=f}for(let h=0;h<=t;++h)o[0][h]=s[h][t];for(let h=0;h<=t;++h){let f=0,p=1,d=[];for(let g=0;g<=t;++g)d[g]=a.slice(0);d[0][0]=1;for(let g=1;g<=i;++g){let m=0,v=h-g,_=t-g;h>=g&&(d[p][0]=d[f][0]/s[_+1][v],m=d[p][0]*s[v][_]);let y=v>=-1?1:-v,x=h-1<=_?g-1:t-h;for(let S=y;S<=x;++S)d[p][S]=(d[f][S]-d[f][S-1])/s[_+1][v+S],m+=d[p][S]*s[v+S][_];h<=_&&(d[p][g]=-d[f][g-1]/s[_+1][h],m+=d[p][g]*s[h][_]),o[g][h]=m;let M=f;f=p,p=M}}let c=t;for(let h=1;h<=i;++h){for(let f=0;f<=t;++f)o[h][f]*=c;c*=t-h}return o}function EIe(r,e,t,i,n){let a=n<r?n:r,o=[],s=coe(r,i,e),l=TIe(s,i,r,a,e),u=[];for(let c=0;c<t.length;++c){let h=t[c].clone(),f=h.w;h.x*=f,h.y*=f,h.z*=f,u[c]=h}for(let c=0;c<=a;++c){let h=u[s-r].clone().multiplyScalar(l[c][0]);for(let f=1;f<=r;++f)h.add(u[s-r+f].clone().multiplyScalar(l[c][f]));o[c]=h}for(let c=a+1;c<=n+1;++c)o[c]=new Ur(0,0,0);return o}function AIe(r,e){let t=1;for(let n=2;n<=r;++n)t*=n;let i=1;for(let n=2;n<=e;++n)i*=n;for(let n=2;n<=r-e;++n)i*=n;return t/i}function CIe(r){let e=r.length,t=[],i=[];for(let a=0;a<e;++a){let o=r[a];t[a]=new ye(o.x,o.y,o.z),i[a]=o.w}let n=[];for(let a=0;a<e;++a){let o=t[a].clone();for(let s=1;s<=a;++s)o.sub(n[a-s].clone().multiplyScalar(AIe(a,s)*i[s]));n[a]=o.divideScalar(i[0])}return n}function foe(r,e,t,i,n){let a=EIe(r,e,t,i,n);return CIe(a)}var BR=class extends MR{constructor(e,t,i,n,a){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=n||0,this.endKnot=a||this.knots.length-1;for(let o=0;o<i.length;++o){let s=i[o];this.controlPoints[o]=new Ur(s.x,s.y,s.z,s.w)}}getPoint(e,t=new ye){let i=t,n=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),a=hoe(this.degree,this.knots,this.controlPoints,n);return a.w!==1&&a.divideScalar(a.w),i.set(a.x,a.y,a.z)}getTangent(e,t=new ye){let i=t,n=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),a=foe(this.degree,this.knots,this.controlPoints,n,1);return i.copy(a[1]).normalize(),i}};var Sr,zi,Ia,VR=class extends Qd{constructor(e){super(e)}load(e,t,i,n){let a=this,o=a.path===""?IR.extractUrlBase(e):a.path,s=new CR(this.manager);s.setPath(a.path),s.setResponseType("arraybuffer"),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,function(l){try{t(a.parse(l,o))}catch(u){n?n(u):console.error(u),a.manager.itemError(e)}},i,n)}parse(e,t){if(LIe(e))Sr=new ak().parse(e);else{let n=voe(e);if(!DIe(n))throw new Error("THREE.FBXLoader: Unknown format.");if(poe(n)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+poe(n));Sr=new nk().parse(n)}let i=new RR(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new tk(i,this.manager).parse(Sr)}},tk=class{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){zi=this.parseConnections();let e=this.parseImages(),t=this.parseTextures(e),i=this.parseMaterials(t),n=this.parseDeformers(),a=new rk().parse(n);return this.parseScene(n,a,i),Ia}parseConnections(){let e=new Map;return"Connections"in Sr&&Sr.Connections.connections.forEach(function(i){let n=i[0],a=i[1],o=i[2];e.has(n)||e.set(n,{parents:[],children:[]});let s={ID:a,relationship:o};e.get(n).parents.push(s),e.has(a)||e.set(a,{parents:[],children:[]});let l={ID:n,relationship:o};e.get(a).children.push(l)}),e}parseImages(){let e={},t={};if("Video"in Sr.Objects){let i=Sr.Objects.Video;for(let n in i){let a=i[n],o=parseInt(n);if(e[o]=a.RelativeFilename||a.Filename,"Content"in a){let s=a.Content instanceof ArrayBuffer&&a.Content.byteLength>0,l=typeof a.Content=="string"&&a.Content!=="";if(s||l){let u=this.parseImage(i[n]);t[a.RelativeFilename||a.Filename]=u}}}}for(let i in e){let n=e[i];t[n]!==void 0?e[i]=t[n]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){let t=e.Content,i=e.RelativeFilename||e.Filename,n=i.slice(i.lastIndexOf(".")+1).toLowerCase(),a;switch(n){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",i),a="image/tga";break;default:console.warn('FBXLoader: Image type "'+n+'" is not supported.');return}if(typeof t=="string")return"data:"+a+";base64,"+t;{let o=new Uint8Array(t);return window.URL.createObjectURL(new Blob([o],{type:a}))}}parseTextures(e){let t=new Map;if("Texture"in Sr.Objects){let i=Sr.Objects.Texture;for(let n in i){let a=this.parseTexture(i[n],e);t.set(parseInt(n),a)}}return t}parseTexture(e,t){let i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;let n=e.WrapModeU,a=e.WrapModeV,o=n!==void 0?n.value:0,s=a!==void 0?a.value:0;if(i.wrapS=o===0?o0:Ho,i.wrapT=s===0?o0:Ho,"Scaling"in e){let l=e.Scaling.value;i.repeat.x=l[0],i.repeat.y=l[1]}if("Translation"in e){let l=e.Translation.value;i.offset.x=l[0],i.offset.y=l[1]}return i}loadTexture(e,t){let i,n=this.textureLoader.path,a=zi.get(e.id).children;a!==void 0&&a.length>0&&t[a[0].ID]!==void 0&&(i=t[a[0].ID],(i.indexOf("blob:")===0||i.indexOf("data:")===0)&&this.textureLoader.setPath(void 0));let o,s=e.FileName.slice(-3).toLowerCase();if(s==="tga"){let l=this.manager.getHandler(".tga");l===null?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),o=new _s):(l.setPath(this.textureLoader.path),o=l.load(i))}else if(s==="dds"){let l=this.manager.getHandler(".dds");l===null?(console.warn("FBXLoader: DDS loader not found, creating placeholder texture for",e.RelativeFilename),o=new _s):(l.setPath(this.textureLoader.path),o=l.load(i))}else s==="psd"?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),o=new _s):o=this.textureLoader.load(i);return this.textureLoader.setPath(n),o}parseMaterials(e){let t=new Map;if("Material"in Sr.Objects){let i=Sr.Objects.Material;for(let n in i){let a=this.parseMaterial(i[n],e);a!==null&&t.set(parseInt(n),a)}}return t}parseMaterial(e,t){let i=e.id,n=e.attrName,a=e.ShadingModel;if(typeof a=="object"&&(a=a.value),!zi.has(i))return null;let o=this.parseParameters(e,t,i),s;switch(a.toLowerCase()){case"phong":s=new p0;break;case"lambert":s=new wR;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',a),s=new p0;break}return s.setValues(o),s.name=n,s}parseParameters(e,t,i){let n={};e.BumpFactor&&(n.bumpScale=e.BumpFactor.value),e.Diffuse?n.color=new nr().fromArray(e.Diffuse.value).convertSRGBToLinear():e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(n.color=new nr().fromArray(e.DiffuseColor.value).convertSRGBToLinear()),e.DisplacementFactor&&(n.displacementScale=e.DisplacementFactor.value),e.Emissive?n.emissive=new nr().fromArray(e.Emissive.value).convertSRGBToLinear():e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(n.emissive=new nr().fromArray(e.EmissiveColor.value).convertSRGBToLinear()),e.EmissiveFactor&&(n.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(n.opacity=parseFloat(e.Opacity.value)),n.opacity<1&&(n.transparent=!0),e.ReflectionFactor&&(n.reflectivity=e.ReflectionFactor.value),e.Shininess&&(n.shininess=e.Shininess.value),e.Specular?n.specular=new nr().fromArray(e.Specular.value).convertSRGBToLinear():e.SpecularColor&&e.SpecularColor.type==="Color"&&(n.specular=new nr().fromArray(e.SpecularColor.value).convertSRGBToLinear());let a=this;return zi.get(i).children.forEach(function(o){let s=o.relationship;switch(s){case"Bump":n.bumpMap=a.getTexture(t,o.ID);break;case"Maya|TEX_ao_map":n.aoMap=a.getTexture(t,o.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":n.map=a.getTexture(t,o.ID),n.map!==void 0&&(n.map.colorSpace=Pa);break;case"DisplacementColor":n.displacementMap=a.getTexture(t,o.ID);break;case"EmissiveColor":n.emissiveMap=a.getTexture(t,o.ID),n.emissiveMap!==void 0&&(n.emissiveMap.colorSpace=Pa);break;case"NormalMap":case"Maya|TEX_normal_map":n.normalMap=a.getTexture(t,o.ID);break;case"ReflectionColor":n.envMap=a.getTexture(t,o.ID),n.envMap!==void 0&&(n.envMap.mapping=vM,n.envMap.colorSpace=Pa);break;case"SpecularColor":n.specularMap=a.getTexture(t,o.ID),n.specularMap!==void 0&&(n.specularMap.colorSpace=Pa);break;case"TransparentColor":case"TransparencyFactor":n.alphaMap=a.getTexture(t,o.ID),n.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",s);break}}),n}getTexture(e,t){return"LayeredTexture"in Sr.Objects&&t in Sr.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=zi.get(t).children[0].ID),e.get(t)}parseDeformers(){let e={},t={};if("Deformer"in Sr.Objects){let i=Sr.Objects.Deformer;for(let n in i){let a=i[n],o=zi.get(parseInt(n));if(a.attrType==="Skin"){let s=this.parseSkeleton(o,i);s.ID=n,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),s.geometryID=o.parents[0].ID,e[n]=s}else if(a.attrType==="BlendShape"){let s={id:n};s.rawTargets=this.parseMorphTargets(o,i),s.id=n,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[n]=s}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){let i=[];return e.children.forEach(function(n){let a=t[n.ID];if(a.attrType!=="Cluster")return;let o={ID:n.ID,indices:[],weights:[],transformLink:new Xt().fromArray(a.TransformLink.a)};"Indexes"in a&&(o.indices=a.Indexes.a,o.weights=a.Weights.a),i.push(o)}),{rawBones:i,bones:[]}}parseMorphTargets(e,t){let i=[];for(let n=0;n<e.children.length;n++){let a=e.children[n],o=t[a.ID],s={name:o.attrName,initialWeight:o.DeformPercent,id:o.id,fullWeights:o.FullWeights.a};if(o.attrType!=="BlendShapeChannel")return;s.geoID=zi.get(parseInt(a.ID)).children.filter(function(l){return l.relationship===void 0})[0].ID,i.push(s)}return i}parseScene(e,t,i){Ia=new jc;let n=this.parseModels(e.skeletons,t,i),a=Sr.Objects.Model,o=this;n.forEach(function(l){let u=a[l.ID];o.setLookAtProperties(l,u),zi.get(l.ID).parents.forEach(function(h){let f=n.get(h.ID);f!==void 0&&f.add(l)}),l.parent===null&&Ia.add(l)}),this.bindSkeleton(e.skeletons,t,n),this.addGlobalSceneSettings(),Ia.traverse(function(l){if(l.userData.transformData){l.parent&&(l.userData.transformData.parentMatrix=l.parent.matrix,l.userData.transformData.parentMatrixWorld=l.parent.matrixWorld);let u=doe(l.userData.transformData);l.applyMatrix4(u),l.updateWorldMatrix()}});let s=new ik().parse();Ia.children.length===1&&Ia.children[0].isGroup&&(Ia.children[0].animations=s,Ia=Ia.children[0]),Ia.animations=s}parseModels(e,t,i){let n=new Map,a=Sr.Objects.Model;for(let o in a){let s=parseInt(o),l=a[o],u=zi.get(s),c=this.buildSkeleton(u,e,s,l.attrName);if(!c){switch(l.attrType){case"Camera":c=this.createCamera(u);break;case"Light":c=this.createLight(u);break;case"Mesh":c=this.createMesh(u,t,i);break;case"NurbsCurve":c=this.createCurve(u,t);break;case"LimbNode":case"Root":c=new f0;break;case"Null":default:c=new jc;break}c.name=l.attrName?si.sanitizeNodeName(l.attrName):"",c.userData.originalName=l.attrName,c.ID=s}this.getTransformData(c,l),n.set(s,c)}return n}buildSkeleton(e,t,i,n){let a=null;return e.parents.forEach(function(o){for(let s in t){let l=t[s];l.rawBones.forEach(function(u,c){if(u.ID===o.ID){let h=a;a=new f0,a.matrixWorld.copy(u.transformLink),a.name=n?si.sanitizeNodeName(n):"",a.userData.originalName=n,a.ID=i,l.bones[c]=a,h!==null&&a.add(h)}})}}),a}createCamera(e){let t,i;if(e.children.forEach(function(n){let a=Sr.Objects.NodeAttribute[n.ID];a!==void 0&&(i=a)}),i===void 0)t=new sa;else{let n=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(n=1);let a=1;i.NearPlane!==void 0&&(a=i.NearPlane.value/1e3);let o=1e3;i.FarPlane!==void 0&&(o=i.FarPlane.value/1e3);let s=window.innerWidth,l=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(s=i.AspectWidth.value,l=i.AspectHeight.value);let u=s/l,c=45;i.FieldOfView!==void 0&&(c=i.FieldOfView.value);let h=i.FocalLength?i.FocalLength.value:null;switch(n){case 0:t=new Fn(c,u,a,o),h!==null&&t.setFocalLength(h);break;case 1:t=new h0(-s/2,s/2,l/2,-l/2,a,o);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+n+"."),t=new sa;break}}return t}createLight(e){let t,i;if(e.children.forEach(function(n){let a=Sr.Objects.NodeAttribute[n.ID];a!==void 0&&(i=a)}),i===void 0)t=new sa;else{let n;i.LightType===void 0?n=0:n=i.LightType.value;let a=16777215;i.Color!==void 0&&(a=new nr().fromArray(i.Color.value).convertSRGBToLinear());let o=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(o=0);let s=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?s=0:s=i.FarAttenuationEnd.value);let l=1;switch(n){case 0:t=new AM(a,o,s,l);break;case 1:t=new DR(a,o);break;case 2:let u=Math.PI/3;i.InnerAngle!==void 0&&(u=la.degToRad(i.InnerAngle.value));let c=0;i.OuterAngle!==void 0&&(c=la.degToRad(i.OuterAngle.value),c=Math.max(c,1)),t=new LR(a,o,s,u,c,l);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),t=new AM(a,o);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,i){let n,a=null,o=null,s=[];return e.children.forEach(function(l){t.has(l.ID)&&(a=t.get(l.ID)),i.has(l.ID)&&s.push(i.get(l.ID))}),s.length>1?o=s:s.length>0?o=s[0]:(o=new p0({name:Qd.DEFAULT_MATERIAL_NAME,color:13421772}),s.push(o)),"color"in a.attributes&&s.forEach(function(l){l.vertexColors=!0}),a.FBX_Deformer?(n=new _R(a,o),n.normalizeSkinWeights()):n=new Wo(a,o),n}createCurve(e,t){let i=e.children.reduce(function(a,o){return t.has(o.ID)&&(a=t.get(o.ID)),a},null),n=new MM({name:Qd.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new SR(i,n)}getTransformData(e,t){let i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?i.eulerOrder=moe(t.RotationOrder.value):i.eulerOrder="ZYX","Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&zi.get(e.ID).children.forEach(function(n){if(n.relationship==="LookAtProperty"){let a=Sr.Objects.Model[n.ID];if("Lcl_Translation"in a){let o=a.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(o),Ia.add(e.target)):e.lookAt(new ye().fromArray(o))}}})}bindSkeleton(e,t,i){let n=this.parsePoseNodes();for(let a in e){let o=e[a];zi.get(parseInt(o.ID)).parents.forEach(function(l){if(t.has(l.ID)){let u=l.ID;zi.get(u).parents.forEach(function(h){i.has(h.ID)&&i.get(h.ID).bind(new xR(o.bones),n[h.ID])})}})}}parsePoseNodes(){let e={};if("Pose"in Sr.Objects){let t=Sr.Objects.Pose;for(let i in t)if(t[i].attrType==="BindPose"&&t[i].NbPoseNodes>0){let n=t[i].PoseNode;Array.isArray(n)?n.forEach(function(a){e[a.Node]=new Xt().fromArray(a.Matrix.a)}):e[n.Node]=new Xt().fromArray(n.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in Sr){if("AmbientColor"in Sr.GlobalSettings){let e=Sr.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],n=e[2];if(t!==0||i!==0||n!==0){let a=new nr(t,i,n).convertSRGBToLinear();Ia.add(new PR(a,1))}}"UnitScaleFactor"in Sr.GlobalSettings&&(Ia.userData.unitScaleFactor=Sr.GlobalSettings.UnitScaleFactor.value)}}},rk=class{constructor(){this.negativeMaterialIndices=!1}parse(e){let t=new Map;if("Geometry"in Sr.Objects){let i=Sr.Objects.Geometry;for(let n in i){let a=zi.get(parseInt(n)),o=this.parseGeometry(a,i[n],e);t.set(parseInt(n),o)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){let n=i.skeletons,a=[],o=e.parents.map(function(h){return Sr.Objects.Model[h.ID]});if(o.length===0)return;let s=e.children.reduce(function(h,f){return n[f.ID]!==void 0&&(h=n[f.ID]),h},null);e.children.forEach(function(h){i.morphTargets[h.ID]!==void 0&&a.push(i.morphTargets[h.ID])});let l=o[0],u={};"RotationOrder"in l&&(u.eulerOrder=moe(l.RotationOrder.value)),"InheritType"in l&&(u.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(u.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(u.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(u.scale=l.GeometricScaling.value);let c=doe(u);return this.genGeometry(t,s,a,c)}genGeometry(e,t,i,n){let a=new ul;e.attrName&&(a.name=e.attrName);let o=this.parseGeoNode(e,t),s=this.genBuffers(o),l=new Bn(s.vertex,3);if(l.applyMatrix4(n),a.setAttribute("position",l),s.colors.length>0&&a.setAttribute("color",new Bn(s.colors,3)),t&&(a.setAttribute("skinIndex",new u0(s.weightsIndices,4)),a.setAttribute("skinWeight",new Bn(s.vertexWeights,4)),a.FBX_Deformer=t),s.normal.length>0){let u=new vr().getNormalMatrix(n),c=new Bn(s.normal,3);c.applyNormalMatrix(u),a.setAttribute("normal",c)}if(s.uvs.forEach(function(u,c){let h=c===0?"uv":`uv${c}`;a.setAttribute(h,new Bn(s.uvs[c],2))}),o.material&&o.material.mappingType!=="AllSame"){let u=s.materialIndex[0],c=0;if(s.materialIndex.forEach(function(h,f){h!==u&&(a.addGroup(c,f-c,u),u=h,c=f)}),a.groups.length>0){let h=a.groups[a.groups.length-1],f=h.start+h.count;f!==s.materialIndex.length&&a.addGroup(f,s.materialIndex.length-f,u)}a.groups.length===0&&a.addGroup(0,s.materialIndex.length,s.materialIndex[0])}return this.addMorphTargets(a,e,i,n),a}parseGeoNode(e,t){let i={};if(i.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],i.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let n=0;for(;e.LayerElementUV[n];)e.LayerElementUV[n].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[n])),n++}return i.weightTable={},t!==null&&(i.skeleton=t,t.rawBones.forEach(function(n,a){n.indices.forEach(function(o,s){i.weightTable[o]===void 0&&(i.weightTable[o]=[]),i.weightTable[o].push({id:a,weight:n.weights[s]})})})),i}genBuffers(e){let t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},i=0,n=0,a=!1,o=[],s=[],l=[],u=[],c=[],h=[],f=this;return e.vertexIndices.forEach(function(p,d){let g,m=!1;p<0&&(p=p^-1,m=!0);let v=[],_=[];if(o.push(p*3,p*3+1,p*3+2),e.color){let y=kR(d,i,p,e.color);l.push(y[0],y[1],y[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(y){_.push(y.weight),v.push(y.id)}),_.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);let y=[0,0,0,0],x=[0,0,0,0];_.forEach(function(M,S){let w=M,T=v[S];x.forEach(function(C,b,E){if(w>C){E[b]=w,w=C;let I=y[b];y[b]=T,T=I}})}),v=y,_=x}for(;_.length<4;)_.push(0),v.push(0);for(let y=0;y<4;++y)c.push(_[y]),h.push(v[y])}if(e.normal){let y=kR(d,i,p,e.normal);s.push(y[0],y[1],y[2])}e.material&&e.material.mappingType!=="AllSame"&&(g=kR(d,i,p,e.material)[0],g<0&&(f.negativeMaterialIndices=!0,g=0)),e.uv&&e.uv.forEach(function(y,x){let M=kR(d,i,p,y);u[x]===void 0&&(u[x]=[]),u[x].push(M[0]),u[x].push(M[1])}),n++,m&&(f.genFace(t,e,o,g,s,l,u,c,h,n),i++,n=0,o=[],s=[],l=[],u=[],c=[],h=[])}),t}getNormalNewell(e){let t=new ye(0,0,0);for(let i=0;i<e.length;i++){let n=e[i],a=e[(i+1)%e.length];t.x+=(n.y-a.y)*(n.z+a.z),t.y+=(n.z-a.z)*(n.x+a.x),t.z+=(n.x-a.x)*(n.y+a.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){let t=this.getNormalNewell(e),n=(Math.abs(t.z)>.5?new ye(0,1,0):new ye(0,0,1)).cross(t).normalize(),a=t.clone().cross(n).normalize();return{normal:t,tangent:n,bitangent:a}}flattenVertex(e,t,i){return new xr(e.dot(t),e.dot(i))}genFace(e,t,i,n,a,o,s,l,u,c){let h;if(c>3){let f=[];for(let m=0;m<i.length;m+=3)f.push(new ye(t.vertexPositions[i[m]],t.vertexPositions[i[m+1]],t.vertexPositions[i[m+2]]));let{tangent:p,bitangent:d}=this.getNormalTangentAndBitangent(f),g=[];for(let m of f)g.push(this.flattenVertex(m,p,d));h=bR.triangulateShape(g,[])}else h=[[0,1,2]];for(let[f,p,d]of h)e.vertex.push(t.vertexPositions[i[f*3]]),e.vertex.push(t.vertexPositions[i[f*3+1]]),e.vertex.push(t.vertexPositions[i[f*3+2]]),e.vertex.push(t.vertexPositions[i[p*3]]),e.vertex.push(t.vertexPositions[i[p*3+1]]),e.vertex.push(t.vertexPositions[i[p*3+2]]),e.vertex.push(t.vertexPositions[i[d*3]]),e.vertex.push(t.vertexPositions[i[d*3+1]]),e.vertex.push(t.vertexPositions[i[d*3+2]]),t.skeleton&&(e.vertexWeights.push(l[f*4]),e.vertexWeights.push(l[f*4+1]),e.vertexWeights.push(l[f*4+2]),e.vertexWeights.push(l[f*4+3]),e.vertexWeights.push(l[p*4]),e.vertexWeights.push(l[p*4+1]),e.vertexWeights.push(l[p*4+2]),e.vertexWeights.push(l[p*4+3]),e.vertexWeights.push(l[d*4]),e.vertexWeights.push(l[d*4+1]),e.vertexWeights.push(l[d*4+2]),e.vertexWeights.push(l[d*4+3]),e.weightsIndices.push(u[f*4]),e.weightsIndices.push(u[f*4+1]),e.weightsIndices.push(u[f*4+2]),e.weightsIndices.push(u[f*4+3]),e.weightsIndices.push(u[p*4]),e.weightsIndices.push(u[p*4+1]),e.weightsIndices.push(u[p*4+2]),e.weightsIndices.push(u[p*4+3]),e.weightsIndices.push(u[d*4]),e.weightsIndices.push(u[d*4+1]),e.weightsIndices.push(u[d*4+2]),e.weightsIndices.push(u[d*4+3])),t.color&&(e.colors.push(o[f*3]),e.colors.push(o[f*3+1]),e.colors.push(o[f*3+2]),e.colors.push(o[p*3]),e.colors.push(o[p*3+1]),e.colors.push(o[p*3+2]),e.colors.push(o[d*3]),e.colors.push(o[d*3+1]),e.colors.push(o[d*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(n),e.materialIndex.push(n),e.materialIndex.push(n)),t.normal&&(e.normal.push(a[f*3]),e.normal.push(a[f*3+1]),e.normal.push(a[f*3+2]),e.normal.push(a[p*3]),e.normal.push(a[p*3+1]),e.normal.push(a[p*3+2]),e.normal.push(a[d*3]),e.normal.push(a[d*3+1]),e.normal.push(a[d*3+2])),t.uv&&t.uv.forEach(function(g,m){e.uvs[m]===void 0&&(e.uvs[m]=[]),e.uvs[m].push(s[m][f*2]),e.uvs[m].push(s[m][f*2+1]),e.uvs[m].push(s[m][p*2]),e.uvs[m].push(s[m][p*2+1]),e.uvs[m].push(s[m][d*2]),e.uvs[m].push(s[m][d*2+1])})}addMorphTargets(e,t,i,n){if(i.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];let a=this;i.forEach(function(o){o.rawTargets.forEach(function(s){let l=Sr.Objects.Geometry[s.geoID];l!==void 0&&a.genMorphGeometry(e,t,l,n,s.name)})})}genMorphGeometry(e,t,i,n,a){let o=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],s=i.Vertices!==void 0?i.Vertices.a:[],l=i.Indexes!==void 0?i.Indexes.a:[],u=e.attributes.position.count*3,c=new Float32Array(u);for(let d=0;d<l.length;d++){let g=l[d]*3;c[g]=s[d*3],c[g+1]=s[d*3+1],c[g+2]=s[d*3+2]}let h={vertexIndices:o,vertexPositions:c},f=this.genBuffers(h),p=new Bn(f.vertex,3);p.name=a||i.attrName,p.applyMatrix4(n),e.morphAttributes.position.push(p)}parseNormals(e){let t=e.MappingInformationType,i=e.ReferenceInformationType,n=e.Normals.a,a=[];return i==="IndexToDirect"&&("NormalIndex"in e?a=e.NormalIndex.a:"NormalsIndex"in e&&(a=e.NormalsIndex.a)),{dataSize:3,buffer:n,indices:a,mappingType:t,referenceType:i}}parseUVs(e){let t=e.MappingInformationType,i=e.ReferenceInformationType,n=e.UV.a,a=[];return i==="IndexToDirect"&&(a=e.UVIndex.a),{dataSize:2,buffer:n,indices:a,mappingType:t,referenceType:i}}parseVertexColors(e){let t=e.MappingInformationType,i=e.ReferenceInformationType,n=e.Colors.a,a=[];i==="IndexToDirect"&&(a=e.ColorIndex.a);for(let o=0,s=new nr;o<n.length;o+=4)s.fromArray(n,o).convertSRGBToLinear().toArray(n,o);return{dataSize:4,buffer:n,indices:a,mappingType:t,referenceType:i}}parseMaterialIndices(e){let t=e.MappingInformationType,i=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};let n=e.Materials.a,a=[];for(let o=0;o<n.length;++o)a.push(o);return{dataSize:1,buffer:n,indices:a,mappingType:t,referenceType:i}}parseNurbsGeometry(e){let t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new ul;let i=t-1,n=e.KnotVector.a,a=[],o=e.Points.a;for(let h=0,f=o.length;h<f;h+=4)a.push(new Ur().fromArray(o,h));let s,l;if(e.Form==="Closed")a.push(a[0]);else if(e.Form==="Periodic"){s=i,l=n.length-1-s;for(let h=0;h<i;++h)a.push(a[h])}let c=new BR(i,n,a,s,l).getPoints(a.length*12);return new ul().setFromPoints(c)}},ik=class{parse(){let e=[],t=this.parseClips();if(t!==void 0)for(let i in t){let n=t[i],a=this.addClip(n);e.push(a)}return e}parseClips(){if(Sr.Objects.AnimationCurve===void 0)return;let e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);let t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){let e=Sr.Objects.AnimationCurveNode,t=new Map;for(let i in e){let n=e[i];if(n.attrName.match(/S|R|T|DeformPercent/)!==null){let a={id:n.id,attr:n.attrName,curves:{}};t.set(a.id,a)}}return t}parseAnimationCurves(e){let t=Sr.Objects.AnimationCurve;for(let i in t){let n={id:t[i].id,times:t[i].KeyTime.a.map(PIe),values:t[i].KeyValueFloat.a},a=zi.get(n.id);if(a!==void 0){let o=a.parents[0].ID,s=a.parents[0].relationship;s.match(/X/)?e.get(o).curves.x=n:s.match(/Y/)?e.get(o).curves.y=n:s.match(/Z/)?e.get(o).curves.z=n:s.match(/DeformPercent/)&&e.has(o)&&(e.get(o).curves.morph=n)}}}parseAnimationLayers(e){let t=Sr.Objects.AnimationLayer,i=new Map;for(let n in t){let a=[],o=zi.get(parseInt(n));o!==void 0&&(o.children.forEach(function(l,u){if(e.has(l.ID)){let c=e.get(l.ID);if(c.curves.x!==void 0||c.curves.y!==void 0||c.curves.z!==void 0){if(a[u]===void 0){let h=zi.get(l.ID).parents.filter(function(f){return f.relationship!==void 0})[0].ID;if(h!==void 0){let f=Sr.Objects.Model[h.toString()];if(f===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",l);return}let p={modelName:f.attrName?si.sanitizeNodeName(f.attrName):"",ID:f.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Ia.traverse(function(d){d.ID===f.id&&(p.transform=d.matrix,d.userData.transformData&&(p.eulerOrder=d.userData.transformData.eulerOrder))}),p.transform||(p.transform=new Xt),"PreRotation"in f&&(p.preRotation=f.PreRotation.value),"PostRotation"in f&&(p.postRotation=f.PostRotation.value),a[u]=p}}a[u]&&(a[u][c.attr]=c)}else if(c.curves.morph!==void 0){if(a[u]===void 0){let h=zi.get(l.ID).parents.filter(function(v){return v.relationship!==void 0})[0].ID,f=zi.get(h).parents[0].ID,p=zi.get(f).parents[0].ID,d=zi.get(p).parents[0].ID,g=Sr.Objects.Model[d],m={modelName:g.attrName?si.sanitizeNodeName(g.attrName):"",morphName:Sr.Objects.Deformer[h].attrName};a[u]=m}a[u][c.attr]=c}}}),i.set(parseInt(n),a))}return i}parseAnimStacks(e){let t=Sr.Objects.AnimationStack,i={};for(let n in t){let a=zi.get(parseInt(n)).children;a.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");let o=e.get(a[0].ID);i[n]={name:t[n].attrName,layer:o}}return i}addClip(e){let t=[],i=this;return e.layer.forEach(function(n){t=t.concat(i.generateTracks(n))}),new ER(e.name,-1,t)}generateTracks(e){let t=[],i=new ye,n=new ye;if(e.transform&&e.transform.decompose(i,new kn,n),i=i.toArray(),n=n.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){let a=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");a!==void 0&&t.push(a)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){let a=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);a!==void 0&&t.push(a)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){let a=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");a!==void 0&&t.push(a)}if(e.DeformPercent!==void 0){let a=this.generateMorphTrack(e);a!==void 0&&t.push(a)}return t}generateVectorTrack(e,t,i,n){let a=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(a,t,i);return new Xf(e+"."+n,a,o)}generateRotationTrack(e,t,i,n,a){let o,s;if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){let h=this.interpolateRotations(t.x,t.y,t.z,a);o=h[0],s=h[1]}i!==void 0&&(i=i.map(la.degToRad),i.push(a),i=new Vn().fromArray(i),i=new kn().setFromEuler(i)),n!==void 0&&(n=n.map(la.degToRad),n.push(a),n=new Vn().fromArray(n),n=new kn().setFromEuler(n).invert());let l=new kn,u=new Vn,c=[];if(!s||!o)return new Yu(e+".quaternion",[],[]);for(let h=0;h<s.length;h+=3)u.set(s[h],s[h+1],s[h+2],a),l.setFromEuler(u),i!==void 0&&l.premultiply(i),n!==void 0&&l.multiply(n),h>2&&new kn().fromArray(c,(h-3)/3*4).dot(l)<0&&l.set(-l.x,-l.y,-l.z,-l.w),l.toArray(c,h/3*4);return new Yu(e+".quaternion",o,c)}generateMorphTrack(e){let t=e.DeformPercent.curves.morph,i=t.values.map(function(a){return a/100}),n=Ia.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new Hf(e.modelName+".morphTargetInfluences["+n+"]",t.times,i)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(i,n){return i-n}),t.length>1){let i=1,n=t[0];for(let a=1;a<t.length;a++){let o=t[a];o!==n&&(t[i]=o,n=o,i++)}t=t.slice(0,i)}return t}getKeyframeTrackValues(e,t,i){let n=i,a=[],o=-1,s=-1,l=-1;return e.forEach(function(u){if(t.x&&(o=t.x.times.indexOf(u)),t.y&&(s=t.y.times.indexOf(u)),t.z&&(l=t.z.times.indexOf(u)),o!==-1){let c=t.x.values[o];a.push(c),n[0]=c}else a.push(n[0]);if(s!==-1){let c=t.y.values[s];a.push(c),n[1]=c}else a.push(n[1]);if(l!==-1){let c=t.z.values[l];a.push(c),n[2]=c}else a.push(n[2])}),a}interpolateRotations(e,t,i,n){let a=[],o=[];a.push(e.times[0]),o.push(la.degToRad(e.values[0])),o.push(la.degToRad(t.values[0])),o.push(la.degToRad(i.values[0]));for(let s=1;s<e.values.length;s++){let l=[e.values[s-1],t.values[s-1],i.values[s-1]];if(isNaN(l[0])||isNaN(l[1])||isNaN(l[2]))continue;let u=l.map(la.degToRad),c=[e.values[s],t.values[s],i.values[s]];if(isNaN(c[0])||isNaN(c[1])||isNaN(c[2]))continue;let h=c.map(la.degToRad),f=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],p=[Math.abs(f[0]),Math.abs(f[1]),Math.abs(f[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){let g=Math.max(...p)/180,m=new Vn(...u,n),v=new Vn(...h,n),_=new kn().setFromEuler(m),y=new kn().setFromEuler(v);_.dot(y)&&y.set(-y.x,-y.y,-y.z,-y.w);let x=e.times[s-1],M=e.times[s]-x,S=new kn,w=new Vn;for(let T=0;T<1;T+=1/g)S.copy(_.clone().slerp(y.clone(),T)),a.push(x+T*M),w.setFromQuaternion(S,n),o.push(w.x),o.push(w.y),o.push(w.z)}else a.push(e.times[s]),o.push(la.degToRad(e.values[s])),o.push(la.degToRad(t.values[s])),o.push(la.degToRad(i.values[s]))}return[a,o]}},nk=class{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new HR,this.nodeStack=[],this.currentProp=[],this.currentPropName="";let t=this,i=e.split(/[\r\n]+/);return i.forEach(function(n,a){let o=n.match(/^[\s\t]*;/),s=n.match(/^[\s\t]*$/);if(o||s)return;let l=n.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),u=n.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),c=n.match("^\\t{"+(t.currentIndent-1)+"}}");l?t.parseNodeBegin(n,l):u?t.parseNodeProperty(n,u,i[++a]):c?t.popStack():n.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(n)}),this.allNodes}parseNodeBegin(e,t){let i=t[1].trim().replace(/^"/,"").replace(/"$/,""),n=t[2].split(",").map(function(l){return l.trim().replace(/^"/,"").replace(/"$/,"")}),a={name:i},o=this.parseNodeAttr(n),s=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(i,a):i in s?(i==="PoseNode"?s.PoseNode.push(a):s[i].id!==void 0&&(s[i]={},s[i][s[i].id]=s[i]),o.id!==""&&(s[i][o.id]=a)):typeof o.id=="number"?(s[i]={},s[i][o.id]=a):i!=="Properties70"&&(i==="PoseNode"?s[i]=[a]:s[i]=a),typeof o.id=="number"&&(a.id=o.id),o.name!==""&&(a.attrName=o.name),o.type!==""&&(a.attrType=o.type),this.pushStack(a)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",n="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),n=e[2]),{id:t,name:i,type:n}}parseNodeProperty(e,t,i){let n=t[1].replace(/^"/,"").replace(/"$/,"").trim(),a=t[2].replace(/^"/,"").replace(/"$/,"").trim();n==="Content"&&a===","&&(a=i.replace(/"/g,"").replace(/,$/,"").trim());let o=this.getCurrentNode();if(o.name==="Properties70"){this.parseNodeSpecialProperty(e,n,a);return}if(n==="C"){let l=a.split(",").slice(1),u=parseInt(l[0]),c=parseInt(l[1]),h=a.split(",").slice(3);h=h.map(function(f){return f.trim().replace(/^"/,"")}),n="connections",a=[u,c],NIe(a,h),o[n]===void 0&&(o[n]=[])}n==="Node"&&(o.id=a),n in o&&Array.isArray(o[n])?o[n].push(a):n!=="a"?o[n]=a:o.a=a,this.setCurrentProp(o,n),n==="a"&&a.slice(-1)!==","&&(o.a=ek(a))}parseNodePropertyContinued(e){let t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=ek(t.a))}parseNodeSpecialProperty(e,t,i){let n=i.split('",').map(function(c){return c.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=n[0],o=n[1],s=n[2],l=n[3],u=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":u=parseFloat(u);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":u=ek(u);break}this.getPrevNode()[a]={type:o,type2:s,flag:l,value:u},this.setCurrentProp(this.getPrevNode(),a)}},ak=class{parse(e){let t=new GR(e);t.skip(23);let i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);let n=new HR;for(;!this.endOfContent(t);){let a=this.parseNode(t,i);a!==null&&n.add(a.name,a)}return n}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){let i={},n=t>=7500?e.getUint64():e.getUint32(),a=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();let o=e.getUint8(),s=e.getString(o);if(n===0)return null;let l=[];for(let f=0;f<a;f++)l.push(this.parseProperty(e));let u=l.length>0?l[0]:"",c=l.length>1?l[1]:"",h=l.length>2?l[2]:"";for(i.singleProperty=a===1&&e.getOffset()===n;n>e.getOffset();){let f=this.parseNode(e,t);f!==null&&this.parseSubNode(s,i,f)}return i.propertyList=l,typeof u=="number"&&(i.id=u),c!==""&&(i.attrName=c),h!==""&&(i.attrType=h),s!==""&&(i.name=s),i}parseSubNode(e,t,i){if(i.singleProperty===!0){let n=i.propertyList[0];Array.isArray(n)?(t[i.name]=i,i.a=n):t[i.name]=n}else if(e==="Connections"&&i.name==="C"){let n=[];i.propertyList.forEach(function(a,o){o!==0&&n.push(a)}),t.connections===void 0&&(t.connections=[]),t.connections.push(n)}else if(i.name==="Properties70")Object.keys(i).forEach(function(a){t[a]=i[a]});else if(e==="Properties70"&&i.name==="P"){let n=i.propertyList[0],a=i.propertyList[1],o=i.propertyList[2],s=i.propertyList[3],l;n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),a.indexOf("Lcl ")===0&&(a=a.replace("Lcl ","Lcl_")),a==="Color"||a==="ColorRGB"||a==="Vector"||a==="Vector3D"||a.indexOf("Lcl_")===0?l=[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:l=i.propertyList[4],t[n]={type:a,type2:o,flag:s,value:l}}else t[i.name]===void 0?typeof i.id=="number"?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:i.name==="PoseNode"?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):t[i.name][i.id]===void 0&&(t[i.name][i.id]=i)}parseProperty(e){let t=e.getString(1),i;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return i=e.getUint32(),e.getArrayBuffer(i);case"S":return i=e.getUint32(),e.getString(i);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":let n=e.getUint32(),a=e.getUint32(),o=e.getUint32();if(a===0)switch(t){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}let s=uoe(new Uint8Array(e.getArrayBuffer(o))),l=new GR(s.buffer);switch(t){case"b":case"c":return l.getBooleanArray(n);case"d":return l.getFloat64Array(n);case"f":return l.getFloat32Array(n);case"i":return l.getInt32Array(n);case"l":return l.getInt64Array(n)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}},GR=class{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){let t=[];for(let i=0;i<e;i++)t.push(this.getBoolean());return t}getUint8(){let e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){let e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){let e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){let t=[];for(let i=0;i<e;i++)t.push(this.getInt32());return t}getUint32(){let e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){let t=[];for(let i=0;i<e;i++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){let e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){let t=[];for(let i=0;i<e;i++)t.push(this.getFloat32());return t}getFloat64(){let e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){let t=[];for(let i=0;i<e;i++)t.push(this.getFloat64());return t}getArrayBuffer(e){let t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=this.offset,i=new Uint8Array(this.dv.buffer,t,e);this.skip(e);let n=i.indexOf(0);return n>=0&&(i=new Uint8Array(this.dv.buffer,t,n)),this._textDecoder.decode(i)}},HR=class{add(e,t){this[e]=t}};function LIe(r){let e="Kaydara FBX Binary \0";return r.byteLength>=e.length&&e===voe(r,0,e.length)}function DIe(r){let e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],t=0;function i(n){let a=r[n-1];return r=r.slice(t+n),t++,a}for(let n=0;n<e.length;++n)if(i(1)===e[n])return!1;return!0}function poe(r){let e=/FBXVersion: (\d+)/,t=r.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function PIe(r){return r/46186158e3}var IIe=[];function kR(r,e,t,i){let n;switch(i.mappingType){case"ByPolygonVertex":n=r;break;case"ByPolygon":n=e;break;case"ByVertice":n=t;break;case"AllSame":n=i.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+i.mappingType)}i.referenceType==="IndexToDirect"&&(n=i.indices[n]);let a=n*i.dataSize,o=a+i.dataSize;return UIe(IIe,i.buffer,a,o)}var QB=new Vn,g0=new ye;function doe(r){let e=new Xt,t=new Xt,i=new Xt,n=new Xt,a=new Xt,o=new Xt,s=new Xt,l=new Xt,u=new Xt,c=new Xt,h=new Xt,f=new Xt,p=r.inheritType?r.inheritType:0;if(r.translation&&e.setPosition(g0.fromArray(r.translation)),r.preRotation){let b=r.preRotation.map(la.degToRad);b.push(r.eulerOrder||Vn.DEFAULT_ORDER),t.makeRotationFromEuler(QB.fromArray(b))}if(r.rotation){let b=r.rotation.map(la.degToRad);b.push(r.eulerOrder||Vn.DEFAULT_ORDER),i.makeRotationFromEuler(QB.fromArray(b))}if(r.postRotation){let b=r.postRotation.map(la.degToRad);b.push(r.eulerOrder||Vn.DEFAULT_ORDER),n.makeRotationFromEuler(QB.fromArray(b)),n.invert()}r.scale&&a.scale(g0.fromArray(r.scale)),r.scalingOffset&&s.setPosition(g0.fromArray(r.scalingOffset)),r.scalingPivot&&o.setPosition(g0.fromArray(r.scalingPivot)),r.rotationOffset&&l.setPosition(g0.fromArray(r.rotationOffset)),r.rotationPivot&&u.setPosition(g0.fromArray(r.rotationPivot)),r.parentMatrixWorld&&(h.copy(r.parentMatrix),c.copy(r.parentMatrixWorld));let d=t.clone().multiply(i).multiply(n),g=new Xt;g.extractRotation(c);let m=new Xt;m.copyPosition(c);let v=m.clone().invert().multiply(c),_=g.clone().invert().multiply(v),y=a,x=new Xt;if(p===0)x.copy(g).multiply(d).multiply(_).multiply(y);else if(p===1)x.copy(g).multiply(_).multiply(d).multiply(y);else{let E=new Xt().scale(new ye().setFromMatrixScale(h)).clone().invert(),I=_.clone().multiply(E);x.copy(g).multiply(d).multiply(I).multiply(y)}let M=u.clone().invert(),S=o.clone().invert(),w=e.clone().multiply(l).multiply(u).multiply(t).multiply(i).multiply(n).multiply(M).multiply(s).multiply(o).multiply(a).multiply(S),T=new Xt().copyPosition(w),C=c.clone().multiply(T);return f.copyPosition(C),w=f.clone().multiply(x),w.premultiply(c.invert()),w}function moe(r){r=r||0;let e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return r===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[r]}function ek(r){return r.split(",").map(function(t){return parseFloat(t)})}function voe(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=r.byteLength),new TextDecoder().decode(new Uint8Array(r,e,t))}function NIe(r,e){for(let t=0,i=r.length,n=e.length;t<n;t++,i++)r[i]=e[t]}function UIe(r,e,t,i){for(let n=t,a=0;n<i;n++,a++)r[a]=e[n];return r}var Xse=$se(Hse());var b3e=["Three"],w3e=new oM,Wse,Yse=(()=>{let e=class e{constructor(){this.http=xn(lu),this.modal=xn(uh),this.titleService=xn(zb),this.animate=()=>{requestAnimationFrame(this.animate);let i=w3e.getDelta();Wse&&Wse.update(i),this.renderer.render(this.scene,this.camera)}}ngOnInit(){this.titleService.setTitle("\u91CD\u78C53D"),this.initThreeJs(),this.animate()}initThreeJs(){this.camera=new Wi(40,window.innerWidth/window.innerHeight,1,2e4),this.camera.position.set(2200,300,-3100),this.camera.fov=60,this.camera.updateProjectionMatrix(),this.scene=new iM,this.scene.background=new or(263446);let i=new nM(16777215,4473924,5);i.position.set(0,200,0),this.scene.add(i);let n=new aM(16777215,5);n.position.set(0,200,100),n.castShadow=!0,n.shadow.camera.top=180,n.shadow.camera.bottom=-100,n.shadow.camera.left=-120,n.shadow.camera.right=120,this.scene.add(n);let a=this;new VR().load("assets/fbx/bb.fbx",function(p){p.traverse(function(d){}),a.scene.add(p)},p=>{},p=>{console.error("An error happened",p)}),this.renderer=new rM({antialias:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(400,300),this.renderer.shadowMap.enabled=!0,this.container.nativeElement.appendChild(this.renderer.domElement);let s=5,l=32,u=new TC(s,l),c=new zc({color:16711680}),h=new an(u,c);h.position.set(850,100,-2e3),this.scene.add(h);let f=new Xse.OrbitControls(this.camera,this.renderer.domElement);f.target.set(850,100,-2e3),f.update()}render(){this.cube.rotation.x+=.01,this.cube.rotation.y+=.01,this.renderer.render(this.scene,this.camera)}onWindowResize(){}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["app-data-v-t1"]],viewQuery:function(n,a){if(n&1&&Mn(b3e,7),n&2){let o;fi(o=pi())&&(a.container=o.first)}},standalone:!0,features:[Ar],decls:3,vars:0,consts:[[2,"width","400vh","flex-direction","column","height","200vh"],[2,"flex-grow","1"],["Three",""]],template:function(n,a){n&1&&(ft(0,"div",0),er(1,"div",1,2),ot())},dependencies:[Ba,ka,io,Ja,ao,oo,no,to,Fa,Za,Ka,co,eo,$a,fn,Ua,Ya,qa,so,uo,Wa,Yn,Qa,Ha,ja,Xa,lo,za,Oa,ro,Ga,Wn,Va,Xn],encapsulation:2});let r=e;return r})();var T3e=["canvas"],qse=(()=>{let e=class e{constructor(i){this.sanitizer=i,this.http=xn(lu),this.defaultCarImage="/assets/blockbuster/tmp1.png",this.status=0}ngOnInit(){this.initSvg()}ngOnChanges(i){i.options&&!i.options.isFirstChange()&&console.log("ChartComponentComponent ngOnChanges")}ngOnDestroy(){}initSvg(){fetch("assets/blockbuster/wc.svg").then(n=>n.text()).then(n=>{this.drawSVGtoCanvas(n,0,0,1)}).catch(n=>{console.error("Failed to load SVG:",n)}),this.status==0&&fetch("assets/blockbuster/zcddxy.svg").then(a=>a.text()).then(a=>{this.drawSVGtoCanvas(a,70,22,.5)}).catch(a=>{console.error("Failed to load SVG:",a)})}drawSVGtoCanvas(i,n,a,o){let l=this.canvasRef.nativeElement.getContext("2d"),u=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(u),h=new Image;h.onload=()=>{let f=h.width*o,p=h.height*o;l.drawImage(h,n,a,f,p),URL.revokeObjectURL(c)},h.src=c}};e.\u0275fac=function(n){return new(n||e)(da(DV))},e.\u0275cmp=Er({type:e,selectors:[["blockbuster-component"]],viewQuery:function(n,a){if(n&1&&Mn(T3e,5),n&2){let o;fi(o=pi())&&(a.canvasRef=o.first)}},inputs:{defaultCarImage:"defaultCarImage",status:"status"},standalone:!0,features:[sh,Ar],decls:8,vars:6,consts:[["nz-row","",2,"height","13rem",3,"nzGutter"],["nz-col","",1,"gutter-row",3,"nzSpan"],["alt","Car Image",2,"width","100%","height","100%",3,"src"],["nz-col","",1,"gutter-row",2,"text-align","center",3,"nzSpan"],[2,"border","5px solid #00EFF8","height","100%","width","100%"],["canvas",""]],template:function(n,a){n&1&&(ft(0,"div",0)(1,"div",1),er(2,"img",2),ot(),ft(3,"div",3),er(4,"canvas",4,5),ot(),ft(6,"div",1),er(7,"img",2),ot()()),n&2&&(rt("nzGutter",12),st(),rt("nzSpan",6),st(),op("src",a.defaultCarImage,BL),st(),rt("nzSpan",12),st(3),rt("nzSpan",6),st(),op("src",a.defaultCarImage,BL))},dependencies:[fn,hh,ch,Wn],styles:[".svg-container[_ngcontent-%COMP%]{position:relative}.svg-overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0}"]});let r=e;return r})();var E3e=["myGrid"];function A3e(r,e){if(r&1&&(ft(0,"div",19),er(1,"blockbuster-component",20),ot()),r&2){let t=e.$implicit;st(),rt("defaultCarImage",t.tmpimg)("status",t.status)}}var C3e=()=>[12,12],Zse=(()=>{let e=class e{constructor(i){this._mqttService=i,this.http=xn(lu),this.modal=xn(uh),this.elementRef=xn(p_),this.titleService=xn(zb),this.items=[{tmpimg:"/assets/blockbuster/tmp1.png",status:0},{tmpimg:"/assets/blockbuster/tmp2.png",status:1},{tmpimg:"/assets/blockbuster/tmp3.png",status:0},{tmpimg:"/assets/blockbuster/tmp4.png",status:1}],this.chartDom=document.getElementById("main"),this.defaultColDef={width:150,editable:!1},this.gridThemedClass="ag-theme-quartz ag-theme-datav",this.rowData=[],this.todayRowData=[],this.array=[1,2,3,4],this.effect="scrollx",this.colDefs1=[{headerName:"\u4EFB\u52A1\u63CF\u8FF0",unSortIcon:!0,field:"rwms",width:120},{headerName:"\u5F00\u59CB\u65F6\u95F4",headerClass:"ag-header-center",unSortIcon:!0,field:"kssj",width:180},{headerName:"\u8D85\u671F",width:70,field:"sfcq"},{headerName:"\u64CD\u4F5C",width:90,autoHeaderHeight:!0,field:"cz",cellRenderer:VV}],this.colDefs2=[{headerName:"",minWidth:150,field:"rwmc",flex:1},{headerName:"1#\u91CD\u78C5",minWidth:110,field:"one",flex:1},{headerName:"2#\u91CD\u78C5",minWidth:110,field:"two",flex:1},{headerName:"3#\u91CD\u78C5",minWidth:110,field:"three",flex:1},{headerName:"4#\u91CD\u78C5",minWidth:110,field:"four",flex:1},{headerName:"\u6C47\u603B",minWidth:110,autoHeaderHeight:!0,field:"all",flex:1}],this.client=i}initCharts(){let i=Ev(document.getElementById("lineChart")),n={tooltip:{formatter:"{a} <br/>{b} : {c}%"},series:[{name:"Pressure",type:"gauge",progress:{show:!0},detail:{valueAnimation:!0,formatter:"{value}"},data:[{value:50,name:"SCORE"}]}]};i.setOption(n)}ngOnInit(){this.todayRowData.push({rwmc:"\u8F66\u8F86\u6570",one:"4\uFF08\u8F86\uFF09",two:"6\uFF08\u8F86\uFF09",three:"9\uFF08\u8F86\uFF09",four:"3\uFF08\u8F86\uFF09",all:"22\uFF08\u8F86\uFF09"}),this.todayRowData.push({rwmc:"\u603B\u5428\u6570",one:"25.1\uFF08\u5428\uFF09",two:"45.2\uFF08\u5428\uFF09",three:"87.9\uFF08\u5428\uFF09",four:"15.5\uFF08\u5428\uFF09",all:"155\uFF08\u5428\uFF09"}),this.todayRowData.push({rwmc:`\u4E0A\u62A5\u70ED\u503C/
  10251. \u4F30\u7B97\u70ED\u503C`,one:"1/1 (MJ)",two:"2/1 (MJ)",three:"3/3 (MJ)",four:"4/3\uFF08MJ)",all:"10/8 \uFF08MJ\uFF09"}),this.titleService.setTitle("\u6211\u7684\u5DE5\u4F5C\u7AD9");for(var i=1;i<30;i++)this.rowData.push({rwmc:`\u4EFB\u52A1${i}`,rwms:`\u4EFB\u52A1\u63CF\u8FF0${i}`,kssj:`2024-1-${i} 13:38:${i*11}`,jhwcsj:`2024-1-${i} 13:38:${i*10}`,sfcq:"\u5426",dqzt:"\u6B63\u5E38",dqjd:`\u8282\u70B9${i}`,sjwcsj:`2024-1-${i} 13:38:${i*27}`,bjmc:"\u62A5\u8B665",bjms:"\u62A5\u8B66\u63CF\u8FF05",bjsj:`2024-1-${i} 13:38:${i*12}`,gzyy:"-",clff:"-",tzsj:`2024-1-${i} 13:38:${i*19}`,zycd:"\u4E00\u822C",tzmc:"\u7CFB\u7EDF\u63D0\u793A",tznr:"\u8D26\u6237\u767B\u5F55",fj:"-",cz:"\u64CD\u4F5C"});this.initCharts()}ngAfterViewInit(){let i=this.elementRef.nativeElement.querySelector(".ag-theme-datav"),n=i.querySelector(".ag-body-viewport"),a=i.querySelector(".ag-scroller")}add(){}};e.\u0275fac=function(n){return new(n||e)(da(kb))},e.\u0275cmp=Er({type:e,selectors:[["app-data-v-s1"]],viewQuery:function(n,a){if(n&1&&Mn(E3e,5),n&2){let o;fi(o=pi())&&(a.grid=o.first)}},standalone:!0,features:[Ar],decls:33,vars:24,consts:[["nz-row","",2,"display","flex","justify-content","space-between",3,"nzGutter"],[2,"display","flex","flex-direction","column","width","23%"],["title","\u7CFB\u7EDF\u72B6\u6001",2,"width","100%"],["title","\u8FD0\u884C\u4FE1\u606F",2,"width","100%",3,"defaultColDef","rowData","columnDefs","gridThemeClass"],["title","\u7CFB\u7EDF\u62A5\u8B66\u4FE1\u606F",2,"width","100%",3,"defaultColDef","rowData","columnDefs","gridThemeClass"],[2,"display","flex","flex-direction","column","width","43%"],[1,"button-container"],[1,"lock-button"],["src","./assets/lock.svg",1,"logo"],[1,"standard-button"],[1,"car-status-container"],["nz-row","",3,"nzGutter"],["nz-col","",1,"gutter-row",2,"text-align","center",3,"nzSpan"],[1,"card-content-title"],[1,"card-content-l"],["class","row",4,"ngFor","ngForOf"],[2,"display","flex","flex-direction","column","width","30%"],["title","\u4ECA\u65E5\u6C47\u603B",2,"height","250px",3,"showPageTurning","showEditButton","defaultColDef","rowData","columnDefs","gridThemeClass"],[2,"width","100%","margin-top","30px"],[1,"row"],[2,"margin-bottom","0.5rem",3,"defaultCarImage","status"]],template:function(n,a){n&1&&(ft(0,"div",0)(1,"div",1),er(2,"app-data-v-lj-dashboard",2)(3,"lj-app-ag-grid-component",3)(4,"lj-app-ag-grid-component",4),ot(),ft(5,"div",5)(6,"div",6)(7,"button",7),er(8,"img",8),ot(),ft(9,"button",9),jt(10,"\u64CD\u4F5C"),ot(),ft(11,"button",9),jt(12,"\u6821\u78C5"),ot(),ft(13,"button",9),jt(14,"\u9632\u4F5C\u5F0A"),ot()(),ft(15,"div",10)(16,"div",11)(17,"div",12)(18,"div",13)(19,"div",14),jt(20),ot()()(),ft(21,"div",12)(22,"div",13)(23,"div",14),jt(24),ot()()(),ft(25,"div",12)(26,"div",13)(27,"div",14),jt(28),ot()()()(),gr(29,A3e,2,2,"div",15),ot()(),ft(30,"div",16),er(31,"lj-app-ag-grid-component",17)(32,"app-data-v-lj-car-info-table",18),ot()()),n&2&&(rt("nzGutter",LV(23,C3e)),st(3),rt("defaultColDef",a.defaultColDef)("rowData",a.rowData)("columnDefs",a.colDefs1)("gridThemeClass",a.gridThemedClass),st(),rt("defaultColDef",a.defaultColDef)("rowData",a.rowData)("columnDefs",a.colDefs1)("gridThemeClass",a.gridThemedClass),st(12),rt("nzGutter",12),st(),rt("nzSpan",6),st(3),ma("\u62AC\u6746\u76D1\u63A7"),st(),rt("nzSpan",12),st(3),ma("3D\u76D1\u63A7"),st(),rt("nzSpan",6),st(3),ma("\u843D\u6746\u76D1\u63A7"),st(),rt("ngForOf",a.items),st(2),rt("showPageTurning",!1)("showEditButton",!0)("defaultColDef",a.defaultColDef)("rowData",a.todayRowData)("columnDefs",a.colDefs2)("gridThemeClass",a.gridThemedClass))},dependencies:[N$,SA,GV,Rm,bA,lh,d_,Ba,ka,io,Ja,ao,oo,no,to,Fa,Za,Ka,co,eo,$a,hh,ch,fn,Ua,Ya,qa,so,uo,Wa,Yn,Qa,Ha,ja,Xa,lo,za,Oa,ro,Ga,Wn,Va,Xn,qse],styles:[".ag-header-center[_ngcontent-%COMP%] .ag-header-group-cell-label[_ngcontent-%COMP%], .ag-header-center[_ngcontent-%COMP%] .ag-header-cell-label[_ngcontent-%COMP%]{display:grid;justify-content:center;color:#000;text-align:center;background:#000} .ag-theme-datav .ag-row-selected .ag-ltr .ag-cell{color:red!important} .ag-theme-datav .ag-ltr .ag-row-focus{font-weight:600;color:red} .ag-theme-datav .ag-ltr .ag-row-focus .ag-cell-focus{border:#74FAFB} .ag-theme-datav .ag-ltr .ag-row-focus .ag-grid-button-style{color:red;border-color:red} .ag-theme-datav{--ag-border-color: #74FAFB;--ag-foreground-color: #74FAFB;--ag-background-color: #0A1632;--ag-header-foreground-color: #74FAFB;--ag-header-background-color: #0A1632;--ag-odd-row-background-color: #0A1632;--ag-header-column-resize-handle-color: #7e2e84;--ag-font-size: 12px;--ag-font-family: monospace;height:17rem;font-weight:700;border-width:3px} .ag-theme-datav .ag-header-cell-resize{--ag-header-column-resize-handle-color: #00eff8} .ag-theme-datav .ag-header-row{font-size:14px;font-weight:700} .ag-theme-datav .ag-root-wrapper{border-radius:0} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar{width:12em} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb{margin-left:40px;background-color:#00eff8;border:2px solid #00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-track{background-color:transparent;border-color:#00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover{margin-left:40px;background-color:#00eff8} .ag-theme-datav .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:active{background-color:#00eff8} .ag-body-vertical-scroll-viewport{scrollbar-color:auto} .ag-body-horizontal-scroll-viewport{scrollbar-color:auto} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar{height:14em;color:#000} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-track{background-color:transparent;border-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:hover{background-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:active{background-color:#00eff8} .ag-theme-datav .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb{background-color:#00eff8}.button-container[_ngcontent-%COMP%]{display:flex;align-items:center}.lock-button[_ngcontent-%COMP%], .standard-button[_ngcontent-%COMP%], .highlighted-button[_ngcontent-%COMP%]{margin:5px;padding:10px 15px;font-size:20px;color:#fff;border:none}.lock-button[_ngcontent-%COMP%]{background-color:transparent}.standard-button[_ngcontent-%COMP%]{font-size:20px;font-weight:700;line-height:20px;color:#6becf6;text-align:center;background-color:#213069;border-radius:3px}.highlighted-button[_ngcontent-%COMP%]{background-color:#3498db;border-radius:10px}.fa-lock[_ngcontent-%COMP%]{margin-right:5px}.logo[_ngcontent-%COMP%]{width:55px}.car-status-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;margin:1vw;margin-top:5px;padding:1rem;background-image:url(/assets/dashboard/dashboard_card_bg.jpg);background-repeat:no-repeat;background-position:center;background-size:cover}.row[_ngcontent-%COMP%]{display:flex;align-items:stretch;justify-content:space-between;margin-bottom:20px}.item[_ngcontent-%COMP%]{flex-basis:100px;flex-grow:1;margin:20px 10px 10px}.item[_ngcontent-%COMP%]:nth-child{flex-grow:6}.item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:200px;height:200px;margin:10px;object-fit:contain}.info-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-around;margin:0 10px}.model-container[_ngcontent-%COMP%]{display:flex;flex:1;flex-direction:column;justify-content:space-around;margin:0 10px}.info-button[_ngcontent-%COMP%]{margin:5px 0;padding:10px;color:#fff;text-align:center;background-color:#007bff;border-radius:5px;box-shadow:0 2px 4px #0000001a}[nz-carousel-content][_ngcontent-%COMP%]{overflow:hidden;width:150px;height:80px;color:#fff;text-align:center;background:#364d79}h3[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;margin-bottom:0;color:#fff}.card-content-title[_ngcontent-%COMP%]{align-items:center;width:fit-content;height:fit-content;margin-bottom:.5rem;padding:5px 20px;font-size:20px;font-weight:600;line-height:22px;color:#74fafb;color:#00eff8;text-align:center;background-color:#19426e;border:1px solid #1f6f97;border-radius:10px 10px 0 0;box-shadow:inset 0 0 10px #1f6f97}.card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{flex:1;align-self:flex-start}.card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}"]});let r=e;return r})();var jse=(()=>{let e=class e{constructor(){this.http=xn(lu),this.modal=xn(uh)}ngOnInit(){}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=Er({type:e,selectors:[["app-data-v-threejs"]],standalone:!0,features:[Ar],decls:1,vars:0,consts:[["src","http://112.33.111.160:8083/","width","100%","height","650px",2,"border","0"]],template:function(n,a){n&1&&er(0,"iframe",0)},dependencies:[Ba,ka,io,Ja,ao,oo,no,to,Fa,Za,Ka,co,eo,$a,fn,Ua,Ya,qa,so,uo,Wa,Yn,Qa,Ha,ja,Xa,lo,za,Oa,ro,Ga,Wn,Va,Xn]});let r=e;return r})();var TIt=[{path:"s1/:id",component:I$,data:{menu:null}},{path:"second1/:id",component:Zse,data:{menu:null}},{path:"threejs/:id",component:jse},{path:"t1/:id",component:Yse},{path:"lj-table",component:jL},{path:"lj-table",component:jL},{path:"lj-dashboard",component:bA},{path:"lj-textDashboard",component:MA},{path:"ljCarInfoTable",component:SA}];export{TIt as routes};