<!-- SOLID-PLAYTIME · part 139 -->
C);let s=new C,a=new ie,r=new ie;function o(c){let u=0,f=0,h=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let p=0,v=0,y=0,U=0,d=0,g=0,m=0,x=0,S=0,A=0,T=0;c.sort(c3);for(let b=0,M=c.length;b<M;b++){let R=c[b],{color:O,intensity:V,distance:k}=R,et=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)u+=O.r*V,f+=O.g*V,h+=O.b*V;else if(R.isLightProbe){for(let Z=0;Z<9;Z++)i.probe[Z].addScaledVector(R.sh.coefficients[Z],V);T++}else if(R.isDirectionalLight){let Z=e.get(R);if(Z.color.copy(R.color).multiplyScalar(R.intensity),R.castShadow){let at=R.shadow,W=n.get(R);W.shadowIntensity=at.intensity,W.shadowBias=at.bias,W.shadowNormalBias=at.normalBias,W.shadowRadius=at.radius,W.shadowMapSize=at.mapSize,i.directionalShadow[p]=W,i.directionalShadowMap[p]=et,i.directionalShadowMatrix[p]=R.shadow.matrix,g++}i.directional[p]=Z,p++}else if(R.isSpotLight){let Z=e.get(R);Z.position.setFromMatrixPosition(R.matrixWorld),Z.color.copy(O).multiplyScalar(V),Z.distance=k,Z.coneCos=Math.cos(R.angle),Z.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),Z.decay=R.decay,i.spot[y]=Z;let at=R.shadow;if(R.map){if(i.spotLightMap[S]=R.map,S++,at.updateMatrices(R),R.castShadow)A++}if(i.spotLightMatrix[y]=at.matrix,R.castShadow){let W=n.get(R);W.shadowIntensity=at.intensity,W.shadowBias=at.bias,W.shadowNormalBias=at.normalBias,W.shadowRadius=at.radius,W.shadowMapSize=at.mapSize,i.spotShadow[y]=W,i.spotShadowMap[y]=et,x++}y++}else if(R.isRectAreaLight){let Z=e.get(R);Z.color.copy(O).multiplyScalar(V),Z.halfWidth.set(R.width*0.5,0,0),Z.halfHeight.set(0,R.height*0.5,0),i.rectArea[U]=Z,U++}else if(R.isPointLight){let Z=e.get(R);if(Z.color.copy(R.color).multiplyScalar(R.intensity),Z.distance=R.distance,Z.decay=R.decay,R.castShadow){let at=R.shadow,W=n.get(R);W.shadowIntensity=at.intensity,W.shadowBias=at.bias,W.shadowNormalBias=at.normalBias,W.shadowRadius=at.radius,W.shadowMapSize=at.mapSize,W.shadowCameraNear=at.camera.near,W.shadowCameraFar=at.camera.far,i.pointShadow[v]=W,i.pointShadowMap[v]=et,i.pointShadowMatrix[v]=R.shadow.matrix,m++}i.point[v]=Z,v++}else if(R.isHemisphereLight){let Z=e.get(R);Z.skyColor.copy(R.color).multiplyScalar(V),Z.groundColor.copy(R.groundColor).multiplyScalar(V),i.hemi[d]=Z,d++}}if(U>0)if(t.has("OES_texture_float_linear")===!0)i.rectAreaLTC1=bt.LTC_FLOAT_1,i.rectAreaLTC2=bt.LTC_FLOAT_2;else i.rectAreaLTC1=bt.LTC_HALF_1,i.rectAreaLTC2=bt.LTC_HALF_2;i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=h;let w=i.hash;if(w.directionalLength!==p||w.pointLength!==v||w.spotLength!==y||w.rectAreaLength!==U||w.hemiLength!==d||w.numDirectionalShadows!==g||w.numPointShadows!==m||w.numSpotShadows!==x||w.numSpotMaps!==S||w.numLightProbes!==T)i.directional.length=p,i.spot.length=y,i.rectArea.length=U,i.point.length=v,i.hemi.length=d,i.directionalShadow.length=g,i.directionalShadowMap.length=g,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=x,i.spotShadowMap.length=x,i.directionalShadowMatrix.length=g,i.pointShadowMatrix.length=m,i.spotLightMatrix.length=x+S-A,i.spotLightMap.length=S,i.numSpotLightShadowsWithMaps=A,i.numLightProbes=T,w.directionalLength=p,w.pointLength=v,w.spotLength=y,w.rectAreaLength=U,w.hemiLength=d,w.numDirectionalShadows=g,w.numPointShadows=m,w.numSpotShadows=x,w.numSpotMaps=S,w.numLightProbes=T,i.version=l3++}function l(c,u){let f=0,h=0,p=0,v=0,y=0,U=u.matrixWorldInverse;for(let d=0,g=c.length;d<g;d++){let m=c[d];if(m.isDirectionalLight){let x=i.directional[f];x.direction.setFromMatrixPosition(m.matrixWorld),s.setFromMatrixPosition(m.target.matrixWorld),x.direction.sub(s),x.direction.transformDirection(U),f++}else if(m.isSpotLight){let x=i.spot[p];x.position.setFromMatrixPosition(m.matrixWorld),x.position.applyMatrix4(U),x.direction.setFromMatrixPosition(m.matrixWorld),s.setFromMatrixPosition(m.target.matrixWorld),x.direction.sub(s),x.direction.transformDirection(U),p++}else if(m.isRectAreaLight){let x=i.rectArea[v];x.position.setFromMatrixPosition(m.matrixWorld),x.position.applyMatrix4(U),r.identity(),a.copy(m.matrixWorld),a.premultiply(U),r.extractRotation(a),x.halfWidth.set(m.width*0.5,0,0),x.halfHeight.set(0,m.height*0.5,0),x.halfWidth.applyMatrix4(r),x.halfHeight.applyMatrix4(r),v++}else if(m.isPointLight){let x=i.point[h];x.position.setFromMatrixPosition(m.matrixWorld),x.position.applyMatrix4(U),h++}else if(m.isHemisphereLight){let x=i.hemi[y];x.direction.setFromMatrixPosition(m.matrixWorld),x.direction.transformDirection(U),y++}}}return{setup:o,setupView:l,state:i}}function fM(t){let e=new u3(t),n=[],i=[];function s(u){c.camera=u,n.length=0,i.length=0}function a(u){n.push(u)}function r(u){i.push(u)}function o(){e.setup(n)}function l(u){e.setupView(n,u)}let c={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:s,state:c,setupLights:o,setupLightsView:l,pushLight:a,pushShadow:r}}function h3(t){let e=new WeakMap;function n(s,a=0){let r=e.get(s),o;if(r===void 0)o=new fM(t),e.set(s,[o]);else if(a>=r.length)o=new 