<!-- SOLIDABILITY · part 69 -->
t e=["webgl2","webgl","experimental-webgl"];if(!0===f.isWebGL1Renderer&&e.shift(),pt=ft(e,t),null===pt)throw ft(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===pt.getShaderPrecisionFormat&&(pt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function gt(){W=new xi(pt),j=new gi(pt,W,t),W.init(j),ut=new ms(pt,W,j),q=new ds(pt,W,j),Y=new bi(pt),Z=new Kr,J=new ps(pt,W,q,Z,j,ut,Y),Q=new yi(f),K=new li(pt,j),dt=new mi(pt,W,K,j),$=new _i(pt,K,Y,dt),tt=new Ei(pt,$,K,Y),lt=new Ti(pt),st=new vi(Z),et=new Qr(f,Q,W,j,dt,st),nt=new _s(Z),it=new ns(Z),rt=new ls(W,j),ot=new pi(f,Q,q,tt,o),at=new us(f,tt,j),ct=new fi(pt,W,Y,j),ht=new wi(pt,W,Y,j),Y.programs=et.programs,f.capabilities=j,f.extensions=W,f.properties=Z,f.renderLists=it,f.shadowMap=at,f.state=q,f.info=Y}gt();const yt=new xs(f,pt);function xt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function _t(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;const t=Y.autoReset,e=at.enabled,n=at.autoUpdate,i=at.needsUpdate,r=at.type;gt(),Y.autoReset=t,at.enabled=e,at.autoUpdate=n,at.needsUpdate=i,at.type=r}function wt(t){const e=t.target;e.removeEventListener("dispose",wt),function(t){(function(t){const e=Z.get(t).programs;void 0!==e&&e.forEach((function(t){et.releaseProgram(t)}))})(t),Z.remove(t)}(e)}this.xr=yt,this.getContext=function(){return pt},this.getContextAttributes=function(){return pt.getContextAttributes()},this.forceContextLoss=function(){const t=W.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=W.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(t){void 0!==t&&(P=t,this.setSize(R,C,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new vt),t.set(R,C)},this.setSize=function(t,n,i){yt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(R=t,C=n,e.width=Math.floor(t*P),e.height=Math.floor(n*P),!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new vt),t.set(R*P,C*P).floor()},this.setDrawingBufferSize=function(t,n,i){R=t,C=n,P=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new St),t.copy(T)},this.getViewport=function(t){return t.copy(N)},this.setViewport=function(t,e,n,i){t.isVector4?N.set(t.x,t.y,t.z,t.w):N.set(t,e,n,i),q.viewport(T.copy(N).multiplyScalar(P).floor())},this.getScissor=function(t){return t.copy(B)},this.setScissor=function(t,e,n,i){t.isVector4?B.set(t.x,t.y,t.z,t.w):B.set(t,e,n,i),q.scissor(A.copy(B).multiplyScalar(P).floor())},this.getScissorTest=function(){return z},this.setScissorTest=function(t){q.setScissorTest(z=t)},this.setOpaqueSort=function(t){D=t},this.setTransparentSort=function(t){I=t},this.getClearColor=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getClearColor() now requires a Color as an argument"),t=new tn),t.copy(ot.getClearColor())},this.setClearColor=function(){ot.setClearColor.apply(ot,arguments)},this.getClearAlpha=function(){return ot.getClearAlpha()},this.setClearAlpha=function(){ot.setClearAlpha.apply(ot,arguments)},this.clear=function(t,e,n){let i=0;(void 0===t||t)&&(i|=16384),(void 0===e||e)&&(i|=256),(void 0===n||n)&&(i|=1024),pt.clear(i)},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(){e.removeEventListener("webglcontextlost",xt,!1),e.removeEventListener("webglcontextrestored",_t,!1),it.dispose(),rt.dispose(),Z.dispose(),Q.dispose(),tt.dispose(),dt.dispose(),yt.dispose(),yt.removeEventListener("sessionstart",Mt),yt.removeEventListener("sessionend",Tt),Et.stop()},this.renderBufferImmediate=function(t,e){dt.initAttributes();const n=Z.get(t);t.hasPositions&&!n.position&&(n.position=pt.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=pt.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=pt.createBuffer()),t.hasColors&&!n.color&&(n.color=pt.createBuffer());const i=e.getAttributes();t.hasPositions&&(pt.bindBuffer(34962,n.position),pt.bufferData(34962,t.positionArray,35048),dt.enableAttribute(i.position),pt.vertexAttribPointer(i.position,3,5126,!1,0,0)),t.hasNormals&&(pt.bindBuffer(34962,n.normal),pt.bufferData(34962,t.normalArray,35048),dt.enableAttribute(i.normal),pt.vertexAttribPointer(i.normal,3,5126,!1,0,0)),t.hasUvs&&(pt.bindBuffer(34962,n.uv),pt.buffe