1import{e as Xm,n as q1,p as Y1,q as j1,r as Ze,j as Ge}from"./index-Bj_V9Is2.js";import{c as $1,u as cc}from"./index-B40885wD.js";import"./index-jXZE__wZ.js";import"./utils-BB1SQE6n.js";import"./Combination-B5UZjfX-.js";import"./x-DA1vm-qO.js";import"./createLucideIcon-CWIq_39t.js";const Zo="184",Z1={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},K1={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},dy=0,_m=1,py=2,J1=3,my=0,ko=1,Zl=2,xa=3,Is=0,Nn=1,ni=2,jn=0,ba=1,Ho=2,ym=3,Sm=4,gy=5,Q1=6,Ir=100,vy=101,xy=102,_y=103,yy=104,Sy=200,by=201,My=202,Ey=203,Mh=204,Eh=205,Ty=206,wy=207,Ay=208,Cy=209,Ry=210,Iy=211,Py=212,Ly=213,Dy=214,Th=0,uc=1,wh=2,wa=3,Ah=4,Ch=5,Rh=6,Ih=7,Ic=0,Ny=1,Uy=2,zi=0,qm=1,Ym=2,jm=3,yf=4,$m=5,Zm=6,Km=7,bm="attached",Fy="detached",Sf=300,Ps=301,Nr=302,Kl=303,Jl=304,Ko=306,hc=1e3,bi=1001,fc=1002,cn=1003,Jm=1004,eE=1004,Oo=1005,tE=1005,nn=1006,Ql=1007,nE=1007,Cs=1008,iE=1008,yn=1009,Qm=1010,eg=1011,Go=1012,bf=1013,ji=1014,Yn=1015,fs=1016,Mf=1017,Ef=1018,Aa=1020,tg=35902,ng=35899,ig=1021,sg=1022,ii=1023,Ls=1026,er=1027,Tf=1028,Pc=1029,Ur=1030,wf=1031,sE=1032,Af=1033,ec=33776,tc=33777,nc=33778,ic=33779,Ph=35840,Lh=35841,Dh=35842,Nh=35843,Uh=36196,Fh=37492,Oh=37496,Bh=37488,zh=37489,dc=37490,kh=37491,Vh=37808,Hh=37809,Gh=37810,Wh=37811,Xh=37812,qh=37813,Yh=37814,jh=37815,$h=37816,Zh=37817,Kh=37818,Jh=37819,Qh=37820,ef=37821,tf=36492,nf=36494,sf=36495,rf=36283,af=36284,pc=36285,of=36286,Oy=2200,By=2201,zy=2202,mc=2300,lf=2301,_h=2302,Mm=2303,_a=2400,ya=2401,gc=2402,Cf=2500,rg=2501,rE=0,aE=1,oE=2,zr=3200,lE=3201,cE=3202,uE=3203,nr=0,ky=1,cs="",$t="srgb",Fr="srgb-linear",vc="linear",Jt="srgb",hE="",fE="rg",dE="ga",pE=0,ga=7680,mE=7681,gE=7682,vE=7683,xE=34055,_E=34056,yE=5386,SE=512,bE=513,ME=514,EE=515,TE=516,wE=517,AE=518,Em=519,Vy=512,Hy=513,Gy=514,Rf=515,Wy=516,Xy=517,If=518,qy=519,xc=35044,CE=35048,RE=35040,IE=35045,PE=35049,LE=35041,DE=35046,NE=35050,UE=35042,FE="100",Tm="300 es",Bi=2e3,Ca=2001,OE={COMPUTE:"compute",RENDER:"render"},BE={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},zE={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},kE={TEXTURE_COMPARE:"depthTextureCompare"};function VE(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}const HE={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Bo(i,e){return new HE[i](e)}function Yy(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function _c(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function jy(){const i=_c("canvas");return i.style.display="block",i}const px={};let Or=null;function GE(i){Or=i}function WE(){return Or}function yc(...i){const e="THREE."+i.shift();Or?Or("log",e,...i):console.log(e,...i)}function $y(i){const e=i[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=i[1];t&&t.isStackTrace?i[0]+=" "+t.getLocation():i[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return i}function De(...i){i=$y(i);const e="THREE."+i.shift();if(Or)Or("warn",e,...i);else{const t=i[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...i)}}function Qe(...i){i=$y(i);const e="THREE."+i.shift();if(Or)Or("error",e,...i);else{const t=i[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...i)}}function cf(...i){const e=i.join(" ");e in px||(px[e]=!0,De(...i))}function XE(i,e,t){return new Promise(function(n,s){function o(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(o,t);break;default:n()}}setTimeout(o,t)})}const qE={[Th]:uc,[wh]:Rh,[Ah]:Ih,[wa]:Ch,[uc]:Th,[Rh]:wh,[Ih]:Ah,[Ch]:wa};class Mi{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const s=n[e];if(s!==void 0){const o=s.indexOf(t);o!==-1&&s.splice(o,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let o=0,l=s.length;o<l;o++)s[o].call(this,e);e.target=null}}}const Qn=["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","5
15","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"];let mx=1234567;const Ma=Math.PI/180,Wo=180/Math.PI;function ki(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Qn[i&255]+Qn[i>>8&255]+Qn[i>>16&255]+Qn[i>>24&255]+"-"+Qn[e&255]+Qn[e>>8&255]+"-"+Qn[e>>16&15|64]+Qn[e>>24&255]+"-"+Qn[t&63|128]+Qn[t>>8&255]+"-"+Qn[t>>16&255]+Qn[t>>24&255]+Qn[n&255]+Qn[n>>8&255]+Qn[n>>16&255]+Qn[n>>24&255]).toLowerCase()}function ft(i,e,t){return Math.max(e,Math.min(t,i))}function ag(i,e){return(i%e+e)%e}function YE(i,e,t,n,s){return n+(i-e)*(s-n)/(t-e)}function jE(i,e,t){return i!==e?(t-i)/(e-i):0}function sc(i,e,t){return(1-t)*i+t*e}function $E(i,e,t,n){return sc(i,e,1-Math.exp(-t*n))}function ZE(i,e=1){return e-Math.abs(ag(i,e*2)-e)}function KE(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function JE(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function QE(i,e){return i+Math.floor(Math.random()*(e-i+1))}function eT(i,e){return i+Math.random()*(e-i)}function tT(i){return i*(.5-Math.random())}function nT(i){i!==void 0&&(mx=i);let e=mx+=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 iT(i){return i*Ma}function sT(i){return i*Wo}function rT(i){return(i&i-1)===0&&i!==0}function aT(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function oT(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function lT(i,e,t,n,s){const o=Math.cos,l=Math.sin,c=o(t/2),h=l(t/2),f=o((e+n)/2),p=l((e+n)/2),g=o((e-n)/2),m=l((e-n)/2),v=o((n-e)/2),y=l((n-e)/2);switch(s){case"XYX":i.set(c*p,h*g,h*m,c*f);break;case"YZY":i.set(h*m,c*p,h*g,c*f);break;case"ZXZ":i.set(h*g,h*m,c*p,c*f);break;case"XZX":i.set(c*p,h*y,h*v,c*f);break;case"YXY":i.set(h*v,c*p,h*y,c*f);break;case"ZYZ":i.set(h*y,h*v,c*p,c*f);break;default:De("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function ui(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function wt(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const Js={DEG2RAD:Ma,RAD2DEG:Wo,generateUUID:ki,clamp:ft,euclideanModulo:ag,mapLinear:YE,inverseLerp:jE,lerp:sc,damp:$E,pingpong:ZE,smoothstep:KE,smootherstep:JE,randInt:QE,randFloat:eT,randFloatSpread:tT,seededRandom:nT,degToRad:iT,radToDeg:sT,isPowerOfTwo:rT,ceilPowerOfTwo:aT,floorPowerOfTwo:oT,setQuaternionFromProperEuler:lT,normalize:wt,denormalize:ui},Vg=class Vg{constructor(e=0,t=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}
vendor: 9,571 bytes, line 1
1sub(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){const t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[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=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ft(n,e,t))}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){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(ft(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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){const n=Math.cos(t),s=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*n-l*s+e.x,this.y=o*s+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Vg.prototype.isVector2=!0;let ae=Vg;class hi{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,o,l,c){let h=n[s+0],f=n[s+1],p=n[s+2],g=n[s+3],m=o[l+0],v=o[l+1],y=o[l+2],E=o[l+3];if(g!==E||h!==m||f!==v||p!==y){let S=h*m+f*v+p*y+g*E;S<0&&(m=-m,v=-v,y=-y,E=-E,S=-S);let _=1-c;if(S<.9995){const M=Math.acos(S),T=Math.sin(M);_=Math.sin(_*M)/T,c=Math.sin(c*M)/T,h=h*_+m*c,f=f*_+v*c,p=p*_+y*c,g=g*_+E*c}else{h=h*_+m*c,f=f*_+v*c,p=p*_+y*c,g=g*_+E*c;const M=1/Math.sqrt(h*h+f*f+p*p+g*g);h*=M,f*=M,p*=M,g*=M}}e[t]=h,e[t+1]=f,e[t+2]=p,e[t+3]=g}static multiplyQuaternionsFlat(e,t,n,s,o,l){const c=n[s],h=n[s+1],f=n[s+2],p=n[s+3],g=o[l],m=o[l+1],v=o[l+2],y=o[l+3];return e[t]=c*y+p*g+h*v-f*m,e[t+1]=h*y+p*m+f*g-c*v,e[t+2]=f*y+p*v+c*m-h*g,e[t+3]=p*y-c*g-h*m-f*v,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,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,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){const n=e._x,s=e._y,o=e._z,l=e._order,c=Math.cos,h=Math.sin,f=c(n/2),p=c(s/2),g=c(o/2),m=h(n/2),v=h(s/2),y=h(o/2);switch(l){case"XYZ":this._x=m*p*g+f*v*y,this._y=f*v*g-m*p*y,this._z=f*p*y+m*v*g,this._w=f*p*g-m*v*y;break;case"YXZ":this._x=m*p*g+f*v*y,this._y=f*v*g-m*p*y,this._z=f*p*y-m*v*g,this._w=f*p*g+m*v*y;break;case"ZXY":this._x=m*p*g-f*v*y,this._y=f*v*g+m*p*y,this._z=f*p*y+m*v*g,this._w=f*p*g-m*v*y;break;case"ZYX":this._x=m*p*g-f*v*y,this._y=f*v*g+m*p*y,this._z=f*p*y-m*v*g,this._w=f*p*g+m*v*y;break;case"YZX":this._x=m*p*g+f*v*y,this._y=f*v*g+m*p*y,this._z=f*p*y-m*v*g,this._w=f*p*g-m*v*y;break;case"XZY":this._x=m*p*g-f*v*y,this._y=f*v*g-m*p*y,this._z=f*p*y+m*v*g,this._w=f*p*g+m*v*y;break;default:De("Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],s=t[4],o=t[8],l=t[1],c=t[5],h=t[9],f=t[2],p=t[6],g=t[10],m=n+c+g;if(m>0){const v=.5/Math.sqrt(m+1);this._w=.25/v,this._x=(p-h)*v,this._y=(o-f)*v,this._z=(l-s)*v}else if(n>c&&n>g){const v=2*Math.sqrt(1+n-c-g);this._w=(p-h)/v,this._x=.25*v,this._y=(s+l)/v,this._z=(o+f)/v}else if(c>g){const v=2*Math.sqrt(1+c-n-g);this._w=(o-f)/v,this._x=(s+l)/v,this._y=.25*v,this._z=(h+p)/v}else{const v=2*Math.sqrt(1+g-n-c);this._w=(l-s)/v,this._x=(o+f)/v,this._y=(h+p)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ft(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const s=Math.min(1,t/n);return this.slerp(e,s),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){const n=e._x,s=e._y,o=e._z,l=e._w,c=t._x,h=t._y,f=t._z,p=t._w;return this._x=n*p+l*c+s*f-o*h,this._y=s*p+l*h+o*c-n*f,this._z=o*p+l*f+n*h-s*c,this._w=l*p-n*c-s*h-o*f,this._onChangeCallback(),this}slerp(e,t){let n=e._x,s=e._y,o=e._z,l=e._w,c=this.dot(e);c<0&&(n=-n,s=-s,o=-o,l=-l,c=-c);let h=1-t;if(c<.9995){const f=Math.acos(c),p=Math.sin(f);h=Math.sin(h*f)/p,t=Math.sin(t*f)/p,this._x=this._x*h+n*t,this._y=this._y*h+s*t,this._z=this._z*h+o*t,this._w=this._w*h+l*t,this._onChangeCallback()}else this._x=this._x*h+n*t,this._y=this._y*h+s*t,this._z=this._z*h+o*t,this._w=this._w*h+l*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),o=Math.sqrt(n);return this.set(s*Math.sin(e),s*Math.cos(e),o*Math.sin(t),o*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}}const Hg=class Hg{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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(gx.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(gx.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,s=this.z,o=e.elements;
vendor: 6,498 bytes, line 1
1return this.x=o[0]*t+o[3]*n+o[6]*s,this.y=o[1]*t+o[4]*n+o[7]*s,this.z=o[2]*t+o[5]*n+o[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,o=e.elements,l=1/(o[3]*t+o[7]*n+o[11]*s+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*s+o[12])*l,this.y=(o[1]*t+o[5]*n+o[9]*s+o[13])*l,this.z=(o[2]*t+o[6]*n+o[10]*s+o[14])*l,this}applyQuaternion(e){const t=this.x,n=this.y,s=this.z,o=e.x,l=e.y,c=e.z,h=e.w,f=2*(l*s-c*n),p=2*(c*t-o*s),g=2*(o*n-l*t);return this.x=t+h*f+l*g-c*p,this.y=n+h*p+c*f-o*g,this.z=s+h*g+o*p-l*f,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*s,this.y=o[1]*t+o[5]*n+o[9]*s,this.z=o[2]*t+o[6]*n+o[10]*s,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=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this.z=ft(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this.z=ft(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ft(n,e,t))}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,s=e.y,o=e.z,l=t.x,c=t.y,h=t.z;return this.x=s*h-o*c,this.y=o*l-n*h,this.z=n*c-s*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return _p.copy(this).projectOnVector(e),this.sub(_p)}reflect(e){return this.sub(_p.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(ft(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}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,n){const s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Hg.prototype.isVector3=!0;let B=Hg;const _p=new B,gx=new hi,Gg=class Gg{constructor(e,t,n,s,o,l,c,h,f){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,s,o,l,c,h,f)}set(e,t,n,s,o,l,c,h,f){const p=this.elements;return p[0]=e,p[1]=s,p[2]=c,p[3]=t,p[4]=o,p[5]=h,p[6]=n,p[7]=l,p[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const 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){const n=e.elements,s=t.elements,o=this.elements,l=n[0],c=n[3],h=n[6],f=n[1],p=n[4],g=n[7],m=n[2],v=n[5],y=n[8],E=s[0],S=s[3],_=s[6],M=s[1],T=s[4],A=s[7],D=s[2],R=s[5],F=s[8];return o[0]=l*E+c*M+h*D,o[3]=l*S+c*T+h*R,o[6]=l*_+c*A+h*F,o[1]=f*E+p*M+g*D,o[4]=f*S+p*T+g*R,o[7]=f*_+p*A+g*F,o[2]=m*E+v*M+y*D,o[5]=m*S+v*T+y*R,o[8]=m*_+v*A+y*F,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],l=e[4],c=e[5],h=e[6],f=e[7],p=e[8];return t*l*p-t*c*f-n*o*p+n*c*h+s*o*f-s*l*h}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],l=e[4],c=e[5],h=e[6],f=e[7],p=e[8],g=p*l-c*f,m=c*h-p*o,v=f*o-l*h,y=t*g+n*m+s*v;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/y;
vendor: 23,197 bytes, line 1
1return e[0]=g*E,e[1]=(s*f-p*n)*E,e[2]=(c*n-s*l)*E,e[3]=m*E,e[4]=(p*t-s*h)*E,e[5]=(s*o-c*t)*E,e[6]=v*E,e[7]=(n*h-f*t)*E,e[8]=(l*t-n*o)*E,this}transpose(){let e;const 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){const 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,n,s,o,l,c){const h=Math.cos(o),f=Math.sin(o);return this.set(n*h,n*f,-n*(h*l+f*c)+l+e,-s*f,s*h,-s*(-f*l+h*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(yp.makeScale(e,t)),this}rotate(e){return this.premultiply(yp.makeRotation(-e)),this}translate(e,t){return this.premultiply(yp.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){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};Gg.prototype.isMatrix3=!0;let xt=Gg;const yp=new xt,vx=new xt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xx=new xt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function cT(){const i={enabled:!0,workingColorSpace:Fr,spaces:{},convert:function(s,o,l){return this.enabled===!1||o===l||!o||!l||(this.spaces[o].transfer===Jt&&(s.r=tr(s.r),s.g=tr(s.g),s.b=tr(s.b)),this.spaces[o].primaries!==this.spaces[l].primaries&&(s.applyMatrix3(this.spaces[o].toXYZ),s.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Jt&&(s.r=Vo(s.r),s.g=Vo(s.g),s.b=Vo(s.b))),s},workingToColorSpace:function(s,o){return this.convert(s,this.workingColorSpace,o)},colorSpaceToWorking:function(s,o){return this.convert(s,o,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===cs?vc:this.spaces[s].transfer},getToneMappingMode:function(s){return this.spaces[s].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(s,o=this.workingColorSpace){return s.fromArray(this.spaces[o].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,o,l){return s.copy(this.spaces[o].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(s,o){return cf("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(s,o)},toWorkingColorSpace:function(s,o){return cf("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(s,o)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[Fr]:{primaries:e,whitePoint:n,transfer:vc,toXYZ:vx,fromXYZ:xx,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:$t},outputColorSpaceConfig:{drawingBufferColorSpace:$t}},[$t]:{primaries:e,whitePoint:n,transfer:Jt,toXYZ:vx,fromXYZ:xx,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:$t}}}),i}const It=cT();function tr(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Vo(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let fo;class Zy{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{fo===void 0&&(fo=_c("canvas")),fo.width=e.width,fo.height=e.height;const s=fo.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=fo}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=_c("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const s=n.getImageData(0,0,e.width,e.height),o=s.data;for(let l=0;l<o.length;l++)o[l]=tr(o[l]/255)*255;return n.putImageData(s,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(tr(t[n]/255)*255):t[n]=tr(t[n]);return{data:t,width:e.width,height:e.height}}else return De("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let uT=0;class Lr{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:uT++}),this.uuid=ki(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},s=this.data;if(s!==null){let o;if(Array.isArray(s)){o=[];for(let l=0,c=s.length;l<c;l++)s[l].isDataTexture?o.push(Sp(s[l].image)):o.push(Sp(s[l]))}else o=Sp(s);n.url=o}return t||(e.images[this.uuid]=n),n}}function Sp(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?Zy.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(De("Texture: Unable to serialize Texture."),{})}let hT=0;const bp=new B;class un extends Mi{constructor(e=un.DEFAULT_IMAGE,t=un.DEFAULT_MAPPING,n=bi,s=bi,o=nn,l=Cs,c=ii,h=yn,f=un.DEFAULT_ANISOTROPY,p=cs){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:hT++}),this.uuid=ki(),this.name="",this.source=new Lr(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=s,this.magFilter=o,this.minFilter=l,this.anisotropy=f,this.format=c,this.internalFormat=null,this.type=h,this.offset=new ae(0,0),this.repeat=new ae(1,1),this.center=new ae(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new xt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(bp).x}get height(){return this.source.getSize(bp).y}get depth(){return this.source.getSize(bp).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){De(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){De(`Texture.setValues(): property '${t}' does not exist.`);continue}s&&n&&s.isVector2&&n.isVector2||s&&n&&s.isVector3&&n.isVector3||s&&n&&s.isMatrix3&&n.isMatrix3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).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,normalized:this.normalized,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),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Sf)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case hc:e.x=e.x-Math.floor(e.x);break;case bi:e.x=e.x<0?0:1;break;case fc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case hc:e.y=e.y-Math.floor(e.y);break;case bi:e.y=e.y<0?0:1;break;case fc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}un.DEFAULT_IMAGE=null;un.DEFAULT_MAPPING=Sf;un.DEFAULT_ANISOTROPY=1;const Wg=class Wg{constructor(e=0,t=0,n=0,s=1){this.x=e,this.y=t,this.z=n,this.w=s}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,n,s){return this.x=e,this.y=t,this.z=n,this.w=s,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){const t=this.x,n=this.y,s=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*s+l[12]*o,this.y=l[1]*t+l[5]*n+l[9]*s+l[13]*o,this.z=l[2]*t+l[6]*n+l[10]*s+l[14]*o,this.w=l[3]*t+l[7]*n+l[11]*s+l[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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,n,s,o;const h=e.elements,f=h[0],p=h[4],g=h[8],m=h[1],v=h[5],y=h[9],E=h[2],S=h[6],_=h[10];if(Math.abs(p-m)<.01&&Math.abs(g-E)<.01&&Math.abs(y-S)<.01){if(Math.abs(p+m)<.1&&Math.abs(g+E)<.1&&Math.abs(y+S)<.1&&Math.abs(f+v+_-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const T=(f+1)/2,A=(v+1)/2,D=(_+1)/2,R=(p+m)/4,F=(g+E)/4,w=(y+S)/4;return T>A&&T>D?T<.01?(n=0,s=.707106781,o=.707106781):(n=Math.sqrt(T),s=R/n,o=F/n):A>D?A<.01?(n=.707106781,s=0,o=.707106781):(s=Math.sqrt(A),n=R/s,o=w/s):D<.01?(n=.707106781,s=.707106781,o=0):(o=Math.sqrt(D),n=F/o,s=w/o),this.set(n,s,o,t),this}let M=Math.sqrt((S-y)*(S-y)+(g-E)*(g-E)+(m-p)*(m-p));return Math.abs(M)<.001&&(M=1),this.x=(S-y)/M,this.y=(g-E)/M,this.z=(m-p)/M,this.w=Math.acos((f+v+_-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],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=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this.z=ft(this.z,e.z,t.z),this.w=ft(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this.z=ft(this.z,e,t),this.w=ft(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(ft(n,e,t))}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,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}};Wg.prototype.isVector4=!0;let Zt=Wg;class og extends Mi{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:nn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Zt(0,0,e,t),this.scissorTest=!1,this.viewport=new Zt(0,0,e,t),this.textures=[];const s={width:e,height:t,depth:n.depth},o=new un(s),l=n.count;for(let c=0;c<l;c++)this.textures[c]=o.clone(),this.textures[c].isRenderTargetTexture=!0,this.textures[c].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:nn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let s=0,o=this.textures.length;s<o;s++)this.textures[s].image.width=e,this.textures[s].image.height=t,this.textures[s].image.depth=n,this.textures[s].isData3DTexture!==!0&&(this.textures[s].isArrayTexture=this.textures[s].image.depth>1);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 t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const s=Object.assign({},e.textures[t].image);this.textures[t].source=new Lr(s)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}}class fn extends og{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Pf extends un{constructor(e=null,t=1,n=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=cn,this.minFilter=cn,this.wrapR=bi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class fT extends fn{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Pf(null,e,t,n),this._setTextureOptions(s),this.texture.isRenderTargetTexture=!0}}class Lf extends un{constructor(e=null,t=1,n=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=cn,this.minFilter=cn,this.wrapR=bi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class dT extends fn{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Lf(null,e,t,n),this._setTextureOptions(s),this.texture.isRenderTargetTexture=!0}}const _f=class _f{constructor(e,t,n,s,o,l,c,h,f,p,g,m,v,y,E,S){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,n,s,o,l,c,h,f,p,g,m,v,y,E,S)}set(e,t,n,s,o,l,c,h,f,p,g,m,v,y,E,S){const _=this.elements;return _[0]=e,_[4]=t,_[8]=n,_[12]=s,_[1]=o,_[5]=l,_[9]=c,_[13]=h,_[2]=f,_[6]=p,_[10]=g,_[14]=m,_[3]=v,_[7]=y,_[11]=E,_[15]=S,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 _f().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const 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,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,n=e.elements,s=1/po.setFromMatrixColumn(e,0).length(),o=1/po.setFromMatrixColumn(e,1).length(),l=1/po.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,s=e.y,o=e.z,l=Math.cos(n),c=Math.sin(n),h=Math.cos(s),f=Math.sin(s),p=Math.cos(o),g=Math.sin(o);if(e.order==="XYZ"){const m=l*p,v=l*g,y=c*p,E=c*g;t[0]=h*p,t[4]=-h*g,t[8]=f,t[1]=v+y*f,t[5]=m-E*f,t[9]=-c*h,t[2]=E-m*f,t[6]=y+v*f,t[10]=l*h}else if(e.order==="YXZ"){const m=h*p,v=h*g,y=f*p,E=f*g;t[0]=m+E*c,t[4]=y*c-v,t[8]=l*f,t[1]=l*g,t[5]=l*p,t[9]=-c,t[2]=v*c-y,t[6]=E+m*c,t[10]=l*h}else if(e.order==="ZXY"){const m=h*p,v=h*g,y=f*p,E=f*g;t[0]=m-E*c,t[4]=-l*g,t[8]=y+v*c,t[1]=v+y*c,t[5]=l*p,t[9]=E-m*c,t[2]=-l*f,t[6]=c,t[10]=l*h}else if(e.order==="ZYX"){const m=l*p,v=l*g,y=c*p,E=c*g;t[0]=h*p,t[4]=y*f-v,t[8]=m*f+E,t[1]=h*g,t[5]=E*f+m,t[9]=v*f-y,t[2]=-f,t[6]=c*h,t[10]=l*h}else if(e.order==="YZX"){const m=l*h,v=l*f,y=c*h,E=c*f;t[0]=h*p,t[4]=E-m*g,t[8]=y*g+v,t[1]=g,t[5]=l*p,t[9]=-c*p,t[2]=-f*p,t[6]=v*g+y,t[10]=m-E*g}else if(e.order==="XZY"){const m=l*h,v=l*f,y=c*h,E=c*f;t[0]=h*p,t[4]=-g,t[8]=f*p,t[1]=m*g+E,t[5]=l*p,t[9]=v*g-y,t[2]=y*g-v,t[6]=c*p,t[10]=E*g+m}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(pT,e,mT)}lookAt(e,t,n){const s=this.elements;return Fi.subVectors(e,t),Fi.lengthSq()===0&&(Fi.z=1),Fi.normalize(),Sr.crossVectors(n,Fi),Sr.lengthSq()===0&&(Math.abs(n.z)===1?Fi.x+=1e-4:Fi.z+=1e-4,Fi.normalize(),Sr.crossVectors(n,Fi)),Sr.normalize(),Au.crossVectors(Fi,Sr),s[0]=Sr.x,s[4]=Au.x,s[8]=Fi.x,s[1]=Sr.y,s[5]=Au.y,s[9]=Fi.y,s[2]=Sr.z,s[6]=Au.z,s[
vendor: 4,778 bytes, line 1
110]=Fi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,o=this.elements,l=n[0],c=n[4],h=n[8],f=n[12],p=n[1],g=n[5],m=n[9],v=n[13],y=n[2],E=n[6],S=n[10],_=n[14],M=n[3],T=n[7],A=n[11],D=n[15],R=s[0],F=s[4],w=s[8],L=s[12],U=s[1],O=s[5],H=s[9],W=s[13],Z=s[2],V=s[6],$=s[10],K=s[14],he=s[3],ce=s[7],ye=s[11],ge=s[15];return o[0]=l*R+c*U+h*Z+f*he,o[4]=l*F+c*O+h*V+f*ce,o[8]=l*w+c*H+h*$+f*ye,o[12]=l*L+c*W+h*K+f*ge,o[1]=p*R+g*U+m*Z+v*he,o[5]=p*F+g*O+m*V+v*ce,o[9]=p*w+g*H+m*$+v*ye,o[13]=p*L+g*W+m*K+v*ge,o[2]=y*R+E*U+S*Z+_*he,o[6]=y*F+E*O+S*V+_*ce,o[10]=y*w+E*H+S*$+_*ye,o[14]=y*L+E*W+S*K+_*ge,o[3]=M*R+T*U+A*Z+D*he,o[7]=M*F+T*O+A*V+D*ce,o[11]=M*w+T*H+A*$+D*ye,o[15]=M*L+T*W+A*K+D*ge,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[4],s=e[8],o=e[12],l=e[1],c=e[5],h=e[9],f=e[13],p=e[2],g=e[6],m=e[10],v=e[14],y=e[3],E=e[7],S=e[11],_=e[15],M=h*v-f*m,T=c*v-f*g,A=c*m-h*g,D=l*v-f*p,R=l*m-h*p,F=l*g-c*p;return t*(E*M-S*T+_*A)-n*(y*M-S*D+_*R)+s*(y*T-E*D+_*F)-o*(y*A-E*R+S*F)}transpose(){const e=this.elements;let 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,n){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],l=e[4],c=e[5],h=e[6],f=e[7],p=e[8],g=e[9],m=e[10],v=e[11],y=e[12],E=e[13],S=e[14],_=e[15],M=t*c-n*l,T=t*h-s*l,A=t*f-o*l,D=n*h-s*c,R=n*f-o*c,F=s*f-o*h,w=p*E-g*y,L=p*S-m*y,U=p*_-v*y,O=g*S-m*E,H=g*_-v*E,W=m*_-v*S,Z=M*W-T*H+A*O+D*U-R*L+F*w;if(Z===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const V=1/Z;return e[0]=(c*W-h*H+f*O)*V,e[1]=(s*H-n*W-o*O)*V,e[2]=(E*F-S*R+_*D)*V,e[3]=(m*R-g*F-v*D)*V,e[4]=(h*U-l*W-f*L)*V,e[5]=(t*W-s*U+o*L)*V,e[6]=(S*A-y*F-_*T)*V,e[7]=(p*F-m*A+v*T)*V,e[8]=(l*H-c*U+f*w)*V,e[9]=(n*U-t*H-o*w)*V,e[10]=(y*R-E*A+_*M)*V,e[11]=(g*A-p*R-v*M)*V,e[12]=(c*L-l*O-h*w)*V,e[13]=(t*O-n*L+s*w)*V,e[14]=(E*T-y*D-S*M)*V,e[15]=(p*D-g*T+m*M)*V,this}scale(e){const t=this.elements,n=e.x,s=e.y,o=e.z;return t[0]*=n,t[4]*=s,t[8]*=o,t[1]*=n,t[5]*=s,t[9]*=o,t[2]*=n,t[6]*=s,t[10]*=o,t[3]*=n,t[7]*=s,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,s))}makeTranslation(e,t,n){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,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),s=Math.sin(t),o=1-n,l=e.x,c=e.y,h=e.z,f=o*l,p=o*c;return this.set(f*l+n,f*c-s*h,f*h+s*c,0,f*c+s*h,p*c+n,p*h-s*l,0,f*h-s*c,p*h+s*l,o*h*h+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,o,l){return this.set(1,n,o,0,e,1,l,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){const s=this.elements,o=t._x,l=t._y,c=t._z,h=t._w,f=o+o,p=l+l,g=c+c,m=o*f,v=o*p,y=o*g,E=l*p,S=l*g,_=c*g,M=h*f,T=h*p,A=h*g,D=n.x,R=n.y,F=n.z;return s[0]=(1-(E+_))*D,s[1]=(v+A)*D,s[2]=(y-T)*D,s[3]=0,s[4]=(v-A)*R,s[5]=(1-(m+_))*R,s[6]=(S+M)*R,s[7]=0,s[8]=(y+T)*F,s[9]=(S-M)*F,s[10]=(1-(m+E))*F,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){const s=this.elements;e.x=s[12],e.y=s[13],e.z=s[14];const o=this.determinant();if(o===0)return n.set(1,1,1),t.identity(),this;let l=po.set(s[0],s[1],s[2]).length();const c=po.set(s[4],s[5],s[6]).length(),h=po.set(s[8],s[9],s[10]).length();o<0&&(l=-l),rs.copy(this);const f=1/l,p=1/c,g=1/h;return rs.elements[0]*=f,rs.elements[1]*=f,rs.elements[2]*=f,rs.elements[4]*=p,rs.elements[5]*=p,rs.elements[6]*=p,rs.elements[8]*=g,rs.elements[9]*=g,rs.elements[10]*=g,t.setFromRotationMatrix(rs),n.x=l,n.y=c,n.z=h,this}makePerspective(e,t,n,s,o,l,c=Bi,h=!1){const f=this.elements,p=2*o/(t-e),g=2*o/(n-s),m=(t+e)/(t-e),v=(n+s)/(n-s);let y,E;if(h)y=o/(l-o),E=l*o/(l-o);else if(c===Bi)y=-(l+o)/(l-o),E=-2*l*o/(l-o);else if(c===Ca)y=-l/(l-o),E=-l*o/(l-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return f[0]=p,f[4]=0,f[8]=m,f[12]=0,f[1]=0,f[5]=g,f[9]=v,f[13]=0,f[2]=0,f[6]=0,f[10]=y,f[14]=E,f[3]=0,f[7]=0,f[11]=-1,f[15]=0,this}
vendor: 24,991 bytes, line 1
1makeOrthographic(e,t,n,s,o,l,c=Bi,h=!1){const f=this.elements,p=2/(t-e),g=2/(n-s),m=-(t+e)/(t-e),v=-(n+s)/(n-s);let y,E;if(h)y=1/(l-o),E=l/(l-o);else if(c===Bi)y=-2/(l-o),E=-(l+o)/(l-o);else if(c===Ca)y=-1/(l-o),E=-o/(l-o);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return f[0]=p,f[4]=0,f[8]=0,f[12]=m,f[1]=0,f[5]=g,f[9]=0,f[13]=v,f[2]=0,f[6]=0,f[10]=y,f[14]=E,f[3]=0,f[7]=0,f[11]=0,f[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};_f.prototype.isMatrix4=!0;let mt=_f;const po=new B,rs=new mt,pT=new B(0,0,0),mT=new B(1,1,1),Sr=new B,Au=new B,Fi=new B,_x=new mt,yx=new hi;class ds{constructor(e=0,t=0,n=0,s=ds.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=s}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 order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,s=this._order){return this._x=e,this._y=t,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const s=e.elements,o=s[0],l=s[4],c=s[8],h=s[1],f=s[5],p=s[9],g=s[2],m=s[6],v=s[10];switch(t){case"XYZ":this._y=Math.asin(ft(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-p,v),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(m,f),this._z=0);break;case"YXZ":this._x=Math.asin(-ft(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(c,v),this._z=Math.atan2(h,f)):(this._y=Math.atan2(-g,o),this._z=0);break;case"ZXY":this._x=Math.asin(ft(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-g,v),this._z=Math.atan2(-l,f)):(this._y=0,this._z=Math.atan2(h,o));break;case"ZYX":this._y=Math.asin(-ft(g,-1,1)),Math.abs(g)<.9999999?(this._x=Math.atan2(m,v),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-l,f));break;case"YZX":this._z=Math.asin(ft(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-p,f),this._y=Math.atan2(-g,o)):(this._x=0,this._y=Math.atan2(c,v));break;case"XZY":this._z=Math.asin(-ft(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(m,f),this._y=Math.atan2(c,o)):(this._x=Math.atan2(-p,v),this._y=0);break;default:De("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return _x.makeRotationFromQuaternion(e),this.setFromRotationMatrix(_x,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return yx.setFromEuler(this),this.setFromQuaternion(yx,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[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._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ds.DEFAULT_ORDER="XYZ";class Xo{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}}let gT=0;const Sx=new B,mo=new hi,qs=new mt,Cu=new B,Pl=new B,vT=new B,xT=new hi,bx=new B(1,0,0),Mx=new B(0,1,0),Ex=new B(0,0,1),Tx={type:"added"},_T={type:"removed"},go={type:"childadded",child:null},Mp={type:"childremoved",child:null};class Ht extends Mi{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:gT++}),this.uuid=ki(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ht.DEFAULT_UP.clone();const e=new B,t=new ds,n=new hi,s=new B(1,1,1);function o(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(o),n._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new mt},normalMatrix:{value:new xt}}),this.matrix=new mt,this.matrixWorld=new mt,this.matrixAutoUpdate=Ht.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ht.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Xo,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return mo.setFromAxisAngle(e,t),this.quaternion.multiply(mo),this}rotateOnWorldAxis(e,t){return mo.setFromAxisAngle(e,t),this.quaternion.premultiply(mo),this}rotateX(e){return this.rotateOnAxis(bx,e)}rotateY(e){return this.rotateOnAxis(Mx,e)}rotateZ(e){return this.rotateOnAxis(Ex,e)}translateOnAxis(e,t){return Sx.copy(e).applyQuaternion(this.quaternion),this.position.add(Sx.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(bx,e)}translateY(e){return this.translateOnAxis(Mx,e)}translateZ(e){return this.translateOnAxis(Ex,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(qs.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Cu.copy(e):Cu.set(e,t,n);const s=this.parent;this.updateWorldMatrix(!0,!1),Pl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?qs.lookAt(Pl,Cu,this.up):qs.lookAt(Cu,Pl,this.up),this.quaternion.setFromRotationMatrix(qs),s&&(qs.extractRotation(s.matrixWorld),mo.setFromRotationMatrix(qs),this.quaternion.premultiply(mo.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(Qe("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Tx),go.child=e,this.dispatchEvent(go),go.child=null):Qe("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(_T),Mp.child=e,this.dispatchEvent(Mp),Mp.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),qs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),qs.multiply(e.parent.matrixWorld)),e.applyMatrix4(qs),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Tx),go.child=e,this.dispatchEvent(go),go.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,s=this.children.length;n<s;n++){const l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const s=this.children;for(let o=0,l=s.length;o<l;o++)s[o].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pl,e,vT),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Pl,xT,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,n=e.y,s=e.z,o=this.matrix.elements;o[12]+=t-o[0]*t-o[4]*n-o[8]*s,o[13]+=n-o[1]*t-o[5]*n-o[9]*s,o[14]+=s-o[2]*t-o[6]*n-o[10]*s}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const s=this.children;for(let o=0,l=s.length;o<l;o++)s[o].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),this.static!==!1&&(s.static=this.static),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.pivot!==null&&(s.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(s.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(s.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(c=>({...c})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(s.boundingBox=this.boundingBox.toJSON()));function o(c,h){return c[h.uuid]===void 0&&(c[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=o(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const h=c.shapes;if(Array.isArray(h))for(let f=0,p=h.length;f<p;f++){const g=h[f];o(e.shapes,g)}else o(e.shapes,h)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let h=0,f=this.material.length;h<f;h++)c.push(o(e.materials,this.material[h]));s.material=c}else s.material=o(e.materials,this.material);if(this.children.length>0){s.children=[];for(let c=0;c<this.children.length;c++)s.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){s.animations=[];for(let c=0;c<this.animations.length;c++){const h=this.animations[c];s.animations.push(o(e.animations,h))}}if(t){const c=l(e.geometries),h=l(e.materials),f=l(e.textures),p=l(e.images),g=l(e.shapes),m=l(e.skeletons),v=l(e.animations),y=l(e.nodes);c.length>0&&(n.geometries=c),h.length>0&&(n.materials=h),f.length>0&&(n.textures=f),p.length>0&&(n.images=p),g.length>0&&(n.shapes=g),m.length>0&&(n.skeletons=m),v.length>0&&(n.animations=v),y.length>0&&(n.nodes=y)}return n.object=s,n;function l(c){const h=[];for(const f in c){const p=c[f];delete p.metadata,h.push(p)}return h}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const s=e.children[n];this.add(s.clone())}return this}}Ht.DEFAULT_UP=new B(0,1,0);Ht.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ht.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class zo extends Ht{constructor(){super(),this.isGroup=!0,this.type="Group"}}const yT={type:"move"};class yh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new zo,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 zo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new B,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new B),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new zo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new B,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new B,this._grip.eventsEnabled=!1),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){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}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,n){let s=null,o=null,l=null;const c=this._targetRay,h=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){l=!0;for(const E of e.hand.values()){const S=t.getJointPose(E,n),_=this._getHandJoint(f,E);S!==null&&(_.matrix.fromArray(S.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=S.radius),_.visible=S!==null}const p=f.joints["index-finger-tip"],g=f.joints["thumb-tip"],m=p.position.distanceTo(g.position),v=.02,y=.005;f.inputState.pinching&&m>v+y?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&m<=v-y&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,n),o!==null&&(h.matrix.fromArray(o.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,o.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(o.linearVelocity)):h.hasLinearVelocity=!1,o.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(o.angularVelocity)):h.hasAngularVelocity=!1,h.eventsEnabled&&h.dispatchEvent({type:"gripUpdated",data:e,target:this})));c!==null&&(s=t.getPose(e.targetRaySpace,n),s===null&&o!==null&&(s=o),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(yT)))}return c!==null&&(c.visible=s!==null),h!==null&&(h.visible=o!==null),f!==null&&(f.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new zo;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const Ky={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},br={h:0,s:0,l:0},Ru={h:0,s:0,l:0};function Ep(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class Ve{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=$t){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,It.colorSpaceToWorking(this,t),this}setRGB(e,t,n,s=It.workingColorSpace){return this.r=e,this.g=t,this.b=n,It.colorSpaceToWorking(this,s),this}setHSL(e,t,n,s=It.workingColorSpace){if(e=ag(e,1),t=ft(t,0,1),n=ft(n,0,1),t===0)this.r=this.g=this.b=n;else{const o=n<=.5?n*(1+t):n+t-n*t,l=2*n-o;this.r=Ep(l,o,e+1/3),this.g=Ep(l,o,e),this.b=Ep(l,o,e-1/3)}return It.colorSpaceToWorking(this,s),this}setStyle(e,t=$t){function n(o){o!==void 0&&parseFloat(o)<1&&De("Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const l=s[1],c=s[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:De("Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=s[1],l=o.length;if(l===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(o,16),t);De("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=$t){const n=Ky[e.toLowerCase()];return n!==void 0?this.setHex(n,t):De("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=tr(e.r),this.g=tr(e.g),this.b=tr(e.b),this}copyLinearToSRGB(e){return this.r=Vo(e.r),this.g=Vo(e.g),this.b=Vo(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=$t){return It.workingToColorSpace(ei.copy(this),e),Math.round(ft(ei.r*255,0,255))*65536+Math.round(ft(ei.g*255,0,255))*256+Math.round(ft(ei.b*255,0,255))}getHexString(e=$t){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=It.workingColorSpace){It.workingToColorSpace(ei.copy(this),t);const n=ei.r,s=ei.g,o=ei.b,l=Math.max(n,s,o),c=Math.min(n,s,o);let h,f;const p=(c+l)/2;if(c===l)h=0,f=0;else{const g=l-c;switch(f=p<=.5?g/(l+c):g/(2-l-c),l){case n:h=(s-o)/g+(s<o?6:0);break;case s:h=(o-n)/g+2;break;case o:h=(n-s)/g+4;break}h/=6}return e.h=h,e.s=f,e.l=p,e}getRGB(e,t=It.workingColorSpace){return It.workingToColorSpace(ei.copy(this),t),e.r=ei.r,e.g=ei.g,e.b=ei.b,e}getStyle(e=$t){It.workingToColorSpace(ei.copy(this),e);const t=ei.r,n=ei.g,s=ei.b;
vendor: 8,242 bytes, line 1
1return e!==$t?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(s*255)})`}offsetHSL(e,t,n){return this.getHSL(br),this.setHSL(br.h+e,br.s+t,br.l+n)}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,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(br),e.getHSL(Ru);const n=sc(br.h,Ru.h,t),s=sc(br.s,Ru.s,t),o=sc(br.l,Ru.l,t);return this.setHSL(n,s,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,s=this.b,o=e.elements;return this.r=o[0]*t+o[3]*n+o[6]*s,this.g=o[1]*t+o[4]*n+o[7]*s,this.b=o[2]*t+o[5]*n+o[8]*s,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}}const ei=new Ve;Ve.NAMES=Ky;class Df{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ve(e),this.density=t}clone(){return new Df(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Nf{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Ve(e),this.near=t,this.far=n}clone(){return new Nf(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Sc extends Ht{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 ds,this.environmentIntensity=1,this.environmentRotation=new ds,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.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const 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(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const as=new B,Ys=new B,Tp=new B,js=new B,vo=new B,xo=new B,wx=new B,wp=new B,Ap=new B,Cp=new B,Rp=new Zt,Ip=new Zt,Pp=new Zt;class Si{constructor(e=new B,t=new B,n=new B){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,s){s.subVectors(n,t),as.subVectors(e,t),s.cross(as);const o=s.lengthSq();return o>0?s.multiplyScalar(1/Math.sqrt(o)):s.set(0,0,0)}static getBarycoord(e,t,n,s,o){as.subVectors(s,t),Ys.subVectors(n,t),Tp.subVectors(e,t);const l=as.dot(as),c=as.dot(Ys),h=as.dot(Tp),f=Ys.dot(Ys),p=Ys.dot(Tp),g=l*f-c*c;if(g===0)return o.set(0,0,0),null;const m=1/g,v=(f*h-c*p)*m,y=(l*p-c*h)*m;return o.set(1-v-y,y,v)}static containsPoint(e,t,n,s){return this.getBarycoord(e,t,n,s,js)===null?!1:js.x>=0&&js.y>=0&&js.x+js.y<=1}static getInterpolation(e,t,n,s,o,l,c,h){return this.getBarycoord(e,t,n,s,js)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(o,js.x),h.addScaledVector(l,js.y),h.addScaledVector(c,js.z),h)}static getInterpolatedAttribute(e,t,n,s,o,l){return Rp.setScalar(0),Ip.setScalar(0),Pp.setScalar(0),Rp.fromBufferAttribute(e,t),Ip.fromBufferAttribute(e,n),Pp.fromBufferAttribute(e,s),l.setScalar(0),l.addScaledVector(Rp,o.x),l.addScaledVector(Ip,o.y),l.addScaledVector(Pp,o.z),l}static isFrontFacing(e,t,n,s){return as.subVectors(n,t),Ys.subVectors(e,t),as.cross(Ys).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),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 as.subVectors(this.c,this.b),Ys.subVectors(this.a,this.b),as.cross(Ys).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Si.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Si.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,o){return Si.getInterpolation(e,this.a,this.b,this.c,t,n,s,o)}containsPoint(e){return Si.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Si.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,s=this.b,o=this.c;let l,c;vo.subVectors(s,n),xo.subVectors(o,n),wp.subVectors(e,n);const h=vo.dot(wp),f=xo.dot(wp);if(h<=0&&f<=0)return t.copy(n);Ap.subVectors(e,s);const p=vo.dot(Ap),g=xo.dot(Ap);if(p>=0&&g<=p)return t.copy(s);const m=h*g-p*f;if(m<=0&&h>=0&&p<=0)return l=h/(h-p),t.copy(n).addScaledVector(vo,l);Cp.subVectors(e,o);const v=vo.dot(Cp),y=xo.dot(Cp);if(y>=0&&v<=y)return t.copy(o);const E=v*f-h*y;if(E<=0&&f>=0&&y<=0)return c=f/(f-y),t.copy(n).addScaledVector(xo,c);const S=p*y-v*g;if(S<=0&&g-p>=0&&v-y>=0)return wx.subVectors(o,s),c=(g-p)/(g-p+(v-y)),t.copy(s).addScaledVector(wx,c);const _=1/(S+E+m);return l=E*_,c=m*_,t.copy(n).addScaledVector(vo,l).addScaledVector(xo,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class ri{constructor(e=new B(1/0,1/0,1/0),t=new B(-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,n=e.length;t<n;t+=3)this.expandByPoint(os.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(os.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=os.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),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);const n=e.geometry;if(n!==void 0){const o=n.getAttribute("position");
vendor: 5,996 bytes, line 1
1if(t===!0&&o!==void 0&&e.isInstancedMesh!==!0)for(let l=0,c=o.count;l<c;l++)e.isMesh===!0?e.getVertexPosition(l,os):os.fromBufferAttribute(o,l),os.applyMatrix4(e.matrixWorld),this.expandByPoint(os);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Iu.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Iu.copy(n.boundingBox)),Iu.applyMatrix4(e.matrixWorld),this.union(Iu)}const s=e.children;for(let o=0,l=s.length;o<l;o++)this.expandByObject(s[o],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,os),os.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ll),Pu.subVectors(this.max,Ll),_o.subVectors(e.a,Ll),yo.subVectors(e.b,Ll),So.subVectors(e.c,Ll),Mr.subVectors(yo,_o),Er.subVectors(So,yo),sa.subVectors(_o,So);let t=[0,-Mr.z,Mr.y,0,-Er.z,Er.y,0,-sa.z,sa.y,Mr.z,0,-Mr.x,Er.z,0,-Er.x,sa.z,0,-sa.x,-Mr.y,Mr.x,0,-Er.y,Er.x,0,-sa.y,sa.x,0];return!Lp(t,_o,yo,So,Pu)||(t=[1,0,0,0,1,0,0,0,1],!Lp(t,_o,yo,So,Pu))?!1:(Lu.crossVectors(Mr,Er),t=[Lu.x,Lu.y,Lu.z],Lp(t,_o,yo,So,Pu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,os).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(os).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:($s[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),$s[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),$s[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),$s[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),$s[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),$s[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),$s[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),$s[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints($s),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const $s=[new B,new B,new B,new B,new B,new B,new B,new B],os=new B,Iu=new ri,_o=new B,yo=new B,So=new B,Mr=new B,Er=new B,sa=new B,Ll=new B,Pu=new B,Lu=new B,ra=new B;function Lp(i,e,t,n,s){for(let o=0,l=i.length-3;o<=l;o+=3){ra.fromArray(i,o);const c=s.x*Math.abs(ra.x)+s.y*Math.abs(ra.y)+s.z*Math.abs(ra.z),h=e.dot(ra),f=t.dot(ra),p=n.dot(ra);if(Math.max(-Math.max(h,f,p),Math.min(h,f,p))>c)return!1}return!0}const Qs=ST();function ST(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),s=new Uint32Array(512);for(let h=0;h<256;++h){const f=h-127;f<-27?(n[h]=0,n[h|256]=32768,s[h]=24,s[h|256]=24):f<-14?(n[h]=1024>>-f-14,n[h|256]=1024>>-f-14|32768,s[h]=-f-1,s[h|256]=-f-1):f<=15?(n[h]=f+15<<10,n[h|256]=f+15<<10|32768,s[h]=13,s[h|256]=13):f<128?(n[h]=31744,n[h|256]=64512,s[h]=24,s[h|256]=24):(n[h]=31744,n[h|256]=64512,s[h]=13,s[h|256]=13)}const o=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64);for(let h=1;h<1024;++h){let f=h<<13,p=0;for(;(f&8388608)===0;)f<<=1,p-=8388608;f&=-8388609,p+=947912704,o[h]=f|p}for(let h=1024;h<2048;++h)o[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)l[h]=h<<23;l[31]=1199570944,l[32]=2147483648;for(let h=33;h<63;++h)l[h]=2147483648+(h-32<<23);l[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(c[h]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:s,mantissaTable:o,exponentTable:l,offsetTable:c}}function _i(i){Math.abs(i)>65504&&De("DataUtils.toHalfFloat(): Value out of range."),i=ft(i,-65504,65504),Qs.floatView[0]=i;const e=Qs.uint32View[0],t=e>>23&511;return Qs.baseTable[t]+((e&8388607)>>Qs.shiftTable[t])}function ql(i){const e=i>>10;return Qs.uint32View[0]=Qs.mantissaTable[Qs.offsetTable[e]+(i&1023)]+Qs.exponentTable[e],Qs.floatView[0]}class bT{static toHalfFloat(e){return _i(e)}static fromHalfFloat(e){return ql(e)}}const In=new B,Du=new ae;let MT=0;class Qt extends Mi{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:MT++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=xc,this.updateRanges=[],this.gpuType=Yn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}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,n){e*=this.itemSize,n*=t.itemSize;
vendor: 5,948 bytes, line 1
1for(let s=0,o=this.itemSize;s<o;s++)this.array[e+s]=t.array[n+s];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Du.fromBufferAttribute(this,t),Du.applyMatrix3(e),this.setXY(t,Du.x,Du.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)In.fromBufferAttribute(this,t),In.applyMatrix3(e),this.setXYZ(t,In.x,In.y,In.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)In.fromBufferAttribute(this,t),In.applyMatrix4(e),this.setXYZ(t,In.x,In.y,In.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)In.fromBufferAttribute(this,t),In.applyNormalMatrix(e),this.setXYZ(t,In.x,In.y,In.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)In.fromBufferAttribute(this,t),In.transformDirection(e),this.setXYZ(t,In.x,In.y,In.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=ui(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=wt(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=ui(t,this.array)),t}setX(e,t){return this.normalized&&(t=wt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=ui(t,this.array)),t}setY(e,t){return this.normalized&&(t=wt(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=ui(t,this.array)),t}setZ(e,t){return this.normalized&&(t=wt(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=ui(t,this.array)),t}setW(e,t){return this.normalized&&(t=wt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,s){return e*=this.itemSize,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array),s=wt(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this}setXYZW(e,t,n,s,o){return e*=this.itemSize,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array),s=wt(s,this.array),o=wt(o,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this.array[e+3]=o,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const 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!==xc&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class ET extends Qt{constructor(e,t,n){super(new Int8Array(e),t,n)}}class TT extends Qt{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class wT extends Qt{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class AT extends Qt{constructor(e,t,n){super(new Int16Array(e),t,n)}}class lg extends Qt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class CT extends Qt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class cg extends Qt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class RT extends Qt{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=ql(this.array[e*this.itemSize]);return this.normalized&&(t=ui(t,this.array)),t}setX(e,t){return this.normalized&&(t=wt(t,this.array)),this.array[e*this.itemSize]=_i(t),this}getY(e){let t=ql(this.array[e*this.itemSize+1]);return this.normalized&&(t=ui(t,this.array)),t}setY(e,t){return this.normalized&&(t=wt(t,this.array)),this.array[e*this.itemSize+1]=_i(t),this}getZ(e){let t=ql(this.array[e*this.itemSize+2]);return this.normalized&&(t=ui(t,this.array)),t}setZ(e,t){return this.normalized&&(t=wt(t,this.array)),this.array[e*this.itemSize+2]=_i(t),this}getW(e){let t=ql(this.array[e*this.itemSize+3]);return this.normalized&&(t=ui(t,this.array)),t}setW(e,t){return this.normalized&&(t=wt(t,this.array)),this.array[e*this.itemSize+3]=_i(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array)),this.array[e+0]=_i(t),this.array[e+1]=_i(n),this}setXYZ(e,t,n,s){return e*=this.itemSize,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array),s=wt(s,this.array)),this.array[e+0]=_i(t),this.array[e+1]=_i(n),this.array[e+2]=_i(s),this}setXYZW(e,t,n,s,o){return e*=this.itemSize,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array),s=wt(s,this.array),o=wt(o,this.array)),this.array[e+0]=_i(t),this.array[e+1]=_i(n),this.array[e+2]=_i(s),this.array[e+3]=_i(o),this}}class je extends Qt{constructor(e,t,n){super(new Float32Array(e),t,n)}}const IT=new ri,Dl=new B,Dp=new B;class $n{constructor(e=new B,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){const n=this.center;t!==void 0?n.copy(t):IT.setFromPoints(e).getCenter(n);let s=0;for(let o=0,l=e.length;o<l;o++)s=Math.max(s,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(s),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){const 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){const n=this.center.distanceToSquared(e);return t.copy(e),n>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)}
vendor: 18,236 bytes, line 1
1applyMatrix4(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;Dl.subVectors(e,this.center);const t=Dl.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),s=(n-this.radius)*.5;this.center.addScaledVector(Dl,s/n),this.radius+=s}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):(Dp.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Dl.copy(e.center).add(Dp)),this.expandByPoint(Dl.copy(e.center).sub(Dp))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let PT=0;const qi=new mt,Np=new Ht,bo=new B,Oi=new ri,Nl=new ri,kn=new B;class gt extends Mi{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:PT++}),this.uuid=ki(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,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(VE(e)?cg:lg)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}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,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const o=new xt().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const s=this.attributes.tangent;return s!==void 0&&(s.transformDirection(e),s.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return qi.makeRotationFromQuaternion(e),this.applyMatrix4(qi),this}rotateX(e){return qi.makeRotationX(e),this.applyMatrix4(qi),this}rotateY(e){return qi.makeRotationY(e),this.applyMatrix4(qi),this}rotateZ(e){return qi.makeRotationZ(e),this.applyMatrix4(qi),this}translate(e,t,n){return qi.makeTranslation(e,t,n),this.applyMatrix4(qi),this}scale(e,t,n){return qi.makeScale(e,t,n),this.applyMatrix4(qi),this}lookAt(e){return Np.lookAt(e),Np.updateMatrix(),this.applyMatrix4(Np.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(bo).negate(),this.translate(bo.x,bo.y,bo.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let s=0,o=e.length;s<o;s++){const l=e[s];n.push(l.x,l.y,l.z||0)}this.setAttribute("position",new je(n,3))}else{const n=Math.min(e.length,t.count);for(let s=0;s<n;s++){const o=e[s];t.setXYZ(s,o.x,o.y,o.z||0)}e.length>t.count&&De("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ri);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Qe("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new B(-1/0,-1/0,-1/0),new B(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,s=t.length;n<s;n++){const o=t[n];Oi.setFromBufferAttribute(o),this.morphTargetsRelative?(kn.addVectors(this.boundingBox.min,Oi.min),this.boundingBox.expandByPoint(kn),kn.addVectors(this.boundingBox.max,Oi.max),this.boundingBox.expandByPoint(kn)):(this.boundingBox.expandByPoint(Oi.min),this.boundingBox.expandByPoint(Oi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Qe('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 $n);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Qe("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new B,1/0);return}if(e){const n=this.boundingSphere.center;if(Oi.setFromBufferAttribute(e),t)for(let o=0,l=t.length;o<l;o++){const c=t[o];Nl.setFromBufferAttribute(c),this.morphTargetsRelative?(kn.addVectors(Oi.min,Nl.min),Oi.expandByPoint(kn),kn.addVectors(Oi.max,Nl.max),Oi.expandByPoint(kn)):(Oi.expandByPoint(Nl.min),Oi.expandByPoint(Nl.max))}Oi.getCenter(n);let s=0;for(let o=0,l=e.count;o<l;o++)kn.fromBufferAttribute(e,o),s=Math.max(s,n.distanceToSquared(kn));if(t)for(let o=0,l=t.length;o<l;o++){const c=t[o],h=this.morphTargetsRelative;for(let f=0,p=c.count;f<p;f++)kn.fromBufferAttribute(c,f),h&&(bo.fromBufferAttribute(e,f),kn.add(bo)),s=Math.max(s,n.distanceToSquared(kn))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&Qe('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){Qe("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,s=t.normal,o=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Qt(new Float32Array(4*n.count),4));const l=this.getAttribute("tangent"),c=[],h=[];for(let w=0;w<n.count;w++)c[w]=new B,h[w]=new B;const f=new B,p=new B,g=new B,m=new ae,v=new ae,y=new ae,E=new B,S=new B;function _(w,L,U){f.fromBufferAttribute(n,w),p.fromBufferAttribute(n,L),g.fromBufferAttribute(n,U),m.fromBufferAttribute(o,w),v.fromBufferAttribute(o,L),y.fromBufferAttribute(o,U),p.sub(f),g.sub(f),v.sub(m),y.sub(m);const O=1/(v.x*y.y-y.x*v.y);isFinite(O)&&(E.copy(p).multiplyScalar(y.y).addScaledVector(g,-v.y).multiplyScalar(O),S.copy(g).multiplyScalar(v.x).addScaledVector(p,-y.x).multiplyScalar(O),c[w].add(E),c[L].add(E),c[U].add(E),h[w].add(S),h[L].add(S),h[U].add(S))}let M=this.groups;M.length===0&&(M=[{start:0,count:e.count}]);for(let w=0,L=M.length;w<L;++w){const U=M[w],O=U.start,H=U.count;for(let W=O,Z=O+H;W<Z;W+=3)_(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const T=new B,A=new B,D=new B,R=new B;function F(w){D.fromBufferAttribute(s,w),R.copy(D);const L=c[w];T.copy(L),T.sub(D.multiplyScalar(D.dot(L))).normalize(),A.crossVectors(R,L);const O=A.dot(h[w])<0?-1:1;l.setXYZW(w,T.x,T.y,T.z,O)}for(let w=0,L=M.length;w<L;++w){const U=M[w],O=U.start,H=U.count;for(let W=O,Z=O+H;W<Z;W+=3)F(e.getX(W+0)),F(e.getX(W+1)),F(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Qt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let m=0,v=n.count;m<v;m++)n.setXYZ(m,0,0,0);const s=new B,o=new B,l=new B,c=new B,h=new B,f=new B,p=new B,g=new B;if(e)for(let m=0,v=e.count;m<v;m+=3){const y=e.getX(m+0),E=e.getX(m+1),S=e.getX(m+2);s.fromBufferAttribute(t,y),o.fromBufferAttribute(t,E),l.fromBufferAttribute(t,S),p.subVectors(l,o),g.subVectors(s,o),p.cross(g),c.fromBufferAttribute(n,y),h.fromBufferAttribute(n,E),f.fromBufferAttribute(n,S),c.add(p),h.add(p),f.add(p),n.setXYZ(y,c.x,c.y,c.z),n.setXYZ(E,h.x,h.y,h.z),n.setXYZ(S,f.x,f.y,f.z)}else for(let m=0,v=t.count;m<v;m+=3)s.fromBufferAttribute(t,m+0),o.fromBufferAttribute(t,m+1),l.fromBufferAttribute(t,m+2),p.subVectors(l,o),g.subVectors(s,o),p.cross(g),n.setXYZ(m+0,p.x,p.y,p.z),n.setXYZ(m+1,p.x,p.y,p.z),n.setXYZ(m+2,p.x,p.y,p.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)kn.fromBufferAttribute(e,t),kn.normalize(),e.setXYZ(t,kn.x,kn.y,kn.z)}toNonIndexed(){function e(c,h){const f=c.array,p=c.itemSize,g=c.normalized,m=new f.constructor(h.length*p);let v=0,y=0;for(let E=0,S=h.length;E<S;E++){c.isInterleavedBufferAttribute?v=h[E]*c.data.stride+c.offset:v=h[E]*p;for(let _=0;_<p;_++)m[y++]=f[v++]}return new Qt(m,p,g)}if(this.index===null)return De("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new gt,n=this.index.array,s=this.attributes;for(const c in s){const h=s[c],f=e(h,n);t.setAttribute(c,f)}const o=this.morphAttributes;for(const c in o){const h=[],f=o[c];for(let p=0,g=f.length;p<g;p++){const m=f[p],v=e(m,n);h.push(v)}t.morphAttributes[c]=h}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let c=0,h=l.length;c<h;c++){const f=l[c];t.addGroup(f.start,f.count,f.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,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){const h=this.parameters;for(const f in h)h[f]!==void 0&&(e[f]=h[f]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const h in n){const f=n[h];e.data.attributes[h]=f.toJSON(e.data)}const s={};let o=!1;for(const h in this.morphAttributes){const f=this.morphAttributes[h],p=[];for(let g=0,m=f.length;g<m;g++){const v=f[g];p.push(v.toJSON(e.data))}p.length>0&&(s[h]=p,o=!0)}o&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere=c.toJSON()),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;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const s=e.attributes;for(const f in s){const p=s[f];this.setAttribute(f,p.clone(t))}const o=e.morphAttributes;for(const f in o){const p=[],g=o[f];for(let m=0,v=g.length;m<v;m++)p.push(g[m].clone(t));this.morphAttributes[f]=p}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let f=0,p=l.length;f<p;f++){const g=l[f];this.addGroup(g.start,g.count,g.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Uf{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=xc,this.updateRanges=[],this.version=0,this.uuid=ki()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let s=0,o=this.stride;s<o;s++)this.array[e+s]=t.array[n+s];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ki()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ki()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const li=new B;class Ra{constructor(e,t,n,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)li.fromBufferAttribute(this,t),li.applyMatrix4(e),this.setXYZ(t,li.x,li.y,li.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)li.fromBufferAttribute(this,t),li.applyNormalMatrix(e),this.setXYZ(t,li.x,li.y,li.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)li.fromBufferAttribute(this,t),li.transformDirection(e),this.setXYZ(t,li.x,li.y,li.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=ui(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=wt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=wt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=wt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=wt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=wt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=ui(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=ui(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=ui(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=ui(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array),s=wt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this}setXYZW(e,t,n,s,o){return e=e*this.data.stride+this.offset,this.normalized&&(t=wt(t,this.array),n=wt(n,this.array),s=wt(s,this.array),o=wt(o,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this.data.array[e+3]=o,this}clone(e){if(e===void 0){yc("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[s+o])}return new Qt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ra(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){yc("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)t.push(this.data.array[s+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let LT=0;class Vn extends Mi{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:LT++}),this.uuid=ki(),this.name="",this.type="Material",this.blending=ba,this.side=Is,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Mh,this.blendDst=Eh,this.blendEquation=Ir,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ve(0,0,0),this.blendAlpha=0,this.depthFunc=wa,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Em,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ga,this.stencilZFail=ga,this.stencilZPass=ga,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.allowOverride=!0,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}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){De(`Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){De(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 13,752 bytes, line 1
1n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ba&&(n.blending=this.blending),this.side!==Is&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Mh&&(n.blendSrc=this.blendSrc),this.blendDst!==Eh&&(n.blendDst=this.blendDst),this.blendEquation!==Ir&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==wa&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Em&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ga&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ga&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ga&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}if(t){const o=s(e.textures),l=s(e.images);o.length>0&&(n.textures=o),l.length>0&&(n.images=l)}return n}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;const t=e.clippingPlanes;let n=null;if(t!==null){const s=t.length;n=new Array(s);for(let o=0;o!==s;++o)n[o]=t[o].clone()}return this.clippingPlanes=n,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.allowOverride=e.allowOverride,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++}}class ug extends Vn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ve(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Mo;const Ul=new B,Eo=new B,To=new B,wo=new ae,Fl=new ae,Jy=new mt,Nu=new B,Ol=new B,Uu=new B,Ax=new ae,Up=new ae,Cx=new ae;class Qy extends Ht{constructor(e=new ug){if(super(),this.isSprite=!0,this.type="Sprite",Mo===void 0){Mo=new gt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new Uf(t,5);Mo.setIndex([0,1,2,0,2,3]),Mo.setAttribute("position",new Ra(n,3,0,!1)),Mo.setAttribute("uv",new Ra(n,2,3,!1))}this.geometry=Mo,this.material=e,this.center=new ae(.5,.5),this.count=1}raycast(e,t){e.camera===null&&Qe('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Eo.setFromMatrixScale(this.matrixWorld),Jy.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),To.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Eo.multiplyScalar(-To.z);const n=this.material.rotation;let s,o;n!==0&&(o=Math.cos(n),s=Math.sin(n));const l=this.center;Fu(Nu.set(-.5,-.5,0),To,l,Eo,s,o),Fu(Ol.set(.5,-.5,0),To,l,Eo,s,o),Fu(Uu.set(.5,.5,0),To,l,Eo,s,o),Ax.set(0,0),Up.set(1,0),Cx.set(1,1);let c=e.ray.intersectTriangle(Nu,Ol,Uu,!1,Ul);if(c===null&&(Fu(Ol.set(-.5,.5,0),To,l,Eo,s,o),Up.set(0,1),c=e.ray.intersectTriangle(Nu,Uu,Ol,!1,Ul),c===null))return;const h=e.ray.origin.distanceTo(Ul);h<e.near||h>e.far||t.push({distance:h,point:Ul.clone(),uv:Si.getInterpolation(Ul,Nu,Ol,Uu,Ax,Up,Cx,new ae),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Fu(i,e,t,n,s,o){wo.subVectors(i,t).addScalar(.5).multiply(n),s!==void 0?(Fl.x=o*wo.x-s*wo.y,Fl.y=s*wo.x+o*wo.y):Fl.copy(wo),i.copy(e),i.x+=Fl.x,i.y+=Fl.y,i.applyMatrix4(Jy)}const Ou=new B,Rx=new B;class eS extends Ht{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,s=t.length;n<s;n++){const o=t[n];this.addLevel(o.object.clone(),o.distance,o.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const s=this.levels;let o;for(o=0;o<s.length&&!(t<s[o].distance);o++);return s.splice(o,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const s=t.splice(n,1);return this.remove(s[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,s;for(n=1,s=t.length;n<s;n++){let o=t[n].distance;if(t[n].object.visible&&(o-=o*t[n].hysteresis),e<o)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Ou.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Ou);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ou.setFromMatrixPosition(e.matrixWorld),Rx.setFromMatrixPosition(this.matrixWorld);const n=Ou.distanceTo(Rx)/e.zoom;t[0].object.visible=!0;let s,o;for(s=1,o=t.length;s<o;s++){let l=t[s].distance;if(t[s].object.visible&&(l-=l*t[s].hysteresis),n>=l)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;s<o;s++)t[s].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let s=0,o=n.length;s<o;s++){const l=n[s];t.object.levels.push({object:l.object.uuid,distance:l.distance,hysteresis:l.hysteresis})}return t}}
vendor: 16,559 bytes, line 1
1const Zs=new B,Fp=new B,Bu=new B,Tr=new B,Op=new B,zu=new B,Bp=new B;class Jo{constructor(e=new B,t=new B(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,Zs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Zs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Zs.copy(this.origin).addScaledVector(this.direction,t),Zs.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){Fp.copy(e).add(t).multiplyScalar(.5),Bu.copy(t).sub(e).normalize(),Tr.copy(this.origin).sub(Fp);const o=e.distanceTo(t)*.5,l=-this.direction.dot(Bu),c=Tr.dot(this.direction),h=-Tr.dot(Bu),f=Tr.lengthSq(),p=Math.abs(1-l*l);let g,m,v,y;if(p>0)if(g=l*h-c,m=l*c-h,y=o*p,g>=0)if(m>=-y)if(m<=y){const E=1/p;g*=E,m*=E,v=g*(g+l*m+2*c)+m*(l*g+m+2*h)+f}else m=o,g=Math.max(0,-(l*m+c)),v=-g*g+m*(m+2*h)+f;else m=-o,g=Math.max(0,-(l*m+c)),v=-g*g+m*(m+2*h)+f;else m<=-y?(g=Math.max(0,-(-l*o+c)),m=g>0?-o:Math.min(Math.max(-o,-h),o),v=-g*g+m*(m+2*h)+f):m<=y?(g=0,m=Math.min(Math.max(-o,-h),o),v=m*(m+2*h)+f):(g=Math.max(0,-(l*o+c)),m=g>0?o:Math.min(Math.max(-o,-h),o),v=-g*g+m*(m+2*h)+f);else m=l>0?-o:o,g=Math.max(0,-(l*m+c)),v=-g*g+m*(m+2*h)+f;return n&&n.copy(this.origin).addScaledVector(this.direction,g),s&&s.copy(Fp).addScaledVector(Bu,m),v}intersectSphere(e,t){Zs.subVectors(e.center,this.origin);const n=Zs.dot(this.direction),s=Zs.dot(Zs)-n*n,o=e.radius*e.radius;if(s>o)return null;const l=Math.sqrt(o-s),c=n-l,h=n+l;return h<0?null:c<0?this.at(h,t):this.at(c,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,o,l,c,h;const f=1/this.direction.x,p=1/this.direction.y,g=1/this.direction.z,m=this.origin;return f>=0?(n=(e.min.x-m.x)*f,s=(e.max.x-m.x)*f):(n=(e.max.x-m.x)*f,s=(e.min.x-m.x)*f),p>=0?(o=(e.min.y-m.y)*p,l=(e.max.y-m.y)*p):(o=(e.max.y-m.y)*p,l=(e.min.y-m.y)*p),n>l||o>s||((o>n||isNaN(n))&&(n=o),(l<s||isNaN(s))&&(s=l),g>=0?(c=(e.min.z-m.z)*g,h=(e.max.z-m.z)*g):(c=(e.max.z-m.z)*g,h=(e.min.z-m.z)*g),n>h||c>s)||((c>n||n!==n)&&(n=c),(h<s||s!==s)&&(s=h),s<0)?null:this.at(n>=0?n:s,t)}intersectsBox(e){return this.intersectBox(e,Zs)!==null}intersectTriangle(e,t,n,s,o){Op.subVectors(t,e),zu.subVectors(n,e),Bp.crossVectors(Op,zu);let l=this.direction.dot(Bp),c;if(l>0){if(s)return null;c=1}else if(l<0)c=-1,l=-l;else return null;Tr.subVectors(this.origin,e);const h=c*this.direction.dot(zu.crossVectors(Tr,zu));if(h<0)return null;const f=c*this.direction.dot(Op.cross(Tr));if(f<0||h+f>l)return null;const p=-c*Tr.dot(Bp);return p<0?null:this.at(p/l,o)}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)}}class kr extends Vn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ve(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 ds,this.combine=Ic,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}}const Ix=new mt,aa=new Jo,ku=new $n,Px=new B,Vu=new B,Hu=new B,Gu=new B,zp=new B,Wu=new B,Lx=new B,Xu=new B;class Mn extends Ht{constructor(e=new gt,t=new kr){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,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(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;o<l;o++){const c=s[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}getVertexPosition(e,t){const n=this.geometry,s=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative;t.fromBufferAttribute(s,e);const c=this.morphTargetInfluences;if(o&&c){Wu.set(0,0,0);for(let h=0,f=o.length;h<f;h++){const p=c[h],g=o[h];p!==0&&(zp.fromBufferAttribute(g,e),l?Wu.addScaledVector(zp,p):Wu.addScaledVector(zp.sub(t),p))}t.add(Wu)}return t}raycast(e,t){const n=this.geometry,s=this.material,o=this.matrixWorld;s!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ku.copy(n.boundingSphere),ku.applyMatrix4(o),aa.copy(e.ray).recast(e.near),!(ku.containsPoint(aa.origin)===!1&&(aa.intersectSphere(ku,Px)===null||aa.origin.distanceToSquared(Px)>(e.far-e.near)**2))&&(Ix.copy(o).invert(),aa.copy(e.ray).applyMatrix4(Ix),!(n.boundingBox!==null&&aa.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,aa)))}_computeIntersections(e,t,n){let s;const o=this.geometry,l=this.material,c=o.index,h=o.attributes.position,f=o.attributes.uv,p=o.attributes.uv1,g=o.attributes.normal,m=o.groups,v=o.drawRange;if(c!==null)if(Array.isArray(l))for(let y=0,E=m.length;y<E;y++){const S=m[y],_=l[S.materialIndex],M=Math.max(S.start,v.start),T=Math.min(c.count,Math.min(S.start+S.count,v.start+v.count));for(let A=M,D=T;A<D;A+=3){const R=c.getX(A),F=c.getX(A+1),w=c.getX(A+2);s=qu(this,_,e,n,f,p,g,R,F,w),s&&(s.faceIndex=Math.floor(A/3),s.face.materialIndex=S.materialIndex,t.push(s))}}else{const y=Math.max(0,v.start),E=Math.min(c.count,v.start+v.count);for(let S=y,_=E;S<_;S+=3){const M=c.getX(S),T=c.getX(S+1),A=c.getX(S+2);s=qu(this,l,e,n,f,p,g,M,T,A),s&&(s.faceIndex=Math.floor(S/3),t.push(s))}}else if(h!==void 0)if(Array.isArray(l))for(let y=0,E=m.length;y<E;y++){const S=m[y],_=l[S.materialIndex],M=Math.max(S.start,v.start),T=Math.min(h.count,Math.min(S.start+S.count,v.start+v.count));for(let A=M,D=T;A<D;A+=3){const R=A,F=A+1,w=A+2;s=qu(this,_,e,n,f,p,g,R,F,w),s&&(s.faceIndex=Math.floor(A/3),s.face.materialIndex=S.materialIndex,t.push(s))}}else{const y=Math.max(0,v.start),E=Math.min(h.count,v.start+v.count);for(let S=y,_=E;S<_;S+=3){const M=S,T=S+1,A=S+2;s=qu(this,l,e,n,f,p,g,M,T,A),s&&(s.faceIndex=Math.floor(S/3),t.push(s))}}}}function DT(i,e,t,n,s,o,l,c){let h;if(e.side===Nn?h=n.intersectTriangle(l,o,s,!0,c):h=n.intersectTriangle(s,o,l,e.side===Is,c),h===null)return null;Xu.copy(c),Xu.applyMatrix4(i.matrixWorld);const f=t.ray.origin.distanceTo(Xu);return f<t.near||f>t.far?null:{distance:f,point:Xu.clone(),object:i}}function qu(i,e,t,n,s,o,l,c,h,f){i.getVertexPosition(c,Vu),i.getVertexPosition(h,Hu),i.getVertexPosition(f,Gu);const p=DT(i,e,t,n,Vu,Hu,Gu,Lx);if(p){const g=new B;Si.getBarycoord(Lx,Vu,Hu,Gu,g),s&&(p.uv=Si.getInterpolatedAttribute(s,c,h,f,g,new ae)),o&&(p.uv1=Si.getInterpolatedAttribute(o,c,h,f,g,new ae)),l&&(p.normal=Si.getInterpolatedAttribute(l,c,h,f,g,new B),p.normal.dot(n.direction)>0&&p.normal.multiplyScalar(-1));const m={a:c,b:h,c:f,normal:new B,materialIndex:0};Si.getNormal(Vu,Hu,Gu,m.normal),p.face=m,p.barycoord=g}return p}const Bl=new Zt,Dx=new Zt,Nx=new Zt,NT=new Zt,Ux=new mt,Yu=new B,kp=new $n,Fx=new mt,Vp=new Jo;class tS extends Mn{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=bm,this.bindMatrix=new mt,this.bindMatrixInverse=new mt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new ri),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Yu),this.boundingBox.expandByPoint(Yu)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new $n),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Yu),this.boundingSphere.expandByPoint(Yu)}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){const n=this.material,s=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),kp.copy(this.boundingSphere),kp.applyMatrix4(s),e.ray.intersectsSphere(kp)!==!1&&(Fx.copy(s).invert(),Vp.copy(e.ray).applyMatrix4(Fx),!(this.boundingBox!==null&&Vp.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Vp)))}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(){const e=new Zt,t=this.geometry.attributes.skinWeight;for(let n=0,s=t.count;n<s;n++){e.fromBufferAttribute(t,n);const o=1/e.manhattanLength();o!==1/0?e.multiplyScalar(o):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===bm?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Fy?this.bindMatrixInverse.copy(this.bindMatrix).invert():De("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,s=this.geometry;Dx.fromBufferAttribute(s.attributes.skinIndex,e),Nx.fromBufferAttribute(s.attributes.skinWeight,e),t.isVector4?(Bl.copy(t),t.set(0,0,0,0)):(Bl.set(...t,1),t.set(0,0,0)),Bl.applyMatrix4(this.bindMatrix);for(let o=0;o<4;o++){const l=Nx.getComponent(o);if(l!==0){const c=Dx.getComponent(o);Ux.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(NT.copy(Bl).applyMatrix4(Ux),l)}}return t.isVector4&&(t.w=Bl.w),t.applyMatrix4(this.bindMatrixInverse)}}class hg extends Ht{constructor(){super(),this.isBone=!0,this.type="Bone"}}class hs extends un{constructor(e=null,t=1,n=1,s,o,l,c,h,f=cn,p=cn,g,m){super(null,l,c,h,f,p,s,o,g,m),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ox=new mt,UT=new mt;class Ff{constructor(e=[],t=[]){this.uuid=ki(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const 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){De("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,s=this.bones.length;n<s;n++)this.boneInverses.push(new mt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new mt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,s=this.boneTexture;for(let o=0,l=e.length;o<l;o++){const c=e[o]?e[o].matrixWorld:UT;Ox.multiplyMatrices(c,t[o]),Ox.toArray(n,o*16)}s!==null&&(s.needsUpdate=!0)}clone(){return new Ff(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new hs(t,e,e,ii,Yn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const s=this.bones[t];if(s.name===e)return s}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,s=e.bones.length;n<s;n++){const o=e.bones[n];let l=t[o];l===void 0&&(De("Skeleton: No bone found with UUID:",o),l=new hg),this.bones.push(l),this.boneInverses.push(new mt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let s=0,o=t.length;s<o;s++){const l=t[s];e.bones.push(l.uuid);const c=n[s];e.boneInverses.push(c.toArray())}return e}}class qo extends Qt{constructor(e,t,n,s=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Ao=new mt,Bx=new mt,ju=[],zx=new ri,FT=new mt,zl=new Mn,kl=new $n;class nS extends Mn{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new qo(new Float32Array(n*16),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s<n;s++)this.setMatrixAt(s,FT)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new ri),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ao),zx.copy(e.boundingBox).applyMatrix4(Ao),this.boundingBox.union(zx)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new $n),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Ao),kl.copy(e.boundingSphere).applyMatrix4(Ao),this.boundingSphere.union(kl)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.previousInstanceMatrix!==null&&(this.previousInstanceMatrix=e.previousInstanceMatrix.clone()),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){return this.instanceColor===null?t.setRGB(1,1,1):t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){return t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,s=this.morphTexture.source.data.data,o=n.length+1,l=e*o+1;for(let c=0;c<n.length;c++)n[c]=s[l+c]}raycast(e,t){const n=this.matrixWorld,s=this.count;if(zl.geometry=this.geometry,zl.material=this.material,zl.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),kl.copy(this.boundingSphere),kl.applyM
1atrix4(n),e.ray.intersectsSphere(kl)!==!1))for(let o=0;o<s;o++){this.getMatrixAt(o,Ao),Bx.multiplyMatrices(n,Ao),zl.matrixWorld=Bx,zl.raycast(e,ju);for(let l=0,c=ju.length;l<c;l++){const h=ju[l];h.instanceId=o,h.object=this,t.push(h)}ju.length=0}}setColorAt(e,t){return this.instanceColor===null&&(this.instanceColor=new qo(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3),this}setMatrixAt(e,t){return t.toArray(this.instanceMatrix.array,e*16),this}setMorphAt(e,t){const n=t.morphTargetInfluences,s=n.length+1;this.morphTexture===null&&(this.morphTexture=new hs(new Float32Array(s*this.count),s,this.count,Tf,Yn));const o=this.morphTexture.source.data.data;let l=0;for(let f=0;f<n.length;f++)l+=n[f];const c=this.geometry.morphTargetsRelative?1:1-l,h=s*e;return o[h]=c,o.set(n,h+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const Hp=new B,OT=new B,BT=new xt;class Rr{constructor(e=new B(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,n,s){return this.normal.set(e,t,n),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const s=Hp.subVectors(n,t).cross(OT.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const 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,n=!0){const s=e.delta(Hp),o=this.normal.dot(s);if(o===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const l=-(e.start.dot(this.normal)+this.constant)/o;return n===!0&&(l<0||l>1)?null:t.copy(e.start).addScaledVector(s,l)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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){const n=t||BT.getNormalMatrix(e),s=this.coplanarPoint(Hp).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(o),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)}}const oa=new $n,zT=new ae(.5,.5),$u=new B;class Qo{constructor(e=new Rr,t=new Rr,n=new Rr,s=new Rr,o=new Rr,l=new Rr){this.planes=[e,t,n,s,o,l]}set(e,t,n,s,o,l){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(s),c[4].copy(o),c[5].copy(l),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Bi,n=!1){const s=this.planes,o=e.elements,l=o[0],c=o[1],h=o[2],f=o[3],p=o[4],g=o[5],m=o[6],v=o[7],y=o[8],E=o[9],S=o[10],_=o[11],M=o[12],T=o[13],A=o[14],D=o[15];if(s[0].setComponents(f-l,v-p,_-y,D-M).normalize(),s[1].setComponents(f+l,v+p,_+y,D+M).normalize(),s[2].setComponents(f+c,v+g,_+E,D+T).normalize(),s[3].setComponents(f-c,v-g,_-E,D-T).normalize(),n)s[4].setComponents(h,m,S,A).normalize(),s[5].setComponents(f-h,v-m,_-S,D-A).normalize();else if(s[4].setComponents(f-h,v-m,_-S,D-A).normalize(),t===Bi)s[5].setComponents(f+h,v+m,_+S,D+A).normalize();else if(t===Ca)s[5].setComponents(h,m,S,A).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(),oa.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),oa.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(oa)}intersectsSprite(e){oa.center.set(0,0,0);const t=zT.distanceTo(e.center);return oa.radius=.7071067811865476+t,oa.applyMatrix4(e.matrixWorld),this.intersectsSphere(oa)}intersectsSphere(e){const t=this.planes,n=e.center,s=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(n)<s)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const s=t[n];if($u.x=s.normal.x>0?e.max.x:e.min.x,$u.y=s.normal.y>0?e.max.y:e.min.y,$u.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint($u)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Es=new mt,Ts=new Qo;class Of{constructor(){this.coordinateSystem=Bi}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const s=t.cameras[n];if(Es.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),Ts.setFromProjectionMatrix(Es,s.coordinateSystem,s.reversedDepth),Ts.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const s=t.cameras[n];if(Es.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),Ts.setFromProjectionMatrix(Es,s.coordinateSystem,s.reversedDepth),Ts.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const s=t.cameras[n];if(Es.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),Ts.setFromProjectionMatrix(Es,s.coordinateSystem,s.reversedDepth),Ts.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const s=t.cameras[n];if(Es.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),Ts.setFromProjectionMatrix(Es,s.coordinateSystem,s.reversedDepth),Ts.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const s=t.cameras[n];if(Es.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),Ts.setFromProjectionMatrix(Es,s.coordinateSystem,s.reversedDepth),Ts.containsPoint(e))return!0}return!1}clone(){return new Of}}function Gp(i,e){return i-e}function kT(i,e){return i.z-e.z}function VT(i,e){return e.z-i.z}class HT{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,s){const o=this.pool,l=this.list;this.index>=o.length&&o.push({start:-1,count:-1,z:-1,index:-1});const c=o[this.index];l.push(c),this.index++,c.start=e,c.count=t,c.z=n,c.index=s}reset(){this.list.length=0,this.index=0}}const xi=new mt,GT=new Ve(1,1,1),kx=new Qo,WT=new Of,Zu=new ri,la=new $n,Vl=new B,Vx=new B,XT=new B,Wp=new HT,ti=new Mn,Ku=[];function qT(i,e,t=0){const n=e.itemSize;
1if(i.isInterleavedBufferAttribute||i.array.constructor!==e.array.constructor){const s=i.count;for(let o=0;o<s;o++)for(let l=0;l<n;l++)e.setComponent(o+t,l,i.getComponent(o,l))}else e.array.set(i.array,t*n);e.needsUpdate=!0}function ca(i,e){if(i.constructor!==e.constructor){const t=Math.min(i.length,e.length);for(let n=0;n<t;n++)e[n]=i[n]}else{const t=Math.min(i.length,e.length);e.set(new i.constructor(i.buffer,0,t))}}class iS extends Mn{constructor(e,t,n=t*2,s){super(new gt,s),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new hs(t,e,e,ii,Yn);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new hs(t,e,e,Pc,ji);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new hs(t,e,e,ii,Yn);
1n.colorSpace=It.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,s=this._maxIndexCount;if(this._geometryInitialized===!1){for(const o in e.attributes){const l=e.getAttribute(o),{array:c,itemSize:h,normalized:f}=l,p=new c.constructor(n*h),g=new Qt(p,h,f);t.setAttribute(o,g)}if(e.getIndex()!==null){const o=n>65535?new Uint32Array(s):new Uint16Array(s);t.setIndex(new Qt(o,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const s=e.getAttribute(n),o=t.getAttribute(n);if(s.itemSize!==o.itemSize||s.normalized!==o.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ri);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,s=t.length;n<s;n++){if(t[n].active===!1)continue;const o=t[n].geometryIndex;this.getMatrixAt(n,xi),this.getBoundingBoxAt(o,Zu).applyMatrix4(xi),e.union(Zu)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new $n);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,s=t.length;n<s;n++){if(t[n].active===!1)continue;const o=t[n].geometryIndex;this.getMatrixAt(n,xi),this.getBoundingSphereAt(o,la).applyMatrix4(xi),e.union(la)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Gp),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=n):(s=this._instanceInfo.length,this._instanceInfo.push(n));const o=this._matricesTexture;xi.identity().toArray(o.image.data,s*16),o.needsUpdate=!0;const l=this._colorsTexture;return l&&(GT.toArray(l.image.data,s*4),l.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},o=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const l=e.getIndex();if(l!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=n===-1?l.count:n),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let h;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Gp),h=this._availableGeometryIds.shift(),o[h]=s):(h=this._geometryCount,this._geometryCount++,o.push(s)),this.setGeometryAt(h,e),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,h}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,s=n.getIndex()!==null,o=n.getIndex(),l=t.getIndex(),c=this._geometryInfo[e];if(s&&l.count>c.reservedIndexCount||t.attributes.position.count>c.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const h=c.vertexStart,f=c.reservedVertexCount;c.vertexCount=t.getAttribute("position").count;for(const p in n.attributes){const g=t.getAttribute(p),m=n.getAttribute(p);qT(g,m,h);const v=g.itemSize;
1for(let y=g.count,E=f;y<E;y++){const S=h+y;for(let _=0;_<v;_++)m.setComponent(S,_,0)}m.needsUpdate=!0,m.addUpdateRange(h*v,f*v)}if(s){const p=c.indexStart,g=c.reservedIndexCount;c.indexCount=t.getIndex().count;for(let m=0;m<l.count;m++)o.setX(p+m,h+l.getX(m));for(let m=l.count,v=g;m<v;m++)o.setX(p+m,h);o.needsUpdate=!0,o.addUpdateRange(p,c.reservedIndexCount)}return c.start=s?c.indexStart:c.vertexStart,c.count=s?c.indexCount:c.vertexCount,c.boundingBox=null,t.boundingBox!==null&&(c.boundingBox=t.boundingBox.clone()),c.boundingSphere=null,t.boundingSphere!==null&&(c.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let s=0,o=n.length;s<o;s++)n[s].active&&n[s].geometryIndex===e&&this.deleteInstance(s);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const n=this._geometryInfo,s=n.map((l,c)=>c).sort((l,c)=>n[l].vertexStart-n[c].vertexStart),o=this.geometry;for(let l=0,c=n.length;l<c;l++){const h=s[l],f=n[h];if(f.active!==!1){if(o.index!==null){if(f.indexStart!==t){const{indexStart:p,vertexStart:g,reservedIndexCount:m}=f,v=o.index,y=v.array,E=e-g;for(let S=p;S<p+m;S++)y[S]=y[S]+E;v.array.copyWithin(t,p,p+m),v.addUpdateRange(t,m),v.needsUpdate=!0,f.indexStart=t}t+=f.reservedIndexCount}if(f.vertexStart!==e){const{vertexStart:p,reservedVertexCount:g}=f,m=o.attributes;for(const v in m){const y=m[v],{array:E,itemSize:S}=y;E.copyWithin(e*S,p*S,(p+g)*S),y.addUpdateRange(e*S,g*S),y.needsUpdate=!0}f.vertexStart=e}e+=f.reservedVertexCount,f.start=o.index?f.indexStart:f.vertexStart}}return this._nextIndexStart=t,this._nextVertexStart=e,this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,s=this._geometryInfo[e];if(s.boundingBox===null){const o=new ri,l=n.index,c=n.attributes.position;for(let h=s.start,f=s.start+s.count;h<f;h++){let p=h;l&&(p=l.getX(p)),o.expandByPoint(Vl.fromBufferAttribute(c,p))}s.boundingBox=o}return t.copy(s.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,s=this._geometryInfo[e];if(s.boundingSphere===null){const o=new $n;this.getBoundingBoxAt(e,Zu),Zu.getCenter(o.center);const l=n.index,c=n.attributes.position;let h=0;for(let f=s.start,p=s.start+s.count;f<p;f++){let g=f;l&&(g=l.getX(g)),Vl.fromBufferAttribute(c,g),h=Math.max(h,o.center.distanceToSquared(Vl))}o.radius=Math.sqrt(h),s.boundingSphere=o}return t.copy(s.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const n=this._matricesTexture,s=this._matricesTexture.image.data;return t.toArray(s,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null?t.isVector4?t.set(1,1,1,1):t.setRGB(1,1,1):t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){const t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(Gp);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const s=new Int32Array(e),o=new Int32Array(e);ca(this._multiDrawCounts,s),ca(this._multiDrawStarts,o),this._multiDrawCounts=s,this._multiDrawStarts=o,this._maxInstanceCount=e;const l=this._indirectTexture,c=this._matricesTexture,h=this._colorsTexture;l.dispose(),this._initIndirectTexture(),ca(l.image.data,this._indirectTexture.image.data),c.dispose(),this._initMatricesTexture(),ca(c.image.data,this._matricesTexture.image.data),h&&(h.dispose(),this._initColorsTexture(),ca(h.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const n=[...this._geometryInfo].filter(c=>c.active);if(Math.max(...n.map(c=>c.vertexStart+c.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(h=>h.indexStart+h.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const o=this.geometry;o.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new gt,this._initializeGeometry(o));const l=this.geometry;o.index&&ca(o.index.array,l.index.array);for(const c in o.attributes)ca(o.attributes[c].array,l.attributes[c].array)}raycast(e,t){const n=this._instanceInfo,s=this._geometryInfo,o=this.matrixWorld,l=this.geometry;ti.material=this.material,ti.geometry.index=l.index,ti.geometry.attributes=l.attributes,ti.geometry.boundingBox===null&&(ti.geometry.boundingBox=new ri),ti.geometry.boundingSphere===null&&(ti.geometry.boundingSphere=new $n);for(let c=0,h=n.length;c<h;c++){if(!n[c].visible||!n[c].active)continue;const f=n[c].geometryIndex,p=s[f];ti.geometry.setDrawRange(p.start,p.count),this.getMatrixAt(c,ti.matrixWorld).premultiply(o),this.getBoundingBoxAt(f,ti.geometry.boundingBox),this.getBoundingSphereAt(f,ti.geometry.boundingSphere),ti.raycast(e,Ku);for(let g=0,m=Ku.length;g<m;g++){const v=Ku[g];v.object=this,v.batchId=c,t.push(v)}Ku.length=0}ti.material=null,ti.geometry.index=null,ti.geometry.attributes={},ti.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,s,o){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const l=s.getIndex();let c=l===null?1:l.array.BYTES_PER_ELEMENT,h=1;o.wireframe&&(h=2,c=s.attributes.position.count>65535?4:2);const f=this._instanceInfo,p=this._multiDrawStarts,g=this._multiDrawCounts,m=this._geometryInfo,v=this.perObjectFrustumCulled,y=this._indirectTexture,E=y.image.data,S=n.isArrayCamera?WT:kx;v&&!n.isArrayCamera&&(xi.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),kx.setFromProjectionMatrix(xi,n.coordinateSystem,n.reversedDepth));let _=0;if(this.sortObjects){xi.copy(this.matrixWorld).invert(),Vl.setFromMatrixPosition(n.matrixWorld).applyMatrix4(xi),Vx.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(xi);for(let A=0,D=f.length;A<D;A++)if(f[A].visible&&f[A].active){const R=f[A].geometryIndex;this.getMatrixAt(A,xi),this.getBoundingSphereAt(R,la).applyMatrix4(xi);let F=!1;if(v&&(F=!S.intersectsSphere(la,n)),!F){const w=m[R],L=XT.subVectors(la.center,Vl).dot(Vx);Wp.push(w.start,w.count,L,A)}}const M=Wp.list,T=this.customSort;T===null?M.sort(o.transparent?VT:kT):T.call(this,M,n);for(let A=0,D=M.length;A<D;A++){const R=M[A];p[_]=R.start*c*h,g[_]=R.count*h,E[_]=R.index,_++}Wp.reset()}else for(let M=0,T=f.length;M<T;M++)if(f[M].visible&&f[M].active){const A=f[M].geometryIndex;let D=!1;if(v&&(this.getMatrixAt(M,xi),this.getBoundingSphereAt(A,la).applyMatrix4(xi),D=!S.intersectsSphere(la,n)),!D
vendor: 10,066 bytes, line 1
1){const R=m[A];p[_]=R.start*c*h,g[_]=R.count*h,E[_]=M,_++}}y.needsUpdate=!0,this._multiDrawCount=_,this._visibilityChanged=!1}onBeforeShadow(e,t,n,s,o,l){this.onBeforeRender(e,null,s,o,l)}}class ai extends Vn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ve(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}}const uf=new B,hf=new B,Hx=new mt,Hl=new Jo,Ju=new $n,Xp=new B,Gx=new B;class ir extends Ht{constructor(e=new gt,t=new ai){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,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(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let s=1,o=t.count;s<o;s++)uf.fromBufferAttribute(t,s-1),hf.fromBufferAttribute(t,s),n[s]=n[s-1],n[s]+=uf.distanceTo(hf);e.setAttribute("lineDistance",new je(n,1))}else De("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,o=e.params.Line.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ju.copy(n.boundingSphere),Ju.applyMatrix4(s),Ju.radius+=o,e.ray.intersectsSphere(Ju)===!1)return;Hx.copy(s).invert(),Hl.copy(e.ray).applyMatrix4(Hx);const c=o/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,f=this.isLineSegments?2:1,p=n.index,m=n.attributes.position;if(p!==null){const v=Math.max(0,l.start),y=Math.min(p.count,l.start+l.count);for(let E=v,S=y-1;E<S;E+=f){const _=p.getX(E),M=p.getX(E+1),T=Qu(this,e,Hl,h,_,M,E);T&&t.push(T)}if(this.isLineLoop){const E=p.getX(y-1),S=p.getX(v),_=Qu(this,e,Hl,h,E,S,y-1);_&&t.push(_)}}else{const v=Math.max(0,l.start),y=Math.min(m.count,l.start+l.count);for(let E=v,S=y-1;E<S;E+=f){const _=Qu(this,e,Hl,h,E,E+1,E);_&&t.push(_)}if(this.isLineLoop){const E=Qu(this,e,Hl,h,y-1,v,y-1);E&&t.push(E)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;o<l;o++){const c=s[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}}function Qu(i,e,t,n,s,o,l){const c=i.geometry.attributes.position;if(uf.fromBufferAttribute(c,s),hf.fromBufferAttribute(c,o),t.distanceSqToSegment(uf,hf,Xp,Gx)>n)return;Xp.applyMatrix4(i.matrixWorld);const f=e.ray.origin.distanceTo(Xp);if(!(f<e.near||f>e.far))return{distance:f,point:Gx.clone().applyMatrix4(i.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:i}}const Wx=new B,Xx=new B;class Ds extends ir{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let s=0,o=t.count;s<o;s+=2)Wx.fromBufferAttribute(t,s),Xx.fromBufferAttribute(t,s+1),n[s]=s===0?0:n[s-1],n[s+1]=n[s]+Wx.distanceTo(Xx);e.setAttribute("lineDistance",new je(n,1))}else De("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class sS extends ir{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class fg extends Vn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ve(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const qx=new mt,wm=new Jo,eh=new $n,th=new B;class rS extends Ht{constructor(e=new gt,t=new fg){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,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}raycast(e,t){const n=this.geometry,s=this.matrixWorld,o=e.params.Points.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),eh.copy(n.boundingSphere),eh.applyMatrix4(s),eh.radius+=o,e.ray.intersectsSphere(eh)===!1)return;qx.copy(s).invert(),wm.copy(e.ray).applyMatrix4(qx);const c=o/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,f=n.index,g=n.attributes.position;if(f!==null){const m=Math.max(0,l.start),v=Math.min(f.count,l.start+l.count);for(let y=m,E=v;y<E;y++){const S=f.getX(y);th.fromBufferAttribute(g,S),Yx(th,S,h,s,e,t,this)}}else{const m=Math.max(0,l.start),v=Math.min(g.count,l.start+l.count);for(let y=m,E=v;y<E;y++)th.fromBufferAttribute(g,y),Yx(th,y,h,s,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=s.length;o<l;o++){const c=s[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=o}}}}}function Yx(i,e,t,n,s,o,l){const c=wm.distanceSqToPoint(i);if(c<t){const h=new B;wm.closestPointToPoint(i,h),h.applyMatrix4(n);const f=s.ray.origin.distanceTo(h);if(f<s.near||f>s.far)return;o.push({distance:f,distanceToRay:Math.sqrt(c),point:h,index:e,face:null,faceIndex:null,barycoord:null,object:l})}}class aS extends un{constructor(e,t,n,s,o=nn,l=nn,c,h,f){super(e,t,n,s,o,l,c,h,f),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const p=this;function g(){p.needsUpdate=!0,p._requestVideoFrameCallbackId=e.requestVideoFrameCallback(g)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(g))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class YT extends aS{constructor(e,t,n,s,o,l,c,h){super({},e,t,n,s,o,l,c,h),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class jT extends un{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=cn,this.minFilter=cn,this.generateMipmaps=!1,this.needsUpdate=!0}}class Bf extends un{constructor(e,t,n,s,o,l,c,h,f,p,g,m){super(null,l,c,h,f,p,s,o,g,m),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class $T extends Bf{constructor(e,t,n,s,o,l){super(e,t,n,o,l),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=bi,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ZT extends Bf{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Ps),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class Lc extends un{constructor(e=[],t=Ps,n,s,o,l,c,h,f,p){super(e,t,n,s,o,l,c,h,f,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class KT extends un{constructor(e,t,n,s,o,l,c,h,f){super(e,t,n,s,o,l,c,h,f),this.isCanvasTexture=!0,this.needsUpdate=!0}}class JT extends un{constructor(e,t,n,s,o,l,c,h,f){super(e,t,n,s,o,l,c,h,f),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;const p=e?e.parentNode:null;p!==null&&"requestPaint"in p&&(p.onpaint=()=>{this.needsUpdate=!0},p.requestPaint())}dispose(){const e=this.image?this.image.parentNode:null;e!==null&&"onpaint"in e&&(e.onpaint=null),super.dispose()}}class Br extends un{constructor(e,t,n=ji,s,o,l,c=cn,h=cn,f,p=Ls,g=1){if(p!==Ls&&p!==er)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:t,depth:g};super(m,s,o,l,c,h,p,n,f),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Lr(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class oS extends Br{constructor(e,t=ji,n=Ps,s,o,l=cn,c=cn,h,f=Ls){const p={width:e,height:e,depth:1},g=[p,p,p,p,p,p];super(e,e,t,n,s,o,l,c,h,f),this.image=g,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class dg extends un{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class La extends gt{constructor(e=1,t=1,n=1,s=1,o=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:s,heightSegments:o,depthSegments:l};const c=this;s=Math.floor(s),o=Math.floor(o),l=Math.floor(l);const h=[],f=[],p=[],g=[];let m=0,v=0;y("z","y","x",-1,-1,n,t,e,l,o,0),y("z","y","x",1,-1,n,t,-e,l,o,1),y("x","z","y",1,1,e,n,t,s,l,2),y("x","z","y",1,-1,e,n,-t,s,l,3),y("x","y","z",1,-1,e,t,n,s,o,4),y("x","y","z",-1,-1,e,t,-n,s,o,5),this.setIndex(h),this.setAttribute("position",new je(f,3)),this.setAttribute("normal",new je(p,3)),this.setAttribute("uv",new je(g,2));function y(E,S,_,M,T,A,D,R,F,w,L){const U=A/F,O=D/w,H=A/2,W=D/2,Z=R/2,V=F+1,$=w+1;let K=0,he=0;const ce=new B;for(let ye=0;ye<$;ye++){const ge=ye*O-W;for(let we=0;we<V;we++){const nt=we*U-H;ce[E]=nt*M,ce[S]=ge*T,ce[_]=Z,f.push(ce.x,ce.y,ce.z),ce[E]=0,ce[S]=0,ce[_]=R>0?1:-1,p.push(ce.x,ce.y,ce.z),g.push(we/F),g.push(1-ye/w),K+=1}}for(let ye=0;ye<w;ye++)for(let ge=0;ge<F;
1ge++){const we=m+ge+V*ye,nt=m+ge+V*(ye+1),st=m+(ge+1)+V*(ye+1),rt=m+(ge+1)+V*ye;h.push(we,nt,rt),h.push(nt,st,rt),he+=6}c.addGroup(v,he,L),v+=he,m+=K}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new La(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class zf extends gt{constructor(e=1,t=1,n=4,s=8,o=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:s,heightSegments:o},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),s=Math.max(3,Math.floor(s)),o=Math.max(1,Math.floor(o));const l=[],c=[],h=[],f=[],p=t/2,g=Math.PI/2*e,m=t,v=2*g+m,y=n*2+o,E=s+1,S=new B,_=new B;for(let M=0;M<=y;M++){let T=0,A=0,D=0,R=0;if(M<=n){const L=M/n,U=L*Math.PI/2;A=-p-e*Math.cos(U),D=e*Math.sin(U),R=-e*Math.cos(U),T=L*g}else if(M<=n+o){const L=(M-n)/o;A=-p+L*t,D=e,R=0,T=g+L*m}else{const L=(M-n-o)/n,U=L*Math.PI/2;A=p+e*Math.sin(U),D=e*Math.cos(U),R=e*Math.sin(U),T=g+m+L*g}const F=Math.max(0,Math.min(1,T/v));let w=0;M===0?w=.5/s:M===y&&(w=-.5/s);for(let L=0;L<=s;L++){const U=L/s,O=U*Math.PI*2,H=Math.sin(O),W=Math.cos(O);_.x=-D*W,_.y=A,_.z=D*H,c.push(_.x,_.y,_.z),S.set(-D*W,R,D*H),S.normalize(),h.push(S.x,S.y,S.z),f.push(U+w,F)}if(M>0){const L=(M-1)*E;for(let U=0;U<s;U++){const O=L+U,H=L+U+1,W=M*E+U,Z=M*E+U+1;l.push(O,H,W),l.push(H,Z,W)}}}this.setIndex(l),this.setAttribute("position",new je(c,3)),this.setAttribute("normal",new je(h,3)),this.setAttribute("uv",new je(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zf(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class kf extends gt{constructor(e=1,t=32,n=0,s=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:s},t=Math.max(3,t);const o=[],l=[],c=[],h=[],f=new B,p=new ae;l.push(0,0,0),c.push(0,0,1),h.push(.5,.5);for(let g=0,m=3;g<=t;g++,m+=3){const v=n+g/t*s;f.x=e*Math.cos(v),f.y=e*Math.sin(v),l.push(f.x,f.y,f.z),c.push(0,0,1),p.x=(l[m]/e+1)/2,p.y=(l[m+1]/e+1)/2,h.push(p.x,p.y)}for(let g=1;g<=t;g++)o.push(g,g+1,0);this.setIndex(o),this.setAttribute("position",new je(l,3)),this.setAttribute("normal",new je(c,3)),this.setAttribute("uv",new je(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new kf(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Dc extends gt{constructor(e=1,t=1,n=1,s=32,o=1,l=!1,c=0,h=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:s,heightSegments:o,openEnded:l,thetaStart:c,thetaLength:h};const f=this;s=Math.floor(s),o=Math.floor(o);const p=[],g=[],m=[],v=[];let y=0;const E=[],S=n/2;let _=0;M(),l===!1&&(e>0&&T(!0),t>0&&T(!1)),this.setIndex(p),this.setAttribute("position",new je(g,3)),this.setAttribute("normal",new je(m,3)),this.setAttribute("uv",new je(v,2));function M(){const A=new B,D=new B;let R=0;const F=(t-e)/n;for(let w=0;w<=o;w++){const L=[],U=w/o,O=U*(t-e)+e;for(let H=0;H<=s;H++){const W=H/s,Z=W*h+c,V=Math.sin(Z),$=Math.cos(Z);D.x=O*V,D.y=-U*n+S,D.z=O*$,g.push(D.x,D.y,D.z),A.set(V,F,$).normalize(),m.push(A.x,A.y,A.z),v.push(W,1-U),L.push(y++)}E.push(L)}for(let w=0;w<s;w++)for(let L=0;L<o;L++){const U=E[L][w],O=E[L+1][w],H=E[L+1][w+1],W=E[L][w+1];(e>0||L!==0)&&(p.push(U,O,W),R+=3),(t>0||L!==o-1)&&(p.push(O,H,W),R+=3)}f.addGroup(_,R,0),_+=R}function T(A){const D=y,R=new ae,F=new B;let w=0;const L=A===!0?e:t,U=A===!0?1:-1;for(let H=1;H<=s;H++)g.push(0,S*U,0),m.push(0,U,0),v.push(.5,.5),y++;const O=y;for(let H=0;H<=s;H++){const Z=H/s*h+c,V=Math.cos(Z),$=Math.sin(Z);F.x=L*$,F.y=S*U,F.z=L*V,g.push(F.x,F.y,F.z),m.push(0,U,0),R.x=V*.5+.5,R.y=$*.5*U+.5,v.push(R.x,R.y),y++}for(let H=0;H<s;H++){const W=D+H,Z=O+H;A===!0?p.push(Z,Z+1,W):p.push(Z+1,Z,W),w+=3}f.addGroup(_,w,A===!0?1:2),_+=w}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Dc(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Nc extends Dc{constructor(e=1,t=1,n=32,s=1,o=!1,l=0,c=Math.PI*2){super(0,e,t,n,s,o,l,c),this.type="C
1oneGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:c}}static fromJSON(e){return new Nc(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Vr extends gt{constructor(e=[],t=[],n=1,s=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:s};const o=[],l=[];c(s),f(n),p(),this.setAttribute("position",new je(o,3)),this.setAttribute("normal",new je(o.slice(),3)),this.setAttribute("uv",new je(l,2)),s===0?this.computeVertexNormals():this.normalizeNormals();function c(M){const T=new B,A=new B,D=new B;for(let R=0;R<t.length;R+=3)v(t[R+0],T),v(t[R+1],A),v(t[R+2],D),h(T,A,D,M)}function h(M,T,A,D){const R=D+1,F=[];for(let w=0;w<=R;w++){F[w]=[];const L=M.clone().lerp(A,w/R),U=T.clone().lerp(A,w/R),O=R-w;for(let H=0;H<=O;H++)H===0&&w===R?F[w][H]=L:F[w][H]=L.clone().lerp(U,H/O)}for(let w=0;w<R;w++)for(let L=0;L<2*(R-w)-1;L++){const U=Math.floor(L/2);L%2===0?(m(F[w][U+1]),m(F[w+1][U]),m(F[w][U])):(m(F[w][U+1]),m(F[w+1][U+1]),m(F[w+1][U]))}}function f(M){const T=new B;for(let A=0;A<o.length;A+=3)T.x=o[A+0],T.y=o[A+1],T.z=o[A+2],T.normalize().multiplyScalar(M),o[A+0]=T.x,o[A+1]=T.y,o[A+2]=T.z}function p(){const M=new B;for(let T=0;T<o.length;T+=3){M.x=o[T+0],M.y=o[T+1],M.z=o[T+2];const A=S(M)/2/Math.PI+.5,D=_(M)/Math.PI+.5;l.push(A,1-D)}y(),g()}function g(){for(let M=0;M<l.length;M+=6){const T=l[M+0],A=l[M+2],D=l[M+4],R=Math.max(T,A,D),F=Math.min(T,A,D);R>.9&&F<.1&&(T<.2&&(l[M+0]+=1),A<.2&&(l[M+2]+=1),D<.2&&(l[M+4]+=1))}}function m(M){o.push(M.x,M.y,M.z)}function v(M,T){const A=M*3;T.x=e[A+0],T.y=e[A+1],T.z=e[A+2]}function y(){const M=new B,T=new B,A=new B,D=new B,R=new ae,F=new ae,w=new ae;for(let L=0,U=0;L<o.length;L+=9,U+=6){M.set(o[L+0],o[L+1],o[L+2]),T.set(o[L+3],o[L+4],o[L+5]),A.set(o[L+6],o[L+7],o[L+8]),R.set(l[U+0],l[U+1]),F.set(l[U+2],l[U+3]),w.set(l[U+4],l[U+5]),D.copy(M).add(T).add(A).divideScalar(3);const O=S(D);E(R,U+0,M,O),E(F,U+2,T,O),E(w,U+4,A,O)}}function E(M,T,A,D){D<0&&M.x===1&&(l[T]=M.x-1),A.x===0&&A.z===0&&(l[T]=D/2/Math.PI+.5)}function S(M){return Math.atan2(M.z,-M.x)}function _(M){return Math.atan2(-M.y,Math.sqrt(M.x*M.x+M.z*M.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Vr(e.vertices,e.indices,e.radius,e.detail)}}class Vf extends Vr{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,s=1/n,o=[-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,-s,-n,0,-s,n,0,s,-n,0,s,n,-s,-n,0,-s,n,0,s,-n,0,s,n,0,-n,0,-s,n,0,-s,-n,0,s,n,0,s],l=[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,
vendor: 10,121 bytes, line 1
119,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(o,l,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Vf(e.radius,e.detail)}}const nh=new B,ih=new B,qp=new B,sh=new Si;class lS extends gt{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const s=Math.pow(10,4),o=Math.cos(Ma*t),l=e.getIndex(),c=e.getAttribute("position"),h=l?l.count:c.count,f=[0,0,0],p=["a","b","c"],g=new Array(3),m={},v=[];for(let y=0;y<h;y+=3){l?(f[0]=l.getX(y),f[1]=l.getX(y+1),f[2]=l.getX(y+2)):(f[0]=y,f[1]=y+1,f[2]=y+2);const{a:E,b:S,c:_}=sh;if(E.fromBufferAttribute(c,f[0]),S.fromBufferAttribute(c,f[1]),_.fromBufferAttribute(c,f[2]),sh.getNormal(qp),g[0]=`${Math.round(E.x*s)},${Math.round(E.y*s)},${Math.round(E.z*s)}`,g[1]=`${Math.round(S.x*s)},${Math.round(S.y*s)},${Math.round(S.z*s)}`,g[2]=`${Math.round(_.x*s)},${Math.round(_.y*s)},${Math.round(_.z*s)}`,!(g[0]===g[1]||g[1]===g[2]||g[2]===g[0]))for(let M=0;M<3;M++){const T=(M+1)%3,A=g[M],D=g[T],R=sh[p[M]],F=sh[p[T]],w=`${A}_${D}`,L=`${D}_${A}`;L in m&&m[L]?(qp.dot(m[L].normal)<=o&&(v.push(R.x,R.y,R.z),v.push(F.x,F.y,F.z)),m[L]=null):w in m||(m[w]={index0:f[M],index1:f[T],normal:qp.clone()})}}for(const y in m)if(m[y]){const{index0:E,index1:S}=m[y];nh.fromBufferAttribute(c,E),ih.fromBufferAttribute(c,S),v.push(nh.x,nh.y,nh.z),v.push(ih.x,ih.y,ih.z)}this.setAttribute("position",new je(v,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class ps{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){De("Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const 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;const t=[];let n,s=this.getPoint(0),o=0;t.push(0);for(let l=1;l<=e;l++)n=this.getPoint(l/e),o+=n.distanceTo(s),t.push(o),s=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let s=0;const o=n.length;let l;t?l=t:l=e*n[o-1];let c=0,h=o-1,f;for(;c<=h;)if(s=Math.floor(c+(h-c)/2),f=n[s]-l,f<0)c=s+1;else if(f>0)h=s-1;else{h=s;break}if(s=h,n[s]===l)return s/(o-1);const p=n[s],m=n[s+1]-p,v=(l-p)/m;return(s+v)/(o-1)}getTangent(e,t){let s=e-1e-4,o=e+1e-4;s<0&&(s=0),o>1&&(o=1);const l=this.getPoint(s),c=this.getPoint(o),h=t||(l.isVector2?new ae:new B);return h.copy(c).sub(l).normalize(),h}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new B,s=[],o=[],l=[],c=new B,h=new mt;for(let v=0;v<=e;v++){const y=v/e;s[v]=this.getTangentAt(y,new B)}o[0]=new B,l[0]=new B;let f=Number.MAX_VALUE;const p=Math.abs(s[0].x),g=Math.abs(s[0].y),m=Math.abs(s[0].z);p<=f&&(f=p,n.set(1,0,0)),g<=f&&(f=g,n.set(0,1,0)),m<=f&&n.set(0,0,1),c.crossVectors(s[0],n).normalize(),o[0].crossVectors(s[0],c),l[0].crossVectors(s[0],o[0]);for(let v=1;v<=e;v++){if(o[v]=o[v-1].clone(),l[v]=l[v-1].clone(),c.crossVectors(s[v-1],s[v]),c.length()>Number.EPSILON){c.normalize();const y=Math.acos(ft(s[v-1].dot(s[v]),-1,1));o[v].applyMatrix4(h.makeRotationAxis(c,y))}l[v].crossVectors(s[v],o[v])}if(t===!0){let v=Math.acos(ft(o[0].dot(o[e]),-1,1));v/=e,s[0].dot(c.crossVectors(o[0],o[e]))>0&&(v=-v);for(let y=1;y<=e;y++)o[y].applyMatrix4(h.makeRotationAxis(s[y],v*y)),l[y].crossVectors(s[y],o[y])}return{tangents:s,normals:o,binormals:l}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Hf extends ps{constructor(e=0,t=0,n=1,s=1,o=0,l=Math.PI*2,c=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=s,this.aStartAngle=o,this.aEndAngle=l,this.aClockwise=c,this.aRotation=h}getPoint(e,t=new ae){const n=t,s=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const l=Math.abs(o)<Number.EPSILON;for(;o<0;)o+=s;for(;o>s;)o-=s;o<Number.EPSILON&&(l?o=0:o=s),this.aClockwise===!0&&!l&&(o===s?o=-s:o=o-s);const c=this.aStartAngle+e*o;let h=this.aX+this.xRadius*Math.cos(c),f=this.aY+this.yRadius*Math.sin(c);if(this.aRotation!==0){const p=Math.cos(this.aRotation),g=Math.sin(this.aRotation),m=h-this.aX,v=f-this.aY;h=m*p-v*g+this.aX,f=m*g+v*p+this.aY}return n.set(h,f)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class cS extends Hf{constructor(e,t,n,s,o,l){super(e,t,n,n,s,o,l),this.isArcCurve=!0,this.type="ArcCurve"}}function pg(){let i=0,e=0,t=0,n=0;function s(o,l,c,h){i=o,e=c,t=-3*o+3*l-2*c-h,n=2*o-2*l+c+h}return{initCatmullRom:function(o,l,c,h,f){s(l,c,f*(c-o),f*(h-l))},initNonuniformCatmullRom:function(o,l,c,h,f,p,g){let m=(l-o)/f-(c-o)/(f+p)+(c-l)/p,v=(c-l)/p-(h-l)/(p+g)+(h-c)/g;m*=p,v*=p,s(l,c,m,v)},calc:function(o){const l=o*o,c=l*o;return i+e*o+t*l+n*c}}}const jx=new B,$x=new B,Yp=new pg,jp=new pg,$p=new pg;class uS extends ps{constructor(e=[],t=!1,n="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=s}getPoint(e,t=new B){const n=t,s=this.points,o=s.length,l=(o-(this.closed?0:1))*e;let c=Math.floor(l),h=l-c;this.closed?c+=c>0?0:(Math.floor(Math.abs(c)/o)+1)*o:h===0&&c===o-1&&(c=o-2,h=1);let f,p;this.closed||c>0?f=s[(c-1)%o]:($x.subVectors(s[0],s[1]).add(s[0]),f=$x);const g=s[c%o],m=s[(c+1)%o];if(this.closed||c+2<o?p=s[(c+2)%o]:(jx.subVectors(s[o-1],s[o-2]).add(s[o-1]),p=jx),this.curveType==="centripetal"||this.curveType==="chordal"){const v=this.curveType==="chordal"?.5:.25;let y=Math.pow(f.distanceToSquared(g),v),E=Math.pow(g.distanceToSquared(m),v),S=Math.pow(m.distanceToSquared(p),v);E<1e-4&&(E=1),y<1e-4&&(y=E),S<1e-4&&(S=E),Yp.initNonuniformCatmullRom(f.x,g.x,m.x,p.x,y,E,S),jp.initNonuniformCatmullRom(f.y,g.y,m.y,p.y,y,E,S),$p.initNonuniformCatmullRom(f.z,g.z,m.z,p.z,y,E,S)}else this.curveType==="catmullrom"&&(Yp.initCatmullRom(f.x,g.x,m.x,p.x,this.tension),jp.initCatmullRom(f.y,g.y,m.y,p.y,this.tension),$p.initCatmullRom(f.z,g.z,m.z,p.z,this.tension));return n.set(Yp.calc(h),jp.calc(h),$p.calc(h)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push(s.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const s=this.points[t];e.points.push(s.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push(new B().fromArray(s))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Zx(i,e,t,n,s){const o=(n-e)*.5,l=(s-t)*.5,c=i*i,h=i*c;return(2*t-2*n+o+l)*h+(-3*t+3*n-2*o-l)*c+o*i+t}function QT(i,e){const t=1-i;return t*t*e}function ew(i,e){return 2*(1-i)*i*e}function tw(i,e){return i*i*e}function rc(i,e,t,n){return QT(i,e)+ew(i,t)+tw(i,n)}function nw(i,e){const t=1-i;return t*t*t*e}function iw(i,e){const t=1-i;return 3*t*t*i*e}function sw(i,e){return 3*(1-i)*i*i*e}function rw(i,e){return i*i*i*e}function ac(i,e,t,n,s){return nw(i,e)+iw(i,t)+sw(i,n)+rw(i,s)}class mg extends ps{constructor(e=new ae,t=new ae,n=new ae,s=new ae){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=s}getPoint(e,t=new ae){const n=t,s=this.v0,o=this.v1,l=this.v2,c=this.v3;return n.set(ac(e,s.x,o.x,l.x,c.x),ac(e,s.y,o.y,l.y,c.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class hS extends ps{constructor(e=new B,t=new B,n=new B,s=new B){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=s}getPoint(e,t=new B){const n=t,s=this.v0,o=this.v1,l=this.v2,c=this.v3;return n.set(ac(e,s.x,o.x,l.x,c.x),ac(e,s.y,o.y,l.y,c.y),ac(e,s.z,o.z,l.z,c.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class gg extends ps{constructor(e=new ae,t=new ae){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new ae){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 8,595 bytes, line 1
1getTangent(e,t=new ae){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class fS extends ps{constructor(e=new B,t=new B){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new B){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new B){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class vg extends ps{constructor(e=new ae,t=new ae,n=new ae){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new ae){const n=t,s=this.v0,o=this.v1,l=this.v2;return n.set(rc(e,s.x,o.x,l.x),rc(e,s.y,o.y,l.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class xg extends ps{constructor(e=new B,t=new B,n=new B){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new B){const n=t,s=this.v0,o=this.v1,l=this.v2;return n.set(rc(e,s.x,o.x,l.x),rc(e,s.y,o.y,l.y),rc(e,s.z,o.z,l.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class _g extends ps{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new ae){const n=t,s=this.points,o=(s.length-1)*e,l=Math.floor(o),c=o-l,h=s[l===0?l:l-1],f=s[l],p=s[l>s.length-2?s.length-1:l+1],g=s[l>s.length-3?s.length-1:l+2];return n.set(Zx(c,h.x,f.x,p.x,g.x),Zx(c,h.y,f.y,p.y,g.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push(s.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const s=this.points[t];e.points.push(s.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push(new ae().fromArray(s))}return this}}var ff=Object.freeze({__proto__:null,ArcCurve:cS,CatmullRomCurve3:uS,CubicBezierCurve:mg,CubicBezierCurve3:hS,EllipseCurve:Hf,LineCurve:gg,LineCurve3:fS,QuadraticBezierCurve:vg,QuadraticBezierCurve3:xg,SplineCurve:_g});class dS extends ps{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new ff[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),s=this.getCurveLengths();let o=0;for(;o<s.length;){if(s[o]>=n){const l=s[o]-n,c=this.curves[o],h=c.getLength(),f=h===0?0:1-l/h;return c.getPointAt(f,t)}o++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,s=this.curves.length;n<s;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let s=0,o=this.curves;s<o.length;s++){const l=o[s],c=l.isEllipseCurve?e*2:l.isLineCurve||l.isLineCurve3?1:l.isSplineCurve?e*l.points.length:e,h=l.getPoints(c);for(let f=0;f<h.length;f++){const p=h[f];n&&n.equals(p)||(t.push(p),n=p)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const s=e.curves[t];this.curves.push(s.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const s=this.curves[t];e.curves.push(s.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const s=e.curves[t];this.curves.push(new ff[s.type]().fromJSON(s))}return this}}class df extends dS{constructor(e){super(),this.type="Path",this.currentPoint=new ae,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new gg(this.currentPoint.clone(),new ae(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,s){const o=new vg(this.currentPoint.clone(),new ae(e,t),new ae(n,s));return this.curves.push(o),this.currentPoint.set(n,s),this}bezierCurveTo(e,t,n,s,o,l){const c=new mg(this.currentPoint.clone(),new ae(e,t),new ae(n,s),new ae(o,l));return this.curves.push(c),this.currentPoint.set(o,l),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new _g(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,s,o,l){const c=this.currentPoint.x,h=this.currentPoint.y;return this.absarc(e+c,t+h,n,s,o,l),this}absarc(e,t,n,s,o,l){return this.absellipse(e,t,n,n,s,o,l),this}ellipse(e,t,n,s,o,l,c,h){const f=this.currentPoint.x,p=this.currentPoint.y;return this.absellipse(e+f,t+p,n,s,o,l,c,h),this}absellipse(e,t,n,s,o,l,c,h){const f=new Hf(e,t,n,s,o,l,c,h);if(this.curves.length>0){const g=f.getPoint(0);g.equals(this.currentPoint)||this.lineTo(g.x,g.y)}this.curves.push(f);const p=f.getPoint(1);return this.currentPoint.copy(p),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Ea extends df{constructor(e){super(e),this.uuid=ki(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,s=this.holes.length;n<s;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const s=e.holes[t];this.holes.push(s.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const s=this.holes[t];e.holes.push(s.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const s=e.holes[t];this.holes.push(new df().fromJSON(s))}return this}}function aw(i,e,t=2){const n=e&&e.length,s=n?e[0]*t:i.length;let o=pS(i,0,s,t,!0);const l=[];if(!o||o.next===o.prev)return l;let c,h,f;if(n&&(o=hw(i,e,o,t)),i.length>80*t){c=i[0],h=i[1];let p=c,g=h;for(let m=t;m<s;m+=t){const v=i[m],y=i[m+1];v<c&&(c=v),y<h&&(h=y),v>p&&(p=v),y>g&&(g=y)}f=Math.max(p-c,g-h),f=f!==0?32767/f:0}return bc(o,l,t,c,h,f,0),l}function pS(i,e,t,n,s){let o;if(s===bw(i,e,t,n)>0)for(let l=e;l<t;l+=n)o=Kx(l/n|0,i[l],i[l+1],o);else for(let l=t-n;l>=e;l-=n)o=Kx(l/n|0,i[l],i[l+1],o);return o&&Yo(o,o.next)&&(Ec(o),o=o.next),o}function Ia(i,e){if(!i)return i;e||(e=i);let t=i,n;do if(n=!1,!t.steiner&&(Yo(t,t.next)||gn(t.prev,t,t.next)===0)){if(Ec(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function bc(i,e,t,n,s,o,l){if(!i)return;!l&&o&&gw(i,n,s,o);let c=i;for(;i.prev!==i.next;){const h=i.prev,f=i.next;if(o?lw(i,n,s,o):ow(i)){e.push(h.i,i.i,f.i),Ec(i),i=f.next,c=f.next;continue}if(i=f,i===c){l?l===1?(i=cw(Ia(i),e),bc(i,e,t,n,s,o,2)):l===2&&uw(i,e,t,n,s,o):bc(Ia(i),e,t,n,s,o,1);break}}}function ow(i){const e=i.prev,t=i,n=i.next;
vendor: 4,224 bytes, line 1
1if(gn(e,t,n)>=0)return!1;const s=e.x,o=t.x,l=n.x,c=e.y,h=t.y,f=n.y,p=Math.min(s,o,l),g=Math.min(c,h,f),m=Math.max(s,o,l),v=Math.max(c,h,f);let y=n.next;for(;y!==e;){if(y.x>=p&&y.x<=m&&y.y>=g&&y.y<=v&&Yl(s,c,o,h,l,f,y.x,y.y)&&gn(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function lw(i,e,t,n){const s=i.prev,o=i,l=i.next;if(gn(s,o,l)>=0)return!1;const c=s.x,h=o.x,f=l.x,p=s.y,g=o.y,m=l.y,v=Math.min(c,h,f),y=Math.min(p,g,m),E=Math.max(c,h,f),S=Math.max(p,g,m),_=Am(v,y,e,t,n),M=Am(E,S,e,t,n);let T=i.prevZ,A=i.nextZ;for(;T&&T.z>=_&&A&&A.z<=M;){if(T.x>=v&&T.x<=E&&T.y>=y&&T.y<=S&&T!==s&&T!==l&&Yl(c,p,h,g,f,m,T.x,T.y)&&gn(T.prev,T,T.next)>=0||(T=T.prevZ,A.x>=v&&A.x<=E&&A.y>=y&&A.y<=S&&A!==s&&A!==l&&Yl(c,p,h,g,f,m,A.x,A.y)&&gn(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;T&&T.z>=_;){if(T.x>=v&&T.x<=E&&T.y>=y&&T.y<=S&&T!==s&&T!==l&&Yl(c,p,h,g,f,m,T.x,T.y)&&gn(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;A&&A.z<=M;){if(A.x>=v&&A.x<=E&&A.y>=y&&A.y<=S&&A!==s&&A!==l&&Yl(c,p,h,g,f,m,A.x,A.y)&&gn(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function cw(i,e){let t=i;do{const n=t.prev,s=t.next.next;!Yo(n,s)&&gS(n,t,t.next,s)&&Mc(n,s)&&Mc(s,n)&&(e.push(n.i,t.i,s.i),Ec(t),Ec(t.next),t=i=s),t=t.next}while(t!==i);return Ia(t)}function uw(i,e,t,n,s,o){let l=i;do{let c=l.next.next;for(;c!==l.prev;){if(l.i!==c.i&&_w(l,c)){let h=vS(l,c);l=Ia(l,l.next),h=Ia(h,h.next),bc(l,e,t,n,s,o,0),bc(h,e,t,n,s,o,0);return}c=c.next}l=l.next}while(l!==i)}function hw(i,e,t,n){const s=[];for(let o=0,l=e.length;o<l;o++){const c=e[o]*n,h=o<l-1?e[o+1]*n:i.length,f=pS(i,c,h,n,!1);f===f.next&&(f.steiner=!0),s.push(xw(f))}s.sort(fw);for(let o=0;o<s.length;o++)t=dw(s[o],t);return t}function fw(i,e){let t=i.x-e.x;if(t===0&&(t=i.y-e.y,t===0)){const n=(i.next.y-i.y)/(i.next.x-i.x),s=(e.next.y-e.y)/(e.next.x-e.x);t=n-s}return t}function dw(i,e){const t=pw(i,e);if(!t)return e;const n=vS(t,i);return Ia(n,n.next),Ia(t,t.next)}function pw(i,e){let t=e;const n=i.x,s=i.y;let o=-1/0,l;if(Yo(i,t))return t;do{if(Yo(i,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){const g=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(g<=n&&g>o&&(o=g,l=t.x<t.next.x?t:t.next,g===n))return l}t=t.next}while(t!==e);if(!l)return null;const c=l,h=l.x,f=l.y;let p=1/0;t=l;do{if(n>=t.x&&t.x>=h&&n!==t.x&&mS(s<f?n:o,s,h,f,s<f?o:n,s,t.x,t.y)){const g=Math.abs(s-t.y)/(n-t.x);Mc(t,i)&&(g<p||g===p&&(t.x>l.x||t.x===l.x&&mw(l,t)))&&(l=t,p=g)}t=t.next}while(t!==c);return l}function mw(i,e){return gn(i.prev,i,e.prev)<0&&gn(e.next,i,i.next)<0}function gw(i,e,t,n){let s=i;do s.z===0&&(s.z=Am(s.x,s.y,e,t,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==i);s.prevZ.nextZ=null,s.prevZ=null,vw(s)}function vw(i){let e,t=1;do{let n=i,s;i=null;let o=null;for(e=0;n;){e++;let l=n,c=0;for(let f=0;f<t&&(c++,l=l.nextZ,!!l);f++);let h=t;for(;c>0||h>0&&l;)c!==0&&(h===0||!l||n.z<=l.z)?(s=n,n=n.nextZ,c--):(s=l,l=l.nextZ,h--),o?o.nextZ=s:i=s,s.prevZ=o,o=s;n=l}o.nextZ=null,t*=2}while(e>1);return i}function Am(i,e,t,n,s){return i=(i-t)*s|0,e=(e-n)*s|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function xw(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function mS(i,e,t,n,s,o,l,c){return(s-l)*(e-c)>=(i-l)*(o-c)&&(i-l)*(n-c)>=(t-l)*(e-c)&&(t-l)*(o-c)>=(s-l)*(n-c)}function Yl(i,e,t,n,s,o,l,c){return!(i===l&&e===c)&&mS(i,e,t,n,s,o,l,c)}function _w(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!yw(i,e)&&(Mc(i,e)&&Mc(e,i)&&Sw(i,e)&&(gn(i.prev,i,e.prev)||gn(i,e.prev,e))||Yo(i,e)&&gn(i.prev,i,i.next)>0&&gn(e.prev,e,e.next)>0)}function gn(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function Yo(i,e){return i.x===e.x&&i.y===e.y}function gS(i,e,t,n){const s=ah(gn(i,e,t)),o=ah(gn(i,e,n)),l=ah(gn(t,n,i)),c=ah(gn(t,n,e));return!!(s!==o&&l!==c||s===0&&rh(i,t,e)||o===0&&rh(i,n,e)||l===0&&rh(t,i,n)||c===0&&rh(t,e,n))}function rh(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function ah(i){return i>0?1:i<0?-1:0}function yw(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&gS(t,t.next,i,e))return!0;t=t.next}
1while(t!==i);return!1}function Mc(i,e){return gn(i.prev,i,i.next)<0?gn(i,e,i.next)>=0&&gn(i,i.prev,e)>=0:gn(i,e,i.prev)<0||gn(i,i.next,e)<0}function Sw(i,e){let t=i,n=!1;const s=(i.x+e.x)/2,o=(i.y+e.y)/2;do t.y>o!=t.next.y>o&&t.next.y!==t.y&&s<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==i);return n}function vS(i,e){const t=Cm(i.i,i.x,i.y),n=Cm(e.i,e.x,e.y),s=i.next,o=e.prev;return i.next=e,e.prev=i,t.next=s,s.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}function Kx(i,e,t,n){const s=Cm(i,e,t);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function Ec(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Cm(i,e,t){return{i,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function bw(i,e,t,n){let s=0;for(let o=e,l=t-n;o<t;o+=n)s+=(i[l]-i[o])*(i[o+1]+i[l+1]),l=o;return s}class Mw{static triangulate(e,t,n=2){return aw(e,t,n)}}class us{static area(e){const t=e.length;let n=0;for(let s=t-1,o=0;o<t;s=o++)n+=e[s].x*e[o].y-e[o].x*e[s].y;return n*.5}static isClockWise(e){return us.area(e)<0}static triangulateShape(e,t){const n=[],s=[],o=[];Jx(e),Qx(n,e);let l=e.length;t.forEach(Jx);for(let h=0;h<t.length;h++)s.push(l),l+=t[h].length,Qx(n,t[h]);const c=Mw.triangulate(n,s);for(let h=0;h<c.length;h+=3)o.push(c.slice(h,h+3));return o}}function Jx(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function Qx(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class Gf extends gt{constructor(e=new Ea([new ae(.5,.5),new ae(-.5,.5),new ae(-.5,-.5),new ae(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,s=[],o=[];for(let c=0,h=e.length;c<h;c++){const f=e[c];l(f)}this.setAttribute("position",new je(s,3)),this.setAttribute("uv",new je(o,2)),this.computeVertexNormals();function l(c){const h=[],f=t.curveSegments!==void 0?t.curveSegments:12,p=t.steps!==void 0?t.steps:1,g=t.depth!==void 0?t.depth:1;let m=t.bevelEnabled!==void 0?t.bevelEnabled:!0,v=t.bevelThickness!==void 0?t.bevelThickness:.2,y=t.bevelSize!==void 0?t.bevelSize:v-.1,E=t.bevelOffset!==void 0?t.bevelOffset:0,S=t.bevelSegments!==void 0?t.bevelSegments:3;const _=t.extrudePath,M=t.UVGenerator!==void 0?t.UVGenerator:Ew;let T,A=!1,D,R,F,w;if(_){T=_.getSpacedPoints(p),A=!0,m=!1;const fe=_.isCatmullRomCurve3?_.closed:!1;D=_.computeFrenetFrames(p,fe),R=new B,F=new B,w=new B}m||(S=0,v=0,y=0,E=0);const L=c.extractPoints(f);let U=L.shape;const O=L.holes;if(!us.isClockWise(U)){U=U.reverse();for(let fe=0,ve=O.length;fe<ve;fe++){const ue=O[fe];us.isClockWise(ue)&&(O[fe]=ue.reverse())}}function W(fe){const ue=10000000000000001e-36;let Pe=fe[0];for(let Le=1;Le<=fe.length;Le++){const ut=Le%fe.length,z=fe[ut],ht=z.x-Pe.x,Xe=z.y-Pe.y,$e=ht*ht+Xe*Xe,_e=Math.max(Math.abs(z.x),Math.abs(z.y),Math.abs(Pe.x),Math.abs(Pe.y)),kt=ue*_e*_e;if($e<=kt){fe.splice(ut,1),Le--;continue}Pe=z}}W(U),O.forEach(W);const Z=O.length,V=U;for(let fe=0;fe<Z;fe++){const ve=O[fe];U=U.concat(ve)}function $(fe,ve,ue){return ve||Qe("ExtrudeGeometry: vec does not exist"),fe.clone().addScaledVector(ve,ue)}const K=U.length;function he(fe,ve,ue){let Pe,Le,ut;const z=fe.x-ve.x,ht=fe.y-ve.y,Xe=ue.x-fe.x,$e=ue.y-fe.y,_e=z*z+ht*ht,kt=z*$e-ht*Xe;if(Math.abs(kt)>Number.EPSILON){const N=Math.sqrt(_e),C=Math.sqrt(Xe*Xe+$e*$e),Y=ve.x-ht/N,se=ve.y+z/N,de=ue.x-$e/C,be=ue.y+Xe/C,Ae=((de-Y)*$e-(be-se)*Xe)/(z*$e-ht*Xe);Pe=Y+z*Ae-fe.x,Le=se+ht*Ae-fe.y;const ie=Pe*Pe+Le*Le;if(ie<=2)return new ae(Pe,Le);ut=Math.sqrt(ie/2)}else{let N=!1;z>Number.EPSILON?Xe>Number.EPSILON&&(N=!0):z<-Number.EPSILON?Xe<-Number.EPSILON&&(N=!0):Math.sign(ht)===Math.sign($e)&&(N=!0),N?(Pe=-ht,Le=z,ut=Math.sqrt(_e)):(Pe=z,Le=ht,ut=Math.sqrt(_e/2))}return new ae(Pe/ut,Le/ut)}const ce=[];for(let fe=0,ve=V.length,ue=ve-1,Pe=fe+1;fe<ve;fe++,ue++,Pe++)ue===ve&&(ue=0),Pe===ve&&(Pe=0),ce[fe]=he(V[fe],V[ue],V[Pe]);const ye=[];let ge,we=ce.concat();for(let fe=0,ve=Z;fe<ve;fe++){const ue=O[fe];ge=[];for(let Pe=0,Le=ue.length,ut=Le-1,z=Pe+1;Pe<Le;Pe++,ut++,z++)ut===Le&&(ut=0),z===Le&&(z=0),ge[Pe]=he(ue[Pe],ue[ut],ue[z]);ye.push(ge),we=we.concat(ge)}let nt;if(S===0)nt=us.triangulateShape(V,O);else{const fe=[],ve=[];for(let ue=0;ue<S;
vendor: 14,455 bytes, line 1
1ue++){const Pe=ue/S,Le=v*Math.cos(Pe*Math.PI/2),ut=y*Math.sin(Pe*Math.PI/2)+E;for(let z=0,ht=V.length;z<ht;z++){const Xe=$(V[z],ce[z],ut);We(Xe.x,Xe.y,-Le),Pe===0&&fe.push(Xe)}for(let z=0,ht=Z;z<ht;z++){const Xe=O[z];ge=ye[z];const $e=[];for(let _e=0,kt=Xe.length;_e<kt;_e++){const N=$(Xe[_e],ge[_e],ut);We(N.x,N.y,-Le),Pe===0&&$e.push(N)}Pe===0&&ve.push($e)}}nt=us.triangulateShape(fe,ve)}const st=nt.length,rt=y+E;for(let fe=0;fe<K;fe++){const ve=m?$(U[fe],we[fe],rt):U[fe];A?(F.copy(D.normals[0]).multiplyScalar(ve.x),R.copy(D.binormals[0]).multiplyScalar(ve.y),w.copy(T[0]).add(F).add(R),We(w.x,w.y,w.z)):We(ve.x,ve.y,0)}for(let fe=1;fe<=p;fe++)for(let ve=0;ve<K;ve++){const ue=m?$(U[ve],we[ve],rt):U[ve];A?(F.copy(D.normals[fe]).multiplyScalar(ue.x),R.copy(D.binormals[fe]).multiplyScalar(ue.y),w.copy(T[fe]).add(F).add(R),We(w.x,w.y,w.z)):We(ue.x,ue.y,g/p*fe)}for(let fe=S-1;fe>=0;fe--){const ve=fe/S,ue=v*Math.cos(ve*Math.PI/2),Pe=y*Math.sin(ve*Math.PI/2)+E;for(let Le=0,ut=V.length;Le<ut;Le++){const z=$(V[Le],ce[Le],Pe);We(z.x,z.y,g+ue)}for(let Le=0,ut=O.length;Le<ut;Le++){const z=O[Le];ge=ye[Le];for(let ht=0,Xe=z.length;ht<Xe;ht++){const $e=$(z[ht],ge[ht],Pe);A?We($e.x,$e.y+T[p-1].y,T[p-1].x+ue):We($e.x,$e.y,g+ue)}}}oe(),Ue();function oe(){const fe=s.length/3;if(m){let ve=0,ue=K*ve;for(let Pe=0;Pe<st;Pe++){const Le=nt[Pe];ot(Le[2]+ue,Le[1]+ue,Le[0]+ue)}ve=p+S*2,ue=K*ve;for(let Pe=0;Pe<st;Pe++){const Le=nt[Pe];ot(Le[0]+ue,Le[1]+ue,Le[2]+ue)}}else{for(let ve=0;ve<st;ve++){const ue=nt[ve];ot(ue[2],ue[1],ue[0])}for(let ve=0;ve<st;ve++){const ue=nt[ve];ot(ue[0]+K*p,ue[1]+K*p,ue[2]+K*p)}}n.addGroup(fe,s.length/3-fe,0)}function Ue(){const fe=s.length/3;let ve=0;Se(V,ve),ve+=V.length;for(let ue=0,Pe=O.length;ue<Pe;ue++){const Le=O[ue];Se(Le,ve),ve+=Le.length}n.addGroup(fe,s.length/3-fe,1)}function Se(fe,ve){let ue=fe.length;for(;--ue>=0;){const Pe=ue;let Le=ue-1;Le<0&&(Le=fe.length-1);for(let ut=0,z=p+S*2;ut<z;ut++){const ht=K*ut,Xe=K*(ut+1),$e=ve+Pe+ht,_e=ve+Le+ht,kt=ve+Le+Xe,N=ve+Pe+Xe;at($e,_e,kt,N)}}}function We(fe,ve,ue){h.push(fe),h.push(ve),h.push(ue)}function ot(fe,ve,ue){Ct(fe),Ct(ve),Ct(ue);const Pe=s.length/3,Le=M.generateTopUV(n,s,Pe-3,Pe-2,Pe-1);it(Le[0]),it(Le[1]),it(Le[2])}function at(fe,ve,ue,Pe){Ct(fe),Ct(ve),Ct(Pe),Ct(ve),Ct(ue),Ct(Pe);const Le=s.length/3,ut=M.generateSideWallUV(n,s,Le-6,Le-3,Le-2,Le-1);it(ut[0]),it(ut[1]),it(ut[3]),it(ut[1]),it(ut[2]),it(ut[3])}function Ct(fe){s.push(h[fe*3+0]),s.push(h[fe*3+1]),s.push(h[fe*3+2])}function it(fe){o.push(fe.x),o.push(fe.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return Tw(t,n,e)}static fromJSON(e,t){const n=[];for(let o=0,l=e.shapes.length;o<l;o++){const c=t[e.shapes[o]];n.push(c)}const s=e.options.extrudePath;return s!==void 0&&(e.options.extrudePath=new ff[s.type]().fromJSON(s)),new Gf(n,e.options)}}const Ew={generateTopUV:function(i,e,t,n,s){const o=e[t*3],l=e[t*3+1],c=e[n*3],h=e[n*3+1],f=e[s*3],p=e[s*3+1];return[new ae(o,l),new ae(c,h),new ae(f,p)]},generateSideWallUV:function(i,e,t,n,s,o){const l=e[t*3],c=e[t*3+1],h=e[t*3+2],f=e[n*3],p=e[n*3+1],g=e[n*3+2],m=e[s*3],v=e[s*3+1],y=e[s*3+2],E=e[o*3],S=e[o*3+1],_=e[o*3+2];return Math.abs(c-p)<Math.abs(l-f)?[new ae(l,1-h),new ae(f,1-g),new ae(m,1-y),new ae(E,1-_)]:[new ae(c,1-h),new ae(p,1-g),new ae(v,1-y),new ae(S,1-_)]}};function Tw(i,e,t){if(t.shapes=[],Array.isArray(i))for(let n=0,s=i.length;n<s;n++){const o=i[n];t.shapes.push(o.uuid)}else t.shapes.push(i.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Wf extends Vr{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,s=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],o=[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];super(s,o,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Wf(e.radius,e.detail)}}class Xf extends gt{constructor(e=[new ae(0,-.5),new ae(.5,0),new ae(0,.5)],t=12,n=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:s},t=Math.floor(t),s=ft(s,0,Math.PI*2);const o=[],l=[],c=[],h=[],f=[],p=1/t,g=new B,m=new ae,v=new B,y=new B,E=new B;let S=0,_=0;for(let M=0;M<=e.length-1;M++)switch(M){case 0:S=e[M+1].x-e[M].x,_=e[M+1].y-e[M].y,v.x=_*1,v.y=-S,v.z=_*0,E.copy(v),v.normalize(),h.push(v.x,v.y,v.z);break;case e.length-1:h.push(E.x,E.y,E.z);break;default:S=e[M+1].x-e[M].x,_=e[M+1].y-e[M].y,v.x=_*1,v.y=-S,v.z=_*0,y.copy(v),v.x+=E.x,v.y+=E.y,v.z+=E.z,v.normalize(),h.push(v.x,v.y,v.z),E.copy(y)}for(let M=0;M<=t;M++){const T=n+M*p*s,A=Math.sin(T),D=Math.cos(T);for(let R=0;R<=e.length-1;R++){g.x=e[R].x*A,g.y=e[R].y,g.z=e[R].x*D,l.push(g.x,g.y,g.z),m.x=M/t,m.y=R/(e.length-1),c.push(m.x,m.y);const F=h[3*R+0]*A,w=h[3*R+1],L=h[3*R+0]*D;f.push(F,w,L)}}for(let M=0;M<t;M++)for(let T=0;T<e.length-1;T++){const A=T+M*e.length,D=A,R=A+e.length,F=A+e.length+1,w=A+1;o.push(D,R,w),o.push(F,w,R)}this.setIndex(o),this.setAttribute("position",new je(l,3)),this.setAttribute("uv",new je(c,2)),this.setAttribute("normal",new je(f,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Xf(e.points,e.segments,e.phiStart,e.phiLength)}}class Uc extends Vr{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],s=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,s,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Uc(e.radius,e.detail)}}class el extends gt{constructor(e=1,t=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:s};const o=e/2,l=t/2,c=Math.floor(n),h=Math.floor(s),f=c+1,p=h+1,g=e/c,m=t/h,v=[],y=[],E=[],S=[];for(let _=0;_<p;_++){const M=_*m-l;for(let T=0;T<f;T++){const A=T*g-o;y.push(A,-M,0),E.push(0,0,1),S.push(T/c),S.push(1-_/h)}}for(let _=0;_<h;_++)for(let M=0;M<c;M++){const T=M+f*_,A=M+f*(_+1),D=M+1+f*(_+1),R=M+1+f*_;v.push(T,A,R),v.push(A,D,R)}this.setIndex(v),this.setAttribute("position",new je(y,3)),this.setAttribute("normal",new je(E,3)),this.setAttribute("uv",new je(S,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new el(e.width,e.height,e.widthSegments,e.heightSegments)}}class qf extends gt{constructor(e=.5,t=1,n=32,s=1,o=0,l=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:s,thetaStart:o,thetaLength:l},n=Math.max(3,n),s=Math.max(1,s);const c=[],h=[],f=[],p=[];let g=e;const m=(t-e)/s,v=new B,y=new ae;for(let E=0;E<=s;E++){for(let S=0;S<=n;S++){const _=o+S/n*l;v.x=g*Math.cos(_),v.y=g*Math.sin(_),h.push(v.x,v.y,v.z),f.push(0,0,1),y.x=(v.x/t+1)/2,y.y=(v.y/t+1)/2,p.push(y.x,y.y)}g+=m}for(let E=0;E<s;E++){const S=E*(n+1);for(let _=0;_<n;_++){const M=_+S,T=M,A=M+n+1,D=M+n+2,R=M+1;c.push(T,A,R),c.push(A,D,R)}}this.setIndex(c),this.setAttribute("position",new je(h,3)),this.setAttribute("normal",new je(f,3)),this.setAttribute("uv",new je(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qf(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Yf extends gt{constructor(e=new Ea([new ae(0,.5),new ae(-.5,-.5),new ae(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],s=[],o=[],l=[];let c=0,h=0;if(Array.isArray(e)===!1)f(e);else for(let p=0;p<e.length;p++)f(e[p]),this.addGroup(c,h,p),c+=h,h=0;this.setIndex(n),this.setAttribute("position",new je(s,3)),this.setAttribute("normal",new je(o,3)),this.setAttribute("uv",new je(l,2));function f(p){const g=s.length/3,m=p.extractPoints(t);let v=m.shape;const y=m.holes;us.isClockWise(v)===!1&&(v=v.reverse());for(let S=0,_=y.length;S<_;S++){const M=y[S];us.isClockWise(M)===!0&&(y[S]=M.reverse())}const E=us.triangulateShape(v,y);for(let S=0,_=y.length;S<_;S++){const M=y[S];v=v.concat(M)}for(let S=0,_=v.length;S<_;S++){const M=v[S];s.push(M.x,M.y,0),o.push(0,0,1),l.push(M.x,M.y)}for(let S=0,_=E.length;S<_;S++){const M=E[S],T=M[0]+g,A=M[1]+g,D=M[2]+g;n.push(T,A,D),h+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return ww(t,e)}static fromJSON(e,t){const n=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];n.push(l)}return new Yf(n,e.curveSegments)}}function ww(i,e){if(e.shapes=[],Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const s=i[t];e.shapes.push(s.uuid)}else e.shapes.push(i.uuid);return e}class Fc extends gt{constructor(e=1,t=32,n=16,s=0,o=Math.PI*2,l=0,c=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:s,phiLength:o,thetaStart:l,thetaLength:c},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const h=Math.min(l+c,Math.PI);let f=0;const p=[],g=new B,m=new B,v=[],y=[],E=[],S=[];for(let _=0;_<=n;_++){const M=[],T=_/n;let A=0;_===0&&l===0?A=.5/t:_===n&&h===Math.PI&&(A=-.5/t);for(let D=0;D<=t;D++){const R=D/t;g.x=-e*Math.cos(s+R*o)*Math.sin(l+T*c),g.y=e*Math.cos(l+T*c),g.z=e*Math.sin(s+R*o)*Math.sin(l+T*c),y.push(g.x,g.y,g.z),m.copy(g).normalize(),E.push(m.x,m.y,m.z),S.push(R+A,1-T),M.push(f++)}p.push(M)}for(let _=0;_<n;_++)for(let M=0;M<t;M++){const T=p[_][M+1],A=p[_][M],D=p[_+1][M],R=p[_+1][M+1];(_!==0||l>0)&&v.push(T,A,R),(_!==n-1||h<Math.PI)&&v.push(A,D,R)}this.setIndex(v),this.setAttribute("position",new je(y,3)),this.setAttribute("normal",new je(E,3)),this.setAttribute("uv",new je(S,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fc(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class jf extends Vr{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],s=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,s,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new jf(e.radius,e.detail)}}class $f extends gt{constructor(e=1,t=.4,n=12,s=48,o=Math.PI*2,l=0,c=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:s,arc:o,thetaStart:l,thetaLength:c},n=Math.floor(n),s=Math.floor(s);const h=[],f=[],p=[],g=[],m=new B,v=new B,y=new B;for(let E=0;E<=n;E++){const S=l+E/n*c;for(let _=0;_<=s;_++){const M=_/s*o;v.x=(e+t*Math.cos(S))*Math.cos(M),v.y=(e+t*Math.cos(S))*Math.sin(M),v.z=t*Math.sin(S),f.push(v.x,v.y,v.z),m.x=e*Math.cos(M),m.y=e*Math.sin(M),y.subVectors(v,m).normalize(),p.push(y.x,y.y,y.z),g.push(_/s),g.push(E/n)}}for(let E=1;E<=n;E++)for(let S=1;S<=s;S++){const _=(s+1)*E+S-1,M=(s+1)*(E-1)+S-1,T=(s+1)*(E-1)+S,A=(s+1)*E+S;h.push(_,M,A),h.push(M,T,A)}this.setIndex(h),this.setAttribute("position",new je(f,3)),this.setAttribute("normal",new je(p,3)),this.setAttribute("uv",new je(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $f(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Zf extends gt{constructor(e=1,t=.4,n=64,s=8,o=2,l=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:s,p:o,q:l},n=Math.floor(n),s=Math.floor(s);const c=[],h=[],f=[],p=[],g=new B,m=new B,v=new B,y=new B,E=new B,S=new B,_=new B;for(let T=0;T<=n;++T){const A=T/n*o*Math.PI*2;M(A,o,l,e,v),M(A+.01,o,l,e,y),S.subVectors(y,v),_.addVectors(y,v),E.crossVectors(S,_),_.crossVectors(E,S),E.normalize(),_.normalize();for(let D=0;D<=s;++D){const R=D/s*Math.PI*2,F=-t*Math.cos(R),w=t*Math.sin(R);g.x=v.x+(F*_.x+w*E.x),g.y=v.y+(F*_.y+w*E.y),g.z=v.z+(F*_.z+w*E.z),h.push(g.x,g.y,g.z),m.subVectors(g,v).normalize(),f.push(m.x,m.y,m.z),p.push(T/n),p.push(D/s)}}for(let T=1;T<=n;T++)for(let A=1;A<=s;A++){const D=(s+1)*(T-1)+(A-1),R=(s+1)*T+(A-1),F=(s+1)*T+A,w=(s+1)*(T-1)+A;c.push(D,R,w),c.push(R,F,w)}this.setIndex(c),this.setAttribute("position",new je(h,3)),this.setAttribute("normal",new je(f,3)),this.setAttribute("uv",new je(p,2));function M(T,A,D,R,F){const w=Math.cos(T),L=Math.sin(T),U=D/A*T,O=Math.cos(U);F.x=R*(2+O)*.5*w,F.y=R*(2+O)*L*.5,F.z=R*Math.sin(U)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Zf(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Kf extends gt{constructor(e=new xg(new B(-1,-1,0),new B(-1,1,0),new B(1,1,0)),t=64,n=1,s=8,o=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:s,closed:o};const l=e.computeFrenetFrames(t,o);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;const c=new B,h=new B,f=new ae;let p=new B;const g=[],m=[],v=[],y=[];E(),this.setIndex(y),this.setAttribute("position",new je(g,3)),this.setAttribute("normal",new je(m,3)),this.setAttribute("uv",new je(v,2));function E(){for(let T=0;T<t;T++)S(T);S(o===!1?t:0),M(),_()}function S(T){p=e.getPointAt(T/t,p);const A=l.normals[T],D=l.binormals[T];for(let R=0;R<=s;R++){const F=R/s*Math.PI*2,w=Math.sin(F),L=-Math.cos(F);h.x=L*A.x+w*D.x,h.y=L*A.y+w*D.y,h.z=L*A.z+w*D.z,h.normalize(),m.push(h.x,h.y,h.z),c.x=p.x+n*h.x,c.y=p.y+n*h.y,c.z=p.z+n*h.z,g.push(c.x,c.y,c.z)}}function _(){for(let T=1;T<=t;T++)for(let A=1;A<=s;A++){const D=(s+1)*(T-1)+(A-1),R=(s+1)*T+(A-1),F=(s+1)*T+A,w=(s+1)*(T-1)+A;y.push(D,R,w),y.push(R,F,w)}}function M(){for(let T=0;T<=t;T++)for(let A=0;A<=s;A++)f.x=T/t,f.y=A/s,v.push(f.x,f.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Kf(new ff[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class xS extends gt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,s=new B,o=new B;if(e.index!==null){const l=e.attributes.position,c=e.index;let h=e.groups;h.length===0&&(h=[{start:0,count:c.count,materialIndex:0}]);for(let f=0,p=h.length;f<p;++f){const g=h[f],m=g.start,v=g.count;for(let y=m,E=m+v;y<E;y+=3)for(let S=0;S<3;S++){const _=c.getX(y+S),M=c.getX(y+(S+1)%3);
1s.fromBufferAttribute(l,_),o.fromBufferAttribute(l,M),e_(s,o,n)===!0&&(t.push(s.x,s.y,s.z),t.push(o.x,o.y,o.z))}}}else{const l=e.attributes.position;for(let c=0,h=l.count/3;c<h;c++)for(let f=0;f<3;f++){const p=3*c+f,g=3*c+(f+1)%3;s.fromBufferAttribute(l,p),o.fromBufferAttribute(l,g),e_(s,o,n)===!0&&(t.push(s.x,s.y,s.z),t.push(o.x,o.y,o.z))}}this.setAttribute("position",new je(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function e_(i,e,t){const n=`${i.x},${i.y},${i.z}-${e.x},${e.y},${e.z}`,s=`${e.x},${e.y},${e.z}-${i.x},${i.y},${i.z}`;return t.has(n)===!0||t.has(s)===!0?!1:(t.add(n),t.add(s),!0)}var t_=Object.freeze({__proto__:null,BoxGeometry:La,CapsuleGeometry:zf,CircleGeometry:kf,ConeGeometry:Nc,CylinderGeometry:Dc,DodecahedronGeometry:Vf,EdgesGeometry:lS,ExtrudeGeometry:Gf,IcosahedronGeometry:Wf,LatheGeometry:Xf,OctahedronGeometry:Uc,PlaneGeometry:el,PolyhedronGeometry:Vr,RingGeometry:qf,ShapeGeometry:Yf,SphereGeometry:Fc,TetrahedronGeometry:jf,TorusGeometry:$f,TorusKnotGeometry:Zf,TubeGeometry:Kf,WireframeGeometry:xS});class _S extends Vn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ve(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}function jo(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const s=i[t][n];if(n_(s))s.isRenderTargetTexture?(De("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=s.clone();else if(Array.isArray(s))if(n_(s[0])){const o=[];for(let l=0,c=s.length;l<c;l++)o[l]=s[l].clone();e[t][n]=o}else e[t][n]=s.slice();else e[t][n]=s}}return e}function ci(i){const e={};for(let t=0;t<i.length;t++){const n=jo(i[t]);for(const s in n)e[s]=n[s]}return e}function n_(i){return i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)}function Aw(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function yS(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:It.workingColorSpace}const SS={clone:jo,merge:ci};var Cw=`void main() { 2 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 3}`,Rw=`void main() { 4 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 5}`;class En extends Vn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Cw,this.fragmentShader=Rw,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={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=jo(e.uniforms),this.uniformsGroups=Aw(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.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const l=this.uniforms[s].value;l&&l.isTexture?t.uniforms[s]={type:"t",value:l.toJSON(e).uuid}:l&&l.isColor?t.uniforms[s]={type:"c",value:l.getHex()}:l&&l.isVector2?t.uniforms[s]={type:"v2",value:l.toArray()}:l&&l.isVector3?t.uniforms[s]={type:"v3",value:l.toArray()}:l&&l.isVector4?t.uniforms[s]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?t.uniforms[s]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?t.uniforms[s]={type:"m4",value:l.toArray()}:t.uniforms[s]={value:l}}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;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}
vendor: 12,118 bytes, line 5
5class yg extends En{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Sg extends Vn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ve(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ds,this.envMapIntensity=1,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.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,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}}class bS extends Sg{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ae(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ft(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ve(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ve(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ve(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class MS extends Vn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ve(16777215),this.specular=new Ve(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ds,this.combine=Ic,this.reflectivity=1,this.envMapIntensity=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.envMapIntensity=e.envMapIntensity,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}}class ES extends Vn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ve(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.gradientMap=e.gradientMap,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class bg extends Vn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class TS extends Vn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ve(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ds,this.combine=Ic,this.reflectivity=1,this.envMapIntensity=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.envMapIntensity=e.envMapIntensity,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}}class Mg extends Vn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=zr,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}}class Eg extends Vn{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}}
vendor: 4,333 bytes, line 5
5class wS extends Vn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ve(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class AS extends ai{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Sa(i,e){return!i||i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function CS(i){function e(s,o){return i[s]-i[o]}const t=i.length,n=new Array(t);for(let s=0;s!==t;++s)n[s]=s;return n.sort(e),n}function Rm(i,e,t){const n=i.length,s=new i.constructor(n);for(let o=0,l=0;l!==n;++o){const c=t[o]*e;for(let h=0;h!==e;++h)s[l++]=i[c+h]}return s}function Tg(i,e,t,n){let s=1,o=i[0];for(;o!==void 0&&o[n]===void 0;)o=i[s++];if(o===void 0)return;let l=o[n];if(l!==void 0)if(Array.isArray(l))do l=o[n],l!==void 0&&(e.push(o.time),t.push(...l)),o=i[s++];while(o!==void 0);else if(l.toArray!==void 0)do l=o[n],l!==void 0&&(e.push(o.time),l.toArray(t,t.length)),o=i[s++];while(o!==void 0);else do l=o[n],l!==void 0&&(e.push(o.time),t.push(l)),o=i[s++];while(o!==void 0)}function Iw(i,e,t,n,s=30){const o=i.clone();o.name=e;const l=[];for(let h=0;h<o.tracks.length;++h){const f=o.tracks[h],p=f.getValueSize(),g=[],m=[];for(let v=0;v<f.times.length;++v){const y=f.times[v]*s;if(!(y<t||y>=n)){g.push(f.times[v]);for(let E=0;E<p;++E)m.push(f.values[v*p+E])}}g.length!==0&&(f.times=Sa(g,f.times.constructor),f.values=Sa(m,f.values.constructor),l.push(f))}o.tracks=l;let c=1/0;for(let h=0;h<o.tracks.length;++h)c>o.tracks[h].times[0]&&(c=o.tracks[h].times[0]);for(let h=0;h<o.tracks.length;++h)o.tracks[h].shift(-1*c);return o.resetDuration(),o}function Pw(i,e=0,t=i,n=30){n<=0&&(n=30);const s=t.tracks.length,o=e/n;for(let l=0;l<s;++l){const c=t.tracks[l],h=c.ValueTypeName;if(h==="bool"||h==="string")continue;const f=i.tracks.find(function(_){return _.name===c.name&&_.ValueTypeName===h});if(f===void 0)continue;let p=0;const g=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=g/3);let m=0;const v=f.getValueSize();f.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=v/3);const y=c.times.length-1;let E;if(o<=c.times[0]){const _=p,M=g-p;E=c.values.slice(_,M)}else if(o>=c.times[y]){const _=y*g+p,M=_+g-p;E=c.values.slice(_,M)}else{const _=c.createInterpolant(),M=p,T=g-p;_.evaluate(o),E=_.resultBuffer.slice(M,T)}h==="quaternion"&&new hi().fromArray(E).normalize().conjugate().toArray(E);const S=f.times.length;for(let _=0;_<S;++_){const M=_*v+m;if(h==="quaternion")hi.multiplyQuaternionsFlat(f.values,M,E,0,f.values,M);else{const T=v-m*2;for(let A=0;A<T;++A)f.values[M+A]-=E[A]}}}return i.blendMode=rg,i}class Lw{static convertArray(e,t){return Sa(e,t)}static isTypedArray(e){return Yy(e)}static getKeyframeOrder(e){return CS(e)}static sortedArray(e,t,n){return Rm(e,t,n)}static flattenJSON(e,t,n,s){Tg(e,t,n,s)}static subclip(e,t,n,s,o=30){return Iw(e,t,n,s,o)}static makeClipAdditive(e,t=0,n=e,s=30){return Pw(e,t,n,s)}}class tl{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,s=t[n],o=t[n-1];e:{t:{let l;n:{i:if(!(e<s)){for(let c=n+2;;
5){if(s===void 0){if(e<o)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(o=s,s=t[++n],e<s)break t}l=t.length;break n}if(!(e>=o)){const c=t[1];e<c&&(n=2,o=c);for(let h=n-2;;){if(o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===h)break;if(s=o,o=t[--n-1],e>=o)break t}l=n,n=0;break n}break e}for(;n<l;){const c=n+l>>>1;e<t[c]?l=c:n=c+1}if(s=t[n],o=t[n-1],o===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,o,s)}return this.interpolate_(n,o,e,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,o=e*s;for(let l=0;l!==s;++l)t[l]=n[o+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class RS extends tl{constructor(e,t,n,s){super(e,t,n,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:_a,endingEnd:_a}}intervalChanged_(e,t,n){const s=this.parameterPositions;let o=e-2,l=e+1,c=s[o],h=s[l];if(c===void 0)switch(this.getSettings_().endingStart){case ya:o=e,c=2*t-n;break;case gc:o=s.length-2,c=t+s[o]-s[o+1];break;default:o=e,c=n}if(h===void 0)switch(this.getSettings_().endingEnd){case ya:l=e,h=2*n-t;break;case gc:l=1,h=n+s[1]-s[0];break;default:l=e-1,h=t}const f=(n-t)*.5,p=this.valueSize;this._weightPrev=f/(t-c),this._weightNext=f/(h-n),this._offsetPrev=o*p,this._offsetNext=l*p}interpolate_(e,t,n,s){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,h=e*c,f=h-c,p=this._offsetPrev,g=this._offsetNext,m=this._weightPrev,v=this._weightNext,y=(n-t)/(s-t),E=y*y,S=E*y,_=-m*S+2*m*E-m*y,M=(1+m)*S+(-1.5-2*m)*E+(-.5+m)*y+1,T=(-1-v)*S+(1.5+v)*E+.5*y,A=v*S-v*E;for(let D=0;D!==c;++D)o[D]=_*l[p+D]+M*l[f+D]+T*l[h+D]+A*l[g+D];return o}}class wg extends tl{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,h=e*c,f=h-c,p=(n-t)/(s-t),g=1-p;for(let m=0;m!==c;++m)o[m]=l[f+m]*g+l[h+m]*p;return o}}class IS extends tl{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e){return this.copySampleValue_(e-1)}}class PS extends tl{interpolate_(e,t,n,s){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,h=e*c,f=h-c,p=this.settings||this.DefaultSettings_,g=p.inTangents,m=p.outTangents;if(!g||!m){const E=(n-t)/(s-t),S=1-E;for(let _=0;_!==c;++_)o[_]=l[f+_]*S+l[h+_]*E;return o}const v=c*2,y=e-1;for(let E=0;E!==c;++E){const S=l[f+E],_=l[h+E],M=y*v+E*2,T=m[M],A=m[M+1],D=e*v+E*2,R=g[D],F=g[D+1];let w=(n-t)/(s-t),L,U,O,H,W;for(let Z=0;Z<8;Z++){L=w*w,U=L*w,O=1-w,H=O*O,W=H*O;const $=W*t+3*H*w*T+3*O*L*R+U*s-n;if(Math.abs($)<1e-10)break;const K=3*H*(T-t)+6*O*w*(R-T)+3*L*(s-R);if(Math.abs(K)<1e-10)break;w=w-$/K,w=Math.max(0,Math.min(1,w))}o[E]=W*S+3*H*w*A+3*O*L*F+U*_}return o}}class $i{constructor(e,t,n,s){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=Sa(t,this.TimeBufferType),this.values=Sa(n,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Sa(e.times,Array),values:Sa(e.values,Array)};const s=e.getInterpolation();s!==e.DefaultInterpolation&&(n.interpolation=s)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new IS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new wg(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new RS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){const t=new PS(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.settings=this.settings),t}setInterpolation(e){let t;switch(e){case mc:t=this.InterpolantFactoryMethodDiscrete;break;case lf:t=this.InterpolantFactoryMethodLinear;break;case _h:t=this.InterpolantFactoryMethodSmooth;break;case Mm:t=this.InterpolantFactoryMethodBezier;break}if(t===void 0){const n="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(n);return De("KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return mc;case this.InterpolantFactoryMethodLinear:return lf;case this.InterpolantFactoryMethodSmooth:return _h;case this.InterpolantFactoryMethodBezier:return Mm}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]*=e}return this}trim(e,t){const n=this.times,s=n.length;let o=0,l=s-1;for(;o!==s&&n[o]<e;)++o;for(;l!==-1&&n[l]>t;)--l;if(++l,o!==0||l!==s){o>=l&&(l=Math.max(l,1),o=l-1);const c=this.getValueSize();this.times=n.slice(o,l),this.values=this.values.slice(o*c,l*c)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Qe("KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,s=this.values,o=n.length;o===0&&(Qe("KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let c=0;c!==o;c++){const h=n[c];if(typeof h=="number"&&isNaN(h)){Qe("KeyframeTrack: Time is not a valid number.",this,c,h),e=!1;break}if(l!==null&&l>h){Qe("KeyframeTrack: Out of order keys.",this,c,h,l),e=!1;break}l=h}if(s!==void 0&&Yy(s))for(let c=0,h=s.length;c!==h;++c){const f=s[c];if(isNaN(f)){Qe("KeyframeTrack: Value is not a valid number.",this,c,f),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===_h,o=e.length-1;let l=1;for(let c=1;c<o;++c){let h=!1;const f=e[c],p=e[c+1];if(f!==p&&(c!==1||f!==e[0]))if(s)h=!0;else{const g=c*n,m=g-n,v=g+n;for(let y=0;y!==n;++y){const E=t[g+y];if(E!==t[m+y]||E!==t[v+y]){h=!0;break}}}
vendor: 4,339 bytes, line 5
5if(h){if(c!==l){e[l]=e[c];const g=c*n,m=l*n;for(let v=0;v!==n;++v)t[m+v]=t[g+v]}++l}}if(o>0){e[l]=e[o];for(let c=o*n,h=l*n,f=0;f!==n;++f)t[h+f]=t[c+f];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,s=new n(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}$i.prototype.ValueTypeName="";$i.prototype.TimeBufferType=Float32Array;$i.prototype.ValueBufferType=Float32Array;$i.prototype.DefaultInterpolation=lf;class Da extends $i{constructor(e,t,n){super(e,t,n)}}Da.prototype.ValueTypeName="bool";Da.prototype.ValueBufferType=Array;Da.prototype.DefaultInterpolation=mc;Da.prototype.InterpolantFactoryMethodLinear=void 0;Da.prototype.InterpolantFactoryMethodSmooth=void 0;class Ag extends $i{constructor(e,t,n,s){super(e,t,n,s)}}Ag.prototype.ValueTypeName="color";class Tc extends $i{constructor(e,t,n,s){super(e,t,n,s)}}Tc.prototype.ValueTypeName="number";class LS extends tl{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const o=this.resultBuffer,l=this.sampleValues,c=this.valueSize,h=(n-t)/(s-t);let f=e*c;for(let p=f+c;f!==p;f+=4)hi.slerpFlat(o,0,l,f-c,l,f,h);return o}}class Oc extends $i{constructor(e,t,n,s){super(e,t,n,s)}InterpolantFactoryMethodLinear(e){return new LS(this.times,this.values,this.getValueSize(),e)}}Oc.prototype.ValueTypeName="quaternion";Oc.prototype.InterpolantFactoryMethodSmooth=void 0;class Na extends $i{constructor(e,t,n){super(e,t,n)}}Na.prototype.ValueTypeName="string";Na.prototype.ValueBufferType=Array;Na.prototype.DefaultInterpolation=mc;Na.prototype.InterpolantFactoryMethodLinear=void 0;Na.prototype.InterpolantFactoryMethodSmooth=void 0;class wc extends $i{constructor(e,t,n,s){super(e,t,n,s)}}wc.prototype.ValueTypeName="vector";class Ac{constructor(e="",t=-1,n=[],s=Cf){this.name=e,this.tracks=n,this.duration=t,this.blendMode=s,this.uuid=ki(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,s=1/(e.fps||1);for(let l=0,c=n.length;l!==c;++l)t.push(Nw(n[l]).scale(s));const o=new this(e.name,e.duration,t,e.blendMode);return o.uuid=e.uuid,o.userData=JSON.parse(e.userData||"{}"),o}static toJSON(e){const t=[],n=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let o=0,l=n.length;o!==l;++o)t.push($i.toJSON(n[o]));return s}static CreateFromMorphTargetSequence(e,t,n,s){const o=t.length,l=[];for(let c=0;c<o;c++){let h=[],f=[];h.push((c+o-1)%o,c,(c+1)%o),f.push(0,1,0);const p=CS(h);h=Rm(h,1,p),f=Rm(f,1,p),!s&&h[0]===0&&(h.push(o),f.push(f[0])),l.push(new Tc(".morphTargetInfluences["+t[c].name+"]",h,f).scale(1/n))}return new this(e,-1,l)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const s=e;n=s.geometry&&s.geometry.animations||s.animations}for(let s=0;s<n.length;s++)if(n[s].name===t)return n[s];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const s={},o=/^([\w-]*?)([\d]+)$/;for(let c=0,h=e.length;c<h;c++){const f=e[c],p=f.name.match(o);if(p&&p.length>1){const g=p[1];let m=s[g];m||(s[g]=m=[]),m.push(f)}}const l=[];for(const c in s)l.push(this.CreateFromMorphTargetSequence(c,s[c],t,n));return l}static parseAnimation(e,t){if(De("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Qe("AnimationClip: No animation in JSONLoader data."),null;const n=function(g,m,v,y,E){if(v.length!==0){const S=[],_=[];Tg(v,S,_,y),S.length!==0&&E.push(new g(m,S,_))}},s=[],o=e.name||"default",l=e.fps||30,c=e.blendMode;let h=e.length||-1;const f=e.hierarchy||[];for(let g=0;g<f.length;g++){const m=f[g].keys;if(!(!m||m.length===0))if(m[0].morphTargets){const v={};let y;for(y=0;y<m.length;y++)if(m[y].morphTargets)for(let E=0;E<m[y].morphTargets.length;E++)v[m[y].morphTargets[E]]=-1;for(const E in v){const S=[],_=[];for(let M=0;M!==m[y].morphTargets.length;++M){const T=m[y];S.push(T.time),_.push(T.morphTarget===E?1:0)}s.push(new Tc(".morphTargetInfluence["+E+"]",S,_))}h=v.length*l}else{const v=".bones["+t[g].name+"]";n(wc,v+".position",m,"pos",s),n(Oc,v+".quaternion",m,"rot",s),n(wc,v+".scale",m,"scl",s)}}return s.length===0?null:new this(o,h,s,c)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,s=e.length;n!==s;++n){const o=this.tracks[n];
5t=Math.max(t,o.times[o.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(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());const t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}function Dw(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Tc;case"vector":case"vector2":case"vector3":case"vector4":return wc;case"color":return Ag;case"quaternion":return Oc;case"bool":case"boolean":return Da;case"string":return Na}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function Nw(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=Dw(i.type);if(i.times===void 0){const t=[],n=[];Tg(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const Rs={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(i_(i)||(this.files[i]=e))},get:function(i){if(this.enabled!==!1&&!i_(i))return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};function i_(i){try{const e=i.slice(i.indexOf(":")+1);return new URL(e).protocol==="blob:"}catch{return!1}}class Cg{constructor(e,t,n){const s=this;let o=!1,l=0,c=0,h;const f=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(p){c++,o===!1&&s.onStart!==void 0&&s.onStart(p,l,c),o=!0},this.itemEnd=function(p){l++,s.onProgress!==void 0&&s.onProgress(p,l,c),l===c&&(o=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(p){s.onError!==void 0&&s.onError(p)},this.resolveURL=function(p){return h?h(p):p},this.setURLModifier=function(p){return h=p,this},this.addHandler=function(p,g){return f.push(p,g),this},this.removeHandler=function(p){const g=f.indexOf(p);return g!==-1&&f.splice(g,2),this},this.getHandler=function(p){for(let g=0,m=f.length;g<m;g+=2){const v=f[g],y=f[g+1];if(v.global&&(v.lastIndex=0),v.test(p))return y}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const DS=new Cg;class Ei{constructor(e){this.manager=e!==void 0?e:DS,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){const n=this;return new Promise(function(s,o){n.load(e,s,t,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Ei.DEFAULT_MATERIAL_NAME="__DEFAULT";const Ks={};
5class Uw extends Error{constructor(e,t){super(e),this.response=t}}class sr extends Ei{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=Rs.get(`file:${e}`);if(o!==void 0){this.manager.itemStart(e),setTimeout(()=>{t&&t(o),this.manager.itemEnd(e)},0);return}if(Ks[e]!==void 0){Ks[e].push({onLoad:t,onProgress:n,onError:s});return}Ks[e]=[],Ks[e].push({onLoad:t,onProgress:n,onError:s});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),c=this.mimeType,h=this.responseType;fetch(l).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&De("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;const p=Ks[e],g=f.body.getReader(),m=f.headers.get("X-File-Size")||f.headers.get("Content-Length"),v=m?parseInt(m):0,y=v!==0;let E=0;const S=new ReadableStream({start(_){M();function M(){g.read().then(({done:T,value:A})=>{if(T)_.close();else{E+=A.byteLength;const D=new ProgressEvent("progress",{lengthComputable:y,loaded:E,total:v});for(let R=0,F=p.length;R<F;R++){const w=p[R];w.onProgress&&w.onProgress(D)}_.enqueue(A),M()}},T=>{_.error(T)})}}});return new Response(S)}else throw new Uw(`fetch for "${f.url}" responded with ${f.status}: ${f.statusText}`,f)}).then(f=>{switch(h){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(p=>new DOMParser().parseFromString(p,c));case"json":return f.json();default:if(c==="")return f.text();{const g=/charset="?([^;"\s]*)"?/i.exec(c),m=g&&g[1]?g[1].toLowerCase():void 0,v=new TextDecoder(m);return f.arrayBuffer().then(y=>v.decode(y))}}}).then(f=>{Rs.add(`file:${e}`,f);const p=Ks[e];delete Ks[e];for(let g=0,m=p.length;g<m;g++){const v=p[g];v.onLoad&&v.onLoad(f)}}).catch(f=>{const p=Ks[e];if(p===void 0)throw this.manager.itemError(e),f;delete Ks[e];for(let g=0,m=p.length;g<m;g++){const v=p[g];v.onError&&v.onError(f)}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}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class Fw extends Ei{constructor(e){super(e)}load(e,t,n,s){const o=this,l=new sr(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{t(o.parse(JSON.parse(c)))}catch(h){s?s(h):Qe(h),o.manager.itemError(e)}},n,s)}parse(e){const t=[];for(let n=0;n<e.length;n++){const s=Ac.parse(e[n]);t.push(s)}return t}}class Ow extends Ei{constructor(e){super(e)}load(e,t,n,s){const o=this,l=[],c=new Bf,h=new sr(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(o.withCredentials);let f=0;function p(g){h.load(e[g],function(m){const v=o.parse(m,!0);l[g]={width:v.width,height:v.height,format:v.format,mipmaps:v.mipmaps},f+=1,f===6&&(v.mipmapCount===1&&(c.minFilter=nn),c.image=l,c.format=v.format,c.needsUpdate=!0,t&&t(c))},n,s)}if(Array.isArray(e))for(let g=0,m=e.length;g<m;++g)p(g);else h.load(e,function(g){const m=o.parse(g,!0);if(m.isCubemap){const v=m.mipmaps.length/m.mipmapCount;for(let y=0;y<v;y++){l[y]={mipmaps:[]};for(let E=0;E<m.mipmapCount;E++)l[y].mipmaps.push(m.mipmaps[y*m.mipmapCount+E]),l[y].format=m.format,l[y].width=m.width,l[y].height=m.height}c.image=l}else c.image.width=m.width,c.image.height=m.height,c.mipmaps=m.mipmaps;m.mipmapCount===1&&(c.minFilter=nn),c.format=m.format,c.needsUpdate=!0,t&&t(c)},n,s);return c}}const Co=new WeakMap;class Cc extends Ei{constructor(e){super(e)}load(e,t,n,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Rs.get(`image:${e}`);if(l!==void 0){if(l.complete===!0)o.manager.itemStart(e),setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0);else{let g=Co.get(l);g===void 0&&(g=[],Co.set(l,g)),g.push({onLoad:t,onError:s})}return l}const c=_c("img");function h(){p(),t&&t(this);const g=Co.get(this)||[];for(let m=0;m<g.length;m++){const v=g[m];v.onLoad&&v.onLoad(this)}Co.delete(this),o.manager.itemEnd(e)}function f(g){p(),s&&s(g),Rs.remove(`image:${e}`);const m=Co.get(this)||[];for(let v=0;v<m.length;v++){const y=m[v];y.onError&&y.onError(g)}Co.delete(this),o.manager.itemError(e),o.manager.itemEnd(e)}function p(){c.removeEventListener("load",h,!1),c.removeEventListener("error",f,!1)}return c.addEventListener("load",h,!1),c.addEventListener("error",f,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),Rs.add(`image:${e}`,c),o.manager.itemStart(e),c.src=e,c}}
5class Bw extends Ei{constructor(e){super(e)}load(e,t,n,s){const o=new Lc;o.colorSpace=$t;const l=new Cc(this.manager);l.setCrossOrigin(this.crossOrigin),l.setPath(this.path);let c=0;function h(f){l.load(e[f],function(p){o.images[f]=p,c++,c===6&&(o.needsUpdate=!0,t&&t(o))},void 0,s)}for(let f=0;f<e.length;++f)h(f);return o}}class zw extends Ei{constructor(e){super(e)}load(e,t,n,s){const o=this,l=new hs,c=new sr(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(o.withCredentials),c.load(e,function(h){let f;try{f=o.parse(h)}catch(p){s!==void 0?s(p):Qe(p);return}f.image!==void 0?l.image=f.image:f.data!==void 0&&(l.image.width=f.width,l.image.height=f.height,l.image.data=f.data),l.wrapS=f.wrapS!==void 0?f.wrapS:bi,l.wrapT=f.wrapT!==void 0?f.wrapT:bi,l.magFilter=f.magFilter!==void 0?f.magFilter:nn,l.minFilter=f.minFilter!==void 0?f.minFilter:nn,l.anisotropy=f.anisotropy!==void 0?f.anisotropy:1,f.colorSpace!==void 0&&(l.colorSpace=f.colorSpace),f.flipY!==void 0&&(l.flipY=f.flipY),f.format!==void 0&&(l.format=f.format),f.type!==void 0&&(l.type=f.type),f.mipmaps!==void 0&&(l.mipmaps=f.mipmaps,l.minFilter=Cs),f.mipmapCount===1&&(l.minFilter=nn),f.generateMipmaps!==void 0&&(l.generateMipmaps=f.generateMipmaps),l.needsUpdate=!0,t&&t(l,f)},n,s),l}}class kw extends Ei{constructor(e){super(e)}load(e,t,n,s){const o=new un,l=new Cc(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(c){o.image=c,o.needsUpdate=!0,t!==void 0&&t(o)},n,s),o}}class Hr extends Ht{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ve(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class NS extends Hr{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Ht.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ve(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const Zp=new mt,s_=new B,r_=new B;class Rg{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ae(512,512),this.mapType=yn,this.map=null,this.mapPass=null,this.matrix=new mt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Qo,this._frameExtents=new ae(1,1),this._viewportCount=1,this._viewports=[new Zt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;s_.setFromMatrixPosition(e.matrixWorld),t.position.copy(s_),r_.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(r_),t.updateMatrixWorld(),Zp.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Zp,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===Ca||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Zp)}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.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),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}}const oh=new B,lh=new hi,ws=new B;class Jf extends Ht{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new mt,this.projectionMatrix=new mt,this.projectionMatrixInverse=new mt,this.coordinateSystem=Bi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}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.matrixWorld.decompose(oh,lh,ws),ws.x===1&&ws.y===1&&ws.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(oh,lh,ws.set(1,1,1)).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorld.decompose(oh,lh,ws),ws.x===1&&ws.y===1&&ws.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(oh,lh,ws.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const wr=new B,a_=new ae,o_=new ae;class Dn extends Jf{constructor(e=50,t=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=s,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){const t=.5*this.getFilmHeight()/e;this.fov=Wo*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ma*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 4,977 bytes, line 5
5getEffectiveFOV(){return Wo*2*Math.atan(Math.tan(Ma*.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,n){wr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(wr.x,wr.y).multiplyScalar(-e/wr.z),wr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(wr.x,wr.y).multiplyScalar(-e/wr.z)}getViewSize(e,t){return this.getViewBounds(e,a_,o_),t.subVectors(o_,a_)}setViewOffset(e,t,n,s,o,l){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=n,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Ma*.5*this.fov)/this.zoom,n=2*t,s=this.aspect*n,o=-.5*s;const l=this.view;if(this.view!==null&&this.view.enabled){const h=l.fullWidth,f=l.fullHeight;o+=l.offsetX*s/h,t-=l.offsetY*n/f,s*=l.width/h,n*=l.height/f}const c=this.filmOffset;c!==0&&(o+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+s,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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}}class Vw extends Rg{constructor(){super(new Dn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=Wo*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||t.far;(n!==t.fov||s!==t.aspect||o!==t.far)&&(t.fov=n,t.aspect=s,t.far=o,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class US extends Hr{constructor(e,t,n=0,s=Math.PI/3,o=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ht.DEFAULT_UP),this.updateMatrix(),this.target=new Ht,this.distance=n,this.angle=s,this.penumbra=o,this.decay=l,this.map=null,this.shadow=new Vw}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.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.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class Hw extends Rg{constructor(){super(new Dn(90,1,.5,500)),this.isPointLightShadow=!0}}class FS extends Hr{constructor(e,t,n=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=s,this.shadow=new Hw}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.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}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class Ua extends Jf{constructor(e=-1,t=1,n=1,s=-1,o=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=s,this.near=o,this.far=l,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,n,s,o,l){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=n,this.view.offsetY=s,this.view.width=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let o=n-e,l=n+e,c=s+t,h=s-t;if(this.view!==null&&this.view.enabled){const f=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=f*this.view.offsetX,l=o+f*this.view.width,c-=p*this.view.offsetY,h=c-p*this.view.height}
vendor: 13,384 bytes, line 5
5this.projectionMatrix.makeOrthographic(o,l,c,h,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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}}class Gw extends Rg{constructor(){super(new Ua(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class OS extends Hr{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ht.DEFAULT_UP),this.updateMatrix(),this.target=new Ht,this.shadow=new Gw}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class BS extends Hr{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class zS extends Hr{constructor(e,t,n=10,s=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=s}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class Ig{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new B)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,s=e.y,o=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.282095),t.addScaledVector(l[1],.488603*s),t.addScaledVector(l[2],.488603*o),t.addScaledVector(l[3],.488603*n),t.addScaledVector(l[4],1.092548*(n*s)),t.addScaledVector(l[5],1.092548*(s*o)),t.addScaledVector(l[6],.315392*(3*o*o-1)),t.addScaledVector(l[7],1.092548*(n*o)),t.addScaledVector(l[8],.546274*(n*n-s*s)),t}getIrradianceAt(e,t){const n=e.x,s=e.y,o=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.886227),t.addScaledVector(l[1],2*.511664*s),t.addScaledVector(l[2],2*.511664*o),t.addScaledVector(l[3],2*.511664*n),t.addScaledVector(l[4],2*.429043*n*s),t.addScaledVector(l[5],2*.429043*s*o),t.addScaledVector(l[6],.743125*o*o-.247708),t.addScaledVector(l[7],2*.429043*n*o),t.addScaledVector(l[8],.429043*(n*n-s*s)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let s=0;s<9;s++)n[s].fromArray(e,t+s*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let s=0;s<9;s++)n[s].toArray(e,t+s*3);return e}static getBasisAt(e,t){const n=e.x,s=e.y,o=e.z;t[0]=.282095,t[1]=.488603*s,t[2]=.488603*o,t[3]=.488603*n,t[4]=1.092548*n*s,t[5]=1.092548*s*o,t[6]=.315392*(3*o*o-1),t[7]=1.092548*n*o,t[8]=.546274*(n*n-s*s)}}class kS extends Hr{constructor(e=new Ig,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Qf extends Ei{constructor(e){super(e),this.textures={}}load(e,t,n,s){const o=this,l=new sr(o.manager);l.setPath(o.path),l.setRequestHeader(o.requestHeader),l.setWithCredentials(o.withCredentials),l.load(e,function(c){try{t(o.parse(JSON.parse(c)))}catch(h){s?s(h):Qe(h),o.manager.itemError(e)}},n,s)}parse(e){const t=this.textures;function n(o){return t[o]===void 0&&De("MaterialLoader: Undefined texture",o),t[o]}const s=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(s.uuid=e.uuid),e.name!==void 0&&(s.name=e.name),e.color!==void 0&&s.color!==void 0&&s.color.setHex(e.color),e.roughness!==void 0&&(s.roughness=e.roughness),e.metalness!==void 0&&(s.metalness=e.metalness),e.sheen!==void 0&&(s.sheen=e.sheen),e.sheenColor!==void 0&&(s.sheenColor=new Ve().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(s.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&s.emissive!==void 0&&s.emissive.setHex(e.emissive),e.specular!==void 0&&s.specular!==void 0&&s.specular.setHex(e.specular),e.specularIntensity!==void 0&&(s.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&s.specularColor!==void 0&&s.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(s.shininess=e.shininess),e.clearcoat!==void 0&&(s.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(s.dispersion=e.dispersion),e.iridescence!==void 0&&(s.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(s.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(s.transmission=e.transmission),e.thickness!==void 0&&(s.thickness=e.thickness),e.attenuationDistance!==void 0&&(s.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&s.attenuationColor!==void 0&&s.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(s.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(s.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(s.fog=e.fog),e.flatShading!==void 0&&(s.flatShading=e.flatShading),e.blending!==void 0&&(s.blending=e.blending),e.combine!==void 0&&(s.combine=e.combine),e.side!==void 0&&(s.side=e.side),e.shadowSide!==void 0&&(s.shadowSide=e.shadowSide),e.opacity!==void 0&&(s.opacity=e.opacity),e.transparent!==void 0&&(s.transparent=e.transparent),e.alphaTest!==void 0&&(s.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(s.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(s.depthFunc=e.depthFunc),e.depthTest!==void 0&&(s.depthTest=e.depthTest),e.depthWrite!==void 0&&(s.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(s.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(s.blendSrc=e.blendSrc),e.blendDst!==void 0&&(s.blendDst=e.blendDst),e.blendEquation!==void 0&&(s.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(s.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(s.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(s.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&s.blendColor!==void 0&&s.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(s.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(s.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(s.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(s.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(s.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(s.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(s.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(s.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(s.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(s.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(s.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(s.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(s.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(s.rotation=e.rotation),e.linewidth!==void 0&&(s.linewidth=e.linewidth),e.dashSize!==void 0&&(s.dashSize=e.dashSize),e.gapSize!==void 0&&(s.gapSize=e.gapSize),e.scale!==void 0&&(s.scale=e.scale),e.polygonOffset!==void 0&&(s.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(s.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(s.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(s.dithering=e.dithering),e.alphaToCoverage!==void 0&&(s.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(s.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(s.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(s.allowOverride=e.allowOverride),e.visible!==void 0&&(s.visible=e.visible),e.toneMapped!==void 0&&(s.toneMapped=e.toneMapped),e.userData!==void 0&&(s.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?s.vertexColors=e.vertexColors>0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const l=e.uniforms[o];switch(s.uniforms[o]={},l.type){case"t":s.uniforms[o].value=n(l.value);break;case"c":s.uniforms[o].value=new Ve().setHex(l.value);break;case"v2":s.uniforms[o].value=new ae().fromArray(l.value);break;case"v3":s.uniforms[o].value=new B().fromArray(l.value);break;case"v4":s.uniforms[o].value=new Zt().fromArray(l.value);break;case"m3":s.uniforms[o].value=new xt().fromArray(l.value);break;case"m4":s.uniforms[o].value=new mt().fromArray(l.value);break;default:s.uniforms[o].value=l.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const o in e.extensions)s.extensions[o]=e.extensions[o];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=n(e.map)),e.matcap!==void 0&&(s.matcap=n(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),s.normalScale=new ae().fromArray(o)}return e.displacementMap!==void 0&&(s.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=n(e.envMap)),e.envMapRotation!==void 0&&s.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new ae().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(s.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=n(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Qf.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:_S,SpriteMaterial:ug,RawShaderMaterial:yg,ShaderMaterial:En,PointsMaterial:fg,MeshPhysicalMaterial:bS,MeshStandardMaterial:Sg,MeshPhongMaterial:MS,MeshToonMaterial:ES,MeshNormalMaterial:bg,MeshLambertMaterial:TS,MeshDepthMaterial:Mg,MeshDistanceMaterial:Eg,MeshBasicMaterial:kr,MeshMatcapMaterial:wS,LineDashedMaterial:AS,LineBasicMaterial:ai,Material:Vn};return new t[e]}}class Im{static extractUrlBase(e){const 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)}}class VS extends gt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}
5class HS extends Ei{constructor(e){super(e)}load(e,t,n,s){const o=this,l=new sr(o.manager);l.setPath(o.path),l.setRequestHeader(o.requestHeader),l.setWithCredentials(o.withCredentials),l.load(e,function(c){try{t(o.parse(JSON.parse(c)))}catch(h){s?s(h):Qe(h),o.manager.itemError(e)}},n,s)}parse(e){const t={},n={};function s(v,y){if(t[y]!==void 0)return t[y];const S=v.interleavedBuffers[y],_=o(v,S.buffer),M=Bo(S.type,_),T=new Uf(M,S.stride);return T.uuid=S.uuid,t[y]=T,T}function o(v,y){if(n[y]!==void 0)return n[y];const S=v.arrayBuffers[y],_=new Uint32Array(S).buffer;return n[y]=_,_}const l=e.isInstancedBufferGeometry?new VS:new gt,c=e.data.index;if(c!==void 0){const v=Bo(c.type,c.array);l.setIndex(new Qt(v,1))}const h=e.data.attributes;for(const v in h){const y=h[v];let E;if(y.isInterleavedBufferAttribute){const S=s(e.data,y.data);E=new Ra(S,y.itemSize,y.offset,y.normalized)}else{const S=Bo(y.type,y.array),_=y.isInstancedBufferAttribute?qo:Qt;E=new _(S,y.itemSize,y.normalized)}y.name!==void 0&&(E.name=y.name),y.usage!==void 0&&E.setUsage(y.usage),l.setAttribute(v,E)}const f=e.data.morphAttributes;if(f)for(const v in f){const y=f[v],E=[];for(let S=0,_=y.length;S<_;S++){const M=y[S];let T;if(M.isInterleavedBufferAttribute){const A=s(e.data,M.data);T=new Ra(A,M.itemSize,M.offset,M.normalized)}else{const A=Bo(M.type,M.array);T=new Qt(A,M.itemSize,M.normalized)}M.name!==void 0&&(T.name=M.name),E.push(T)}l.morphAttributes[v]=E}e.data.morphTargetsRelative&&(l.morphTargetsRelative=!0);const g=e.data.groups||e.data.drawcalls||e.data.offsets;if(g!==void 0)for(let v=0,y=g.length;v!==y;++v){const E=g[v];l.addGroup(E.start,E.count,E.materialIndex)}const m=e.data.boundingSphere;return m!==void 0&&(l.boundingSphere=new $n().fromJSON(m)),e.name&&(l.name=e.name),e.userData&&(l.userData=e.userData),l}}const Kp={};class Ww extends Ei{constructor(e){super(e)}load(e,t,n,s){const o=this,l=this.path===""?Im.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||l;const c=new sr(this.manager);c.setPath(this.path),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(e,function(h){let f=null;try{f=JSON.parse(h)}catch(g){s!==void 0&&s(g),Qe("ObjectLoader: Can't parse "+e+".",g.message);return}const p=f.metadata;if(p===void 0||p.type===void 0||p.type.toLowerCase()==="geometry"){s!==void 0&&s(new Error("THREE.ObjectLoader: Can't load "+e)),Qe("ObjectLoader: Can't load "+e);return}o.parse(f,t)},n,s)}async loadAsync(e,t){const n=this,s=this.path===""?Im.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const o=new sr(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials);const l=await o.loadAsync(e,t);let c;try{c=JSON.parse(l)}catch(f){throw new Error("ObjectLoader: Can't parse "+e+". "+f.message)}const h=c.metadata;if(h===void 0||h.type===void 0||h.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(c)}parse(e,t){const n=this.parseAnimations(e.animations),s=this.parseShapes(e.shapes),o=this.parseGeometries(e.geometries,s),l=this.parseImages(e.images,function(){t!==void 0&&t(f)}),c=this.parseTextures(e.textures,l),h=this.parseMaterials(e.materials,c),f=this.parseObject(e.object,o,h,c,n),p=this.parseSkeletons(e.skeletons,f);
vendor: 4,247 bytes, line 5
5if(this.bindSkeletons(f,p),this.bindLightTargets(f),t!==void 0){let g=!1;for(const m in l)if(l[m].data instanceof HTMLImageElement){g=!0;break}g===!1&&t(f)}return f}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,n),o=await this.parseImagesAsync(e.images),l=this.parseTextures(e.textures,o),c=this.parseMaterials(e.materials,l),h=this.parseObject(e.object,s,c,l,t),f=this.parseSkeletons(e.skeletons,h);return this.bindSkeletons(h,f),this.bindLightTargets(h),h}static registerGeometry(e,t){Kp[e]=t}parseShapes(e){const t={};if(e!==void 0)for(let n=0,s=e.length;n<s;n++){const o=new Ea().fromJSON(e[n]);t[o.uuid]=o}return t}parseSkeletons(e,t){const n={},s={};if(t.traverse(function(o){o.isBone&&(s[o.uuid]=o)}),e!==void 0)for(let o=0,l=e.length;o<l;o++){const c=new Ff().fromJSON(e[o],s);n[c.uuid]=c}return n}parseGeometries(e,t){const n={};if(e!==void 0){const s=new HS;for(let o=0,l=e.length;o<l;o++){let c;const h=e[o];switch(h.type){case"BufferGeometry":case"InstancedBufferGeometry":c=s.parse(h);break;default:h.type in t_?c=t_[h.type].fromJSON(h,t):h.type in Kp?c=Kp[h.type].fromJSON(h,t):De(`ObjectLoader: Unknown geometry type "${h.type}". Use .registerGeometry() before starting the deserialization process.`)}c.uuid=h.uuid,h.name!==void 0&&(c.name=h.name),h.userData!==void 0&&(c.userData=h.userData),n[h.uuid]=c}}return n}parseMaterials(e,t){const n={},s={};if(e!==void 0){const o=new Qf;o.setTextures(t);for(let l=0,c=e.length;l<c;l++){const h=e[l];n[h.uuid]===void 0&&(n[h.uuid]=o.parse(h)),s[h.uuid]=n[h.uuid]}}return s}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const s=e[n],o=Ac.parse(s);t[o.uuid]=o}return t}parseImages(e,t){const n=this,s={};let o;function l(h){return n.manager.itemStart(h),o.load(h,function(){n.manager.itemEnd(h)},void 0,function(){n.manager.itemError(h),n.manager.itemEnd(h)})}function c(h){if(typeof h=="string"){const f=h,p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(f)?f:n.resourcePath+f;return l(p)}else return h.data?{data:Bo(h.type,h.data),width:h.width,height:h.height}:null}if(e!==void 0&&e.length>0){const h=new Cg(t);o=new Cc(h),o.setCrossOrigin(this.crossOrigin);for(let f=0,p=e.length;f<p;f++){const g=e[f],m=g.url;if(Array.isArray(m)){const v=[];for(let y=0,E=m.length;y<E;y++){const S=m[y],_=c(S);_!==null&&(_ instanceof HTMLImageElement?v.push(_):v.push(new hs(_.data,_.width,_.height)))}s[g.uuid]=new Lr(v)}else{const v=c(g.url);s[g.uuid]=new Lr(v)}}}return s}async parseImagesAsync(e){const t=this,n={};let s;async function o(l){if(typeof l=="string"){const c=l,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:t.resourcePath+c;return await s.loadAsync(h)}else return l.data?{data:Bo(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){s=new Cc(this.manager),s.setCrossOrigin(this.crossOrigin);for(let l=0,c=e.length;l<c;l++){const h=e[l],f=h.url;if(Array.isArray(f)){const p=[];for(let g=0,m=f.length;g<m;g++){const v=f[g],y=await o(v);y!==null&&(y instanceof HTMLImageElement?p.push(y):p.push(new hs(y.data,y.width,y.height)))}n[h.uuid]=new Lr(p)}else{const p=await o(h.url);n[h.uuid]=new Lr(p)}}}return n}parseTextures(e,t){function n(o,l){return typeof o=="number"?o:(De("ObjectLoader.parseTexture: Constant should be in numeric form.",o),l[o])}const s={};if(e!==void 0)for(let o=0,l=e.length;o<l;o++){const c=e[o];c.image===void 0&&De('ObjectLoader: No "image" specified for',c.uuid),t[c.image]===void 0&&De("ObjectLoader: Undefined image",c.image);const h=t[c.image],f=h.data;let p;Array.isArray(f)?(p=new Lc,f.length===6&&(p.needsUpdate=!0)):(f&&f.data?p=new hs:p=new un,f&&(p.needsUpdate=!0)),p.source=h,p.uuid=c.uuid,c.name!==void 0&&(p.name=c.name),c.mapping!==void 0&&(p.mapping=n(c.mapping,Xw)),c.channel!==void 0&&(p.channel=c.channel),c.offset!==void 0&&p.offset.fromArray(c.offset),c.repeat!==void 0&&p.repeat.fromArray(c.repeat),c.center!==void 0&&p.center.fromArray(c.center),c.rotation!==void 0&&(p.rotation=c.rotation),c.wrap!==void 0&&(p.wrapS=n(c.wrap[0],l_),p.wrapT=n(c.wrap[1],l_)),c.format!==void 0&&(p.format=c.format),c.internalFormat!==void 0&&(p.internalFormat=c.internalFormat),c.type!==void 0&&(p.type=c.type),c.colorSpace!==void 0&&(p.colorSpace
vendor: 6,548 bytes, line 5
5=c.colorSpace),c.minFilter!==void 0&&(p.minFilter=n(c.minFilter,c_)),c.magFilter!==void 0&&(p.magFilter=n(c.magFilter,c_)),c.anisotropy!==void 0&&(p.anisotropy=c.anisotropy),c.flipY!==void 0&&(p.flipY=c.flipY),c.generateMipmaps!==void 0&&(p.generateMipmaps=c.generateMipmaps),c.premultiplyAlpha!==void 0&&(p.premultiplyAlpha=c.premultiplyAlpha),c.unpackAlignment!==void 0&&(p.unpackAlignment=c.unpackAlignment),c.compareFunction!==void 0&&(p.compareFunction=c.compareFunction),c.normalized!==void 0&&(p.normalized=c.normalized),c.userData!==void 0&&(p.userData=c.userData),s[c.uuid]=p}return s}parseObject(e,t,n,s,o){let l;function c(m){return t[m]===void 0&&De("ObjectLoader: Undefined geometry",m),t[m]}function h(m){if(m!==void 0){if(Array.isArray(m)){const v=[];for(let y=0,E=m.length;y<E;y++){const S=m[y];n[S]===void 0&&De("ObjectLoader: Undefined material",S),v.push(n[S])}return v}return n[m]===void 0&&De("ObjectLoader: Undefined material",m),n[m]}}function f(m){return s[m]===void 0&&De("ObjectLoader: Undefined texture",m),s[m]}let p,g;switch(e.type){case"Scene":l=new Sc,e.background!==void 0&&(Number.isInteger(e.background)?l.background=new Ve(e.background):l.background=f(e.background)),e.environment!==void 0&&(l.environment=f(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?l.fog=new Nf(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(l.fog=new Df(e.fog.color,e.fog.density)),e.fog.name!==""&&(l.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(l.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(l.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&l.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(l.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&l.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":l=new Dn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(l.focus=e.focus),e.zoom!==void 0&&(l.zoom=e.zoom),e.filmGauge!==void 0&&(l.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(l.filmOffset=e.filmOffset),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"OrthographicCamera":l=new Ua(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(l.zoom=e.zoom),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"AmbientLight":l=new BS(e.color,e.intensity);break;case"DirectionalLight":l=new OS(e.color,e.intensity),l.target=e.target||"";break;case"PointLight":l=new FS(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":l=new zS(e.color,e.intensity,e.width,e.height);break;case"SpotLight":l=new US(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),l.target=e.target||"";break;case"HemisphereLight":l=new NS(e.color,e.groundColor,e.intensity);break;case"LightProbe":const m=new Ig().fromArray(e.sh);l=new kS(m,e.intensity);break;case"SkinnedMesh":p=c(e.geometry),g=h(e.material),l=new tS(p,g),e.bindMode!==void 0&&(l.bindMode=e.bindMode),e.bindMatrix!==void 0&&l.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(l.skeleton=e.skeleton);break;case"Mesh":p=c(e.geometry),g=h(e.material),l=new Mn(p,g);break;case"InstancedMesh":p=c(e.geometry),g=h(e.material);const v=e.count,y=e.instanceMatrix,E=e.instanceColor;l=new nS(p,g,v),l.instanceMatrix=new qo(new Float32Array(y.array),16),E!==void 0&&(l.instanceColor=new qo(new Float32Array(E.array),E.itemSize));break;case"BatchedMesh":p=c(e.geometry),g=h(e.material),l=new iS(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,g),l.geometry=p,l.perObjectFrustumCulled=e.perObjectFrustumCulled,l.sortObjects=e.sortObjects,l._drawRanges=e.drawRanges,l._reservedRanges=e.reservedRanges,l._geometryInfo=e.geometryInfo.map(S=>{let _=null,M=null;return S.boundingBox!==void 0&&(_=new ri().fromJSON(S.boundingBox)),S.boundingSphere!==void 0&&(M=new $n().fromJSON(S.boundingSphere)),{...S,boundingBox:_,boundingSphere:M}}),l._instanceInfo=e.instanceInfo,l._availableInstanceIds=e._availableInstanceIds,l._availableGeometryIds=e._availableGeometryIds,l._nextIndexStart=e.nextIndexStart,l._nextVertexStart=e.nextVertexStart,l._geometryCount=e.geometryCount,l._maxInstanceCount=e.maxInstanceCount,l._maxVertexCount=e.maxVertexCount,l._maxIndexCount=e.maxIndexCount,l._geometryInitialized=e.geometryInitialized,l._matricesTexture=f(e.matricesTexture.uuid),l._indirectTexture=f(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(l._colorsTexture=f(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(l.boundingSphere=new $n().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(l.boundingBox=new ri().fromJSON(e.boundingBox));break;case"LOD":l=new eS;break;case"Line":l=new ir(c(e.geometry),h(e.material));break;case"LineLoop":l=new sS(c(e.geometry),h(e.material));break;case"LineSegments":l=new Ds(c(e.geometry),h(e.material));break;case"PointCloud":case"Points":l=new rS(c(e.geometry),h(e.material));break;case"Sprite":l=new Qy(h(e.material));break;case"Group":l=new zo;break;case"Bone":l=new hg;break;default:l=new Ht}if(l.uuid=e.uuid,e.name!==void 0&&(l.name=e.name),e.matrix!==void 0?(l.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(l.matrixAutoUpdate=e.matrixAutoUpdate),l.matrixAutoUpdate&&l.matrix.decompose(l.position,l.quaternion,l.scale)):(e.position!==void 0&&l.position.fromArray(e.position),e.rotation!==void 0&&l.rotation.fromArray(e.rotation),e.quaternion!==void 0&&l.quaternion.fromArray(e.quaternion),e.scale!==void 0&&l.scale.fromArray(e.scale)),e.up!==void 0&&l.up.fromArray(e.up),e.pivot!==void 0&&(l.pivot=new B().fromArray(e.pivot)),e.morphTargetDictionary!==void 0&&(l.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),e.morphTargetInfluences!==void 0&&(l.morphTargetInfluences=e.morphTargetInfluences.slice()),e.castShadow!==void 0&&(l.castShadow=e.castShadow),e.receiveShadow!==void 0&&(l.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(l.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(l.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(l.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(l.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&l.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(l.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(l.visible=e.visible),e.frustumCulled!==void 0&&(l.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(l.renderOrder=e.renderOrder),e.static!==void 0&&(l.static=e.static),e.userData!==void 0&&(l.userData=e.userData),e.layers!==void 0&&(l.layers.mask=e.layers
5),e.children!==void 0){const m=e.children;for(let v=0;v<m.length;v++)l.add(this.parseObject(m[v],t,n,s,o))}if(e.animations!==void 0){const m=e.animations;for(let v=0;v<m.length;v++){const y=m[v];l.animations.push(o[y])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(l.autoUpdate=e.autoUpdate);const m=e.levels;for(let v=0;v<m.length;v++){const y=m[v],E=l.getObjectByProperty("uuid",y.object);E!==void 0&&l.addLevel(E,y.distance,y.hysteresis)}}return l}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const s=t[n.skeleton];s===void 0?De("ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(s,n.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,s=e.getObjectByProperty("uuid",n);s!==void 0?t.target=s:t.target=new Ht}})}}const Xw={UVMapping:Sf,CubeReflectionMapping:Ps,CubeRefractionMapping:Nr,EquirectangularReflectionMapping:Kl,EquirectangularRefractionMapping:Jl,CubeUVReflectionMapping:Ko},l_={RepeatWrapping:hc,ClampToEdgeWrapping:bi,MirroredRepeatWrapping:fc},c_={NearestFilter:cn,NearestMipmapNearestFilter:Jm,NearestMipmapLinearFilter:Oo,LinearFilter:nn,LinearMipmapNearestFilter:Ql,LinearMipmapLinearFilter:Cs},Jp=new WeakMap;class qw extends Ei{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&De("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&De("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,l=Rs.get(`image-bitmap:${e}`);if(l!==void 0){if(o.manager.itemStart(e),l.then){l.then(f=>{Jp.has(l)===!0?(s&&s(Jp.get(l)),o.manager.itemError(e),o.manager.itemEnd(e)):(t&&t(f),o.manager.itemEnd(e))});return}setTimeout(function(){t&&t(l),o.manager.itemEnd(e)},0);return}const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader,c.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const h=fetch(e,c).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(f){Rs.add(`image-bitmap:${e}`,f),t&&t(f),o.manager.itemEnd(e)}).catch(function(f){s&&s(f),Jp.set(h,f),Rs.remove(`image-bitmap:${e}`),o.manager.itemError(e),o.manager.itemEnd(e)});Rs.add(`image-bitmap:${e}`,h),o.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let ch;class Pg{static getContext(){return ch===void 0&&(ch=new(window.AudioContext||window.webkitAudioContext)),ch}static setContext(e){ch=e}}class Yw extends Ei{constructor(e){super(e)}load(e,t,n,s){const o=this,l=new sr(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(h){try{const f=h.slice(0),p=Pg.getContext(),g=e+"#decode";o.manager.itemStart(g),p.decodeAudioData(f,function(m){t(m),o.manager.itemEnd(g)}).catch(function(m){c(m),o.manager.itemEnd(g)})}catch(f){c(f)}},n,s);function c(h){s?s(h):Qe(h),o.manager.itemError(e)}}}const u_=new mt,h_=new mt,ua=new mt;class jw{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Dn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Dn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,ua.copy(e.projectionMatrix);const s=t.eyeSep/2,o=s*t.near/t.focus,l=t.near*Math.tan(Ma*t.fov*.5)/t.zoom;let c,h;h_.elements[12]=-s,u_.elements[12]=s,c=-l*t.aspect+o,h=l*t.aspect+o,ua.elements[0]=2*t.near/(h-c),ua.elements[8]=(h+c)/(h-c),this.cameraL.projectionMatrix.copy(ua),c=-l*t.aspect-o,h=l*t.aspect-o,ua.elements[0]=2*t.near/(h-c),ua.elements[8]=(h+c)/(h-c),this.cameraR.projectionMatrix.copy(ua)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(h_),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(u_)}}const Ro=-90,Io=1;class GS extends Ht{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Dn(Ro,Io,e,t);s.layers=this.layers,this.add(s);const o=new Dn(Ro,Io,e,t);o.layers=this.layers,this.add(o);const l=new Dn(Ro,Io,e,t);l.layers=this.layers,this.add(l);const c=new Dn(Ro,Io,e,t);c.layers=this.layers,this.add(c);const h=new Dn(Ro,Io,e,t);h.layers=this.layers,this.add(h);const f=new Dn(Ro,Io,e,t);f.layers=this.layers,this.add(f)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,o,l,c,h]=t;
5for(const f of t)this.remove(f);if(e===Bi)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),h.up.set(0,1,0),h.lookAt(0,0,-1);else if(e===Ca)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),h.up.set(0,-1,0),h.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const f of t)this.add(f),f.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,l,c,h,f,p]=this.children,g=e.getRenderTarget(),m=e.getActiveCubeFace(),v=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const E=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let S=!1;e.isWebGLRenderer===!0?S=e.state.buffers.depth.getReversed():S=e.reversedDepthBuffer,e.setRenderTarget(n,0,s),S&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,1,s),S&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(n,2,s),S&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),e.setRenderTarget(n,3,s),S&&e.autoClear===!1&&e.clearDepth(),e.render(t,h),e.setRenderTarget(n,4,s),S&&e.autoClear===!1&&e.clearDepth(),e.render(t,f),n.texture.generateMipmaps=E,e.setRenderTarget(n,5,s),S&&e.autoClear===!1&&e.clearDepth(),e.render(t,p),e.setRenderTarget(g,m,v),e.xr.enabled=y,n.texture.needsPMREMUpdate=!0}}class WS extends Dn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}let XS=class{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=$w.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}};function $w(){this._document.hidden===!1&&this.reset()}const ha=new B,Qp=new hi,Zw=new B,fa=new B,da=new B;class Kw extends Ht{constructor(){super(),this.type="AudioListener",this.context=Pg.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new XS}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this._timer.update(
vendor: 4,318 bytes, line 5
5);const t=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(ha,Qp,Zw),fa.set(0,0,-1).applyQuaternion(Qp),da.set(0,1,0).applyQuaternion(Qp),t.positionX){const n=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ha.x,n),t.positionY.linearRampToValueAtTime(ha.y,n),t.positionZ.linearRampToValueAtTime(ha.z,n),t.forwardX.linearRampToValueAtTime(fa.x,n),t.forwardY.linearRampToValueAtTime(fa.y,n),t.forwardZ.linearRampToValueAtTime(fa.z,n),t.upX.linearRampToValueAtTime(da.x,n),t.upY.linearRampToValueAtTime(da.y,n),t.upZ.linearRampToValueAtTime(da.z,n)}else t.setPosition(ha.x,ha.y,ha.z),t.setOrientation(fa.x,fa.y,fa.z,da.x,da.y,da.z)}}class qS extends Ht{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){De("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){De("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){De("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){De("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){De("Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}
vendor: 9,301 bytes, line 5
5getLoop(){return this.hasPlaybackControl===!1?(De("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){De("Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(De("Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const pa=new B,f_=new hi,Jw=new B,ma=new B;class Qw extends qS{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(pa,f_,Jw),ma.set(0,0,1).applyQuaternion(f_);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(pa.x,n),t.positionY.linearRampToValueAtTime(pa.y,n),t.positionZ.linearRampToValueAtTime(pa.z,n),t.orientationX.linearRampToValueAtTime(ma.x,n),t.orientationY.linearRampToValueAtTime(ma.y,n),t.orientationZ.linearRampToValueAtTime(ma.z,n)}else t.setPosition(pa.x,pa.y,pa.z),t.setOrientation(ma.x,ma.y,ma.z)}}class eA{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class YS{constructor(e,t,n){this.binding=e,this.valueSize=n;let s,o,l;switch(t){case"quaternion":s=this._slerp,o=this._slerpAdditive,l=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":s=this._select,o=this._select,l=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:s=this._lerp,o=this._lerpAdditive,l=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=s,this._mixBufferRegionAdditive=o,this._setIdentity=l,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,s=this.valueSize,o=e*s+s;let l=this.cumulativeWeight;if(l===0){for(let c=0;c!==s;++c)n[o+c]=n[c];l=t}else{l+=t;const c=t/l;this._mixBufferRegion(n,o,0,c,s)}this.cumulativeWeight=l}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,s=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,s,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,s=e*t+t,o=this.cumulativeWeight,l=this.cumulativeWeightAdditive,c=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,o<1){const h=t*this._origIndex;this._mixBufferRegion(n,s,h,1-o,t)}l>0&&this._mixBufferRegionAdditive(n,s,this._addIndex*t,1,t);for(let h=t,f=t+t;h!==f;++h)if(n[h]!==n[h+t]){c.setValue(n,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,s=n*this._origIndex;e.getValue(t,s);for(let o=n,l=s;o!==l;++o)t[o]=t[s+o%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,s,o){if(s>=.5)for(let l=0;l!==o;++l)e[t+l]=e[n+l]}_slerp(e,t,n,s){hi.slerpFlat(e,t,e,t,e,n,s)}_slerpAdditive(e,t,n,s,o){const l=this._workIndex*o;hi.multiplyQuaternionsFlat(e,l,e,t,e,n),hi.slerpFlat(e,t,e,t,e,l,s)}_lerp(e,t,n,s,o){const l=1-s;for(let c=0;c!==o;++c){const h=t+c;e[h]=e[h]*l+e[n+c]*s}}_lerpAdditive(e,t,n,s,o){for(let l=0;l!==o;++l){const c=t+l;e[c]=e[c]+e[n+l]*s}}}const Lg="\\[\\]\\.:\\/",tA=new RegExp("["+Lg+"]","g"),Dg="[^"+Lg+"]",nA="[^"+Lg.replace("\\.","")+"]",iA=/((?:WC+[\/:])*)/.source.replace("WC",Dg),sA=/(WCOD+)?/.source.replace("WCOD",nA),rA=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Dg),aA=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Dg),oA=new RegExp("^"+iA+sA+rA+aA+"$"),lA=["material","materials","bones","map"];class cA{constructor(e,t,n){const s=n||Vt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,s=this._bindings[n];s!==void 0&&s.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let s=this._targetGroup.nCachedObjects_,o=n.length;s!==o;++s)n[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Vt{constructor(e,t,n){this.path=t,this.parsedPath=n||Vt.parseTrackName(t),this.node=Vt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Vt.Composite(e,t,n):new Vt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tA,"")}static parseTrackName(e){const t=oA.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=n.nodeName&&n.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const o=n.nodeName.substring(s+1);lA.indexOf(o)!==-1&&(n.nodeName=n.nodeName.substring(0,s),n.objectName=o)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(o){for(let l=0;l<o.length;l++){const c=o[l];if(c.name===t||c.uuid===t)return c;const h=n(c.children);if(h)return h}return null},s=n(e.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let s=0,o=n.length;s!==o;++s)e[t++]=n[s]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let s=0,o=n.length;s!==o;++s)n[s]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let s=0,o=n.length;s!==o;++s)n[s]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let s=0,o=n.length;s!==o;++s)n[s]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}
vendor: 4,487 bytes, line 5
5_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,s=t.propertyName;let o=t.propertyIndex;if(e||(e=Vt.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){De("PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let f=t.objectIndex;switch(n){case"materials":if(!e.material){Qe("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){Qe("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){Qe("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let p=0;p<e.length;p++)if(e[p].name===f){f=p;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){Qe("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){Qe("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){Qe("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(f!==void 0){if(e[f]===void 0){Qe("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[f]}}const l=e[s];if(l===void 0){const f=t.nodeName;Qe("PropertyBinding: Trying to update property for track: "+f+"."+s+" but it wasn't found.",e);return}let c=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?c=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(c=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(o!==void 0){if(s==="morphTargetInfluences"){if(!e.geometry){Qe("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){Qe("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[o]!==void 0&&(o=e.morphTargetDictionary[o])}h=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=o}else l.fromArray!==void 0&&l.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(h=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=s;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Vt.Composite=cA;Vt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Vt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Vt.prototype.GetterByBindingType=[Vt.prototype._getValue_direct,Vt.prototype._getValue_array,Vt.prototype._getValue_arrayElement,Vt.prototype._getValue_toArray];Vt.prototype.SetterByBindingTypeAndVersioning=[[Vt.prototype._setValue_direct,Vt.prototype._setValue_direct_setNeedsUpdate,Vt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Vt.prototype._setValue_array,Vt.prototype._setValue_array_setNeedsUpdate,Vt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Vt.prototype._setValue_arrayElement,Vt.prototype._setValue_arrayElement_setNeedsUpdate,Vt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Vt.prototype._setValue_fromArray,Vt.prototype._setValue_fromArray_setNeedsUpdate,Vt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class uA{constructor(){this.isAnimationObjectGroup=!0,this.uuid=ki(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,s=arguments.length;n!==s;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,s=this._parsedPaths,o=this._bindings,l=o.length;let c,h=e.length,f=this.nCachedObjects_;for(let p=0,g=arguments.length;p!==g;
vendor: 15,833 bytes, line 5
5++p){const m=arguments[p],v=m.uuid;let y=t[v];if(y===void 0){y=h++,t[v]=y,e.push(m);for(let E=0,S=l;E!==S;++E)o[E].push(new Vt(m,n[E],s[E]))}else if(y<f){c=e[y];const E=--f,S=e[E];t[S.uuid]=y,e[y]=S,t[v]=E,e[E]=m;for(let _=0,M=l;_!==M;++_){const T=o[_],A=T[E];let D=T[y];T[y]=A,D===void 0&&(D=new Vt(m,n[_],s[_])),T[E]=D}}else e[y]!==c&&Qe("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=f}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,s=n.length;let o=this.nCachedObjects_;for(let l=0,c=arguments.length;l!==c;++l){const h=arguments[l],f=h.uuid,p=t[f];if(p!==void 0&&p>=o){const g=o++,m=e[g];t[m.uuid]=p,e[p]=m,t[f]=g,e[g]=h;for(let v=0,y=s;v!==y;++v){const E=n[v],S=E[g],_=E[p];E[p]=S,E[g]=_}}}this.nCachedObjects_=o}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,s=n.length;let o=this.nCachedObjects_,l=e.length;for(let c=0,h=arguments.length;c!==h;++c){const f=arguments[c],p=f.uuid,g=t[p];if(g!==void 0)if(delete t[p],g<o){const m=--o,v=e[m],y=--l,E=e[y];t[v.uuid]=g,e[g]=v,t[E.uuid]=m,e[m]=E,e.pop();for(let S=0,_=s;S!==_;++S){const M=n[S],T=M[m],A=M[y];M[g]=T,M[m]=A,M.pop()}}else{const m=--l,v=e[m];m>0&&(t[v.uuid]=g),e[g]=v,e.pop();for(let y=0,E=s;y!==E;++y){const S=n[y];S[g]=S[m],S.pop()}}}this.nCachedObjects_=o}subscribe_(e,t){const n=this._bindingsIndicesByPath;let s=n[e];const o=this._bindings;if(s!==void 0)return o[s];const l=this._paths,c=this._parsedPaths,h=this._objects,f=h.length,p=this.nCachedObjects_,g=new Array(f);s=o.length,n[e]=s,l.push(e),c.push(t),o.push(g);for(let m=p,v=h.length;m!==v;++m){const y=h[m];g[m]=new Vt(y,e,t)}return g}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const s=this._paths,o=this._parsedPaths,l=this._bindings,c=l.length-1,h=l[c],f=e[c];t[f]=n,l[n]=h,l.pop(),o[n]=o[c],o.pop(),s[n]=s[c],s.pop()}}}class jS{constructor(e,t,n=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=s;const o=t.tracks,l=o.length,c=new Array(l),h={endingStart:_a,endingEnd:_a};for(let f=0;f!==l;++f){const p=o[f].createInterpolant(null);c[f]=p,p.settings&&Object.assign(h,p.settings),p.settings=h}this._interpolantSettings=h,this._interpolants=c,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=By,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){const s=this._clip.duration,o=e._clip.duration,l=o/s,c=s/o;e.warp(1,l,t),this.warp(c,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const s=this._mixer,o=s.time,l=this.timeScale;let c=this._timeScaleInterpolant;c===null&&(c=s._lendControlInterpolant(),this._timeScaleInterpolant=c);const h=c.parameterPositions,f=c.sampleValues;return h[0]=o,h[1]=o+n,f[0]=e/l,f[1]=t/l,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,s){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const h=(e-o)*n;h<0||n===0?t=0:(this._startTime=null,t=n*h)}t*=this._updateTimeScale(e);const l=this._updateTime(t),c=this._updateWeight(e);if(c>0){const h=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case rg:for(let p=0,g=h.length;p!==g;++p)h[p].evaluate(l),f[p].accumulateAdditive(c);break;case Cf:default:for(let p=0,g=h.length;p!==g;++p)h[p].evaluate(l),f[p].accumulate(s,c)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let s=this.time+e,o=this._loopCount;const l=n===zy;if(e===0)return o===-1?s:l&&(o&1)===1?t-s:s;if(n===Oy){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),s>=t||s<0){const c=Math.floor(s/t);s-=t*c,o+=Math.abs(c);const h=this.repetitions-o;if(h<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(h===1){const f=e<0;this._setEndings(f,!f,l)}else this._setEndings(!1,!1,l);this._loopCount=o,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:c})}}else this._loopCount=o,this.time=s;if(l&&(o&1)===1)return t-s}return s}_setEndings(e,t,n){const s=this._interpolantSettings;n?(s.endingStart=ya,s.endingEnd=ya):(e?s.endingStart=this.zeroSlopeAtStart?ya:_a:s.endingStart=gc,t?s.endingEnd=this.zeroSlopeAtEnd?ya:_a:s.endingEnd=gc)}_scheduleFading(e,t,n){const s=this._mixer,o=s.time;let l=this._weightInterpolant;l===null&&(l=s._lendControlInterpolant(),this._weightInterpolant=l);const c=l.parameterPositions,h=l.sampleValues;return c[0]=o,h[0]=t,c[1]=o+e,h[1]=n,this}}const hA=new Float32Array(1);class fA extends Mi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(e,t){const n=e._localRoot||this._root,s=e._clip.tracks,o=s.length,l=e._propertyBindings,c=e._interpolants,h=n.uuid,f=this._bindingsByRootAndName;let p=f[h];p===void 0&&(p={},f[h]=p);for(let g=0;g!==o;++g){const m=s[g],v=m.name;let y=p[v];if(y!==void 0)++y.referenceCount,l[g]=y;else{if(y=l[g],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,h,v));continue}const E=t&&t._propertyBindings[g].binding.parsedPath;y=new YS(Vt.create(n,v,E),m.ValueTypeName,m.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,h,v),l[g]=y}c[g].resultBuffer=y.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,s=e._clip.uuid,o=this._actionsByClip[s];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,s,n)}const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const o=t[n];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const o=t[n];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const s=this._actions,o=this._actionsByClip;let l=o[t];if(l===void 0)l={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,o[t]=l;else{const c=l.knownActions;e._byClipCacheIndex=c.length,c.push(e)}e._cacheIndex=s.length,s.push(e),l.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],s=e._cacheIndex;n._cacheIndex=s,t[s]=n,t.pop(),e._cacheIndex=null;const o=e._clip.uuid,l=this._actionsByClip,c=l[o],h=c.knownActions,f=h[h.length-1],p=e._byClipCacheIndex;f._byClipCacheIndex=p,h[p]=f,h.pop(),e._byClipCacheIndex=null;const g=c.actionByRoot,m=(e._localRoot||this._root).uuid;delete g[m],h.length===0&&delete l[o],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const o=t[n];--o.referenceCount===0&&this._removeInactiveBinding(o)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,s=this._nActiveActions++,o=t[s];e._cacheIndex=s,t[s]=e,o._cacheIndex=n,t[n]=o}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,s=--this._nActiveActions,o=t[s];e._cacheIndex=s,t[s]=e,o._cacheIndex=n,t[n]=o}_addInactiveBinding(e,t,n){const s=this._bindingsByRootAndName,o=this._bindings;let l=s[t];l===void 0&&(l={},s[t]=l),l[n]=e,e._cacheIndex=o.length,o.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,s=n.rootNode.uuid,o=n.path,l=this._bindingsByRootAndName,c=l[s],h=t[t.length-1],f=e._cacheIndex;h._cacheIndex=f,t[f]=h,t.pop(),delete c[o],Object.keys(c).length===0&&delete l[s]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,s=this._nActiveBindings++,o=t[s];e._cacheIndex=s,t[s]=e,o._cacheIndex=n,t[n]=o}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,s=--this._nActiveBindings,o=t[s];e._cacheIndex=s,t[s]=e,o._cacheIndex=n,t[n]=o}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new wg(new Float32Array(2),new Float32Array(2),1,hA),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,s=--this._nActiveControlInterpolants,o=t[s];e.__cacheIndex=s,t[s]=e,o.__cacheIndex=n,t[n]=o}clipAction(e,t,n){const s=t||this._root,o=s.uuid;let l=typeof e=="string"?Ac.findByName(s,e):e;const c=l!==null?l.uuid:e,h=this._actionsByClip[c];let f=null;if(n===void 0&&(l!==null?n=l.blendMode:n=Cf),h!==void 0){const g=h.actionByRoot[o];if(g!==void 0&&g.blendMode===n)return g;f=h.knownActions[0],l===null&&(l=f._clip)}if(l===null)return null;const p=new jS(this,l,t,n);return this._bindAction(p,f),this._addInactiveAction(p,c,o),p}existingAction(e,t){const n=t||this._root,s=n.uuid,o=typeof e=="string"?Ac.findByName(n,e):e,l=o?o.uuid:e,c=this._actionsByClip[l];return c!==void 0&&c.actionByRoot[s]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,s=this.time+=e,o=Math.sign(e),l=this._accuIndex^=1;for(let f=0;f!==n;++f)t[f]._update(s,e,o,l);const c=this._bindings,h=this._nActiveBindings;for(let f=0;f!==h;++f)c[f].apply(l);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,s=this._actionsByClip,o=s[n];if(o!==void 0){const l=o.knownActions;for(let c=0,h=l.length;c!==h;++c){const f=l[c];this._deactivateAction(f);const p=f._cacheIndex,g=t[t.length-1];f._cacheIndex=null,f._byClipCacheIndex=null,g._cacheIndex=p,t[p]=g,t.pop(),this._removeInactiveBindingsForAction(f)}delete s[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const l in n){const c=n[l].actionByRoot,h=c[t];h!==void 0&&(this._deactivateAction(h),this._removeInactiveAction(h))}const s=this._bindingsByRootAndName,o=s[t];if(o!==void 0)for(const l in o){const c=o[l];c.restoreOriginalState(),this._removeInactiveBinding(c)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class dA extends og{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isRenderTarget3D=!0,this.depth=n,this.texture=new Lf(null,e,t,n),this._setTextureOptions(s),this.texture.isRenderTargetTexture=!0}}class Ut{constructor(e){this.value=e}clone(){return new Ut(this.value.clone===void 0?this.value:this.value.clone())}}let pA=0;class mA extends Mi{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:pA++}),this.name="",this.usage=xc,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,s=t.length;n<s;n++){const o=Array.isArray(t[n])?t[n]:[t[n]];for(let l=0;l<o.length;l++)this.uniforms.push(o[l].clone())}return this}clone(){return new this.constructor().copy(this)}}class gA extends Uf{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class vA{constructor(e,t,n,s,o,l=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=s,this.count=o,this.normalized=l,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const d_=new mt;class $S{constructor(e,t,n=0,s=1/0){this.ray=new Jo(e,t),this.near=n,this.far=s,this.camera=null,this.layers=new Xo,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):Qe("Raycaster:
5Unsupported camera type: "+t.type)}setFromXRController(e){return d_.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(d_),this}intersectObject(e,t=!0,n=[]){return Pm(e,this,n,t),n.sort(p_),n}intersectObjects(e,t=!0,n=[]){for(let s=0,o=e.length;s<o;s++)Pm(e[s],this,n,t);return n.sort(p_),n}}function p_(i,e){return i.distance-e.distance}function Pm(i,e,t,n){let s=!0;if(i.layers.test(e.layers)&&i.raycast(e,t)===!1&&(s=!1),s===!0&&n===!0){const o=i.children;for(let l=0,c=o.length;l<c;l++)Pm(o[l],e,t,!0)}}class ZS{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,De("Clock: This module has been deprecated. Please use THREE.Timer instead.")}start(){this.startTime=performance.now(),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){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}class xA{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=ft(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(ft(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class _A{constructor(e=1,t=0,n=0){this.radius=e,this.theta=t,this.y=n}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}const Xg=class Xg{constructor(e,t,n,s){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,s)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,s){const o=this.elements;return o[0]=e,o[2]=t,o[1]=n,o[3]=s,this}};Xg.prototype.isMatrix2=!0;let Lm=Xg;const m_=new ae;class yA{constructor(e=new ae(1/0,1/0),t=new ae(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=m_.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}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=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(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}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}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}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))}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}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,m_).distanceTo(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}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)}}const g_=new B,uh=new B,Po=new B,Lo=new B,em=new B,SA=new B,bA=ne
5w B;class MA{constructor(e=new B,t=new B){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){g_.subVectors(e,this.start),uh.subVectors(this.end,this.start);const n=uh.dot(uh);if(n===0)return 0;let o=uh.dot(g_)/n;return t&&(o=ft(o,0,1)),o}closestPointToPoint(e,t,n){const s=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(s).add(this.start)}distanceSqToLine3(e,t=SA,n=bA){const s=10000000000000001e-32;let o,l;const c=this.start,h=e.start,f=this.end,p=e.end;Po.subVectors(f,c),Lo.subVectors(p,h),em.subVectors(c,h);const g=Po.dot(Po),m=Lo.dot(Lo),v=Lo.dot(em);if(g<=s&&m<=s)return t.copy(c),n.copy(h),t.sub(n),t.dot(t);if(g<=s)o=0,l=v/m,l=ft(l,0,1);else{const y=Po.dot(em);if(m<=s)l=0,o=ft(-y/g,0,1);else{const E=Po.dot(Lo),S=g*m-E*E;S!==0?o=ft((E*v-y*m)/S,0,1):o=0,l=(E*o+v)/m,l<0?(l=0,o=ft(-y/g,0,1)):l>1&&(l=1,o=ft((E-y)/g,0,1))}}return t.copy(c).addScaledVector(Po,o),n.copy(h).addScaledVector(Lo,l),t.distanceToSquared(n)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const v_=new B;class EA extends Ht{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new gt,s=[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];for(let l=0,c=1,h=32;l<h;l++,c++){const f=l/h*Math.PI*2,p=c/h*Math.PI*2;s.push(Math.cos(f),Math.sin(f),1,Math.cos(p),Math.sin(p),1)}n.setAttribute("position",new je(s,3));const o=new ai({fog:!1,toneMapped:!1});this.cone=new Ds(n,o),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),v_.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(v_),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ar=new B,hh=new mt,tm=new mt;class TA extends Ds{constructor(e){const t=KS(e),n=new gt,s=[],o=[];for(let f=0;f<t.length;f++){const p=t[f];p.parent&&p.parent.isBone&&(s.push(0,0,0),s.push(0,0,0),o.push(0,0,0),o.push(0,0,0))}n.setAttribute("position",new je(s,3)),n.setAttribute("color",new je(o,3));const l=new ai({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const c=new Ve(255),h=new Ve(65280);this.setColors(c,h)}updateMatrixWorld(e){const t=this.bones,n=this.geometry,s=n.getAttribute("position");tm.copy(this.root.matrixWorld).invert();for(let o=0,l=0;o<t.length;o++){const c=t[o];c.parent&&c.parent.isBone&&(hh.multiplyMatrices(tm,c.matrixWorld),Ar.setFromMatrixPosition(hh),s.setXYZ(l,Ar.x,Ar.y,Ar.z),hh.multiplyMatrices(tm,c.parent.matrixWorld),Ar.setFromMatrixPosition(hh),s.setXYZ(l+1,Ar.x,Ar.y,Ar.z),l+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){const s=this.geometry.getAttribute("color");for(let o=0;o<s.count;o+=2)s.setXYZ(o,e.r,e.g,e.b),s.setXYZ(o+1,t.r,t.g,t.b);return s.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function KS(i){const e=[];i.isBone===!0&&e.push(i);for(let t=0;t<i.children.length;t++)e.push(...KS(i.children[t]));return e}class wA extends Mn{constructor(e,t,n){const s=new Fc(t,4,2),o=new kr({wireframe:!0,fog:!1,toneMapped:!1});super(s,o),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const AA=new B,x_=new Ve,__=new Ve;class CA extends Ht{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const s=new Uc(t);s.rotateY(Math.PI*.5),this.material=new kr({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const o=s.getAttribute("position"),l=new Float32Array(o.count*3);s.setAttribute("color",new Qt(l,3)),this.add(new Mn(s,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");x_.copy(this.light.color),__.copy(this.light.groundColor);for(let n=0,s=t.count;n<s;n++){const o=n<s/2?x_:__;t.setXYZ(n,o.r,o.g,o.b)}t.needsUpdate=!0}
vendor: 5,193 bytes, line 5
5this.light.updateWorldMatrix(!0,!1),e.lookAt(AA.setFromMatrixPosition(this.light.matrixWorld).negate())}}class RA extends Ds{constructor(e=10,t=10,n=4473924,s=8947848){n=new Ve(n),s=new Ve(s);const o=t/2,l=e/t,c=e/2,h=[],f=[];for(let m=0,v=0,y=-c;m<=t;m++,y+=l){h.push(-c,0,y,c,0,y),h.push(y,0,-c,y,0,c);const E=m===o?n:s;E.toArray(f,v),v+=3,E.toArray(f,v),v+=3,E.toArray(f,v),v+=3,E.toArray(f,v),v+=3}const p=new gt;p.setAttribute("position",new je(h,3)),p.setAttribute("color",new je(f,3));const g=new ai({vertexColors:!0,toneMapped:!1});super(p,g),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class IA extends Ds{constructor(e=10,t=16,n=8,s=64,o=4473924,l=8947848){o=new Ve(o),l=new Ve(l);const c=[],h=[];if(t>1)for(let g=0;g<t;g++){const m=g/t*(Math.PI*2),v=Math.sin(m)*e,y=Math.cos(m)*e;c.push(0,0,0),c.push(v,0,y);const E=g&1?o:l;h.push(E.r,E.g,E.b),h.push(E.r,E.g,E.b)}for(let g=0;g<n;g++){const m=g&1?o:l,v=e-e/n*g;for(let y=0;y<s;y++){let E=y/s*(Math.PI*2),S=Math.sin(E)*v,_=Math.cos(E)*v;c.push(S,0,_),h.push(m.r,m.g,m.b),E=(y+1)/s*(Math.PI*2),S=Math.sin(E)*v,_=Math.cos(E)*v,c.push(S,0,_),h.push(m.r,m.g,m.b)}}const f=new gt;f.setAttribute("position",new je(c,3)),f.setAttribute("color",new je(h,3));const p=new ai({vertexColors:!0,toneMapped:!1});super(f,p),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const y_=new B,fh=new B,S_=new B;class PA extends Ht{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",t===void 0&&(t=1);let s=new gt;s.setAttribute("position",new je([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const o=new ai({fog:!1,toneMapped:!1});this.lightPlane=new ir(s,o),this.add(this.lightPlane),s=new gt,s.setAttribute("position",new je([0,0,0,0,0,1],3)),this.targetLine=new ir(s,o),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),y_.setFromMatrixPosition(this.light.matrixWorld),fh.setFromMatrixPosition(this.light.target.matrixWorld),S_.subVectors(fh,y_),this.lightPlane.lookAt(fh),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(fh),this.targetLine.scale.z=S_.length()}}const dh=new B,_n=new Jf;class LA extends Ds{constructor(e){const t=new gt,n=new ai({color:16777215,vertexColors:!0,toneMapped:!1}),s=[],o=[],l={};c("n1","n2"),c("n2","n4"),c("n4","n3"),c("n3","n1"),c("f1","f2"),c("f2","f4"),c("f4","f3"),c("f3","f1"),c("n1","f1"),c("n2","f2"),c("n3","f3"),c("n4","f4"),c("p","n1"),c("p","n2"),c("p","n3"),c("p","n4"),c("u1","u2"),c("u2","u3"),c("u3","u1"),c("c","t"),c("p","c"),c("cn1","cn2"),c("cn3","cn4"),c("cf1","cf2"),c("cf3","cf4");function c(y,E){h(y),h(E)}function h(y){s.push(0,0,0),o.push(0,0,0),l[y]===void 0&&(l[y]=[]),l[y].push(s.length/3-1)}t.setAttribute("position",new je(s,3)),t.setAttribute("color",new je(o,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=l,this.update();const f=new Ve(16755200),p=new Ve(16711680),g=new Ve(43775),m=new Ve(16777215),v=new Ve(3355443);this.setColors(f,p,g,m,v)}setColors(e,t,n,s,o){const c=this.geometry.getAttribute("color");return c.setXYZ(0,e.r,e.g,e.b),c.setXYZ(1,e.r,e.g,e.b),c.setXYZ(2,e.r,e.g,e.b),c.setXYZ(3,e.r,e.g,e.b),c.setXYZ(4,e.r,e.g,e.b),c.setXYZ(5,e.r,e.g,e.b),c.setXYZ(6,e.r,e.g,e.b),c.setXYZ(7,e.r,e.g,e.b),c.setXYZ(8,e.r,e.g,e.b),c.setXYZ(9,e.r,e.g,e.b),c.setXYZ(10,e.r,e.g,e.b),c.setXYZ(11,e.r,e.g,e.b),c.setXYZ(12,e.r,e.g,e.b),c.setXYZ(13,e.r,e.g,e.b),c.setXYZ(14,e.r,e.g,e.b),c.setXYZ(15,e.r,e.g,e.b),c.setXYZ(16,e.r,e.g,e.b),c.setXYZ(17,e.r,e.g,e.b),c.setXYZ(18,e.r,e.g,e.b),c.setXYZ(19,e.r,e.g,e.b),c.setXYZ(20,e.r,e.g,e.b),c.setXYZ(21,e.r,e.g,e.b),c.setXYZ(22,e.r,e.g,e.b),c.setXYZ(23,e.r,e.g,e.b),c.setXYZ(24,t.r,t.g,t.b),c.setXYZ(25,t.r,t.g,t.b),c.setXYZ(26,t.r,t.g,t.b),c.setXYZ(27,t.r,t.g,t.b),c.setXYZ(28,t.r,t.g,t.b),c.setXYZ(29,t.r,t.g,t.b),c.setXYZ(30,t.r,t.g,t.b),c.setXYZ(31,t.r,t.g,t.b),c.setXYZ(32,n.r,n.g,n.b),c.setXYZ(33,n.r,n.g,n.b),c.setXYZ(34,n.r,n.g,n.b),c.setXYZ(35,n.r,n.g,n.b),c.setXYZ(36,n.r,n.g,n.b),c.setXYZ(37,n.r,n.g,n.b),c.setXYZ(38,s.r,s.g,s.b),c.setXYZ(39,s.r,s.g,s.b),c.setXYZ(40,o.r,o.g,o.b),c.setXYZ(41,o.r,o.g,o.b),c.setXYZ(42,o.r,o.g,o.b),c.setXYZ(43,o.r,o.g,o.b),c.setXYZ(44,o.r,o.g,o.b),c.setXYZ(45,o.r,o.g,o.b),c.setXYZ(46,o.r,o.g,o.b),c.setXYZ(47,o.r,o.g,o.b),c.setXYZ(48,o.r,o.g,o.b),c.setXYZ(49,o.r,o.g,o.b),c.needsUpdate=!0,this}update(){const e=this.geometry,t=this.pointMap,n=1,s=1;let o,l;if(_n.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)o=1,l=0;else if(this.camera.coordinateSystem===Bi)o=-1,l=1;else if(this.camera.coordinateSystem===Ca)o=0,l=1;
5else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);bn("c",t,e,_n,0,0,o),bn("t",t,e,_n,0,0,l),bn("n1",t,e,_n,-n,-s,o),bn("n2",t,e,_n,n,-s,o),bn("n3",t,e,_n,-n,s,o),bn("n4",t,e,_n,n,s,o),bn("f1",t,e,_n,-n,-s,l),bn("f2",t,e,_n,n,-s,l),bn("f3",t,e,_n,-n,s,l),bn("f4",t,e,_n,n,s,l),bn("u1",t,e,_n,n*.7,s*1.1,o),bn("u2",t,e,_n,-n*.7,s*1.1,o),bn("u3",t,e,_n,0,s*2,o),bn("cf1",t,e,_n,-n,0,l),bn("cf2",t,e,_n,n,0,l),bn("cf3",t,e,_n,0,-s,l),bn("cf4",t,e,_n,0,s,l),bn("cn1",t,e,_n,-n,0,o),bn("cn2",t,e,_n,n,0,o),bn("cn3",t,e,_n,0,-s,o),bn("cn4",t,e,_n,0,s,o),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function bn(i,e,t,n,s,o,l){dh.set(s,o,l).unproject(n);const c=e[i];if(c!==void 0){const h=t.getAttribute("position");for(let f=0,p=c.length;f<p;f++)h.setXYZ(c[f],dh.x,dh.y,dh.z)}}const ph=new ri;class DA extends Ds{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),s=new Float32Array(24),o=new gt;o.setIndex(new Qt(n,1)),o.setAttribute("position",new Qt(s,3)),super(o,new ai({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&ph.setFromObject(this.object),ph.isEmpty())return;const e=ph.min,t=ph.max,n=this.geometry.attributes.position,s=n.array;s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=e.x,s[4]=t.y,s[5]=t.z,s[6]=e.x,s[7]=e.y,s[8]=t.z,s[9]=t.x,s[10]=e.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=e.z,s[15]=e.x,s[16]=t.y,s[17]=e.z,s[18]=e.x,s[19]=e.y,s[20]=e.z,s[21]=t.x,s[22]=e.y,s[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class NA extends Ds{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),s=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],o=new gt;o.setIndex(new Qt(n,1)),o.setAttribute("position",new je(s,3)),super(o,new ai({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class UA extends ir{constructor(e,t=1,n=16776960){const s=n,o=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],l=new gt;l.setAttribute("position",new je(o,3)),l.computeBoundingSphere(),super(l,new ai({color:s,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const c=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],h=new gt;h.setAttribute("position",new je(c,3)),h.computeBoundingSphere(),this.add(new Mn(h,new kr({color:s,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const b_=new B;let mh,nm;class FA extends Ht{constructor(e=new B(0,0,1),t=new B(0,0,0),n=1,s=16776960,o=n*.2,l=o*.2){super(),this.type="ArrowHelper",mh===void 0&&(mh=new gt,mh.setAttribute("position",new je([0,0,0,0,1,0],3)),nm=new Nc(.5,1,5,1),nm.translate(0,-.5,0)),this.position.copy(t),this.line=new ir(mh,new ai({color:s,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Mn(nm,new kr({color:s,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,o,l)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{b_.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(b_,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class OA extends Ds{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new gt;s.setAttribute("position",new je(t,3)),s.setAttribute("color",new je(n,3));const o=new ai({vertexColors:!0,toneMapped:!1});super(s,o),this.type="AxesHelper"}
5setColors(e,t,n){const s=new Ve,o=this.geometry.attributes.color.array;return s.set(e),s.toArray(o,0),s.toArray(o,3),s.set(t),s.toArray(o,6),s.toArray(o,9),s.set(n),s.toArray(o,12),s.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class BA{constructor(){this.type="ShapePath",this.color=new Ve,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new df,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,s){return this.currentPath.quadraticCurveTo(e,t,n,s),this}bezierCurveTo(e,t,n,s,o,l){return this.currentPath.bezierCurveTo(e,t,n,s,o,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(_){const M=[];for(let T=0,A=_.length;T<A;T++){const D=_[T],R=new Ea;R.curves=D.curves,M.push(R)}return M}function n(_,M){const T=M.length;let A=!1;for(let D=T-1,R=0;R<T;D=R++){let F=M[D],w=M[R],L=w.x-F.x,U=w.y-F.y;if(Math.abs(U)>Number.EPSILON){if(U<0&&(F=M[R],L=-L,w=M[D],U=-U),_.y<F.y||_.y>w.y)continue;if(_.y===F.y){if(_.x===F.x)return!0}else{const O=U*(_.x-F.x)-L*(_.y-F.y);if(O===0)return!0;if(O<0)continue;A=!A}}else{if(_.y!==F.y)continue;if(w.x<=_.x&&_.x<=F.x||F.x<=_.x&&_.x<=w.x)return!0}}return A}const s=us.isClockWise,o=this.subPaths;if(o.length===0)return[];let l,c,h;const f=[];if(o.length===1)return c=o[0],h=new Ea,h.curves=c.curves,f.push(h),f;let p=!s(o[0].getPoints());p=e?!p:p;const g=[],m=[];let v=[],y=0,E;m[y]=void 0,v[y]=[];for(let _=0,M=o.length;_<M;_++)c=o[_],E=c.getPoints(),l=s(E),l=e?!l:l,l?(!p&&m[y]&&y++,m[y]={s:new Ea,p:E},m[y].s.curves=c.curves,p&&y++,v[y]=[]):v[y].push({h:c,p:E[0]});if(!m[0])return t(o);if(m.length>1){let _=!1,M=0;for(let T=0,A=m.length;T<A;T++)g[T]=[];for(let T=0,A=m.length;T<A;T++){const D=v[T];for(let R=0;R<D.length;R++){const F=D[R];let w=!0;for(let L=0;L<m.length;L++)n(F.p,m[L].p)&&(T!==L&&M++,w?(w=!1,g[L].push(F)):_=!0);w&&g[T].push(F)}}M>0&&_===!1&&(v=g)}let S;for(let _=0,M=m.length;_<M;_++){h=m[_].s,f.push(h),S=v[_];for(let T=0,A=S.length;T<A;T++)h.holes.push(S[T].h)}return f}}class zA extends Mi{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){De("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function kA(i,e){const t=i.image&&i.image.width?i.image.width/i.image.height:1;return t>e?(i.repeat.x=1,i.repeat.y=t/e,i.offset.x=0,i.offset.y=(1-i.repeat.y)/2):(i.repeat.x=e/t,i.repeat.y=1,i.offset.x=(1-i.repeat.x)/2,i.offset.y=0),i}function VA(i,e){const t=i.image&&i.image.width?i.image.width/i.image.height:1;return t>e?(i.repeat.x=e/t,i.repeat.y=1,i.offset.x=(1-i.repeat.x)/2,i.offset.y=0):(i.repeat.x=1,i.repeat.y=t/e,i.offset.x=0,i.offset.y=(1-i.repeat.y)/2),i}function HA(i){return i.repeat.x=1,i.repeat.y=1,i.offset.x=0,i.offset.y=0,i}function Dm(i,e,t,n){const s=GA(n);switch(t){case ig:return i*e;case Tf:return i*e/s.components*s.byteLength;case Pc:return i*e/s.components*s.byteLength;case Ur:return i*e*2/s.components*s.byteLength;case wf:return i*e*2/s.components*s.byteLength;case sg:return i*e*3/s.components*s.byteLength;case ii:return i*e*4/s.components*s.byteLength;case Af:return i*e*4/s.components*s.byteLength;case ec:case tc:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case nc:case ic:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Lh:case Nh:return Math.max(i,16)*Math.max(e,8)/4;case Ph:case Dh:return Math.max(i,8)*Math.max(e,8)/2;case Uh:case Fh:case Bh:case zh:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case Oh:case dc:case kh:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Vh:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Hh:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case Gh:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case Wh:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case Xh:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case qh:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case Yh:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case jh:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case $h:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case Zh:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case Kh:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case Jh:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case Qh:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case ef:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case tf:case nf:case sf:return Math.ceil(i/4)*Math.ceil(e/4)*16;case rf:case af:return Math.ceil(i/4)*Math.ceil(e/4)*8;case pc:case of:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function GA(i){switch(i){case yn:case Qm:return{byteLength:1,components:1};case Go:case eg:case fs:return{byteLength:2,components:1};case Mf:case Ef:return{byteLength:2,components:4};case ji:case bf:case Yn:return{byteLength:4,components:1};case tg:case ng:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}class WA{static contain(e,t){return kA(e,t)}static cover(e,t){return VA(e,t)}static fill(e){return HA(e)}static getByteLength(e,t,n,s){return Dm(e,t,n,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Zo}}));typeof window<"u"&&(window.__THREE__?De("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Zo);function JS(){let i=null,e=!1,t=null,n=null;function s(o,l){t(o,l),n=i.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&i!==null&&(n=i.requestAnimationFrame(s),e=!0)},stop:function(){i!==null&&i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(o){t=o},setContext:function(o){i=o}}}function XA(i){const e=new WeakMap;function t(c,h){const f=c.array,p=c.usage,g=f.byteLength,m=i.createBuffer();i.bindBuffer(h,m),i.bufferData(h,f,p),c.onUploadCallback();let v;if(f instanceof Float32Array)v=i.FLOAT;else if(typeof Float16Array<"u"&&f instanceof Float16Array)v=i.HALF_FLOAT;else if(f instanceof Uint16Array)c.isFloat16BufferAttribute?v=i.HALF_FLOAT:v=i.UNSIGNED_SHORT;else if(f instanceof Int16Array)v=i.SHORT;else if(f instanceof Uint32Array)v=i.UNSIGNED_INT;else if(f instanceof Int32Array)v=i.INT;else if(f instanceof Int8Array)v=i.BYTE;else if(f instanceof Uint8Array)v=i.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)v=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:m,type:v,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version,size:g}}function n(c,h,f){const p=h.array,g=h.updateRanges;if(i.bindBuffer(f,c),g.length===0)i.bufferSubData(f,0,p);else{g.sort((v,y)=>v.start-y.start);let m=0;for(let v=1;v<g.length;v++){const y=g[m],E=g[v];E.start<=y.start+y.count+1?y.count=Math.max(y.count,E.start+E.count-y.start):(++m,g[m]=E)}g.length=m+1;for(let v=0,y=g.length;v<y;v++){const E=g[v];i.bufferSubData(f,E.start*p.BYTES_PER_ELEMENT,p,E.start,E.count)}
vendor: 4,945 bytes, lines 5-118
5h.clearUpdateRanges()}h.onUploadCallback()}function s(c){return c.isInterleavedBufferAttribute&&(c=c.data),e.get(c)}function o(c){c.isInterleavedBufferAttribute&&(c=c.data);const h=e.get(c);h&&(i.deleteBuffer(h.buffer),e.delete(c))}function l(c,h){if(c.isInterleavedBufferAttribute&&(c=c.data),c.isGLBufferAttribute){const p=e.get(c);(!p||p.version<c.version)&&e.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}const f=e.get(c);if(f===void 0)e.set(c,t(c,h));else if(f.version<c.version){if(f.size!==c.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.");n(f.buffer,c,h),f.version=c.version}}return{get:s,remove:o,update:l}}var qA=`#ifdef USE_ALPHAHASH 6 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 7#endif`,YA=`#ifdef USE_ALPHAHASH 8 const float ALPHA_HASH_SCALE = 0.05; 9 float hash2D( vec2 value ) { 10 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 11 } 12 float hash3D( vec3 value ) { 13 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 14 } 15 float getAlphaHashThreshold( vec3 position ) { 16 float maxDeriv = max( 17 length( dFdx( position.xyz ) ), 18 length( dFdy( position.xyz ) ) 19 ); 20 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 21 vec2 pixScales = vec2( 22 exp2( floor( log2( pixScale ) ) ), 23 exp2( ceil( log2( pixScale ) ) ) 24 ); 25 vec2 alpha = vec2( 26 hash3D( floor( pixScales.x * position.xyz ) ), 27 hash3D( floor( pixScales.y * position.xyz ) ) 28 ); 29 float lerpFactor = fract( log2( pixScale ) ); 30 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 31 float a = min( lerpFactor, 1.0 - lerpFactor ); 32 vec3 cases = vec3( 33 x * x / ( 2.0 * a * ( 1.0 - a ) ), 34 ( x - 0.5 * a ) / ( 1.0 - a ), 35 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 36 ); 37 float threshold = ( x < ( 1.0 - a ) ) 38 ? ( ( x < a ) ? cases.x : cases.y ) 39 : cases.z; 40 return clamp( threshold , 1.0e-6, 1.0 ); 41 } 42#endif`,jA=`#ifdef USE_ALPHAMAP 43 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 44#endif`,$A=`#ifdef USE_ALPHAMAP 45 uniform sampler2D alphaMap; 46#endif`,ZA=`#ifdef USE_ALPHATEST 47 #ifdef ALPHA_TO_COVERAGE 48 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 49 if ( diffuseColor.a == 0.0 ) discard; 50 #else 51 if ( diffuseColor.a < alphaTest ) discard; 52 #endif 53#endif`,KA=`#ifdef USE_ALPHATEST 54 uniform float alphaTest; 55#endif`,JA=`#ifdef USE_AOMAP 56 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 57 reflectedLight.indirectDiffuse *= ambientOcclusion; 58 #if defined( USE_CLEARCOAT ) 59 clearcoatSpecularIndirect *= ambientOcclusion; 60 #endif 61 #if defined( USE_SHEEN ) 62 sheenSpecularIndirect *= ambientOcclusion; 63 #endif 64 #if defined( USE_ENVMAP ) && defined( STANDARD ) 65 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 66 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 67 #endif 68#endif`,QA=`#ifdef USE_AOMAP 69 uniform sampler2D aoMap; 70 uniform float aoMapIntensity; 71#endif`,eC=`#ifdef USE_BATCHING 72 #if ! defined( GL_ANGLE_multi_draw ) 73 #define gl_DrawID _gl_DrawID 74 uniform int _gl_DrawID; 75 #endif 76 uniform highp sampler2D batchingTexture; 77 uniform highp usampler2D batchingIdTexture; 78 mat4 getBatchingMatrix( const in float i ) { 79 int size = textureSize( batchingTexture, 0 ).x; 80 int j = int( i ) * 4; 81 int x = j % size; 82 int y = j / size; 83 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 84 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 85 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 86 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 87 return mat4( v1, v2, v3, v4 ); 88 } 89 float getIndirectIndex( const in int i ) { 90 int size = textureSize( batchingIdTexture, 0 ).x; 91 int x = i % size; 92 int y = i / size; 93 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 94 } 95#endif 96#ifdef USE_BATCHING_COLOR 97 uniform sampler2D batchingColorTexture; 98 vec4 getBatchingColor( const in float i ) { 99 int size = textureSize( batchingColorTexture, 0 ).x; 100 int j = int( i ); 101 int x = j % size; 102 int y = j / size; 103 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ); 104 } 105#endif`,tC=`#ifdef USE_BATCHING 106 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 107#endif`,nC=`vec3 transformed = vec3( position ); 108#ifdef USE_ALPHAHASH 109 vPosition = vec3( position ); 110#endif`,iC=`vec3 objectNormal = vec3( normal ); 111#ifdef USE_TANGENT 112 vec3 objectTangent = vec3( tangent.xyz ); 113#endif`,sC=`float G_BlinnPhong_Implicit( ) { 114 return 0.25; 115} 116float D_BlinnPhong( const in float shininess, const in float dotNH ) { 117 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 118}
119vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 120 vec3 halfDir = normalize( lightDir + viewDir ); 121 float dotNH = saturate( dot( normal, halfDir ) ); 122 float dotVH = saturate( dot( viewDir, halfDir ) ); 123 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 124 float G = G_BlinnPhong_Implicit( ); 125 float D = D_BlinnPhong( shininess, dotNH ); 126 return F * ( G * D ); 127} // validated`,rC=`#ifdef USE_IRIDESCENCE 128 const mat3 XYZ_TO_REC709 = mat3( 129 3.2404542, -0.9692660, 0.0556434, 130 -1.5371385, 1.8760108, -0.2040259, 131 -0.4985314, 0.0415560, 1.0572252 132 ); 133 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 134 vec3 sqrtF0 = sqrt( fresnel0 ); 135 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 136 } 137 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 138 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 139 } 140 float IorToFresnel0( float transmittedIor, float incidentIor ) { 141 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 142 } 143 vec3 evalSensitivity( float OPD, vec3 shift ) { 144 float phase = 2.0 * PI * OPD * 1.0e-9; 145 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 146 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 147 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 148 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 149 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 ) ); 150 xyz /= 1.0685e-7; 151 vec3 rgb = XYZ_TO_REC709 * xyz; 152 return rgb; 153 } 154 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 155 vec3 I; 156 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 157 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 158 float cosTheta2Sq = 1.0 - sinTheta2Sq; 159 if ( cosTheta2Sq < 0.0 ) { 160 return vec3( 1.0 ); 161 } 162 float cosTheta2 = sqrt( cosTheta2Sq ); 163 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); 164 float R12 = F_Schlick( R0, 1.0, cosTheta1 );
165 float T121 = 1.0 - R12; 166 float phi12 = 0.0; 167 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 168 float phi21 = PI - phi12; 169 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 170 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 171 vec3 phi23 = vec3( 0.0 ); 172 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 173 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 174 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 175 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 176 vec3 phi = vec3( phi21 ) + phi23; 177 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 178 vec3 r123 = sqrt( R123 ); 179 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 180 vec3 C0 = R12 + Rs; 181 I = C0; 182 vec3 Cm = Rs - T121; 183 for ( int m = 1; m <= 2; ++ m ) { 184 Cm *= r123; 185 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 186 I += Cm * Sm; 187 } 188 return max( I, vec3( 0.0 ) ); 189 } 190#endif`,aC=`#ifdef USE_BUMPMAP 191 uniform sampler2D bumpMap; 192 uniform float bumpScale; 193 vec2 dHdxy_fwd() { 194 vec2 dSTdx = dFdx( vBumpMapUv ); 195 vec2 dSTdy = dFdy( vBumpMapUv ); 196 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 197 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 198 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 199 return vec2( dBx, dBy ); 200 } 201 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 202 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 203 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 204 vec3 vN = surf_norm; 205 vec3 R1 = cross( vSigmaY, vN ); 206 vec3 R2 = cross( vN, vSigmaX ); 207 float fDet = dot( vSigmaX, R1 ) * faceDirection; 208 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 209 return normalize( abs( fDet ) * surf_norm - vGrad ); 210 } 211#endif`,oC=`#if NUM_CLIPPING_PLANES > 0 212 vec4 plane; 213 #ifdef ALPHA_TO_COVERAGE 214 float distanceToPlane, distanceGradient; 215 float clipOpacity = 1.0; 216 #pragma unroll_loop_start 217 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 218 plane = clippingPlanes[ i ]; 219 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 220 distanceGradient = fwidth( distanceToPlane ) / 2.0; 221 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 222 if ( clipOpacity == 0.0 ) discard; 223 } 224 #pragma unroll_loop_end 225 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 226 float unionClipOpacity = 1.0; 227 #pragma unroll_loop_start 228 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 229 plane = clippingPlanes[ i ]; 230 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 231 distanceGradient = fwidth( distanceToPlane ) / 2.0; 232 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 233 } 234 #pragma unroll_loop_end 235 clipOpacity *= 1.0 - unionClipOpacity; 236 #endif 237 diffuseColor.a *= clipOpacity; 238 if ( diffuseColor.a == 0.0 ) discard; 239 #else 240 #pragma unroll_loop_start 241 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 242 plane = clippingPlanes[ i ]; 243 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 244 } 245 #pragma unroll_loop_end 246 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 247 bool clipped = true; 248 #pragma unroll_loop_start 249 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 250 plane = clippingPlanes[ i ]; 251 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 252 } 253 #pragma unroll_loop_end 254 if ( clipped ) discard; 255 #endif 256 #endif 257#endif`,lC=`#if NUM_CLIPPING_PLANES > 0 258 varying vec3 vClipPosition; 259 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 260#endif`,cC=`#if NUM_CLIPPING_PLANES > 0 261 varying vec3 vClipPosition; 262#endif`,uC=`#if NUM_CLIPPING_PLANES > 0 263 vClipPosition = - mvPosition.xyz; 264#endif`,hC=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) 265 diffuseColor *= vColor; 266#endif`,fC=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) 267 varying vec4 vColor; 268#endif`,dC=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 269 varying vec4 vColor; 270#endif`,pC=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 271 vColor = vec4( 1.0 ); 272#endif 273#ifdef USE_COLOR_ALPHA 274 vColor *= color; 275#elif defined( USE_COLOR ) 276 vColor.rgb *= color; 277#endif 278#ifdef USE_INSTANCING_COLOR 279 vColor.rgb *= instanceColor.rgb; 280#endif 281#ifdef USE_BATCHING_COLOR 282 vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) ); 283#endif`,mC=`#define PI 3.141592653589793 284#define PI2 6.283185307179586 285#define PI_HALF 1.5707963267948966 286#define RECIPROCAL_PI 0.3183098861837907 287#define RECIPROCAL_PI2 0.15915494309189535 288#define EPSILON 1e-6 289#ifndef saturate 290#define saturate( a ) clamp( a, 0.0, 1.0 ) 291#endif 292#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 293float pow2( const in float x ) { return x*x; } 294vec3 pow2( const in vec3 x ) { return x*x; } 295float pow3( const in float x ) { return x*x*x; } 296float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 297float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 298float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 299highp float rand( const in vec2 uv ) { 300 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 301 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 302 return fract( sin( sn ) * c ); 303} 304#ifdef HIGH_PRECISION 305 float precisionSafeLength( vec3 v ) { return length( v ); } 306#else 307 float precisionSafeLength( vec3 v ) { 308 float maxComponent = max3( abs( v ) ); 309 return length( v / maxComponent ) * maxComponent; 310 } 311#endif 312struct IncidentLight { 313 vec3 color; 314 vec3 direction; 315 bool visible; 316}; 317struct ReflectedLight { 318 vec3 directDiffuse; 319 vec3 directSpecular; 320 vec3 indirectDiffuse; 321 vec3 indirectSpecular; 322}; 323#ifdef USE_ALPHAHASH 324 varying vec3 vPosition; 325#endif 326vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 327 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 328} 329vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 330 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 331} 332bool isPerspectiveMatrix( mat4 m ) { 333 return m[ 2 ][ 3 ] == - 1.0; 334} 335vec2 equirectUv( in vec3 dir ) { 336 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 337 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 338 return vec2( u, v ); 339}
340vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 341 return RECIPROCAL_PI * diffuseColor; 342} 343vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 344 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 345 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 346} 347float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 348 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 349 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 350} // validated`,gC=`#ifdef ENVMAP_TYPE_CUBE_UV 351 #define cubeUV_minMipLevel 4.0 352 #define cubeUV_minTileSize 16.0 353 float getFace( vec3 direction ) { 354 vec3 absDirection = abs( direction ); 355 float face = - 1.0; 356 if ( absDirection.x > absDirection.z ) { 357 if ( absDirection.x > absDirection.y ) 358 face = direction.x > 0.0 ? 0.0 : 3.0; 359 else 360 face = direction.y > 0.0 ? 1.0 : 4.0; 361 } else { 362 if ( absDirection.z > absDirection.y ) 363 face = direction.z > 0.0 ? 2.0 : 5.0; 364 else 365 face = direction.y > 0.0 ? 1.0 : 4.0; 366 } 367 return face; 368 } 369 vec2 getUV( vec3 direction, float face ) { 370 vec2 uv; 371 if ( face == 0.0 ) { 372 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 373 } else if ( face == 1.0 ) { 374 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 375 } else if ( face == 2.0 ) { 376 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 377 } else if ( face == 3.0 ) { 378 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 379 } else if ( face == 4.0 ) { 380 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 381 } else { 382 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 383 } 384 return 0.5 * ( uv + 1.0 ); 385 } 386 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 387 float face = getFace( direction ); 388 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 389 mipInt = max( mipInt, cubeUV_minMipLevel ); 390 float faceSize = exp2( mipInt ); 391 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 392 if ( face > 2.0 ) { 393 uv.y += faceSize; 394 face -= 3.0; 395 } 396 uv.x += face * faceSize; 397 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 398 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 399 uv.x *= CUBEUV_TEXEL_WIDTH; 400 uv.y *= CUBEUV_TEXEL_HEIGHT; 401 #ifdef texture2DGradEXT 402 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 403 #else 404 return texture2D( envMap, uv ).rgb; 405 #endif 406 } 407 #define cubeUV_r0 1.0 408 #define cubeUV_m0 - 2.0 409 #define cubeUV_r1 0.8 410 #define cubeUV_m1 - 1.0 411 #define cubeUV_r4 0.4 412 #define cubeUV_m4 2.0 413 #define cubeUV_r5 0.305 414 #define cubeUV_m5 3.0 415 #define cubeUV_r6 0.21 416 #define cubeUV_m6 4.0 417 float roughnessToMip( float roughness ) { 418 float mip = 0.0; 419 if ( roughness >= cubeUV_r1 ) { 420 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 421 } else if ( roughness >= cubeUV_r4 ) { 422 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 423 } else if ( roughness >= cubeUV_r5 ) { 424 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 425 } else if ( roughness >= cubeUV_r6 ) { 426 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 427 } else { 428 mip = - 2.0 * log2( 1.16 * roughness ); } 429 return mip; 430 } 431 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 432 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 433 float mipF = fract( mip ); 434 float mipInt = floor( mip ); 435 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 436 if ( mipF == 0.0 ) { 437 return vec4( color0, 1.0 ); 438 } else { 439 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 440 return vec4( mix( color0, color1, mipF ), 1.0 ); 441 } 442 } 443#endif`,vC=`vec3 transformedNormal = objectNormal; 444#ifdef USE_TANGENT 445 vec3 transformedTangent = objectTangent; 446#endif 447#ifdef USE_BATCHING 448 mat3 bm = mat3( batchingMatrix ); 449 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 450 transformedNormal = bm * transformedNormal; 451 #ifdef USE_TANGENT 452 transformedTangent = bm * transformedTangent; 453 #endif 454#endif 455#ifdef USE_INSTANCING 456 mat3 im = mat3( instanceMatrix ); 457 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 458 transformedNormal = im * transformedNormal; 459 #ifdef USE_TANGENT 460 transformedTangent = im * transformedTangent; 461 #endif 462#endif 463transformedNormal = normalMatrix * transformedNormal; 464#ifdef FLIP_SIDED 465 transformedNormal = - transformedNormal; 466#endif 467#ifdef USE_TANGENT 468 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 469 #ifdef FLIP_SIDED 470 transformedTangent = - transformedTangent; 471 #endif 472#endif`,xC=`#ifdef USE_DISPLACEMENTMAP 473 uniform sampler2D displacementMap; 474 uniform float displacementScale; 475 uniform float displacementBias; 476#endif`,_C=`#ifdef USE_DISPLACEMENTMAP 477 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
477placementBias ); 478#endif`,yC=`#ifdef USE_EMISSIVEMAP 479 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 480 #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE 481 emissiveColor = sRGBTransferEOTF( emissiveColor ); 482 #endif 483 totalEmissiveRadiance *= emissiveColor.rgb; 484#endif`,SC=`#ifdef USE_EMISSIVEMAP 485 uniform sampler2D emissiveMap; 486#endif`,bC="gl_FragColor = linearToOutputTexel( gl_FragColor );",MC=`vec4 LinearTransferOETF( in vec4 value ) { 487 return value; 488} 489vec4 sRGBTransferEOTF( in vec4 value ) { 490 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.a ); 491} 492vec4 sRGBTransferOETF( in vec4 value ) { 493 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 ); 494}`,EC=`#ifdef USE_ENVMAP 495 #ifdef ENV_WORLDPOS 496 vec3 cameraToFrag; 497 if ( isOrthographic ) { 498 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 499 } else { 500 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 501 } 502 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 503 #ifdef ENVMAP_MODE_REFLECTION 504 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 505 #else 506 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 507 #endif 508 #else 509 vec3 reflectVec = vReflect; 510 #endif 511 #ifdef ENVMAP_TYPE_CUBE 512 vec4 envColor = textureCube( envMap, envMapRotation * reflectVec ); 513 #ifdef ENVMAP_BLENDING_MULTIPLY 514 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 515 #elif defined( ENVMAP_BLENDING_MIX ) 516 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 517 #elif defined( ENVMAP_BLENDING_ADD ) 518 outgoingLight += envColor.xyz * specularStrength * reflectivity; 519 #endif 520 #endif 521#endif`,TC=`#ifdef USE_ENVMAP 522 uniform float envMapIntensity; 523 uniform mat3 envMapRotation; 524 #ifdef ENVMAP_TYPE_CUBE 525 uniform samplerCube envMap; 526 #else 527 uniform sampler2D envMap; 528 #endif 529#endif`,wC=`#ifdef USE_ENVMAP 530 uniform float reflectivity; 531 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 532 #define ENV_WORLDPOS 533 #endif 534 #ifdef ENV_WORLDPOS 535 varying vec3 vWorldPosition; 536 uniform float refractionRatio; 537 #else 538 varying vec3 vReflect; 539 #endif 540#endif`,AC=`#ifdef USE_ENVMAP 541 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 542 #define ENV_WORLDPOS 543 #endif 544 #ifdef ENV_WORLDPOS 545 546 varying vec3 vWorldPosition; 547 #else 548 varying vec3 vReflect; 549 uniform float refractionRatio; 550 #endif 551#endif`,CC=`#ifdef USE_ENVMAP 552 #ifdef ENV_WORLDPOS 553 vWorldPosition = worldPosition.xyz; 554 #else 555 vec3 cameraToVertex; 556 if ( isOrthographic ) { 557 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 558 } else {
559 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 560 } 561 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 562 #ifdef ENVMAP_MODE_REFLECTION 563 vReflect = reflect( cameraToVertex, worldNormal ); 564 #else 565 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 566 #endif 567 #endif 568#endif`,RC=`#ifdef USE_FOG 569 vFogDepth = - mvPosition.z; 570#endif`,IC=`#ifdef USE_FOG 571 varying float vFogDepth; 572#endif`,PC=`#ifdef USE_FOG 573 #ifdef FOG_EXP2 574 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 575 #else 576 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 577 #endif 578 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 579#endif`,LC=`#ifdef USE_FOG 580 uniform vec3 fogColor; 581 varying float vFogDepth; 582 #ifdef FOG_EXP2 583 uniform float fogDensity; 584 #else 585 uniform float fogNear; 586 uniform float fogFar; 587 #endif 588#endif`,DC=`#ifdef USE_GRADIENTMAP 589 uniform sampler2D gradientMap; 590#endif 591vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 592 float dotNL = dot( normal, lightDirection ); 593 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 594 #ifdef USE_GRADIENTMAP 595 return vec3( texture2D( gradientMap, coord ).r ); 596 #else 597 vec2 fw = fwidth( coord ) * 0.5; 598 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 599 #endif 600}`,NC=`#ifdef USE_LIGHTMAP 601 uniform sampler2D lightMap; 602 uniform float lightMapIntensity; 603#endif`,UC=`LambertMaterial material; 604material.diffuseColor = diffuseColor.rgb; 605material.specularStrength = specularStrength;`,FC=`varying vec3 vViewPosition; 606struct LambertMaterial { 607 vec3 diffuseColor; 608 float specularStrength; 609}; 610void 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 ) { 611 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 612 vec3 irradiance = dotNL * directLight.color; 613 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 614} 615void 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 ) { 616 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 617} 618#define RE_Direct RE_Direct_Lambert 619#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,OC=`uniform bool receiveShadow; 620uniform vec3 ambientLightColor; 621#if defined( USE_LIGHT_PROBES ) 622 uniform vec3 lightProbe[ 9 ]; 623#endif 624vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 625 float x = normal.x, y = normal.y, z = normal.z; 626 vec3 result = shCoefficients[ 0 ] * 0.886227; 627 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 628 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 629 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 630 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 631 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 632 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 633 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 634 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 635 return result; 636} 637vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 638 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 639 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 640 return irradiance; 641} 642vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 643 vec3 irradiance = ambientLightColor; 644 return irradiance; 645} 646float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 647 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 648 if ( cutoffDistance > 0.0 ) { 649 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 650 } 651 return distanceFalloff; 652} 653float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 654 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 655} 656#if NUM_DIR_LIGHTS > 0 657 struct DirectionalLight { 658 vec3 direction; 659 vec3 color; 660 }; 661 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 662 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 663 light.color = directionalLight.color; 664 light.direction = directionalLight.direction; 665 light.visible = true; 666 } 667#endif 668#if NUM_POINT_LIGHTS > 0 669 struct PointLight { 670 vec3 position; 671 vec3 color; 672 float distance; 673 float decay; 674 }; 675 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 676 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 677 vec3 lVector = pointLight.position - geometryPosition; 678 light.direction = normalize( lVector ); 679 float lightDistance = length( lVector ); 680 light.color = pointLight.color; 681 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 682 light.visible = ( light.color != vec3( 0.0 ) ); 683 } 684#endif
685#if NUM_SPOT_LIGHTS > 0 686 struct SpotLight { 687 vec3 position; 688 vec3 direction; 689 vec3 color; 690 float distance; 691 float decay; 692 float coneCos; 693 float penumbraCos; 694 }; 695 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 696 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 697 vec3 lVector = spotLight.position - geometryPosition; 698 light.direction = normalize( lVector ); 699 float angleCos = dot( light.direction, spotLight.direction ); 700 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 701 if ( spotAttenuation > 0.0 ) { 702 float lightDistance = length( lVector ); 703 light.color = spotLight.color * spotAttenuation; 704 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 705 light.visible = ( light.color != vec3( 0.0 ) ); 706 } else { 707 light.color = vec3( 0.0 ); 708 light.visible = false; 709 } 710 } 711#endif 712#if NUM_RECT_AREA_LIGHTS > 0 713 struct RectAreaLight { 714 vec3 color; 715 vec3 position; 716 vec3 halfWidth; 717 vec3 halfHeight; 718 }; 719 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 720 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 721#endif 722#if NUM_HEMI_LIGHTS > 0 723 struct HemisphereLight { 724 vec3 direction; 725 vec3 skyColor; 726 vec3 groundColor; 727 }; 728 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 729 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 730 float dotNL = dot( normal, hemiLight.direction ); 731 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 732 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 733 return irradiance; 734 } 735#endif 736#include <lightprobes_pars_fragment>`,BC=`#ifdef USE_ENVMAP 737 vec3 getIBLIrradiance( const in vec3 normal ) { 738 #ifdef ENVMAP_TYPE_CUBE_UV 739 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 740 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 741 return PI * envMapColor.rgb * envMapIntensity; 742 #else 743 return vec3( 0.0 ); 744 #endif 745 } 746 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 747 #ifdef ENVMAP_TYPE_CUBE_UV 748 vec3 reflectVec = reflect( - viewDir, normal ); 749 reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); 750 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 751 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 752 return envMapColor.rgb * envMapIntensity; 753 #else 754 return vec3( 0.0 ); 755 #endif 756 } 757 #ifdef USE_ANISOTROPY 758 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 759 #ifdef ENVMAP_TYPE_CUBE_UV 760 vec3 bentNormal = cross( bitangent, viewDir ); 761 bentNormal = normalize( cross( bentNormal, bitangent ) ); 762 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 763 return getIBLRadiance( viewDir, bentNormal, roughness ); 764 #else 765 return vec3( 0.0 ); 766 #endif 767 } 768 #endif 769#endif`,zC=`ToonMaterial material; 770material.diffuseColor = diffuseColor.rgb;`,kC=`varying vec3 vViewPosition; 771struct ToonMaterial { 772 vec3 diffuseColor; 773}; 774void 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 ) { 775 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 776 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 777} 778void 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 ) { 779 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 780} 781#define RE_Direct RE_Direct_Toon 782#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,VC=`BlinnPhongMaterial material; 783material.diffuseColor = diffuseColor.rgb; 784material.specularColor = specular; 785material.specularShininess = shininess; 786material.specularStrength = specularStrength;`,HC=`varying vec3 vViewPosition; 787struct BlinnPhongMaterial { 788 vec3 diffuseColor; 789 vec3 specularColor; 790 float specularShininess; 791 float specularStrength; 792}; 793void 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 ) {
794 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 795 vec3 irradiance = dotNL * directLight.color; 796 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 797 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 798} 799void 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 ) { 800 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 801} 802#define RE_Direct RE_Direct_BlinnPhong 803#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,GC=`PhysicalMaterial material; 804material.diffuseColor = diffuseColor.rgb; 805material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 806material.metalness = metalnessFactor; 807vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 808float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 809material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 810material.roughness = min( material.roughness, 1.0 ); 811#ifdef IOR 812 material.ior = ior; 813 #ifdef USE_SPECULAR 814 float specularIntensityFactor = specularIntensity; 815 vec3 specularColorFactor = specularColor; 816 #ifdef USE_SPECULAR_COLORMAP 817 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 818 #endif 819 #ifdef USE_SPECULAR_INTENSITYMAP 820 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 821 #endif 822 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 823 #else 824 float specularIntensityFactor = 1.0; 825 vec3 specularColorFactor = vec3( 1.0 ); 826 material.specularF90 = 1.0; 827 #endif 828 material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; 829 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 830#else 831 material.specularColor = vec3( 0.04 ); 832 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 833 material.specularF90 = 1.0; 834#endif 835#ifdef USE_CLEARCOAT 836 material.clearcoat = clearcoat; 837 material.clearcoatRoughness = clearcoatRoughness; 838 material.clearcoatF0 = vec3( 0.04 ); 839 material.clearcoatF90 = 1.0; 840 #ifdef USE_CLEARCOATMAP 841 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 842 #endif 843 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 844 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 845 #endif 846 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 847 material.clearcoatRoughness += geometryRoughness; 848 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 849#endif 850#ifdef USE_DISPERSION 851 material.dispersion = dispersion; 852#endif 853#ifdef USE_IRIDESCENCE 854 material.iridescence = iridescence; 855 material.iridescenceIOR = iridescenceIOR; 856 #ifdef USE_IRIDESCENCEMAP 857 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 858 #endif 859 #ifdef USE_IRIDESCENCE_THICKNESSMAP 860 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 861 #else 862 material.iridescenceThickness = iridescenceThicknessMaximum; 863 #endif 864#endif 865#ifdef USE_SHEEN 866 material.sheenColor = sheenColor; 867 #ifdef USE_SHEEN_COLORMAP 868 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 869 #endif 870 material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); 871 #ifdef USE_SHEEN_ROUGHNESSMAP 872 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 873 #endif 874#endif 875#ifdef USE_ANISOTROPY 876 #ifdef USE_ANISOTROPYMAP 877 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 878 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 879 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 880 #else 881 vec2 anisotropyV = anisotropyVector; 882 #endif 883 material.anisotropy = length( anisotropyV ); 884 if( material.anisotropy == 0.0 ) { 885 anisotropyV = vec2( 1.0, 0.0 ); 886 } else { 887 anisotropyV /= material.anisotropy; 888 material.anisotropy = saturate( material.anisotropy ); 889 } 890 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
891 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 892 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 893#endif`,WC=`uniform sampler2D dfgLUT; 894struct PhysicalMaterial { 895 vec3 diffuseColor; 896 vec3 diffuseContribution; 897 vec3 specularColor; 898 vec3 specularColorBlended; 899 float roughness; 900 float metalness; 901 float specularF90; 902 float dispersion; 903 #ifdef USE_CLEARCOAT 904 float clearcoat; 905 float clearcoatRoughness; 906 vec3 clearcoatF0; 907 float clearcoatF90; 908 #endif 909 #ifdef USE_IRIDESCENCE 910 float iridescence; 911 float iridescenceIOR; 912 float iridescenceThickness; 913 vec3 iridescenceFresnel; 914 vec3 iridescenceF0; 915 vec3 iridescenceFresnelDielectric; 916 vec3 iridescenceFresnelMetallic; 917 #endif 918 #ifdef USE_SHEEN 919 vec3 sheenColor; 920 float sheenRoughness; 921 #endif 922 #ifdef IOR 923 float ior; 924 #endif 925 #ifdef USE_TRANSMISSION 926 float transmission; 927 float transmissionAlpha; 928 float thickness; 929 float attenuationDistance; 930 vec3 attenuationColor; 931 #endif 932 #ifdef USE_ANISOTROPY 933 float anisotropy; 934 float alphaT; 935 vec3 anisotropyT; 936 vec3 anisotropyB; 937 #endif 938}; 939vec3 clearcoatSpecularDirect = vec3( 0.0 ); 940vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 941vec3 sheenSpecularDirect = vec3( 0.0 ); 942vec3 sheenSpecularIndirect = vec3(0.0 ); 943vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 944 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 945 float x2 = x * x; 946 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 947 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 948} 949float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 950 float a2 = pow2( alpha ); 951 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 952 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 953 return 0.5 / max( gv + gl, EPSILON ); 954} 955float D_GGX( const in float alpha, const in float dotNH ) { 956 float a2 = pow2( alpha ); 957 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 958 return RECIPROCAL_PI * a2 / pow2( denom ); 959} 960#ifdef USE_ANISOTROPY 961 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 ) { 962 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 963 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 964 return 0.5 / max( gv + gl, EPSILON )
vendor: 7,372 bytes, lines 964-1123
964; 965 } 966 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 967 float a2 = alphaT * alphaB; 968 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 969 highp float v2 = dot( v, v ); 970 float w2 = a2 / v2; 971 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 972 } 973#endif 974#ifdef USE_CLEARCOAT 975 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 976 vec3 f0 = material.clearcoatF0; 977 float f90 = material.clearcoatF90; 978 float roughness = material.clearcoatRoughness; 979 float alpha = pow2( roughness ); 980 vec3 halfDir = normalize( lightDir + viewDir ); 981 float dotNL = saturate( dot( normal, lightDir ) ); 982 float dotNV = saturate( dot( normal, viewDir ) ); 983 float dotNH = saturate( dot( normal, halfDir ) ); 984 float dotVH = saturate( dot( viewDir, halfDir ) ); 985 vec3 F = F_Schlick( f0, f90, dotVH ); 986 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 987 float D = D_GGX( alpha, dotNH ); 988 return F * ( V * D ); 989 } 990#endif 991vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 992 vec3 f0 = material.specularColorBlended; 993 float f90 = material.specularF90; 994 float roughness = material.roughness; 995 float alpha = pow2( roughness ); 996 vec3 halfDir = normalize( lightDir + viewDir ); 997 float dotNL = saturate( dot( normal, lightDir ) ); 998 float dotNV = saturate( dot( normal, viewDir ) ); 999 float dotNH = saturate( dot( normal, halfDir ) ); 1000 float dotVH = saturate( dot( viewDir, halfDir ) ); 1001 vec3 F = F_Schlick( f0, f90, dotVH ); 1002 #ifdef USE_IRIDESCENCE 1003 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1004 #endif 1005 #ifdef USE_ANISOTROPY 1006 float dotTL = dot( material.anisotropyT, lightDir ); 1007 float dotTV = dot( material.anisotropyT, viewDir ); 1008 float dotTH = dot( material.anisotropyT, halfDir ); 1009 float dotBL = dot( material.anisotropyB, lightDir ); 1010 float dotBV = dot( material.anisotropyB, viewDir ); 1011 float dotBH = dot( material.anisotropyB, halfDir ); 1012 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1013 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1014 #else 1015 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1016 float D = D_GGX( alpha, dotNH ); 1017 #endif 1018 return F * ( V * D ); 1019} 1020vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1021 const float LUT_SIZE = 64.0; 1022 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1023 const float LUT_BIAS = 0.5 / LUT_SIZE; 1024 float dotNV = saturate( dot( N, V ) ); 1025 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1026 uv = uv * LUT_SCALE + LUT_BIAS; 1027 return uv; 1028} 1029float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1030 float l = length( f ); 1031 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1032} 1033vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1034 float x = dot( v1, v2 ); 1035 float y = abs( x ); 1036 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1037 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1038 float v = a / b; 1039 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1040 return cross( v1, v2 ) * theta_sintheta; 1041} 1042vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1043 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1044 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1045 vec3 lightNormal = cross( v1, v2 ); 1046 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1047 vec3 T1, T2; 1048 T1 = normalize( V - N * dot( V, N ) ); 1049 T2 = - cross( N, T1 ); 1050 mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); 1051 vec3 coords[ 4 ]; 1052 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1053 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1054 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1055 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1056 coords[ 0 ] = normalize( coords[ 0 ] ); 1057 coords[ 1 ] = normalize( coords[ 1 ] ); 1058 coords[ 2 ] = normalize( coords[ 2 ] ); 1059 coords[ 3 ] = normalize( coords[ 3 ] ); 1060 vec3 vectorFormFactor = vec3( 0.0 ); 1061 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1062 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1063 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1064 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1065 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1066 return vec3( result ); 1067} 1068#if defined( USE_SHEEN ) 1069float D_Charlie( float roughness, float dotNH ) { 1070 float alpha = pow2( roughness ); 1071 float invAlpha = 1.0 / alpha; 1072 float cos2h = dotNH * dotNH; 1073 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1074 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1075} 1076float V_Neubelt( float dotNV, float dotNL ) { 1077 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1078} 1079vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1080 vec3 halfDir = normalize( lightDir + viewDir ); 1081 float dotNL = saturate( dot( normal, lightDir ) ); 1082 float dotNV = saturate( dot( normal, viewDir ) ); 1083 float dotNH = saturate( dot( normal, halfDir ) ); 1084 float D = D_Charlie( sheenRoughness, dotNH ); 1085 float V = V_Neubelt( dotNV, dotNL ); 1086 return sheenColor * ( D * V ); 1087} 1088#endif 1089float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1090 float dotNV = saturate( dot( normal, viewDir ) ); 1091 float r2 = roughness * roughness; 1092 float rInv = 1.0 / ( roughness + 0.1 ); 1093 float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; 1094 float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; 1095 float DG = exp( a * dotNV + b ); 1096 return saturate( DG ); 1097} 1098vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1099 float dotNV = saturate( dot( normal, viewDir ) ); 1100 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1101 return specularColor * fab.x + specularF90 * fab.y; 1102} 1103#ifdef USE_IRIDESCENCE 1104void 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 ) { 1105#else 1106void 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 ) { 1107#endif 1108 float dotNV = saturate( dot( normal, viewDir ) ); 1109 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1110 #ifdef USE_IRIDESCENCE 1111 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1112 #else 1113 vec3 Fr = specularColor; 1114 #endif 1115 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1116 float Ess = fab.x + fab.y; 1117 float Ems = 1.0 - Ess; 1118 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1119 singleScatter += FssEss; 1120 multiScatter += Fms * Ems; 1121} 1122vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1123 vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 1124-1253
1124 float dotNL = saturate( dot( normal, lightDir ) ); 1125 float dotNV = saturate( dot( normal, viewDir ) ); 1126 vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; 1127 vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; 1128 vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; 1129 vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; 1130 float Ess_V = dfgV.x + dfgV.y; 1131 float Ess_L = dfgL.x + dfgL.y; 1132 float Ems_V = 1.0 - Ess_V; 1133 float Ems_L = 1.0 - Ess_L; 1134 vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; 1135 vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); 1136 float compensationFactor = Ems_V * Ems_L; 1137 vec3 multiScatter = Fms * compensationFactor; 1138 return singleScatter + multiScatter; 1139} 1140#if NUM_RECT_AREA_LIGHTS > 0 1141 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 ) { 1142 vec3 normal = geometryNormal; 1143 vec3 viewDir = geometryViewDir; 1144 vec3 position = geometryPosition; 1145 vec3 lightPos = rectAreaLight.position; 1146 vec3 halfWidth = rectAreaLight.halfWidth; 1147 vec3 halfHeight = rectAreaLight.halfHeight; 1148 vec3 lightColor = rectAreaLight.color; 1149 float roughness = material.roughness; 1150 vec3 rectCoords[ 4 ]; 1151 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1152 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1153 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1154 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1155 vec4 t1 = texture2D( ltc_1, uv ); 1156 vec4 t2 = texture2D( ltc_2, uv ); 1157 mat3 mInv = mat3( 1158 vec3( t1.x, 0, t1.y ), 1159 vec3( 0, 1, 0 ), 1160 vec3( t1.z, 0, t1.w ) 1161 ); 1162 vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y ); 1163 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1164 reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1165 #ifdef USE_CLEARCOAT 1166 vec3 Ncc = geometryClearcoatNormal; 1167 vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness ); 1168 vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat ); 1169 vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat ); 1170 mat3 mInvClearcoat = mat3( 1171 vec3( t1Clearcoat.x, 0, t1Clearcoat.y ), 1172 vec3( 0, 1, 0 ), 1173 vec3( t1Clearcoat.z, 0, t1Clearcoat.w ) 1174 ); 1175 vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y; 1176 clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords ); 1177 #endif 1178 } 1179#endif 1180void 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 ) { 1181 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1182 vec3 irradiance = dotNL * directLight.color; 1183 #ifdef USE_CLEARCOAT 1184 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1185 vec3 ccIrradiance = dotNLcc * directLight.color; 1186 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1187 #endif 1188 #ifdef USE_SHEEN 1189 1190 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1191 1192 float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1193 float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); 1194 1195 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); 1196 1197 irradiance *= sheenEnergyComp; 1198 1199 #endif 1200 reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); 1201 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); 1202} 1203void 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 ) { 1204 vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); 1205 #ifdef USE_SHEEN 1206 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1207 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1208 diffuse *= sheenEnergyComp; 1209 #endif 1210 reflectedLight.indirectDiffuse += diffuse; 1211} 1212void 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) { 1213 #ifdef USE_CLEARCOAT 1214 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1215 #endif 1216 #ifdef USE_SHEEN 1217 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; 1218 #endif 1219 vec3 singleScatteringDielectric = vec3( 0.0 ); 1220 vec3 multiScatteringDielectric = vec3( 0.0 ); 1221 vec3 singleScatteringMetallic = vec3( 0.0 ); 1222 vec3 multiScatteringMetallic = vec3( 0.0 ); 1223 #ifdef USE_IRIDESCENCE 1224 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1225 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1226 #else 1227 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1228 computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1229 #endif 1230 vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); 1231 vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); 1232 vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; 1233 vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); 1234 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1235 vec3 indirectSpecular = radiance * singleScattering; 1236 indirectSpecular += multiScattering * cosineWeightedIrradiance; 1237 vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; 1238 #ifdef USE_SHEEN 1239 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1240 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1241 indirectSpecular *= sheenEnergyComp; 1242 indirectDiffuse *= sheenEnergyComp; 1243 #endif 1244 reflectedLight.indirectSpecular += indirectSpecular; 1245 reflectedLight.indirectDiffuse += indirectDiffuse; 1246} 1247#define RE_Direct RE_Direct_Physical 1248#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1249#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1250#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1251float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1252 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1253}`,
1253XC=` 1254vec3 geometryPosition = - vViewPosition; 1255vec3 geometryNormal = normal; 1256vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1257vec3 geometryClearcoatNormal = vec3( 0.0 ); 1258#ifdef USE_CLEARCOAT 1259 geometryClearcoatNormal = clearcoatNormal; 1260#endif 1261#ifdef USE_IRIDESCENCE 1262 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1263 if ( material.iridescenceThickness == 0.0 ) { 1264 material.iridescence = 0.0; 1265 } else { 1266 material.iridescence = saturate( material.iridescence ); 1267 } 1268 if ( material.iridescence > 0.0 ) { 1269 material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1270 material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); 1271 material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); 1272 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1273 } 1274#endif 1275IncidentLight directLight; 1276#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1277 PointLight pointLight; 1278 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1279 PointLightShadow pointLightShadow; 1280 #endif 1281 #pragma unroll_loop_start 1282 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1283 pointLight = pointLights[ i ]; 1284 getPointLightInfo( pointLight, geometryPosition, directLight ); 1285 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 1286 pointLightShadow = pointLightShadows[ i ]; 1287 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1288 #endif 1289 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1290 } 1291 #pragma unroll_loop_end 1292#endif 1293#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1294 SpotLight spotLight; 1295 vec4 spotColor; 1296 vec3 spotLightCoord; 1297 bool inSpotLightMap; 1298 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1299 SpotLightShadow spotLightShadow; 1300 #endif 1301 #pragma unroll_loop_start 1302 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1303 spotLight = spotLights[ i ]; 1304 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1305 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1306 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1307 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1308 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1309 #else 1310 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1311 #endif 1312 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1313 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1314 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1315 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1316 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1317 #endif 1318 #undef SPOT_LIGHT_MAP_INDEX 1319 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1320 spotLightShadow = spotLightShadows[ i ]; 1321 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1322 #endif 1323 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1324 } 1325 #pragma unroll_loop_end 1326#endif 1327#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1328 DirectionalLight directionalLight; 1329 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1330 DirectionalLightShadow directionalLightShadow; 1331 #endif 1332 #pragma unroll_loop_start 1333 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1334 directionalLight = directionalLights[ i ]; 1335 getDirectionalLightInfo( directionalLight, directLight ); 1336 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1337 directionalLightShadow = directionalLightShadows[ i ]; 1338 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1339 #endif 1340 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1341 } 1342 #pragma unroll_loop_end 1343#endif 1344#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1345 RectAreaLight rectAreaLight; 1346 #pragma unroll_loop_start 1347 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1348 rectAreaLight = rectAreaLights[ i ]; 1349 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1350 } 1351 #pragma unroll_loop_end 1352#endif 1353#if defined( RE_IndirectDiffuse ) 1354 vec3 iblIrradiance = vec3( 0.0 ); 1355 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1356 #if defined( USE_LIGHT_PROBES ) 1357 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1358 #endif 1359 #if ( NUM_HEMI_LIGHTS > 0 ) 1360 #pragma unroll_loop_start 1361 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1362 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1363 } 1364 #pragma unroll_loop_end 1365 #endif 1366 #ifdef USE_LIGHT_PROBES_GRID 1367 vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz; 1368 vec3 probeWorldNormal = inverseTransformDirection( geometryNormal, viewMatrix ); 1369 irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal ); 1370 #endif 1371#endif 1372#if defined( RE_IndirectSpecular ) 1373 vec3 radiance = vec3( 0.0 ); 1374 vec3 clearcoatRadiance = vec3( 0.0 ); 1375#endif`,qC=`#if defined( RE_IndirectDiffuse ) 1376 #ifdef USE_LIGHTMAP 1377 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1378 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1379 irradiance += lightMapIrradiance; 1380 #endif 1381 #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV ) 1382 #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG ) 1383 iblIrradiance += getIBLIrradiance( geometryNormal ); 1384 #endif 1385 #endif 1386#endif 1387#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1388 #ifdef USE_ANISOTROPY 1389 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1390 #else 1391 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1392 #endif 1393 #ifdef USE_CLEARCOAT 1394 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1395 #endif 1396#endif`,YC=`#if defined( RE_IndirectDiffuse ) 1397 #if defined( LAMBERT ) || defined( PHONG ) 1398 irradiance += iblIrradiance; 1399 #endif 1400 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1401#endif 1402#if defined( RE_IndirectSpecular ) 1403 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1404#endif`,jC=`#ifdef USE_LIGHT_PROBES_GRID 1405uniform highp sampler3D probesSH; 1406uniform vec3 probesMin; 1407uniform vec3 probesMax; 1408uniform vec3 probesResolution; 1409vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) { 1410 vec3 res = probesResolution; 1411 vec3 gridRange = probesMax - probesMin; 1412 vec3 resMinusOne = res - 1.0; 1413 vec3 probeSpacing = gridRange / resMinusOne; 1414 vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5; 1415 vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 ); 1416 uvw = uvw * resMinusOne / res + 0.5 / res; 1417 float nz = res.z; 1418 float paddedSlices = nz + 2.0; 1419 float atlasDepth = 7.0 * paddedSlices; 1420 float uvZBase = uvw.z * nz + 1.0; 1421 vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) ); 1422 vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) ); 1423 vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) ); 1424 vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) ); 1425 vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) ); 1426 vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) ); 1427 vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) ); 1428 vec3 c0 = s0.xyz; 1429 vec3 c1 = vec3( s0.w, s1.xy ); 1430 vec3 c2 = vec3( s1.zw, s2.x ); 1431 vec3 c3 = s2.yzw; 1432 vec3 c4 = s3.xyz; 1433 vec3 c5 = vec3( s3.w, s4.xy ); 1434 vec3 c6 = vec3( s4.zw, s5.x ); 1435 vec3 c7 = s5.yzw; 1436 vec3 c8 = s6.xyz; 1437 float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z; 1438 vec3 result = c0 * 0.886227; 1439 result += c1 * 2.0 * 0.511664 * y; 1440 result += c2 * 2.0 * 0.511664 * z; 1441 result += c3 * 2.0 * 0.511664 * x; 1442 result += c4 * 2.0 * 0.429043 * x * y; 1443 result += c5 * 2.0 * 0.429043 * y * z; 1444 result += c6 * ( 0.743125 * z * z - 0.247708 ); 1445 result += c7 * 2.0 * 0.429043 * x * z; 1446 result += c8 * 0.429043 * ( x * x - y * y ); 1447 return max( result, vec3( 0.0 ) ); 1448} 1449#endif`,$C=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1450 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1451#endif`,ZC=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1452 uniform float logDepthBufFC; 1453 varying float vFragDepth; 1454 varying float vIsPerspective; 1455#endif`,KC=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1456 varying float vFragDepth; 1457 varying float vIsPerspective; 1458#endif`,JC=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1459 vFragDepth = 1.0 + gl_Position.w; 1460 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1461#endif`,QC=`#ifdef USE_MAP 1462 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1463 #ifdef DECODE_VIDEO_TEXTURE 1464 sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); 1465 #endif 1466 diffuseColor *= sampledDiffuseColor; 1467#endif`,eR=`#ifdef USE_MAP 1468 uniform sampler2D map; 1469#endif`,tR=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1470 #if defined( USE_POINTS_UV ) 1471 vec2 uv = vUv; 1472 #else 1473 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1474 #endif 1475#endif 1476#ifdef USE_MAP 1477 diffuseColor *= texture2D( map, uv ); 1478#endif 1479#ifdef USE_ALPHAMAP 1480 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1481#endif`,nR=`#if defined( USE_POINTS_UV ) 1482 varying vec2 vUv; 1483#else 1484 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1485 uniform mat3 uvTransform; 1486 #endif 1487#endif 1488#ifdef USE_MAP 1489 uniform sampler2D map; 1490#endif 1491#ifdef USE_ALPHAMAP 1492 uniform sampler2D alphaMap; 1493#endif`,iR=`float metalnessFactor = metalness; 1494#ifdef USE_METALNESSMAP 1495 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1496 metalnessFactor *= texelMetalness.b; 1497#endif`,sR=`#ifdef USE_METALNESSMAP 1498 uniform sampler2D metalnessMap; 1499#endif`,rR=`#ifdef USE_INSTANCING_MORPH 1500 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1501 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1502 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1503 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1504 } 1505#endif`,aR=`#if defined( USE_MORPHCOLORS ) 1506 vColor *= morphTargetBaseInfluence; 1507 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1508 #if defined( USE_COLOR_ALPHA ) 1509 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1510 #elif defined( USE_COLOR ) 1511 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1512 #endif 1513 } 1514#endif`,oR=`#ifdef USE_MORPHNORMALS 1515 objectNormal *= morphTargetBaseInfluence; 1516 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1517 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1518 } 1519#endif`,lR=`#ifdef USE_MORPHTARGETS 1520 #ifndef USE_INSTANCING_MORPH 1521 uniform float morphTargetBaseInfluence; 1522 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1523 #endif 1524 uniform sampler2DArray morphTargetsTexture; 1525 uniform ivec2 morphTargetsTextureSize; 1526 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1527 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1528 int y = texelIndex / morphTargetsTextureSize.x; 1529 int x = texelIndex - y * morphTargetsTextureSize.x; 1530 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1531 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1532 } 1533#endif`,cR=`#ifdef USE_MORPHTARGETS 1534 transformed *= morphTargetBaseInfluence; 1535 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1536 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1537 } 1538#endif`,uR=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1539#ifdef FLAT_SHADED 1540 vec3 fdx = dFdx( vViewPosition ); 1541 vec3 fdy = dFdy( vViewPosition ); 1542 vec3 normal = normalize( cross( fdx, fdy ) ); 1543#else 1544 vec3 normal = normalize( vNormal ); 1545 #ifdef DOUBLE_SIDED 1546 normal *= faceDirection; 1547 #endif 1548#endif 1549#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1550 #ifdef USE_TANGENT 1551 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1552 #else 1553 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1554 #if defined( USE_NORMALMAP ) 1555 vNormalMapUv 1556 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1557 vClearcoatNormalMapUv 1558 #else 1559 vUv 1560 #endif 1561 ); 1562 #endif 1563 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1564 tbn[0] *= faceDirection; 1565 tbn[1] *= faceDirection; 1566 #endif 1567#endif 1568#ifdef USE_CLEARCOAT_NORMALMAP 1569 #ifdef USE_TANGENT 1570 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1571 #else 1572 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1573 #endif 1574 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1575 tbn2[0] *= faceDirection; 1576 tbn2[1] *= faceDirection; 1577 #endif 1578#endif 1579vec3 nonPerturbedNormal = normal;`,hR=`#ifdef USE_NORMALMAP_OBJECTSPACE 1580 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1581 #ifdef FLIP_SIDED 1582 normal = - normal; 1583 #endif 1584 #ifdef DOUBLE_SIDED 1585 normal = normal * faceDirection; 1586 #endif 1587 normal = normalize( normalMatrix * normal ); 1588#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1589 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1590 #if defined( USE_PACKED_NORMALMAP ) 1591 mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) ); 1592 #endif 1593 mapN.xy *= normalScale; 1594 normal = normalize( tbn * mapN ); 1595#elif defined( USE_BUMPMAP )
1596 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1597#endif`,fR=`#ifndef FLAT_SHADED 1598 varying vec3 vNormal; 1599 #ifdef USE_TANGENT 1600 varying vec3 vTangent; 1601 varying vec3 vBitangent; 1602 #endif 1603#endif`,dR=`#ifndef FLAT_SHADED 1604 varying vec3 vNormal; 1605 #ifdef USE_TANGENT 1606 varying vec3 vTangent; 1607 varying vec3 vBitangent; 1608 #endif 1609#endif`,pR=`#ifndef FLAT_SHADED 1610 vNormal = normalize( transformedNormal ); 1611 #ifdef USE_TANGENT 1612 vTangent = normalize( transformedTangent ); 1613 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1614 #endif 1615#endif`,mR=`#ifdef USE_NORMALMAP 1616 uniform sampler2D normalMap; 1617 uniform vec2 normalScale; 1618#endif 1619#ifdef USE_NORMALMAP_OBJECTSPACE 1620 uniform mat3 normalMatrix; 1621#endif 1622#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1623 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1624 vec3 q0 = dFdx( eye_pos.xyz ); 1625 vec3 q1 = dFdy( eye_pos.xyz ); 1626 vec2 st0 = dFdx( uv.st ); 1627 vec2 st1 = dFdy( uv.st ); 1628 vec3 N = surf_norm; 1629 vec3 q1perp = cross( q1, N ); 1630 vec3 q0perp = cross( N, q0 ); 1631 vec3 T = q1perp * st0.x + q0perp * st1.x; 1632 vec3 B = q1perp * st0.y + q0perp * st1.y; 1633 float det = max( dot( T, T ), dot( B, B ) ); 1634 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1635 return mat3( T * scale, B * scale, N ); 1636 } 1637#endif`,gR=`#ifdef USE_CLEARCOAT 1638 vec3 clearcoatNormal = nonPerturbedNormal; 1639#endif`,vR=`#ifdef USE_CLEARCOAT_NORMALMAP 1640 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1641 clearcoatMapN.xy *= clearcoatNormalScale; 1642 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1643#endif`,xR=`#ifdef USE_CLEARCOATMAP 1644 uniform sampler2D clearcoatMap; 1645#endif 1646#ifdef USE_CLEARCOAT_NORMALMAP 1647 uniform sampler2D clearcoatNormalMap; 1648 uniform vec2 clearcoatNormalScale; 1649#endif 1650#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1651 uniform sampler2D clearcoatRoughnessMap; 1652#endif`,_R=`#ifdef USE_IRIDESCENCEMAP 1653 uniform sampler2D iridescenceMap; 1654#endif 1655#ifdef USE_IRIDESCENCE_THICKNESSMAP 1656 uniform sampler2D iridescenceThicknessMap; 1657#endif`,yR=`#ifdef OPAQUE 1658diffuseColor.a = 1.0; 1659#endif 1660#ifdef USE_TRANSMISSION 1661diffuseColor.a *= material.transmissionAlpha; 1662#endif 1663gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,SR=`vec3 packNormalToRGB( const in vec3 normal ) { 1664 return normalize( normal ) * 0.5 + 0.5; 1665} 1666vec3 unpackRGBToNormal( const in vec3 rgb ) { 1667 return 2.0 * rgb.xyz - 1.0; 1668} 1669const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 1670const float Inv255 = 1. / 255.; 1671const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 1672const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 1673const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 1674const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 1675vec4 packDepthToRGBA( const in float v ) { 1676 if( v <= 0.0 ) 1677 return vec4( 0., 0., 0., 0. ); 1678 if( v >= 1.0 ) 1679 return vec4( 1., 1., 1., 1. ); 1680 float vuf; 1681 float af = modf( v * PackFactors.a, vuf ); 1682 float bf = modf( vuf * ShiftRight8, vuf ); 1683 float gf = modf( vuf * ShiftRight8, vuf ); 1684 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 1685} 1686vec3 packDepthToRGB( const in float v ) { 1687 if( v <= 0.0 ) 1688 return vec3( 0., 0., 0. ); 1689 if( v >= 1.0 ) 1690 return vec3( 1., 1., 1. ); 1691 float vuf; 1692 float bf = modf( v * PackFactors.b, vuf ); 1693 float gf = modf( vuf * ShiftRight8, vuf ); 1694 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 1695} 1696vec2 packDepthToRG( const in float v ) { 1697 if( v <= 0.0 ) 1698 return vec2( 0., 0. ); 1699 if( v >= 1.0 ) 1700 return vec2( 1., 1. ); 1701 float vuf; 1702 float gf = modf( v * 256., vuf ); 1703 return vec2( vuf * Inv255, gf ); 1704} 1705float unpackRGBAToDepth( const in vec4 v ) { 1706 return dot( v, UnpackFactors4 ); 1707} 1708float unpackRGBToDepth( const in vec3 v ) { 1709 return dot( v, UnpackFactors3 ); 1710} 1711float unpackRGToDepth( const in vec2 v ) { 1712 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 1713} 1714vec4 pack2HalfToRGBA( const in vec2 v ) {
1715 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1716 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1717} 1718vec2 unpackRGBATo2Half( const in vec4 v ) { 1719 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1720} 1721float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1722 return ( viewZ + near ) / ( near - far ); 1723} 1724float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1725 #ifdef USE_REVERSED_DEPTH_BUFFER 1726 1727 return depth * ( far - near ) - far; 1728 #else 1729 return depth * ( near - far ) - near; 1730 #endif 1731} 1732float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1733 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1734} 1735float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1736 1737 #ifdef USE_REVERSED_DEPTH_BUFFER 1738 return ( near * far ) / ( ( near - far ) * depth - near ); 1739 #else 1740 return ( near * far ) / ( ( far - near ) * depth - far ); 1741 #endif 1742}`,bR=`#ifdef PREMULTIPLIED_ALPHA 1743 gl_FragColor.rgb *= gl_FragColor.a; 1744#endif`,MR=`vec4 mvPosition = vec4( transformed, 1.0 ); 1745#ifdef USE_BATCHING 1746 mvPosition = batchingMatrix * mvPosition; 1747#endif 1748#ifdef USE_INSTANCING 1749 mvPosition = instanceMatrix * mvPosition; 1750#endif 1751mvPosition = modelViewMatrix * mvPosition; 1752gl_Position = projectionMatrix * mvPosition;`,ER=`#ifdef DITHERING 1753 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1754#endif`,TR=`#ifdef DITHERING 1755 vec3 dithering( vec3 color ) { 1756 float grid_position = rand( gl_FragCoord.xy ); 1757 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1758 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1759 return color + dither_shift_RGB; 1760 } 1761#endif`,wR=`float roughnessFactor = roughness; 1762#ifdef USE_ROUGHNESSMAP 1763 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1764 roughnessFactor *= texelRoughness.g; 1765#endif`,AR=`#ifdef USE_ROUGHNESSMAP 1766 uniform sampler2D roughnessMap; 1767#endif`,CR=`#if NUM_SPOT_LIGHT_COORDS > 0 1768 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1769#endif 1770#if NUM_SPOT_LIGHT_MAPS > 0 1771 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1772#endif 1773#ifdef USE_SHADOWMAP 1774 #if NUM_DIR_LIGHT_SHADOWS > 0 1775 #if defined( SHADOWMAP_TYPE_PCF ) 1776 uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1777 #else 1778 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1779 #endif 1780 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1781 struct DirectionalLightShadow { 1782 float shadowIntensity; 1783 float shadowBias; 1784 float shadowNormalBias; 1785 float shadowRadius; 1786 vec2 shadowMapSize; 1787 }; 1788 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1789 #endif 1790 #if NUM_SPOT_LIGHT_SHADOWS > 0 1791 #if defined( SHADOWMAP_TYPE_PCF ) 1792 uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1793 #else 1794 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1795 #endif 1796 struct SpotLightShadow { 1797 float shadowIntensity; 1798 float shadowBias; 1799 float shadowNormalBias; 1800 float shadowRadius; 1801 vec2 shadowMapSize; 1802 }; 1803 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1804 #endif 1805 #if NUM_POINT_LIGHT_SHADOWS > 0 1806 #if defined( SHADOWMAP_TYPE_PCF ) 1807 uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1808 #elif defined( SHADOWMAP_TYPE_BASIC ) 1809 uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1810 #endif 1811 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1812 struct PointLightShadow { 1813 float shadowIntensity; 1814 float shadowBias; 1815 float shadowNormalBias; 1816 float shadowRadius; 1817 vec2 shadowMapSize; 1818 float shadowCameraNear; 1819 float shadowCameraFar; 1820 }; 1821 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1822 #endif 1823 #if defined( SHADOWMAP_TYPE_PCF ) 1824 float interleavedGradientNoise( vec2 position ) { 1825 return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); 1826 } 1827 vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { 1828 const float goldenAngle = 2.399963229728653; 1829 float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); 1830 float theta = float( sampleIndex ) * goldenAngle + phi; 1831 return vec2( cos( theta ), sin( theta ) ) * r; 1832 } 1833 #endif 1834 #if defined( SHADOWMAP_TYPE_PCF ) 1835 float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1836 float shadow = 1.0; 1837 shadowCoord.xyz /= shadowCoord.w; 1838 shadowCoord.z += shadowBias; 1839 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1840 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1841 if ( frustumTest ) { 1842 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1843 float radius = shadowRadius * texelSize.x; 1844 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; 1845 shadow = ( 1846 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + 1847 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + 1848 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + 1849 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + 1850 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) 1851 ) * 0.2; 1852 } 1853 return mix( 1.0, shadow, shadowIntensity ); 1854 } 1855 #elif defined( SHADOWMAP_TYPE_VSM ) 1856 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1857 float shadow = 1.0; 1858 shadowCoord.xyz /= shadowCoord.w; 1859 #ifdef USE_REVERSED_DEPTH_BUFFER 1860 shadowCoord.z -= shadowBias; 1861 #else 1862 shadowCoord.z += shadowBias; 1863 #endif 1864 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1865 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1866 if ( frustumTest ) { 1867 vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; 1868 float mean = distribution.x; 1869 float variance = distribution.y * distribution.y; 1870 #ifdef USE_REVERSED_DEPTH_BUFFER 1871 float hard_shadow = step( mean, shadowCoord.z ); 1872 #else 1873 float hard_shadow = step( shadowCoord.z, mean ); 1874 #endif 1875 1876 if ( hard_shadow == 1.0 ) { 1877 shadow = 1.0; 1878 } else { 1879 variance = max( variance, 0.0000001 ); 1880 float d = shadowCoord.z - mean; 1881 float p_max = variance / ( variance + d * d ); 1882 p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); 1883 shadow = max( hard_shadow, p_max ); 1884 } 1885 } 1886 return mix( 1.0, shadow, shadowIntensity ); 1887 } 1888 #else 1889 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1890 float shadow = 1.0; 1891 shadowCoord.xyz /= shadowCoord.w; 1892 #ifdef USE_REVERSED_DEPTH_BUFFER 1893 shadowCoord.z -= shadowBias; 1894 #else 1895 shadowCoord.z += shadowBias; 1896 #endif 1897 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1898 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1899 if ( frustumTest ) { 1900 float depth = texture2D( shadowMap, shadowCoord.xy ).r; 1901 #ifdef USE_REVERSED_DEPTH_BUFFER 1902 shadow = step( depth, shadowCoord.z ); 1903 #else 1904 shadow = step( shadowCoord.z, depth ); 1905 #endif 1906 } 1907 return mix( 1.0, shadow, shadowIntensity ); 1908 } 1909 #endif 1910 #if NUM_POINT_LIGHT_SHADOWS > 0 1911 #if defined( SHADOWMAP_TYPE_PCF ) 1912 float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1913 float shadow = 1.0; 1914 vec3 lightToPosition = shadowCoord.xyz; 1915 vec3 bd3D = normalize( lightToPosition ); 1916 vec3 absVec = abs( lightToPosition ); 1917 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 1918 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 1919 #ifdef USE_REVERSED_DEPTH_BUFFER 1920 float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1921 dp -= shadowBias; 1922 #else 1923 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 1924 dp += shadowBias; 1925 #endif 1926 float texelSize = shadowRadius / shadowMapSize.x; 1927 vec3 absDir = abs( bd3D ); 1928 vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); 1929 tangent = normalize( cross( bd3D, tangent ) ); 1930 vec3 bitangent = cross( bd3D, tangent ); 1931 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; 1932 vec2 sample0 = vogelDiskSample( 0, 5, phi ); 1933 vec2 sample1 = vogelDiskSample( 1, 5, phi ); 1934 vec2 sample2 = vogelDiskSample( 2, 5, phi ); 1935 vec2 sample3 = vogelDiskSample( 3, 5, phi ); 1936 vec2 sample4 = vogelDiskSample( 4, 5, phi ); 1937 shadow = ( 1938 texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) + 1939 texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) + 1940 texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) + 1941 texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) + 1942 texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) ) 1943 ) * 0.2; 1944 } 1945 return mix( 1.0, shadow, shadowIntensity ); 1946 } 1947 #elif defined( SHADOWMAP_TYPE_BASIC ) 1948 float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1949 float shadow = 1.0; 1950 vec3 lightToPosition = shadowCoord.xyz; 1951 vec3 absVec = abs( lightToPosition ); 1952 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 1953 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 1954 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 1955 dp += shadowBias; 1956 vec3 bd3D = normalize( lightToPosition ); 1957 float depth = textureCube( shadowMap, bd3D ).r; 1958 #ifdef USE_REVERSED_DEPTH_BUFFER 1959 depth = 1.0 - depth; 1960 #endif 1961 shadow = step( dp, depth ); 1962 } 1963 return mix( 1.0, shadow, shadowIntensity ); 1964 } 1965 #endif 1966 #endif 1967#endif`,RR=`#if NUM_SPOT_LIGHT_COORDS > 0 1968 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 1969 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1970#endif 1971#ifdef USE_SHADOWMAP 1972 #if NUM_DIR_LIGHT_SHADOWS > 0 1973 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 1974 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1975 struct DirectionalLightShadow { 1976 float shadowIntensity; 1977 float shadowBias; 1978 float shadowNormalBias; 1979 float shadowRadius; 1980 vec2 shadowMapSize; 1981 }; 1982 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1983 #endif 1984 #if NUM_SPOT_LIGHT_SHADOWS > 0 1985 struct SpotLightShadow { 1986 float shadowIntensity; 1987 float shadowBias; 1988 float shadowNormalBias; 1989 float shadowRadius; 1990 vec2 shadowMapSize; 1991 }; 1992 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1993 #endif 1994 #if NUM_POINT_LIGHT_SHADOWS > 0 1995 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 1996 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1997 struct PointLightShadow { 1998 float shadowIntensity; 1999 float shadowBias; 2000 float shadowNormalBias; 2001 float shadowRadius; 2002 vec2 shadowMapSize; 2003 float shadowCameraNear; 2004 float shadowCameraFar; 2005 }; 2006 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2007 #endif 2008#endif`,IR=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 2009 #ifdef HAS_NORMAL 2010 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 2011 #else 2012 vec3 shadowWorldNormal = vec3( 0.0 ); 2013 #endif 2014 vec4 shadowWorldPosition; 2015#endif 2016#if defined( USE_SHADOWMAP ) 2017 #if NUM_DIR_LIGHT_SHADOWS > 0 2018 #pragma unroll_loop_start 2019 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2020 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 2021 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 2022 } 2023 #pragma unroll_loop_end 2024 #endif 2025 #if NUM_POINT_LIGHT_SHADOWS > 0 2026 #pragma unroll_loop_start 2027 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2028 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 2029 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 2030 } 2031 #pragma unroll_loop_end 2032 #endif 2033#endif
2034#if NUM_SPOT_LIGHT_COORDS > 0 2035 #pragma unroll_loop_start 2036 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 2037 shadowWorldPosition = worldPosition; 2038 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2039 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 2040 #endif 2041 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 2042 } 2043 #pragma unroll_loop_end 2044#endif`,PR=`float getShadowMask() { 2045 float shadow = 1.0; 2046 #ifdef USE_SHADOWMAP 2047 #if NUM_DIR_LIGHT_SHADOWS > 0 2048 DirectionalLightShadow directionalLight; 2049 #pragma unroll_loop_start 2050 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2051 directionalLight = directionalLightShadows[ i ]; 2052 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2053 } 2054 #pragma unroll_loop_end 2055 #endif 2056 #if NUM_SPOT_LIGHT_SHADOWS > 0 2057 SpotLightShadow spotLight; 2058 #pragma unroll_loop_start 2059 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 2060 spotLight = spotLightShadows[ i ]; 2061 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2062 } 2063 #pragma unroll_loop_end 2064 #endif 2065 #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 2066 PointLightShadow pointLight; 2067 #pragma unroll_loop_start 2068 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2069 pointLight = pointLightShadows[ i ]; 2070 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2071 } 2072 #pragma unroll_loop_end 2073 #endif 2074 #endif 2075 return shadow; 2076}`,LR=`#ifdef USE_SKINNING 2077 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2078 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2079 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2080 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2081#endif`,DR=`#ifdef USE_SKINNING 2082 uniform mat4 bindMatrix; 2083 uniform mat4 bindMatrixInverse; 2084 uniform highp sampler2D boneTexture; 2085 mat4 getBoneMatrix( const in float i ) { 2086 int size = textureSize( boneTexture, 0 ).x; 2087 int j = int( i ) * 4; 2088 int x = j % size; 2089 int y = j / size; 2090 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2091 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2092 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2093 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2094 return mat4( v1, v2, v3, v4 ); 2095 } 2096#endif`,NR=`#ifdef USE_SKINNING 2097 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2098 vec4 skinned = vec4( 0.0 ); 2099 skinned += boneMatX * skinVertex * skinWeight.x; 2100 skinned += boneMatY * skinVertex * skinWeight.y; 2101 skinned += boneMatZ * skinVertex * skinWeight.z; 2102 skinned += boneMatW * skinVertex * skinWeight.w; 2103 transformed = ( bindMatrixInverse * skinned ).xyz; 2104#endif`,UR=`#ifdef USE_SKINNING 2105 mat4 skinMatrix = mat4( 0.0 ); 2106 skinMatrix += skinWeight.x * boneMatX; 2107 skinMatrix += skinWeight.y * boneMatY; 2108 skinMatrix += skinWeight.z * boneMatZ; 2109 skinMatrix += skinWeight.w * boneMatW; 2110 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2111 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2112 #ifdef USE_TANGENT 2113 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2114 #endif 2115#endif`,FR=`float specularStrength; 2116#ifdef USE_SPECULARMAP 2117 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2118 specularStrength = texelSpecular.r; 2119#else 2120 specularStrength = 1.0; 2121#endif`,OR=`#ifdef USE_SPECULARMAP 2122 uniform sampler2D specularMap; 2123#endif`,BR=`#if defined( TONE_MAPPING ) 2124 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2125#endif`,zR=`#ifndef saturate 2126#define saturate( a ) clamp( a, 0.0, 1.0 ) 2127#endif 2128uniform float toneMappingExposure; 2129vec3 LinearToneMapping( vec3 color ) { 2130 return saturate( toneMappingExposure * color ); 2131} 2132vec3 ReinhardToneMapping( vec3 color ) { 2133 color *= toneMappingExposure; 2134 return saturate( color / ( vec3( 1.0 ) + color ) ); 2135} 2136vec3 CineonToneMapping( vec3 color ) { 2137 color *= toneMappingExposure; 2138 color = max( vec3( 0.0 ), color - 0.004 ); 2139 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2140} 2141vec3 RRTAndODTFit( vec3 v ) { 2142 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2143 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2144 return a / b; 2145} 2146vec3 ACESFilmicToneMapping( vec3 color ) { 2147 const mat3 ACESInputMat = mat3( 2148 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2149 vec3( 0.04823, 0.01566, 0.83777 ) 2150 ); 2151 const mat3 ACESOutputMat = mat3( 2152 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2153 vec3( -0.07367, -0.00605, 1.07602 ) 2154 ); 2155 color *= toneMappingExposure / 0.6; 2156 color = ACESInputMat * color; 2157 color = RRTAndODTFit( color ); 2158 color = ACESOutputMat * color; 2159 return saturate( color ); 2160} 2161const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2162 vec3( 1.6605, - 0.1246, - 0.0182 ), 2163 vec3( - 0.5876, 1.1329, - 0.1006 ), 2164 vec3( - 0.0728, - 0.0083, 1.1187 ) 2165); 2166const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2167 vec3( 0.6274, 0.0691, 0.0164 ), 2168 vec3( 0.3293, 0.9195, 0.0880 ), 2169 vec3( 0.0433, 0.0113, 0.8956 ) 2170); 2171vec3 agxDefaultContrastApprox( vec3 x ) { 2172 vec3 x2 = x * x; 2173 vec3 x4 = x2 * x2; 2174 return + 15.5 * x4 * x2 2175 - 40.14 * x4 * x 2176 + 31.96 * x4 2177 - 6.868 * x2 * x 2178 + 0.4298 * x2 2179 + 0.1191 * x 2180 - 0.00232; 2181} 2182vec3 AgXToneMapping( vec3 color ) { 2183 const mat3 AgXInsetMatrix = mat3( 2184 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2185 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2186 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2187 );
2188 const mat3 AgXOutsetMatrix = mat3( 2189 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2190 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2191 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2192 ); 2193 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2194 color *= toneMappingExposure; 2195 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2196 color = AgXInsetMatrix * color; 2197 color = max( color, 1e-10 ); color = log2( color ); 2198 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2199 color = clamp( color, 0.0, 1.0 ); 2200 color = agxDefaultContrastApprox( color ); 2201 color = AgXOutsetMatrix * color; 2202 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2203 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2204 color = clamp( color, 0.0, 1.0 ); 2205 return color; 2206} 2207vec3 NeutralToneMapping( vec3 color ) { 2208 const float StartCompression = 0.8 - 0.04; 2209 const float Desaturation = 0.15; 2210 color *= toneMappingExposure; 2211 float x = min( color.r, min( color.g, color.b ) ); 2212 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2213 color -= offset; 2214 float peak = max( color.r, max( color.g, color.b ) ); 2215 if ( peak < StartCompression ) return color; 2216 float d = 1. - StartCompression; 2217 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2218 color *= newPeak / peak; 2219 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2220 return mix( color, vec3( newPeak ), g ); 2221} 2222vec3 CustomToneMapping( vec3 color ) { return color; }`,kR=`#ifdef USE_TRANSMISSION 2223 material.transmission = transmission; 2224 material.transmissionAlpha = 1.0; 2225 material.thickness = thickness; 2226 material.attenuationDistance = attenuationDistance; 2227 material.attenuationColor = attenuationColor; 2228 #ifdef USE_TRANSMISSIONMAP 2229 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2230 #endif 2231 #ifdef USE_THICKNESSMAP 2232 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2233 #endif 2234 vec3 pos = vWorldPosition; 2235 vec3 v = normalize( cameraPosition - pos ); 2236 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2237 vec4 transmitted = getIBLVolumeRefraction( 2238 n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, 2239 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2240 material.attenuationColor, material.attenuationDistance ); 2241 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2242 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2243#endif`,VR=`#ifdef USE_TRANSMISSION 2244 uniform float transmission; 2245 uniform float thickness; 2246 uniform float attenuationDistance; 2247 uniform vec3 attenuationColor; 2248 #ifdef USE_TRANSMISSIONMAP 2249 uniform sampler2D transmissionMap; 2250 #endif 2251 #ifdef USE_THICKNESSMAP 2252 uniform sampler2D thicknessMap; 2253 #endif 2254 uniform vec2 transmissionSamplerSize; 2255 uniform sampler2D transmissionSamplerMap; 2256 uniform mat4 modelMatrix; 2257 uniform mat4 projectionMatrix; 2258 varying vec3 vWorldPosition; 2259 float w0( float a ) { 2260 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2261 } 2262 float w1( float a ) { 2263 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2264 } 2265 float w2( float a ){ 2266 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2267 } 2268 float w3( float a ) { 2269 return ( 1.0 / 6.0 ) * ( a * a * a ); 2270 } 2271 float g0( float a ) { 2272 return w0( a ) + w1( a ); 2273 } 2274 float g1( float a ) { 2275 return w2( a ) + w3( a ); 2276 } 2277 float h0( float a ) { 2278 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2279 } 2280 float h1( float a ) { 2281 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2282 } 2283 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2284 uv = uv * texelSize.zw + 0.5; 2285 vec2 iuv = floor( uv ); 2286 vec2 fuv = fract( uv ); 2287 float g0x = g0( fuv.x ); 2288 float g1x = g1( fuv.x ); 2289 float h0x = h0( fuv.x ); 2290 float h1x = h1( fuv.x ); 2291 float h0y = h0( fuv.y ); 2292 float h1y = h1( fuv.y ); 2293 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2294 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2295 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2296 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2297 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2298 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2299 } 2300 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2301 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2302 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2303 vec2 fLodSizeInv = 1.0 / fLodSize; 2304 vec2 cLodSizeInv = 1.0 / cLodSize; 2305 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2306 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2307 return mix( fSample, cSample, fract( lod ) ); 2308 } 2309 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2310 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2311 vec3 modelScale; 2312 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2313 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2314 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2315 return normalize( refractionVector ) * thickness * modelScale; 2316 } 2317 float applyIorToRoughness( const in float roughness, const in float ior ) { 2318 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2319 } 2320 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2321 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2322 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2323 } 2324 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2325 if ( isinf( attenuationDistance ) ) { 2326 return vec3( 1.0 ); 2327 } else { 2328 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2329 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2330 } 2331 } 2332 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2333 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2334 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2335 const in vec3 attenuationColor, const in float attenuationDistance ) { 2336 vec4 transmittedLight; 2337 vec3 transmittance; 2338 #ifdef USE_DISPERSION 2339 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2340 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2341 for ( int i = 0; i < 3; i ++ ) { 2342 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2343 vec3 refractedRayExit = position + transmissionRay; 2344 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2345 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2346 refractionCoords += 1.0; 2347 refractionCoords /= 2.0; 2348 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2349 transmittedLight[ i ] = transmissionSample[ i ]; 2350 transmittedLight.a += transmissionSample.a; 2351 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2352 } 2353 transmittedLight.a /= 3.0; 2354 #else 2355 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2356 vec3 refractedRayExit = position + transmissionRay; 2357 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2358 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2359 refractionCoords += 1.0; 2360 refractionCoords /= 2.0; 2361 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2362 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2363 #endif 2364 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2365 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2366 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2367 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2368 } 2369#endif`,HR=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2370 varying vec2 vUv; 2371#endif 2372#ifdef USE_MAP 2373 varying vec2 vMapUv; 2374#endif 2375#ifdef USE_ALPHAMAP
2376 varying vec2 vAlphaMapUv; 2377#endif 2378#ifdef USE_LIGHTMAP 2379 varying vec2 vLightMapUv; 2380#endif 2381#ifdef USE_AOMAP 2382 varying vec2 vAoMapUv; 2383#endif 2384#ifdef USE_BUMPMAP 2385 varying vec2 vBumpMapUv; 2386#endif 2387#ifdef USE_NORMALMAP 2388 varying vec2 vNormalMapUv; 2389#endif 2390#ifdef USE_EMISSIVEMAP 2391 varying vec2 vEmissiveMapUv; 2392#endif 2393#ifdef USE_METALNESSMAP 2394 varying vec2 vMetalnessMapUv; 2395#endif 2396#ifdef USE_ROUGHNESSMAP 2397 varying vec2 vRoughnessMapUv; 2398#endif 2399#ifdef USE_ANISOTROPYMAP 2400 varying vec2 vAnisotropyMapUv; 2401#endif 2402#ifdef USE_CLEARCOATMAP 2403 varying vec2 vClearcoatMapUv; 2404#endif 2405#ifdef USE_CLEARCOAT_NORMALMAP 2406 varying vec2 vClearcoatNormalMapUv; 2407#endif 2408#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2409 varying vec2 vClearcoatRoughnessMapUv; 2410#endif 2411#ifdef USE_IRIDESCENCEMAP 2412 varying vec2 vIridescenceMapUv; 2413#endif 2414#ifdef USE_IRIDESCENCE_THICKNESSMAP 2415 varying vec2 vIridescenceThicknessMapUv; 2416#endif 2417#ifdef USE_SHEEN_COLORMAP 2418 varying vec2 vSheenColorMapUv; 2419#endif 2420#ifdef USE_SHEEN_ROUGHNESSMAP 2421 varying vec2 vSheenRoughnessMapUv; 2422#endif 2423#ifdef USE_SPECULARMAP 2424 varying vec2 vSpecularMapUv; 2425#endif 2426#ifdef USE_SPECULAR_COLORMAP 2427 varying vec2 vSpecularColorMapUv; 2428#endif 2429#ifdef USE_SPECULAR_INTENSITYMAP 2430 varying vec2 vSpecularIntensityMapUv; 2431#endif 2432#ifdef USE_TRANSMISSIONMAP 2433 uniform mat3 transmissionMapTransform; 2434 varying vec2 vTransmissionMapUv; 2435#endif 2436#ifdef USE_THICKNESSMAP 2437 uniform mat3 thicknessMapTransform; 2438 varying vec2 vThicknessMapUv; 2439#endif`,GR=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2440 varying vec2 vUv; 2441#endif 2442#ifdef USE_MAP 2443 uniform mat3 mapTransform; 2444 varying vec2 vMapUv; 2445#endif 2446#ifdef USE_ALPHAMAP 2447 uniform mat3 alphaMapTransform; 2448 varying vec2 vAlphaMapUv; 2449#endif 2450#ifdef USE_LIGHTMAP 2451 uniform mat3 lightMapTransform; 2452 varying vec2 vLightMapUv; 2453#endif 2454#ifdef USE_AOMAP 2455 uniform mat3 aoMapTransform; 2456 varying vec2 vAoMapUv; 2457#endif 2458#ifdef USE_BUMPMAP 2459 uniform mat3 bumpMapTransform; 2460 varying vec2 vBumpMapUv; 2461#endif 2462#ifdef USE_NORMALMAP 2463 uniform mat3 normalMapTransform; 2464 varying vec2 vNormalMapUv; 2465#endif 2466#ifdef USE_DISPLACEMENTMAP 2467 uniform mat3 displacementMapTransform; 2468 varying vec2 vDisplacementMapUv; 2469#endif 2470#ifdef USE_EMISSIVEMAP 2471 uniform mat3 emissiveMapTransform; 2472 varying vec2 vEmissiveMapUv; 2473#endif 2474#ifdef USE_METALNESSMAP 2475 uniform mat3 metalnessMapTransform; 2476 varying vec2 vMetalnessMapUv; 2477#endif 2478#ifdef USE_ROUGHNESSMAP 2479 uniform mat3 roughnessMapTransform; 2480 varying vec2 vRoughnessMapUv; 2481#endif 2482#ifdef USE_ANISOTROPYMAP 2483 uniform mat3 anisotropyMapTransform; 2484 varying vec2 vAnisotropyMapUv; 2485#endif 2486#ifdef USE_CLEARCOATMAP 2487 uniform mat3 clearcoatMapTransform; 2488 varying vec2 vClearcoatMapUv; 2489#endif 2490#ifdef USE_CLEARCOAT_NORMALMAP 2491 uniform mat3 clearcoatNormalMapTransform; 2492 varying vec2 vClearcoatNormalMapUv; 2493#endif 2494#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2495 uniform mat3 clearcoatRoughnessMapTransform; 2496 varying vec2 vClearcoatRoughnessMapUv; 2497#endif 2498#ifdef USE_SHEEN_COLORMAP 2499 uniform mat3 sheenColorMapTransform; 2500 varying vec2 vSheenColorMapUv; 2501#endif 2502#ifdef USE_SHEEN_ROUGHNESSMAP 2503 uniform mat3 sheenRoughnessMapTransform; 2504 varying vec2 vSheenRoughnessMapUv; 2505#endif 2506#ifdef USE_IRIDESCENCEMAP 2507 uniform mat3 iridescenceMapTransform; 2508 varying vec2 vIridescenceMapUv; 2509#endif 2510#ifdef USE_IRIDESCENCE_THICKNESSMAP 2511 uniform mat3 iridescenceThicknessMapTransform; 2512 varying vec2 vIridescenceThicknessMapUv; 2513#endif 2514#ifdef USE_SPECULARMAP 2515 uniform mat3 specularMapTransform; 2516 varying vec2 vSpecularMapUv; 2517#endif 2518#ifdef USE_SPECULAR_COLORMAP 2519 uniform mat3 specularColorMapTransform; 2520 varying vec2 vSpecularColorMapUv; 2521#endif 2522#ifdef USE_SPECULAR_INTENSITYMAP 2523 uniform mat3 specularIntensityMapTransform; 2524 varying vec2 vSpecularIntensityMapUv; 2525#endif 2526#ifdef USE_TRANSMISSIONMAP 2527 uniform mat3 transmissionMapTransform; 2528 varying vec2 vTransmissionMapUv; 2529#endif 2530#ifdef USE_THICKNESSMAP 2531 uniform mat3 thicknessMapTransform; 2532 varying vec2 vThicknessMapUv; 2533#endif`,WR=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2534 vUv = vec3( uv, 1 ).xy; 2535#endif 2536#ifdef USE_MAP 2537 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2538#endif 2539#ifdef USE_ALPHAMAP 2540 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2541#endif 2542#ifdef USE_LIGHTMAP 2543 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2544#endif 2545#ifdef USE_AOMAP 2546 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2547#endif 2548#ifdef USE_BUMPMAP 2549 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2550#endif 2551#ifdef USE_NORMALMAP 2552 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2553#endif 2554#ifdef USE_DISPLACEMENTMAP 2555 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2556#endif 2557#ifdef USE_EMISSIVEMAP 2558 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2559#endif 2560#ifdef USE_METALNESSMAP 2561 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2562#endif 2563#ifdef USE_ROUGHNESSMAP 2564 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2565#endif 2566#ifdef USE_ANISOTROPYMAP 2567 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2568#endif 2569#ifdef USE_CLEARCOATMAP 2570 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2571#endif 2572#ifdef USE_CLEARCOAT_NORMALMAP 2573 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2574#endif 2575#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2576 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2577#endif
2578#ifdef USE_IRIDESCENCEMAP 2579 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2580#endif 2581#ifdef USE_IRIDESCENCE_THICKNESSMAP 2582 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2583#endif 2584#ifdef USE_SHEEN_COLORMAP 2585 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2586#endif 2587#ifdef USE_SHEEN_ROUGHNESSMAP 2588 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2589#endif 2590#ifdef USE_SPECULARMAP 2591 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2592#endif 2593#ifdef USE_SPECULAR_COLORMAP 2594 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2595#endif 2596#ifdef USE_SPECULAR_INTENSITYMAP 2597 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2598#endif 2599#ifdef USE_TRANSMISSIONMAP 2600 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2601#endif 2602#ifdef USE_THICKNESSMAP 2603 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2604#endif`,XR=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2605 vec4 worldPosition = vec4( transformed, 1.0 ); 2606 #ifdef USE_BATCHING 2607 worldPosition = batchingMatrix * worldPosition; 2608 #endif 2609 #ifdef USE_INSTANCING 2610 worldPosition = instanceMatrix * worldPosition; 2611 #endif 2612 worldPosition = modelMatrix * worldPosition; 2613#endif`;const qR=`varying vec2 vUv; 2614uniform mat3 uvTransform; 2615void main() { 2616 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2617 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2618}`,YR=`uniform sampler2D t2D; 2619uniform float backgroundIntensity; 2620varying vec2 vUv; 2621void main() { 2622 vec4 texColor = texture2D( t2D, vUv ); 2623 #ifdef DECODE_VIDEO_TEXTURE 2624 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 ); 2625 #endif 2626 texColor.rgb *= backgroundIntensity; 2627 gl_FragColor = texColor; 2628 #include <tonemapping_fragment> 2629 #include <colorspace_fragment> 2630}`,jR=`varying vec3 vWorldDirection; 2631#include <common> 2632void main() { 2633 vWorldDirection = transformDirection( position, modelMatrix ); 2634 #include <begin_vertex> 2635 #include <project_vertex> 2636 gl_Position.z = gl_Position.w; 2637}`,$R=`#ifdef ENVMAP_TYPE_CUBE 2638 uniform samplerCube envMap; 2639#elif defined( ENVMAP_TYPE_CUBE_UV ) 2640 uniform sampler2D envMap; 2641#endif 2642uniform float backgroundBlurriness; 2643uniform float backgroundIntensity; 2644uniform mat3 backgroundRotation; 2645varying vec3 vWorldDirection; 2646#include <cube_uv_reflection_fragment> 2647void main() { 2648 #ifdef ENVMAP_TYPE_CUBE 2649 vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection ); 2650 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2651 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2652 #else 2653 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2654 #endif 2655 texColor.rgb *= backgroundIntensity; 2656 gl_FragColor = texColor; 2657 #include <tonemapping_fragment> 2658 #include <colorspace_fragment> 2659}`,ZR=`varying vec3 vWorldDirection; 2660#include <common> 2661void main() { 2662 vWorldDirection = transformDirection( position, modelMatrix ); 2663 #include <begin_vertex> 2664 #include <project_vertex> 2665 gl_Position.z = gl_Position.w; 2666}`,KR=`uniform samplerCube tCube; 2667uniform float tFlip; 2668uniform float opacity; 2669varying vec3 vWorldDirection; 2670void main() { 2671 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2672 gl_FragColor = texColor; 2673 gl_FragColor.a *= opacity; 2674 #include <tonemapping_fragment> 2675 #include <colorspace_fragment> 2676}`,JR=`#include <common> 2677#include <batching_pars_vertex> 2678#include <uv_pars_vertex> 2679#include <displacementmap_pars_vertex> 2680#include <morphtarget_pars_vertex> 2681#include <skinning_pars_vertex> 2682#include <logdepthbuf_pars_vertex> 2683#include <clipping_planes_pars_vertex> 2684varying vec2 vHighPrecisionZW; 2685void main() { 2686 #include <uv_vertex> 2687 #include <batching_vertex> 2688 #include <skinbase_vertex> 2689 #include <morphinstance_vertex> 2690 #ifdef USE_DISPLACEMENTMAP 2691 #include <beginnormal_vertex> 2692 #include <morphnormal_vertex> 2693 #include <skinnormal_vertex> 2694 #endif 2695 #include <begin_vertex> 2696 #include <morphtarget_vertex> 2697 #include <skinning_vertex> 2698 #include <displacementmap_vertex> 2699 #include <project_vertex> 2700 #include <logdepthbuf_vertex> 2701 #include <clipping_planes_vertex> 2702 vHighPrecisionZW = gl_Position.zw; 2703}`,QR=`#if DEPTH_PACKING == 3200 2704 uniform float opacity; 2705#endif 2706#include <common> 2707#include <packing> 2708#include <uv_pars_fragment> 2709#include <map_pars_fragment> 2710#include <alphamap_pars_fragment> 2711#include <alphatest_pars_fragment> 2712#include <alphahash_pars_fragment> 2713#include <logdepthbuf_pars_fragment> 2714#include <clipping_planes_pars_fragment> 2715varying vec2 vHighPrecisionZW; 2716void main() { 2717 vec4 diffuseColor = vec4( 1.0 ); 2718 #include <clipping_planes_fragment> 2719 #if DEPTH_PACKING == 3200 2720 diffuseColor.a = opacity; 2721 #endif 2722 #include <map_fragment> 2723 #include <alphamap_fragment> 2724 #include <alphatest_fragment> 2725 #include <alphahash_fragment> 2726 #include <logdepthbuf_fragment> 2727 #ifdef USE_REVERSED_DEPTH_BUFFER 2728 float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; 2729 #else 2730 float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; 2731 #endif 2732 #if DEPTH_PACKING == 3200 2733 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2734 #elif DEPTH_PACKING == 3201 2735 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2736 #elif DEPTH_PACKING == 3202 2737 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 2738 #elif DEPTH_PACKING == 3203 2739 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 2740 #endif 2741}`,e3=`#define DISTANCE 2742varying vec3 vWorldPosition; 2743#include <common> 2744#include <batching_pars_vertex> 2745#include <uv_pars_vertex> 2746#include <displacementmap_pars_vertex> 2747#include <morphtarget_pars_vertex> 2748#include <skinning_pars_vertex> 2749#include <clipping_planes_pars_vertex> 2750void main() { 2751 #include <uv_vertex> 2752 #include <batching_vertex> 2753 #include <skinbase_vertex> 2754 #include <morphinstance_vertex> 2755 #ifdef USE_DISPLACEMENTMAP 2756 #include <beginnormal_vertex> 2757 #include <morphnormal_vertex> 2758 #include <skinnormal_vertex> 2759 #endif 2760 #include <begin_vertex> 2761 #include <morphtarget_vertex> 2762 #include <skinning_vertex> 2763 #include <displacementmap_vertex> 2764 #include <project_vertex> 2765 #include <worldpos_vertex> 2766 #include <clipping_planes_vertex> 2767 vWorldPosition = worldPosition.xyz; 2768}`,t3=`#define DISTANCE 2769uniform vec3 referencePosition; 2770uniform float nearDistance; 2771uniform float farDistance; 2772varying vec3 vWorldPosition; 2773#include <common> 2774#include <uv_pars_fragment> 2775#include <map_pars_fragment> 2776#include <alphamap_pars_fragment> 2777#include <alphatest_pars_fragment> 2778#include <alphahash_pars_fragment> 2779#include <clipping_planes_pars_fragment> 2780void main () { 2781 vec4 diffuseColor = vec4( 1.0 ); 2782 #include <clipping_planes_fragment> 2783 #include <map_fragment> 2784 #include <alphamap_fragment> 2785 #include <alphatest_fragment> 2786 #include <alphahash_fragment> 2787 float dist = length( vWorldPosition - referencePosition ); 2788 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2789 dist = saturate( dist ); 2790 gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); 2791}`,n3=`varying vec3 vWorldDirection; 2792#include <common> 2793void main() { 2794 vWorldDirection = transformDirection( position, modelMatrix ); 2795 #include <begin_vertex> 2796 #include <project_vertex> 2797}`,i3=`uniform sampler2D tEquirect; 2798varying vec3 vWorldDirection; 2799#include <common> 2800void main() { 2801 vec3 direction = normalize( vWorldDirection ); 2802 vec2 sampleUV = equirectUv( direction ); 2803 gl_FragColor = texture2D( tEquirect, sampleUV ); 2804 #include <tonemapping_fragment> 2805 #include <colorspace_fragment> 2806}`,s3=`uniform float scale; 2807attribute float lineDistance; 2808varying float vLineDistance; 2809#include <common> 2810#include <uv_pars_vertex> 2811#include <color_pars_vertex> 2812#include <fog_pars_vertex> 2813#include <morphtarget_pars_vertex> 2814#include <logdepthbuf_pars_vertex> 2815#include <clipping_planes_pars_vertex> 2816void main() { 2817 vLineDistance = scale * lineDistance; 2818 #include <uv_vertex> 2819 #include <color_vertex> 2820 #include <morphinstance_vertex> 2821 #include <morphcolor_vertex> 2822 #include <begin_vertex> 2823 #include <morphtarget_vertex> 2824 #include <project_vertex> 2825 #include <logdepthbuf_vertex> 2826 #include <clipping_planes_vertex> 2827 #include <fog_vertex> 2828}`,r3=`uniform vec3 diffuse; 2829uniform float opacity; 2830uniform float dashSize; 2831uniform float totalSize; 2832varying float vLineDistance; 2833#include <common> 2834#include <color_pars_fragment> 2835#include <uv_pars_fragment> 2836#include <map_pars_fragment> 2837#include <fog_pars_fragment> 2838#include <logdepthbuf_pars_fragment> 2839#include <clipping_planes_pars_fragment> 2840void main() { 2841 vec4 diffuseColor = vec4( diffuse, opacity ); 2842 #include <clipping_planes_fragment> 2843 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2844 discard; 2845 } 2846 vec3 outgoingLight = vec3( 0.0 ); 2847 #include <logdepthbuf_fragment> 2848 #include <map_fragment> 2849 #include <color_fragment> 2850 outgoingLight = diffuseColor.rgb; 2851 #include <opaque_fragment> 2852 #include <tonemapping_fragment> 2853 #include <colorspace_fragment> 2854 #include <fog_fragment> 2855 #include <premultiplied_alpha_fragment> 2856}`,a3=`#include <common> 2857#include <batching_pars_vertex> 2858#include <uv_pars_vertex> 2859#include <envmap_pars_vertex> 2860#include <color_pars_vertex> 2861#include <fog_pars_vertex> 2862#include <morphtarget_pars_vertex> 2863#include <skinning_pars_vertex> 2864#include <logdepthbuf_pars_vertex> 2865#include <clipping_planes_pars_vertex> 2866void main() { 2867 #include <uv_vertex> 2868 #include <color_vertex> 2869 #include <morphinstance_vertex> 2870 #include <morphcolor_vertex> 2871 #include <batching_vertex> 2872 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2873 #include <beginnormal_vertex> 2874 #include <morphnormal_vertex> 2875 #include <skinbase_vertex> 2876 #include <skinnormal_vertex> 2877 #include <defaultnormal_vertex> 2878 #endif 2879 #include <begin_vertex> 2880 #include <morphtarget_vertex> 2881 #include <skinning_vertex> 2882 #include <project_vertex> 2883 #include <logdepthbuf_vertex> 2884 #include <clipping_planes_vertex> 2885 #include <worldpos_vertex> 2886 #include <envmap_vertex> 2887 #include <fog_vertex> 2888}`,o3=`uniform vec3 diffuse; 2889uniform float opacity; 2890#ifndef FLAT_SHADED 2891 varying vec3 vNormal; 2892#endif 2893#include <common> 2894#include <dithering_pars_fragment> 2895#include <color_pars_fragment> 2896#include <uv_pars_fragment> 2897#include <map_pars_fragment> 2898#include <alphamap_pars_fragment> 2899#include <alphatest_pars_fragment> 2900#include <alphahash_pars_fragment> 2901#include <aomap_pars_fragment> 2902#include <lightmap_pars_fragment> 2903#include <envmap_common_pars_fragment> 2904#include <envmap_pars_fragment> 2905#include <fog_pars_fragment> 2906#include <specularmap_pars_fragment> 2907#include <logdepthbuf_pars_fragment> 2908#include <clipping_planes_pars_fragment> 2909void main() { 2910 vec4 diffuseColor = vec4( diffuse, opacity ); 2911 #include <clipping_planes_fragment> 2912 #include <logdepthbuf_fragment> 2913 #include <map_fragment> 2914 #include <color_fragment> 2915 #include <alphamap_fragment> 2916 #include <alphatest_fragment> 2917 #include <alphahash_fragment> 2918 #include <specularmap_fragment> 2919 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2920 #ifdef USE_LIGHTMAP 2921 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2922 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 2923 #else 2924 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2925 #endif 2926 #include <aomap_fragment> 2927 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2928 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2929 #include <envmap_fragment> 2930 #include <opaque_fragment> 2931 #include <tonemapping_fragment> 2932 #include <colorspace_fragment> 2933 #include <fog_fragment> 2934 #include <premultiplied_alpha_fragment> 2935 #include <dithering_fragment> 2936}`,l3=`#define LAMBERT 2937varying vec3 vViewPosition; 2938#include <common> 2939#include <batching_pars_vertex> 2940#include <uv_pars_vertex> 2941#include <displacementmap_pars_vertex> 2942#include <envmap_pars_vertex> 2943#include <color_pars_vertex> 2944#include <fog_pars_vertex> 2945#include <normal_pars_vertex> 2946#include <morphtarget_pars_vertex> 2947#include <skinning_pars_vertex> 2948#include <shadowmap_pars_vertex> 2949#include <logdepthbuf_pars_vertex> 2950#include <clipping_planes_pars_vertex> 2951void main() { 2952 #include <uv_vertex> 2953 #include <color_vertex> 2954 #include <morphinstance_vertex> 2955 #include <morphcolor_vertex> 2956 #include <batching_vertex> 2957 #include <beginnormal_vertex> 2958 #include <morphnormal_vertex> 2959 #include <skinbase_vertex> 2960 #include <skinnormal_vertex> 2961 #include <defaultnormal_vertex> 2962 #include <normal_vertex> 2963 #include <begin_vertex> 2964 #include <morphtarget_vertex> 2965 #include <skinning_vertex> 2966 #include <displacementmap_vertex> 2967 #include <project_vertex> 2968 #include <logdepthbuf_vertex> 2969 #include <clipping_planes_vertex> 2970 vViewPosition = - mvPosition.xyz; 2971 #include <worldpos_vertex> 2972 #include <envmap_vertex> 2973 #include <shadowmap_vertex> 2974 #include <fog_vertex> 2975}`,c3=`#define LAMBERT 2976uniform vec3 diffuse; 2977uniform vec3 emissive; 2978uniform float opacity; 2979#include <common> 2980#include <dithering_pars_fragment> 2981#include <color_pars_fragment> 2982#include <uv_pars_fragment> 2983#include <map_pars_fragment> 2984#include <alphamap_pars_fragment> 2985#include <alphatest_pars_fragment> 2986#include <alphahash_pars_fragment> 2987#include <aomap_pars_fragment> 2988#include <lightmap_pars_fragment> 2989#include <emissivemap_pars_fragment> 2990#include <cube_uv_reflection_fragment> 2991#include <envmap_common_pars_fragment> 2992#include <envmap_pars_fragment> 2993#include <envmap_physical_pars_fragment> 2994#include <fog_pars_fragment> 2995#include <bsdfs> 2996#include <lights_pars_begin> 2997#include <normal_pars_fragment> 2998#include <lights_lambert_pars_fragment> 2999#include <shadowmap_pars_fragment> 3000#include <bumpmap_pars_fragment> 3001#include <normalmap_pars_fragment> 3002#include <specularmap_pars_fragment> 3003#include <logdepthbuf_pars_fragment> 3004#include <clipping_planes_pars_fragment> 3005void main() { 3006 vec4 diffuseColor = vec4( diffuse, opacity ); 3007 #include <clipping_planes_fragment> 3008 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3009 vec3 totalEmissiveRadiance = emissive; 3010 #include <logdepthbuf_fragment> 3011 #include <map_fragment> 3012 #include <color_fragment> 3013 #include <alphamap_fragment> 3014 #include <alphatest_fragment> 3015 #include <alphahash_fragment> 3016 #include <specularmap_fragment> 3017 #include <normal_fragment_begin> 3018 #include <normal_fragment_maps> 3019 #include <emissivemap_fragment> 3020 #include <lights_lambert_fragment> 3021 #include <lights_fragment_begin> 3022 #include <lights_fragment_maps> 3023 #include <lights_fragment_end> 3024 #include <aomap_fragment> 3025 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3026 #include <envmap_fragment> 3027 #include <opaque_fragment> 3028 #include <tonemapping_fragment> 3029 #include <colorspace_fragment> 3030 #include <fog_fragment> 3031 #include <premultiplied_alpha_fragment> 3032 #include <dithering_fragment> 3033}`,u3=`#define MATCAP 3034varying vec3 vViewPosition; 3035#include <common> 3036#include <batching_pars_vertex> 3037#include <uv_pars_vertex> 3038#include <color_pars_vertex> 3039#include <displacementmap_pars_vertex> 3040#include <fog_pars_vertex> 3041#include <normal_pars_vertex> 3042#include <morphtarget_pars_vertex> 3043#include <skinning_pars_vertex> 3044#include <logdepthbuf_pars_vertex> 3045#include <clipping_planes_pars_vertex> 3046void main() { 3047 #include <uv_vertex> 3048 #include <color_vertex> 3049 #include <morphinstance_vertex> 3050 #include <morphcolor_vertex> 3051 #include <batching_vertex> 3052 #include <beginnormal_vertex> 3053 #include <morphnormal_vertex> 3054 #include <skinbase_vertex> 3055 #include <skinnormal_vertex> 3056 #include <defaultnormal_vertex> 3057 #include <normal_vertex> 3058 #include <begin_vertex> 3059 #include <morphtarget_vertex> 3060 #include <skinning_vertex> 3061 #include <displacementmap_vertex> 3062 #include <project_vertex> 3063 #include <logdepthbuf_vertex> 3064 #include <clipping_planes_vertex> 3065 #include <fog_vertex> 3066 vViewPosition = - mvPosition.xyz; 3067}`,h3=`#define MATCAP 3068uniform vec3 diffuse; 3069uniform float opacity; 3070uniform sampler2D matcap; 3071varying vec3 vViewPosition; 3072#include <common> 3073#include <dithering_pars_fragment> 3074#include <color_pars_fragment> 3075#include <uv_pars_fragment> 3076#include <map_pars_fragment> 3077#include <alphamap_pars_fragment> 3078#include <alphatest_pars_fragment> 3079#include <alphahash_pars_fragment> 3080#include <fog_pars_fragment> 3081#include <normal_pars_fragment> 3082#include <bumpmap_pars_fragment> 3083#include <normalmap_pars_fragme
3083nt> 3084#include <logdepthbuf_pars_fragment> 3085#include <clipping_planes_pars_fragment> 3086void main() { 3087 vec4 diffuseColor = vec4( diffuse, opacity ); 3088 #include <clipping_planes_fragment> 3089 #include <logdepthbuf_fragment> 3090 #include <map_fragment> 3091 #include <color_fragment> 3092 #include <alphamap_fragment> 3093 #include <alphatest_fragment> 3094 #include <alphahash_fragment> 3095 #include <normal_fragment_begin> 3096 #include <normal_fragment_maps> 3097 vec3 viewDir = normalize( vViewPosition ); 3098 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3099 vec3 y = cross( viewDir, x ); 3100 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3101 #ifdef USE_MATCAP 3102 vec4 matcapColor = texture2D( matcap, uv ); 3103 #else 3104 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3105 #endif 3106 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3107 #include <opaque_fragment> 3108 #include <tonemapping_fragment> 3109 #include <colorspace_fragment> 3110 #include <fog_fragment> 3111 #include <premultiplied_alpha_fragment> 3112 #include <dithering_fragment> 3113}`,f3=`#define NORMAL 3114#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3115 varying vec3 vViewPosition; 3116#endif 3117#include <common> 3118#include <batching_pars_vertex> 3119#include <uv_pars_vertex> 3120#include <displacementmap_pars_vertex> 3121#include <normal_pars_vertex> 3122#include <morphtarget_pars_vertex> 3123#include <skinning_pars_vertex> 3124#include <logdepthbuf_pars_vertex> 3125#include <clipping_planes_pars_vertex> 3126void main() { 3127 #include <uv_vertex> 3128 #include <batching_vertex> 3129 #include <beginnormal_vertex> 3130 #include <morphinstance_vertex> 3131 #include <morphnormal_vertex> 3132 #include <skinbase_vertex> 3133 #include <skinnormal_vertex> 3134 #include <defaultnormal_vertex> 3135 #include <normal_vertex> 3136 #include <begin_vertex> 3137 #include <morphtarget_vertex> 3138 #include <skinning_vertex> 3139 #include <displacementmap_vertex> 3140 #include <project_vertex> 3141 #include <logdepthbuf_vertex> 3142 #include <clipping_planes_vertex> 3143#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3144 vViewPosition = - mvPosition.xyz; 3145#endif 3146}`,d3=`#define NORMAL 3147uniform float opacity; 3148#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3149 varying vec3 vViewPosition; 3150#endif 3151#include <uv_pars_fragment> 3152#include <normal_pars_fragment> 3153#include <bumpmap_pars_fragment> 3154#include <normalmap_pars_fragment> 3155#include <logdepthbuf_pars_fragment> 3156#include <clipping_planes_pars_fragment> 3157void main() { 3158 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3159 #include <clipping_planes_fragment> 3160 #include <logdepthbuf_fragment> 3161 #include <normal_fragment_begin> 3162 #include <normal_fragment_maps> 3163 gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); 3164 #ifdef OPAQUE 3165 gl_FragColor.a = 1.0; 3166 #endif 3167}`,p3=`#define PHONG 3168varying vec3 vViewPosition; 3169#include <common> 3170#include <batching_pars_vertex> 3171#include <uv_pars_vertex> 3172#include <displacementmap_pars_vertex> 3173#include <envmap_pars_vertex> 3174#include <color_pars_vertex> 3175#include <fog_pars_vertex> 3176#include <normal_pars_vertex> 3177#include <morphtarget_pars_vertex> 3178#include <skinning_pars_vertex> 3179#include <shadowmap_pars_vertex> 3180#include <logdepthbuf_pars_vertex> 3181#include <clipping_planes_pars_vertex> 3182void main() { 3183 #include <uv_vertex> 3184 #include <color_vertex> 3185 #include <morphcolor_vertex> 3186 #include <batching_vertex> 3187 #include <beginnormal_vertex> 3188 #include <morphinstance_vertex> 3189 #include <morphnormal_vertex> 3190 #include <skinbase_vertex> 3191 #include <skinnormal_vertex> 3192 #include <defaultnormal_vertex> 3193 #include <normal_vertex> 3194 #include <begin_vertex> 3195 #include <morphtarget_vertex> 3196 #include <skinning_vertex> 3197 #include <displacementmap_vertex> 3198 #include <project_vertex> 3199 #include <logdepthbuf_vertex> 3200 #include <clipping_planes_vertex> 3201 vViewPosition = - mvPosition.xyz; 3202 #include <worldpos_vertex> 3203 #include <envmap_vertex> 3204 #include <shadowmap_vertex> 3205 #include <fog_vertex> 3206}`,m3=`#define PHONG 3207uniform vec3 diffuse; 3208uniform vec3 emissive; 3209uniform vec3 specular; 3210uniform float shininess; 3211uniform float opacity; 3212#include <common> 3213#include <dithering_pars_fragment> 3214#include <color_pars_fragment> 3215#include <uv_pars_fragment> 3216#include <map_pars_fragment> 3217#include <alphamap_pars_fragment> 3218#include <alphatest_pars_fragment> 3219#include <alphahash_pars_fragment> 3220#include <aomap_pars_fragment> 3221#include <lightmap_pars_fragment> 3222#include <emissivemap_pars_fragment> 3223#include <cube_uv_reflection_fragment> 3224#include <envmap_common_pars_fragment> 3225#include <envmap_pars_fragment> 3226#include <envmap_physical_pars_fragment> 3227#include <fog_pars_fragment> 3228#include <bsdfs> 3229#include <lights_pars_begin> 3230#include <normal_pars_fragment> 3231#include <lights_phong_pars_fragment> 3232#include <shadowmap_pars_fragment> 3233#include <bumpmap_pars_fragment> 3234#include <normalmap_pars_fragment> 3235#include <specularmap_pars_fragment> 3236#include <logdepthbuf_pars_fragment> 3237#include <clipping_planes_pars_fragment> 3238void main() { 3239 vec4 diffuseColor = vec4( diffuse, opacity ); 3240 #include <clipping_planes_fragment> 3241 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3242 vec3 totalEmissiveRadiance = emissive; 3243 #include <logdepthbuf_fragment> 3244 #include <map_fragment> 3245 #include <color_fragment> 3246 #include <alphamap_fragment> 3247 #include <alphatest_fragment> 3248 #include <alphahash_fragment> 3249 #include <specularmap_fragment> 3250 #include <normal_fragment_begin> 3251 #include <normal_fragment_maps> 3252 #include <emissivemap_fragment> 3253 #include <lights_phong_fragment> 3254 #include <lights_fragment_begin> 3255 #include <lights_fragment_maps> 3256 #include <lights_fragment_end> 3257 #include <aomap_fragment> 3258 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3259 #include <envmap_fragment> 3260 #include <opaque_fragment> 3261 #include <tonemapping_fragment> 3262 #include <colorspace_fragment> 3263 #include <fog_fragment> 3264 #include <premultiplied_alpha_fragment> 3265 #include <dithering_fragment> 3266}`,g3=`#define STANDARD 3267varying vec3 vViewPosition; 3268#ifdef USE_TRANSMISSION 3269 varying vec3 vWorldPosition; 3270#endif 3271#include <common> 3272#include <batching_pars_vertex> 3273#include <uv_pars_vertex> 3274#include <displacementmap_pars_vertex> 3275#include <color_pars_vertex> 3276#include <fog_pars_vertex> 3277#include <normal_pars_vertex> 3278#include <morphtarget_pars_vertex> 3279#include <skinning_pars_vertex> 3280#include <shadowmap_pars_vertex> 3281#include <logdepthbuf_pars_vertex> 3282#include <clipping_planes_pars_vertex> 3283void main() { 3284 #include <uv_vertex> 3285 #include <color_vertex> 3286 #include <morphinstance_vertex> 3287 #include <morphcolor_vertex> 3288 #include <batching_vertex> 3289 #include <beginnormal_vertex> 3290 #include <morphnormal_vertex> 3291 #include <skinbase_vertex> 3292 #include <skinnormal_vertex> 3293 #include <defaultnormal_vertex> 3294 #include <normal_vertex> 3295 #include <begin_vertex> 3296 #include <morphtarget_vertex> 3297 #include <skinning_vertex> 3298 #include <displacementmap_vertex> 3299 #include <project_vertex> 3300 #include <logdepthbuf_vertex> 3301 #include <clipping_planes_vertex> 3302 vViewPosition = - mvPosition.xyz; 3303 #include <worldpos_vertex> 3304 #include <shadowmap_vertex> 3305 #include <fog_vertex> 3306#ifdef USE_TRANSMISSION 3307 vWorldPosition = worldPosition.xyz; 3308#endif 3309}`,v3=`#define STANDARD 3310#ifdef PHYSICAL 3311 #define IOR 3312 #define USE_SPECULAR 3313#endif 3314uniform vec3 diffuse; 3315uniform vec3 emissive; 3316uniform float roughness; 3317uniform float metalness; 3318uniform float opacity; 3319#ifdef IOR 3320 uniform float ior; 3321#endif 3322#ifdef USE_SPECULAR 3323 uniform float specularIntensity; 3324 uniform vec3 specularColor; 3325 #ifdef USE_SPECULAR_COLORMAP 3326 uniform sampler2D specularColorMap; 3327 #endif 3328 #ifdef USE_SPECULAR_INTENSITYMAP 3329 uniform sampler2D specularIntensityMap; 3330 #endif 3331#endif 3332#ifdef USE_CLEARCOAT 3333 uniform float clearcoat; 3334 uniform float clearcoatRoughness; 3335#endif 3336#ifdef USE_DISPERSION 3337 uniform float dispersion; 3338#endif
3339#ifdef USE_IRIDESCENCE 3340 uniform float iridescence; 3341 uniform float iridescenceIOR; 3342 uniform float iridescenceThicknessMinimum; 3343 uniform float iridescenceThicknessMaximum; 3344#endif 3345#ifdef USE_SHEEN 3346 uniform vec3 sheenColor; 3347 uniform float sheenRoughness; 3348 #ifdef USE_SHEEN_COLORMAP 3349 uniform sampler2D sheenColorMap; 3350 #endif 3351 #ifdef USE_SHEEN_ROUGHNESSMAP 3352 uniform sampler2D sheenRoughnessMap; 3353 #endif 3354#endif 3355#ifdef USE_ANISOTROPY 3356 uniform vec2 anisotropyVector; 3357 #ifdef USE_ANISOTROPYMAP 3358 uniform sampler2D anisotropyMap; 3359 #endif 3360#endif 3361varying vec3 vViewPosition; 3362#include <common> 3363#include <dithering_pars_fragment> 3364#include <color_pars_fragment> 3365#include <uv_pars_fragment> 3366#include <map_pars_fragment> 3367#include <alphamap_pars_fragment> 3368#include <alphatest_pars_fragment> 3369#include <alphahash_pars_fragment> 3370#include <aomap_pars_fragment> 3371#include <lightmap_pars_fragment> 3372#include <emissivemap_pars_fragment> 3373#include <iridescence_fragment> 3374#include <cube_uv_reflection_fragment> 3375#include <envmap_common_pars_fragment> 3376#include <envmap_physical_pars_fragment> 3377#include <fog_pars_fragment> 3378#include <lights_pars_begin> 3379#include <normal_pars_fragment> 3380#include <lights_physical_pars_fragment> 3381#include <transmission_pars_fragment> 3382#include <shadowmap_pars_fragment> 3383#include <bumpmap_pars_fragment> 3384#include <normalmap_pars_fragment> 3385#include <clearcoat_pars_fragment> 3386#include <iridescence_pars_fragment> 3387#include <roughnessmap_pars_fragment> 3388#include <metalnessmap_pars_fragment> 3389#include <logdepthbuf_pars_fragment> 3390#include <clipping_planes_pars_fragment> 3391void main() { 3392 vec4 diffuseColor = vec4( diffuse, opacity ); 3393 #include <clipping_planes_fragment> 3394 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3395 vec3 totalEmissiveRadiance = emissive; 3396 #include <logdepthbuf_fragment> 3397 #include <map_fragment> 3398 #include <color_fragment> 3399 #include <alphamap_fragment> 3400 #include <alphatest_fragment> 3401 #include <alphahash_fragment> 3402 #include <roughnessmap_fragment> 3403 #include <metalnessmap_fragment> 3404 #include <normal_fragment_begin> 3405 #include <normal_fragment_maps> 3406 #include <clearcoat_normal_fragment_begin> 3407 #include <clearcoat_normal_fragment_maps> 3408 #include <emissivemap_fragment> 3409 #include <lights_physical_fragment> 3410 #include <lights_fragment_begin> 3411 #include <lights_fragment_maps> 3412 #include <lights_fragment_end> 3413 #include <aomap_fragment> 3414 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3415 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3416 #include <transmission_fragment> 3417 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3418 #ifdef USE_SHEEN 3419 3420 outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; 3421 3422 #endif 3423 #ifdef USE_CLEARCOAT 3424 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3425 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3426 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3427 #endif 3428 #include <opaque_fragment> 3429 #include <tonemapping_fragment> 3430 #include <colorspace_fragment> 3431 #include <fog_fragment> 3432 #include <premultiplied_alpha_fragment> 3433 #include <dithering_fragment> 3434}`,x3=`#define TOON 3435varying vec3 vViewPosition; 3436#include <common> 3437#include <batching_pars_vertex> 3438#include <uv_pars_vertex> 3439#include <displacementmap_pars_vertex> 3440#include <color_pars_vertex> 3441#include <fog_pars_vertex> 3442#include <normal_pars_vertex> 3443#include <morphtarget_pars_vertex> 3444#include <skinning_pars_vertex> 3445#include <shadowmap_pars_vertex> 3446#include <logdepthbuf_pars_vertex> 3447#include <clipping_planes_pars_vertex> 3448void main() { 3449 #include <uv_vertex> 3450 #include <color_vertex> 3451 #include <morphinstance_vertex> 3452 #include <morphcolor_vertex> 3453 #include <batching_vertex> 3454 #include <beginnormal_vertex> 3455 #include <morphnormal_vertex> 3456 #include <skinbase_vertex> 3457 #include <skinnormal_vertex> 3458 #include <defaultnormal_vertex> 3459 #include <normal_vertex> 3460 #include <begin_vertex> 3461 #include <morphtarget_vertex> 3462 #include <skinning_vertex> 3463 #include <displacementmap_vertex> 3464 #include <project_vertex> 3465 #include <logdepthbuf_vertex> 3466 #include <clipping_planes_vertex> 3467 vViewPosition = - mvPosition.xyz; 3468 #include <worldpos_vertex> 3469 #include <shadowmap_vertex> 3470 #include <fog_vertex> 3471}`,_3=`#define TOON 3472uniform vec3 diffuse; 3473uniform vec3 emissive; 3474uniform float opacity; 3475#include <common> 3476#include <dithering_pars_fragment> 3477#include <color_pars_fragment> 3478#include <uv_pars_fragment> 3479#include <map_pars_fragment> 3480#include <alphamap_pars_fragment> 3481#include <alphatest_pars_fragment> 3482#include <alphahash_pars_fragment> 3483#include <aomap_pars_fragment> 3484#include <lightmap_pars_fragment> 3485#include <emissivemap_pars_fragment> 3486#include <gradientmap_pars_fragment> 3487#include <fog_pars_fragment> 3488#include <bsdfs> 3489#include <lights_pars_begin> 3490#include <normal_pars_fragment> 3491#include <lights_toon_pars_fragment> 3492#include <shadowmap_pars_fragment> 3493#include <bumpmap_pars_fragment> 3494#include <normalmap_pars_fragment> 3495#include <logdepthbuf_pars_fragment> 3496#include <clipping_planes_pars_fragment> 3497void main() { 3498 vec4 diffuseColor = vec4( diffuse, opacity ); 3499 #include <clipping_planes_fragment> 3500 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3501 vec3 totalEmissiveRadiance = emissive; 3502 #include <logdepthbuf_fragment> 3503 #include <map_fragment> 3504 #include <color_fragment> 3505 #include <alphamap_fragment> 3506 #include <alphatest_fragment> 3507 #include <alphahash_fragment> 3508 #include <normal_fragment_begin> 3509 #include <normal_fragment_maps> 3510 #include <emissivemap_fragment> 3511 #include <lights_toon_fragment> 3512 #include <lights_fragment_begin> 3513 #include <lights_fragment_maps> 3514 #include <lights_fragment_end> 3515 #include <aomap_fragment> 3516 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3517 #include <opaque_fragment> 3518 #include <tonemapping_fragment> 3519 #include <colorspace_fragment> 3520 #include <fog_fragment> 3521 #include <premultiplied_alpha_fragment> 3522 #include <dithering_fragment> 3523}`,y3=`uniform float size; 3524uniform float scale; 3525#include <common> 3526#include <color_pars_vertex> 3527#include <fog_pars_vertex> 3528#include <morphtarget_pars_vertex> 3529#include <logdepthbuf_pars_vertex> 3530#include <clipping_planes_pars_vertex> 3531#ifdef USE_POINTS_UV 3532 varying vec2 vUv; 3533 uniform mat3 uvTransform; 3534#endif 3535void main() { 3536 #ifdef USE_POINTS_UV 3537 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3538 #endif 3539 #include <color_vertex> 3540 #include <morphinstance_vertex> 3541 #include <morphcolor_vertex> 3542 #include <begin_vertex> 3543 #include <morphtarget_vertex> 3544 #include <project_vertex> 3545 gl_PointSize = size; 3546 #ifdef USE_SIZEATTENUATION 3547 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3548 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3549 #endif 3550 #include <logdepthbuf_vertex> 3551 #include <clipping_planes_vertex> 3552 #include <worldpos_vertex> 3553 #include <fog_vertex> 3554}`,S3=`uniform vec3 diffuse; 3555uniform float opacity; 3556#include <common> 3557#include <color_pars_fragment> 3558#include <map_particle_pars_fragment> 3559#include <alphatest_pars_fragment> 3560#include <alphahash_pars_fragment> 3561#include <fog_pars_fragment> 3562#include <logdepthbuf_pars_fragment> 3563#include <clipping_planes_pars_fragment> 3564void main() { 3565 vec4 diffuseColor = vec4( diffuse, opacity ); 3566 #include <clipping_planes_fragment> 3567 vec3 outgoingLight = vec3( 0.0 ); 3568 #include <logdepthbuf_fragment> 3569 #include <map_particle_fragment> 3570 #include <color_fragment> 3571 #include <alphatest_fragment> 3572 #include <alphahash_fragment> 3573 outgoingLight = diffuseColor.rgb; 3574 #include <opaque_fragment> 3575 #include <tonemapping_fragment> 3576 #include <colorspace_fragment> 3577 #include <fog_fragment> 3578 #include <premultiplied_alpha_fragment> 3579}`,b3=`#include <common> 3580#include <batching_pars_vertex> 3581#include <fog_pars_vertex> 3582#include <morphtarget_pars_vertex> 3583#include <skinning_pars_vertex> 3584#include <logdepthbuf_pars_vertex> 3585#include <shadowmap_pars_vertex> 3586void main() { 3587 #include <batching_vertex> 3588 #include <beginnormal_vertex> 3589 #include <morphinstance_vertex> 3590 #include <morphnormal_vertex> 3591 #include <skinbase_vertex> 3592 #include <skinnormal_vertex> 3593 #include <defaultnormal_vertex> 3594 #include <begin_vertex> 3595 #include <morphtarget_vertex> 3596 #include <skinning_vertex> 3597 #include <project_vertex> 3598 #include <logdepthbuf_vertex> 3599 #include <worldpos_vertex> 3600 #include <shadowmap_vertex> 3601 #include <fog_vertex> 3602}`,M3=`uniform vec3 color; 3603uniform float opacity; 3604#include <common> 3605#include <fog_pars_fragment> 3606#include <bsdfs> 3607#include <lights_pars_begin> 3608#include <logdepthbuf_pars_fragment> 3609#include <shadowmap_pars_fragment> 3610#include <shadowmask_pars_fragment> 3611void main() { 3612 #include <logdepthbuf_fragment> 3613 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3614 #include <tonemapping_fragment> 3615 #include <colorspace_fragment> 3616 #include <fog_fragment> 3617 #include <premultiplied_alpha_fragment> 3618}`,E3=`uniform float rotation; 3619uniform vec2 center; 3620#include <common> 3621#include <uv_pars_vertex> 3622#include <fog_pars_vertex> 3623#include <logdepthbuf_pars_vertex> 3624#include <clipping_planes_pars_vertex> 3625void main() { 3626 #include <uv_vertex> 3627 vec4 mvPosition = modelViewMatrix[ 3 ]; 3628 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3629 #ifndef USE_SIZEATTENUATION 3630 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3631 if ( isPerspective ) scale *= - mvPosition.z; 3632 #endif 3633 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3634 vec2 rotatedPosition; 3635 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3636 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3637 mvPosition.xy += rotatedPosition; 3638 gl_Position = projectionMatrix * mvPosition; 3639 #include <logdepthbuf_vertex> 3640 #include <clipping_planes_vertex> 3641 #include <fog_vertex> 3642}`,T3=`uniform vec3 diffuse; 3643uniform float opacity; 3644#include <common> 3645#include <uv_pars_fragment> 3646#include <map_pars_fragment> 3647#include <alphamap_pars_fragment> 3648#include <alphatest_pars_fragment> 3649#include <alphahash_pars_fragment> 3650#include <fog_pars_fragment> 3651#include <logdepthbuf_pars_fragment> 3652#include <clipping_planes_pars_fragment> 3653void main() { 3654 vec4 diffuseColor = vec4( diffuse, opacity ); 3655 #include <clipping_planes_fragment> 3656 vec3 outgoingLight = vec3( 0.0 ); 3657 #include <logdepthbuf_fragment> 3658 #include <map_fragment> 3659 #include <alphamap_fragment> 3660 #include <alphatest_fragment> 3661 #include <alphahash_fragment> 3662 outgoingLight = diffuseColor.rgb; 3663 #include <opaque_fragment> 3664 #include <tonemapping_fragment> 3665 #include <colorspace_fragment> 3666 #include <fog_fragment> 3667}`,At={alphahash_fragment:qA,alphahash_pars_fragment:YA,alphamap_fragment:jA,alphamap_pars_fragment:$A,alphatest_fragment:ZA,alphatest_pars_fragment:KA,aomap_fragment:JA,aomap_pars_fragment:QA,batching_pars_vertex:eC,batching_vertex:tC,begin_vertex:nC,beginnormal_vertex:iC,bsdfs:sC,iridescence_fragment:rC,bumpmap_pars_fragment:aC,clipping_planes_fragment:oC,clipping_planes_pars_fragment:lC,clipping_planes_pars_vertex:cC,clipping_planes_vertex:uC,color_fragment:hC,color_pars_fragment:fC,color_pars_vertex:dC,color_vertex:pC,common:mC,cube_uv_reflection_fragment:gC,defaultnormal_vertex:vC,displacementmap_pars_vertex:xC,displacementmap_vertex:_C,emissivemap_fragment:yC,emissivemap_pars_fragment:SC,colorspace_fragment:bC,colorspace_pars_fragment:MC,envmap_fragment:EC,envmap_common_pars_fragment:TC,envmap_pars_fragment:wC,envmap_pars_vertex:AC,envmap_physical_pars_fragment:BC,envmap_vertex:CC,fog_vertex:RC,fog_pars_vertex:IC,fog_fragment:PC,fog_pars_fragment:LC,gradientmap_pars_fragment:DC,lightmap_pars_fragment:NC,lights_lambert_fragment:UC,lights_lambert_pars_fragment:FC,lights_pars_begin:OC,lights_toon_fragment:zC,lights_toon_pars_fragment:kC,lights_phong_fragment:VC,lights_phong_pars_fragment:HC,lights_physical_fragment:GC,lights_physical_pars_fragment:WC,lights_fragment_begin:XC,lights_fragment_maps:qC,lights_fragment_end:YC,lightprobes_pars_fragment:jC,logdepthbuf_fragment:$C,logdepthbuf_pars_fragment:ZC,logdepthbuf_pars_vertex:KC,logdepthbuf_vertex:JC,map_fragment:QC,map_pars_fragment:eR,map_particle_fragment:tR,map_particle_pars_fragment:nR,metalnessmap_fragment:iR,metalnessmap_pars_fragment:sR,morphinstance_vertex:rR,morphcolor_vertex:aR,morphnormal_vertex:oR,morphtarget_pars_vertex:lR,morphtarget_vertex:cR,normal_fragment_begin:uR,normal_fragment_maps:h
vendor: 10,912 bytes, line 3667
3667R,normal_pars_fragment:fR,normal_pars_vertex:dR,normal_vertex:pR,normalmap_pars_fragment:mR,clearcoat_normal_fragment_begin:gR,clearcoat_normal_fragment_maps:vR,clearcoat_pars_fragment:xR,iridescence_pars_fragment:_R,opaque_fragment:yR,packing:SR,premultiplied_alpha_fragment:bR,project_vertex:MR,dithering_fragment:ER,dithering_pars_fragment:TR,roughnessmap_fragment:wR,roughnessmap_pars_fragment:AR,shadowmap_pars_fragment:CR,shadowmap_pars_vertex:RR,shadowmap_vertex:IR,shadowmask_pars_fragment:PR,skinbase_vertex:LR,skinning_pars_vertex:DR,skinning_vertex:NR,skinnormal_vertex:UR,specularmap_fragment:FR,specularmap_pars_fragment:OR,tonemapping_fragment:BR,tonemapping_pars_fragment:zR,transmission_fragment:kR,transmission_pars_fragment:VR,uv_pars_fragment:HR,uv_pars_vertex:GR,uv_vertex:WR,worldpos_vertex:XR,background_vert:qR,background_frag:YR,backgroundCube_vert:jR,backgroundCube_frag:$R,cube_vert:ZR,cube_frag:KR,depth_vert:JR,depth_frag:QR,distance_vert:e3,distance_frag:t3,equirect_vert:n3,equirect_frag:i3,linedashed_vert:s3,linedashed_frag:r3,meshbasic_vert:a3,meshbasic_frag:o3,meshlambert_vert:l3,meshlambert_frag:c3,meshmatcap_vert:u3,meshmatcap_frag:h3,meshnormal_vert:f3,meshnormal_frag:d3,meshphong_vert:p3,meshphong_frag:m3,meshphysical_vert:g3,meshphysical_frag:v3,meshtoon_vert:x3,meshtoon_frag:_3,points_vert:y3,points_frag:S3,shadow_vert:b3,shadow_frag:M3,sprite_vert:E3,sprite_frag:T3},Oe={common:{diffuse:{value:new Ve(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new xt},alphaMap:{value:null},alphaMapTransform:{value:new xt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new xt}},envmap:{envMap:{value:null},envMapRotation:{value:new xt},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new xt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new xt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new xt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new xt},normalScale:{value:new ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new xt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new xt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new xt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new xt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ve(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new B},probesMax:{value:new B},probesResolution:{value:new B}},points:{diffuse:{value:new Ve(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new xt},alphaTest:{value:0},uvTransform:{value:new xt}},sprite:{diffuse:{value:new Ve(16777215)},opacity:{value:1},center:{value:new ae(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new xt},alphaMap:{value:null},alphaMapTransform:{value:new xt},alphaTest:{value:0}}},ls={basic:{uniforms:ci([Oe.common,Oe.specularmap,Oe.envmap,Oe.aomap,Oe.lightmap,Oe.fog]),vertexShader:At.meshbasic_vert,fragmentShader:At.meshbasic_frag},lambert:{uniforms:ci([Oe.common,Oe.specularmap,Oe.envmap,Oe.aomap,Oe.lightmap,Oe.emissivemap,Oe.bumpmap,Oe.normalmap,Oe.displacementmap,Oe.fog,Oe.lights,{emissive:{value:new Ve(0)},envMapIntensity:{value:1}}]),vertexShader:At.meshlambert_vert,fragmentShader:At.meshlambert_frag},phong:{uniforms:ci([Oe.common,Oe.specularmap,Oe.envmap,Oe.aomap,Oe.lightmap,Oe.emissivemap,Oe.bumpmap,Oe.normalmap,Oe.displacementmap,Oe.fog,Oe.lights,{emissive:{value:new Ve(0)},specular:{value:new Ve(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:At.meshphong_vert,fragmentShader:At.meshphong_frag},standard:{uniforms:ci([Oe.common,Oe.envmap,Oe.aomap,Oe.lightmap,Oe.emissivemap,Oe.bumpmap,Oe.normalmap,Oe.displacementmap,Oe.roughnessmap,Oe.metalnessmap,Oe.fog,Oe.lights,{emissive:{value:new Ve(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:At.meshphysical_vert,fragmentShader:At.meshphysical_frag},toon:{uniforms:ci([Oe.common,Oe.aomap,Oe.lightmap,Oe.emissivemap,Oe.bumpmap,Oe.normalmap,Oe.displacementmap,Oe.gradientmap,Oe.fog,Oe.lights,{emissive:{value:new Ve(0)}}]),vertexShader:At.meshtoon_vert,fragmentShader:At.meshtoon_frag},matcap:{uniforms:ci([Oe.common,Oe.bumpmap,Oe.normalmap,Oe.displacementmap,Oe.fog,{matcap:{value:null}}]),vertexShader:At.meshmatcap_vert,fragmentShader:At.meshmatcap_frag},points:{uniforms:ci([Oe.points,Oe.fog]),vertexShader:At.points_vert,fragmentShader:At.points_frag},dashed:{uniforms:ci([Oe.common,Oe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:At.linedashed_vert,fragmentShader:At.linedashed_frag},depth:{uniforms:ci([Oe.common,Oe.displacementmap]),vertexShader:At.depth_vert,fragmentShader:At.depth_frag},normal:{uniforms:ci([Oe.common,Oe.bumpmap,Oe.normalmap,Oe.displacementmap,{opacity:{value:1}}]),vertexShader:At.meshnormal_vert,fragmentShader:At.meshnormal_frag},sprite:{uniforms:ci([Oe.sprite,Oe.fog]),vertexShader:At.sprite_vert,fragmentShader:At.sprite_frag},background:{uniforms:{uvTransform:{value:new xt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:At.background_vert,fragmentShader:At.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new xt}},vertexShader:At.backgroundCube_vert,fragmentShader:At.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:At.cube_vert,fragmentShader:At.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:At.equirect_vert,fragmentShader:At.equirect_frag},distance:{uniforms:ci([Oe.common,Oe.displacementmap,{referencePosition:{value:new B},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:At.distance_vert,fragmentShader:At.distance_frag},shadow:{uniforms:ci([Oe.lights,Oe.fog,{color:{value:new Ve(0)},opacity:{value:1}}]),vertexShader:At.shadow_vert,fragmentShader:At.shadow_frag}};ls.physical={uniforms:ci([ls.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new xt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new xt},clearcoatNormalScale:{value:new ae(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new xt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new xt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new xt},sheen:{value:0},sheenColor:{value:new Ve(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new xt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new xt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new xt},transmissionSamplerSize:{value:new ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new xt},attenuationDistance:{value:0},attenuationColor:{value:new Ve(0)},specularColor:{value:new Ve(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new xt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new xt},anisotropyVector:{value:new ae},anisotropyMap:{value:null},anisotropyMapTransform:{value:new xt}}]),vertexShader:At.meshphysical_vert,fragmentShader:At.meshphysical_frag};const gh={r:0,b:0,g:0},w3=new mt,QS=new xt;QS.set(-1,0,0,0,1,0,0,0,1);function A3(i,e,t,n,s,o){const l=new Ve(0);let c=s===!0?0:1,h,f,p=null,g=0,m=null;function v(M){let T=M.isScene===!0?M.background:null;if(T&&T.isTexture){const A=M.backgroundBlurriness>0;T=e.get(T,A)}return T}function y(M){let T=!1;const A=v(M);A===null?S(l,c):A&&A.isColor&&(S(A,1),T=!0);const D=i.xr.getEnvironmentBlendMode();D==="additive"?t.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,o),(i.autoClear||T)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function E(M,T){const A=v(T);A&&(A.isCubeTexture||A.mapping===Ko)?(f===void 0&&(f=new Mn(new La(1,1,1),new En({name:"BackgroundCubeMaterial",uniforms:jo(ls.backgroundCube.uniforms),vertexShader:ls.backgroundCube.vertexShader,fragmentShader:ls.backgroundCube.fragmentShader,side:Nn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(D,R,F){this.matrixWorld.copyPosition(F.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(f)),f.material.uniforms.envMap.value=A,f.material.uniforms.backgroundBlurriness.value=T.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,f.material.uniforms.backgroundRotation.value.setFromMatrix4(w3.makeRotationFromEuler(T.backgroundRotation)).transpose(),A.isCubeTexture&&A.isRenderTargetTexture===!1&&f.material.uniforms.backgroundRotation.value.premultiply(QS),f.material.toneMapped=It.getTransfer(A.colorSpace)!==Jt,(p!==A||g!==A.version||m!==i.toneMapping)&&(f.material.needsUpdate=!0,p=A,g=A.version,m=i.toneMapping),f.layers.enableAll(),M.unshift(f,f.geometry,f.material,0,0,null)):A&&A.isTexture&&(h===void 0&&(h=new Mn(new el(2,2),new En({name:"Backgroun
3667dMaterial",uniforms:jo(ls.background.uniforms),vertexShader:ls.background.vertexShader,fragmentShader:ls.background.fragmentShader,side:Is,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(h)),h.material.uniforms.t2D.value=A,h.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,h.material.toneMapped=It.getTransfer(A.colorSpace)!==Jt,A.matrixAutoUpdate===!0&&A.updateMatrix(),h.material.uniforms.uvTransform.value.copy(A.matrix),(p!==A||g!==A.version||m!==i.toneMapping)&&(h.material.needsUpdate=!0,p=A,g=A.version,m=i.toneMapping),h.layers.enableAll(),M.unshift(h,h.geometry,h.material,0,0,null))}function S(M,T){M.getRGB(gh,yS(i)),t.buffers.color.setClear(gh.r,gh.g,gh.b,T,o)}function _(){f!==void 0&&(f.geometry.dispose(),f.material.dispose(),f=void 0),h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0)}return{getClearColor:function(){return l},setClearColor:function(M,T=1){l.set(M),c=T,S(l,c)},getClearAlpha:function(){return c},setClearAlpha:function(M){c=M,S(l,c)},render:y,addToRenderList:E,dispose:_}}function C3(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=m(null);let o=s,l=!1;function c(O,H,W,Z,V){let $=!1;const K=g(O,Z,W,H);o!==K&&(o=K,f(o.object)),$=v(O,Z,W,V),$&&y(O,Z,W,V),V!==null&&e.update(V,i.ELEMENT_ARRAY_BUFFER),($||l)&&(l=!1,A(O,H,W,Z),V!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(V).buffer))}function h(){return i.createVertexArray()}function f(O){return i.bindVertexArray(O)}function p(O){return i.deleteVertexArray(O)}function g(O,H,W,Z){const V=Z.wireframe===!0;let $=n[H.id];$===void 0&&($={},n[H.id]=$);const K=O.isInstancedMesh===!0?O.id:0;let he=$[K];he===void 0&&(he={},$[K]=he);let ce=he[W.id];ce===void 0&&(ce={},he[W.id]=ce);let ye=ce[V];return ye===void 0&&(ye=m(h()),ce[V]=ye),ye}function m(O){const H=[],W=[],Z=[];for(let V=0;V<t;V++)H[V]=0,W[V]=0,Z[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:H,enabledAttributes:W,attributeDivisors:Z,object:O,attributes:{},index:null}}function v(O,H,W,Z){const V=o.attributes,$=H.attributes;let K=0;const he=W.getAttributes();for(const ce in he)if(he[ce].location>=0){const ge=V[ce];let we=$[ce];if(we===void 0&&(ce==="instanceMatrix"&&O.instanceMatrix&&(we=O.instanceMatrix),ce==="instanceColor"&&O.instanceColor&&(we=O.instanceColor)),ge===void 0||ge.attribute!==we||we&&ge.data!==we.data)return!0;K++}return o.attributesNum!==K||o.index!==Z}function y(O,H,W,Z){const V={},$=H.attributes;let K=0;const he=W.getAttributes();for(const ce in he)if(he[ce].location>=0){let ge=$[ce];ge===void 0&&(ce==="instanceMatrix"&&O.instanceMatrix&&(ge=O.instanceMatrix),ce==="instanceColor"&&O.instanceColor&&(ge=O.instanceColor));const we={};we.attribute=ge,ge&&ge.data&&(we.data=ge.data),V[ce]=we,K++}o.attributes=V,o.attributesNum=K,o.index=Z}function E(){const O=o.newAttributes;for(let H=0,W=O.length;H<W;H++)O[H]=0}function S(O){_(O,0)}function _(O,H){const W=o.newAttributes,Z=o.enabledAttributes,V=o.attributeDivisors;W[O]=1,Z[O]===0&&(i.enableVertexAttribArray(O),Z[O]=1),V[O]!==H&&(i.vertexAttribDivisor(O,H),V[O]=H)}function M(){const O=o.newAttributes,H=o.enabledAttributes;for(let W=0,Z=H.length;W<Z;W++)H[W]!==O[W]&&(i.disableVertexAttribArray(W),H[W]=0)}function T(O,H,W,Z,V,$,K){K===!0?i.vertexAttribIPointer(O,H,W,V,$):i.vertexAttribPointer(O,H,W,Z,V,$)}function A(O,H,W,Z){E();const V=Z.attributes,$=W.getAttributes(),K=H.defaultAttributeValues;for(const he in $){const ce=$[he];if(ce.location>=0){let ye=V[he];if(ye===void 0&&(he==="instanceMatrix"&&O.instanceMatrix&&(ye=O.instanceMatrix),he==="instanceColor"&&O.instanceColor&&(ye=O.instanceColor)),ye!==void 0){const ge=ye.normalized,we=ye.itemSize,nt=e.get(ye);if(nt===void 0)continue;const st=nt.buffer,rt=nt.type,oe=nt.bytesPerElement,Ue=rt===i.INT||rt===i.UNSIGNED_INT||ye.gpuType===bf;if(ye.isInterleavedBufferAttribute){const Se=ye.data,We=Se.stride,ot=ye.offset;if(Se.isInstancedInterleavedBuffer){for(let at=0;at<ce.locationSize;at++)_(ce.location+at,Se.meshPerAttribute);O.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=Se.meshPerAttribute*Se.count)}else for(let at=0;at<ce.locationSize;
3667at++)S(ce.location+at);i.bindBuffer(i.ARRAY_BUFFER,st);for(let at=0;at<ce.locationSize;at++)T(ce.location+at,we/ce.locationSize,rt,ge,We*oe,(ot+we/ce.locationSize*at)*oe,Ue)}else{if(ye.isInstancedBufferAttribute){for(let Se=0;Se<ce.locationSize;Se++)_(ce.location+Se,ye.meshPerAttribute);O.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=ye.meshPerAttribute*ye.count)}else for(let Se=0;Se<ce.locationSize;Se++)S(ce.location+Se);i.bindBuffer(i.ARRAY_BUFFER,st);for(let Se=0;Se<ce.locationSize;Se++)T(ce.location+Se,we/ce.locationSize,rt,ge,we*oe,we/ce.locationSize*Se*oe,Ue)}}else if(K!==void 0){const ge=K[he];if(ge!==void 0)switch(ge.length){case 2:i.vertexAttrib2fv(ce.location,ge);break;case 3:i.vertexAttrib3fv(ce.location,ge);break;case 4:i.vertexAttrib4fv(ce.location,ge);break;default:i.vertexAttrib1fv(ce.location,ge)}}}}M()}function D(){L();for(const O in n){const H=n[O];for(const W in H){const Z=H[W];for(const V in Z){const $=Z[V];for(const K in $)p($[K].object),delete $[K];delete Z[V]}}delete n[O]}}function R(O){if(n[O.id]===void 0)return;const H=n[O.id];for(const W in H){const Z=H[W];for(const V in Z){const $=Z[V];for(const K in $)p($[K].object),delete $[K];delete Z[V]}}delete n[O.id]}function F(O){for(const H in n){const W=n[H];for(const Z in W){const V=W[Z];if(V[O.id]===void 0)continue;const $=V[O.id];for(const K in $)p($[K].object),delete $[K];delete V[O.id]}}}function w(O){for(const H in n){const W=n[H],Z=O.isInstancedMesh===!0?O.id:0,V=W[Z];if(V!==void 0){for(const $ in V){const K=V[$];for(const he in K)p(K[he].object),delete K[he];delete V[$]}delete W[Z],Object.keys(W).length===0&&delete n[H]}}}function L(){U(),l=!0,o!==s&&(o=s,f(o.object))}function U(){s.geometry=null,s.program=null,s.wireframe=!1}return{setup:c,reset:L,resetDefaultState:U,dispose:D,releaseStatesOfGeometry:R,releaseStatesOfObject:w,releaseStatesOfProgram:F,initAttributes:E,enableAttribute:S,disableUnusedAttributes:M}}function R3(i,e,t){let n;function s(h){n=h}function o(h,f){i.drawArrays(n,h,f),t.update(f,n,1)}function l(h,f,p){p!==0&&(i.drawArraysInstanced(n,h,f,p),t.update(f,n,p))}function c(h,f,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,h,0,f,0,p);let m=0;for(let v=0;v<p;v++)m+=f[v];t.update(m,n,1)}this.setMode=s,this.render=o,this.renderInstances=l,this.renderMultiDraw=c}function I3(i,e,t,n){let s;function o(){if(s!==void 0)return s;if(e.has("EXT_texture_filter_anisotropic")===!0){const F=e.get("EXT_texture_filter_anisotropic");s=i.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else s=0;return s}function l(F){return!(F!==ii&&n.convert(F)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function c(F){const w=F===fs&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(F!==yn&&n.convert(F)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&F!==Yn&&!w)}function h(F){if(F==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";F="mediump"}return F==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let f=t.precision!==void 0?t.precision:"highp";const p=h(f);p!==f&&(De("WebGLRenderer:",f,"not supported, using",p,"instead."),f=p);const g=t.logarithmicDepthBuffer===!0,m=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control");t.reversedDepthBuffer===!0&&m===!1&&De("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const v=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),y=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),E=i.getParameter(i.MAX_TEXTURE_SIZE),S=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),_=i.getParameter(i.MAX_VERTEX_ATTRIBS),M=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),T=i.getParameter(i.MAX_VARYING_VECTORS),A=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),D=i.getParameter(i.MAX_SAMPLES),R=i.getParameter(i.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:h,textureFormatReadable:l,textureTypeReadable:c,precision:f,logarithmicDepthBuffer:g,reversedDepthBuffer:m,maxTextures:v,maxVertexTextures:y,maxTextureSize:E,maxCubemapSize:S,maxAttributes:_,maxVertexUniforms:M,maxVaryings:T,maxFragmentUniforms:A,maxSamples:D,samples:R}}function P3(i){const e=this;let t=null,n=0,s=!1,o=!1;const l=new Rr,c=new xt,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(g,m){const v=g.length!==0||m||n!==0||s;return s=m,n=g.length,v},this.beginShadows=function(){o=!0,p(null)},this.endShadows=function(){o=!1}
vendor: 4,241 bytes, line 3667
3667,this.setGlobalState=function(g,m){t=p(g,m,0)},this.setState=function(g,m,v){const y=g.clippingPlanes,E=g.clipIntersection,S=g.clipShadows,_=i.get(g);if(!s||y===null||y.length===0||o&&!S)o?p(null):f();else{const M=o?0:n,T=M*4;let A=_.clippingState||null;h.value=A,A=p(y,m,T,v);for(let D=0;D!==T;++D)A[D]=t[D];_.clippingState=A,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=M}};function f(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function p(g,m,v,y){const E=g!==null?g.length:0;let S=null;if(E!==0){if(S=h.value,y!==!0||S===null){const _=v+E*4,M=m.matrixWorldInverse;c.getNormalMatrix(M),(S===null||S.length<_)&&(S=new Float32Array(_));for(let T=0,A=v;T!==E;++T,A+=4)l.copy(g[T]).applyMatrix4(M,c),l.normal.toArray(S,A),S[A+3]=l.constant}h.value=S,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,S}}const Dr=4,M_=[.125,.215,.35,.446,.526,.582],va=20,L3=256,Gl=new Ua,E_=new Ve;let im=null,sm=0,rm=0,am=!1;const D3=new B;class Nm{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,s=100,o={}){const{size:l=256,position:c=D3}=o;im=this._renderer.getRenderTarget(),sm=this._renderer.getActiveCubeFace(),rm=this._renderer.getActiveMipmapLevel(),am=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(l);const h=this._allocateTargets();return h.depthBuffer=!0,this._sceneToCubeUV(e,n,s,h,c),t>0&&this._blur(h,0,0,t),this._applyPMREM(h),this._cleanup(h),h}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=A_(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=w_(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.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._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(im,sm,rm),this._renderer.xr.enabled=am,e.scissorTest=!1,Do(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Ps||e.mapping===Nr?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),im=this._renderer.getRenderTarget(),sm=this._renderer.getActiveCubeFace(),rm=this._renderer.getActiveMipmapLevel(),am=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:nn,minFilter:nn,generateMipmaps:!1,type:fs,format:ii,colorSpace:Fr,depthBuffer:!1},s=T_(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=T_(e,t,n);const{_lodMax:o}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=N3(o)),this._blurMaterial=F3(o,e,t),this._ggxMaterial=U3(o,e,t)}return s}_compileMaterial(e){const t=new Mn(new gt,e);this._renderer.compile(t,Gl)}_sceneToCubeUV(e,t,n,s,o){const h=new Dn(90,1,t,n),f=[1,-1,1,1,1,1],p=[1,1,1,-1,-1,-1],g=this._renderer,m=g.autoClear,v=g.toneMapping;g.getClearColor(E_),g.toneMapping=zi,g.autoClear=!1,g.state.buffers.depth.getReversed()&&(g.setRenderTarget(s),g.clearDepth(),g.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Mn(new La,new kr({name:"PMREM.Backgroun
3667d",side:Nn,depthWrite:!1,depthTest:!1})));const E=this._backgroundBox,S=E.material;let _=!1;const M=e.background;M?M.isColor&&(S.color.copy(M),e.background=null,_=!0):(S.color.copy(E_),_=!0);for(let T=0;T<6;T++){const A=T%3;A===0?(h.up.set(0,f[T],0),h.position.set(o.x,o.y,o.z),h.lookAt(o.x+p[T],o.y,o.z)):A===1?(h.up.set(0,0,f[T]),h.position.set(o.x,o.y,o.z),h.lookAt(o.x,o.y+p[T],o.z)):(h.up.set(0,f[T],0),h.position.set(o.x,o.y,o.z),h.lookAt(o.x,o.y,o.z+p[T]));const D=this._cubeSize;Do(s,A*D,T>2?D:0,D,D),g.setRenderTarget(s),_&&g.render(E,h),g.render(e,h)}g.toneMapping=v,g.autoClear=m,e.background=M}_textureToCubeUV(e,t){const n=this._renderer,s=e.mapping===Ps||e.mapping===Nr;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=A_()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=w_());const o=s?this._cubemapMaterial:this._equirectMaterial,l=this._lodMeshes[0];l.material=o;const c=o.uniforms;c.envMap.value=e;const h=this._cubeSize;Do(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(l,Gl)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const s=this._lodMeshes.length;for(let o=1;o<s;o++)this._applyGGXFilter(e,o-1,o);t.autoClear=n}_applyGGXFilter(e,t,n){const s=this._renderer,o=this._pingPongRenderTarget,l=this._ggxMaterial,c=this._lodMeshes[n];c.material=l;const h=l.uniforms,f=n/(this._lodMeshes.length-1),p=t/(this._lodMeshes.length-1),g=Math.sqrt(f*f-p*p),m=0+f*1.25,v=g*m,{_lodMax:y}=this,E=this._sizeLods[n],S=3*E*(n>y-Dr?n-y+Dr:0),_=4*(this._cubeSize-E);h.envMap.value=e.texture,h.roughness.value=v,h.mipInt.value=y-t,Do(o,S,_,3*E,2*E),s.setRenderTarget(o),s.render(c,Gl),h.envMap.value=o.texture,h.roughness.value=0,h.mipInt.value=y-n,Do(e,S,_,3*E,2*E),s.setRenderTarget(e),s.render(c,Gl)}_blur(e,t,n,s,o){const l=this._pingPongRenderTarget;this._halfBlur(e,l,t,n,s,"latitudinal",o),this._halfBlur(l,e,n,n,s,"longitudinal",o)}_halfBlur(e,t,n,s,o,l,c){const h=this._renderer,f=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&Qe("blur direction must be either latitudinal or longitudinal!");const p=3,g=this._lodMeshes[s];g.material=f;const m=f.uniforms,v=this._sizeLods[n]-1,y=isFinite(o)?Math.PI/(2*v):2*Math.PI/(2*va-1),E=o/y,S=isFinite(o)?1+Math.floor(p*E):va;S>va&&De(`sigmaRadians, ${o}, is too large and will clip, as it requested ${S} samples when the maximum is set to ${va}`);const _=[];let M=0;for(let F=0;F<va;++F){const w=F/E,L=Math.exp(-w*w/2);_.push(L),F===0?M+=L:F<S&&(M+=2*L)}for(let F=0;F<_.length;F++)_[F]=_[F]/M;m.envMap.value=e.texture,m.samples.value=S,m.weights.value=_,m.latitudinal.value=l==="latitudinal",c&&(m.poleAxis.value=c);const{_lodMax:T}=this;m.dTheta.value=y,m.mipInt.value=T-n;const A=this._sizeLods[s],D=3*A*(s>T-Dr?s-T+Dr:0),R=4*(this._cubeSize-A);Do(t,D,R,3*A,2*A),h.setRenderTarget(t),h.render(g,Gl)}}function N3(i){const e=[],t=[],n=[];let s=i;const o=i-Dr+1+M_.length;for(let l=0;l<o;l++){const c=Math.pow(2,s);e.push(c);let h=1/c;l>i-Dr?h=M_[l-i+Dr-1]:l===0&&(h=0),t.push(h);const f=1/(c-2),p=-f,g=1+f,m=[p,p,g,p,g,g,p,p,g,g,p,g],v=6,y=6,E=3,S=2,_=1,M=new Float32Array(E*y*v),T=new Float32Array(S*y*v),A=new Float32Array(_*y*v);for(let R=0;R<v;R++){const F=R%3*2/3-1,w=R>2?0:-1,L=[F,w,0,F+2/3,w,0,F+2/3,w+1,0,F,w,0,F+2/3,w+1,0,F,w+1,0];M.set(L,E*y*R),T.set(m,S*y*R);const U=[R,R,R,R,R,R];A.set(U,_*y*R)}const D=new gt;D.setAttribute("position",new Qt(M,E)),D.setAttribute("uv",new Qt(T,S)),D.setAttribute("faceIndex",new Qt(A,_)),n.push(new Mn(D,null)),s>Dr&&s--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function T_(i,e,t){const n=new fn(i,e,t);return n.texture.mapping=Ko,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Do(i,e,t,n,s){i.viewport.set(e,t,n,s),i.scissor.set(e,t,n,s)}function U3(i,e,t){return new En({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:L3,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:ed(),fragmentShader:` 3668 3669 precision highp float; 3670 precision highp int; 3671 3672 varying vec3 vOutputDirection; 3673 3674 uniform sampler2D envMap; 3675 uniform float roughness; 3676 uniform float mipInt; 3677 3678 #define ENVMAP_TYPE_CUBE_UV 3679 #include <cube_uv_reflection_fragment> 3680 3681 #define PI 3.14159265359 3682 3683 // Van der Corput radical inverse 3684 float radicalInverse_VdC(uint bits) { 3685 bits = (bits << 16u) | (bits >> 16u); 3686 bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); 3687 bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); 3688 bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); 3689 bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); 3690 return float(bits) * 2.3283064365386963e-10; // / 0x100000000 3691 } 3692 3693 // Hammersley sequence 3694 vec2 hammersley(uint i, uint N) { 3695 return vec2(float(i) / float(N), radicalInverse_VdC(i)); 3696 } 3697 3698 // GGX VNDF importance sampling (Eric Heitz 2018) 3699 // "Sampling the GGX Distribution of Visible Normals" 3700 // https://jcgt.org/published/0007/04/01/ 3701 vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { 3702 float alpha = roughness * roughness; 3703 3704 // Section 4.1: Orthonormal basis 3705 vec3 T1 = vec3(1.0, 0.0, 0.0); 3706 vec3 T2 = cross(V, T1); 3707 3708 // Section 4.2: Parameterization of projected area 3709 float r = sqrt(Xi.x); 3710 float phi = 2.0 * PI * Xi.y; 3711 float t1 = r * cos(phi); 3712 float t2 = r * sin(phi); 3713 float s = 0.5 * (1.0 + V.z); 3714 t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; 3715 3716 // Section 4.3: Reprojection onto hemisphere 3717 vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; 3718 3719 // Section 3.4: Transform back to ellipsoid configuration 3720 return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); 3721 } 3722 3723 void main() { 3724 vec3 N = normalize(vOutputDirection); 3725 vec3 V = N; // Assume view direction equals normal for pre-filtering 3726 3727 vec3 prefilteredColor = vec3(0.0); 3728 float totalWeight = 0.0; 3729 3730 // For very low roughness, just sample the environment directly 3731 if (roughness < 0.001) { 3732 gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); 3733 return; 3734 } 3735 3736 // Tangent space basis for VNDF sampling 3737 vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); 3738 vec3 tangent = normalize(cross(up, N)); 3739 vec3 bitangent = cross(N, tangent); 3740
3741 for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { 3742 vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); 3743 3744 // For PMREM, V = N, so in tangent space V is always (0, 0, 1) 3745 vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); 3746 3747 // Transform H back to world space 3748 vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); 3749 vec3 L = normalize(2.0 * dot(V, H) * H - V); 3750 3751 float NdotL = max(dot(N, L), 0.0); 3752 3753 if(NdotL > 0.0) { 3754 // Sample environment at fixed mip level 3755 // VNDF importance sampling handles the distribution filtering 3756 vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); 3757 3758 // Weight by NdotL for the split-sum approximation 3759 // VNDF PDF naturally accounts for the visible microfacet distribution 3760 prefilteredColor += sampleColor * NdotL; 3761 totalWeight += NdotL; 3762 } 3763 } 3764 3765 if (totalWeight > 0.0) { 3766 prefilteredColor = prefilteredColor / totalWeight; 3767 } 3768 3769 gl_FragColor = vec4(prefilteredColor, 1.0); 3770 } 3771 `,blending:jn,depthTest:!1,depthWrite:!1})}function F3(i,e,t){const n=new Float32Array(va),s=new B(0,1,0);return new En({name:"SphericalGaussianBlur",defines:{n:va,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:ed(),fragmentShader:` 3772 3773 precision mediump float; 3774 precision mediump int; 3775 3776 varying vec3 vOutputDirection; 3777 3778 uniform sampler2D envMap; 3779 uniform int samples; 3780 uniform float weights[ n ]; 3781 uniform bool latitudinal; 3782 uniform float dTheta; 3783 uniform float mipInt; 3784 uniform vec3 poleAxis; 3785 3786 #define ENVMAP_TYPE_CUBE_UV 3787 #include <cube_uv_reflection_fragment> 3788 3789 vec3 getSample( float theta, vec3 axis ) { 3790 3791 float cosTheta = cos( theta ); 3792 // Rodrigues' axis-angle rotation 3793 vec3 sampleDirection = vOutputDirection * cosTheta 3794 + cross( axis, vOutputDirection ) * sin( theta ) 3795 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3796 3797 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3798 3799 } 3800 3801 void main() { 3802 3803 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3804 3805 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3806 3807 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3808 3809 } 3810 3811 axis = normalize( axis ); 3812 3813 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3814 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3815 3816 for ( int i = 1; i < n; i++ ) { 3817 3818 if ( i >= samples ) { 3819 3820 break; 3821 3822 } 3823 3824 float theta = dTheta * float( i ); 3825 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3826 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3827 3828 } 3829 3830 } 3831 `,blending:jn,depthTest:!1,depthWrite:!1})}function w_(){return new En({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ed(),fragmentShader:` 3832 3833 precision mediump float; 3834 precision mediump int; 3835 3836 varying vec3 vOutputDirection; 3837 3838 uniform sampler2D envMap; 3839 3840 #include <common> 3841 3842 void main() { 3843 3844 vec3 outputDirection = normalize( vOutputDirection ); 3845 vec2 uv = equirectUv( outputDirection ); 3846 3847 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3848 3849 } 3850 `,blending:jn,depthTest:!1,depthWrite:!1})}function A_(){return new En({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ed(),fragmentShader:` 3851 3852 precision mediump float; 3853 precision mediump int; 3854 3855 uniform float flipEnvMap; 3856 3857 varying vec3 vOutputDirection; 3858 3859 uniform samplerCube envMap; 3860 3861 void main() { 3862 3863 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3864 3865 } 3866 `,blending:jn,depthTest:!1,depthWrite:!1})}function ed(){return` 3867 3868 precision mediump float; 3869 precision mediump int; 3870 3871 attribute float faceIndex; 3872 3873 varying vec3 vOutputDirection; 3874 3875 // RH coordinate system; PMREM face-indexing convention 3876 vec3 getDirection( vec2 uv, float face ) { 3877 3878 uv = 2.0 * uv - 1.0; 3879 3880 vec3 direction = vec3( uv, 1.0 ); 3881 3882 if ( face == 0.0 ) { 3883 3884 direction = direction.zyx; // ( 1, v, u ) pos x 3885 3886 } else if ( face == 1.0 ) { 3887 3888 direction = direction.xzy; 3889 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3890 3891 } else if ( face == 2.0 ) { 3892 3893 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3894 3895 } else if ( face == 3.0 ) { 3896 3897 direction = direction.zyx; 3898 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3899 3900 } else if ( face == 4.0 ) { 3901 3902 direction = direction.xzy; 3903 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3904 3905 } else if ( face == 5.0 ) { 3906 3907 direction.z *= -1.0; // ( u, v, -1 ) neg z 3908 3909 } 3910 3911 return direction; 3912 3913 } 3914 3915 void main() { 3916 3917 vOutputDirection = getDirection( uv, faceIndex ); 3918 gl_Position = vec4( position, 1.0 ); 3919 3920 } 3921 `}class Ng extends fn{constructor(e=1,t={}
vendor: 25,753 bytes, lines 3921-4037
3921){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];this.texture=new Lc(s),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}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;const n={uniforms:{tEquirect:{value:null}},vertexShader:` 3922 3923 varying vec3 vWorldDirection; 3924 3925 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 3926 3927 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 3928 3929 } 3930 3931 void main() { 3932 3933 vWorldDirection = transformDirection( position, modelMatrix ); 3934 3935 #include <begin_vertex> 3936 #include <project_vertex> 3937 3938 } 3939 `,fragmentShader:` 3940 3941 uniform sampler2D tEquirect; 3942 3943 varying vec3 vWorldDirection; 3944 3945 #include <common> 3946 3947 void main() { 3948 3949 vec3 direction = normalize( vWorldDirection ); 3950 3951 vec2 sampleUV = equirectUv( direction ); 3952 3953 gl_FragColor = texture2D( tEquirect, sampleUV ); 3954 3955 } 3956 `},s=new La(5,5,5),o=new En({name:"CubemapFromEquirect",uniforms:jo(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Nn,blending:jn});o.uniforms.tEquirect.value=t;const l=new Mn(s,o),c=t.minFilter;return t.minFilter===Cs&&(t.minFilter=nn),new GS(1,10,this).update(e,l),t.minFilter=c,l.geometry.dispose(),l.material.dispose(),this}clear(e,t=!0,n=!0,s=!0){const o=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,n,s);e.setRenderTarget(o)}}function O3(i){let e=new WeakMap,t=new WeakMap,n=null;function s(m,v=!1){return m==null?null:v?l(m):o(m)}function o(m){if(m&&m.isTexture){const v=m.mapping;if(v===Kl||v===Jl)if(e.has(m)){const y=e.get(m).texture;return c(y,m.mapping)}else{const y=m.image;if(y&&y.height>0){const E=new Ng(y.height);return E.fromEquirectangularTexture(i,m),e.set(m,E),m.addEventListener("dispose",f),c(E.texture,m.mapping)}else return null}}return m}function l(m){if(m&&m.isTexture){const v=m.mapping,y=v===Kl||v===Jl,E=v===Ps||v===Nr;if(y||E){let S=t.get(m);const _=S!==void 0?S.texture.pmremVersion:0;if(m.isRenderTargetTexture&&m.pmremVersion!==_)return n===null&&(n=new Nm(i)),S=y?n.fromEquirectangular(m,S):n.fromCubemap(m,S),S.texture.pmremVersion=m.pmremVersion,t.set(m,S),S.texture;if(S!==void 0)return S.texture;{const M=m.image;return y&&M&&M.height>0||E&&M&&h(M)?(n===null&&(n=new Nm(i)),S=y?n.fromEquirectangular(m):n.fromCubemap(m),S.texture.pmremVersion=m.pmremVersion,t.set(m,S),m.addEventListener("dispose",p),S.texture):null}}}return m}function c(m,v){return v===Kl?m.mapping=Ps:v===Jl&&(m.mapping=Nr),m}function h(m){let v=0;const y=6;for(let E=0;E<y;E++)m[E]!==void 0&&v++;return v===y}function f(m){const v=m.target;v.removeEventListener("dispose",f);const y=e.get(v);y!==void 0&&(e.delete(v),y.dispose())}function p(m){const v=m.target;v.removeEventListener("dispose",p);const y=t.get(v);y!==void 0&&(t.delete(v),y.dispose())}function g(){e=new WeakMap,t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:s,dispose:g}}function B3(i){const e={};function t(n){if(e[n]!==void 0)return e[n];const s=i.getExtension(n);return e[n]=s,s}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const s=t(n);return s===null&&cf("WebGLRenderer: "+n+" extension not supported."),s}}}function z3(i,e,t,n){const s={},o=new WeakMap;function l(g){const m=g.target;m.index!==null&&e.remove(m.index);for(const y in m.attributes)e.remove(m.attributes[y]);m.removeEventListener("dispose",l),delete s[m.id];const v=o.get(m);v&&(e.remove(v),o.delete(m)),n.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,t.memory.geometries--}function c(g,m){return s[m.id]===!0||(m.addEventListener("dispose",l),s[m.id]=!0,t.memory.geometries++),m}function h(g){const m=g.attributes;for(const v in m)e.update(m[v],i.ARRAY_BUFFER)}function f(g){const m=[],v=g.index,y=g.attributes.position;let E=0;if(y===void 0)return;if(v!==null){const M=v.array;E=v.version;for(let T=0,A=M.length;T<A;T+=3){const D=M[T+0],R=M[T+1],F=M[T+2];m.push(D,R,R,F,F,D)}}else{const M=y.array;E=y.version;for(let T=0,A=M.length/3-1;T<A;T+=3){const D=T+0,R=T+1,F=T+2;m.push(D,R,R,F,F,D)}}const S=new(y.count>=65535?cg:lg)(m,1);S.version=E;const _=o.get(g);_&&e.remove(_),o.set(g,S)}function p(g){const m=o.get(g);if(m){const v=g.index;v!==null&&m.version<v.version&&f(g)}else f(g);return o.get(g)}return{get:c,update:h,getWireframeAttribute:p}}function k3(i,e,t){let n;function s(g){n=g}let o,l;function c(g){o=g.type,l=g.bytesPerElement}function h(g,m){i.drawElements(n,m,o,g*l),t.update(m,n,1)}function f(g,m,v){v!==0&&(i.drawElementsInstanced(n,m,o,g*l,v),t.update(m,n,v))}function p(g,m,v){if(v===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,m,0,o,g,0,v);let E=0;for(let S=0;S<v;S++)E+=m[S];t.update(E,n,1)}this.setMode=s,this.setIndex=c,this.render=h,this.renderInstances=f,this.renderMultiDraw=p}function V3(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(o,l,c){switch(t.calls++,l){case i.TRIANGLES:t.triangles+=c*(o/3);break;case i.LINES:t.lines+=c*(o/2);break;case i.LINE_STRIP:t.lines+=c*(o-1);break;case i.LINE_LOOP:t.lines+=c*o;break;case i.POINTS:t.points+=c*o;break;default:Qe("WebGLInfo: Unknown draw mode:",l);break}}function s(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:s,update:n}}function H3(i,e,t){const n=new WeakMap,s=new Zt;function o(l,c,h){const f=l.morphTargetInfluences,p=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,g=p!==void 0?p.length:0;let m=n.get(c);if(m===void 0||m.count!==g){let L=function(){F.dispose(),n.delete(c),c.removeEventListener("dispose",L)};m!==void 0&&m.texture.dispose();const v=c.morphAttributes.position!==void 0,y=c.morphAttributes.normal!==void 0,E=c.morphAttributes.color!==void 0,S=c.morphAttributes.position||[],_=c.morphAttributes.normal||[],M=c.morphAttributes.color||[];let T=0;v===!0&&(T=1),y===!0&&(T=2),E===!0&&(T=3);let A=c.attributes.position.count*T,D=1;A>e.maxTextureSize&&(D=Math.ceil(A/e.maxTextureSize),A=e.maxTextureSize);const R=new Float32Array(A*D*4*g),F=new Pf(R,A,D,g);F.type=Yn,F.needsUpdate=!0;const w=T*4;for(let U=0;U<g;U++){const O=S[U],H=_[U],W=M[U],Z=A*D*4*U;for(let V=0;V<O.count;V++){const $=V*w;v===!0&&(s.fromBufferAttribute(O,V),R[Z+$+0]=s.x,R[Z+$+1]=s.y,R[Z+$+2]=s.z,R[Z+$+3]=0),y===!0&&(s.fromBufferAttribute(H,V),R[Z+$+4]=s.x,R[Z+$+5]=s.y,R[Z+$+6]=s.z,R[Z+$+7]=0),E===!0&&(s.fromBufferAttribute(W,V),R[Z+$+8]=s.x,R[Z+$+9]=s.y,R[Z+$+10]=s.z,R[Z+$+11]=W.itemSize===4?s.w:1)}}m={count:g,texture:F,size:new ae(A,D)},n.set(c,m),c.addEventListener("dispose",L)}if(l.isInstancedMesh===!0&&l.morphTexture!==null)h.getUniforms().setValue(i,"morphTexture",l.morphTexture,t);else{let v=0;for(let E=0;E<f.length;E++)v+=f[E];const y=c.morphTargetsRelative?1:1-v;h.getUniforms().setValue(i,"morphTargetBaseInfluence",y),h.getUniforms().setValue(i,"morphTargetInfluences",f)}h.getUniforms().setValue(i,"morphTargetsTexture",m.texture,t),h.getUniforms().setValue(i,"morphTargetsTextureSize",m.size)}return{update:o}}function G3(i,e,t,n,s){let o=new WeakMap;function l(f){const p=s.render.frame,g=f.geometry,m=e.get(f,g);if(o.get(m)!==p&&(e.update(m),o.set(m,p)),f.isInstancedMesh&&(f.hasEventListener("dispose",h)===!1&&f.addEventListener("dispose",h),o.get(f)!==p&&(t.update(f.instanceMatrix,i.ARRAY_BUFFER),f.instanceColor!==null&&t.update(f.instanceColor,i.ARRAY_BUFFER),o.set(f,p))),f.isSkinnedMesh){const v=f.skeleton;o.get(v)!==p&&(v.update(),o.set(v,p))}return m}function c(){o=new WeakMap}function h(f){const p=f.target;p.removeEventListener("dispose",h),n.releaseStatesOfObject(p),t.remove(p.instanceMatrix),p.instanceColor!==null&&t.remove(p.instanceColor)}return{update:l,dispose:c}}const W3={[qm]:"LINEAR_TONE_MAPPING",[Ym]:"REINHARD_TONE_MAPPING",[jm]:"CINEON_TONE_MAPPING",[yf]:"ACES_FILMIC_TONE_MAPPING",[Zm]:"AGX_TONE_MAPPING",[Km]:"NEUTRAL_TONE_MAPPING",[$m]:"CUSTOM_TONE_MAPPING"};function X3(i,e,t,n,s){const o=new fn(e,t,{type:i,depthBuffer:n,stencilBuffer:s,depthTexture:n?new Br(e,t):void 0}),l=new fn(e,t,{type:fs,depthBuffer:!1,stencilBuffer:!1}),c=new gt;c.setAttribute("position",new je([-1,3,0,-1,-1,0,3,-1,0],3)),c.setAttribute("uv",new je([0,2,0,0,2,0],2));const h=new yg({uniforms:{tDiffuse:{value:null}},vertexShader:` 3957 precision highp float; 3958 3959 uniform mat4 modelViewMatrix; 3960 uniform mat4 projectionMatrix; 3961 3962 attribute vec3 position; 3963 attribute vec2 uv; 3964 3965 varying vec2 vUv; 3966 3967 void main() { 3968 vUv = uv; 3969 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 3970 }`,fragmentShader:` 3971 precision highp float; 3972 3973 uniform sampler2D tDiffuse; 3974 3975 varying vec2 vUv; 3976 3977 #include <tonemapping_pars_fragment> 3978 #include <colorspace_pars_fragment> 3979 3980 void main() { 3981 gl_FragColor = texture2D( tDiffuse, vUv ); 3982 3983 #ifdef LINEAR_TONE_MAPPING 3984 gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); 3985 #elif defined( REINHARD_TONE_MAPPING ) 3986 gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); 3987 #elif defined( CINEON_TONE_MAPPING ) 3988 gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); 3989 #elif defined( ACES_FILMIC_TONE_MAPPING ) 3990 gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); 3991 #elif defined( AGX_TONE_MAPPING ) 3992 gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); 3993 #elif defined( NEUTRAL_TONE_MAPPING ) 3994 gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); 3995 #elif defined( CUSTOM_TONE_MAPPING ) 3996 gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); 3997 #endif 3998 3999 #ifdef SRGB_TRANSFER 4000 gl_FragColor = sRGBTransferOETF( gl_FragColor ); 4001 #endif 4002 }`,depthTest:!1,depthWrite:!1}),f=new Mn(c,h),p=new Ua(-1,1,1,-1,0,1);let g=null,m=null,v=!1,y,E=null,S=[],_=!1;this.setSize=function(M,T){o.setSize(M,T),l.setSize(M,T);for(let A=0;A<S.length;A++){const D=S[A];D.setSize&&D.setSize(M,T)}},this.setEffects=function(M){S=M,_=S.length>0&&S[0].isRenderPass===!0;const T=o.width,A=o.height;for(let D=0;D<S.length;D++){const R=S[D];R.setSize&&R.setSize(T,A)}},this.begin=function(M,T){if(v||M.toneMapping===zi&&S.length===0)return!1;if(E=T,T!==null){const A=T.width,D=T.height;(o.width!==A||o.height!==D)&&this.setSize(A,D)}return _===!1&&M.setRenderTarget(o),y=M.toneMapping,M.toneMapping=zi,!0},this.hasRenderPass=function(){return _},this.end=function(M,T){M.toneMapping=y,v=!0;let A=o,D=l;for(let R=0;R<S.length;R++){const F=S[R];if(F.enabled!==!1&&(F.render(M,D,A,T),F.needsSwap!==!1)){const w=A;A=D,D=w}}if(g!==M.outputColorSpace||m!==M.toneMapping){g=M.outputColorSpace,m=M.toneMapping,h.defines={},It.getTransfer(g)===Jt&&(h.defines.SRGB_TRANSFER="");const R=W3[m];R&&(h.defines[R]=""),h.needsUpdate=!0}h.uniforms.tDiffuse.value=A.texture,M.setRenderTarget(E),M.render(f,p),E=null,v=!1},this.isCompositing=function(){return v},this.dispose=function(){o.depthTexture&&o.depthTexture.dispose(),o.dispose(),l.dispose(),c.dispose(),h.dispose()}}const eb=new un,Um=new Br(1,1),tb=new Pf,nb=new Lf,ib=new Lc,C_=[],R_=[],I_=new Float32Array(16),P_=new Float32Array(9),L_=new Float32Array(4);function nl(i,e,t){const n=i[0];if(n<=0||n>0)return i;const s=e*t;let o=C_[s];if(o===void 0&&(o=new Float32Array(s),C_[s]=o),e!==0){n.toArray(o,0);for(let l=1,c=0;l!==e;++l)c+=t,i[l].toArray(o,c)}return o}function Un(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function Fn(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function td(i,e){let t=R_[e];t===void 0&&(t=new Int32Array(e),R_[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function q3(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function Y3(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Un(t,e))return;i.uniform2fv(this.addr,e),Fn(t,e)}}function j3(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.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)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Un(t,e))return;i.uniform3fv(this.addr,e),Fn(t,e)}}function $3(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.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(Un(t,e))return;i.uniform4fv(this.addr,e),Fn(t,e)}}function Z3(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Un(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),Fn(t,e)}else{if(Un(t,n))return;L_.set(n),i.uniformMatrix2fv(this.addr,!1,L_),Fn(t,n)}}function K3(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Un(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),Fn(t,e)}else{if(Un(t,n))return;P_.set(n),i.uniformMatrix3fv(this.addr,!1,P_),Fn(t,n)}}function J3(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Un(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),Fn(t,e)}else{if(Un(t,n))return;I_.set(n),i.uniformMatrix4fv(this.addr,!1,I_),Fn(t,n)}}function Q3(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function eI(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Un(t,e))return;i.uniform2iv(this.addr,e),Fn(t,e)}}function tI(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Un(t,e))return;i.uniform3iv(this.addr,e),Fn(t,e)}}function nI(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.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(Un(t,e))return;i.uniform4iv(this.addr,e),Fn(t,e)}}function iI(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function sI(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Un(t,e))return;i.uniform2uiv(this.addr,e),Fn(t,e)}}function rI(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Un(t,e))return;i.uniform3uiv(this.addr,e),Fn(t,e)}}function aI(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.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(Un(t,e))return;i.uniform4uiv(this.addr,e),Fn(t,e)}}function oI(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s);let o;this.type===i.SAMPLER_2D_SHADOW?(Um.compareFunction=t.isReversedDepthBuffer()?If:Rf,o=Um):o=eb,t.setTexture2D(e||o,s)}function lI(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture3D(e||nb,s)}function cI(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTextureCube(e||ib,s)}function uI(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture2DArray(e||tb,s)}function hI(i){switch(i){case 5126:return q3;case 35664:return Y3;case 35665:return j3;case 35666:return $3;case 35674:return Z3;case 35675:return K3;case 35676:return J3;case 5124:case 35670:return Q3;case 35667:case 35671:return eI;case 35668:case 35672:return tI;case 35669:case 35673:return nI;case 5125:return iI;case 36294:return sI;case 36295:return rI;case 36296:return aI;case 35678:case 36198:case 36298:case 36306:case 35682:return oI;case 35679:case 36299:case 36307:return lI;case 35680:case 36300:case 36308:case 36293:return cI;case 36289:case 36303:case 36311:case 36292:return uI}}function fI(i,e){i.uniform1fv(this.addr,e)}function dI(i,e){const t=nl(e,this.size,2);i.uniform2fv(this.addr,t)}function pI(i,e){const t=nl(e,this.size,3);i.uniform3fv(this.addr,t)}function mI(i,e){const t=nl(e,this.size,4);i.uniform4fv(this.addr,t)}function gI(i,e){const t=nl(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function vI(i,e){const t=nl(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function xI(i,e){const t=nl(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function _I(i,e){i.uniform1iv(this.addr,e)}function yI(i,e){i.uniform2iv(this.addr,e)}function SI(i,e){i.uniform3iv(this.addr,e)}function bI(i,e){i.uniform4iv(this.addr,e)}function MI(i,e){i.uniform1uiv(this.addr,e)}function EI(i,e){i.uniform2uiv(this.addr,e)}function TI(i,e){i.uniform3uiv(this.addr,e)}function wI(i,e){i.uniform4uiv(this.addr,e)}function AI(i,e,t){const n=this.cache,s=e.length,o=td(t,s);Un(n,o)||(i.uniform1iv(this.addr,o),Fn(n,o));let l;this.type===i.SAMPLER_2D_SHADOW?l=Um:l=eb;for(let c=0;c!==s;++c)t.setTexture2D(e[c]||l,o[c])}function CI(i,e,t){const n=this.cache,s=e.length,o=td(t,s);Un(n,o)||(i.uniform1iv(this.addr,o),Fn(n,o));for(let l=0;l!==s;++l)t.setTexture3D(e[l]||nb,o[l])}function RI(i,e,t){const n=this.cache,s=e.length,o=td(t,s);Un(n,o)||(i.uniform1iv(this.addr,o),Fn(n,o));for(let l=0;l!==s;++l)t.setTextureCube(e[l]||ib,o[l])}function II(i,e,t){const n=this.cache,s=e.length,o=td(t,s);Un(n,o)||(i.uniform1iv(this.addr,o),Fn(n,o));for(let l=0;l!==s;++l)t.setTexture2DArray(e[l]||tb,o[l])}function PI(i){switch(i){case 5126:return fI;case 35664:return dI;case 35665:return pI;case 35666:return mI;case 35674:return gI;case 35675:return vI;case 35676:return xI;case 5124:case 35670:return _I;case 35667:case 35671:return yI;case 35668:case 35672:return SI;case 35669:case 35673:return bI;case 5125:return MI;case 36294:return EI;case 36295:return TI;case 36296:return wI;case 35678:case 36198:case 36298:case 36306:case 35682:return AI;case 35679:case 36299:case 36307:return CI;case 35680:case 36300:case 36308:case 36293:return RI;case 36289:case 36303:case 36311:case 36292:return II}}class LI{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=hI(t.type)}}class DI{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=PI(t.type)}}class NI{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const s=this.seq;for(let o=0,l=s.length;o!==l;++o){const c=s[o];c.setValue(e,t[c.id],n)}}}const om=/(\w+)(\])?(\[|\.)?/g;function D_(i,e){i.seq.push(e),i.map[e.id]=e}function UI(i,e,t){const n=i.name,s=n.length;for(om.lastIndex=0;;){const o=om.exec(n),l=om.lastIndex;let c=o[1];const h=o[2]==="]",f=o[3];if(h&&(c=c|0),f===void 0||f==="["&&l+2===s){D_(t,f===void 0?new LI(c,i,e):new DI(c,i,e));break}else{let g=t.map[c];g===void 0&&(g=new NI(c),D_(t,g)),t=g}}}class Sh{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let l=0;l<n;++l){const c=e.getActiveUniform(t,l),h=e.getUniformLocation(t,c.name);UI(c,h,this)}const s=[],o=[];for(const l of this.seq)l.type===e.SAMPLER_2D_SHADOW||l.type===e.SAMPLER_CUBE_SHADOW||l.type===e.SAMPLER_2D_ARRAY_SHADOW?s.push(l):o.push(l);s.length>0&&(this.seq=s.concat(o))}setValue(e,t,n,s){const o=this.map[t];o!==void 0&&o.setValue(e,n,s)}setOptional(e,t,n){const s=t[n];s!==void 0&&this.setValue(e,n,s)}static upload(e,t,n,s){for(let o=0,l=t.length;o!==l;++o){const c=t[o],h=n[c.id];h.needsUpdate!==!1&&c.setValue(e,h.value,s)}}static seqWithValue(e,t){const n=[];for(let s=0,o=e.length;s!==o;++s){const l=e[s];l.id in t&&n.push(l)}return n}}function N_(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const FI=37297;let OI=0;function BI(i,e){const t=i.split(` 4003`),n=[],s=Math.max(e-6,0),o=Math.min(e+6,t.length);for(let l=s;l<o;l++){const c=l+1;n.push(`${c===e?">":" "} ${c}: ${t[l]}`)}return n.join(` 4004`)}const U_=new xt;function zI(i){It._getMatrix(U_,It.workingColorSpace,i);const e=`mat3( ${U_.elements.map(t=>t.toFixed(4))} )`;switch(It.getTransfer(i)){case vc:return[e,"LinearTransferOETF"];case Jt:return[e,"sRGBTransferOETF"];default:return De("WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function F_(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),o=(i.getShaderInfoLog(e)||"").trim();if(n&&o==="")return"";const l=/ERROR: 0:(\d+)/.exec(o);if(l){const c=parseInt(l[1]);return t.toUpperCase()+` 4005 4006`+o+` 4007 4008`+BI(i.getShaderSource(e),c)}else return o}function kI(i,e){const t=zI(e);return[`vec4 ${i}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` 4009`)}const VI={[qm]:"Linear",[Ym]:"Reinhard",[jm]:"Cineon",[yf]:"ACESFilmic",[Zm]:"AgX",[Km]:"Neutral",[$m]:"Custom"};function HI(i,e){const t=VI[e];return t===void 0?(De("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+i+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const vh=new B;function GI(){It.getLuminanceCoefficients(vh);const i=vh.x.toFixed(4),e=vh.y.toFixed(4),t=vh.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` 4010`)}function WI(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(jl).join(` 4011`)}function XI(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` 4012`)}function qI(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const o=i.getActiveAttrib(e,s),l=o.name;let c=1;o.type===i.FLOAT_MAT2&&(c=2),o.type===i.FLOAT_MAT3&&(c=3),o.type===i.FLOAT_MAT4&&(c=4),t[l]={type:o.type,location:i.getAttribLocation(e,l),locationSize:c}}return t}function jl(i){return i!==""}function O_(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.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 B_(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const YI=/^[ \t]*#include +<([\w\d./]+)>/gm;function Fm(i){return i.replace(YI,$I)}const jI=new Map;function $I(i,e){let t=At[e];if(t===void 0){const n=jI.get(e);if(n!==void 0)t=At[n],De('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Fm(t)}const ZI=/#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 z_(i){return i.replace(ZI,KI)}function KI(i,e,t,n){let s="";for(let o=parseInt(e);o<parseInt(t);o++)s+=n.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return s}function k_(i){let e=`precision ${i.precision} float; 4013 precision ${i.precision} int; 4014 precision ${i.precision} sampler2D; 4015 precision ${i.precision} samplerCube; 4016 precision ${i.precision} sampler3D; 4017 precision ${i.precision} sampler2DArray; 4018 precision ${i.precision} sampler2DShadow; 4019 precision ${i.precision} samplerCubeShadow; 4020 precision ${i.precision} sampler2DArrayShadow; 4021 precision ${i.precision} isampler2D; 4022 precision ${i.precision} isampler3D; 4023 precision ${i.precision} isamplerCube; 4024 precision ${i.precision} isampler2DArray; 4025 precision ${i.precision} usampler2D; 4026 precision ${i.precision} usampler3D; 4027 precision ${i.precision} usamplerCube; 4028 precision ${i.precision} usampler2DArray; 4029 `;return i.precision==="highp"?e+=` 4030#define HIGH_PRECISION`:i.precision==="mediump"?e+=` 4031#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=` 4032#define LOW_PRECISION`),e}const JI={[ko]:"SHADOWMAP_TYPE_PCF",[xa]:"SHADOWMAP_TYPE_VSM"};function QI(i){return JI[i.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const eP={[Ps]:"ENVMAP_TYPE_CUBE",[Nr]:"ENVMAP_TYPE_CUBE",[Ko]:"ENVMAP_TYPE_CUBE_UV"};function tP(i){return i.envMap===!1?"ENVMAP_TYPE_CUBE":eP[i.envMapMode]||"ENVMAP_TYPE_CUBE"}const nP={[Nr]:"ENVMAP_MODE_REFRACTION"};function iP(i){return i.envMap===!1?"ENVMAP_MODE_REFLECTION":nP[i.envMapMode]||"ENVMAP_MODE_REFLECTION"}const sP={[Ic]:"ENVMAP_BLENDING_MULTIPLY",[Ny]:"ENVMAP_BLENDING_MIX",[Uy]:"ENVMAP_BLENDING_ADD"};function rP(i){return i.envMap===!1?"ENVMAP_BLENDING_NONE":sP[i.combine]||"ENVMAP_BLENDING_NONE"}function aP(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function oP(i,e,t,n){const s=i.getContext(),o=t.defines;let l=t.vertexShader,c=t.fragmentShader;const h=QI(t),f=tP(t),p=iP(t),g=rP(t),m=aP(t),v=WI(t),y=XI(o),E=s.createProgram();let S,_,M=t.glslVersion?"#version "+t.glslVersion+` 4033`:"";t.isRawShaderMaterial?(S=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(jl).join(` 4034`),S.length>0&&(S+=` 4035`),_=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(jl).join(` 4036`),_.length>0&&(_+=` 4037`)):(S=[k_(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.extensionCl
vendor: 6,566 bytes, lines 4037-4039
4037ipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",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 "+p:"",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.vertexNormals?"#define HAS_NORMAL":"",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?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+h:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","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","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` 4038`].filter(jl).join(` 4039`),_=[k_(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,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 "+f:"",t.envMap?"#define "+p:"",t.envMap?"#define "+g:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.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.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",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.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
4039IDESCENCE":"",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||t.batchingColor?"#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 "+h:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==zi?"#define TONE_MAPPING":"",t.toneMapping!==zi?At.tonemapping_pars_fragment:"",t.toneMapping!==zi?HI("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",At.colorspace_pars_fragment,kI("linearToOutputTexel",t.outputColorSpace),GI(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 4040`].filter(jl).join(` 4041`)),l=Fm(l),l=O_(l,t),l=B_(l,t),c=Fm(c),c=O_(c,t),c=B_(c,t),l=z_(l),c=z_(c),t.isRawShaderMaterial!==!0&&(M=`#version 300 es 4042`,S=[v,"#define attribute in","#define varying out","#define texture2D texture"].join(` 4043`)+` 4044`+S,_=["#define varying in",t.glslVersion===Tm?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Tm?"":"#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(` 4045`)+` 4046`+_);const T=M+S+l,A=M+_+c,D=N_(s,s.VERTEX_SHADER,T),R=N_(s,s.FRAGMENT_SHADER,A);s.attachShader(E,D),s.attachShader(E,R),t.index0AttributeName!==void 0?s.bindAttribLocation(E,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(E,0,"position"),s.linkProgram(E);function F(O){if(i.debug.checkShaderErrors){const H=s.getProgramInfoLog(E)||"",W=s.getShaderInfoLog(D)||"",Z=s.getShaderInfoLog(R)||"",V=H.trim(),$=W.trim(),K=Z.trim();let he=!0,ce=!0;if(s.getProgramParameter(E,s.LINK_STATUS)===!1)if(he=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,E,D,R);else{const ye=F_(s,D,"vertex"),ge=F_(s,R,"fragment");Qe("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(E,s.VALIDATE_STATUS)+` 4047 4048Material Name: `+O.name+` 4049Material Type: `+O.type+` 4050 4051Program Info Log: `+V+` 4052`+ye+` 4053`+ge)}else V!==""?De("WebGLProgram: Program Info Log:",V):($===""||K==="")&&(ce=!1);ce&&(O.diagnostics={runnable:he,programLog:V,vertexShader:{log:$,prefix:S},fragmentShader:{log:K,prefix:_}})}s.deleteShader(D),s.deleteShader(R),w=new Sh(s,E),L=qI(s,E)}let w;this.getUniforms=function(){return w===void 0&&F(this),w};let L;this.getAttributes=function(){return L===void 0&&F(this),L};let U=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return U===!1&&(U=s.getProgramParameter(E,FI)),U},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=OI++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=D,this.fragmentShader=R,this}let lP=0;class cP{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,s=this._getShaderStage(t),o=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(s)===!1&&(l.add(s),s.usedTimes++),l.has(o)===!1&&(l.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.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){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new uP(e),t.set(e,n)),n}}class uP{constructor(e){this.id=lP++,this.code=e,this.usedTimes=0}}function hP(i){return i===Ur||i===dc||i===pc}function fP(i,e,t,n,s,o){const l=new Xo,c=new cP,h=new Set,f=[],p=new Map,g=n.logarithmicDepthBuffer;let m=n.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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 y(w){return h.add(w),w===0?"uv":`uv${w}`}function E(w,L,U,O,H,W){const Z=O.fog,V=H.geometry,$=w.isMeshStandardMaterial||w.isMeshLambertMaterial||w.isMeshPhongMaterial?O.environment:null,K=w.isMeshStandardMaterial||w.isMeshLambertMaterial&&!w.envMap||w.isMeshPhongMaterial&&!w.envMap,he=e.get(w.envMap||$,K),ce=he&&he.mapping===Ko?he.image.height:null,ye=v[w.type];w.precision!==null&&(m=n.getMaxPrecision(w.precision),m!==w.precision&&De("WebGLProgram.getParameters:",w.precision,"not supported, using",m,"instead."));const ge=V.morphAttributes.position||V.morphAttributes.normal||V.morphAttributes.color,we=ge!==void 0?ge.length:0;let nt=0;V.morphAttributes.position!==void 0&&(nt=1),V.morphAttributes.normal!==void 0&&(nt=2),V.morphAttributes.color!==void 0&&(nt=3);let st,rt,oe,Ue;if(ye){const vt=ls[ye];st=vt.vertexShader,rt=vt.fragmentShader}else st=w.vertexShader,rt=w.fragmentShader,c.update(w),oe=c.getVertexShaderID(w),Ue=c.getFragmentShaderID(w);const Se=i.getRenderTarget(),We=i.state.buffers.depth.getReversed(),ot=H.isInstancedMesh===!0,at=H.isBatchedMesh===!0,Ct=!!w.map,it=!!w.matcap,fe=!!he,ve=!!w.aoMap,ue=!!w.lightMap,Pe=!!w.bumpMap,Le=!!w.normalMap,ut=!!w.displacementMap,z=!!w.emissiveMap,ht=!!w.metalnessMap,Xe=!!w.roughnessMap,$e=w.anisotropy>0,_e=w.clearcoat>0,kt=w.dispersion>0,N=w.iridescence>0,C=w.sheen>0,Y=w.transmission>0,se=$e&&!!w.anisotropyMap,de=_e&&!!w.clearcoatMap,be=_e&&!!w.clearcoatNormalMap,Ae=_e&&!!w.clearcoatRoughnessMap,ie=N&&!!w.iridescenceMap,le=N&&!!w.iridescenceThicknessMap,Be=C&&!!w.sheenColorMap,qe=C&&!!w.sheenRoughnessMap,Re=!!w.specularMap,Ce=!!w.specularColorMap,pt=!!w.specularIntensityMap,St=Y&&!!w.transmissionMap,Ft=Y&&!!w.thicknessMap,G=!!w.gradientMap,Te=!!w.alphaMap,re=w.alphaTest>0,ze=!!w.alphaHash,Ie=!!w.extensions;let pe=zi;w.toneMapped&&(Se===null||Se.isXRRenderTarget===!0)&&(pe=i.toneMapping);const Je={shaderID:ye,shaderType:w.type,shaderName:w.name,vertexShader:st,fragmentShader:rt,defines:w.defines,customVertexShaderID:oe,customFragmentShaderID:Ue,isRawShaderMaterial:w.isRawShaderMaterial===!0,glslVersion:w.glslVersion,precision:m,batching:at,batchingColor:at&&H._colorsTexture!==null,instancing:ot,instancingColor:ot&&H.instanceColor!==null,instancingMorph:ot&&H.morphTexture!==null,outputColorSpace:Se===null?i.outputColorSpace:Se.isXRRenderTarget===!0?Se.texture.colorSpace:It.workingColorSpace,alphaToCoverage:!!w.alphaToCoverage,map:Ct,matcap:it,envMap:fe,envMapMode:fe&&he.mapping,envMapCubeUVHeight:ce,aoMap:ve,lightMap:ue,bumpMap:Pe,normalMap:Le,displacementMap:ut,emissiveMap:z,normalMapObjectSpace:Le&&w.normalMapType===ky,normalMapTangentSpace:Le&&w.normalMapType===nr,packedNormalMap:Le&&w.normalMapType===nr&&hP(w.normalMap.format),metalnessMap:ht,roughnessMap:Xe,anisotropy:$e,anisotropyMap:se,clearcoat:_e,clearcoatMap:de,clearcoatNormalMap:be,clearcoatRoughnessMap:Ae,dispersion:kt,iridescence:N,iridescenceMap:ie,iridescenceThicknessMap:le,sheen:C,sheenColorMap:Be,sheenRoughnessMap:qe,specularMap:Re,specularColorMap:Ce,specularIntensityMap:pt,transmission:Y,transmissionMap:St,thicknessMap:Ft,gradientMap:G,opaque:w.transparent===!1&&w.blending===ba&&w.alphaToCoverage===!1,alphaMap:Te,alphaTest:re,alphaHash:ze,combine:w.combine,mapUv:Ct&&y(w.map.channel),aoMapUv:ve&&y(w.aoMap.channel),lightMapUv:ue&&y(w.lightMap.channel),bumpMapUv:Pe&&y(w.bumpMap.channel),normalMapUv:Le&&y(w.normalMap.channel),displacementMapUv:ut&&y(w.displacementMap.channel),emissiveMapUv:z&&y(w.emissiveMap.channel),metalnessMapUv:ht&&y(w.metalnessMap.channel),roughnessMapUv:Xe&&y(w.roughnessMap.channel),anisotropyMapUv:se&&y(w.anisotropyMap.channel),clearcoatMapUv:de&&y(w.clearcoatMap.channel),clearcoatNormalMapUv:be&&y(w.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&y(w.clearcoatRoughnessMap.channel),iridescenceMapUv:ie&&y(w.iridescenceMap.channel),iridescenceThicknessMapUv:le&&y(w.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&y(w.sheenColorMap.channel),sheenRoughnessMapUv:qe&&y(w.sheenRoughnessMap.channel),specularMapUv:Re&&y(w.specularMap.channel),specularColorMapUv:Ce&&y(w.specularColorMap.channel),specularIntensityMapUv:pt&&y(w.specularIntensityMap.channel),transmissionMapUv:St&&y(w.transmissionMap.channel),thicknessMapUv:Ft&&y(w.thicknessMap.channel),alphaMapUv:Te&&y(w.alphaMap.channel),vertexTangents:!!V.attributes.tangent&&(Le||$e),vertexNormals:!!V.attributes.normal,vertexColors:w.vertexColors,vertexAlphas:w.vertexColors===!0&&!!V.attributes.color&&V.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!V.attributes.uv&&(Ct||Te),fog:!!Z,useFog:w.fog===!0,fogExp2:!!Z&&Z.isFogExp2,flatShading:w.wireframe===!1&&(w.flatShading===!0||V.attributes.normal===void 0&&Le===!1&&(w.isMeshLambertMaterial||w.isMeshPhongMaterial||w.isMeshStandardMaterial||w.isMeshPhysicalMaterial)),sizeAttenuation:w.sizeAttenuation===!0,logarithmicDepthBuffer:g,reversedDepthBuffer:We,skinning:H.isSkinnedMesh===!0,morphTargets:V.morphAttributes.position!==void 0,morphNormals:V.morphAttributes.normal!==void 0,morphColors:V.morphAttributes.color!==void 0,morphTargetsCount:we,morphTextureStride:nt,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numLightProbes:L.numLightProbes,numLightProbeGrids:W.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:w.dithering,shadowMapEnabled:i.shadowMap.enabled&&U.length>0,shadowMapType:i.shadowMap.type,toneMapping:pe,decodeVideoTexture:Ct&&w.map.isVideoTexture===!0&&It.getTransfer(w.map.colorSpace)===Jt,decodeVideoTextureEmissive:z&&w.emissiveMap.isVideoTexture===!0&&It.getTransfer(w.emissiveMap.colorSpace)===Jt,premultipliedAlpha:w.premultipliedAlpha,doubleSided:w.side===ni,flipSided:w.side===Nn,useDepthPacking:w.depthPacking>=0,depthPacking:w.depthPacking||0,index0AttributeName:w.index0AttributeName,extensionCl
vendor: 12,894 bytes, line 4053
4053ipCullDistance:Ie&&w.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ie&&w.extensions.multiDraw===!0||at)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:w.customProgramCacheKey()};return Je.vertexUv1s=h.has(1),Je.vertexUv2s=h.has(2),Je.vertexUv3s=h.has(3),h.clear(),Je}function S(w){const L=[];if(w.shaderID?L.push(w.shaderID):(L.push(w.customVertexShaderID),L.push(w.customFragmentShaderID)),w.defines!==void 0)for(const U in w.defines)L.push(U),L.push(w.defines[U]);return w.isRawShaderMaterial===!1&&(_(L,w),M(L,w),L.push(i.outputColorSpace)),L.push(w.customProgramCacheKey),L.join()}function _(w,L){w.push(L.precision),w.push(L.outputColorSpace),w.push(L.envMapMode),w.push(L.envMapCubeUVHeight),w.push(L.mapUv),w.push(L.alphaMapUv),w.push(L.lightMapUv),w.push(L.aoMapUv),w.push(L.bumpMapUv),w.push(L.normalMapUv),w.push(L.displacementMapUv),w.push(L.emissiveMapUv),w.push(L.metalnessMapUv),w.push(L.roughnessMapUv),w.push(L.anisotropyMapUv),w.push(L.clearcoatMapUv),w.push(L.clearcoatNormalMapUv),w.push(L.clearcoatRoughnessMapUv),w.push(L.iridescenceMapUv),w.push(L.iridescenceThicknessMapUv),w.push(L.sheenColorMapUv),w.push(L.sheenRoughnessMapUv),w.push(L.specularMapUv),w.push(L.specularColorMapUv),w.push(L.specularIntensityMapUv),w.push(L.transmissionMapUv),w.push(L.thicknessMapUv),w.push(L.combine),w.push(L.fogExp2),w.push(L.sizeAttenuation),w.push(L.morphTargetsCount),w.push(L.morphAttributeCount),w.push(L.numDirLights),w.push(L.numPointLights),w.push(L.numSpotLights),w.push(L.numSpotLightMaps),w.push(L.numHemiLights),w.push(L.numRectAreaLights),w.push(L.numDirLightShadows),w.push(L.numPointLightShadows),w.push(L.numSpotLightShadows),w.push(L.numSpotLightShadowsWithMaps),w.push(L.numLightProbes),w.push(L.shadowMapType),w.push(L.toneMapping),w.push(L.numClippingPlanes),w.push(L.numClipIntersection),w.push(L.depthPacking)}function M(w,L){l.disableAll(),L.instancing&&l.enable(0),L.instancingColor&&l.enable(1),L.instancingMorph&&l.enable(2),L.matcap&&l.enable(3),L.envMap&&l.enable(4),L.normalMapObjectSpace&&l.enable(5),L.normalMapTangentSpace&&l.enable(6),L.clearcoat&&l.enable(7),L.iridescence&&l.enable(8),L.alphaTest&&l.enable(9),L.vertexColors&&l.enable(10),L.vertexAlphas&&l.enable(11),L.vertexUv1s&&l.enable(12),L.vertexUv2s&&l.enable(13),L.vertexUv3s&&l.enable(14),L.vertexTangents&&l.enable(15),L.anisotropy&&l.enable(16),L.alphaHash&&l.enable(17),L.batching&&l.enable(18),L.dispersion&&l.enable(19),L.batchingColor&&l.enable(20),L.gradientMap&&l.enable(21),L.packedNormalMap&&l.enable(22),L.vertexNormals&&l.enable(23),w.push(l.mask),l.disableAll(),L.fog&&l.enable(0),L.useFog&&l.enable(1),L.flatShading&&l.enable(2),L.logarithmicDepthBuffer&&l.enable(3),L.reversedDepthBuffer&&l.enable(4),L.skinning&&l.enable(5),L.morphTargets&&l.enable(6),L.morphNormals&&l.enable(7),L.morphColors&&l.enable(8),L.premultipliedAlpha&&l.enable(9),L.shadowMapEnabled&&l.enable(10),L.doubleSided&&l.enable(11),L.flipSided&&l.enable(12),L.useDepthPacking&&l.enable(13),L.dithering&&l.enable(14),L.transmission&&l.enable(15),L.sheen&&l.enable(16),L.opaque&&l.enable(17),L.pointsUvs&&l.enable(18),L.decodeVideoTexture&&l.enable(19),L.decodeVideoTextureEmissive&&l.enable(20),L.alphaToCoverage&&l.enable(21),L.numLightProbeGrids>0&&l.enable(22),w.push(l.mask)}function T(w){const L=v[w.type];let U;if(L){const O=ls[L];U=SS.clone(O.uniforms)}else U=w.uniforms;return U}function A(w,L){let U=p.get(L);return U!==void 0?++U.usedTimes:(U=new oP(i,L,w,s),f.push(U),p.set(L,U)),U}function D(w){if(--w.usedTimes===0){const L=f.indexOf(w);f[L]=f[f.length-1],f.pop(),p.delete(w.cacheKey),w.destroy()}}function R(w){c.remove(w)}function F(){c.dispose()}return{getParameters:E,getProgramCacheKey:S,getUniforms:T,acquireProgram:A,releaseProgram:D,releaseShaderCache:R,programs:f,dispose:F}}function dP(){let i=new WeakMap;function e(l){return i.has(l)}function t(l){let c=i.get(l);return c===void 0&&(c={},i.set(l,c)),c}function n(l){i.delete(l)}function s(l,c,h){i.get(l)[c]=h}function o(){i=new WeakMap}return{has:e,get:t,remove:n,update:s,dispose:o}}function pP(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.materialVariant!==e.materialVariant?i.materialVariant-e.materialVariant:i.z!==e.z?i.z-e.z:i.id-e.id}function V_(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function H_(){const i=[];let e=0;const t=[],n=[],s=[];function o(){e=0,t.length=0,n.length=0,s.length=0}function l(m){let v=0;return m.isInstancedMesh&&(v+=2),m.isSkinnedMesh&&(v+=1),v}function c(m,v,y,E,S,_){let M=i[e];return M===void 0?(M={id:m.id,object:m,geometry:v,material:y,materialVariant:l(m),groupOrder:E,renderOrder:m.renderOrder,z:S,group:_},i[e]=M):(M.id=m.id,M.object=m,M.geometry=v,M.material=y,M.materialVariant=l(m),M.groupOrder=E,M.renderOrder=m.renderOrder,M.z=S,M.group=_),e++,M}function h(m,v,y,E,S,_){const M=c(m,v,y,E,S,_);y.transmission>0?n.push(M):y.transparent===!0?s.push(M):t.push(M)}function f(m,v,y,E,S,_){const M=c(m,v,y,E,S,_);y.transmission>0?n.unshift(M):y.transparent===!0?s.unshift(M):t.unshift(M)}function p(m,v){t.length>1&&t.sort(m||pP),n.length>1&&n.sort(v||V_),s.length>1&&s.sort(v||V_)}function g(){for(let m=e,v=i.length;m<v;m++){const y=i[m];if(y.id===null)break;y.id=null,y.object=null,y.geometry=null,y.material=null,y.group=null}}return{opaque:t,transmissive:n,transparent:s,init:o,push:h,unshift:f,finish:g,sort:p}}function mP(){let i=new WeakMap;function e(n,s){const o=i.get(n);let l;return o===void 0?(l=new H_,i.set(n,[l])):s>=o.length?(l=new H_,o.push(l)):l=o[s],l}function t(){i=new WeakMap}return{get:e,dispose:t}}function gP(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new B,color:new Ve};break;case"SpotLight":t={position:new B,direction:new B,color:new Ve,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new B,color:new Ve,distance:0,decay:0};break;case"HemisphereLight":t={direction:new B,skyColor:new Ve,groundColor:new Ve};break;case"RectAreaLight":t={color:new Ve,position:new B,halfWidth:new B,halfHeight:new B};break}return i[e.id]=t,t}}}function vP(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ae};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ae};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ae,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let xP=0;function _P(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function yP(i){const e=new gP,t=vP(),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 f=0;f<9;f++)n.probe.push(new B);const s=new B,o=new mt,l=new mt;function c(f){let p=0,g=0,m=0;for(let L=0;L<9;L++)n.probe[L].set(0,0,0);let v=0,y=0,E=0,S=0,_=0,M=0,T=0,A=0,D=0,R=0,F=0;f.sort(_P);for(let L=0,U=f.length;L<U;L++){const O=f[L],H=O.color,W=O.intensity,Z=O.distance;let V=null;if(O.shadow&&O.shadow.map&&(O.shadow.map.texture.format===Ur?V=O.shadow.map.texture:V=O.shadow.map.depthTexture||O.shadow.map.texture),O.isAmbientLight)p+=H.r*W,g+=H.g*W,m+=H.b*W;else if(O.isLightProbe){for(let $=0;$<9;$++)n.probe[$].addScaledVector(O.sh.coefficients[$],W);F++}else if(O.isDirectionalLight){const $=e.get(O);if($.color.copy(O.color).multiplyScalar(O.intensity),O.castShadow){const K=O.shadow,he=t.get(O);he.shadowIntensity=K.intensity,he.shadowBias=K.bias,he.shadowNormalBias=K.normalBias,he.shadowRadius=K.radius,he.shadowMapSize=K.mapSize,n.directionalShadow[v]=he,n.directionalShadowMap[v]=V,n.directionalShadowMatrix[v]=O.shadow.matrix,M++}n.directional[v]=$,v++}else if(O.isSpotLight){const $=e.get(O);$.position.setFromMatrixPosition(O.matrixWorld),$.color.copy(H).multiplyScalar(W),$.distance=Z,$.coneCos=Math.cos(O.angle),$.penumbraCos=Math.cos(O.angle*(1-O.penumbra)),$.decay=O.decay,n.spot[E]=$;const K=O.shadow;if(O.map&&(n.spotLightMap[D]=O.map,D++,K.updateMatrices(O),O.castShadow&&R++),n.spotLightMatrix[E]=K.matrix,O.castShadow){const he=t.get(O);he.shadowIntensity=K.intensity,he.shadowBias=K.bias,he.shadowNormalBias=K.normalBias,he.shadowRadius=K.radius,he.shadowMapSize=K.mapSize,n.spotShadow[E]=he,n.spotShadowMap[E]=V,A++}E++}else if(O.isRectAreaLight){const $=e.get(O);$.color.copy(H).multiplyScalar(W),$.halfWidth.set(O.width*.5,0,0),$.halfHeight.set(0,O.height*.5,0),n.rectArea[S]=$,S++}else if(O.isPointLight){const $=e.get(O);if($.color.copy(O.color).multiplyScalar(O.intensity),$.distance=O.distance,$.decay=O.decay,O.castShadow){const K=O.shadow,he=t.get(O);he.shadowIntensity=K.intensity,he.shadowBias=K.bias,he.shadowNormalBias=K.normalBias,he.shadowRadius=K.radius,he.shadowMapSize=K.mapSize,he.shadowCameraNear=K.camera.near,he.shadowCameraFar=K.camera.far,n.pointShadow[y]=he,n.pointShadowMap[y]=V,n.pointShadowMatrix[y]=O.shadow.matrix,T++}n.point[y]=$,y++}else if(O.isHemisphereLight){const $=e.get(O);$.skyColor.copy(O.color).multiplyScalar(W),$.groundColor.copy(O.groundColor).multiplyScalar(W),n.hemi[_]=$,_++}}S>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Oe.LTC_FLOAT_1,n.rectAreaLTC2=Oe.LTC_FLOAT_2):(n.rectAreaLTC1=Oe.LTC_HALF_1,n.rectAreaLTC2=Oe.LTC_HALF_2)),n.ambient[0]=p,n.ambient[1]=g,n.ambient[2]=m;const w=n.hash;(w.directionalLength!==v||w.pointLength!==y||w.spotLength!==E||w.rectAreaLength!==S||w.hemiLength!==_||w.numDirectionalShadows!==M||w.numPointShadows!==T||w.numSpotShadows!==A||w.numSpotMaps!==D||w.numLightProbes!==F)&&(n.directional.length=v,n.spot.length=E,n.rectArea.length=S,n.point.length=y,n.hemi.length=_,n.directionalShadow.length=M,n.directionalShadowMap.length=M,n.pointShadow.length=T,n.pointShadowMap.length=T,n.spotShadow.length=A,n.spotShadowMap.length=A,n.directionalShadowMatrix.length=M,n.pointShadowMatrix.length=T,n.spotLightMatrix.length=A+D-R,n.spotLightMap.length=D,n.numSpotLightShadowsWithMaps=R,n.numLightProbes=F,w.directionalLength=v,w.pointLength=y,w.spotLength=E,w.rectAreaLength=S,w.hemiLength=_,w.numDirectionalShadows=M,w.numPointShadows=T,w.numSpotShadows=A,w.numSpotMaps=D,w.numLightProbes=F,n.version=xP++)}function h(f,p){let g=0,m=0,v=0,y=0,E=0;const S=p.matrixWorldInverse;for(let _=0,M=f.length;_<M;_++){const T=f[_];if(T.isDirectionalLight){const A=n.directional[g];A.direction.setFromMatrixPosition(T.matrixWorld),s.setFromMatrixPosition(T.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(S),g++}else if(T.isSpotLight){const A=n.spot[v];A.position.setFromMatrixPosition(T.matrixWorld),A.position.applyMatrix4(S),A.direction.setFromMatrixPosition(T.matrixWorld),s.setFromMatrixPosition(T.target.matrixWorld),A.direction.sub(s),A.direction.transformDirection(S),v++}else if(T.isRectAreaLight){const A=n.rectArea[y];A.position.setFromMatrixPosition(T.matrixWorld),A.position.applyMatrix4(S),l.identity(),o.copy(T.matrixWorld),o.premultiply(S),l.extractRotation(o),A.halfWidth.set(T.width*.5,0,0),A.halfHeight.set(0,T.height*.5,0),A.halfWidth.applyMatrix4(l),A.halfHeight.applyMatrix4(l),y++}else if(T.isPointLight){const A=n.point[m];A.position.setFromMatrixPosition(T.matrixWorld),A.position.applyMatrix4(S),m++}else if(T.isHemisphereLight){const A=n.hemi[E];A.direction.setFromMatrixPosition(T.matrixWorld),A.direction.transformDirection(S),E++}}}return{setup:c,setupView:h,state:n}}function G_(i){const e=new yP(i),t=[],n=[],s=[];function o(m){g.camera=m,t.length=0,n.length=0,s.length=0}function l(m){t.push(m)}function c(m){n.push(m)}function h(m){s.push(m)}function f(){e.setup(t)}function p(m){e.setupView(t,m)}const g={lightsArray:t,shadowsArray:n,lightProbeGridArray:s,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:o,state:g,setupLights:f,setupLightsView:p,pushLight:l,pushShadow:c,pushLightProbeGrid:h}}function SP(i){let e=new WeakMap;function t(s,o=0){const l=e.get(s);let c;return l===void 0?(c=new G_(i),e.set(s,[c])):o>=l.length?(c=new G_(i),l.push(c)):c=l[o],c}
vendor: 4,076 bytes, lines 4053-4080
4053function n(){e=new WeakMap}return{get:t,dispose:n}}const bP=`void main() { 4054 gl_Position = vec4( position, 1.0 ); 4055}`,MP=`uniform sampler2D shadow_pass; 4056uniform vec2 resolution; 4057uniform float radius; 4058void main() { 4059 const float samples = float( VSM_SAMPLES ); 4060 float mean = 0.0; 4061 float squared_mean = 0.0; 4062 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 4063 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 4064 for ( float i = 0.0; i < samples; i ++ ) { 4065 float uvOffset = uvStart + i * uvStride; 4066 #ifdef HORIZONTAL_PASS 4067 vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; 4068 mean += distribution.x; 4069 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 4070 #else 4071 float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; 4072 mean += depth; 4073 squared_mean += depth * depth; 4074 #endif 4075 } 4076 mean = mean / samples; 4077 squared_mean = squared_mean / samples; 4078 float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); 4079 gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); 4080}`,EP=[new B(1,0,0),new B(-1,0,0),new B(0,1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1)],TP=[new B(0,-1,0),new B(0,-1,0),new B(0,0,1),new B(0,0,-1),new B(0,-1,0),new B(0,-1,0)],W_=new mt,Wl=new B,lm=new B;function wP(i,e,t){let n=new Qo;const s=new ae,o=new ae,l=new Zt,c=new Mg,h=new Eg,f={},p=t.maxTextureSize,g={[Is]:Nn,[Nn]:Is,[ni]:ni},m=new En({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ae},radius:{value:4}},vertexShader:bP,fragmentShader:MP}),v=m.clone();v.defines.HORIZONTAL_PASS=1;const y=new gt;y.setAttribute("position",new Qt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Mn(y,m),S=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ko;let _=this.type;this.render=function(R,F,w){if(S.enabled===!1||S.autoUpdate===!1&&S.needsUpdate===!1||R.length===0)return;this.type===Zl&&(De("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=ko);const L=i.getRenderTarget(),U=i.getActiveCubeFace(),O=i.getActiveMipmapLevel(),H=i.state;H.setBlending(jn),H.buffers.depth.getReversed()===!0?H.buffers.color.setClear(0,0,0,0):H.buffers.color.setClear(1,1,1,1),H.buffers.depth.setTest(!0),H.setScissorTest(!1);const W=_!==this.type;W&&F.traverse(function(Z){Z.material&&(Array.isArray(Z.material)?Z.material.forEach(V=>V.needsUpdate=!0):Z.material.needsUpdate=!0)});for(let Z=0,V=R.length;Z<V;Z++){const $=R[Z],K=$.shadow;if(K===void 0){De("WebGLShadowMap:",$,"has no shadow.");continue}if(K.autoUpdate===!1&&K.needsUpdate===!1)continue;s.copy(K.mapSize);const he=K.getFrameExtents();s.multiply(he),o.copy(K.mapSize),(s.x>p||s.y>p)&&(s.x>p&&(o.x=Math.floor(p/he.x),s.x=o.x*he.x,K.mapSize.x=o.x),s.y>p&&(o.y=Math.floor(p/he.y),s.y=o.y*he.y,K.mapSize.y=o.y));const ce=i.state.buffers.depth.getReversed();if(K.camera._reversedDepth=ce,K.map===null||W===!0){if(K.map!==null&&(K.map.depthTexture!==null&&(K.map.depthTexture.dispose(),K.map.depthTexture=null),K.map.dispose()),this.type===xa){if($.isPointLight){De("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}K.map=new fn(s.x,s.y,{format:Ur,type:fs,minFilter:nn,magFilter:nn,generateMipmaps:!1}),K.map.texture.name=$.name+".shadowMap",K.map.depthTexture=new Br(s.x,s.y,Yn),K.map.depthTexture.name=$.name+".shadowMapDepth",K.map.depthTexture.format=Ls,K.map.depthTexture.compareFunction=null,K.map.depthTexture.minFilter=cn,K.map.depthTexture.magFilter=cn}else $.isPointLight?(K.map=new Ng(s.x),K.map.depthTexture=new oS(s.x,ji)):(K.map=new fn(s.x,s.y),K.map.depthTexture=new Br(s.x,s.y,ji)),K.map.depthTexture.name=$.name+".shadowMap",K.map.depthTexture.format=Ls,this.type===ko?(K.map.depthTexture.compareFunction=ce?If:Rf,K.map.depthTexture.minFilter=nn,K.map.depthTexture.magFilter=nn):(K.map.depthTexture.compareFunction=null,K.map.depthTexture.minFilter=cn,K.map.depthTexture.magFilter=cn);K.camera.updateProjectionMatrix()}
vendor: 9,692 bytes, line 4080
4080const ye=K.map.isWebGLCubeRenderTarget?6:1;for(let ge=0;ge<ye;ge++){if(K.map.isWebGLCubeRenderTarget)i.setRenderTarget(K.map,ge),i.clear();else{ge===0&&(i.setRenderTarget(K.map),i.clear());const we=K.getViewport(ge);l.set(o.x*we.x,o.y*we.y,o.x*we.z,o.y*we.w),H.viewport(l)}if($.isPointLight){const we=K.camera,nt=K.matrix,st=$.distance||we.far;st!==we.far&&(we.far=st,we.updateProjectionMatrix()),Wl.setFromMatrixPosition($.matrixWorld),we.position.copy(Wl),lm.copy(we.position),lm.add(EP[ge]),we.up.copy(TP[ge]),we.lookAt(lm),we.updateMatrixWorld(),nt.makeTranslation(-Wl.x,-Wl.y,-Wl.z),W_.multiplyMatrices(we.projectionMatrix,we.matrixWorldInverse),K._frustum.setFromProjectionMatrix(W_,we.coordinateSystem,we.reversedDepth)}else K.updateMatrices($);n=K.getFrustum(),A(F,w,K.camera,$,this.type)}K.isPointLightShadow!==!0&&this.type===xa&&M(K,w),K.needsUpdate=!1}_=this.type,S.needsUpdate=!1,i.setRenderTarget(L,U,O)};function M(R,F){const w=e.update(E);m.defines.VSM_SAMPLES!==R.blurSamples&&(m.defines.VSM_SAMPLES=R.blurSamples,v.defines.VSM_SAMPLES=R.blurSamples,m.needsUpdate=!0,v.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new fn(s.x,s.y,{format:Ur,type:fs})),m.uniforms.shadow_pass.value=R.map.depthTexture,m.uniforms.resolution.value=R.mapSize,m.uniforms.radius.value=R.radius,i.setRenderTarget(R.mapPass),i.clear(),i.renderBufferDirect(F,null,w,m,E,null),v.uniforms.shadow_pass.value=R.mapPass.texture,v.uniforms.resolution.value=R.mapSize,v.uniforms.radius.value=R.radius,i.setRenderTarget(R.map),i.clear(),i.renderBufferDirect(F,null,w,v,E,null)}function T(R,F,w,L){let U=null;const O=w.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(O!==void 0)U=O;else if(U=w.isPointLight===!0?h:c,i.localClippingEnabled&&F.clipShadows===!0&&Array.isArray(F.clippingPlanes)&&F.clippingPlanes.length!==0||F.displacementMap&&F.displacementScale!==0||F.alphaMap&&F.alphaTest>0||F.map&&F.alphaTest>0||F.alphaToCoverage===!0){const H=U.uuid,W=F.uuid;let Z=f[H];Z===void 0&&(Z={},f[H]=Z);let V=Z[W];V===void 0&&(V=U.clone(),Z[W]=V,F.addEventListener("dispose",D)),U=V}if(U.visible=F.visible,U.wireframe=F.wireframe,L===xa?U.side=F.shadowSide!==null?F.shadowSide:F.side:U.side=F.shadowSide!==null?F.shadowSide:g[F.side],U.alphaMap=F.alphaMap,U.alphaTest=F.alphaToCoverage===!0?.5:F.alphaTest,U.map=F.map,U.clipShadows=F.clipShadows,U.clippingPlanes=F.clippingPlanes,U.clipIntersection=F.clipIntersection,U.displacementMap=F.displacementMap,U.displacementScale=F.displacementScale,U.displacementBias=F.displacementBias,U.wireframeLinewidth=F.wireframeLinewidth,U.linewidth=F.linewidth,w.isPointLight===!0&&U.isMeshDistanceMaterial===!0){const H=i.properties.get(U);H.light=w}return U}function A(R,F,w,L,U){if(R.visible===!1)return;if(R.layers.test(F.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&U===xa)&&(!R.frustumCulled||n.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,R.matrixWorld);const W=e.update(R),Z=R.material;if(Array.isArray(Z)){const V=W.groups;for(let $=0,K=V.length;$<K;$++){const he=V[$],ce=Z[he.materialIndex];if(ce&&ce.visible){const ye=T(R,ce,L,U);R.onBeforeShadow(i,R,F,w,W,ye,he),i.renderBufferDirect(w,null,W,ye,R,he),R.onAfterShadow(i,R,F,w,W,ye,he)}}}else if(Z.visible){const V=T(R,Z,L,U);R.onBeforeShadow(i,R,F,w,W,V,null),i.renderBufferDirect(w,null,W,V,R,null),R.onAfterShadow(i,R,F,w,W,V,null)}}const H=R.children;for(let W=0,Z=H.length;W<Z;W++)A(H[W],F,w,L,U)}function D(R){R.target.removeEventListener("dispose",D);for(const w in f){const L=f[w],U=R.target.uuid;U in L&&(L[U].dispose(),delete L[U])}}}function AP(i,e){function t(){let G=!1;const Te=new Zt;let re=null;const ze=new Zt(0,0,0,0);return{setMask:function(Ie){re!==Ie&&!G&&(i.colorMask(Ie,Ie,Ie,Ie),re=Ie)},setLocked:function(Ie){G=Ie},setClear:function(Ie,pe,Je,vt,an){an===!0&&(Ie*=vt,pe*=vt,Je*=vt),Te.set(Ie,pe,Je,vt),ze.equals(Te)===!1&&(i.clearColor(Ie,pe,Je,vt),ze.copy(Te))},reset:function(){G=!1,re=null,ze.set(-1,0,0,0)}}}function n(){let G=!1,Te=!1,re=null,ze=null,Ie=null;return{setReversed:function(pe){if(Te!==pe){const Je=e.get("EXT_clip_control");pe?Je.clipControlEXT(Je.LOWER_LEFT_EXT,Je.ZERO_TO_ONE_EXT):Je.clipControlEXT(Je.LOWER_LEFT_EXT,Je.NEGATIVE_ONE_TO_ONE_EXT),Te=pe;const vt=Ie;Ie=null,this.setClear(vt)}},getReversed:function(){return Te},setTest:function(pe){pe?Se(i.DEPTH_TEST):We(i.DEPTH_TEST)},setMask:function(pe){re!==pe&&!G&&(i.depthMask(pe),re=pe)},setFunc:function(pe){if(Te&&(pe=qE[pe]),ze!==pe){switch(pe){case Th:i.depthFunc(i.NEVER);break;case uc:i.depthFunc(i.ALWAYS);break;case wh:i.depthFunc(i.LESS);break;case wa:i.depthFunc(i.LEQUAL);break;case Ah:i.depthFunc(i.EQUAL);break;case Ch:i.depthFunc(i.GEQUAL);break;case Rh:i.depthFunc(i.GREATER);break;case Ih:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}ze=pe}},setLocked:function(pe){G=pe},setClear:function(pe){Ie!==pe&&(Ie=pe,Te&&(pe=1-pe),i.clearDepth(pe))},reset:function(){G=!1,re=null,ze=null,Ie=null,Te=!1}}}function s(){let G=!1,Te=null,re=null,ze=null,Ie=null,pe=null,Je=null,vt=null,an=null;return{setTest:function(zt){G||(zt?Se(i.STENCIL_TEST):We(i.STENCIL_TEST))},setMask:function(zt){Te!==zt&&!G&&(i.stencilMask(zt),Te=zt)},setFunc:function(zt,fi,wi){(re!==zt||ze!==fi||Ie!==wi)&&(i.stencilFunc(zt,fi,wi),re=zt,ze=fi,Ie=wi)},setOp:function(zt,fi,wi){(pe!==zt||Je!==fi||vt!==wi)&&(i.stencilOp(zt,fi,wi),pe=zt,Je=fi,vt=wi)},setLocked:function(zt){G=zt},setClear:function(zt){an!==zt&&(i.clearStencil(zt),an=zt)},reset:function(){G=!1,Te=null,re=null,ze=null,Ie=null,pe=null,Je=null,vt=null,an=null}}}const o=new t,l=new n,c=new s,h=new WeakMap,f=new WeakMap;let p={},g={},m={},v=new WeakMap,y=[],E=null,S=!1,_=null,M=null,T=null,A=null,D=null,R=null,F=null,w=new Ve(0,0,0),L=0,U=!1,O=null,H=null,W=null,Z=null,V=null;const $=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let K=!1,he=0;const ce=i.getParameter(i.VERSION);ce.indexOf("WebGL")!==-1?(he=parseFloat(/^WebGL (\d)/.exec(ce)[1]),K=he>=1):ce.indexOf("OpenGL ES")!==-1&&(he=parseFloat(/^OpenGL ES (\d)/.exec(ce)[1]),K=he>=2);let ye=null,ge={};const we=i.getParameter(i.SCISSOR_BOX),nt=i.getParameter(i.VIEWPORT),st=new Zt().fromArray(we),rt=new Zt().fromArray(nt);function oe(G,Te,re,ze){const Ie=new Uint8Array(4),pe=i.createTexture();i.bindTexture(G,pe),i.texParameteri(G,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(G,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let Je=0;Je<re;Je++)G===i.TEXTURE_3D||G===i.TEXTURE_2D_ARRAY?i.texImage3D(Te,0,i.RGBA,1,1,ze,0,i.RGBA,i.UNSIGNED_BYTE,Ie):i.texImage2D(Te+Je,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,Ie);return pe}const Ue={};Ue[i.TEXTURE_2D]=oe(i.TEXTURE_2D,i.TEXTURE_2D,1),Ue[i.TEXTURE_CUBE_MAP]=oe(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),Ue[i.TEXTURE_2D_ARRAY]=oe(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),Ue[i.TEXTURE_3D]=oe(i.TEXTURE_3D,i.TEXTURE_3D,1,1),o.setClear(0,0,0,1),l.setClear(1),c.setClear(0),Se(i.DEPTH_TEST),l.setFunc(wa),Pe(!1),Le(_m),Se(i.CULL_FACE),ve(jn);function Se(G){p[G]!==!0&&(i.enable(G),p[G]=!0)}function We(G){p[G]!==!1&&(i.disable(G),p[G]=!1)}function ot(G,Te){return m[G]!==Te?(i.bindFramebuffer(G,Te),m[G]=Te,G===i.DRAW_FRAMEBUFFER&&(m[i.FRAMEBUFFER]=Te),G===i.FRAMEBUFFER&&(m[i.DRAW_FRAMEBUFFER]=Te),!0):!1}function at(G,Te){let re=y,ze=!1;if(G){re=v.get(Te),re===void 0&&(re=[],v.set(Te,re));const Ie=G.textures;if(re.length!==Ie.length||re[0]!==i.COLOR_ATTACHMENT0){for(let pe=0,Je=Ie.length;pe<Je;pe++)re[pe]=i.COLOR_ATTACHMENT0+pe;re.length=Ie.length,ze=!0}}else re[0]!==i.BACK&&(re[0]=i.BACK,ze=!0);ze&&i.drawBuffers(re)}function Ct(G){return E!==G?(i.useProgram(G),E=G,!0):!1}const it={[Ir]:i.FUNC_ADD,[vy]:i.FUNC_SUBTRACT,[xy]:i.FUNC_REVERSE_SUBTRACT};it[_y]=i.MIN,it[yy]=i.MAX;const fe={[Sy]:i.ZERO,[by]:i.ONE,[My]:i.SRC_COLOR,[Mh]:i.SRC_ALPHA,[Ry]:i.SRC_ALPHA_SATURATE,[Ay]:i.DST_COLOR,[Ty]:i.DST_ALPHA,[Ey]:i.ONE_MINUS_SRC_COLOR,[Eh]:i.ONE_MINUS_SRC_ALPHA,[Cy]:i.ONE_MINUS_DST_COLOR,[wy]:i.ONE_MINUS_DST_ALPHA,[Iy]:i.CONSTANT_COLOR,[Py]:i.ONE_MINUS_CONSTANT_COLOR,[Ly]:i.CONSTANT_ALPHA,[Dy]:i.ONE_MINUS_CONSTANT_ALPHA};function ve(G,Te,re,ze,Ie,pe,Je,vt,an,zt){if(G===jn){S===!0&&(We(i.BLEND),S=!1);return}if(S===!1&&(Se(i.BLEND),S=!0),G!==gy){if(G!==_||zt!==U){if((M!==Ir||D!==Ir)&&(i.blendEquation(i.FUNC_ADD),M=Ir,D=Ir),zt)switch(G){case ba:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case Ho:i.blendFunc(i.ONE,i.ONE);break;case ym:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case Sm:i.blendFuncSeparate(i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA,i.ZERO,i.ONE);break;default:Qe("WebGLState: Invalid blending: ",G);break}else switch(G){case ba:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case Ho:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE,i.ONE,i.ONE);break;case ym:Qe("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case Sm:Qe("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Qe("WebGLState: Invalid blending: ",G);break}T=null,A=null,R=null,F=null,w.set(0,0,0),L=0,_=G,U=zt}return}Ie=Ie||Te,pe=pe||re,Je=Je||ze,(Te!==M||Ie!==D)&&(i.blendEquationSeparate(it[Te],it[Ie]),M=Te,D=Ie),(re!==T||ze!==A||pe!==R||Je!==F)&&(i.blendFuncSeparate(fe[re],fe[ze],fe[pe],fe[Je]),T=re,A=ze,R=pe,F=Je),(vt.equals(w)===!1||an!==L)&&(i.blendColor(vt.r,vt.g,vt.b,an),w.copy(vt),L=an),_=G,U=!1}function ue(G,Te){G.side===ni?We(i.CULL_FACE):Se(i.CULL_FACE);let re=G.side===Nn;Te&&(re=!re),Pe(re),G.blending===ba&&G.transparent===!1?ve(jn):ve(G.blending,G.blendEquation,G.blendSrc,G.blendDst,G.blendEquationAlpha,G.blendSrcAlpha,G.blendDstAlpha,G.blendColor,G.blendAlpha,G.premultipliedAlpha),l.setFu
vendor: 9,839 bytes, line 4080
4080nc(G.depthFunc),l.setTest(G.depthTest),l.setMask(G.depthWrite),o.setMask(G.colorWrite);const ze=G.stencilWrite;c.setTest(ze),ze&&(c.setMask(G.stencilWriteMask),c.setFunc(G.stencilFunc,G.stencilRef,G.stencilFuncMask),c.setOp(G.stencilFail,G.stencilZFail,G.stencilZPass)),z(G.polygonOffset,G.polygonOffsetFactor,G.polygonOffsetUnits),G.alphaToCoverage===!0?Se(i.SAMPLE_ALPHA_TO_COVERAGE):We(i.SAMPLE_ALPHA_TO_COVERAGE)}function Pe(G){O!==G&&(G?i.frontFace(i.CW):i.frontFace(i.CCW),O=G)}function Le(G){G!==dy?(Se(i.CULL_FACE),G!==H&&(G===_m?i.cullFace(i.BACK):G===py?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):We(i.CULL_FACE),H=G}function ut(G){G!==W&&(K&&i.lineWidth(G),W=G)}function z(G,Te,re){G?(Se(i.POLYGON_OFFSET_FILL),(Z!==Te||V!==re)&&(Z=Te,V=re,l.getReversed()&&(Te=-Te),i.polygonOffset(Te,re))):We(i.POLYGON_OFFSET_FILL)}function ht(G){G?Se(i.SCISSOR_TEST):We(i.SCISSOR_TEST)}function Xe(G){G===void 0&&(G=i.TEXTURE0+$-1),ye!==G&&(i.activeTexture(G),ye=G)}function $e(G,Te,re){re===void 0&&(ye===null?re=i.TEXTURE0+$-1:re=ye);let ze=ge[re];ze===void 0&&(ze={type:void 0,texture:void 0},ge[re]=ze),(ze.type!==G||ze.texture!==Te)&&(ye!==re&&(i.activeTexture(re),ye=re),i.bindTexture(G,Te||Ue[G]),ze.type=G,ze.texture=Te)}function _e(){const G=ge[ye];G!==void 0&&G.type!==void 0&&(i.bindTexture(G.type,null),G.type=void 0,G.texture=void 0)}function kt(){try{i.compressedTexImage2D(...arguments)}catch(G){Qe("WebGLState:",G)}}function N(){try{i.compressedTexImage3D(...arguments)}catch(G){Qe("WebGLState:",G)}}function C(){try{i.texSubImage2D(...arguments)}catch(G){Qe("WebGLState:",G)}}function Y(){try{i.texSubImage3D(...arguments)}catch(G){Qe("WebGLState:",G)}}function se(){try{i.compressedTexSubImage2D(...arguments)}catch(G){Qe("WebGLState:",G)}}function de(){try{i.compressedTexSubImage3D(...arguments)}catch(G){Qe("WebGLState:",G)}}function be(){try{i.texStorage2D(...arguments)}catch(G){Qe("WebGLState:",G)}}function Ae(){try{i.texStorage3D(...arguments)}catch(G){Qe("WebGLState:",G)}}function ie(){try{i.texImage2D(...arguments)}catch(G){Qe("WebGLState:",G)}}function le(){try{i.texImage3D(...arguments)}catch(G){Qe("WebGLState:",G)}}function Be(G){return g[G]!==void 0?g[G]:i.getParameter(G)}function qe(G,Te){g[G]!==Te&&(i.pixelStorei(G,Te),g[G]=Te)}function Re(G){st.equals(G)===!1&&(i.scissor(G.x,G.y,G.z,G.w),st.copy(G))}function Ce(G){rt.equals(G)===!1&&(i.viewport(G.x,G.y,G.z,G.w),rt.copy(G))}function pt(G,Te){let re=f.get(Te);re===void 0&&(re=new WeakMap,f.set(Te,re));let ze=re.get(G);ze===void 0&&(ze=i.getUniformBlockIndex(Te,G.name),re.set(G,ze))}function St(G,Te){const ze=f.get(Te).get(G);h.get(Te)!==ze&&(i.uniformBlockBinding(Te,ze,G.__bindingPointIndex),h.set(Te,ze))}function Ft(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),l.setReversed(!1),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),i.pixelStorei(i.PACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL),i.pixelStorei(i.PACK_ROW_LENGTH,0),i.pixelStorei(i.PACK_SKIP_PIXELS,0),i.pixelStorei(i.PACK_SKIP_ROWS,0),i.pixelStorei(i.UNPACK_ROW_LENGTH,0),i.pixelStorei(i.UNPACK_IMAGE_HEIGHT,0),i.pixelStorei(i.UNPACK_SKIP_PIXELS,0),i.pixelStorei(i.UNPACK_SKIP_ROWS,0),i.pixelStorei(i.UNPACK_SKIP_IMAGES,0),p={},g={},ye=null,ge={},m={},v=new WeakMap,y=[],E=null,S=!1,_=null,M=null,T=null,A=null,D=null,R=null,F=null,w=new Ve(0,0,0),L=0,U=!1,O=null,H=null,W=null,Z=null,V=null,st.set(0,0,i.canvas.width,i.canvas.height),rt.set(0,0,i.canvas.width,i.canvas.height),o.reset(),l.reset(),c.reset()}return{buffers:{color:o,depth:l,stencil:c},enable:Se,disable:We,bindFramebuffer:ot,drawBuffers:at,useProgram:Ct,setBlending:ve,setMaterial:ue,setFlipSided:Pe,setCullFace:Le,setLineWidth:ut,setPolygonOffset:z,setScissorTest:ht,activeTexture:Xe,bindTexture:$e,unbindTexture:_e,compressedTexImage2D:kt,compressedTexImage3D:N,texImage2D:ie,texImage3D:le,pixelStorei:qe,getParameter:Be,updateUBOMapping:pt,uniformBlockBinding:St,texStorage2D:be,texStorage3D:Ae,texSubImage2D:C,texSubImage3D:Y,compressedTexSubImage2D:se,compressedTexSubImage3D:de,scissor:Re,viewport:Ce,reset:Ft}}function CP(i,e,t,n,s,o,l){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new ae,p=new WeakMap,g=new Set;let m;const v=new WeakMap;let y=!1;try{y=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(N,C){return y?new OffscreenCanvas(N,C):_c("canvas")}function S(N,C,Y){let se=1;const de=kt(N);if((de.width>Y||de.height>Y)&&(se=Y/Math.max(de.width,de.height)),se<1)if(typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&N instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&N instanceof ImageBitmap||typeof VideoFrame<"u"&&N instanceof VideoFrame){const be=Math.floor(se*de.width),Ae=Math.floor(se*de.height);m===void 0&&(m=E(be,Ae));const ie=C?E(be,Ae):m;return ie.width=be,ie.height=Ae,ie.getContext("2d").drawImage(N,0,0,be,Ae),De("WebGLRenderer: Texture has been resized from ("+de.width+"x"+de.height+") to ("+be+"x"+Ae+")."),ie}else return"data"in N&&De("WebGLRenderer: Image in DataTexture is too big ("+de.width+"x"+de.height+")."),N;return N}function _(N){return N.generateMipmaps}function M(N){i.generateMipmap(N)}function T(N){return N.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:N.isWebGL3DRenderTarget?i.TEXTURE_3D:N.isWebGLArrayRenderTarget||N.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function A(N,C,Y,se,de,be=!1){if(N!==null){if(i[N]!==void 0)return i[N];De("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let Ae;se&&(Ae=e.get("EXT_texture_norm16"),Ae||De("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let ie=C;if(C===i.RED&&(Y===i.FLOAT&&(ie=i.R32F),Y===i.HALF_FLOAT&&(ie=i.R16F),Y===i.UNSIGNED_BYTE&&(ie=i.R8),Y===i.UNSIGNED_SHORT&&Ae&&(ie=Ae.R16_EXT),Y===i.SHORT&&Ae&&(ie=Ae.R16_SNORM_EXT)),C===i.RED_INTEGER&&(Y===i.UNSIGNED_BYTE&&(ie=i.R8UI),Y===i.UNSIGNED_SHORT&&(ie=i.R16UI),Y===i.UNSIGNED_INT&&(ie=i.R32UI),Y===i.BYTE&&(ie=i.R8I),Y===i.SHORT&&(ie=i.R16I),Y===i.INT&&(ie=i.R32I)),C===i.RG&&(Y===i.FLOAT&&(ie=i.RG32F),Y===i.HALF_FLOAT&&(ie=i.RG16F),Y===i.UNSIGNED_BYTE&&(ie=i.RG8),Y===i.UNSIGNED_SHORT&&Ae&&(ie=Ae.RG16_EXT),Y===i.SHORT&&Ae&&(ie=Ae.RG16_SNORM_EXT)),C===i.RG_INTEGER&&(Y===i.UNSIGNED_BYTE&&(ie=i.RG8UI),Y===i.UNSIGNED_SHORT&&(ie=i.RG16UI),Y===i.UNSIGNED_INT&&(ie=i.RG32UI),Y===i.BYTE&&(ie=i.RG8I),Y===i.SHORT&&(ie=i.RG16I),Y===i.INT&&(ie=i.RG32I)),C===i.RGB_INTEGER&&(Y===i.UNSIGNED_BYTE&&(ie=i.RGB8UI),Y===i.UNSIGNED_SHORT&&(ie=i.RGB16UI),Y===i.UNSIGNED_INT&&(ie=i.RGB32UI),Y===i.BYTE&&(ie=i.RGB8I),Y===i.SHORT&&(ie=i.RGB16I),Y===i.INT&&(ie=i.RGB32I)),C===i.RGBA_INTEGER&&(Y===i.UNSIGNED_BYTE&&(ie=i.RGBA8UI),Y===i.UNSIGNED_SHORT&&(ie=i.RGBA16UI),Y===i.UNSIGNED_INT&&(ie=i.RGBA32UI),Y===i.BYTE&&(ie=i.RGBA8I),Y===i.SHORT&&(ie=i.RGBA16I),Y===i.INT&&(ie=i.RGBA32I)),C===i.RGB&&(Y===i.UNSIGNED_SHORT&&Ae&&(ie=Ae.RGB16_EXT),Y===i.SHORT&&Ae&&(ie=Ae.RGB16_SNORM_EXT),Y===i.UNSIGNED_INT_5_9_9_9_REV&&(ie=i.RGB9_E5),Y===i.UNSIGNED_INT_10F_11F_11F_REV&&(ie=i.R11F_G11F_B10F)),C===i.RGBA){const le=be?vc:It.getTransfer(de);Y===i.FLOAT&&(ie=i.RGBA32F),Y===i.HALF_FLOAT&&(ie=i.RGBA16F),Y===i.UNSIGNED_BYTE&&(ie=le===Jt?i.SRGB8_ALPHA8:i.RGBA8),Y===i.UNSIGNED_SHORT&&Ae&&(ie=Ae.RGBA16_EXT),Y===i.SHORT&&Ae&&(ie=Ae.RGBA16_SNORM_EXT),Y===i.UNSIGNED_SHORT_4_4_4_4&&(ie=i.RGBA4),Y===i.UNSIGNED_SHORT_5_5_5_1&&(ie=i.RGB5_A1)}return(ie===i.R16F||ie===i.R32F||ie===i.RG16F||ie===i.RG32F||ie===i.RGBA16F||ie===i.RGBA32F)&&e.get("EXT_color_buffer_float"),ie}function D(N,C){let Y;return N?C===null||C===ji||C===Aa?Y=i.DEPTH24_STENCIL8:C===Yn?Y=i.DEPTH32F_STENCIL8:C===Go&&(Y=i.DEPTH24_STENCIL8,De("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===ji||C===Aa?Y=i.DEPTH_COMPONENT24:C===Yn?Y=i.DEPTH_COMPONENT32F:C===Go&&(Y=i.DEPTH_COMPONENT16),Y}function R(N,C){return _(N)===!0||N.isFramebufferTexture&&N.minFilter!==cn&&N.minFilter!==nn?Math.log2(Math.max(C.width,C.height))+1:N.mipmaps!==void 0&&N.mipmaps.length>0?N.mipmaps.length:N.isCompressedTexture&&Array.isArray(N.image)?C.mipmaps.length:1}function F(N){const C=N.target;C.removeEventListener("dispose",F),L(C),C.isVideoTexture&&p.delete(C),C.isHTMLTexture&&g.delete(C)}function w(N){const C=N.target;C.removeEventListener("dispose",w),O(C)}function L(N){const C=n.get(N);if(C.__webglInit===void 0)return;const Y=N.source,se=v.get(Y);if(se){const de=se[C.__cacheKey];de.usedTimes--,de.usedTimes===0&&U(N),Object.keys(se).length===0&&v.delete(Y)}n.remove(N)}function U(N){const C=n.get(N);i.deleteTexture(C.__webglTexture);const Y=N.source,se=v.get(Y);delete se[C.__cacheKey],l.memory.textures--}function O(N){const C=n.get(N);if(N.depthTexture&&(N.depthTexture.dispose(),n.remove(N.depthTexture)),N.isWebGLCubeRen
vendor: 5,720 bytes, line 4080
4080derTarget)for(let se=0;se<6;se++){if(Array.isArray(C.__webglFramebuffer[se]))for(let de=0;de<C.__webglFramebuffer[se].length;de++)i.deleteFramebuffer(C.__webglFramebuffer[se][de]);else i.deleteFramebuffer(C.__webglFramebuffer[se]);C.__webglDepthbuffer&&i.deleteRenderbuffer(C.__webglDepthbuffer[se])}else{if(Array.isArray(C.__webglFramebuffer))for(let se=0;se<C.__webglFramebuffer.length;se++)i.deleteFramebuffer(C.__webglFramebuffer[se]);else i.deleteFramebuffer(C.__webglFramebuffer);if(C.__webglDepthbuffer&&i.deleteRenderbuffer(C.__webglDepthbuffer),C.__webglMultisampledFramebuffer&&i.deleteFramebuffer(C.__webglMultisampledFramebuffer),C.__webglColorRenderbuffer)for(let se=0;se<C.__webglColorRenderbuffer.length;se++)C.__webglColorRenderbuffer[se]&&i.deleteRenderbuffer(C.__webglColorRenderbuffer[se]);C.__webglDepthRenderbuffer&&i.deleteRenderbuffer(C.__webglDepthRenderbuffer)}const Y=N.textures;for(let se=0,de=Y.length;se<de;se++){const be=n.get(Y[se]);be.__webglTexture&&(i.deleteTexture(be.__webglTexture),l.memory.textures--),n.remove(Y[se])}n.remove(N)}let H=0;function W(){H=0}function Z(){return H}function V(N){H=N}function $(){const N=H;return N>=s.maxTextures&&De("WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+s.maxTextures),H+=1,N}function K(N){const C=[];return C.push(N.wrapS),C.push(N.wrapT),C.push(N.wrapR||0),C.push(N.magFilter),C.push(N.minFilter),C.push(N.anisotropy),C.push(N.internalFormat),C.push(N.format),C.push(N.type),C.push(N.generateMipmaps),C.push(N.premultiplyAlpha),C.push(N.flipY),C.push(N.unpackAlignment),C.push(N.colorSpace),C.join()}function he(N,C){const Y=n.get(N);if(N.isVideoTexture&&$e(N),N.isRenderTargetTexture===!1&&N.isExternalTexture!==!0&&N.version>0&&Y.__version!==N.version){const se=N.image;if(se===null)De("WebGLRenderer: Texture marked for update but no image data found.");else if(se.complete===!1)De("WebGLRenderer: Texture marked for update but image is incomplete");else{We(Y,N,C);return}}else N.isExternalTexture&&(Y.__webglTexture=N.sourceTexture?N.sourceTexture:null);t.bindTexture(i.TEXTURE_2D,Y.__webglTexture,i.TEXTURE0+C)}function ce(N,C){const Y=n.get(N);if(N.isRenderTargetTexture===!1&&N.version>0&&Y.__version!==N.version){We(Y,N,C);return}else N.isExternalTexture&&(Y.__webglTexture=N.sourceTexture?N.sourceTexture:null);t.bindTexture(i.TEXTURE_2D_ARRAY,Y.__webglTexture,i.TEXTURE0+C)}function ye(N,C){const Y=n.get(N);if(N.isRenderTargetTexture===!1&&N.version>0&&Y.__version!==N.version){We(Y,N,C);return}t.bindTexture(i.TEXTURE_3D,Y.__webglTexture,i.TEXTURE0+C)}function ge(N,C){const Y=n.get(N);if(N.isCubeDepthTexture!==!0&&N.version>0&&Y.__version!==N.version){ot(Y,N,C);return}t.bindTexture(i.TEXTURE_CUBE_MAP,Y.__webglTexture,i.TEXTURE0+C)}const we={[hc]:i.REPEAT,[bi]:i.CLAMP_TO_EDGE,[fc]:i.MIRRORED_REPEAT},nt={[cn]:i.NEAREST,[Jm]:i.NEAREST_MIPMAP_NEAREST,[Oo]:i.NEAREST_MIPMAP_LINEAR,[nn]:i.LINEAR,[Ql]:i.LINEAR_MIPMAP_NEAREST,[Cs]:i.LINEAR_MIPMAP_LINEAR},st={[Vy]:i.NEVER,[qy]:i.ALWAYS,[Hy]:i.LESS,[Rf]:i.LEQUAL,[Gy]:i.EQUAL,[If]:i.GEQUAL,[Wy]:i.GREATER,[Xy]:i.NOTEQUAL};function rt(N,C){if(C.type===Yn&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===nn||C.magFilter===Ql||C.magFilter===Oo||C.magFilter===Cs||C.minFilter===nn||C.minFilter===Ql||C.minFilter===Oo||C.minFilter===Cs)&&De("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(N,i.TEXTURE_WRAP_S,we[C.wrapS]),i.texParameteri(N,i.TEXTURE_WRAP_T,we[C.wrapT]),(N===i.TEXTURE_3D||N===i.TEXTURE_2D_ARRAY)&&i.texParameteri(N,i.TEXTURE_WRAP_R,we[C.wrapR]),i.texParameteri(N,i.TEXTURE_MAG_FILTER,nt[C.magFilter]),i.texParameteri(N,i.TEXTURE_MIN_FILTER,nt[C.minFilter]),C.compareFunction&&(i.texParameteri(N,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(N,i.TEXTURE_COMPARE_FUNC,st[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===cn||C.minFilter!==Oo&&C.minFilter!==Cs||C.type===Yn&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||n.get(C).__currentAnisotropy){const Y=e.get("EXT_texture_filter_anisotropic");i.texParameterf(N,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,s.getMaxAnisotropy())),n.get(C).__currentAnisotropy=C.anisotropy}}}function oe(N,C){let Y=!1;N.__webglInit===void 0&&(N.__webglInit=!0,C.addEventListener("dispose",F));const se=C.source;let de=v.get(se);de===void 0&&(de={},v.set(se,de));const be=K(C);if(be!==N.__cacheKey){de[be]===void 0&&(de[be]={texture:i.createTexture(),usedTimes:0},l.memory.textures++,Y=!0),de[be].usedTimes++;const Ae=de[N.__cacheKey];Ae!==void 0&&(de[N.__cacheKey].usedTimes--,Ae.usedTimes===0&&U(C)),N.__cacheKey=be,N.__webglTexture=de[be].texture}return Y}function Ue(N,C,Y){return Math.floor(Math.floor(N/Y)/C)}function Se(N,C,Y,se){const be=N.updateRanges;if(be.length===0)t.texSubImage2D(i.TEXTURE_2D,0,0,0,C.width,C.height,Y,se,C.data);else{be.sort((qe,Re)=>qe.start-Re.start);let Ae=0;for(let qe=1;qe<be.length;qe++){const Re=be[Ae],Ce=be[qe],pt=Re.start+Re.count,St=Ue(Ce.start,C.width,4),Ft=Ue(Re.start,C.width,4);Ce.start<=pt+1&&St===Ft&&Ue(Ce.start+Ce.count-1,C.width,4)===St?Re.count=Math.max(Re.count,Ce.start+Ce.count-Re.start):(++Ae,be[Ae]=Ce)}be.length=Ae+1;const ie=t.getParameter(i.UNPACK_ROW_LENGTH),le=t.getParameter(i.UNPACK_SKIP_PIXELS),Be=t.getParameter(i.UNPACK_SKIP_ROWS);t.pixelStorei(i.UNPACK_ROW_LENGTH,C.width);for(let qe=0,Re=be.length;qe<Re;qe++){const Ce=be[qe],pt=Math.floor(Ce.start/4),St=Math.ceil(Ce.count/4),Ft=pt%C.width,G=Math.floor(pt/C.width),Te=St,re=1;t.pixelStorei(i.UNPACK_SKIP_PIXELS,Ft),t.pixelStorei(i.UNPACK_SKIP_ROWS,G),t.texSubImage2D(i.TEXTURE_2D,0,Ft,G,Te,re,Y,
vendor: 5,555 bytes, line 4080
4080se,C.data)}N.clearUpdateRanges(),t.pixelStorei(i.UNPACK_ROW_LENGTH,ie),t.pixelStorei(i.UNPACK_SKIP_PIXELS,le),t.pixelStorei(i.UNPACK_SKIP_ROWS,Be)}}function We(N,C,Y){let se=i.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(se=i.TEXTURE_2D_ARRAY),C.isData3DTexture&&(se=i.TEXTURE_3D);const de=oe(N,C),be=C.source;t.bindTexture(se,N.__webglTexture,i.TEXTURE0+Y);const Ae=n.get(be);if(be.version!==Ae.__version||de===!0){if(t.activeTexture(i.TEXTURE0+Y),(typeof ImageBitmap<"u"&&C.image instanceof ImageBitmap)===!1){const re=It.getPrimaries(It.workingColorSpace),ze=C.colorSpace===cs?null:It.getPrimaries(C.colorSpace),Ie=C.colorSpace===cs||re===ze?i.NONE:i.BROWSER_DEFAULT_WEBGL;t.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,C.flipY),t.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),t.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ie)}t.pixelStorei(i.UNPACK_ALIGNMENT,C.unpackAlignment);let le=S(C.image,!1,s.maxTextureSize);le=_e(C,le);const Be=o.convert(C.format,C.colorSpace),qe=o.convert(C.type);let Re=A(C.internalFormat,Be,qe,C.normalized,C.colorSpace,C.isVideoTexture);rt(se,C);let Ce;const pt=C.mipmaps,St=C.isVideoTexture!==!0,Ft=Ae.__version===void 0||de===!0,G=be.dataReady,Te=R(C,le);if(C.isDepthTexture)Re=D(C.format===er,C.type),Ft&&(St?t.texStorage2D(i.TEXTURE_2D,1,Re,le.width,le.height):t.texImage2D(i.TEXTURE_2D,0,Re,le.width,le.height,0,Be,qe,null));else if(C.isDataTexture)if(pt.length>0){St&&Ft&&t.texStorage2D(i.TEXTURE_2D,Te,Re,pt[0].width,pt[0].height);for(let re=0,ze=pt.length;re<ze;re++)Ce=pt[re],St?G&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Ce.width,Ce.height,Be,qe,Ce.data):t.texImage2D(i.TEXTURE_2D,re,Re,Ce.width,Ce.height,0,Be,qe,Ce.data);C.generateMipmaps=!1}else St?(Ft&&t.texStorage2D(i.TEXTURE_2D,Te,Re,le.width,le.height),G&&Se(C,le,Be,qe)):t.texImage2D(i.TEXTURE_2D,0,Re,le.width,le.height,0,Be,qe,le.data);else if(C.isCompressedTexture)if(C.isCompressedArrayTexture){St&&Ft&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Te,Re,pt[0].width,pt[0].height,le.depth);for(let re=0,ze=pt.length;re<ze;re++)if(Ce=pt[re],C.format!==ii)if(Be!==null)if(St){if(G)if(C.layerUpdates.size>0){const Ie=Dm(Ce.width,Ce.height,C.format,C.type);for(const pe of C.layerUpdates){const Je=Ce.data.subarray(pe*Ie/Ce.data.BYTES_PER_ELEMENT,(pe+1)*Ie/Ce.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,pe,Ce.width,Ce.height,1,Be,Je)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,0,Ce.width,Ce.height,le.depth,Be,Ce.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,re,Re,Ce.width,Ce.height,le.depth,0,Ce.data,0,0);else De("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else St?G&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,re,0,0,0,Ce.width,Ce.height,le.depth,Be,qe,Ce.data):t.texImage3D(i.TEXTURE_2D_ARRAY,re,Re,Ce.width,Ce.height,le.depth,0,Be,qe,Ce.data)}else{St&&Ft&&t.texStorage2D(i.TEXTURE_2D,Te,Re,pt[0].width,pt[0].height);for(let re=0,ze=pt.length;re<ze;re++)Ce=pt[re],C.format!==ii?Be!==null?St?G&&t.compressedTexSubImage2D(i.TEXTURE_2D,re,0,0,Ce.width,Ce.height,Be,Ce.data):t.compressedTexImage2D(i.TEXTURE_2D,re,Re,Ce.width,Ce.height,0,Ce.data):De("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):St?G&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Ce.width,Ce.height,Be,qe,Ce.data):t.texImage2D(i.TEXTURE_2D,re,Re,Ce.width,Ce.height,0,Be,qe,Ce.data)}else if(C.isDataArrayTexture)if(St){if(Ft&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Te,Re,le.width,le.height,le.depth),G)if(C.layerUpdates.size>0){const re=Dm(le.width,le.height,C.format,C.type);for(const ze of C.layerUpdates){const Ie=le.data.subarray(ze*re/le.data.BYTES_PER_ELEMENT,(ze+1)*re/le.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,ze,le.width,le.height,1,Be,qe,Ie)}C.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,le.width,le.height,le.depth,Be,qe,le.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Re,le.width,le.height,le.depth,0,Be,qe,le.data);else if(C.isData3DTexture)St?(Ft&&t.texStorage3D(i.TEXTURE_3D,Te,Re,le.width,le.height,le.depth),G&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,le.width,le.height,le.depth,Be,qe,le.data)):t.texImage3D(i.TEXTURE_3D,0,Re,le.width,le.height,le.depth,0,Be,qe,le.data);else if(C.isFramebufferTexture){if(Ft)if(St)t.texStorage2D(i.TEXTURE_2D,Te,Re,le.width,le.height);else{let re=le.width,ze=le.height;for(let Ie=0;Ie<Te;Ie++)t.texImage2D(i.TEXTURE_2D,Ie,Re,re,ze,0,Be,qe,null),re>>=1,ze>>=1}}else if(C.isHTMLTexture){if("texElementImage2D"in i){const re=i.canvas;if(re.hasAttribute("layoutsubtree")||re.setAttribute("layoutsubtree","true"),le.parentNode!==re){re.appendChild(le),g.add(C),re.onpaint=vt=>{const an=vt.changedElements;for(const zt of g)an.includes(zt.image)&&(zt.needsUpdate=!0)},re.requestPaint();return}const ze=0,Ie=i.RGBA,pe=i.RGBA,Je=i.UNSIGNED_BYTE;i.texElementImage2D(i.TEXTURE_2D,ze,Ie,pe,Je,le),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE)}}else if(pt.length>0){if(St&&Ft){const re=kt(pt[0]);t.texStorage2D(i.TEXTURE_2D,Te,Re,re.width,re.height)}for(let re=0,ze=pt.length;re<ze;re++)Ce=pt[re],St?G&&t.texSubImage2D(i.TEXTURE_2D,re,0,0,Be,qe,Ce):t.texImage2D(i.TEXTURE_2D,re,Re,Be,qe,Ce);C.generateMipmaps=!1}else if(St){if(Ft){const re=kt(le);t.texStorage2D(i.TEXTURE_2D,Te,Re,re.width,re.height)}G&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Be,qe,le)}else t.texImage2D(i.TEXTURE_2D,0,Re,Be,qe,le);
vendor: 14,542 bytes, line 4080
4080_(C)&&M(se),Ae.__version=be.version,C.onUpdate&&C.onUpdate(C)}N.__version=C.version}function ot(N,C,Y){if(C.image.length!==6)return;const se=oe(N,C),de=C.source;t.bindTexture(i.TEXTURE_CUBE_MAP,N.__webglTexture,i.TEXTURE0+Y);const be=n.get(de);if(de.version!==be.__version||se===!0){t.activeTexture(i.TEXTURE0+Y);const Ae=It.getPrimaries(It.workingColorSpace),ie=C.colorSpace===cs?null:It.getPrimaries(C.colorSpace),le=C.colorSpace===cs||Ae===ie?i.NONE:i.BROWSER_DEFAULT_WEBGL;t.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,C.flipY),t.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),t.pixelStorei(i.UNPACK_ALIGNMENT,C.unpackAlignment),t.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,le);const Be=C.isCompressedTexture||C.image[0].isCompressedTexture,qe=C.image[0]&&C.image[0].isDataTexture,Re=[];for(let pe=0;pe<6;pe++)!Be&&!qe?Re[pe]=S(C.image[pe],!0,s.maxCubemapSize):Re[pe]=qe?C.image[pe].image:C.image[pe],Re[pe]=_e(C,Re[pe]);const Ce=Re[0],pt=o.convert(C.format,C.colorSpace),St=o.convert(C.type),Ft=A(C.internalFormat,pt,St,C.normalized,C.colorSpace),G=C.isVideoTexture!==!0,Te=be.__version===void 0||se===!0,re=de.dataReady;let ze=R(C,Ce);rt(i.TEXTURE_CUBE_MAP,C);let Ie;if(Be){G&&Te&&t.texStorage2D(i.TEXTURE_CUBE_MAP,ze,Ft,Ce.width,Ce.height);for(let pe=0;pe<6;pe++){Ie=Re[pe].mipmaps;for(let Je=0;Je<Ie.length;Je++){const vt=Ie[Je];C.format!==ii?pt!==null?G?re&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,Je,0,0,vt.width,vt.height,pt,vt.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,Je,Ft,vt.width,vt.height,0,vt.data):De("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):G?re&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,Je,0,0,vt.width,vt.height,pt,St,vt.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,Je,Ft,vt.width,vt.height,0,pt,St,vt.data)}}}else{if(Ie=C.mipmaps,G&&Te){Ie.length>0&&ze++;const pe=kt(Re[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,ze,Ft,pe.width,pe.height)}for(let pe=0;pe<6;pe++)if(qe){G?re&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,0,0,Re[pe].width,Re[pe].height,pt,St,Re[pe].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,Ft,Re[pe].width,Re[pe].height,0,pt,St,Re[pe].data);for(let Je=0;Je<Ie.length;Je++){const an=Ie[Je].image[pe].image;G?re&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,Je+1,0,0,an.width,an.height,pt,St,an.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,Je+1,Ft,an.width,an.height,0,pt,St,an.data)}}else{G?re&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,0,0,pt,St,Re[pe]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,Ft,pt,St,Re[pe]);for(let Je=0;Je<Ie.length;Je++){const vt=Ie[Je];G?re&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,Je+1,0,0,pt,St,vt.image[pe]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+pe,Je+1,Ft,pt,St,vt.image[pe])}}}_(C)&&M(i.TEXTURE_CUBE_MAP),be.__version=de.version,C.onUpdate&&C.onUpdate(C)}N.__version=C.version}function at(N,C,Y,se,de,be){const Ae=o.convert(Y.format,Y.colorSpace),ie=o.convert(Y.type),le=A(Y.internalFormat,Ae,ie,Y.normalized,Y.colorSpace),Be=n.get(C),qe=n.get(Y);if(qe.__renderTarget=C,!Be.__hasExternalTextures){const Re=Math.max(1,C.width>>be),Ce=Math.max(1,C.height>>be);de===i.TEXTURE_3D||de===i.TEXTURE_2D_ARRAY?t.texImage3D(de,be,le,Re,Ce,C.depth,0,Ae,ie,null):t.texImage2D(de,be,le,Re,Ce,0,Ae,ie,null)}t.bindFramebuffer(i.FRAMEBUFFER,N),Xe(C)?c.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,se,de,qe.__webglTexture,0,ht(C)):(de===i.TEXTURE_2D||de>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&de<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,se,de,qe.__webglTexture,be),t.bindFramebuffer(i.FRAMEBUFFER,null)}function Ct(N,C,Y){if(i.bindRenderbuffer(i.RENDERBUFFER,N),C.depthBuffer){const se=C.depthTexture,de=se&&se.isDepthTexture?se.type:null,be=D(C.stencilBuffer,de),Ae=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;Xe(C)?c.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,ht(C),be,C.width,C.height):Y?i.renderbufferStorageMultisample(i.RENDERBUFFER,ht(C),be,C.width,C.height):i.renderbufferStorage(i.RENDERBUFFER,be,C.width,C.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ae,i.RENDERBUFFER,N)}else{const se=C.textures;for(let de=0;de<se.length;de++){const be=se[de],Ae=o.convert(be.format,be.colorSpace),ie=o.convert(be.type),le=A(be.internalFormat,Ae,ie,be.normalized,be.colorSpace);Xe(C)?c.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,ht(C),le,C.width,C.height):Y?i.renderbufferStorageMultisample(i.RENDERBUFFER,ht(C),le,C.width,C.height):i.renderbufferStorage(i.RENDERBUFFER,le,C.width,C.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function it(N,C,Y){const se=C.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(i.FRAMEBUFFER,N),!(C.depthTexture&&C.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const de=n.get(C.depthTexture);if(de.__renderTarget=C,(!de.__webglTexture||C.depthTexture.image.width!==C.width||C.depthTexture.image.height!==C.height)&&(C.depthTexture.image.width=C.width,C.depthTexture.image.height=C.height,C.depthTexture.needsUpdate=!0),se){if(de.__webglInit===void 0&&(de.__webglInit=!0,C.depthTexture.addEventListener("dispose",F)),de.__webglTexture===void 0){de.__webglTexture=i.createTexture(),t.bindTexture(i.TEXTURE_CUBE_MAP,de.__webglTexture),rt(i.TEXTURE_CUBE_MAP,C.depthTexture);const Be=o.convert(C.depthTexture.format),qe=o.convert(C.depthTexture.type);let Re;C.depthTexture.format===Ls?Re=i.DEPTH_COMPONENT24:C.depthTexture.format===er&&(Re=i.DEPTH24_STENCIL8);for(let Ce=0;Ce<6;Ce++)i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,0,Re,C.width,C.height,0,Be,qe,null)}}else he(C.depthTexture,0);const be=de.__webglTexture,Ae=ht(C),ie=se?i.TEXTURE_CUBE_MAP_POSITIVE_X+Y:i.TEXTURE_2D,le=C.depthTexture.format===er?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;if(C.depthTexture.format===Ls)Xe(C)?c.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,le,ie,be,0,Ae):i.framebufferTexture2D(i.FRAMEBUFFER,le,ie,be,0);else if(C.depthTexture.format===er)Xe(C)?c.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,le,ie,be,0,Ae):i.framebufferTexture2D(i.FRAMEBUFFER,le,ie,be,0);else throw new Error("Unknown depthTexture format")}function fe(N){const C=n.get(N),Y=N.isWebGLCubeRenderTarget===!0;if(C.__boundDepthTexture!==N.depthTexture){const se=N.depthTexture;if(C.__depthDisposeCallback&&C.__depthDisposeCallback(),se){const de=()=>{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,se.removeEventListener("dispose",de)};se.addEventListener("dispose",de),C.__depthDisposeCallback=de}C.__boundDepthTexture=se}if(N.depthTexture&&!C.__autoAllocateDepthBuffer)if(Y)for(let se=0;se<6;se++)it(C.__webglFramebuffer[se],N,se);else{const se=N.texture.mipmaps;se&&se.length>0?it(C.__webglFramebuffer[0],N,0):it(C.__webglFramebuffer,N,0)}else if(Y){C.__webglDepthbuffer=[];for(let se=0;se<6;se++)if(t.bindFramebuffer(i.FRAMEBUFFER,C.__webglFramebuffer[se]),C.__webglDepthbuffer[se]===void 0)C.__webglDepthbuffer[se]=i.createRenderbuffer(),Ct(C.__webglDepthbuffer[se],N,!1);else{const de=N.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,be=C.__webglDepthbuffer[se];i.bindRenderbuffer(i.RENDERBUFFER,be),i.framebufferRenderbuffer(i.FRAMEBUFFER,de,i.RENDERBUFFER,be)}}else{const se=N.texture.mipmaps;if(se&&se.length>0?t.bindFramebuffer(i.FRAMEBUFFER,C.__webglFramebuffer[0]):t.bindFramebuffer(i.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=i.createRenderbuffer(),Ct(C.__webglDepthbuffer,N,!1);else{const de=N.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,be=C.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,be),i.framebufferRenderbuffer(i.FRAMEBUFFER,de,i.RENDERBUFFER,be)}}t.bindFramebuffer(i.FRAMEBUFFER,null)}function ve(N,C,Y){const se=n.get(N);C!==void 0&&at(se.__webglFramebuffer,N,N.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),Y!==void 0&&fe(N)}function ue(N){const C=N.texture,Y=n.get(N),se=n.get(C);N.addEventListener("dispose",w);const de=N.textures,be=N.isWebGLCubeRenderTarget===!0,Ae=de.length>1;if(Ae||(se.__webglTexture===void 0&&(se.__webglTexture=i.createTexture()),se.__version=C.version,l.memory.textures++),be){Y.__webglFramebuffer=[];for(let ie=0;ie<6;ie++)if(C.mipmaps&&C.mipmaps.length>0){Y.__webglFramebuffer[ie]=[];for(let le=0;le<C.mipmaps.length;le++)Y.__webglFramebuffer[ie][le]=i.createFramebuffer()}else Y.__webglFramebuffer[ie]=i.createFramebuffer()}else{if(C.mipmaps&&C.mipmaps.length>0){Y.__webglFramebuffer=[];for(let ie=0;ie<C.mipmaps.length;ie++)Y.__webglFramebuffer[ie]=i.createFramebuffer()}else Y.__webglFramebuffer=i.createFramebuffer();if(Ae)for(let ie=0,le=de.length;ie<le;ie++){const Be=n.get(de[ie]);Be.__webglTexture===void 0&&(Be.__webglTexture=i.createTexture(),l.memory.textures++)}if(N.samples>0&&Xe(N)===!1){Y.__webglMultisampledFramebuffer=i.createFramebuffer(),Y.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,Y.__webglMultisampledFramebuffer);for(let ie=0;ie<de.length;ie++){const le=de[ie];Y.__webglColorRenderbuffer[ie]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,Y.__webglColorRenderbuffer[ie]);const Be=o.convert(le.format,le.colorSpace),qe=o.convert(le.type),Re=A(le.internalFormat,Be,qe,le.normalized,le.colorSpace,N.isXRRenderTarget===!0),Ce=ht(N);i.renderbufferStorageMultisample(i.RENDERBUFFER,Ce,Re,N.width,N.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+ie,i.RENDERBUFFER,Y.__webglColorRenderbuffer[ie])}i.bindRenderbuffer(i.RENDERBUFFER,null),N.depthBuffer&&(Y.__webglDepthRenderbuffer=i.createRenderbuffer(),Ct(Y.__webglDepthRenderbuffer,N,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(be){t.bindTexture(i.TEXTURE_CUBE_MAP,se.__webglTexture),rt(i.TEXTURE_CUBE_MAP,C);for(let ie=0;ie<6;ie++)if(C.mipmaps&&C.mipmaps.length>0)for(let le=0;le<C.mipmaps.length;le++)at(Y.__webglFramebuffer[ie][le],N,C,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,le);else at(Y.__webglFramebuffer[ie],N,C,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0);_(C)&&M(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ae){for(let ie=0,le=de.length;ie<le;ie++){const Be=de[ie],qe=n.get(Be);let Re=i.TEXTURE_2D;(N.isWebGL3DRenderTarget||N.isWebGLArrayRenderTarget)&&(Re=N.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(Re,qe.__webglTexture),rt(Re,Be),at(Y.__webglFramebuffer,N,Be,i.COLOR_ATTACHMENT0+ie,Re,0),_(Be)&&M(Re)}t.unbindTexture()}else{let ie=i.TEXTURE_2D;if((N.isWebGL3DRenderTarget||N.isWebGLArrayRenderTarget)&&(ie=N.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(ie,se.__webglTexture),rt(ie,C),C.mipmaps&&C.mipmaps.length>0)for(let le=0;le<C.mipmaps.length;le++)at(Y.__webglFramebuffer[le],N,C,i.COLOR_ATTACHMENT0,ie,le);else at(Y.__webglFramebuffer,N,C,i.COLOR_ATTACHMENT0,ie,0);_(C)&&M(ie),t.unbindTexture()}N.depthBuffer&&fe(N)}function Pe(N){const C=N.textures;for(let Y=0,se=C.length;Y<se;Y++){const de=C[Y];if(_(de)){const be=T(N),Ae=n.get(de).__webglTexture;t.bindTexture(be,Ae),M(be),t.unbindTexture()}}}const Le=[],ut=[];function z(N){if(N.samples>0){if(Xe(N)===!1){const C=N.textures,Y=N.width,se=N.height;let de=i.COLOR_BUFFER_BIT;const be=N.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Ae=n.get(N),ie=C.length>1;if(ie)for(let Be=0;Be<C.length;Be++)t.bindFramebuffer(i.FRAMEBUFFER,Ae.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Be,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,Ae.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Be,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,Ae.__webglMultisampledFramebuffer);const le=N.texture.mipmaps;le&&le.length>0?t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ae.__webglFramebuffer[0]):t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ae.__webglFramebuffer);for(let Be=0;Be<C.length;Be++){if(N.resolveDepthBuffer&&(N.depthBuffer&&(de|=i.DEPTH_BUFFER_BIT),N.stencilBuffer&&N.resolveStencilBuffer&&(de|=i.STENCIL_BUFFER_BIT)),ie){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Ae.__webglColorRenderbuffer[Be]);const qe=n.get(C[Be]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,qe,0)}i.blitFramebuffer(0,0,Y,se,0,0,Y,se,de,i.NEAREST),h===!0&&(Le.length=0,ut.length=0,Le.push(i.COLOR_ATTACHMENT0+Be),N.depthBuffer&&N.resolveDepthBuffer===!1&&(Le.push(be),ut.push(be),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,ut)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Le))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),ie)for(let Be=0;Be<C.length;Be++){t.bindFramebuffer(i.FRAMEBUFFER,Ae.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Be,i.RENDERBUFFER,Ae.__webglColorRenderbuffer[Be]);const qe=n.get(C[Be]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,Ae.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Be,i.TEXTURE_2D,qe,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Ae.__webglMultisampledFramebuffer)}else if(N.depthBuffer&&N.resolveDepthBuffer===!1&&h){const C=N.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[C])}}}function ht(N){return Math.min(s.maxSamples,N.samples)}function Xe(N){const C=n.get(N);return N.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function $e(N){const C=l.render.frame;p.get(N)!==C&&(p.set(N,C),N.update())}function _e(N,C){const Y=N.colorSpace,se=N.format,de=N.type;return N.isCompressedTexture===!0||N.isVideoTexture===!0||Y!==Fr&&Y!==cs&&(It.getTransfer(Y)===Jt?(se!==ii||de!==yn)&&De("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Qe("WebGLTextures: Unsupported texture color space:",Y)),C}function kt(N){return typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement?(f.width=N.naturalWidth||N.width,f.height=N.naturalHeight||N.height):typeof VideoFrame<"u"&&N instanceof VideoFrame?(f.width=N.displayWidth,f.height=N.displayHeight):(f.width=N.width,f.height=N.height),f}this.allocateTextureUnit=$,this.resetTextureUnits=W,this.getTextureUnits=Z,this.setTextureUnits=V,this.setTexture2D=he,this.setTexture2DArray=ce,this.setTexture3D=ye,this.setTextureCube=ge,this.rebindTextures=ve,this.setupRenderTarget=ue,this.updateRenderTargetMipmap=Pe,this.updateMultisampleRenderTarget=z,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=at,this.useMultisampledRTT=Xe,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}
vendor: 4,083 bytes, line 4080
4080function sb(i,e){function t(n,s=cs){let o;const l=It.getTransfer(s);if(n===yn)return i.UNSIGNED_BYTE;if(n===Mf)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Ef)return i.UNSIGNED_SHORT_5_5_5_1;if(n===tg)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===ng)return i.UNSIGNED_INT_10F_11F_11F_REV;if(n===Qm)return i.BYTE;if(n===eg)return i.SHORT;if(n===Go)return i.UNSIGNED_SHORT;if(n===bf)return i.INT;if(n===ji)return i.UNSIGNED_INT;if(n===Yn)return i.FLOAT;if(n===fs)return i.HALF_FLOAT;if(n===ig)return i.ALPHA;if(n===sg)return i.RGB;if(n===ii)return i.RGBA;if(n===Ls)return i.DEPTH_COMPONENT;if(n===er)return i.DEPTH_STENCIL;if(n===Tf)return i.RED;if(n===Pc)return i.RED_INTEGER;if(n===Ur)return i.RG;if(n===wf)return i.RG_INTEGER;if(n===Af)return i.RGBA_INTEGER;if(n===ec||n===tc||n===nc||n===ic)if(l===Jt)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(n===ec)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===tc)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===nc)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===ic)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(n===ec)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===tc)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===nc)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===ic)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Ph||n===Lh||n===Dh||n===Nh)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(n===Ph)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Lh)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Dh)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Nh)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Uh||n===Fh||n===Oh||n===Bh||n===zh||n===dc||n===kh)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(n===Uh||n===Fh)return l===Jt?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(n===Oh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC;if(n===Bh)return o.COMPRESSED_R11_EAC;if(n===zh)return o.COMPRESSED_SIGNED_R11_EAC;if(n===dc)return o.COMPRESSED_RG11_EAC;if(n===kh)return o.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===Vh||n===Hh||n===Gh||n===Wh||n===Xh||n===qh||n===Yh||n===jh||n===$h||n===Zh||n===Kh||n===Jh||n===Qh||n===ef)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(n===Vh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Hh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Gh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Wh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Xh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===qh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Yh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===jh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===$h)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Zh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Kh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Jh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Qh)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===ef)return l===Jt?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===tf||n===nf||n===sf)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(n===tf)return l===Jt?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===nf)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===sf)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===rf||n===af||n===pc||n===of)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(n===rf)return o.COMPRESSED_RED_RGTC1_EXT;
vendor: 18,713 bytes, lines 4080-4104
4080if(n===af)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===pc)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===of)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Aa?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const RP=` 4081void main() { 4082 4083 gl_Position = vec4( position, 1.0 ); 4084 4085}`,IP=` 4086uniform sampler2DArray depthColor; 4087uniform float depthWidth; 4088uniform float depthHeight; 4089 4090void main() { 4091 4092 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 4093 4094 if ( coord.x >= 1.0 ) { 4095 4096 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 4097 4098 } else { 4099 4100 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 4101 4102 } 4103 4104}`;class PP{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new dg(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new En({vertexShader:RP,fragmentShader:IP,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Mn(new el(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class LP extends Mi{constructor(e,t){super();const n=this;let s=null,o=1,l=null,c="local-floor",h=1,f=null,p=null,g=null,m=null,v=null,y=null;const E=typeof XRWebGLBinding<"u",S=new PP,_={},M=t.getContextAttributes();let T=null,A=null;const D=[],R=[],F=new ae;let w=null;const L=new Dn;L.viewport=new Zt;const U=new Dn;U.viewport=new Zt;const O=[L,U],H=new WS;let W=null,Z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(oe){let Ue=D[oe];return Ue===void 0&&(Ue=new yh,D[oe]=Ue),Ue.getTargetRaySpace()},this.getControllerGrip=function(oe){let Ue=D[oe];return Ue===void 0&&(Ue=new yh,D[oe]=Ue),Ue.getGripSpace()},this.getHand=function(oe){let Ue=D[oe];return Ue===void 0&&(Ue=new yh,D[oe]=Ue),Ue.getHandSpace()};function V(oe){const Ue=R.indexOf(oe.inputSource);if(Ue===-1)return;const Se=D[Ue];Se!==void 0&&(Se.update(oe.inputSource,oe.frame,f||l),Se.dispatchEvent({type:oe.type,data:oe.inputSource}))}function $(){s.removeEventListener("select",V),s.removeEventListener("selectstart",V),s.removeEventListener("selectend",V),s.removeEventListener("squeeze",V),s.removeEventListener("squeezestart",V),s.removeEventListener("squeezeend",V),s.removeEventListener("end",$),s.removeEventListener("inputsourceschange",K);for(let oe=0;oe<D.length;oe++){const Ue=R[oe];Ue!==null&&(R[oe]=null,D[oe].disconnect(Ue))}W=null,Z=null,S.reset();for(const oe in _)delete _[oe];e.setRenderTarget(T),v=null,m=null,g=null,s=null,A=null,rt.stop(),n.isPresenting=!1,e.setPixelRatio(w),e.setSize(F.width,F.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(oe){o=oe,n.isPresenting===!0&&De("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(oe){c=oe,n.isPresenting===!0&&De("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||l},this.setReferenceSpace=function(oe){f=oe},this.getBaseLayer=function(){return m!==null?m:v},this.getBinding=function(){return g===null&&E&&(g=new XRWebGLBinding(s,t)),g},this.getFrame=function(){return y},this.getSession=function(){return s},this.setSession=async function(oe){if(s=oe,s!==null){if(T=e.getRenderTarget(),s.addEventListener("select",V),s.addEventListener("selectstart",V),s.addEventListener("selectend",V),s.addEventListener("squeeze",V),s.addEventListener("squeezestart",V),s.addEventListener("squeezeend",V),s.addEventListener("end",$),s.addEventListener("inputsourceschange",K),M.xrCompatible!==!0&&await t.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(F),E&&"createProjectionLayer"in XRWebGLBinding.prototype){let Se=null,We=null,ot=null;M.depth&&(ot=M.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Se=M.stencil?er:Ls,We=M.stencil?Aa:ji);const at={colorFormat:t.RGBA8,depthFormat:ot,scaleFactor:o};g=this.getBinding(),m=g.createProjectionLayer(at),s.updateRenderState({layers:[m]}),e.setPixelRatio(1),e.setSize(m.textureWidth,m.textureHeight,!1),A=new fn(m.textureWidth,m.textureHeight,{format:ii,type:yn,depthTexture:new Br(m.textureWidth,m.textureHeight,We,void 0,void 0,void 0,void 0,void 0,void 0,Se),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}else{const Se={antialias:M.antialias,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:o};v=new XRWebGLLayer(s,t,Se),s.updateRenderState({baseLayer:v}),e.setPixelRatio(1),e.setSize(v.framebufferWidth,v.framebufferHeight,!1),A=new fn(v.framebufferWidth,v.framebufferHeight,{format:ii,type:yn,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil,resolveDepthBuffer:v.ignoreDepthValues===!1,resolveStencilBuffer:v.ignoreDepthValues===!1})}A.isXRRenderTarget=!0,this.setFoveation(h),f=null,l=await s.requestReferenceSpace(c),rt.setContext(s),rt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return S.getDepthTexture()};function K(oe){for(let Ue=0;Ue<oe.removed.length;Ue++){const Se=oe.removed[Ue],We=R.indexOf(Se);We>=0&&(R[We]=null,D[We].disconnect(Se))}for(let Ue=0;Ue<oe.added.length;Ue++){const Se=oe.added[Ue];let We=R.indexOf(Se);if(We===-1){for(let at=0;at<D.length;at++)if(at>=R.length){R.push(Se),We=at;break}else if(R[at]===null){R[at]=Se,We=at;break}if(We===-1)break}const ot=D[We];ot&&ot.connect(Se)}}const he=new B,ce=new B;function ye(oe,Ue,Se){he.setFromMatrixPosition(Ue.matrixWorld),ce.setFromMatrixPosition(Se.matrixWorld);const We=he.distanceTo(ce),ot=Ue.projectionMatrix.elements,at=Se.projectionMatrix.elements,Ct=ot[14]/(ot[10]-1),it=ot[14]/(ot[10]+1),fe=(ot[9]+1)/ot[5],ve=(ot[9]-1)/ot[5],ue=(ot[8]-1)/ot[0],Pe=(at[8]+1)/at[0],Le=Ct*ue,ut=Ct*Pe,z=We/(-ue+Pe),ht=z*-ue;if(Ue.matrixWorld.decompose(oe.position,oe.quaternion,oe.scale),oe.translateX(ht),oe.translateZ(z),oe.matrixWorld.compose(oe.position,oe.quaternion,oe.scale),oe.matrixWorldInverse.copy(oe.matrixWorld).invert(),ot[10]===-1)oe.projectionMatrix.copy(Ue.projectionMatrix),oe.projectionMatrixInverse.copy(Ue.projectionMatrixInverse);else{const Xe=Ct+z,$e=it+z,_e=Le-ht,kt=ut+(We-ht),N=fe*it/$e*Xe,C=ve*it/$e*Xe;oe.projectionMatrix.makePerspective(_e,kt,N,C,Xe,$e),oe.projectionMatrixInverse.copy(oe.projectionMatrix).invert()}}function ge(oe,Ue){Ue===null?oe.matrixWorld.copy(oe.matrix):oe.matrixWorld.multiplyMatrices(Ue.matrixWorld,oe.matrix),oe.matrixWorldInverse.copy(oe.matrixWorld).invert()}this.updateCamera=function(oe){if(s===null)return;let Ue=oe.near,Se=oe.far;S.texture!==null&&(S.depthNear>0&&(Ue=S.depthNear),S.depthFar>0&&(Se=S.depthFar)),H.near=U.near=L.near=Ue,H.far=U.far=L.far=Se,(W!==H.near||Z!==H.far)&&(s.updateRenderState({depthNear:H.near,depthFar:H.far}),W=H.near,Z=H.far),H.layers.mask=oe.layers.mask|6,L.layers.mask=H.layers.mask&-5,U.layers.mask=H.layers.mask&-3;const We=oe.parent,ot=H.cameras;ge(H,We);for(let at=0;at<ot.length;at++)ge(ot[at],We);ot.length===2?ye(H,L,U):H.projectionMatrix.copy(L.projectionMatrix),we(oe,H,We)};function we(oe,Ue,Se){Se===null?oe.matrix.copy(Ue.matrixWorld):(oe.matrix.copy(Se.matrixWorld),oe.matrix.invert(),oe.matrix.multiply(Ue.matrixWorld)),oe.matrix.decompose(oe.position,oe.quaternion,oe.scale),oe.updateMatrixWorld(!0),oe.projectionMatrix.copy(Ue.projectionMatrix),oe.projectionMatrixInverse.copy(Ue.projectionMatrixInverse),oe.isPerspectiveCamera&&(oe.fov=Wo*2*Math.atan(1/oe.projectionMatrix.elements[5]),oe.zoom=1)}this.getCamera=function(){return H},this.getFoveation=function(){if(!(m===null&&v===null))return h},this.setFoveation=function(oe){h=oe,m!==null&&(m.fixedFoveation=oe),v!==null&&v.fixedFoveation!==void 0&&(v.fixedFoveation=oe)},this.hasDepthSensing=function(){return S.texture!==null},this.getDepthSensingMesh=function(){return S.getMesh(H)},this.getCameraTexture=function(oe){return _[oe]};let nt=null;function st(oe,Ue){if(p=Ue.getViewerPose(f||l),y=Ue,p!==null){const Se=p.views;v!==null&&(e.setRenderTargetFramebuffer(A,v.framebuffer),e.setRenderTarget(A));let We=!1;Se.length!==H.cameras.length&&(H.cameras.length=0,We=!0);for(let it=0;it<Se.length;it++){const fe=Se[it];let ve=null;if(v!==null)ve=v.getViewport(fe);else{const Pe=g.getViewSubImage(m,fe);ve=Pe.viewport,it===0&&(e.setRenderTargetTextures(A,Pe.colorTexture,Pe.depthStencilTexture),e.setRenderTarget(A))}let ue=O[it];ue===void 0&&(ue=new Dn,ue.layers.enable(it),ue.viewport=new Zt,O[it]=ue),ue.matrix.fromArray(fe.transform.matrix),ue.matrix.decompose(ue.position,ue.quaternion,ue.scale),ue.projectionMatrix.fromArray(fe.projectionMatrix),ue.projectionMatrixInverse.copy(ue.projectionMatrix).invert(),ue.viewport.set(ve.x,ve.y,ve.width,ve.height),it===0&&(H.matrix.copy(ue.matrix),H.matrix.decompose(H.position,H.quaternion,H.scale)),We===!0&&H.cameras.push(ue)}const ot=s.enabledFeatures;if(ot&&ot.includes("depth-sensing")&&s.depthUsage=="gpu-optimized"&&E){g=n.getBinding();const it=g.getDepthInformation(Se[0]);it&&it.isValid&&it.texture&&S.init(it,s.renderState)}if(ot&&ot.includes("camera-access")&&E){e.state.unbindTexture(),g=n.getBinding();for(let it=0;it<Se.length;it++){const fe=Se[it].camera;if(fe){let ve=_[fe];ve||(ve=new dg,_[fe]=ve);const ue=g.getCameraImage(fe);ve.sourceTexture=ue}}}}for(let Se=0;Se<D.length;Se++){const We=R[Se],ot=D[Se];We!==null&&ot!==void 0&&ot.update(We,Ue,f||l)}nt&&nt(oe,Ue),Ue.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Ue}),y=null}const rt=new JS;rt.setAnimationLoop(st),this.setAnimationLoop=function(oe){nt=oe},this.dispose=function(){}}}const DP=new mt,rb=new xt;rb.set(-1,0,0,0,1,0,0,0,1);function NP(i,e){function t(S,_){S.matrixAutoUpdate===!0&&S.updateMatrix(),_.value.copy(S.matrix)}function n(S,_){_.color.getRGB(S.fogColor.value,yS(i)),_.isFog?(S.fogNear.value=_.near,S.fogFar.value=_.far):_.isFogExp2&&(S.fogDensity.value=_.density)}function s(S,_,M,T,A){_.isNodeMaterial?_.uniformsNeedUpdate=!1:_.isMeshBasicMaterial?o(S,_):_.isMeshLambertMaterial?(o(S,_),_.envMap&&(S.envMapIntensity.value=_.envMapIntensity)):_.isMeshToonMaterial?(o(S,_),g(S,_)):_.isMeshPhongMaterial?(o(S,_),p(S,_),_.envMap&&(S.envMapIntensity.value=_.envMapIntensity)):_.isMeshStandardMaterial?(o(S,_),m(S,_),_.isMeshPhysicalMaterial&&v(S,_,A)):_.isMeshMatcapMaterial?(o(S,_),y(S,_)):_.isMeshDepthMaterial?o(S,_):_.isMeshDistanceMaterial?(o(S,_),E(S,_)):_.isMeshNormalMaterial?o(S,_):_.isLineBasicMaterial?(l(S,_),_.isLineDashedMaterial&&c(S,_)):_.isPointsMaterial?h(S,_,M,T):_.isSpriteMaterial?f(S,_):_.isShadowMaterial?(S.color.value.copy(_.color),S.opacity.value=_.opacity):_.isShaderMaterial&&(_.uniformsNeedUpdate=!1)}function o(S,_){S.opacity.value=_.opacity,_.color&&S.diffuse.value.copy(_.color),_.emissive&&S.emissive.value.copy(_.emissive).multiplyScalar(_.emissiveIntensity),_.map&&(S.map.value=_.map,t(_.map,S.mapTransform)),_.alphaMap&&(S.alphaMap.value=_.alphaMap,t(_.alphaMap,S.alphaMapTransform)),_.bumpMap&&(S.bumpMap.value=_.bumpMap,t(_.bumpMap,S.bumpMapTransform),S.bumpScale.value=_.bumpScale,_.side===Nn&&(S.bumpScale.value*=-1)),_.normalMap&&(S.normalMap.value=_.normalMap,t(_.normalMap,S.normalMapTransform),S.normalScale.value.copy(_.normalScale),_.side===Nn&&S.normalScale.value.negate()),_.displacementMap&&(S.displacementMap.value=_.displacementMap,t(_.displacementMap,S.displacementMapTransform),S.displacementScale.value=_.displacementScale,S.displacementBias.value=_.displacementBias),_.emissiveMap&&(S.emissiveMap.value=_.emissiveMap,t(_.emissiveMap,S.emissiveMapTransform)),_.specularMap&&(S.specularMap.value=_.specularMap,t(_.specularMap,S.specularMapTransform)),_.alphaTest>0&&(S.alphaTest.value=_.alphaTest);const M=e.get(_),T=M.envMap,A=M.envMapRotation;T&&(S.envMap.value=T,S.envMapRotation.value.setFromMatrix4(DP.makeRotationFromEuler(A)).transpose(),T.isCubeTexture&&T.isRenderTargetTexture===!1&&S.envMapRotation.value.premultiply(rb),S.reflectivity.value=_.reflectivity,S.ior.value=_.ior,S.refractionRatio.value=_.refractionRatio),_.lightMap&&(S.lightMap.value=_.lightMap,S.lightMapIntensity.value=_.lightMapIntensity,t(_.lightMap,S.lightMapTransform)),_.aoMap&&(S.aoMap.value=_.aoMap,S.aoMapIntensity.value=_.aoMapIntensity,t(_.aoMap,S.aoMapTransform))}function l(S,_){S.diffuse.value.copy(_.color),S.opacity.value=_.opacity,_.map&&(S.map.value=_.map,t(_.map,S.mapTransform))}function c(S,_){S.dashSize.value=_.dashSize,S.totalSize.value=_.dashSize+_.gapSize,S.scale.value=_.scale}function h(S,_,M,T){S.diffuse.value.copy(_.color),S.opacity.value=_.opacity,S.size.value=_.size*M,S.scale.value=T*.5,_.map&&(S.map.value=_.map,t(_.map,S.uvTransform)),_.alphaMap&&(S.alphaMap.value=_.alphaMap,t(_.alphaMap,S.alphaMapTransform)),_.alphaTest>0&&(S.alphaTest.value=_.alphaTest)}function f(S,_){S.diffuse.value.copy(_.color),S.opacity.value=_.opacity,S.rotation.value=_.rotation,_.map&&(S.map.value=_.map,t(_.map,S.mapTransform)),_.alphaMap&&(S.alphaMap.value=_.alphaMap,t(_.alphaMap,S.alphaMapTransform)),_.alphaTest>0&&(S.alphaTest.value=_.alphaTest)}function p(S,_){S.specular.value.copy(_.specular),S.shininess.value=Math.max(_.shininess,1e-4)}function g(S,_){_.gradientMap&&(S.gradientMap.value=_.gradientMap)}function m(S,_){S.metalness.value=_.metalness,_.metalnessMap&&(S.metalnessMap.value=_.metalnessMap,t(_.metalnessMap,S.metalnessMapTransform)),S.roughness.value=_.roughness,_.roughnessMap&&(S.roughnessMap.value=_.roughnessMap,t(_.roughnessMap,S.roughnessMapTransform)),_.envMap&&(S.envMapIntensity.value=_.envMapIntensity)}function v(S,_,M){S.ior.value=_.ior,_.sheen>0&&(S.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),S.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(S.sheenColorMap.value=_.sheenColorMap,t(_.sheenColorMap,S.sheenColorMapTransform)),_.sheenRoughnessMap&&(S.sheenRoughnessMap.value=_.sheenRoughnessMap,t(_.sheenRoughnessMap,S.sheenRoughnessMapTransform))),_.clearcoat>0&&(S.clearcoat.value=_.clearcoat,S.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(S.clearcoatMap.value=_.clearcoatMap,t(_.clearcoatMap,S.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(S.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,t(_.clearcoatRoughnessMap,S.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(S.clearcoatNormalMap.value=_.clearcoatNormalMap,t(_.clearcoatNormalMap,S.clearcoatNormalMapTransform),S.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===Nn&&S.clearcoatNormalScale.value.negate())),_.dispersion>0&&(S.dispersion.value=_.dispersion),_.iridescence>0&&(S.iridescence.value=_.iridescence,S.iridescenceIOR.value=_.iridescenceIOR,S.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],S.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(S.iridescenceMap.value=_.iridescenceMap,t(_.iridescenceMap,S.iridescenceMapTransform)),_.iridescenceThicknessMap&&(S.iridescenceThicknessMap.value=_.iridescenceThicknessMap,t(_.iridescenceThicknessMap,S.iridescenceThicknessMapTransform))),_.transmission>0&&(S.transmission.value=_.transmission,S.transmissionSamplerMap.value=M.texture,S.transmissionSamplerSize.value.set(M.width,M.height),_.transmissionMap&&(S.transmissionMap.value=_.transmissionMap,t(_.transmissionMap,S.transmissionMapTransform)),S.thickness.value=_.thickness,_.thicknessMap&&(S.thicknessMap.value=_.thicknessMap,t(_.thicknessMap,S.thicknessMapTransform)),S.attenuationDistance.value=_.attenuationDistance,S.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(S.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(S.anisotropyMap.value=_.anisotropyMap,t(_.anisotropyMap,S.anisotropyMapTransform))),S.specularIntensity.value=_.specularIntensity,S.specularColor.value.copy(_.specularColor),_.specularColorMap&&(S.specularColorMap.value=_.specularColorMap,t(_.specularColorMap,S.specularColorMapTransform)),_.specularIntensityMap&&(S.specularIntensityMap.value=_.specularIntensityMap,t(_.specularIntensityMap,S.specularIntensityMapTransform))}function y(S,_){_.matcap&&(S.matcap.value=_.matcap)}function E(S,_){const M=e.get(_).light;S.referencePosition.value.setFromMatrixPosition(M.matrixWorld),S.nearDistance.value=M.shadow.camera.near,S.farDistance.value=M.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function UP(i,e,t,n){let s={},o={},l=[];const c=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function h(M,T){const A=T.program;n.uniformBlockBinding(M,A)}function f(M,T){let A=s[M.id];A===void 0&&(y(M),A=p(M),s[M.id]=A,M.addEventListener("dispose",S));const D=T.program;n.updateUBOMapping(M,D);const R=e.render.frame;o[M.id]!==R&&(m(M),o[M.id]=R)}function p(M){const T=g();M.__bindingPointIndex=T;const A=i.createBuffer(),D=M.__size,R=M.usage;return i.bindBuffer(i.UNIFORM_BUFFER,A),i.bufferData(i.UNIFORM_BUFFER,D,R),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,T,A),A}function g(){for(let M=0;M<c;M++)if(l.indexOf(M)===-1)return l.push(M),M;return Qe("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(M){const T=s[M.id],A=M.uniforms,D=M.__cache;i.bindBuffer(i.UNIFORM_BUFFER,T);for(let R=0,F=A.length;R<F;R++){const w=Array.isArray(A[R])?A[R]:[A[R]];for(let L=0,U=w.length;L<U;L++){const O=w[L];if(v(O,R,L,D)===!0){const H=O.__offset,W=Array.isArray(O.value)?O.value:[O.value];let Z=0;for(let V=0;V<W.length;V++){const $=W[V],K=E($);typeof $=="number"||typeof $=="boolean"?(O.__data[0]=$,i.bufferSubData(i.UNIFORM_BUFFER,H+Z,O.__data)):$.isMatrix3?(O.__data[0]=$.elements[0],O.__data[1]=$.elements[1],O.__data[2]=$.elements[2],O.__data[3]=0,O.__data[4]=$.elements[3],O.__data[5]=$.elements[4],O.__data[6]=$.elements[5],O.__data[7]=0,O.__data[8]=$.elements[6],O.__data[9]=$.elements[7],O.__data[10]=$.elements[8],O.__data[11]=0):ArrayBuffer.isView($)?O.__data.set(new $.constructor($.buffer,$.byteOffset,O.__data.length)):($.toArray(O.__data,Z),Z+=K.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,H,O.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function v(M,T,A,D){const R=M.value,F=T+"_"+A;if(D[F]===void 0)return typeof R=="number"||typeof R=="boolean"?D[F]=R:ArrayBuffer.isView(R)?D[F]=R.slice():D[F]=R.clone(),!0;{const w=D[F];if(typeof R=="number"||typeof R=="boolean"){if(w!==R)return D[F]=R,!0}else{if(ArrayBuffer.isView(R))return!0;
4104if(w.equals(R)===!1)return w.copy(R),!0}}return!1}function y(M){const T=M.uniforms;let A=0;const D=16;for(let F=0,w=T.length;F<w;F++){const L=Array.isArray(T[F])?T[F]:[T[F]];for(let U=0,O=L.length;U<O;U++){const H=L[U],W=Array.isArray(H.value)?H.value:[H.value];for(let Z=0,V=W.length;Z<V;Z++){const $=W[Z],K=E($),he=A%D,ce=he%K.boundary,ye=he+ce;A+=ce,ye!==0&&D-ye<K.storage&&(A+=D-ye),H.__data=new Float32Array(K.storage/Float32Array.BYTES_PER_ELEMENT),H.__offset=A,A+=K.storage}}}const R=A%D;return R>0&&(A+=D-R),M.__size=A,M.__cache={},this}function E(M){const T={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(T.boundary=4,T.storage=4):M.isVector2?(T.boundary=8,T.storage=8):M.isVector3||M.isColor?(T.boundary=16,T.storage=12):M.isVector4?(T.boundary=16,T.storage=16):M.isMatrix3?(T.boundary=48,T.storage=48):M.isMatrix4?(T.boundary=64,T.storage=64):M.isTexture?De("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(M)?(T.boundary=16,T.storage=M.byteLength):De("WebGLRenderer: Unsupported uniform value type.",M),T}function S(M){const T=M.target;T.removeEventListener("dispose",S);const A=l.indexOf(T.__bindingPointIndex);l.splice(A,1),i.deleteBuffer(s[T.id]),delete s[T.id],delete o[T.id]}function _(){for(const M in s)i.deleteBuffer(s[M]);l=[],s={},o={}}return{bind:h,update:f,dispose:_}}const FP=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,
vendor: 4,562 bytes, line 4104
410414942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let As=null;function OP(){return As===null&&(As=new hs(FP,16,16,Ur,fs),As.name="DFG_LUT",As.minFilter=nn,As.magFilter=nn,As.wrapS=bi,As.wrapT=bi,As.generateMipmaps=!1,As.needsUpdate=!0),As}class ab{constructor(e={}){const{canvas:t=jy(),context:n=null,depth:s=!0,stencil:o=!1,alpha:l=!1,antialias:c=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:f=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:g=!1,reversedDepthBuffer:m=!1,outputBufferType:v=yn}=e;this.isWebGLRenderer=!0;let y;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");y=n.getContextAttributes().alpha}else y=l;const E=v,S=new Set([Af,wf,Pc]),_=new Set([yn,ji,Go,Aa,Mf,Ef]),M=new Uint32Array(4),T=new Int32Array(4),A=new B;let D=null,R=null;const F=[],w=[];let L=null;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.toneMapping=zi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const U=this;let O=!1,H=null;this._outputColorSpace=$t;let W=0,Z=0,V=null,$=-1,K=null;const he=new Zt,ce=new Zt;let ye=null;const ge=new Ve(0);let we=0,nt=t.width,st=t.height,rt=1,oe=null,Ue=null;const Se=new Zt(0,0,nt,st),We=new Zt(0,0,nt,st);let ot=!1;const at=new Qo;let Ct=!1,it=!1;const fe=new mt,ve=new B,ue=new Zt,Pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Le=!1;function ut(){return V===null?rt:1}let z=n;function ht(P,X){return t.getContext(P,X)}try{const P={alpha:!0,depth:s,stencil:o,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:f,powerPreference:p,failIfMajorPerformanceCaveat:g};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Zo}`),t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",Je,!1),t.addEventListener("webglcontextcreationerror",vt,!1),z===null){const X="webgl2";if(z=ht(X,P),z===null)throw ht(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(P){throw Qe("WebGLRenderer: "+P.message),P}let Xe,$e,_e,kt,N,C,Y,se,de,be,Ae,ie,le,Be,qe,Re,Ce,pt,St,Ft,G,Te,re;function ze(){Xe=new B3(z),Xe.init(),G=new sb(z,Xe),$e=new I3(z,Xe,e,G),_e=new AP(z,Xe),$e.reversedDepthBuffer&&m&&_e.buffers.depth.setReversed(!0),kt=new V3(z),N=new dP,C=new CP(z,Xe,_e,N,$e,G,kt),Y=new O3(U),se=new XA(z),Te=new C3(z,se),de=new z3(z,se,kt,Te),be=new G3(z,de,se,Te,kt),pt=new H3(z,$e,C),qe=new P3(N),Ae=new fP(U,Y,Xe,$e,Te,qe),ie=new NP(U,N),le=new mP,Be
vendor: 4,750 bytes, line 4104
4104=new SP(Xe),Ce=new A3(U,Y,_e,be,y,h),Re=new wP(U,be,$e),re=new UP(z,kt,$e,_e),St=new R3(z,Xe,kt),Ft=new k3(z,Xe,kt),kt.programs=Ae.programs,U.capabilities=$e,U.extensions=Xe,U.properties=N,U.renderLists=le,U.shadowMap=Re,U.state=_e,U.info=kt}ze(),E!==yn&&(L=new X3(E,t.width,t.height,s,o));const Ie=new LP(U,z);this.xr=Ie,this.getContext=function(){return z},this.getContextAttributes=function(){return z.getContextAttributes()},this.forceContextLoss=function(){const P=Xe.get("WEBGL_lose_context");P&&P.loseContext()},this.forceContextRestore=function(){const P=Xe.get("WEBGL_lose_context");P&&P.restoreContext()},this.getPixelRatio=function(){return rt},this.setPixelRatio=function(P){P!==void 0&&(rt=P,this.setSize(nt,st,!1))},this.getSize=function(P){return P.set(nt,st)},this.setSize=function(P,X,Q=!0){if(Ie.isPresenting){De("WebGLRenderer: Can't change size while VR device is presenting.");return}nt=P,st=X,t.width=Math.floor(P*rt),t.height=Math.floor(X*rt),Q===!0&&(t.style.width=P+"px",t.style.height=X+"px"),L!==null&&L.setSize(t.width,t.height),this.setViewport(0,0,P,X)},this.getDrawingBufferSize=function(P){return P.set(nt*rt,st*rt).floor()},this.setDrawingBufferSize=function(P,X,Q){nt=P,st=X,rt=Q,t.width=Math.floor(P*Q),t.height=Math.floor(X*Q),this.setViewport(0,0,P,X)},this.setEffects=function(P){if(E===yn){Qe("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(P){for(let X=0;X<P.length;X++)if(P[X].isOutputPass===!0){De("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}L.setEffects(P||[])},this.getCurrentViewport=function(P){return P.copy(he)},this.getViewport=function(P){return P.copy(Se)},this.setViewport=function(P,X,Q,j){P.isVector4?Se.set(P.x,P.y,P.z,P.w):Se.set(P,X,Q,j),_e.viewport(he.copy(Se).multiplyScalar(rt).round())},this.getScissor=function(P){return P.copy(We)},this.setScissor=function(P,X,Q,j){P.isVector4?We.set(P.x,P.y,P.z,P.w):We.set(P,X,Q,j),_e.scissor(ce.copy(We).multiplyScalar(rt).round())},this.getScissorTest=function(){return ot},this.setScissorTest=function(P){_e.setScissorTest(ot=P)},this.setOpaqueSort=function(P){oe=P},this.setTransparentSort=function(P){Ue=P},this.getClearColor=function(P){return P.copy(Ce.getClearColor())},this.setClearColor=function(){Ce.setClearColor(...arguments)},this.getClearAlpha=function(){return Ce.getClearAlpha()},this.setClearAlpha=function(){Ce.setClearAlpha(...arguments)},this.clear=function(P=!0,X=!0,Q=!0){let j=0;if(P){let J=!1;if(V!==null){const xe=V.texture.format;J=S.has(xe)}if(J){const xe=V.texture.type,He=_.has(xe),Fe=Ce.getClearColor(),Ke=Ce.getClearAlpha(),et=Fe.r,_t=Fe.g,bt=Fe.b;He?(M[0]=et,M[1]=_t,M[2]=bt,M[3]=Ke,z.clearBufferuiv(z.COLOR,0,M)):(T[0]=et,T[1]=_t,T[2]=bt,T[3]=Ke,z.clearBufferiv(z.COLOR,0,T))}else j|=z.COLOR_BUFFER_BIT}X&&(j|=z.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),Q&&(j|=z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),j!==0&&z.clear(j)},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.setNodesHandler=function(P){P.setRenderer(this),H=P},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",Je,!1),t.removeEventListener("webglcontextcreationerror",vt,!1),Ce.dispose(),le.dispose(),Be.dispose(),N.dispose(),Y.dispose(),be.dispose(),Te.dispose(),re.dispose(),Ae.dispose(),Ie.dispose(),Ie.removeEventListener("sessionstart",Oa),Ie.removeEventListener("sessionend",ms),gs.stop()};function pe(P){P.preventDefault(),yc("WebGLRenderer: Context Lost."),O=!0}function Je(){yc("WebGLRenderer: Context Restored."),O=!1;const P=kt.autoReset,X=Re.enabled,Q=Re.autoUpdate,j=Re.needsUpdate,J=Re.type;ze(),kt.autoReset=P,Re.enabled=X,Re.autoUpdate=Q,Re.needsUpdate=j,Re.type=J}function vt(P){Qe("WebGLRenderer: A WebGL context could not be created. Reason: ",P.statusMessage)}function an(P){const X=P.target;X.removeEventListener("dispose",an),zt(X)}function zt(P){fi(P),N.remove(P)}function fi(P){const X=N.get(P).programs;X!==void 0&&(X.forEach(function(Q){Ae.releaseProgram(Q)}),P.isShaderMaterial&&Ae.releaseShaderCache(P))}this.renderBufferDirect=function(P,X,Q,j,J,xe){X===null&&(X=Pe);const He=J.isMesh&&J.matrixWorld.determinant()<0,Fe=zc(P,X,Q,j,J);_e.setMaterial(j,He);let Ke=Q.index,et=1;if(j.wireframe===!0){if(Ke=de.getWireframeAttribute(Q),Ke===void 0)return;et=2}const _t=Q.drawRange,bt=Q.attributes.position;let tt=_t.start*et,Gt=(_t.start+_t.count)*et;xe!==null&&(tt=Math.max(tt,xe.start*et),Gt=Math.min(Gt,(xe.start+xe.count)*et)),Ke!==null?(tt=Math.max(tt,0),Gt=M
vendor: 10,455 bytes, line 4104
4104ath.min(Gt,Ke.count)):bt!=null&&(tt=Math.max(tt,0),Gt=Math.min(Gt,bt.count));const Pt=Gt-tt;if(Pt<0||Pt===1/0)return;Te.setup(J,j,Fe,Q,Ke);let yt,Wt=St;if(Ke!==null&&(yt=se.get(Ke),Wt=Ft,Wt.setIndex(yt)),J.isMesh)j.wireframe===!0?(_e.setLineWidth(j.wireframeLinewidth*ut()),Wt.setMode(z.LINES)):Wt.setMode(z.TRIANGLES);else if(J.isLine){let vn=j.linewidth;vn===void 0&&(vn=1),_e.setLineWidth(vn*ut()),J.isLineSegments?Wt.setMode(z.LINES):J.isLineLoop?Wt.setMode(z.LINE_LOOP):Wt.setMode(z.LINE_STRIP)}else J.isPoints?Wt.setMode(z.POINTS):J.isSprite&&Wt.setMode(z.TRIANGLES);if(J.isBatchedMesh)if(Xe.get("WEBGL_multi_draw"))Wt.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else{const vn=J._multiDrawStarts,ke=J._multiDrawCounts,Hn=J._multiDrawCount,Mt=Ke?se.get(Ke).bytesPerElement:1,Gn=N.get(j).currentProgram.getUniforms();for(let di=0;di<Hn;di++)Gn.setValue(z,"_gl_DrawID",di),Wt.render(vn[di]/Mt,ke[di])}else if(J.isInstancedMesh)Wt.renderInstances(tt,Pt,J.count);else if(Q.isInstancedBufferGeometry){const vn=Q._maxInstanceCount!==void 0?Q._maxInstanceCount:1/0,ke=Math.min(Q.instanceCount,vn);Wt.renderInstances(tt,Pt,ke)}else Wt.render(tt,Pt)};function wi(P,X,Q){P.transparent===!0&&P.side===ni&&P.forceSinglePass===!1?(P.side=Nn,P.needsUpdate=!0,vs(P,X,Q),P.side=Is,P.needsUpdate=!0,vs(P,X,Q),P.side=ni):vs(P,X,Q)}this.compile=function(P,X,Q=null){Q===null&&(Q=P),R=Be.get(Q),R.init(X),w.push(R),Q.traverseVisible(function(J){J.isLight&&J.layers.test(X.layers)&&(R.pushLight(J),J.castShadow&&R.pushShadow(J))}),P!==Q&&P.traverseVisible(function(J){J.isLight&&J.layers.test(X.layers)&&(R.pushLight(J),J.castShadow&&R.pushShadow(J))}),R.setupLights();const j=new Set;return P.traverse(function(J){if(!(J.isMesh||J.isPoints||J.isLine||J.isSprite))return;const xe=J.material;if(xe)if(Array.isArray(xe))for(let He=0;He<xe.length;He++){const Fe=xe[He];wi(Fe,Q,J),j.add(Fe)}else wi(xe,Q,J),j.add(xe)}),R=w.pop(),j},this.compileAsync=function(P,X,Q=null){const j=this.compile(P,X,Q);return new Promise(J=>{function xe(){if(j.forEach(function(He){N.get(He).currentProgram.isReady()&&j.delete(He)}),j.size===0){J(P);return}setTimeout(xe,10)}Xe.get("KHR_parallel_shader_compile")!==null?xe():setTimeout(xe,10)})};let rr=null;function Fa(P){rr&&rr(P)}function Oa(){gs.stop()}function ms(){gs.start()}const gs=new JS;gs.setAnimationLoop(Fa),typeof self<"u"&&gs.setContext(self),this.setAnimationLoop=function(P){rr=P,Ie.setAnimationLoop(P),P===null?gs.stop():gs.start()},Ie.addEventListener("sessionstart",Oa),Ie.addEventListener("sessionend",ms),this.render=function(P,X){if(X!==void 0&&X.isCamera!==!0){Qe("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(O===!0)return;H!==null&&H.renderStart(P,X);const Q=Ie.enabled===!0&&Ie.isPresenting===!0,j=L!==null&&(V===null||Q)&&L.begin(U,V);if(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),Ie.enabled===!0&&Ie.isPresenting===!0&&(L===null||L.isCompositing()===!1)&&(Ie.cameraAutoUpdate===!0&&Ie.updateCamera(X),X=Ie.getCamera()),P.isScene===!0&&P.onBeforeRender(U,P,X,V),R=Be.get(P,w.length),R.init(X),R.state.textureUnits=C.getTextureUnits(),w.push(R),fe.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),at.setFromProjectionMatrix(fe,Bi,X.reversedDepth),it=this.localClippingEnabled,Ct=qe.init(this.clippingPlanes,it),D=le.get(P,F.length),D.init(),F.push(D),Ie.enabled===!0&&Ie.isPresenting===!0){const He=U.xr.getDepthSensingMesh();He!==null&&ar(He,X,-1/0,U.sortObjects)}ar(P,X,0,U.sortObjects),D.finish(),U.sortObjects===!0&&D.sort(oe,Ue),Le=Ie.enabled===!1||Ie.isPresenting===!1||Ie.hasDepthSensing()===!1,Le&&Ce.addToRenderList(D,P),this.info.render.frame++,Ct===!0&&qe.beginShadows();const J=R.state.shadowsArray;if(Re.render(J,P,X),Ct===!0&&qe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(j&&L.hasRenderPass())===!1){const He=D.opaque,Fe=D.transmissive;if(R.setupLights(),X.isArrayCamera){const Ke=X.cameras;if(Fe.length>0)for(let et=0,_t=Ke.length;et<_t;et++){const bt=Ke[et];za(He,Fe,P,bt)}Le&&Ce.render(P);for(let et=0,_t=Ke.length;et<_t;et++){const bt=Ke[et];Ba(D,P,bt,bt.viewport)}}else Fe.length>0&&za(He,Fe,P,X),Le&&Ce.render(P),Ba(D,P,X)}V!==null&&Z===0&&(C.updateMultisampleRenderTarget(V),C.updateRenderTargetMipmap(V)),j&&L.end(U),P.isScene===!0&&P.onAfterRender(U,P,X),Te.resetDefaultState(),$=-1,K=null,w.pop(),w.length>0?(R=w[w.length-1],C.setTextureUnits(R.state.textureUnits),Ct===!0&&qe.setGlobalState(U.clippingPlanes,R.state.camera)):R=null,F.pop(),F.length>0?D=F[F.length-1]:D=null,H!==null&&H.renderEnd()};function ar(P,X,Q,j){if(P.visible===!1)return;if(P.layers.test(X.layers)){if(P.isGroup)Q=P.renderOrder;else if(P.isLOD)P.autoUpdate===!0&&P.update(X);else if(P.isLightProbeGrid)R.pushLightProbeGrid(P);else if(P.isLight)R.pushLight(P),P.castShadow&&R.pushShadow(P);else if(P.isSprite){if(!P.frustumCulled||at.intersectsSprite(P)){j&&ue.setFromMatrixPosition(P.matrixWorld).applyMatrix4(fe);const He=be.update(P),Fe=P.material;Fe.visible&&D.push(P,He,Fe,Q,ue.z,null)}}else if((P.isMesh||P.isLine||P.isPoints)&&(!P.frustumCulled||at.intersectsObject(P))){const He=be.update(P),Fe=P.material;if(j&&(P.boundingSphere!==void 0?(P.boundingSphere===null&&P.computeBoundingSphere(),ue.copy(P.boundingSphere.center)):(He.boundingSphere===null&&He.computeBoundingSphere(),ue.copy(He.boundingSphere.center)),ue.applyMatrix4(P.matrixWorld).applyMatrix4(fe)),Array.isArray(Fe)){const Ke=He.groups;for(let et=0,_t=Ke.length;et<_t;et++){const bt=Ke[et],tt=Fe[bt.materialIndex];tt&&tt.visible&&D.push(P,He,tt,Q,ue.z,bt)}}else Fe.visible&&D.push(P,He,Fe,Q,ue.z,null)}}const xe=P.children;for(let He=0,Fe=xe.length;He<Fe;He++)ar(xe[He],X,Q,j)}function Ba(P,X,Q,j){const{opaque:J,transmissive:xe,transparent:He}=P;R.setupLightsView(Q),Ct===!0&&qe.setGlobalState(U.clippingPlanes,Q),j&&_e.viewport(he.copy(j)),J.length>0&&Ai(J,X,Q),xe.length>0&&Ai(xe,X,Q),He.length>0&&Ai(He,X,Q),_e.buffers.depth.setTest(!0),_e.buffers.depth.setMask(!0),_e.buffers.color.setMask(!0),_e.setPolygonOffset(!1)}function za(P,X,Q,j){if((Q.isScene===!0?Q.overrideMaterial:null)!==null)return;if(R.state.transmissionRenderTarget[j.id]===void 0){const tt=Xe.has("EXT_color_buffer_half_float")||Xe.has("EXT_color_buffer_float");R.state.transmissionRenderTarget[j.id]=new fn(1,1,{generateMipmaps:!0,type:tt?fs:yn,minFilter:Cs,samples:Math.max(4,$e.samples),stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:It.workingColorSpace})}const xe=R.state.transmissionRenderTarget[j.id],He=j.viewport||he;xe.setSize(He.z*U.transmissionResolutionScale,He.w*U.transmissionResolutionScale);const Fe=U.getRenderTarget(),Ke=U.getActiveCubeFace(),et=U.getActiveMipmapLevel();U.setRenderTarget(xe),U.getClearColor(ge),we=U.getClearAlpha(),we<1&&U.setClearColor(16777215,.5),U.clear(),Le&&Ce.render(Q);const _t=U.toneMapping;U.toneMapping=zi;const bt=j.viewport;if(j.viewport!==void 0&&(j.viewport=void 0),R.setupLightsView(j),Ct===!0&&qe.setGlobalState(U.clippingPlanes,j),Ai(P,Q,j),C.updateMultisampleRenderTarget(xe),C.updateRenderTargetMipmap(xe),Xe.has("WEBGL_multisampled_render_to_texture")===!1){let tt=!1;for(let Gt=0,Pt=X.length;Gt<Pt;Gt++){const yt=X[Gt],{object:Wt,geometry:vn,material:ke,group:Hn}=yt;if(ke.side===ni&&Wt.layers.test(j.layers)){const Mt=ke.side;ke.side=Nn,ke.needsUpdate=!0,Zi(Wt,Q,j,vn,ke,Hn),ke.side=Mt,ke.needsUpdate=!0,tt=!0}}tt===!0&&(C.updateMultisampleRenderTarget(xe),C.updateRenderTargetMipmap(xe))}U.setRenderTarget(Fe,Ke,et),U.setClearColor(ge,we),bt!==void 0&&(j.viewport=bt),U.toneMapping=_t}function Ai(P,X,Q){const j=X.isScene===!0?X.overrideMaterial:null;for(let J=0,xe=P.length;J<xe;J++){const He=P[J],{object:Fe,geometry:Ke,group:et}=He;let _t=He.material;_t.allowOverride===!0&&j!==null&&(_t=j),Fe.layers.test(Q.layers)&&Zi(Fe,X,Q,Ke,_t,et)}}function Zi(P,X,Q,j,J,xe){P.onBeforeRender(U,X,Q,j,J,xe),P.modelViewMatrix.multiplyMatrices(Q.matrixWorldInverse,P.matrixWorld),P.normalMatrix.getNormalMatrix(P.modelViewMatrix),J.onBeforeRender(U,X,Q,j,P,xe),J.transparent===!0&&J.side===ni&&J.forceSinglePass===!1?(J.side=Nn,J.needsUpdate=!0,U.renderBufferDirect(Q,X,j,J,P,xe),J.side=Is,J.needsUpdate=!0,U.renderBufferDirect(Q,X,j,J,P,xe),J.side=ni):U.renderBufferDirect(Q,X,j,J,P,xe),P.onAfterRender(U,X,Q,j,J,xe)}function vs(P,X,Q){X.isScene!==!0&&(X=Pe);const j=N.get(P),J=R.state.lights,xe=R.state.shadowsArray,He=J.state.version,Fe=Ae.getParameters(P,J.state,xe,X,Q,R.state.lightProbeGridArray),Ke=Ae.getProgramCacheKey(Fe);let et=j.programs;j.environment=P.isMeshStandardMaterial||P.isMeshLambertMaterial||P.isMeshPhongMaterial?X.environment:null,j.fog=X.fog;const _t=P.isMeshStandardMaterial||P.isMeshLambertMaterial&&!P.envMap||P.isMeshPhongMaterial&&!P.envMap;j.envMap=Y.get(P.envMap||j.environment,_t),j.envMapRotation=j.environment!==null&&P.envMap===null?X.environmentRotation:P.envMapRotation,et===void 0&&(P.addEventListener("dispose",an),et=new Map,j.programs=et);let bt=et.get(Ke);if(bt!==void 0){if(j.currentProgram===bt&&j.lightsStateVersion===He)return or(P,Fe),bt}else Fe.uniforms=Ae.getUniforms(P),H!==null&&P.isNodeMaterial&&H.build(P,Q,Fe),P.onBeforeCompile(Fe,U),bt=Ae.acquireProgram(Fe,Ke),et.set(Ke,bt),j.uniforms=Fe.uniforms;const tt=j.uniforms;return(!P.isShaderMaterial&&!P.isRawShaderMaterial||P.clipping===!0)&&(tt.clippingPlanes=qe.uniform),or(P,Fe),j.needsLights=Vc(P),j.lightsStateVersion=He,j.needsLights&&(tt.ambientLightColor.value=J.state.ambient,tt.lightProbe.value=J.state.probe,tt.directionalLights.value=J.state.directional,tt.directionalLightShadows.value=J.state.directionalShadow,tt.spotLights.value=J.state.spot,tt.spotLightShadows.value=J.state.spotShadow,tt.rectAreaLights.value=J.state.rectArea,tt.ltc_1.value=J.state.rectAreaLTC1,tt.ltc_2.value=J.state.rectAreaLTC2,tt.pointLights.value=J.state.point,tt.pointLightShadows.value=J.state.pointShadow,tt.hemisphereLights.value=J.state.hemi,tt.directionalShadowMatrix.value=J.state.directionalShadowMatrix,tt.spotLightMatrix.value=J.state.spotLightMatrix,tt.spotLightMap.value=J.state.spotLightMap,tt.pointShadowMatrix.value=J.state.pointShadowMatrix),j.lightProbeGrid=R.state.lightProbeGridArray.length>0,j.currentProgram=bt,j.uniformsList=null,bt}function ka(P){if(P.uniformsList===null){const X=P.currentProgram.getUniforms();P.uniformsList=Sh.seqWithValue(X.seq,P.uniforms)}return P.uniformsList}function or(P,X){const Q=N.get(P);
vendor: 4,894 bytes, line 4104
4104Q.outputColorSpace=X.outputColorSpace,Q.batching=X.batching,Q.batchingColor=X.batchingColor,Q.instancing=X.instancing,Q.instancingColor=X.instancingColor,Q.instancingMorph=X.instancingMorph,Q.skinning=X.skinning,Q.morphTargets=X.morphTargets,Q.morphNormals=X.morphNormals,Q.morphColors=X.morphColors,Q.morphTargetsCount=X.morphTargetsCount,Q.numClippingPlanes=X.numClippingPlanes,Q.numIntersection=X.numClipIntersection,Q.vertexAlphas=X.vertexAlphas,Q.vertexTangents=X.vertexTangents,Q.toneMapping=X.toneMapping}function Gr(P,X){if(P.length===0)return null;if(P.length===1)return P[0].texture!==null?P[0]:null;A.setFromMatrixPosition(X.matrixWorld);for(let Q=0,j=P.length;Q<j;Q++){const J=P[Q];if(J.texture!==null&&J.boundingBox.containsPoint(A))return J}return null}function zc(P,X,Q,j,J){X.isScene!==!0&&(X=Pe),C.resetTextureUnits();const xe=X.fog,He=j.isMeshStandardMaterial||j.isMeshLambertMaterial||j.isMeshPhongMaterial?X.environment:null,Fe=V===null?U.outputColorSpace:V.isXRRenderTarget===!0?V.texture.colorSpace:It.workingColorSpace,Ke=j.isMeshStandardMaterial||j.isMeshLambertMaterial&&!j.envMap||j.isMeshPhongMaterial&&!j.envMap,et=Y.get(j.envMap||He,Ke),_t=j.vertexColors===!0&&!!Q.attributes.color&&Q.attributes.color.itemSize===4,bt=!!Q.attributes.tangent&&(!!j.normalMap||j.anisotropy>0),tt=!!Q.morphAttributes.position,Gt=!!Q.morphAttributes.normal,Pt=!!Q.morphAttributes.color;let yt=zi;j.toneMapped&&(V===null||V.isXRRenderTarget===!0)&&(yt=U.toneMapping);const Wt=Q.morphAttributes.position||Q.morphAttributes.normal||Q.morphAttributes.color,vn=Wt!==void 0?Wt.length:0,ke=N.get(j),Hn=R.state.lights;if(Ct===!0&&(it===!0||P!==K)){const en=P===K&&j.id===$;qe.setState(j,P,en)}let Mt=!1;j.version===ke.__version?(ke.needsLights&&ke.lightsStateVersion!==Hn.state.version||ke.outputColorSpace!==Fe||J.isBatchedMesh&&ke.batching===!1||!J.isBatchedMesh&&ke.batching===!0||J.isBatchedMesh&&ke.batchingColor===!0&&J.colorTexture===null||J.isBatchedMesh&&ke.batchingColor===!1&&J.colorTexture!==null||J.isInstancedMesh&&ke.instancing===!1||!J.isInstancedMesh&&ke.instancing===!0||J.isSkinnedMesh&&ke.skinning===!1||!J.isSkinnedMesh&&ke.skinning===!0||J.isInstancedMesh&&ke.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&ke.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&ke.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&ke.instancingMorph===!1&&J.morphTexture!==null||ke.envMap!==et||j.fog===!0&&ke.fog!==xe||ke.numClippingPlanes!==void 0&&(ke.numClippingPlanes!==qe.numPlanes||ke.numIntersection!==qe.numIntersection)||ke.vertexAlphas!==_t||ke.vertexTangents!==bt||ke.morphTargets!==tt||ke.morphNormals!==Gt||ke.morphColors!==Pt||ke.toneMapping!==yt||ke.morphTargetsCount!==vn||!!ke.lightProbeGrid!=R.state.lightProbeGridArray.length>0)&&(Mt=!0):(Mt=!0,ke.__version=j.version);let Gn=ke.currentProgram;Mt===!0&&(Gn=vs(j,X,J),H&&j.isNodeMaterial&&H.onUpdateProgram(j,Gn,ke));let di=!1,Vi=!1,Ns=!1;const Kt=Gn.getUniforms(),hn=ke.uniforms;if(_e.useProgram(Gn.program)&&(di=!0,Vi=!0,Ns=!0),j.id!==$&&($=j.id,Vi=!0),ke.needsLights){const en=Gr(R.state.lightProbeGridArray,J);ke.lightProbeGrid!==en&&(ke.lightProbeGrid=en,Vi=!0)}if(di||K!==P){_e.buffers.depth.getReversed()&&P.reversedDepth!==!0&&(P._reversedDepth=!0,P.updateProjectionMatrix()),Kt.setValue(z,"projectionMatrix",P.projectionMatrix),Kt.setValue(z,"viewMatrix",P.matrixWorldInverse);const Ji=Kt.map.cameraPosition;Ji!==void 0&&Ji.setValue(z,ve.setFromMatrixPosition(P.matrixWorld)),$e.logarithmicDepthBuffer&&Kt.setValue(z,"logDepthBufFC",2/(Math.log(P.far+1)/Math.LN2)),(j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshLambertMaterial||j.isMeshBasicMaterial||j.isMeshStandardMaterial||j.isShaderMaterial)&&Kt.setValue(z,"isOrthographic",P.isOrthographicCamera===!0),K!==P&&(K=P,Vi=!0,Ns=!0)}if(ke.needsLights&&(Hn.state.directionalShadowMap.length>0&&Kt.setValue(z,"directionalShadowMap",Hn.state.directionalShadowMap,C),Hn.state.spotShadowMap.length>0&&Kt.setValue(z,"spotShadowMap",Hn.state.spotShadowMap,C),Hn.state.pointShadowMap.length>0&&Kt.setValue(z,"pointShadowMap",Hn.state.pointShadowMap,C)),J.isSkinnedMesh){Kt.setOptional(z,J,"bindMatrix"),Kt.setOptional(z,J,"bindMatrixInverse");const en=J.skeleton;en&&(en.boneTexture===null&&en.computeBoneTexture(),Kt.setValue(z,"boneTexture",en.boneTexture,C))}J.isBatchedMesh&&(Kt.setOptional(z,J,"batchingTexture"),Kt.setValue(z,"batchingTexture",J._matricesTexture,C),Kt.setOptional(z,J,"batchingIdTexture"),Kt.setValue(z,"batchingIdTexture",J._indirectTexture,C),Kt.setOptional(z,J,"batchingColorTexture"),J._colorsTexture!==null&&Kt.setValue(z,"batchingColorTexture",J._colorsTexture,C));const Ki=Q.morphAttributes;if((Ki.position!==void 0||Ki.normal!==void 0||Ki.color!==void 0)&&pt.update(J,Q,Gn),(Vi||ke.receiveShadow!==J.receiveShadow)&&(ke.receiveShadow=J.receiveShadow,Kt.setValue(z,"receiveShadow",J.re
vendor: 10,966 bytes, line 4104
4104ceiveShadow)),(j.isMeshStandardMaterial||j.isMeshLambertMaterial||j.isMeshPhongMaterial)&&j.envMap===null&&X.environment!==null&&(hn.envMapIntensity.value=X.environmentIntensity),hn.dfgLUT!==void 0&&(hn.dfgLUT.value=OP()),Vi){if(Kt.setValue(z,"toneMappingExposure",U.toneMappingExposure),ke.needsLights&&kc(hn,Ns),xe&&j.fog===!0&&ie.refreshFogUniforms(hn,xe),ie.refreshMaterialUniforms(hn,j,rt,st,R.state.transmissionRenderTarget[P.id]),ke.needsLights&&ke.lightProbeGrid){const en=ke.lightProbeGrid;hn.probesSH.value=en.texture,hn.probesMin.value.copy(en.boundingBox.min),hn.probesMax.value.copy(en.boundingBox.max),hn.probesResolution.value.copy(en.resolution)}Sh.upload(z,ka(ke),hn,C)}if(j.isShaderMaterial&&j.uniformsNeedUpdate===!0&&(Sh.upload(z,ka(ke),hn,C),j.uniformsNeedUpdate=!1),j.isSpriteMaterial&&Kt.setValue(z,"center",J.center),Kt.setValue(z,"modelViewMatrix",J.modelViewMatrix),Kt.setValue(z,"normalMatrix",J.normalMatrix),Kt.setValue(z,"modelMatrix",J.matrixWorld),j.uniformsGroups!==void 0){const en=j.uniformsGroups;for(let Ji=0,_s=en.length;Ji<_s;Ji++){const ol=en[Ji];re.update(ol,Gn),re.bind(ol,Gn)}}return Gn}function kc(P,X){P.ambientLightColor.needsUpdate=X,P.lightProbe.needsUpdate=X,P.directionalLights.needsUpdate=X,P.directionalLightShadows.needsUpdate=X,P.pointLights.needsUpdate=X,P.pointLightShadows.needsUpdate=X,P.spotLights.needsUpdate=X,P.spotLightShadows.needsUpdate=X,P.rectAreaLights.needsUpdate=X,P.hemisphereLights.needsUpdate=X}function Vc(P){return P.isMeshLambertMaterial||P.isMeshToonMaterial||P.isMeshPhongMaterial||P.isMeshStandardMaterial||P.isShadowMaterial||P.isShaderMaterial&&P.lights===!0}this.getActiveCubeFace=function(){return W},this.getActiveMipmapLevel=function(){return Z},this.getRenderTarget=function(){return V},this.setRenderTargetTextures=function(P,X,Q){const j=N.get(P);j.__autoAllocateDepthBuffer=P.resolveDepthBuffer===!1,j.__autoAllocateDepthBuffer===!1&&(j.__useRenderToTexture=!1),N.get(P.texture).__webglTexture=X,N.get(P.depthTexture).__webglTexture=j.__autoAllocateDepthBuffer?void 0:Q,j.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(P,X){const Q=N.get(P);Q.__webglFramebuffer=X,Q.__useDefaultFramebuffer=X===void 0};const rl=z.createFramebuffer();this.setRenderTarget=function(P,X=0,Q=0){V=P,W=X,Z=Q;let j=null,J=!1,xe=!1;if(P){const Fe=N.get(P);if(Fe.__useDefaultFramebuffer!==void 0){_e.bindFramebuffer(z.FRAMEBUFFER,Fe.__webglFramebuffer),he.copy(P.viewport),ce.copy(P.scissor),ye=P.scissorTest,_e.viewport(he),_e.scissor(ce),_e.setScissorTest(ye),$=-1;return}else if(Fe.__webglFramebuffer===void 0)C.setupRenderTarget(P);else if(Fe.__hasExternalTextures)C.rebindTextures(P,N.get(P.texture).__webglTexture,N.get(P.depthTexture).__webglTexture);else if(P.depthBuffer){const _t=P.depthTexture;if(Fe.__boundDepthTexture!==_t){if(_t!==null&&N.has(_t)&&(P.width!==_t.image.width||P.height!==_t.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");C.setupDepthRenderbuffer(P)}}const Ke=P.texture;(Ke.isData3DTexture||Ke.isDataArrayTexture||Ke.isCompressedArrayTexture)&&(xe=!0);const et=N.get(P).__webglFramebuffer;P.isWebGLCubeRenderTarget?(Array.isArray(et[X])?j=et[X][Q]:j=et[X],J=!0):P.samples>0&&C.useMultisampledRTT(P)===!1?j=N.get(P).__webglMultisampledFramebuffer:Array.isArray(et)?j=et[Q]:j=et,he.copy(P.viewport),ce.copy(P.scissor),ye=P.scissorTest}else he.copy(Se).multiplyScalar(rt).floor(),ce.copy(We).multiplyScalar(rt).floor(),ye=ot;if(Q!==0&&(j=rl),_e.bindFramebuffer(z.FRAMEBUFFER,j)&&_e.drawBuffers(P,j),_e.viewport(he),_e.scissor(ce),_e.setScissorTest(ye),J){const Fe=N.get(P.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+X,Fe.__webglTexture,Q)}else if(xe){const Fe=X;for(let Ke=0;Ke<P.textures.length;Ke++){const et=N.get(P.textures[Ke]);z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0+Ke,et.__webglTexture,Q,Fe)}}else if(P!==null&&Q!==0){const Fe=N.get(P.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Fe.__webglTexture,Q)}$=-1},this.readRenderTargetPixels=function(P,X,Q,j,J,xe,He,Fe=0){if(!(P&&P.isWebGLRenderTarget)){Qe("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ke=N.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&He!==void 0&&(Ke=Ke[He]),Ke){_e.bindFramebuffer(z.FRAMEBUFFER,Ke);try{const et=P.textures[Fe],_t=et.format,bt=et.type;if(P.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+Fe),!$e.textureFormatReadable(_t)){Qe("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!$e.textureTypeReadable(bt)){Qe("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=P.width-j&&Q>=0&&Q<=P.height-J&&z.readPixels(X,Q,j,J,G.convert(_t),G.convert(bt),xe)}finally{const et=V!==null?N.get(V).__webglFramebuffer:null;_e.bindFramebuffer(z.FRAMEBUFFER,et)}}},this.readRenderTargetPixelsAsync=async function(P,X,Q,j,J,xe,He,Fe=0){if(!(P&&P.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ke=N.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&He!==void 0&&(Ke=Ke[He]),Ke)if(X>=0&&X<=P.width-j&&Q>=0&&Q<=P.height-J){_e.bindFramebuffer(z.FRAMEBUFFER,Ke);const et=P.textures[Fe],_t=et.format,bt=et.type;if(P.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+Fe),!$e.textureFormatReadable(_t))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!$e.textureTypeReadable(bt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const tt=z.createBuffer();z.bindBuffer(z.PIXEL_PACK_BUFFER,tt),z.bufferData(z.PIXEL_PACK_BUFFER,xe.byteLength,z.STREAM_READ),z.readPixels(X,Q,j,J,G.convert(_t),G.convert(bt),0);const Gt=V!==null?N.get(V).__webglFramebuffer:null;_e.bindFramebuffer(z.FRAMEBUFFER,Gt);const Pt=z.fenceSync(z.SYNC_GPU_COMMANDS_COMPLETE,0);return z.flush(),await XE(z,Pt,4),z.bindBuffer(z.PIXEL_PACK_BUFFER,tt),z.getBufferSubData(z.PIXEL_PACK_BUFFER,0,xe),z.deleteBuffer(tt),z.deleteSync(Pt),xe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(P,X=null,Q=0){const j=Math.pow(2,-Q),J=Math.floor(P.image.width*j),xe=Math.floor(P.image.height*j),He=X!==null?X.x:0,Fe=X!==null?X.y:0;C.setTexture2D(P,0),z.copyTexSubImage2D(z.TEXTURE_2D,Q,0,0,He,Fe,J,xe),_e.unbindTexture()};const al=z.createFramebuffer(),xs=z.createFramebuffer();this.copyTextureToTexture=function(P,X,Q=null,j=null,J=0,xe=0){let He,Fe,Ke,et,_t,bt,tt,Gt,Pt;const yt=P.isCompressedTexture?P.mipmaps[xe]:P.image;if(Q!==null)He=Q.max.x-Q.min.x,Fe=Q.max.y-Q.min.y,Ke=Q.isBox3?Q.max.z-Q.min.z:1,et=Q.min.x,_t=Q.min.y,bt=Q.isBox3?Q.min.z:0;else{const hn=Math.pow(2,-J);He=Math.floor(yt.width*hn),Fe=Math.floor(yt.height*hn),P.isDataArrayTexture?Ke=yt.depth:P.isData3DTexture?Ke=Math.floor(yt.depth*hn):Ke=1,et=0,_t=0,bt=0}j!==null?(tt=j.x,Gt=j.y,Pt=j.z):(tt=0,Gt=0,Pt=0);const Wt=G.convert(X.format),vn=G.convert(X.type);let ke;X.isData3DTexture?(C.setTexture3D(X,0),ke=z.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(C.setTexture2DArray(X,0),ke=z.TEXTURE_2D_ARRAY):(C.setTexture2D(X,0),ke=z.TEXTURE_2D),_e.activeTexture(z.TEXTURE0),_e.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,X.flipY),_e.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),_e.pixelStorei(z.UNPACK_ALIGNMENT,X.unpackAlignment);const Hn=_e.getParameter(z.UNPACK_ROW_LENGTH),Mt=_e.getParameter(z.UNPACK_IMAGE_HEIGHT),Gn=_e.getParameter(z.UNPACK_SKIP_PIXELS),di=_e.getParameter(z.UNPACK_SKIP_ROWS),Vi=_e.getParameter(z.UNPACK_SKIP_IMAGES);_e.pixelStorei(z.UNPACK_ROW_LENGTH,yt.width),_e.pixelStorei(z.UNPACK_IMAGE_HEIGHT,yt.height),_e.pixelStorei(z.UNPACK_SKIP_PIXELS,et),_e.pixelStorei(z.UNPACK_SKIP_ROWS,_t),_e.pixelStorei(z.UNPACK_SKIP_IMAGES,bt);const Ns=P.isDataArrayTexture||P.isData3DTexture,Kt=X.isDataArrayTexture||X.isData3DTexture;if(P.isDepthTexture){const hn=N.get(P),Ki=N.get(X),en=N.get(hn.__renderTarget),Ji=N.get(Ki.__renderTarget);_e.bindFramebuffer(z.READ_FRAMEBUFFER,en.__webglFramebuffer),_e.bindFramebuffer(z.DRAW_FRAMEBUFFER,Ji.__webglFramebuffer);for(let _s=0;_s<Ke;_s++)Ns&&(z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,N.get(P).__webglTexture,J,bt+_s),z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,N.get(X).__webglTexture,xe,Pt+_s)),z.blitFramebuffer(et,_t,He,Fe,tt,Gt,He,Fe,z.DEPTH_BUFFER_BIT,z.NEAREST);_e.bindFramebuffer(z.READ_FRAMEBUFFER,null),_e.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else if(J!==0||P.isRenderTargetTexture||N.has(P)){const hn=N.get(P),Ki=N.get(X);_e.bindFramebuffer(z.READ_FRAMEBUFFER,al),_e.bindFramebuffer(z.DRAW_FRAMEBUFFER,xs);for(let en=0;en<Ke;en++)Ns?z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,hn.__webglTexture,J,bt+en):z.framebufferTexture2D(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,hn.__webglTexture,J),Kt?z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,Ki.__webglTexture,xe,Pt+en):z.framebufferTexture2D(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Ki.__webglTexture,xe),J!==0?z.blitFramebuffer(et,_t,He,Fe,tt,Gt,He,Fe,z.COLOR_BUFFER_BIT,z.NEAREST):Kt?z.copyTexSubImage3D(ke,xe,tt,Gt,Pt+en,et,_t,He,Fe):z.copyTexSubImage2D(ke,xe,tt,Gt,et,_t,He,Fe);_e.bindFramebuffer(z.READ_FRAMEBUFFER,null),_e.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else Kt?P.isDataTexture||P.isData3DTexture?z.texSubImage3D(ke,xe,tt,Gt,Pt,He,Fe,Ke,Wt,vn,yt.data):X.isCompressedArrayTexture?z.compressedTexSubImage3D(ke,xe,tt,Gt,Pt,He,Fe,Ke,Wt,yt.data):z.texSubImage3D(ke,xe,tt,Gt,Pt,He,Fe,Ke,Wt,vn,yt):P.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,xe,tt,Gt,He,Fe,Wt,vn,yt.data):P.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,xe,tt,Gt,yt.width,yt.height,Wt,yt.data):z.texSubImage2D(z.TEXTURE_2D,xe,tt,Gt,He,Fe,Wt,vn,yt);_e.pixelStorei(z.UNPACK_ROW_LENGTH,Hn),_e.pixelStorei(z.UNPACK_IMAGE_HEIGHT,Mt),_e.pixelStorei(z.UNPACK_SKIP_PIXELS,Gn),_e.pixelStorei(z.UNPACK_SKIP_ROWS,di),_e.pixelStorei(z.UNPACK_SKIP_IMAGES,Vi),xe===0&&X.generateMipmaps&&z.generateMipmap(ke),_e.unbindTexture()},this.initRenderTarget=function(P){N.get(P).__webglFramebuffer===void 0&&C.setupRenderTarget(P)},this.initTexture=function(P){P.isCubeTexture?C.setTextureCube(P,0):P.isData3DTexture?C.setTexture3D(P,0):P.isDataArrayTexture||P.isCompressedArrayTexture?C.setTexture2DArray(P,0):C.setTexture2D(P,0),_e.unbindTexture()},this.resetState=function(){W=0,Z=0,V=null,_e.reset(),Te.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Bi}get outputColorSpace(){return this._outputColorSpace}
4104set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=It._getDrawingBufferColorSpace(e),t.unpackColorSpace=It._getUnpackColorSpace()}}const BP=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:yf,AddEquation:Ir,AddOperation:Uy,AdditiveAnimationBlendMode:rg,AdditiveBlending:Ho,AgXToneMapping:Zm,AlphaFormat:ig,AlwaysCompare:qy,AlwaysDepth:uc,AlwaysStencilFunc:Em,AmbientLight:BS,AnimationAction:jS,AnimationClip:Ac,AnimationLoader:Fw,AnimationMixer:fA,AnimationObjectGroup:uA,AnimationUtils:Lw,ArcCurve:cS,ArrayCamera:WS,ArrowHelper:FA,AttachedBindMode:bm,Audio:qS,AudioAnalyser:eA,AudioContext:Pg,AudioListener:Kw,AudioLoader:Yw,AxesHelper:OA,BackSide:Nn,BasicDepthPacking:zr,BasicShadowMap:my,BatchedMesh:iS,BezierInterpolant:PS,Bone:hg,BooleanKeyframeTrack:Da,Box2:yA,Box3:ri,Box3Helper:NA,BoxGeometry:La,BoxHelper:DA,BufferAttribute:Qt,BufferGeometry:gt,BufferGeometryLoader:HS,ByteType:Qm,Cache:Rs,Camera:Jf,CameraHelper:LA,CanvasTexture:KT,CapsuleGeometry:zf,CatmullRomCurve3:uS,CineonToneMapping:jm,CircleGeometry:kf,ClampToEdgeWrapping:bi,Clock:ZS,Color:Ve,ColorKeyframeTrack:Ag,ColorManagement:It,Compatibility:kE,CompressedArrayTexture:$T,CompressedCubeTexture:ZT,CompressedTexture:Bf,CompressedTextureLoader:Ow,ConeGeometry:Nc,ConstantAlphaFactor:Ly,ConstantColorFactor:Iy,Controls:zA,CubeCamera:GS,CubeDepthTexture:oS,CubeReflectionMapping:Ps,CubeRefractionMapping:Nr,CubeTexture:Lc,CubeTextureLoader:Bw,CubeUVReflectionMapping:Ko,CubicBezierCurve:mg,CubicBezierCurve3:hS,CubicInterpolant:RS,CullFaceBack:_m,CullFaceFront:py,CullFaceFrontBack:J1,CullFaceNone:dy,Curve:ps,CurvePath:dS,CustomBlending:gy,CustomToneMapping:$m,CylinderGeometry:Dc,Cylindrical:_A,Data3DTexture:Lf,DataArrayTexture:Pf,DataTexture:hs,DataTextureLoader:zw,DataUtils:bT,DecrementStencilOp:vE,DecrementWrapStencilOp:_E,DefaultLoadingManager:DS,DepthFormat:Ls,DepthStencilFormat:er,DepthTexture:Br,DetachedBindMode:Fy,DirectionalLight:OS,DirectionalLightHelper:PA,DiscreteInterpolant:IS,DodecahedronGeometry:Vf,DoubleSide:ni,DstAlphaFactor:Ty,DstColorFactor:Ay,DynamicCopyUsage:NE,DynamicDrawUsage:CE,DynamicReadUsage:PE,EdgesGeometry:lS,EllipseCurve:Hf,EqualCompare:Gy,EqualDepth:Ah,EqualStencilFunc:ME,EquirectangularReflectionMapping:Kl,EquirectangularRefractionMapping:Jl,Euler:ds,EventDispatcher:Mi,ExternalTexture:dg,ExtrudeGeometry:Gf,FileLoader:sr,Float16BufferAttribute:RT,Float32BufferAttribute:je,FloatType:Yn,Fog:Nf,FogExp2:Df,FramebufferTexture:jT,FrontSide:Is,Frustum:Qo,FrustumArray:Of,GLBufferAttribute:vA,GLSL1:FE,GLSL3:Tm,GreaterCompare:Wy,GreaterDepth:Rh,GreaterEqualCompare:If,GreaterEqualDepth:Ch,GreaterEqualStencilFunc:AE,GreaterStencilFunc:TE,GridHelper:RA,Group:zo,HTMLTexture:JT,HalfFloatType:fs,HemisphereLight:NS,HemisphereLightHelper:CA,IcosahedronGeometry:Wf,ImageBitmapLoader:qw,ImageLoader:Cc,ImageUtils:Zy,IncrementStencilOp:gE,IncrementWrapStencilOp:xE,InstancedBufferAttribute:qo,InstancedBufferGeometry:VS,InstancedInterleavedBuffer:gA,InstancedMesh:nS,Int16BufferAttribute:AT,Int32BufferAttribute:CT,Int8BufferAttribute:ET,IntType:bf,InterleavedBuffer:Uf,InterleavedBufferAttribute:Ra,Interpolant:tl,InterpolateBezier:Mm,InterpolateDiscrete:mc,InterpolateLinear:lf,InterpolateSmooth:_h,InterpolationSamplingMode:zE,InterpolationSamplingType:BE,InvertStencilOp:yE,KeepStencilOp:ga,KeyframeTrack:$i,LOD:eS,LatheGeometry:Xf,Layers:Xo,LessCompare:Hy,LessDepth:wh,LessEqualCompare:Rf,LessEqualDepth:wa,LessEqualStencilFunc:EE,LessStencilFunc:bE,Light:Hr,LightProbe:kS,Line:ir,Line3:MA,LineBasicMaterial:ai,LineCurve:gg,LineCurve3:fS,LineDashedMaterial:AS,LineLoop:sS,LineSegments:Ds,LinearFilter:nn,LinearInterpolant:wg,LinearMipMapLinearFilter:iE,LinearMipMapNearestFilter:nE,LinearMipmapLinearFilter:Cs,LinearMipmapNearestFilter:Ql,LinearSRGBColorSpace:Fr,LinearToneMapping:qm,LinearTransfer:vc,Loader:Ei,LoaderUtils:Im,LoadingManager:Cg,LoopOnce:Oy,LoopPingPong:zy,LoopRepeat:By,MOUSE:Z1,Material:Vn,MaterialBlending:Q1,MaterialLoader:Qf,MathUtils:Js,Matrix2:Lm,Matrix3:xt,Matrix4:mt,MaxEquation:yy,Mesh:Mn,MeshBasicMaterial:kr,MeshDepthMaterial:Mg,MeshDistanceMaterial:Eg,MeshLambertMaterial:TS,MeshMatcapMaterial:wS,MeshNormalMaterial:bg,MeshPhongMaterial:MS,MeshPhysicalMaterial:bS,MeshStandardMaterial:Sg,MeshToonMaterial:ES,MinEquation:_y,MirroredRepeatWrapping:fc,MixOperation:Ny,MultiplyBlending:Sm,MultiplyOperation:Ic,NearestFilter:cn,NearestMipMapLinearFilter:tE,NearestMipMapNearestFilter:eE,NearestMipmapLinearFilter:Oo,NearestMipmapNearestFilter:Jm,NeutralToneMapping:Km,NeverCompare:Vy,NeverDepth:Th,NeverStencilFunc:SE,NoBlending:jn,NoColorSpace:cs,NoNormalPacking:hE,NoToneMapping:zi,NormalAnimationBlendMode:Cf,NormalBlending:ba,NormalGAPacking:dE,NormalRGPacking:fE,NotEqualCompare:Xy,NotEqualDepth:Ih,NotEqualStencilFunc:wE,NumberKeyframeTrack:Tc,Object3D:Ht,ObjectLoader:Ww,ObjectSpaceNormalMap:ky,OctahedronGeometry:Uc,OneFactor:by,OneMinusConstantAlphaFactor:Dy,OneMinusConstantColorFactor:Py,O
4104neMinusDstAlphaFactor:wy,OneMinusDstColorFactor:Cy,OneMinusSrcAlphaFactor:Eh,OneMinusSrcColorFactor:Ey,OrthographicCamera:Ua,PCFShadowMap:ko,PCFSoftShadowMap:Zl,PMREMGenerator:Nm,Path:df,PerspectiveCamera:Dn,Plane:Rr,PlaneGeometry:el,PlaneHelper:UA,PointLight:FS,PointLightHelper:wA,Points:rS,PointsMaterial:fg,PolarGridHelper:IA,PolyhedronGeometry:Vr,PositionalAudio:Qw,PropertyBinding:Vt,PropertyMixer:YS,QuadraticBezierCurve:vg,QuadraticBezierCurve3:xg,Quaternion:hi,QuaternionKeyframeTrack:Oc,QuaternionLinearInterpolant:LS,R11_EAC_Format:Bh,RED_GREEN_RGTC2_Format:pc,RED_RGTC1_Format:rf,REVISION:Zo,RG11_EAC_Format:dc,RGBADepthPacking:lE,RGBAFormat:ii,RGBAIntegerFormat:Af,RGBA_ASTC_10x10_Format:Jh,RGBA_ASTC_10x5_Format:$h,RGBA_ASTC_10x6_Format:Zh,RGBA_ASTC_10x8_Format:Kh,RGBA_ASTC_12x10_Format:Qh,RGBA_ASTC_12x12_Format:ef,RGBA_ASTC_4x4_Format:Vh,RGBA_ASTC_5x4_Format:Hh,RGBA_ASTC_5x5_Format:Gh,RGBA_ASTC_6x5_Format:Wh,RGBA_ASTC_6x6_Format:Xh,RGBA_ASTC_8x5_Format:qh,RGBA_ASTC_8x6_Format:Yh,RGBA_ASTC_8x8_Format:jh,RGBA_BPTC_Format:tf,RGBA_ETC2_EAC_Format:Oh,RGBA_PVRTC_2BPPV1_Format:Nh,RGBA_PVRTC_4BPPV1_Format:Dh,RGBA_S3TC_DXT1_Format:tc,RGBA_S3TC_DXT3_Format:nc,RGBA_S3TC_DXT5_Format:ic,RGBDepthPacking:cE,RGBFormat:sg,RGBIntegerFormat:sE,RGB_BPTC_SIGNED_Format:nf,RGB_BPTC_UNSIGNED_Format:sf,RGB_ETC1_Format:Uh,RGB_ETC2_Format:Fh,RGB_PVRTC_2BPPV1_Format:Lh,RGB_PVRTC_4BPPV1_Format:Ph,RGB_S3TC_DXT1_Format:ec,RGDepthPacking:uE,RGFormat:Ur,RGIntegerFormat:wf,RawShaderMaterial:yg,Ray:Jo,Raycaster:$S,RectAreaLight:zS,RedFormat:Tf,RedIntegerFormat:Pc,ReinhardToneMapping:Ym,RenderTarget:og,RenderTarget3D:dA,RepeatWrapping:hc,ReplaceStencilOp:mE,ReverseSubtractEquation:xy,RingGeometry:qf,SIGNED_R11_EAC_Format:zh,SIGNED_RED_GREEN_RGTC2_Format:of,SIGNED_RED_RGTC1_Format:af,SIGNED_RG11_EAC_Format:kh,SRGBColorSpace:$t,SRGBTransfer:Jt,Scene:Sc,ShaderChunk:At,ShaderLib:ls,ShaderMaterial:En,ShadowMaterial:_S,Shape:Ea,ShapeGeometry:Yf,ShapePath:BA,ShapeUtils:us,ShortType:eg,Skeleton:Ff,SkeletonHelper:TA,SkinnedMesh:tS,Source:Lr,Sphere:$n,SphereGeometry:Fc,Spherical:xA,SphericalHarmonics3:Ig,SplineCurve:_g,SpotLight:US,SpotLightHelper:EA,Sprite:Qy,SpriteMaterial:ug,SrcAlphaFactor:Mh,SrcAlphaSaturateFactor:Ry,SrcColorFactor:My,StaticCopyUsage:DE,StaticDrawUsage:xc,StaticReadUsage:IE,StereoCamera:jw,StreamCopyUsage:UE,StreamDrawUsage:RE,StreamReadUsage:LE,StringKeyframeTrack:Na,SubtractEquation:vy,SubtractiveBlending:ym,TOUCH:K1,TangentSpaceNormalMap:nr,TetrahedronGeometry:jf,Texture:un,TextureLoader:kw,TextureUtils:WA,Timer:XS,TimestampQuery:OE,TorusGeometry:$f,TorusKnotGeometry:Zf,Triangle:Si,TriangleFanDrawMode:oE,TriangleStripDrawMode:aE,TrianglesDrawMode:rE,TubeGeometry:Kf,UVMapping:Sf,Uint16BufferAttribute:lg,Uint32BufferAttribute:cg,Uint8BufferAttribute:TT,Uint8ClampedBufferAttribute:wT,Uniform:Ut,UniformsGroup:mA,UniformsLib:Oe,UniformsUtils:SS,UnsignedByteType:yn,UnsignedInt101111Type:ng,UnsignedInt248Type:Aa,UnsignedInt5999Type:tg,UnsignedIntType:ji,UnsignedShort4444Type:Mf,UnsignedShort5551Type:Ef,UnsignedShortType:Go,VSMShadowMap:xa,Vector2:ae,Vector3:B,Vector4:Zt,VectorKeyframeTrack:wc,VideoFrameTexture:YT,VideoTexture:aS,WebGL3DRenderTarget:dT,WebGLArrayRenderTarget:fT,WebGLCoordinateSystem:Bi,WebGLCubeRenderTarget:Ng,WebGLRenderTarget:fn,WebGLRenderer:ab,WebGLUtils:sb,WebGPUCoordinateSystem:Ca,WebXRController:yh,WireframeGeometry:xS,WrapAroundEnding:gc,ZeroCurvatureEnding:_a,ZeroFactor:Sy,ZeroSlopeEnding:ya,ZeroStencilOp:pE,createCanvasElement:jy,error:Qe,getConsoleFunction:WE,log:yc,setConsoleFunction:GE,warn:De,warnOnce:cf},Symbol.toStringTag,{value:"Module"})),{useSyncExternalStoreWithSelector:zP}=q1,kP=i=>i;function VP(i,e=kP,t){const n=zP(i.subscribe,i.getState,i.getInitialState,e,t);return Xm.useDebugValue(n),n}const X_=(i,e)=>{const t=$1(i),n=(s,o=e)=>VP(t,s,o);return Object.assign(n,t),n},HP=((i,e)=>i?X_(i,e):X_);var Om=Y1();const GP=j1(Om);function Ug(i,e,t){if(!i)return;if(t(i)===!0)return i;let n=e?i.return:i.child;for(;n;){const s=Ug(n,e,t);if(s)return s;n=e?null:n.sibling}}function ob(i){try{return Object.defineProperties(i,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return i}}const Fg=ob(Ze.createContext(null));class lb extends Ze.Component{render(){return Ze.createElement(Fg.Provider,{value:this._reactInternals},this.props.children)}}function cb(){const i=Ze.useContext(Fg);if(i===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=Ze.useId();return Ze.useMemo(()=>{for(const t of[i,i?.alternate]){if(!t)continue;const n=Ug(t,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(n)return n}},[i,e])}const WP=Symbol.for("react.context"),XP=i=>i!==null&&typeof i=="object"&&"$$typeof"in i&&i.$$typeof===WP;function qP(){const i=cb(),[e]=Ze.useState(()=>new Map);e.clear();let t=i;for(;t;){const n=t.type;XP(n)&&n!==Fg&&!e.has(n)&&e.set(n,Ze.use(ob(n))),t=t.return}return e}function YP(){const i=qP();return Ze.useMemo(()=>Array.from(i.keys()).reduce((e,t)=>
4104n=>Ze.createElement(e,null,Ze.createElement(t.Provider,{...n,value:i.get(t)})),e=>Ze.createElement(lb,{...e})),[i])}function Og(i){let e=i.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const ub=i=>i&&i.isOrthographicCamera,jP=i=>i&&i.hasOwnProperty("current"),$P=i=>i!=null&&(typeof i=="string"||typeof i=="number"||i.isColor),Bc=((i,e)=>typeof window<"u"&&(((i=window.document)==null?void 0:i.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?Ze.useLayoutEffect:Ze.useEffect;function hb(i){const e=Ze.useRef(i);return Bc(()=>{e.current=i},[i]),e}function ZP(){const i=cb(),e=YP();return Ze.useMemo(()=>({children:t})=>{const s=!!Ug(i,!0,o=>o.type===Ze.StrictMode)?Ze.StrictMode:Ze.Fragment;return Ge.jsx(s,{children:Ge.jsx(e,{children:t})})},[i,e])}function KP({set:i}){return Bc(()=>(i(new Promise(()=>null)),()=>i(!1)),[i]),null}const JP=(i=>(i=class extends Ze.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},i.getDerivedStateFromError=()=>({error:!0}),i))();function fb(i){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(i)?Math.min(Math.max(i[0],t),i[1]):i}function No(i){var e;return(e=i.__r3f)==null?void 0:e.root.getState()}const ln={obj:i=>i===Object(i)&&!ln.arr(i)&&typeof i!="function",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",boo:i=>typeof i=="boolean",und:i=>i===void 0,nul:i=>i===null,arr:i=>Array.isArray(i),equ(i,e,{arrays:t="shallow",objects:n="reference",strict:s=!0}={}){if(typeof i!=typeof e||!!i!=!!e)return!1;if(ln.str(i)||ln.num(i)||ln.boo(i))return i===e;const o=ln.obj(i);if(o&&n==="reference")return i===e;const l=ln.arr(i);if(l&&t==="reference")return i===e;if((l||o)&&i===e)return!0;let c;for(c in i)if(!(c in e))return!1;if(o&&t==="shallow"&&n==="shallow"){for(c in s?e:i)if(!ln.equ(i[c],e[c],{strict:s,objects:"reference"}))return!1}else for(c in s?e:i)if(i[c]!==e[c])return!1;if(ln.und(c)){if(l&&i.length===0&&e.length===0||o&&Object.keys(i).length===0&&Object.keys(e).length===0)return!0;if(i!==e)return!1}return!0}};function QP(i){i.type!=="Scene"&&(i.dispose==null||i.dispose());for(const e in i){const t=i[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const db=["children","key","ref"];function eL(i){const e={};for(const t in i)db.includes(t)||(e[t]=i[t]);return e}function pf(i,e,t,n){const s=i;let o=s?.__r3f;return o||(o={root:e,type:t,parent:null,children:[],props:eL(n),object:s,eventCount:0,handlers:{},isHidden:!1},s&&(s.__r3f=o)),o}function Rc(i,e){if(!e.includes("-"))return{root:i,key:e,target:i[e]};if(e in i)return{root:i,key:e,target:i[e]};let t=i;const n=e.split("-");for(const s of n){if(typeof t!="object"||t===null){if(t!==void 0){const o=n.slice(n.indexOf(s)).join("-");return{root:t,key:o,target:void 0}}return{root:i,key:e,target:void 0}}e=s,i=t,t=t[e]}return{root:i,key:e,target:t}}const q_=/-\d+$/;function mf(i,e){if(ln.str(e.props.attach)){if(q_.test(e.props.attach)){const s=e.props.attach.replace(q_,""),{root:o,key:l}=Rc(i.object,s);Array.isArray(o[l])||(o[l]=[])}const{root:t,key:n}=Rc(i.object,e.props.attach);e.previousAttach=t[n],t[n]=e.object}else ln.fun(e.props.attach)&&(e.previousAttach=e.props.attach(i.object,e.object))}function gf(i,e){if(ln.str(e.props.attach)){const{root:t,key:n}=Rc(i.object,e.props.attach),s=e.previousAttach;s===void 0?delete t[n]:t[n]=s}else e.previousAttach==null||e.previousAttach(i.object,e.object);delete e.previousAttach}const Bm=[...db,"args","dispose","attach","object","onUpdate","dispose"],Y_=new Map;function tL(i){let e=Y_.get(i.constructor);try{e||(e=new i.constructor,Y_.set(i.constructor,e))}catch{}return e}function nL(i,e){const t={};for(const n in e)if(!Bm.includes(n)&&!ln.equ(e[n],i.props[n])){t[n]=e[n];for(const s in e)s.startsWith(`${n}-`)&&(t[s]=e[s])}for(const n in i.props){if(Bm.includes(n)||e.hasOwnProperty(n))continue;const{root:s,key:o}=Rc(i.object,n);if(s.constructor&&s.constructor.length===0){const l=tL(s);ln.und(l)||(t[o]=l[o])}else t[o]=0}return t}const iL=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],sL=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function Pr(i,e){var t;const n=i.__r3f,s=n&&Og(n).getState(),o=n?.eventCount;for(const c in e){let h=e[c];if(Bm.includes(c))continue;if(n&&sL.test(c)){typeof h=="function"?n.handlers[c]=h:delete n.handlers[c],n.eventCount=Object.keys(n.handlers).length;continue}if(h===void 0)continue;let{root:f,key:p,target:g}=Rc(i,c);if(g===void 0&&(typeof f!="object"||f===null))throw Error(`R3F: Cannot set "${c}". Ensure it is an object before setting "${p}".`);if(g instanceof Xo&&h instanceof Xo)g.mask=h.mask;else if(g instanceof Ve&&$P(h))g.set(h);else if(g!==null&&typeof g=="object"&&typeof g.set=="function"&&typeof g.copy=="function"&&h!=null&&h.constructor&&g.constructor===h.constructor)g.copy(h);else if(g!==null&&typeof g=="object"&&typeof g.set=="function"&&Array.isArray(h))typeof g.fromArray=="function"?g.fromArray(h):g.set(...h);else if(g!==null&&typeof g=="object"&&typeof g.set=="function"&&typeof h=="number")typeof g.setScalar=="function"?g.setScalar(h):g.set(h);else if(f instanceof En&&p==="uniforms"&&ln.obj(h)){ln.obj(f.uniforms)||(f.uniforms={});const m=f.uniforms,v=h;for(const y in v){const E=v[y],S=m[y];S?Object.assign(S,E):m[y]={...E}}}else{var l;
4104f[p]=h,s&&!s.linear&&iL.includes(p)&&(l=f[p])!=null&&l.isTexture&&f[p].format===ii&&f[p].type===yn&&(f[p].colorSpace=$t)}}if(n!=null&&n.parent&&s!=null&&s.internal&&(t=n.object)!=null&&t.isObject3D&&o!==n.eventCount){const c=n.object,h=s.internal.interaction.indexOf(c);h>-1&&s.internal.interaction.splice(h,1),n.eventCount&&c.raycast!==null&&s.internal.interaction.push(c)}return n&&n.props.attach===void 0&&(n.object.isBufferGeometry?n.props.attach="geometry":n.object.isMaterial&&(n.props.attach="material")),n&&il(n),i}function il(i){var e;if(!i.parent)return;i.props.onUpdate==null||i.props.onUpdate(i.object);const t=(e=i.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function rL(i,e){i.manual||(ub(i)?(i.left=e.width/-2,i.right=e.width/2,i.top=e.height/2,i.bottom=e.height/-2):i.aspect=e.width/e.height,i.updateProjectionMatrix())}const yi=i=>i?.isObject3D;function $l(i){return(i.eventObject||i.object).uuid+"/"+i.index+i.instanceId}function pb(i,e,t,n){const s=t.get(e);s&&(t.delete(e),t.size===0&&(i.delete(n),s.target.releasePointerCapture(n)))}function aL(i,e,t){const{internal:n}=i.getState();for(let s=0;s<n.interaction.length;s++)n.interaction[s]===e&&(n.interaction[s]=t);for(let s=0;s<n.initialHits.length;s++)n.initialHits[s]===e&&(n.initialHits[s]=t);n.hovered.forEach((s,o)=>{if(s.eventObject===e||s.object===e){n.hovered.delete(o);const l={...s,eventObject:s.eventObject===e?t:s.eventObject,object:s.object===e?t:s.object};n.hovered.set($l(l),l)}}),n.capturedMap.forEach(s=>{const o=s.get(e);o&&(s.delete(e),s.set(t,o))})}function oL(i,e){const{internal:t}
vendor: 4,609 bytes, line 4104
4104=i.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,s)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((n,s)=>{pb(t.capturedMap,e,n,s)})}function lL(i){function e(h){const{internal:f}=i.getState(),p=h.offsetX-f.initialClick[0],g=h.offsetY-f.initialClick[1];return Math.round(Math.sqrt(p*p+g*g))}function t(h){return h.filter(f=>["Move","Over","Enter","Out","Leave"].some(p=>{var g;return(g=f.__r3f)==null?void 0:g.handlers["onPointer"+p]}))}function n(h,f){const p=i.getState(),g=new Set,m=[],v=f?f(p.internal.interaction):p.internal.interaction;for(let _=0;_<v.length;_++){const M=No(v[_]);M&&(M.raycaster.camera=void 0)}p.previousRoot||p.events.compute==null||p.events.compute(h,p);function y(_){const M=No(_);if(!M||!M.events.enabled||M.raycaster.camera===null)return[];if(M.raycaster.camera===void 0){var T;M.events.compute==null||M.events.compute(h,M,(T=M.previousRoot)==null?void 0:T.getState()),M.raycaster.camera===void 0&&(M.raycaster.camera=null)}return M.raycaster.camera?M.raycaster.intersectObject(_,!0):[]}let E=v.flatMap(y).sort((_,M)=>{const T=No(_.object),A=No(M.object);return!T||!A?_.distance-M.distance:A.events.priority-T.events.priority||_.distance-M.distance}).filter(_=>{const M=$l(_);return g.has(M)?!1:(g.add(M),!0)});p.events.filter&&(E=p.events.filter(E,p));for(const _ of E){let M=_.object;for(;M;){var S;(S=M.__r3f)!=null&&S.eventCount&&m.push({..._,eventObject:M}),M=M.parent}}if("pointerId"in h&&p.internal.capturedMap.has(h.pointerId))for(let _ of p.internal.capturedMap.get(h.pointerId).values())g.has($l(_.intersection))||m.push(_.intersection);return m}function s(h,f,p,g){if(h.length){const m={stopped:!1};for(const v of h){let y=No(v.object);if(y||v.object.traverseAncestors(E=>{const S=No(E);if(S)return y=S,!1}),y){const{raycaster:E,pointer:S,camera:_,internal:M}=y,T=new B(S.x,S.y,0).unproject(_),A=L=>{var U,O;return(U=(O=M.capturedMap.get(L))==null?void 0:O.has(v.eventObject))!=null?U:!1},D=L=>{const U={intersection:v,target:f.target};M.capturedMap.has(L)?M.capturedMap.get(L).set(v.eventObject,U):M.capturedMap.set(L,new Map([[v.eventObject,U]])),f.target.setPointerCapture(L)},R=L=>{const U=M.capturedMap.get(L);U&&pb(M.capturedMap,v.eventObject,U,L)};let F={};for(let L in f){let U=f[L];typeof U!="function"&&(F[L]=U)}let w={...v,...F,pointer:S,intersections:h,stopped:m.stopped,delta:p,unprojectedPoint:T,ray:E.ray,camera:_,stopPropagation(){const L="pointerId"in f&&M.capturedMap.get(f.pointerId);if((!L||L.has(v.eventObject))&&(w.stopped=m.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(U=>U.eventObject===v.eventObject))){const U=h.slice(0,h.indexOf(v));o([...U,v])}},target:{hasPointerCapture:A,setPointerCapture:D,releasePointerCapture:R},currentTarget:{hasPointerCapture:A,setPointerCapture:D,releasePointerCapture:R},nativeEvent:f};if(g(w),m.stopped===!0)break}}}return h}function o(h){const{internal:f}=i.getState();for(const p of f.hovered.values())if(!h.length||!h.find(g=>g.object===p.object&&g.index===p.index&&g.instanceId===p.instanceId)){const m=p.eventObject.__r3f;if(f.hovered.delete($l(p)),m!=null&&m.eventCount){const v=m.handlers,y={...p,intersections:h};v.onPointerOut==null||v.onPointerOut(y),v.onPointerLeave==null||v.onPointerLeave(y)}}}function l(h,f){for(let p=0;p<f.length;p++){const g=f[p].__r3f;g==null||g.handlers.onPointerMissed==null||g.handlers.onPointerMissed(h)}}function c(h){switch(h){case"onPointerLeave":case"onPointerCancel":return()=>o([]);case"onLostPointerCapture":return f=>{const{internal:p}=i.getState();"pointerId"in f&&p.capturedMap.has(f.pointerId)&&requestAnimationFrame(()=>{p.capturedMap.has(f.pointerId)&&(p.capturedMap.delete(f.pointerId),o([]))})}}return function(p){const{onPointerMissed:g,internal:m}=i.getState();m.lastEvent.current=p;const v=h==="onPointerMove",y=h==="onClick"||h==="onContextMenu"||h==="onDoubleClick",S=n(p,v?t:void 0),_=y?e(p):0;h==="onPointerDown"&&(m.initialClick=[p.offsetX,p.offsetY],m.initialHits=S.map(T=>T.eventObject)),y&&!S.length&&_<=2&&(l(p,m.interaction),g&&g(p)),v&&o(S);function M(T){const A=T.eventObject,D=A.__r3f;if(!(D!=null&&D.eventCount))return;const R=D.handlers;if(v){if(R.onPointerOver||R.onPointerEnter||R.onPointerOut||R.onPointerLeave){const F=$l(T),w=m.hovered.get(F);w?w.stopped&&T.stopPropagation():(m.hovered.set(F,T),R.onPointerOver==null||R.onPointerOver(T),R.onPointerEnter==null||R.onPointerEnter(T))}R.onPointerMove==null||R.onPointerMove(T)}else{const F=R[h];F?(!y||m.initialHits.includes(A))&&(l(p,m.interaction.filter(w=>
4104!m.initialHits.includes(w))),F(T)):y&&m.initialHits.includes(A)&&l(p,m.interaction.filter(w=>!m.initialHits.includes(w)))}}s(S,p,_,M)}}return{handlePointer:c}}const j_=i=>!!(i!=null&&i.render),mb=Ze.createContext(null),cL=(i,e)=>{const t=HP((c,h)=>{const f=new B,p=new B,g=new B;function m(_=h().camera,M=p,T=h().size){const{width:A,height:D,top:R,left:F}=T,w=A/D;M.isVector3?g.copy(M):g.set(...M);const L=_.getWorldPosition(f).distanceTo(g);if(ub(_))return{width:A/_.zoom,height:D/_.zoom,top:R,left:F,factor:1,distance:L,aspect:w};{const U=_.fov*Math.PI/180,O=2*Math.tan(U/2)*L,H=O*(A/D);return{width:H,height:O,top:R,left:F,factor:A/H,distance:L,aspect:w}}}let v;const y=_=>c(M=>({performance:{...M.performance,current:_}})),E=new ae;return{set:c,get:h,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(_=1)=>i(h(),_),advance:(_,M)=>e(_,M,h()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new ZS,pointer:E,mouse:E,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const _=h();v&&clearTimeout(v),_.performance.current!==_.performance.min&&y(_.performance.min),v=setTimeout(()=>y(h().performance.max),_.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:m},setEvents:_=>c(M=>({...M,events:{...M.events,..._}})),setSize:(_,M,T=0,A=0)=>{const D=h().camera,R={width:_,height:M,top:T,left:A};c(F=>({size:R,viewport:{...F.viewport,...m(D,p,R)}}))},setDpr:_=>c(M=>{const T=fb(_);return{viewport:{...M.viewport,dpr:T,initialDpr:M.viewport.initialDpr||T}}}),setFrameloop:(_="always")=>{const M=h().clock;M.stop(),M.elapsedTime=0,_!=="never"&&(M.start(),M.elapsedTime=0),c(()=>({frameloop:_}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:Ze.createRef(),active:!1,frames:0,priority:0,subscribe:(_,M,T)=>{const A=h().internal;return A.priority=A.priority+(M>0?1:0),A.subscribers.push({ref:_,priority:M,store:T}),A.subscribers=A.subscribers.sort((D,R)=>D.priority-R.priority),()=>{const D=h().internal;D!=null&&D.subscribers&&(D.priority=D.priority-(M>0?1:0),D.subscribers=D.subscribers.filter(R=>R.ref!==_))}}}}}),n=t.getState();let s=n.size,o=n.viewport.dpr,l=n.camera;return t.subscribe(()=>{const{camera:c,size:h,viewport:f,gl:p,set:g}=t.getState();if(h.width!==s.width||h.height!==s.height||f.dpr!==o){s=h,o=f.dpr,rL(c,h),f.dpr>0&&p.setPixelRatio(f.dpr);const m=typeof HTMLCanvasElement<"u"&&p.domElement instanceof HTMLCanvasElement;p.setSize(h.width,h.height,m)}c!==l&&(l=c,g(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(c)}})))}),t.subscribe(c=>i(c)),t};function gb(){const i=Ze.useContext(mb);if(!i)throw new Error("R3F: Hooks can only be used within the Canvas component!");return i}function Bg(i=t=>t,e){return gb()(i,e)}function sl(i,e=0){const t=gb(),n=t.getState().internal.subscribe,s=hb(i);return Bc(()=>n(s,e,t),[e,n,t]),null}const uL=1,hL=8,fL=32,dL=2;var pL={version:"9.6.1"};function mL(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var $_={exports:{}},Z_={exports:{}},K_;function gL(){return K_||(K_=1,(function(i){i.exports=function(e){function t(r,a,u,d){return new Kb(r,a,u,d)}function n(){}function s(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){var a=r,u=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(u=a.return),r=a.return;while(r)}return a.tag===3?u:null}function l(r){if(o(r)!==r)throw Error(s(188))}function c(r){var a=r.alternate;if(!a){if(a=o(r),a===null)throw Error(s(188));return a!==r?null:r}for(var u=r,d=a;;){var x=u.return;if(x===null)break;var b=x.alternate;if(b===null){if(d=x.return,d!==null){u=d;continue}break}if(x.child===b.child){for(b=x.child;b;){if(b===u)return l(x),r;if(b===d)return l(x),a;b=b.sibling}throw Error(s(188))}if(u.return!==d.return)u=x,d=b;else{for(var I=!1,k=x.child;k;){if(k===u){I=!0,u=x,d=b;break}if(k===d){I=!0,d=x,u=b;break}k=k.sibling}if(!I){for(k=b.child;k;){if(k===u){I=!0,u=b,d=x;break}if(k===d){I=!0,d=b,u=x;break}k=k.sibling}if(!I)throw Error(s(189))}}if(u.alternate!==d)throw Error(s(190))}if(u.tag!==3)throw Error(s(188));return u.stateNode.current===u?r:a}function h(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=h(r),a!==null)return a;r=r.sibling}return null}function f(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(r.tag!==4&&(a=f(r),a!==null))return a;r=r.sibling}return null}function p(r){return r===null||typeof r!="object"?null:(r=Dv&&r[Dv]||r["@@iterator"],typeof r=="function"?r:null)}function g(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===nM?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case qa:return"Fragment";case zd:return"Profiler";case Pv:return"StrictMode";case Vd:return"Suspense";case Hd:return"SuspenseList";case Wd:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case Xa:return"Portal";case ur:return r.displayName||"Context";case Lv:return(r._context.displayName||"Context")+".Consumer";case kd:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Gd:return a=r.displayName||null,a!==null?a:g(r.type)||"Memo";case hr:a=r._payload,r=r._init;try{return g(r(a))}catch{}}return null}function m(r){return{current:r}}function v(r){0>$a||(r.current=Zd[$a],Zd[$a]=null,$a--)}function y(r,a){$a++,Zd[$a]=r.current,r.current=a}function E(r){return r>>>=0,r===0?32:31-(I1(r)/P1|0)|0}function S(r){var a=r&42;if(a!==0)return a;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;
vendor: 5,493 bytes, lines 4104-4111
4104case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function _(r,a,u){var d=r.pendingLanes;if(d===0)return 0;var x=0,b=r.suspendedLanes,I=r.pingedLanes;r=r.warmLanes;var k=d&134217727;return k!==0?(d=k&~b,d!==0?x=S(d):(I&=k,I!==0?x=S(I):u||(u=k&~r,u!==0&&(x=S(u))))):(k=d&~b,k!==0?x=S(k):I!==0?x=S(I):u||(u=d&~r,u!==0&&(x=S(u)))),x===0?0:a!==0&&a!==x&&(a&b)===0&&(b=x&-x,u=a&-a,b>=u||b===32&&(u&4194048)!==0)?a:x}function M(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function T(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function A(){var r=lu;return lu<<=1,(lu&62914560)===0&&(lu=4194304),r}function D(r){for(var a=[],u=0;31>u;u++)a.push(r);return a}function R(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function F(r,a,u,d,x,b){var I=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var k=r.entanglements,ne=r.expirationTimes,me=r.hiddenUpdates;for(u=I&~u;0<u;){var Ne=31-Ii(u),Me=1<<Ne;k[Ne]=0,ne[Ne]=-1;var Ye=me[Ne];if(Ye!==null)for(me[Ne]=null,Ne=0;Ne<Ye.length;Ne++){var Et=Ye[Ne];Et!==null&&(Et.lane&=-536870913)}u&=~Me}d!==0&&w(r,d,0),b!==0&&x===0&&r.tag!==0&&(r.suspendedLanes|=b&~(I&~a))}function w(r,a,u){r.pendingLanes|=a,r.suspendedLanes&=~a;var d=31-Ii(a);r.entangledLanes|=a,r.entanglements[d]=r.entanglements[d]|1073741824|u&261930}function L(r,a){var u=r.entangledLanes|=a;for(r=r.entanglements;u;){var d=31-Ii(u),x=1<<d;x&a|r[d]&a&&(r[d]|=a),u&=~x}}function U(r,a){var u=a&-a;return u=(u&42)!==0?1:O(u),(u&(r.suspendedLanes|a))!==0?0:u}function O(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function H(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function W(r){if(typeof F1=="function"&&O1(r),Pi&&typeof Pi.setStrictMode=="function")try{Pi.setStrictMode(_l,r)}catch{}}function Z(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}function V(r){if(Qd===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Qd=a&&a[1]||"",rx=-1<u.stack.indexOf(` 4105 at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return` 4106`+Qd+r+rx}function $(r,a){if(!r||ep)return"";ep=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(a){var Me=function(){throw Error()};if(Object.defineProperty(Me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Me,[])}catch(Et){var Ye=Et}Reflect.construct(r,[],Me)}else{try{Me.call()}catch(Et){Ye=Et}r.call(Me.prototype)}}else{try{throw Error()}catch(Et){Ye=Et}(Me=r())&&typeof Me.catch=="function"&&Me.catch(function(){})}}catch(Et){if(Et&&Ye&&typeof Et.stack=="string")return[Et.stack,Ye.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),I=b[0],k=b[1];if(I&&k){var ne=I.split(` 4107`),me=k.split(` 4108`);for(x=d=0;d<ne.length&&!ne[d].includes("DetermineComponentFrameRoot");)d++;for(;x<me.length&&!me[x].includes("DetermineComponentFrameRoot");)x++;if(d===ne.length||x===me.length)for(d=ne.length-1,x=me.length-1;1<=d&&0<=x&&ne[d]!==me[x];)x--;for(;1<=d&&0<=x;d--,x--)if(ne[d]!==me[x]){if(d!==1||x!==1)do if(d--,x--,0>x||ne[d]!==me[x]){var Ne=` 4109`+ne[d].replace(" at new "," at ");return r.displayName&&Ne.includes("<anonymous>")&&(Ne=Ne.replace("<anonymous>",r.displayName)),Ne}while(1<=d&&0<=x);break}}}finally{ep=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?V(u):""}function K(r,a){switch(r.tag){case 26:case 27:case 5:return V(r.type);case 16:return V("Lazy");case 13:return r.child!==a&&a!==null?V("Suspense Fallback"):V("Suspense");case 19:return V("SuspenseList");case 0:case 15:return $(r.type,!1);case 11:return $(r.type.render,!1);case 1:return $(r.type,!0);case 31:return V("Activity");default:return""}}function he(r){try{var a="",u=null;do a+=K(r,u),u=r,r=r.return;while(r);return a}catch(d){return` 4110Error generating stack: `+d.message+` 4111`+d.stack}}function ce(r,a){if(typeof r=="object"&&r!==null){var u=ax.get(r);return u!==void 0?u:(a={value:r,source:a,stack:he(a)},ax.set(r,a),a)}return{value:r,source:a,stack:he(a)}}function ye(r,a){Ka[Ja++]=yl,Ka[Ja++]=uu,uu=r,yl=a}function ge(r,a,u){Hi[Gi++]=bs,Hi[Gi++]=Ms,Hi[Gi++]=fr,fr=r;var d=bs;r=Ms;var x=32-Ii(d)-1;d&=~(1<<x),u+=1;var b=32-Ii(a)+x;if(30<b){var I=x-x%5;b=(d&(1<<I)-1).toString(32),d>>=I,x-=I,bs=1<<32-Ii(a)+x|u<<x|d,Ms=b+r}else bs=1<<b|u<<x|d,Ms=r}
4111function we(r){r.return!==null&&(ye(r,1),ge(r,1,0))}function nt(r){for(;r===uu;)uu=Ka[--Ja],Ka[Ja]=null,yl=Ka[--Ja],Ka[Ja]=null;for(;r===fr;)fr=Hi[--Gi],Hi[Gi]=null,Ms=Hi[--Gi],Hi[Gi]=null,bs=Hi[--Gi],Hi[Gi]=null}function st(r,a){Hi[Gi++]=bs,Hi[Gi++]=Ms,Hi[Gi++]=fr,bs=a.id,Ms=a.overflow,fr=r}function rt(r,a){y(dr,a),y(Sl,r),y(Xn,null),r=rM(a),v(Xn),y(Xn,r)}function oe(){v(Xn),v(Sl),v(dr)}function Ue(r){r.memoizedState!==null&&y(hu,r);var a=Xn.current,u=aM(a,r.type);a!==u&&(y(Sl,r),y(Xn,u))}function Se(r){Sl.current===r&&(v(Xn),v(Sl)),hu.current===r&&(v(hu),zs?$r._currentValue=Ya:$r._currentValue2=Ya)}function We(r){var a=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ve(ce(a,r)),tp}function ot(r,a){if(!Jn)throw Error(s(175));a1(r.stateNode,r.type,r.memoizedProps,a,r)||We(r,!0)}function at(r){for(qn=r.return;qn;)switch(qn.tag){case 5:case 31:case 13:Wi=!1;return;case 27:case 3:Wi=!0;return;default:qn=qn.return}}function Ct(r){if(!Jn||r!==qn)return!1;if(!Bt)return at(r),Bt=!0,!1;var a=r.tag;if(Pn?a!==3&&a!==27&&(a!==5||qv(r.type)&&!ru(r.type,r.memoizedProps))&&dn&&We(r):a!==3&&(a!==5||qv(r.type)&&!ru(r.type,r.memoizedProps))&&dn&&We(r),at(r),a===13){if(!Jn)throw Error(s(316));if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));dn=h1(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));dn=u1(r)}else dn=Pn&&a===27?ZM(r.type,dn):qn?Xv(r.stateNode):null;return!0}function it(){Jn&&(dn=qn=null,Bt=!1)}function fe(){var r=pr;return r!==null&&(vi===null?vi=r:vi.push.apply(vi,r),pr=null),r}function ve(r){pr===null?pr=[r]:pr.push(r)}function ue(r,a,u){zs?(y(fu,a._currentValue),a._currentValue=u):(y(fu,a._currentValue2),a._currentValue2=u)}function Pe(r){var a=fu.current;zs?r._currentValue=a:r._currentValue2=a,v(fu)}function Le(r,a,u){for(;r!==null;){var d=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,d!==null&&(d.childLanes|=a)):d!==null&&(d.childLanes&a)!==a&&(d.childLanes|=a),r===u)break;r=r.return}}function ut(r,a,u,d){var x=r.child;for(x!==null&&(x.return=r);x!==null;){var b=x.dependencies;if(b!==null){var I=x.child;b=b.firstContext;e:for(;b!==null;){var k=b;b=x;for(var ne=0;ne<a.length;ne++)if(k.context===a[ne]){b.lanes|=u,k=b.alternate,k!==null&&(k.lanes|=u),Le(b.return,u,r),d||(I=null);break e}b=k.next}}else if(x.tag===18){if(I=x.return,I===null)throw Error(s(341));I.lanes|=u,b=I.alternate,b!==null&&(b.lanes|=u),Le(I,u,r),I=null}else I=x.child;if(I!==null)I.return=x;else for(I=x;I!==null;){if(I===r){I=null;break}if(x=I.sibling,x!==null){x.return=I.return,I=x;break}I=I.return}x=I}}function z(r,a,u,d){r=null;for(var x=a,b=!1;x!==null;){if(!b){if((x.flags&524288)!==0)b=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var I=x.alternate;if(I===null)throw Error(s(387));if(I=I.memoizedProps,I!==null){var k=x.type;Li(x.pendingProps.value,I.value)||(r!==null?r.push(k):r=[k])}}else if(x===hu.current){if(I=x.alternate,I===null)throw Error(s(387));I.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(r!==null?r.push($r):r=[$r])}x=x.return}r!==null&&ut(a,r,u,d),a.flags|=262144}function ht(r){for(r=r.firstContext;r!==null;){var a=r.context;if(!Li(zs?a._currentValue:a._currentValue2,r.memoizedValue))return!0;r=r.next}return!1}function Xe(r){Zr=r,Vs=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function $e(r){return kt(Zr,r)}function _e(r,a){return Zr===null&&Xe(r),kt(r,a)}function kt(r,a){var u=zs?a._currentValue:a._currentValue2;if(a={context:a,memoizedValue:u,next:null},Vs===null){if(r===null)throw Error(s(308));Vs=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else Vs=Vs.next=a;return u}function N(){return{controller:new z1,data:new Map,refCount:0}}function C(r){r.refCount--,r.refCount===0&&k1(V1,function(){r.controller.abort()})}function Y(){}function se(r){r!==Qa&&r.next===null&&(Qa===null?du=Qa=r:Qa=Qa.next=r),pu=!0,np||(np=!0,qe())}function de(r,a){if(!ip&&pu){ip=!0;do for(var u=!1,d=du;d!==null;
vendor: 6,222 bytes, line 4111
4111){if(r!==0){var x=d.pendingLanes;if(x===0)var b=0;else{var I=d.suspendedLanes,k=d.pingedLanes;b=(1<<31-Ii(42|r)+1)-1,b&=x&~(I&~k),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(u=!0,Be(d,b))}else b=Ot,b=_(d,d===rn?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==jr),(b&3)===0||M(d,b)||(u=!0,Be(d,b));d=d.next}while(u);ip=!1}}function be(){Ae()}function Ae(){pu=np=!1;var r=0;Kr!==0&&mM()&&(r=Kr);for(var a=mi(),u=null,d=du;d!==null;){var x=d.next,b=ie(d,a);b===0?(d.next=null,u===null?du=x:u.next=x,x===null&&(Qa=u)):(u=d,(r!==0||(b&3)!==0)&&(pu=!0)),d=x}Ln!==0&&Ln!==5||de(r),Kr!==0&&(Kr=0)}function ie(r,a){for(var u=r.suspendedLanes,d=r.pingedLanes,x=r.expirationTimes,b=r.pendingLanes&-62914561;0<b;){var I=31-Ii(b),k=1<<I,ne=x[I];ne===-1?((k&u)===0||(k&d)!==0)&&(x[I]=T(k,a)):ne<=a&&(r.expiredLanes|=k),b&=~k}if(a=rn,u=Ot,u=_(r,r===a?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==jr),d=r.callbackNode,u===0||r===a&&(tn===2||tn===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Kd(d),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||M(r,u)){if(a=u&-u,a===r.callbackPriority)return a;switch(d!==null&&Kd(d),H(u)){case 2:case 8:u=N1;break;case 32:u=Jd;break;case 268435456:u=U1;break;default:u=Jd}return d=le.bind(null,r),u=cu(u,d),r.callbackPriority=a,r.callbackNode=u,a}return d!==null&&d!==null&&Kd(d),r.callbackPriority=2,r.callbackNode=null,2}function le(r,a){if(Ln!==0&&Ln!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(ml()&&r.callbackNode!==u)return null;var d=Ot;return d=_(r,r===rn?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==jr),d===0?null:(av(r,d,a),ie(r,mi()),r.callbackNode!=null&&r.callbackNode===u?le.bind(null,r):null)}function Be(r,a){if(ml())return null;av(r,a,!0)}function qe(){bM?MM(function(){(Dt&6)!==0?cu(ix,be):Ae()}):cu(ix,be)}function Re(){if(Kr===0){var r=eo;r===0&&(r=au,au<<=1,(au&261888)===0&&(au=256)),Kr=r}return Kr}function Ce(r,a){if(bl===null){var u=bl=[];sp=0,eo=Re(),to={status:"pending",value:void 0,then:function(d){u.push(d)}}}return sp++,a.then(pt,pt),a}function pt(){if(--sp===0&&bl!==null){to!==null&&(to.status="fulfilled");var r=bl;bl=null,eo=0,to=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function St(r,a){var u=[],d={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return r.then(function(){d.status="fulfilled",d.value=a;for(var x=0;x<u.length;x++)(0,u[x])(a)},function(x){for(d.status="rejected",d.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),d}function Ft(){var r=Jr.current;return r!==null?r:rn.pooledCache}function G(r,a){a===null?y(Jr,Jr.current):y(Jr,a.pool)}function Te(){var r=Ft();return r===null?null:{parent:zs?pn._currentValue:pn._currentValue2,pool:r}}function re(r,a){if(Li(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var u=Object.keys(r),d=Object.keys(a);if(u.length!==d.length)return!1;for(d=0;d<u.length;d++){var x=u[d];if(!B1.call(a,x)||!Li(r[x],a[x]))return!1}return!0}function ze(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Ie(r,a,u){switch(u=r[u],u===void 0?r.push(a):u!==a&&(a.then(Y,Y),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,vt(r),r;default:if(typeof a.status=="string")a.then(Y,Y);else{if(r=rn,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=a,r.status="pending",r.then(function(d){if(a.status==="pending"){var x=a;x.status="fulfilled",x.value=d}},function(d){if(a.status==="pending"){var x=a;x.status="rejected",x.reason=d}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,vt(r),r}throw Qr=a,no}}function pe(r){try{var a=r._init;return a(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Qr=u,no):u}}function Je(){if(Qr===null)throw Error(s(459));var r=Qr;return Qr=null,r}function vt(r){if(r===no||r===mu)throw Error(s(483))}function an(r){var a=Ml;return Ml+=1,io===null&&(io=[]),Ie(io,r,a)}function zt(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function fi(r,a){throw a.$$typeof===eM?Error(s(525)):(r=Object.prototype.toString.call(a),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function wi(r){function a(ee,q){if(r){var te=ee.deletions;te===null?(ee.deletions=[q],ee.flags|=16):te.push(q)}}function u(ee,q){if(!r)return null;for(;q!==null;)a(ee,q),q=q.sibling;return null}function d(ee){for(var q=new Map;ee!==null;)ee.key!==null?q.set(ee.key,ee):q.set(ee.index,ee),ee=ee.sibling;return q}function x(ee,q){return ee=Bs(ee,q),ee.index=0,ee.sibling=null,ee}function b(ee,q,te){return ee.index=te,r?(te=ee.alternate,te!==null?(te=te.index,te<q?(ee.flags|=67108866,q):te):(ee.flags|=67108866,q)):(ee.flags|=1048576,q)}function I(ee){return r&&ee.alternate===null&&(ee.flags|=67108866),ee}function k(ee,q,te,Ee){return q===null||q.tag!==6?(q=Ud(te,ee.mode,Ee),q.return=ee,q):(q=x(q,te),q.return=ee,q)}function ne(ee,q,te,Ee){var ct=te.type;return ct===qa?Ne(ee,q,te.props.children,Ee,te.key):q!==null&&(q.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===hr&&pe(ct)===q.type)?(q=x(q,te.props),zt(q,te),q.return=ee,q):(q=nu(te.type,te.key,te.props,null,ee.mode,Ee),zt(q,te),q.return=ee,q)}function me(ee,q,te,Ee){return q===null||q.tag!==4||q.stateNode.containerInfo!==te.containerInfo||q.stateNode.implementation!==te.implementation?(q=Fd(te,ee.mode,Ee),q.return=ee,q):(q=x(q,te.children||[]),q.return=ee,q)}function Ne(ee,q,te,Ee,ct){return q===null||q.tag!==7?(q=Yr(te,ee.mode,Ee,ct),q.return=ee,q):(q=x(q,te),q.return=ee,q)}function Me(ee,q,te){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Ud(""+q,ee.mode,te),q.return=ee,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case iu:return te=nu(q.type,q.key,q.props,null,ee.mode,te),zt(te,q),te.return=ee,te;case Xa:return q=Fd(q,ee.mode,te),q.return=ee,q;case hr:return q=pe(q),Me(ee,q,te)}if(su(q)||p(q))return q=Yr(q,ee.mode,te,null),q.return=ee,q;if(typeof q.then=="function")return Me(ee,an(q),te);if(q.$$typeof===ur)return Me(ee,_e(ee,q),te);fi(ee,q)}return null}function Ye(ee,q,te,Ee){var ct=q!==null?q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return ct!==null?null:k(ee,q,""+te,Ee);
vendor: 3,595 bytes, line 4111
4111if(typeof te=="object"&&te!==null){switch(te.$$typeof){case iu:return te.key===ct?ne(ee,q,te,Ee):null;case Xa:return te.key===ct?me(ee,q,te,Ee):null;case hr:return te=pe(te),Ye(ee,q,te,Ee)}if(su(te)||p(te))return ct!==null?null:Ne(ee,q,te,Ee,null);if(typeof te.then=="function")return Ye(ee,q,an(te),Ee);if(te.$$typeof===ur)return Ye(ee,q,_e(ee,te),Ee);fi(ee,te)}return null}function Et(ee,q,te,Ee,ct){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return ee=ee.get(te)||null,k(q,ee,""+Ee,ct);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case iu:return ee=ee.get(Ee.key===null?te:Ee.key)||null,ne(q,ee,Ee,ct);case Xa:return ee=ee.get(Ee.key===null?te:Ee.key)||null,me(q,ee,Ee,ct);case hr:return Ee=pe(Ee),Et(ee,q,te,Ee,ct)}if(su(Ee)||p(Ee))return ee=ee.get(te)||null,Ne(q,ee,Ee,ct,null);if(typeof Ee.then=="function")return Et(ee,q,te,an(Ee),ct);if(Ee.$$typeof===ur)return Et(ee,q,te,_e(q,Ee),ct);fi(q,Ee)}return null}function Rn(ee,q,te,Ee){for(var ct=null,mn=null,dt=q,qt=q=0,zn=null;dt!==null&&qt<te.length;qt++){dt.index>qt?(zn=dt,dt=null):zn=dt.sibling;var Yt=Ye(ee,dt,te[qt],Ee);if(Yt===null){dt===null&&(dt=zn);break}r&&dt&&Yt.alternate===null&&a(ee,dt),q=b(Yt,q,qt),mn===null?ct=Yt:mn.sibling=Yt,mn=Yt,dt=zn}if(qt===te.length)return u(ee,dt),Bt&&ye(ee,qt),ct;if(dt===null){for(;qt<te.length;qt++)dt=Me(ee,te[qt],Ee),dt!==null&&(q=b(dt,q,qt),mn===null?ct=dt:mn.sibling=dt,mn=dt);return Bt&&ye(ee,qt),ct}for(dt=d(dt);qt<te.length;qt++)zn=Et(dt,ee,qt,te[qt],Ee),zn!==null&&(r&&zn.alternate!==null&&dt.delete(zn.key===null?qt:zn.key),q=b(zn,q,qt),mn===null?ct=zn:mn.sibling=zn,mn=zn);return r&&dt.forEach(function(yr){return a(ee,yr)}),Bt&&ye(ee,qt),ct}function Il(ee,q,te,Ee){if(te==null)throw Error(s(151));for(var ct=null,mn=null,dt=q,qt=q=0,zn=null,Yt=te.next();dt!==null&&!Yt.done;qt++,Yt=te.next()){dt.index>qt?(zn=dt,dt=null):zn=dt.sibling;var yr=Ye(ee,dt,Yt.value,Ee);if(yr===null){dt===null&&(dt=zn);break}r&&dt&&yr.alternate===null&&a(ee,dt),q=b(yr,q,qt),mn===null?ct=yr:mn.sibling=yr,mn=yr,dt=zn}if(Yt.done)return u(ee,dt),Bt&&ye(ee,qt),ct;if(dt===null){for(;!Yt.done;qt++,Yt=te.next())Yt=Me(ee,Yt.value,Ee),Yt!==null&&(q=b(Yt,q,qt),mn===null?ct=Yt:mn.sibling=Yt,mn=Yt);return Bt&&ye(ee,qt),ct}for(dt=d(dt);!Yt.done;qt++,Yt=te.next())Yt=Et(dt,ee,qt,Yt.value,Ee),Yt!==null&&(r&&Yt.alternate!==null&&dt.delete(Yt.key===null?qt:Yt.key),q=b(Yt,q,qt),mn===null?ct=Yt:mn.sibling=Yt,mn=Yt);return r&&dt.forEach(function(X1){return a(ee,X1)}),Bt&&ye(ee,qt),ct}function ia(ee,q,te,Ee){if(typeof te=="object"&&te!==null&&te.type===qa&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case iu:e:{for(var ct=te.key;q!==null;){if(q.key===ct){if(ct=te.type,ct===qa){if(q.tag===7){u(ee,q.sibling),Ee=x(q,te.props.children),Ee.return=ee,ee=Ee;break e}}else if(q.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===hr&&pe(ct)===q.type){u(ee,q.sibling),Ee=x(q,te.props),zt(Ee,te),Ee.return=ee,ee=Ee;break e}u(ee,q);break}else a(ee,q);q=q.sibling}te.type===qa?(Ee=Yr(te.props.children,ee.mode,Ee,te.key),Ee.return=ee,ee=Ee):(Ee=nu(te.type,te.key,te.props,null,ee.mode,Ee),zt(Ee,te),Ee.return=ee,ee=Ee)}return I(ee);case Xa:e:{for(ct=te.key;q!==null;){if(q.key===ct)if(q.tag===4&&q.stateNode.containerInfo===te.containerInfo&&q.stateNode.implementation===te.implementation){u(ee,q.sibling),Ee=x(q,te.children||[]),Ee.return=ee,ee=Ee;break e}else{u(ee,q);break}else a(ee,q);q=q.sibling}Ee=Fd(te,ee.mode,Ee),Ee.return=ee,ee=Ee}return I(ee);case hr:return te=pe(te),ia(ee,q,te,Ee)}if(su(te))return Rn(ee,q,te,Ee);
vendor: 2,089 bytes, line 4111
4111if(p(te)){if(ct=p(te),typeof ct!="function")throw Error(s(150));return te=ct.call(te),Il(ee,q,te,Ee)}if(typeof te.then=="function")return ia(ee,q,an(te),Ee);if(te.$$typeof===ur)return ia(ee,q,_e(ee,te),Ee);fi(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,q!==null&&q.tag===6?(u(ee,q.sibling),Ee=x(q,te),Ee.return=ee,ee=Ee):(u(ee,q),Ee=Ud(te,ee.mode,Ee),Ee.return=ee,ee=Ee),I(ee)):u(ee,q)}return function(ee,q,te,Ee){try{Ml=0;var ct=ia(ee,q,te,Ee);return io=null,ct}catch(dt){if(dt===no||dt===mu)throw dt;var mn=t(29,dt,null,ee.mode);return mn.lanes=Ee,mn.return=ee,mn}}}function rr(){for(var r=so,a=ap=so=0;a<r;){var u=Xi[a];Xi[a++]=null;var d=Xi[a];Xi[a++]=null;var x=Xi[a];Xi[a++]=null;var b=Xi[a];if(Xi[a++]=null,d!==null&&x!==null){var I=d.pending;I===null?x.next=x:(x.next=I.next,I.next=x),d.pending=x}b!==0&&gs(u,x,b)}}function Fa(r,a,u,d){Xi[so++]=r,Xi[so++]=a,Xi[so++]=u,Xi[so++]=d,ap|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function Oa(r,a,u,d){return Fa(r,a,u,d),ar(r)}function ms(r,a){return Fa(r,null,null,a),ar(r)}function gs(r,a,u){r.lanes|=u;var d=r.alternate;d!==null&&(d.lanes|=u);for(var x=!1,b=r.return;b!==null;)b.childLanes|=u,d=b.alternate,d!==null&&(d.childLanes|=u),b.tag===22&&(r=b.stateNode,r===null||r._visibility&1||(x=!0)),r=b,b=b.return;return r.tag===3?(b=r.stateNode,x&&a!==null&&(x=31-Ii(u),r=b.hiddenUpdates,d=r[x],d===null?r[x]=[a]:d.push(a),a.lane=u|536870912),b):null}function ar(r){if(50<Rl)throw Rl=0,xp=null,Error(s(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}function Ba(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function za(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ai(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Zi(r,a,u){var d=r.updateQueue;if(d===null)return null;
vendor: 7,245 bytes, line 4111
4111if(d=d.shared,(Dt&2)!==0){var x=d.pending;return x===null?a.next=a:(a.next=x.next,x.next=a),d.pending=a,a=ar(r),gs(r,null,u),a}return Fa(r,d,a,u),ar(r)}function vs(r,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var d=a.lanes;d&=r.pendingLanes,u|=d,a.lanes=u,L(r,u)}}function ka(r,a){var u=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,u===d)){var x=null,b=null;if(u=u.firstBaseUpdate,u!==null){do{var I={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};b===null?x=b=I:b=b.next=I,u=u.next}while(u!==null);b===null?x=b=a:b=b.next=a}else x=b=a;u={baseState:d.baseState,firstBaseUpdate:x,lastBaseUpdate:b,shared:d.shared,callbacks:d.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=a:r.next=a,u.lastBaseUpdate=a}function or(){if(op){var r=to;if(r!==null)throw r}}function Gr(r,a,u,d){op=!1;var x=r.updateQueue;mr=!1;var b=x.firstBaseUpdate,I=x.lastBaseUpdate,k=x.shared.pending;if(k!==null){x.shared.pending=null;var ne=k,me=ne.next;ne.next=null,I===null?b=me:I.next=me,I=ne;var Ne=r.alternate;Ne!==null&&(Ne=Ne.updateQueue,k=Ne.lastBaseUpdate,k!==I&&(k===null?Ne.firstBaseUpdate=me:k.next=me,Ne.lastBaseUpdate=ne))}if(b!==null){var Me=x.baseState;I=0,Ne=me=ne=null,k=b;do{var Ye=k.lane&-536870913,Et=Ye!==k.lane;if(Et?(Ot&Ye)===Ye:(d&Ye)===Ye){Ye!==0&&Ye===eo&&(op=!0),Ne!==null&&(Ne=Ne.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Rn=r,Il=k;Ye=a;var ia=u;switch(Il.tag){case 1:if(Rn=Il.payload,typeof Rn=="function"){Me=Rn.call(ia,Me,Ye);break e}Me=Rn;break e;case 3:Rn.flags=Rn.flags&-65537|128;case 0:if(Rn=Il.payload,Ye=typeof Rn=="function"?Rn.call(ia,Me,Ye):Rn,Ye==null)break e;Me=Bd({},Me,Ye);break e;case 2:mr=!0}}Ye=k.callback,Ye!==null&&(r.flags|=64,Et&&(r.flags|=8192),Et=x.callbacks,Et===null?x.callbacks=[Ye]:Et.push(Ye))}else Et={lane:Ye,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Ne===null?(me=Ne=Et,ne=Me):Ne=Ne.next=Et,I|=Ye;if(k=k.next,k===null){if(k=x.shared.pending,k===null)break;Et=k,k=Et.next,Et.next=null,x.lastBaseUpdate=Et,x.shared.pending=null}}while(!0);Ne===null&&(ne=Me),x.baseState=ne,x.firstBaseUpdate=me,x.lastBaseUpdate=Ne,b===null&&(x.shared.lanes=0),vr|=I,r.lanes=I,r.memoizedState=Me}}function zc(r,a){if(typeof r!="function")throw Error(s(191,r));r.call(a)}function kc(r,a){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)zc(u[r],a)}function Vc(r,a){r=Ws,y(vu,r),y(ro,a),Ws=r|a.baseLanes}function rl(){y(vu,Ws),y(ro,ro.current)}function al(){Ws=vu.current,v(ro),v(vu)}function xs(r){var a=r.alternate;y(Sn,Sn.current&1),y(Di,r),is===null&&(a===null||ro.current!==null||a.memoizedState!==null)&&(is=r)}function P(r){y(Sn,Sn.current),y(Di,r),is===null&&(is=r)}function X(r){r.tag===22?(y(Sn,Sn.current),y(Di,r),is===null&&(is=r)):Q()}function Q(){y(Sn,Sn.current),y(Di,Di.current)}function j(r){v(Di),is===r&&(is=null),v(Sn)}function J(r){for(var a=r;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Yd(u)||jd(u)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function xe(){throw Error(s(321))}function He(r,a){if(a===null)return!1;for(var u=0;u<a.length&&u<r.length;u++)if(!Li(r[u],a[u]))return!1;return!0}function Fe(r,a,u,d,x,b){return Hs=b,Tt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,lt.H=r===null||r.memoizedState===null?cx:lp,ta=!1,b=u(d,x),ta=!1,ao&&(b=et(a,u,d,x)),Ke(r),b}function Ke(r){lt.H=Tl;var a=sn!==null&&sn.next!==null;if(Hs=0,Tn=sn=Tt=null,xu=!1,El=0,oo=null,a)throw Error(s(300));r===null||wn||(r=r.dependencies,r!==null&&ht(r)&&(wn=!0))}function et(r,a,u,d){Tt=r;var x=0;do{if(ao&&(oo=null),El=0,ao=!1,25<=x)throw Error(s(301));if(x+=1,Tn=sn=null,r.updateQueue!=null){var b=r.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}lt.H=ux,b=a(u,d)}while(ao);return b}function _t(){var r=lt.H,a=r.useState()[0];return a=typeof a.then=="function"?vn(a):a,r=r.useState()[0],(sn!==null?sn.memoizedState:null)!==r&&(Tt.flags|=1024),a}function bt(){var r=_u!==0;return _u=0,r}function tt(r,a,u){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~u}function Gt(r){if(xu){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}xu=!1}Hs=0,Tn=sn=Tt=null,ao=!1,El=_u=0,oo=null}function Pt(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?Tt.memoizedState=Tn=r:Tn=Tn.next=r,Tn}function yt(){if(sn===null){var r=Tt.alternate;r=r!==null?r.memoizedState:null}else r=sn.next;var a=Tn===null?Tt.memoizedState:Tn.next;if(a!==null)Tn=a,sn=r;else{if(r===null)throw Tt.alternate===null?Error(s(467)):Error(s(310));sn=r,r={memoizedState:sn.memoizedState,baseState:sn.baseState,baseQueue:sn.baseQueue,queue:sn.queue,next:null},Tn===null?Tt.memoizedState=Tn=r:Tn=Tn.next=r}return Tn}function Wt(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vn(r){var a=El;return El+=1,oo===null&&(oo=[]),r=Ie(oo,r,a),a=Tt,(Tn===null?a.memoizedState:Tn.next)===null&&(a=a.alternate,lt.H=a===null||a.memoizedState===null?cx:lp),r}function ke(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return vn(r);if(r.$$typeof===ur)return $e(r)}throw Error(s(438,String(r)))}function Hn(r){var a=null,u=Tt.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var d=Tt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(a={data:d.data.map(function(x){return x.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=Wt(),Tt.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(r),d=0;d<r;d++)u[d]=tM;return a.index++,u}function Mt(r,a){return typeof a=="function"?a(r):a}function Gn(r){var a=yt();return di(a,sn,r)}function di(r,a,u){var d=r.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=u;var x=r.baseQueue,b=d.pending;if(b!==null){if(x!==null){var I=x.next;x.next=b.next,b.next=I}a.baseQueue=x=b,d.pending=null}if(b=r.baseState,x===null)r.memoizedState=b;else{a=x.next;var k=I=null,ne=null,me=a,Ne=!1;do{var Me=me.lane&-536870913;if(Me!==me.lane?(Ot&Me)===Me:(Hs&Me)===Me){var Ye=me.revertLane;if(Ye===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),Me===eo&&(Ne=!0);else if((Hs&Ye)===Ye){me=me.next,Ye===eo&&(Ne=!0);continue}else Me={lane:0,revertLane:me.revertLane,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},ne===null?(k=ne=Me,I=b):ne=ne.next=Me,Tt.lanes|=Ye,vr|=Ye;Me=me.action,ta&&u(b,Me),b=me.hasEagerState?me.eagerState:u(b,Me)}else Ye={lane:Me,revertLane:me.revertLane,gesture:me.gesture,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},ne===null?(k=ne=Ye,I=b):ne=ne.next=Ye,Tt.lanes|=Me,vr|=Me;me=me.next}
vendor: 4,876 bytes, line 4111
4111while(me!==null&&me!==a);if(ne===null?I=b:ne.next=k,!Li(b,r.memoizedState)&&(wn=!0,Ne&&(u=to,u!==null)))throw u;r.memoizedState=b,r.baseState=I,r.baseQueue=ne,d.lastRenderedState=b}return x===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Vi(r){var a=yt(),u=a.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=r;var d=u.dispatch,x=u.pending,b=a.memoizedState;if(x!==null){u.pending=null;var I=x=x.next;do b=r(b,I.action),I=I.next;while(I!==x);Li(b,a.memoizedState)||(wn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),u.lastRenderedState=b}return[b,d]}function Ns(r,a,u){var d=Tt,x=yt(),b=Bt;if(b){if(u===void 0)throw Error(s(407));u=u()}else u=a();var I=!Li((sn||x).memoizedState,u);if(I&&(x.memoizedState=u,wn=!0),x=x.queue,sd(Ki.bind(null,d,x,r),[r]),x.getSnapshot!==a||I||Tn!==null&&Tn.memoizedState.tag&1){if(d.flags|=2048,Va(9,{destroy:void 0},hn.bind(null,d,x,u,a),null),rn===null)throw Error(s(349));b||(Hs&127)!==0||Kt(d,a,u)}return u}function Kt(r,a,u){r.flags|=16384,r={getSnapshot:a,value:u},a=Tt.updateQueue,a===null?(a=Wt(),Tt.updateQueue=a,a.stores=[r]):(u=a.stores,u===null?a.stores=[r]:u.push(r))}function hn(r,a,u,d){a.value=u,a.getSnapshot=d,en(a)&&Ji(r)}function Ki(r,a,u){return u(function(){en(a)&&Ji(r)})}function en(r){var a=r.getSnapshot;r=r.value;try{var u=a();return!Li(r,u)}catch{return!0}}function Ji(r){var a=ms(r,2);a!==null&&pi(a,r,2)}function _s(r){var a=Pt();if(typeof r=="function"){var u=r;if(r=u(),ta){W(!0);try{u()}finally{W(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mt,lastRenderedState:r},a}function ol(r,a,u,d){return r.baseState=u,di(r,sn,typeof d=="function"?d:Mt)}function Pb(r,a,u,d,x){if(Wc(r))throw Error(s(485));if(r=a.action,r!==null){var b={payload:x,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){b.listeners.push(I)}};lt.T!==null?u(!0):b.isTransition=!1,d(b),u=a.pending,u===null?(b.next=a.pending=b,qg(a,b)):(b.next=u.next,a.pending=u.next=b)}}function qg(r,a){var u=a.action,d=a.payload,x=r.state;if(a.isTransition){var b=lt.T,I={};lt.T=I;try{var k=u(x,d),ne=lt.S;ne!==null&&ne(I,k),Yg(r,a,k)}catch(me){id(r,a,me)}finally{b!==null&&I.types!==null&&(b.types=I.types),lt.T=b}}else try{b=u(x,d),Yg(r,a,b)}catch(me){id(r,a,me)}}function Yg(r,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(d){jg(r,a,d)},function(d){return id(r,a,d)}):jg(r,a,u)}function jg(r,a,u){a.status="fulfilled",a.value=u,$g(a),r.state=u,a=r.pending,a!==null&&(u=a.next,u===a?r.pending=null:(u=u.next,a.next=u,qg(r,u)))}function id(r,a,u){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do a.status="rejected",a.reason=u,$g(a),a=a.next;while(a!==d)}r.action=null}function $g(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function Zg(r,a){return a}function Kg(r,a){if(Bt){var u=rn.formState;if(u!==null){e:{var d=Tt;if(Bt){if(dn){var x=jM(dn,Wi);if(x){dn=Xv(x),d=$M(x);break e}}We(d)}d=!1}d&&(a=u[0])}}u=Pt(),u.memoizedState=u.baseState=a,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zg,lastRenderedState:a},u.queue=d,u=m0.bind(null,Tt,d),d.dispatch=u,d=_s(!1);var b=ld.bind(null,Tt,!1,d.queue);return d=Pt(),x={state:a,dispatch:null,action:r,pending:null},d.queue=x,u=Pb.bind(null,Tt,x,b,u),x.dispatch=u,d.memoizedState=r,[a,u,!1]}function Jg(r){var a=yt();return Qg(a,sn,r)}function Qg(r,a,u){if(a=di(r,a,Zg)[0],r=Gn(Mt)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var d=vn(a)}catch(I){throw I===no?mu:I}else d=a;a=yt();var x=a.queue,b=x.dispatch;return u!==a.memoizedState&&(Tt.flags|=2048,Va(9,{destroy:void 0},Lb.bind(null,x,u),null)),[d,b,r]}function Lb(r,a){r.action=a}function e0(r){var a=yt(),u=sn;if(u!==null)return Qg(a,u,r);yt(),a=a.memoizedState,u=yt();var d=u.queue.dispatch;return u.memoizedState=r,[a,d,!1]}function Va(r,a,u,d){return r={tag:r,create:u,deps:d,inst:a,next:null},a=Tt.updateQueue,a===null&&(a=Wt(),Tt.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=r.next=r:(d=u.next,u.next=r,r.next=d,a.lastEffect=r),r}function t0(){return yt().memoizedState}function Hc(r,a,u,d){var x=Pt();Tt.flags|=r,x.memoizedState=Va(1|a,{destroy:void 0},u,d===void 0?null:d)}function Gc(r,a,u,d){var x=yt();d=d===void 0?null:d;var b=x.memoizedState.inst;sn!==null&&d!==null&&He(d,sn.memoizedState.deps)?x.memoizedState=Va(a,b,u,d):(Tt.flags|=r,x.memoizedState=Va(1|a,b,u,d))}function n0(r,a){Hc(8390656,8,r,a)}function sd(r,a){Gc(2048,8,r,a)}function Db(r){Tt.flags|=4;var a=Tt.updateQueue;if(a===null)a=Wt(),Tt.updateQueue=a,a.events=[r];else{var u=a.events;u===null?a.events=[r]:u.push(r)}}function i0(r){var a=yt().memoizedState;return Db({ref:a,nextImpl:r}),function(){if((Dt&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}function s0(r,a){return Gc(4,2,r,a)}function r0(r,a){return Gc(4,4,r,a)}
vendor: 8,907 bytes, line 4111
4111function a0(r,a){if(typeof a=="function"){r=r();var u=a(r);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function o0(r,a,u){u=u!=null?u.concat([r]):null,Gc(4,4,a0.bind(null,a,r),u)}function rd(){}function l0(r,a){var u=yt();a=a===void 0?null:a;var d=u.memoizedState;return a!==null&&He(a,d[1])?d[0]:(u.memoizedState=[r,a],r)}function c0(r,a){var u=yt();a=a===void 0?null:a;var d=u.memoizedState;if(a!==null&&He(a,d[1]))return d[0];if(d=r(),ta){W(!0);try{r()}finally{W(!1)}}return u.memoizedState=[d,a],d}function ad(r,a,u){return u===void 0||(Hs&1073741824)!==0&&(Ot&261930)===0?r.memoizedState=a:(r.memoizedState=u,r=rv(),Tt.lanes|=r,vr|=r,u)}function u0(r,a,u,d){return Li(u,a)?u:ro.current!==null?(r=ad(r,u,d),Li(r,a)||(wn=!0),r):(Hs&42)===0||(Hs&1073741824)!==0&&(Ot&261930)===0?(wn=!0,r.memoizedState=u):(r=rv(),Tt.lanes|=r,vr|=r,a)}function h0(r,a,u,d,x){var b=ks();On(b!==0&&8>b?b:8);var I=lt.T,k={};lt.T=k,ld(r,!1,a,u);try{var ne=x(),me=lt.S;if(me!==null&&me(k,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var Ne=St(ne,d);ll(r,a,Ne,Ci(r))}else ll(r,a,d,Ci(r))}catch(Me){ll(r,a,{then:function(){},status:"rejected",reason:Me},Ci())}finally{On(b),I!==null&&k.types!==null&&(I.types=k.types),lt.T=I}}function f0(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:Ya,baseState:Ya,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mt,lastRenderedState:Ya},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mt,lastRenderedState:u},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function od(){return $e($r)}function d0(){return yt().memoizedState}function p0(){return yt().memoizedState}function Nb(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var u=Ci();r=Ai(u);var d=Zi(a,r,u);d!==null&&(pi(d,a,u),vs(d,a,u)),a={cache:N()},r.payload=a;return}a=a.return}}function Ub(r,a,u){var d=Ci();u={lane:d,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Wc(r)?g0(a,u):(u=Oa(r,a,u,d),u!==null&&(pi(u,r,d),v0(u,a,d)))}function m0(r,a,u){var d=Ci();ll(r,a,u,d)}function ll(r,a,u,d){var x={lane:d,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Wc(r))g0(a,x);else{var b=r.alternate;if(r.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var I=a.lastRenderedState,k=b(I,u);if(x.hasEagerState=!0,x.eagerState=k,Li(k,I))return Fa(r,a,x,0),rn===null&&rr(),!1}catch{}if(u=Oa(r,a,x,d),u!==null)return pi(u,r,d),v0(u,a,d),!0}return!1}function ld(r,a,u,d){if(d={lane:2,revertLane:Re(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Wc(r)){if(a)throw Error(s(479))}else a=Oa(r,u,d,2),a!==null&&pi(a,r,2)}function Wc(r){var a=r.alternate;return r===Tt||a!==null&&a===Tt}function g0(r,a){ao=xu=!0;var u=r.pending;u===null?a.next=a:(a.next=u.next,u.next=a),r.pending=a}function v0(r,a,u){if((u&4194048)!==0){var d=a.lanes;d&=r.pendingLanes,u|=d,a.lanes=u,L(r,u)}}function cd(r,a,u,d){a=r.memoizedState,u=u(d,a),u=u==null?a:Bd({},a,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}function x0(r,a,u,d,x,b,I){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,b,I):a.prototype&&a.prototype.isPureReactComponent?!re(u,d)||!re(x,b):!0}function _0(r,a,u,d){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,d),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,d),a.state!==r&&cp.enqueueReplaceState(a,a.state,null)}function Wr(r,a){var u=a;if("ref"in a){u={};for(var d in a)d!=="ref"&&(u[d]=a[d])}if(r=r.defaultProps){u===a&&(u=Bd({},u));for(var x in r)u[x]===void 0&&(u[x]=r[x])}return u}function Xc(r,a){try{var u=r.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(d){setTimeout(function(){throw d})}}function y0(r,a,u){try{var d=r.onCaughtError;d(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function ud(r,a,u){return u=Ai(u),u.tag=3,u.payload={element:null},u.callback=function(){Xc(r,a)},u}function S0(r){return r=Ai(r),r.tag=3,r}function b0(r,a,u,d){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var b=d.value;r.payload=function(){return x(b)},r.callback=function(){y0(a,u,d)}}var I=u.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(r.callback=function(){y0(a,u,d),typeof x!="function"&&(xr===null?xr=new Set([this]):xr.add(this));var k=d.stack;this.componentDidCatch(d.value,{componentStack:k!==null?k:""})})}function Fb(r,a,u,d,x){if(u.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(a=u.alternate,a!==null&&z(a,u,x,!0),u=Di.current,u!==null){switch(u.tag){case 31:case 13:return is===null?eu():u.alternate===null&&xn===0&&(xn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,d===gu?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([d]):a.add(d),Dd(r,d,x)),!1;case 22:return u.flags|=65536,d===gu?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([d])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([d]):u.add(d)),Dd(r,d,x)),!1}throw Error(s(435,u.tag))}return Dd(r,d,x),eu(),!1}if(Bt)return a=Di.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=x,d!==tp&&(r=Error(s(422),{cause:d}),ve(ce(r,u)))):(d!==tp&&(a=Error(s(423),{cause:d}),ve(ce(a,u))),r=r.current.alternate,r.flags|=65536,x&=-x,r.lanes|=x,d=ce(d,u),x=ud(r.stateNode,d,x),ka(r,x),xn!==4&&(xn=2)),!1;var b=Error(s(520),{cause:d});if(b=ce(b,u),Al===null?Al=[b]:Al.push(b),xn!==4&&(xn=2),a===null)return!0;d=ce(d,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,r=x&-x,u.lanes|=r,r=ud(u.stateNode,d,r),ka(u,r),!1;case 1:if(a=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(xr===null||!xr.has(b))))return u.flags|=65536,x&=-x,u.lanes|=x,x=S0(x),b0(x,r,u,d),ka(u,x),!1}u=u.return}while(u!==null);return!1}function Wn(r,a,u,d){a.child=r===null?lx(a,null,u,d):ea(a,r.child,u,d)}function M0(r,a,u,d,x){u=u.render;var b=a.ref;if("ref"in d){var I={};for(var k in d)k!=="ref"&&(I[k]=d[k])}else I=d;return Xe(a),d=Fe(r,a,u,I,b,x),k=bt(),r!==null&&!wn?(tt(r,a,x),Us(r,a,x)):(Bt&&k&&we(a),a.flags|=1,Wn(r,a,d,x),a.child)}function E0(r,a,u,d,x){if(r===null){var b=u.type;return typeof b=="function"&&!Nd(b)&&b.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=b,T0(r,a,b,d,x)):(r=nu(u.type,null,d,a,a.mode,x),r.ref=a.ref,r.return=a,a.child=r)}if(b=r.child,!vd(r,x)){var I=b.memoizedProps;if(u=u.compare,u=u!==null?u:re,u(I,d)&&r.ref===a.ref)return Us(r,a,x)}return a.flags|=1,r=Bs(b,d),r.ref=a.ref,r.return=a,a.child=r}function T0(r,a,u,d,x){if(r!==null){var b=r.memoizedProps;if(re(b,d)&&r.ref===a.ref)if(wn=!1,a.pendingProps=d=b,vd(r,x))(r.flags&131072)!==0&&(wn=!0);else return a.lanes=r.lanes,Us(r,a,x)}return hd(r,a,u,d,x)}function w0(r,a,u,d){var x=d.children,b=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((a.flags&128)!==0){if(b=b!==null?b.baseLanes|u:u,r!==null){for(d=a.child=r.child,x=0;d!==null;)x=x|d.lanes|d.childLanes,d=d.sibling;d=x&~b}else d=0,a.child=null;return A0(r,a,b,u,d)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&G(a,b!==null?b.cachePool:null),b!==null?Vc(a,b):rl(),X(a);else return d=a.lanes=536870912,A0(r,a,b!==null?b.baseLanes|u:u,u,d)}else b!==null?(G(a,b.cachePool),Vc(a,b),Q(),a.memoizedState=null):(r!==null&&G(a,null),rl(),Q());return Wn(r,a,x,u),a.child}function cl(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function A0(r,a,u,d,x){var b=Ft();return b=b===null?null:{parent:zs?pn._currentValue:pn._currentValue2,pool:b},a.memoizedState={baseLanes:u,cachePool:b},r!==null&&G(a,null),rl(),X(a),r!==null&&z(r,a,d,!0),a.childLanes=x,null}function qc(r,a){return a=jc({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function C0(r,a,u){return ea(a,r.child,null,u),r=qc(a,a.pendingProps),r.flags|=2,j(a),a.memoizedState=null,r}function Ob(r,a,u){var d=a.pendingProps,x=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(Bt){if(d.mode==="hidden")return r=qc(a,d),a.lanes=536870912,cl(null,r);if(P(a),(r=dn)?(r=s1(r,Wi),r!==null&&(a.memoizedState={dehydrated:r,treeContext:fr!==null?{id:bs,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},u=Tv(r),u.return=a,a.child=u,qn=a,dn=null)):r=null,r===null)throw We(a);return a.lanes=536870912,null}return qc(a,d)}var b=r.memoizedState;if(b!==null){var I=b.dehydrated;
vendor: 4,885 bytes, line 4111
4111if(P(a),x)if(a.flags&256)a.flags&=-257,a=C0(r,a,u);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(s(558));else if(wn||z(r,a,u,!1),x=(u&r.childLanes)!==0,wn||x){if(d=rn,d!==null&&(I=U(d,u),I!==0&&I!==b.retryLane))throw b.retryLane=I,ms(r,I),pi(d,r,I),up;eu(),a=C0(r,a,u)}else r=b.treeContext,Jn&&(dn=QM(I),qn=a,Bt=!0,pr=null,Wi=!1,r!==null&&st(a,r)),a=qc(a,d),a.flags|=4096;return a}return r=Bs(r.child,{mode:d.mode,children:d.children}),r.ref=a.ref,a.child=r,r.return=a,r}function Yc(r,a){var u=a.ref;if(u===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(s(284));(r===null||r.ref!==u)&&(a.flags|=4194816)}}function hd(r,a,u,d,x){return Xe(a),u=Fe(r,a,u,d,void 0,x),d=bt(),r!==null&&!wn?(tt(r,a,x),Us(r,a,x)):(Bt&&d&&we(a),a.flags|=1,Wn(r,a,u,x),a.child)}function R0(r,a,u,d,x,b){return Xe(a),a.updateQueue=null,u=et(a,d,u,x),Ke(r),d=bt(),r!==null&&!wn?(tt(r,a,b),Us(r,a,b)):(Bt&&d&&we(a),a.flags|=1,Wn(r,a,u,b),a.child)}function I0(r,a,u,d,x){if(Xe(a),a.stateNode===null){var b=Za,I=u.contextType;typeof I=="object"&&I!==null&&(b=$e(I)),b=new u(d,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=cp,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=d,b.state=a.memoizedState,b.refs={},Ba(a),I=u.contextType,b.context=typeof I=="object"&&I!==null?$e(I):Za,b.state=a.memoizedState,I=u.getDerivedStateFromProps,typeof I=="function"&&(cd(a,u,I,d),b.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(I=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),I!==b.state&&cp.enqueueReplaceState(b,b.state,null),Gr(a,d,b,x),or(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),d=!0}else if(r===null){b=a.stateNode;var k=a.memoizedProps,ne=Wr(u,k);b.props=ne;var me=b.context,Ne=u.contextType;I=Za,typeof Ne=="object"&&Ne!==null&&(I=$e(Ne));var Me=u.getDerivedStateFromProps;Ne=typeof Me=="function"||typeof b.getSnapshotBeforeUpdate=="function",k=a.pendingProps!==k,Ne||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(k||me!==I)&&_0(a,b,d,I),mr=!1;var Ye=a.memoizedState;b.state=Ye,Gr(a,d,b,x),or(),me=a.memoizedState,k||Ye!==me||mr?(typeof Me=="function"&&(cd(a,u,Me,d),me=a.memoizedState),(ne=mr||x0(a,u,ne,d,Ye,me,I))?(Ne||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=d,a.memoizedState=me),b.props=d,b.state=me,b.context=I,d=ne):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),d=!1)}else{b=a.stateNode,za(r,a),I=a.memoizedProps,Ne=Wr(u,I),b.props=Ne,Me=a.pendingProps,Ye=b.context,me=u.contextType,ne=Za,typeof me=="object"&&me!==null&&(ne=$e(me)),k=u.getDerivedStateFromProps,(me=typeof k=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(I!==Me||Ye!==ne)&&_0(a,b,d,ne),mr=!1,Ye=a.memoizedState,b.state=Ye,Gr(a,d,b,x),or();var Et=a.memoizedState;I!==Me||Ye!==Et||mr||r!==null&&r.dependencies!==null&&ht(r.dependencies)?(typeof k=="function"&&(cd(a,u,k,d),Et=a.memoizedState),(Ne=mr||x0(a,u,Ne,d,Ye,Et,ne)||r!==null&&r.dependencies!==null&&ht(r.dependencies))?(me||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,Et,ne),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,Et,ne)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||I===r.memoizedProps&&Ye===r.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||I===r.memoizedProps&&Ye===r.memoizedState||(a.flags|=1024),a.memoizedProps=d,a.memoizedState=Et),b.props=d,b.state=Et,b.context=ne,d=Ne):(typeof b.componentDidUpdate!="function"||I===r.memoizedProps&&Ye===r.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||I===r.memoizedProps&&Ye===r.memoizedState||(a.flags|=1024),d=!1)}return b=d,Yc(r,a),d=(a.flags&128)!==0,b||d?(b=a.stateNode,u=d&&typeof u.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,r!==null&&d?(a.child=ea(a,r.child,null,x),a.child=ea(a,null,u,x)):Wn(r,a,u,x),a.memoizedState=b.state,r=
vendor: 2,518 bytes, line 4111
4111a.child):r=Us(r,a,x),r}function P0(r,a,u,d){return it(),a.flags|=256,Wn(r,a,u,d),a.child}function fd(r){return{baseLanes:r,cachePool:Te()}}function dd(r,a,u){return r=r!==null?r.childLanes&~u:0,a&&(r|=Ui),r}function L0(r,a,u){var d=a.pendingProps,x=!1,b=(a.flags&128)!==0,I;if((I=b)||(I=r!==null&&r.memoizedState===null?!1:(Sn.current&2)!==0),I&&(x=!0,a.flags&=-129),I=(a.flags&32)!==0,a.flags&=-33,r===null){if(Bt){if(x?xs(a):Q(),(r=dn)?(r=r1(r,Wi),r!==null&&(a.memoizedState={dehydrated:r,treeContext:fr!==null?{id:bs,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},u=Tv(r),u.return=a,a.child=u,qn=a,dn=null)):r=null,r===null)throw We(a);return jd(r)?a.lanes=32:a.lanes=536870912,null}var k=d.children;return d=d.fallback,x?(Q(),x=a.mode,k=jc({mode:"hidden",children:k},x),d=Yr(d,x,u,null),k.return=a,d.return=a,k.sibling=d,a.child=k,d=a.child,d.memoizedState=fd(u),d.childLanes=dd(r,I,u),a.memoizedState=hp,cl(null,d)):(xs(a),pd(a,k))}var ne=r.memoizedState;if(ne!==null&&(k=ne.dehydrated,k!==null)){if(b)a.flags&256?(xs(a),a.flags&=-257,a=md(r,a,u)):a.memoizedState!==null?(Q(),a.child=r.child,a.flags|=128,a=null):(Q(),k=d.fallback,x=a.mode,d=jc({mode:"visible",children:d.children},x),k=Yr(k,x,u,null),k.flags|=2,d.return=a,k.return=a,d.sibling=k,a.child=d,ea(a,r.child,null,u),d=a.child,d.memoizedState=fd(u),d.childLanes=dd(r,I,u),a.memoizedState=hp,a=cl(null,d));else if(xs(a),jd(k))I=qM(k).digest,d=Error(s(419)),d.stack="",d.digest=I,ve({value:d,source:null,stack:null}),a=md(r,a,u);else if(wn||z(r,a,u,!1),I=(u&r.childLanes)!==0,wn||I){if(I=rn,I!==null&&(d=U(I,u),d!==0&&d!==ne.retryLane))throw ne.retryLane=d,ms(r,d),pi(I,r,d),up;Yd(k)||eu(),a=md(r,a,u)}else Yd(k)?(a.flags|=192,a.child=r.child,a=null):(r=ne.treeContext,Jn&&(dn=e1(k),qn=a,Bt=!0,pr=null,Wi=!1,r!==null&&st(a,r)),a=pd(a,d.children),a.flags|=4096);return a}return x?(Q(),k=d.fallback,x=a.mode,ne=r.child,b=ne.sibling,d=Bs(ne,{mode:"hidden",children:d.children}),d.subtreeFlags=ne.subtreeFlags&65011712,b!==null?k=Bs(b,k):(k=Yr(k,x,u,null),k.flags|=2),k.return=a,d.return=a,d.sibling=k,a.child=d,cl(null,d),d=a.child,k=r.child.memoizedState,k===null?k=fd(u):(x=k.cachePool,x!==null?(ne=zs?pn._currentValue:pn._currentValue2,x=x.parent!==ne?{parent:ne,pool:ne}:x):x=Te(),k={baseLanes:k.baseLanes|u,cachePool:x}),d.memoizedState=k,d.childLanes=dd(r,I,u),a.memoizedState=hp,cl(r.child,d)):(xs(a),u=r.child,r=u.sibling,u=Bs(u,{mode:"visible",children:d.children}),u.return=a,u.sibling=null,r!==null&&(I=a.deletions,I===null?(a.deleti
vendor: 2,609 bytes, line 4111
4111ons=[r],a.flags|=16):I.push(r)),a.child=u,a.memoizedState=null,u)}function pd(r,a){return a=jc({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function jc(r,a){return r=t(22,r,null,a),r.lanes=0,r}function md(r,a,u){return ea(a,r.child,null,u),r=pd(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function D0(r,a,u){r.lanes|=a;var d=r.alternate;d!==null&&(d.lanes|=a),Le(r.return,a,u)}function gd(r,a,u,d,x,b){var I=r.memoizedState;I===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:d,tail:u,tailMode:x,treeForkCount:b}:(I.isBackwards=a,I.rendering=null,I.renderingStartTime=0,I.last=d,I.tail=u,I.tailMode=x,I.treeForkCount=b)}function N0(r,a,u){var d=a.pendingProps,x=d.revealOrder,b=d.tail;d=d.children;var I=Sn.current,k=(I&2)!==0;if(k?(I=I&1|2,a.flags|=128):I&=1,y(Sn,I),Wn(r,a,d,u),d=Bt?yl:0,!k&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&D0(r,u,a);else if(r.tag===19)D0(r,u,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(x){case"forwards":for(u=a.child,x=null;u!==null;)r=u.alternate,r!==null&&J(r)===null&&(x=u),u=u.sibling;u=x,u===null?(x=a.child,a.child=null):(x=u.sibling,u.sibling=null),gd(a,!1,x,u,b,d);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=a.child,a.child=null;x!==null;){if(r=x.alternate,r!==null&&J(r)===null){a.child=x;break}r=x.sibling,x.sibling=u,u=x,x=r}gd(a,!0,u,null,b,d);break;case"together":gd(a,!1,null,null,void 0,d);break;default:a.memoizedState=null}return a.child}function Us(r,a,u){if(r!==null&&(a.dependencies=r.dependencies),vr|=a.lanes,(u&a.childLanes)===0)if(r!==null){if(z(r,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(s(153));if(a.child!==null){for(r=a.child,u=Bs(r,r.pendingProps),a.child=u,u.return=a;r.sibling!==null;)r=r.sibling,u=u.sibling=Bs(r,r.pendingProps),u.return=a;u.sibling=null}return a.child}function vd(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&ht(r)))}function Bb(r,a,u){switch(a.tag){case 3:rt(a,a.stateNode.containerInfo),ue(a,pn,r.memoizedState.cache),it();break;case 27:case 5:Ue(a);break;case 4:rt(a,a.stateNode.containerInfo);break;case 10:ue(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,P(a),null;break;case 13:var d=a.memoizedState;if(d!==null)return d.dehydrated!==null?(xs(a),a.flags|=128,null):(u&a.child.childLanes)!==0?L0(r,a,u):(xs(a),r
4111=Us(r,a,u),r!==null?r.sibling:null);xs(a);break;case 19:var x=(r.flags&128)!==0;if(d=(u&a.childLanes)!==0,d||(z(r,a,u,!1),d=(u&a.childLanes)!==0),x){if(d)return N0(r,a,u);a.flags|=128}if(x=a.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),y(Sn,Sn.current),d)break;return null;case 22:return a.lanes=0,w0(r,a,u,a.pendingProps);case 24:ue(a,pn,r.memoizedState.cache)}return Us(r,a,u)}function U0(r,a,u){if(r!==null)if(r.memoizedProps!==a.pendingProps)wn=!0;else{if(!vd(r,u)&&(a.flags&128)===0)return wn=!1,Bb(r,a,u);wn=(r.flags&131072)!==0}else wn=!1,Bt&&(a.flags&1048576)!==0&&ge(a,yl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var d=a.pendingProps;if(r=pe(a.elementType),a.type=r,typeof r=="function")Nd(r)?(d=Wr(r,d),a.tag=1,a=I0(null,a,r,d,u)):(a.tag=0,a=hd(null,a,r,d,u));else{if(r!=null){var x=r.$$typeof;if(x===kd){a.tag=11,a=M0(null,a,r,d,u);break e}else if(x===Gd){a.tag=14,a=E0(null,a,r,d,u);break e}}throw a=g(r)||r,Error(s(306,a,""))}}return a;case 0:return hd(r,a,a.type,a.pendingProps,u);case 1:return d=a.type,x=Wr(d,a.pendingProps),I0(r,a,d,x,u);case 3:e:{if(rt(a,a.stateNode.containerInfo),r===null)throw Error(s(387));var b=a.pendingProps;x=a.memoizedState,d=x.element,za(r,a),Gr(a,b,null,u);var I=a.memoizedState;if(b=I.cache,ue(a,pn,b),b!==x.cache&&ut(a,[pn],u,!0),or(),b=I.element,Jn&&x.isDehydrated)if(x={element:b,isDehydrated:!1,cache:I.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=P0(r,a,b,u);break e}else if(b!==d){d=ce(Error(s(424)),a),ve(d),a=P0(r,a,b,u);break e}else for(Jn&&(dn=JM(a.stateNode.containerInfo),qn=a,Bt=!0,pr=null,Wi=!0),u=lx(a,null,b,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(it(),b===d){a=Us(r,a,u);break e}Wn(r,a,b,u)}a=a.child}return a;case 26:if(ns)return Yc(r,a),r===null?(u=jv(a.type,null,a.pendingProps,null))?a.memoizedState=u:Bt||(a.stateNode=T1(a.type,a.pendingProps,dr.current,a)):a.memoizedState=jv(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:if(Pn)return Ue(a),r===null&&Pn&&Bt&&(d=a.stateNode=ex(a.type,a.pendingProps,dr.current,Xn.current,!1),qn=a,Wi=!0,dn=t1(a.type,d,dn)),Wn(r,a,a.pendingProps.children,u),Yc(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&Bt&&(b1(a.type,a.pendingProps,Xn.current),(x=d=dn)&&(d=n1(d,a.type,a.pendingProps,Wi),d!==null?(a.stateNode=d,qn=a,dn=KM(d),Wi=!1,x=!0):x=!1),x||We(a)),Ue(a),x=a.type,b=a.pendingProps,I=r!==null?r.memoizedProps:null,d=b.children,ru(x,b)?d=null:I!==null&&ru(x,I)&&(a.flags|=32),a.memoizedState!==null&&(x=Fe(r,a,_t,null,null,u),zs?$r._currentValue=x:$r._currentValue2=x),Yc(r,a),Wn(r,a,d,u),a.child;case 6:return r===null&&Bt&&(M1(a.pendingProps,Xn.current),(r=u=dn)&&(u=i1(u,a.pendingProps,Wi),u!==null?(a.stateNode=u,qn=a,dn=null,r=!0):r=!1),r||We(a)),null;case 13:return L0(r,a,u);case 4:return rt(a,a.stateNode.containerInfo),d=a.pendingProps,r===null?a.child=ea(a,null,d,u):Wn(r,a,d,u),a.child;case 11:return M0(r,a,a.type,a.pendingProps,u);case 7:return Wn(r,a,a.pendingProps,u),a.child;case 8:return Wn(r,a,a.pendingProps.children,u),a.child;case 12:return Wn(r,a,a.pendingProps.children,u),a.child;case 10:return d=a.pendingProps,ue(a,a.type,d.value),Wn(r,a,d.children,u),a.child;case 9:return x=a.type._context,d=a.pendingProps.children,Xe(a),x=$e(x),d=d(x),a.flags|=1,Wn(r,a,d,u),a.child;case 14:return E0(r,a,a.type,a.pendingProps,u);case 15:return T0(r,a,a.type,a.pendingProps,u);case 19:return N0(r,a,u);case 31:return Ob(r,a,u);case 22:return w0(r,a,u,a.pendingProps);case 24:return Xe(a),d=$e(pn),r===null?(x=Ft(),x===null&&(x=rn,b=N(),x.pooledCache=b,b.refCount++,b!==null&&(x.pooledCacheLanes|=u),x=b),a.memoizedState={parent:d,cache:x},Ba(a),ue(a,pn,x)):((r.lanes&u)!==0&&(za(r,a),Gr(a,null,null,u),or()),x=r.memoizedState,b
4111=a.memoizedState,x.parent!==d?(x={parent:d,cache:d},a.memoizedState=x,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=x),ue(a,pn,d)):(d=b.cache,ue(a,pn,d),d!==x.cache&&ut(a,[pn],u,!0))),Wn(r,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(s(156,a.tag))}function Qi(r){r.flags|=4}function $c(r){Ss&&(r.flags|=8)}function F0(r,a){if(r!==null&&r.child===a.child)return!1;if((a.flags&16)!==0)return!0;for(r=a.child;r!==null;){if((r.flags&8218)!==0||(r.subtreeFlags&8218)!==0)return!0;r=r.sibling}return!1}function xd(r,a,u,d){if(Kn)for(u=a.child;u!==null;){if(u.tag===5||u.tag===6)Xd(r,u.stateNode);else if(!(u.tag===4||Pn&&u.tag===27)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return;u=u.return}u.sibling.return=u.return,u=u.sibling}else if(Ss)for(var x=a.child;x!==null;){if(x.tag===5){var b=x.stateNode;u&&d&&(b=Gv(b,x.type,x.memoizedProps)),Xd(r,b)}else if(x.tag===6)b=x.stateNode,u&&d&&(b=Wv(b,x.memoizedProps)),Xd(r,b);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)b=x.child,b!==null&&(b.return=x),xd(r,x,!0,!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===a)break;for(;x.sibling===null;){if(x.return===null||x.return===a)return;x=x.return}x.sibling.return=x.return,x=x.sibling}}function O0(r,a,u,d){var x=!1;if(Ss)for(var b=a.child;b!==null;){if(b.tag===5){var I=b.stateNode;u&&d&&(I=Gv(I,b.type,b.memoizedProps)),Vv(r,I)}else if(b.tag===6)I=b.stateNode,u&&d&&(I=Wv(I,b.memoizedProps)),Vv(r,I);else if(b.tag!==4){if(b.tag===22&&b.memoizedState!==null)x=b.child,x!==null&&(x.return=b),O0(r,b,!0,!0),x=!0;else if(b.child!==null){b.child.return=b,b=b.child;continue}}if(b===a)break;for(;b.sibling===null;){if(b.return===null||b.return===a)return x;b=b.return}b.sibling.return=b.return,b=b.sibling}return x}function B0(r,a){if(Ss&&F0(r,a)){r=a.stateNode;var u=r.containerInfo,d=kv();O0(d,a,!1,!1),r.pendingChildren=d,Qi(a),XM(u,d)}}function _d(r,a,u,d){if(Kn)r.memoizedProps!==d&&Qi(a);else if(Ss){var x=r.stateNode,b=r.memoizedProps;if((r=F0(r,a))||b!==d){var I=Xn.current;b=WM(x,u,b,d,!r,null),b===x?a.stateNode=x:($c(a),Uv(b,u,d,I)&&Qi(a),a.stateNode=b,r&&xd(b,a,!1,!1))}else a.stateNode=x}}function yd(r,a,u,d,x){if((r.mode&32)!==0&&(u===null?vM(a,d):xM(a,u,d))){if(r.flags|=16777216,(x&335544128)===x||qd(a,d))if(Ov(r.stateNode,a,d))r.flags|=8192;else if(uv())r.flags|=8192;else throw Qr=gu,rp}else r.flags&=-16777217}function z0(r,a){if(A1(a)){if(r.flags|=16777216,!Qv(a))if(uv())r.flags|=8192;else throw Qr=gu,rp}else r.flags&=-16777217}function Zc(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?A():536870912,r.lanes|=a,uo|=a)}function ul(r,a){if(!Bt)switch(r.tailMode){case"hidden":a=r.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function on(r){var a=r.alternate!==null&&r.alternate.child===r.child,u=0,d=0;if(a)for(var x=r.child;x!==null;)u|=x.lanes|x.childLanes,d|=x.subtreeFlags&65011712,d|=x.flags&65011712,x.return=r,x=x.sibling;else for(x=r.child;x!==null;)u|=x.lanes|x.childLanes,d|=x.subtreeFlags,d|=x.flags,x.return=r,x=x.sibling;return r.subtreeFlags|=d,r.childLanes=u,a}function zb(r,a,u){var d=a.pendingProps;switch(nt(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return on(a),null;case 1:return on(a),null;case 3:return u=a.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),a.memoizedState.cache!==d&&(a.flags|=2048),Pe(pn),oe(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Ct(a)?Qi(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,fe())),B0(r,a),on(a),null;case 26:if(ns){var x=a.type,b=a.memoizedState;return r===null?(Qi(a),b!==null?(on(a),z0(a,b)):(on(a),yd(a,x,null,d,u))):b?b!==r.memoizedState?(Qi(a),on(a),z0(a,b)):(on(a),a.flags&=-16777217):(b=r.memoizedProps,Kn?b!==d&&Qi(a):_d(r,a,x,d),on(a),yd(a,x,b,d,u)),null}
vendor: 5,878 bytes, line 4111
4111case 27:if(Pn){if(Se(a),u=dr.current,x=a.type,r!==null&&a.stateNode!=null)Kn?r.memoizedProps!==d&&Qi(a):_d(r,a,x,d);else{if(!d){if(a.stateNode===null)throw Error(s(166));return on(a),null}r=Xn.current,Ct(a)?ot(a,r):(r=ex(x,d,u,r,!0),a.stateNode=r,Qi(a))}return on(a),null}case 5:if(Se(a),x=a.type,r!==null&&a.stateNode!=null)_d(r,a,x,d);else{if(!d){if(a.stateNode===null)throw Error(s(166));return on(a),null}if(b=Xn.current,Ct(a))ot(a,b),g1(a.stateNode,x,d,b)&&(a.flags|=64);else{var I=cM(x,d,dr.current,b,a);$c(a),xd(I,a,!1,!1),a.stateNode=I,Uv(I,x,d,b)&&Qi(a)}}return on(a),yd(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,u),null;case 6:if(r&&a.stateNode!=null)u=r.memoizedProps,Kn?u!==d&&Qi(a):Ss&&(u!==d?(r=dr.current,u=Xn.current,$c(a),a.stateNode=Fv(d,r,u,a)):a.stateNode=r.stateNode);else{if(typeof d!="string"&&a.stateNode===null)throw Error(s(166));if(r=dr.current,u=Xn.current,Ct(a)){if(!Jn)throw Error(s(176));if(r=a.stateNode,u=a.memoizedProps,d=null,x=qn,x!==null)switch(x.tag){case 27:case 5:d=x.memoizedProps}o1(r,u,a,d)||We(a,!0)}else $c(a),a.stateNode=Fv(d,r,u,a)}return on(a),null;case 31:if(u=a.memoizedState,r===null||r.memoizedState!==null){if(d=Ct(a),u!==null){if(r===null){if(!d)throw Error(s(318));if(!Jn)throw Error(s(556));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));l1(r,a)}else it(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;on(a),r=!1}else u=fe(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return a.flags&256?(j(a),a):(j(a),null);if((a.flags&128)!==0)throw Error(s(558))}return on(a),null;case 13:if(d=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(x=Ct(a),d!==null&&d.dehydrated!==null){if(r===null){if(!x)throw Error(s(318));if(!Jn)throw Error(s(344));if(x=a.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(s(317));c1(x,a)}else it(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;on(a),x=!1}else x=fe(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=x),x=!0;if(!x)return a.flags&256?(j(a),a):(j(a),null)}return j(a),(a.flags&128)!==0?(a.lanes=u,a):(u=d!==null,r=r!==null&&r.memoizedState!==null,u&&(d=a.child,x=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(x=d.alternate.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==x&&(d.flags|=2048)),u!==r&&u&&(a.child.flags|=8192),Zc(a,a.updateQueue),on(a),null);case 4:return oe(),B0(r,a),r===null&&dM(a.stateNode.containerInfo),on(a),null;case 10:return Pe(a.type),on(a),null;case 19:if(v(Sn),d=a.memoizedState,d===null)return on(a),null;if(x=(a.flags&128)!==0,b=d.rendering,b===null)if(x)ul(d,!1);else{if(xn!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(b=J(r),b!==null){for(a.flags|=128,ul(d,!1),r=b.updateQueue,a.updateQueue=r,Zc(a,r),a.subtreeFlags=0,r=u,u=a.child;u!==null;)Ev(u,r),u=u.sibling;return y(Sn,Sn.current&1|2),Bt&&ye(a,d.treeForkCount),a.child}r=r.sibling}d.tail!==null&&mi()>Cl&&(a.flags|=128,x=!0,ul(d,!1),a.lanes=4194304)}else{if(!x)if(r=J(b),r!==null){if(a.flags|=128,x=!0,r=r.updateQueue,a.updateQueue=r,Zc(a,r),ul(d,!0),d.tail===null&&d.tailMode==="hidden"&&!b.alternate&&!Bt)return on(a),null}else 2*mi()-d.renderingStartTime>Cl&&u!==536870912&&(a.flags|=128,x=!0,ul(d,!1),a.lanes=4194304);d.isBackwards?(b.sibling=a.child,a.child=b):(r=d.last,r!==null?r.sibling=b:a.child=b,d.last=b)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=mi(),r.sibling=null,u=Sn.current,y(Sn,x?u&1|2:u&1),Bt&&ye(a,d.treeForkCount),r):(on(a),null);case 22:case 23:return j(a),al(),d=a.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(a.flags|=8192):d&&(a.flags|=8192),d?(u&536870912)!==0&&(a.flags&128)===0&&(on(a),a.subtreeFlags&6&&(a.flags|=8192)):on(a),u=a.updateQueue,u!==null&&Zc(a,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),d=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),d!==u&&(a.flags|=2048),r!==null&&v(Jr),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),Pe(pn),on(a),null;case 25:return null;case 30:return null}throw Error(s(156,a.tag))}function kb(r,a){switch(nt(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Pe(pn),oe(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return Se(a),null;case 31:if(a.memoizedState!==null){if(j(a),a.alternate===null)throw Error(s(340));it()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(j(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(s(340));it()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return v(Sn),null;case 4:return oe(),null;case 10:return Pe(a.type),null;case 22:case 23:return j(a),al(),r!==null&&v(Jr),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Pe(pn),null;case 25:return null;default:return null}}function k0(r,a){switch(nt(a),a.tag){case 3:Pe(pn),oe();break;case 26:case 27:case 5:Se(a);break;case 4:oe();break;case 31:a.memoizedState!==null&&j(a);break;case 13:j(a);break;case 19:v(Sn);break;case 10:Pe(a.type);break;case 22:case 23:j(a),al(),r!==null&&v(Jr);break;case 24:Pe(pn)}}function hl(r,a){try{var u=a.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var x=d.next;u=x;do{if((u.tag&r)===r){d=void 0;var b=u.create,I=u.inst;d=b(),I.destroy=d}u=u.next}while(u!==x)}}catch(k){Xt(a,a.return,k)}}function lr(r,a,u){try{var d=a.updateQueue,x=d!==null?d.lastEffect:null;if(x!==null){var b=x.next;d=b;do{if((d.tag&r)===r){var I=d.inst,k=I.destroy;if(k!==void 0){I.destroy=void 0,x=a;var ne=u,me=k;
4111try{me()}catch(Ne){Xt(x,ne,Ne)}}}d=d.next}while(d!==b)}}catch(Ne){Xt(a,a.return,Ne)}}function V0(r){var a=r.updateQueue;if(a!==null){var u=r.stateNode;try{kc(a,u)}catch(d){Xt(r,r.return,d)}}}function H0(r,a,u){u.props=Wr(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(d){Xt(r,a,d)}}function fl(r,a){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var d=gl(r.stateNode);break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof u=="function"?r.refCleanup=u(d):u.current=d}}catch(x){Xt(r,a,x)}}function ys(r,a){var u=r.ref,d=r.refCleanup;if(u!==null)if(typeof d=="function")try{d()}catch(x){Xt(r,a,x)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){Xt(r,a,x)}else u.current=null}function G0(r){var a=r.type,u=r.memoizedProps,d=r.stateNode;try{DM(d,a,u,r)}catch(x){Xt(r,r.return,x)}}function Sd(r,a,u){try{NM(r.stateNode,r.type,u,a,r)}catch(d){Xt(r,r.return,d)}}function W0(r){return r.tag===5||r.tag===3||(ns?r.tag===26:!1)||(Pn?r.tag===27&&ja(r.type):!1)||r.tag===4}function bd(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||W0(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(Pn&&r.tag===27&&ja(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Md(r,a,u){var d=r.tag;if(d===5||d===6)r=r.stateNode,a?FM(u,r,a):PM(u,r);else if(d!==4&&(Pn&&d===27&&ja(r.type)&&(u=r.stateNode,a=null),r=r.child,r!==null))for(Md(r,a,u),r=r.sibling;r!==null;)Md(r,a,u),r=r.sibling}function Kc(r,a,u){var d=r.tag;if(d===5||d===6)r=r.stateNode,a?UM(u,r,a):IM(u,r);else if(d!==4&&(Pn&&d===27&&ja(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(Kc(r,a,u),r=r.sibling;r!==null;)Kc(r,a,u),r=r.sibling}function X0(r,a,u){r=r.containerInfo;try{Hv(r,u)}catch(d){Xt(a,a.return,d)}}function q0(r){var a=r.stateNode,u=r.memoizedProps;try{R1(r.type,u,a,r)}catch(d){Xt(r,r.return,d)}}function Vb(r,a){for(oM(r.containerInfo),Bn=a;Bn!==null;)if(r=Bn,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,Bn=a;else for(;Bn!==null;){r=Bn;var u=r.alternate;switch(a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(var d=0;d<a.length;d++){var x=a[d];x.ref.impl=x.nextImpl}break;case 11:case 15:break;case 1:if((a&1024)!==0&&u!==null){a=void 0,d=r,x=u.memoizedProps,u=u.memoizedState;var b=d.stateNode;try{var I=Wr(d.type,x);a=b.getSnapshotBeforeUpdate(I,u),b.__reactInternalSnapshotBeforeUpdate=a}catch(k){Xt(d,d.return,k)}}break;case 3:(a&1024)!==0&&Kn&&GM(r.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(s(163))}if(a=r.sibling,a!==null){a.return=r.return,Bn=a;break}Bn=r.return}}function Y0(r,a,u){var d=u.flags;switch(u.tag){case 0:case 11:case 15:Fs(r,u),d&4&&hl(5,u);break;case 1:if(Fs(r,u),d&4)if(r=u.stateNode,a===null)try{r.componentDidMount()}catch(I){Xt(u,u.return,I)}else{var x=Wr(u.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(x,a,r.__reactInternalSnapshotBeforeUpdate)}catch(I){Xt(u,u.return,I)}}d&64&&V0(u),d&512&&fl(u,u.return);break;case 3:if(Fs(r,u),d&64&&(d=u.updateQueue,d!==null)){if(r=null,u.child!==null)switch(u.child.tag){case 27:case 5:r=gl(u.child.stateNode);break;case 1:r=u.child.stateNode}try{kc(d,r)}catch(I){Xt(u,u.return,I)}}break;case 27:Pn&&a===null&&d&4&&q0(u);case 26:case 5:if(Fs(r,u),a===null){if(d&4)G0(u);else if(d&64){r=u.type,a=u.memoizedProps,x=u.stateNode;try{f1(x,r,a,u)}catch(I){Xt(u,u.return,I)}}}d&512&&fl(u,u.return);break;case 12:Fs(r,u);break;case 31:Fs(r,u),d&4&&$0(r,u);break;case 13:Fs(r,u),d&4&&Z0(r,u),d&64&&(d=u.memoizedState,d!==null&&(d=d.dehydrated,d!==null&&(u=jb.bind(null,u),YM(d,u))));break;case 22:if(d=u.memoizedState!==null||Gs,!d){a=a!==null&&a.memoizedState!==null||An,x=Gs;var b=An;Gs=d,(An=a)&&!b?Os(r,u,(u.subtreeFlags&8772)!==0):Fs(r,u),Gs=x,An=b}break;case 30:break;default:Fs(r,u)}}function j0(r){var a=r.alternate;a!==null&&(r.alternate=null,j0(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&gM(a)),r.stateNode=null,r.return=null,r.depen
4111dencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function es(r,a,u){for(u=u.child;u!==null;)Ed(r,a,u),u=u.sibling}function Ed(r,a,u){if(Pi&&typeof Pi.onCommitFiberUnmount=="function")try{Pi.onCommitFiberUnmount(_l,u)}catch{}switch(u.tag){case 26:if(ns){An||ys(u,a),es(r,a,u),u.memoizedState?Zv(u.memoizedState):u.stateNode&&Jv(u.stateNode);break}case 27:if(Pn){An||ys(u,a);var d=Cn,x=gi;ja(u.type)&&(Cn=u.stateNode,gi=!1),es(r,a,u),tx(u.stateNode),Cn=d,gi=x;break}case 5:An||ys(u,a);case 6:if(Kn){if(d=Cn,x=gi,Cn=null,es(r,a,u),Cn=d,gi=x,Cn!==null)if(gi)try{BM(Cn,u.stateNode)}catch(b){Xt(u,a,b)}else try{OM(Cn,u.stateNode)}catch(b){Xt(u,a,b)}}else es(r,a,u);break;case 18:Kn&&Cn!==null&&(gi?_1(Cn,u.stateNode):x1(Cn,u.stateNode));break;case 4:Kn?(d=Cn,x=gi,Cn=u.stateNode.containerInfo,gi=!0,es(r,a,u),Cn=d,gi=x):(Ss&&X0(u.stateNode,u,kv()),es(r,a,u));break;case 0:case 11:case 14:case 15:lr(2,u,a),An||lr(4,u,a),es(r,a,u);break;case 1:An||(ys(u,a),d=u.stateNode,typeof d.componentWillUnmount=="function"&&H0(u,a,d)),es(r,a,u);break;case 21:es(r,a,u);break;case 22:An=(d=An)||u.memoizedState!==null,es(r,a,u),An=d;break;default:es(r,a,u)}}function $0(r,a){if(Jn&&a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{p1(r)}catch(u){Xt(a,a.return,u)}}}
4111function Z0(r,a){if(Jn&&a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{m1(r)}catch(u){Xt(a,a.return,u)}}function Hb(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new hx),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new hx),a;default:throw Error(s(435,r.tag))}}function Jc(r,a){var u=Hb(r);a.forEach(function(d){if(!u.has(d)){u.add(d);var x=$b.bind(null,r,d);d.then(x,x)}})}function Zn(r,a){var u=a.deletions;if(u!==null)for(var d=0;d<u.length;d++){var x=u[d],b=r,I=a;if(Kn){var k=I;e:for(;k!==null;){switch(k.tag){case 27:if(Pn){if(ja(k.type)){Cn=k.stateNode,gi=!1;break e}break}case 5:Cn=k.stateNode,gi=!1;break e;case 3:case 4:Cn=k.stateNode.containerInfo,gi=!0;break e}k=k.return}if(Cn===null)throw Error(s(160));Ed(b,I,x),Cn=null,gi=!1}else Ed(b,I,x);b=x.alternate,b!==null&&(b.return=null),x.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)K0(a,r),a=a.sibling}function K0(r,a){var u=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Zn(a,r),oi(r),d&4&&(lr(3,r,r.return),hl(3,r),lr(5,r,r.return));break;case 1:Zn(a,r),oi(r),d&512&&(An||u===null||ys(u,u.return)),d&64&&Gs&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?d:u.concat(d))));break;case 26:if(ns){var x=ss;if(Zn(a,r),oi(r),d&512&&(An||u===null||ys(u,u.return)),d&4){d=u!==null?u.memoizedState:null;var b=r.memoizedState;u===null?b===null?r.stateNode===null?r.stateNode=E1(x,r.type,r.memoizedProps,r):Kv(x,r.type,r.stateNode):r.stateNode=$v(x,b,r.memoizedProps):d!==b?(d===null?u.stateNode!==null&&Jv(u.stateNode):Zv(d),b===null?Kv(x,r.type,r.stateNode):$v(x,b,r.memoizedProps)):b===null&&r.stateNode!==null&&Sd(r,r.memoizedProps,u.memoizedProps)}break}case 27:if(Pn){Zn(a,r),oi(r),d&512&&(An||u===null||ys(u,u.return)),u!==null&&d&4&&Sd(r,r.memoizedProps,u.memoizedProps);break}case 5:if(Zn(a,r),oi(r),d&512&&(An||u===null||ys(u,u.return)),Kn){if(r.flags&32){x=r.stateNode;try{zv(x)}catch(Me){Xt(r,r.return,Me)}}d&4&&r.stateNode!=null&&(x=r.memoizedProps,Sd(r,x,u!==null?u.memoizedProps:x)),d&1024&&(fp=!0)}else Ss&&r.alternate!==null&&(r.alternate.stateNode=r.stateNode);break;case 6:if(Zn(a,r),oi(r),d&4&&Kn){if(r.stateNode===null)throw Error(s(162));d=r.memoizedProps,u=u!==null?u.memoizedProps:d,x=r.stateNode;try{LM(x,u,d)}catch(Me){Xt(r,r.return,Me)}}break;case 3:if(ns?(w1(),x=ss,ss=$d(a.containerInfo),Zn(a,r),ss=x):Zn(a,r),oi(r),d&4){if(Kn&&Jn&&u!==null&&u.memoizedState.isDehydrated)try{d1(a.containerInfo)}catch(Me){Xt(r,r.return,Me)}if(Ss){d=a.containerInfo,u=a.pendingChildren;try{Hv(d,u)}catch(Me){Xt(r,r.return,Me)}}}fp&&(fp=!1,J0(r));break;case 4:ns?(u=ss,ss=$d(r.stateNode.containerInfo),Zn(a,r),oi(r),ss=u):(Zn(a,r),oi(r)),d&4&&Ss&&X0(r.stateNode,r,r.stateNode.pendingChildren);break;case 12:Zn(a,r),oi(r);break;case 31:Zn(a,r),oi(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Jc(r,d)));break;case 13:Zn(a,r),oi(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Tu=mi()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Jc(r,d)));break;case 22:x=r.memoizedState!==null;var I=u!==null&&u.memoizedState!==null,k=Gs,ne=An;if(Gs=k||x,An=ne||I,Zn(a,r),An=ne,Gs=k,oi(r),d&8192&&(a=r.stateNode,a._visibility=x?a._visibility&-2:a._visibility|1,x&&(u===null||I||Gs||An||Xr(r)),Kn)){e:if(u=null,Kn)for(a=r;;
4111){if(a.tag===5||ns&&a.tag===26){if(u===null){I=u=a;try{b=I.stateNode,x?zM(b):VM(I.stateNode,I.memoizedProps)}catch(Me){Xt(I,I.return,Me)}}}else if(a.tag===6){if(u===null){I=a;try{var me=I.stateNode;x?kM(me):HM(me,I.memoizedProps)}catch(Me){Xt(I,I.return,Me)}}}else if(a.tag===18){if(u===null){I=a;try{var Ne=I.stateNode;x?y1(Ne):S1(I.stateNode)}catch(Me){Xt(I,I.return,Me)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}}d&4&&(d=r.updateQueue,d!==null&&(u=d.retryQueue,u!==null&&(d.retryQueue=null,Jc(r,u))));break;case 19:Zn(a,r),oi(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Jc(r,d)));break;case 30:break;case 21:break;default:Zn(a,r),oi(r)}}function oi(r){var a=r.flags;if(a&2){try{for(var u,d=r.return;d!==null;){if(W0(d)){u=d;break}d=d.return}if(Kn){if(u==null)throw Error(s(160));switch(u.tag){case 27:if(Pn){var x=u.stateNode,b=bd(r);Kc(r,b,x);break}case 5:var I=u.stateNode;u.flags&32&&(zv(I),u.flags&=-33);var k=bd(r);Kc(r,k,I);break;case 3:case 4:var ne=u.stateNode.containerInfo,me=bd(r);Md(r,me,ne);break;default:throw Error(s(161))}}}catch(Ne){Xt(r,r.return,Ne)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function J0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;J0(a),a.tag===5&&a.flags&1024&&SM(a.stateNode),r=r.sibling}}function Fs(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Y0(r,a.alternate,a),a=a.sibling}function Xr(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:lr(4,a,a.return),Xr(a);break;case 1:ys(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&H0(a,a.return,u),Xr(a);break;case 27:Pn&&tx(a.stateNode);case 26:case 5:ys(a,a.return),Xr(a);break;case 22:a.memoizedState===null&&Xr(a);break;case 30:Xr(a);break;default:Xr(a)}r=r.sibling}}function Os(r,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var d=a.alternate,x=r,b=a,I=b.flags;switch(b.tag){case 0:case 11:case 15:Os(x,b,u),hl(4,b);break;case 1:if(Os(x,b,u),d=b,x=d.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(me){Xt(d,d.return,me)}if(d=b,x=d.updateQueue,x!==null){var k=d.stateNode;try{var ne=x.shared.hiddenCallbacks;if(ne!==null)for(x.shared.hiddenCallbacks=null,x=0;x<ne.length;x++)zc(ne[x],k)}catch(me){Xt(d,d.return,me)}}u&&I&64&&V0(b),fl(b,b.return);break;case 27:Pn&&q0(b);case 26:case 5:Os(x,b,u),u&&d===null&&I&4&&G0(b),fl(b,b.return);break;case 12:Os(x,b,u);break;case 31:Os(x,b,u),u&&I&4&&$0(x,b);break;case 13:Os(x,b,u),u&&I&4&&Z0(x,b);break;case 22:b.memoizedState===null&&Os(x,b,u),fl(b,b.return);break;case 30:break;default:Os(x,b,u)}a=a.sibling}}function Td(r,a){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&C(u))}function wd(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&C(r))}function ts(r,a,u,d){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Q0(r,a,u,d),a=a.sibling}function Q0(r,a,u,d){var x=a.flags;switch(a.tag){case 0:case 11:case 15:ts(r,a,u,d),x&2048&&hl(9,a);break;case 1:ts(r,a,u,d);break;case 3:ts(r,a,u,d),x&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&C(r)));break;case 12:if(x&2048){ts(r,a,u,d),r=a.stateNode;try{var b=a.memoizedProps,I=b.id,k=b.onPostCommit;typeof k=="function"&&k(I,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ne){Xt(a,a.return,ne)}}else ts(r,a,u,d);break;case 31:ts(r,a,u,d);break;case 13:ts(r,a,u,d);break;case 23:break;case 22:b=a.stateNode,I=a.alternate,a.memoizedState!==null?b._visibility&2?ts(r,a,u,d):dl(r,a):b._visibility&2?ts(r,a,u,d):(b._visibility|=2,Ha(r,a,u,d,(a.subtreeFlags&10256)!==0||!1)),x&2048&&Td(I,a);break;case 24:ts(r,a,u,d),x&2048&&wd(a.alternate,a);break;default:ts(r,a,u,d)}}function Ha(r,a,u,d,x){for(x=x&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var b=r,I=a,k=u,ne=d,me=I.flags;switch(I.tag){case 0:case 11:case 15:Ha(b,I,k,ne,x),hl(8,I);break;case 23:break;case 22:var Ne=I.stateNode;I.memoizedState!==null?Ne._visibility&2?Ha(b,I,k,ne,x):dl(b,I):(Ne._visibility|=2,Ha(b,I,k,ne,x)),x&&me&2048&&Td(I.alternate,I);break;case 24:Ha(b,I,k,ne,x),x&&me&2048&&wd(I.alternate,I);break;default:Ha(b,I,k,ne,x)}a=a.sibling}}function dl(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=r,d=a,x=d.flags;switch(d.tag){case 22:dl(u,d),x&2048&&Td(d.alternate,d);break;case 24:dl(u,d),x&2048&&wd(d.alternate,d);break;default:dl(u,d)}a=a.sibling}}function qr(r,a,u){if(r.subtreeFlags&lo)for(r=r.child;r!==null;)ev(r,a,u),r=r.sibling}function ev(r,a,u){switch(r.tag){case 26:if(qr(r,a,u),r.flags&lo)if(r.memoizedState!==null)C1(u,ss,r.memoizedState,r.memoizedProps);else{var d=r.stateNode,x=r.type;r=r.memoizedProps,((a&335544128)===a||qd(x,r))&&Bv(u,d,x,r)}break;case 5:qr(r,a,u),r.flags&lo&&(d=r.stateNode,x=r.type,r=r.memoizedProps,((a&335544128)===a||qd(x,r))&&Bv(u,d,x,r));break;case 3:case 4:ns?(d=ss,ss=$d(r.stateNode.containerInfo),qr(r,a,u),ss=d):qr(r,a,u);break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=lo,lo=16777216,qr(r,a,u),lo=d):qr(r,a,u));break;default:qr(r,a,u)}}function tv(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function pl(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var d=a[u];Bn=d,iv(d,r)}tv(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)nv(r),r=r.sibling}function nv(r){switch(r.tag){case 0:case 11:case 15:pl(r),r.flags&2048&&lr(9,r,r.return);break;case 3:pl(r);break;case 12:pl(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,Qc(r)):pl(r);break;default:pl(r)}}function Qc(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var d=a[u];Bn=d,iv(d,r)}tv(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:lr(8,a,a.return),Qc(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,Qc(a));break;default:Qc(a)}r=r.sibling}}function iv(r,a){for(;Bn!==null;){var u=Bn;switch(u.tag){case 0:case 11:case 15:lr(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var d=u.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:C(u.memoizedState.cache)}if(d=u.child,d!==null)d.return=u,Bn=d;else e:for(u=r;Bn!==null;){d=Bn;var x=d.sibling,b=d.return;if(j0(d),d===u){Bn=null;break e}if(x!==null){x.return=b,Bn=x;break e}Bn=b}}}function Ad(r){var a=fM(r);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(s(364));return a}if(r=EM(r),r===null)throw Error(s(362));return r.stateNode.current}function Cd(r,a){var u=r.tag;switch(a.$$typeof){case yu:if(r.type===a.value)return!0;break;case Su:e:{for(a=a.value,r=[r,0],u=0;u<r.length;){var d=r[u++],x=d.tag,b=r[u++],I=a[b];if(x!==5&&x!==26&&x!==27||!xl(d)){for(;I!=null&&Cd(d,I);)b++,I=a[b];if(b===a.length){a=!0;break e}else for(d=d.child;d!==null;)r.push(d,b),d=d.sibling}}a=!1}return a;case bu:if((u===5||u===26||u===27)&&AM(r.stateNode,a.value))return!0;break;case Eu:if((u===5||u===6||u===26||u===27)&&(r=wM(r),r!==null&&0<=r.indexOf(a.value)))return!0;break;case Mu:if((u===5||u===26||u===27)&&(r=r.memoizedProps["data-testname"],typeof r=="string"&&r.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(s(365))}return!1}function Rd(r){switch(r.$$typeof){case yu:return"<"+(g(r.value)||"Unknown")+">";case Su:return":has("+(Rd(r)||"")+")";case bu:return'[role="'+r.value+'"]';
vendor: 11,625 bytes, line 4111
4111case Eu:return'"'+r.value+'"';case Mu:return'[data-testname="'+r.value+'"]';default:throw Error(s(365))}}function sv(r,a){var u=[];r=[r,0];for(var d=0;d<r.length;){var x=r[d++],b=x.tag,I=r[d++],k=a[I];if(b!==5&&b!==26&&b!==27||!xl(x)){for(;k!=null&&Cd(x,k);)I++,k=a[I];if(I===a.length)u.push(x);else for(x=x.child;x!==null;)r.push(x,I),x=x.sibling}}return u}function Id(r,a){if(!vl)throw Error(s(363));r=Ad(r),r=sv(r,a),a=[],r=Array.from(r);for(var u=0;u<r.length;){var d=r[u++],x=d.tag;if(x===5||x===26||x===27)xl(d)||a.push(d.stateNode);else for(d=d.child;d!==null;)r.push(d),d=d.sibling}return a}function Ci(){return(Dt&2)!==0&&Ot!==0?Ot&-Ot:lt.T!==null?Re():pM()}function rv(){if(Ui===0)if((Ot&536870912)===0||Bt){var r=ou;ou<<=1,(ou&3932160)===0&&(ou=262144),Ui=r}else Ui=536870912;return r=Di.current,r!==null&&(r.flags|=32),Ui}function pi(r,a,u){(r===rn&&(tn===2||tn===9)||r.cancelPendingCommit!==null)&&(Ga(r,0),cr(r,Ot,Ui,!1)),R(r,u),((Dt&2)===0||r!==rn)&&(r===rn&&((Dt&2)===0&&(na|=u),xn===4&&cr(r,Ot,Ui,!1)),se(r))}function av(r,a,u){if((Dt&6)!==0)throw Error(s(327));var d=!u&&(a&127)===0&&(a&r.expiredLanes)===0||M(r,a),x=d?Xb(r,a):Ld(r,a,!0),b=d;do{if(x===0){co&&!d&&cr(r,a,0,!1);break}else{if(u=r.current.alternate,b&&!Gb(u)){x=Ld(r,a,!1),b=!1;continue}if(x===2){if(b=a,r.errorRecoveryDisabledLanes&b)var I=0;else I=r.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){a=I;e:{var k=r;x=Al;var ne=Jn&&k.current.memoizedState.isDehydrated;if(ne&&(Ga(k,I).flags|=256),I=Ld(k,I,!1),I!==2){if(dp&&!ne){k.errorRecoveryDisabledLanes|=b,na|=b,x=4;break e}b=vi,vi=x,b!==null&&(vi===null?vi=b:vi.push.apply(vi,b))}x=I}if(b=!1,x!==2)continue}}if(x===1){Ga(r,0),cr(r,a,0,!0);break}e:{switch(d=r,b=x,b){case 0:case 1:throw Error(s(345));case 4:if((a&4194048)!==a)break;case 6:cr(d,a,Ui,!gr);break e;case 2:vi=null;break;case 3:case 5:break;default:throw Error(s(329))}if((a&62914560)===a&&(x=Tu+300-mi(),10<x)){if(cr(d,a,Ui,!gr),_(d,0,!0)!==0)break e;Xs=a,d.timeoutHandle=uM(ov.bind(null,d,u,vi,wu,mp,a,Ui,na,uo,gr,b,"Throttled",-0,0),x);break e}ov(d,u,vi,wu,mp,a,Ui,na,uo,gr,b,null,-0,0)}}break}while(!0);se(r)}function ov(r,a,u,d,x,b,I,k,ne,me,Ne,Me,Ye,Et){if(r.timeoutHandle=jr,Me=a.subtreeFlags,Me&8192||(Me&16785408)===16785408){Me=_M(),ev(a,b,Me);var Rn=(b&62914560)===b?Tu-mi():(b&4194048)===b?fx-mi():0;if(Rn=yM(Me,Rn),Rn!==null){Xs=b,r.cancelPendingCommit=Rn(gv.bind(null,r,a,b,u,d,x,I,k,ne,Ne,Me,null,Ye,Et)),cr(r,b,I,!me);return}}gv(r,a,b,u,d,x,I,k,ne)}function Gb(r){for(var a=r;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var d=0;d<u.length;d++){var x=u[d],b=x.getSnapshot;x=x.value;try{if(!Li(b(),x))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function cr(r,a,u,d){a&=~pp,a&=~na,r.suspendedLanes|=a,r.pingedLanes&=~a,d&&(r.warmLanes|=a),d=r.expirationTimes;for(var x=a;0<x;){var b=31-Ii(x),I=1<<b;d[b]=-1,x&=~I}u!==0&&w(r,u,a)}function lv(){return(Dt&6)===0?(de(0),!1):!0}function Pd(){if(Nt!==null){if(tn===0)var r=Nt.return;else r=Nt,Vs=Zr=null,Gt(r),io=null,Ml=0,r=Nt;for(;r!==null;)k0(r.alternate,r),r=r.return;Nt=null}}function Ga(r,a){var u=r.timeoutHandle;u!==jr&&(r.timeoutHandle=jr,hM(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),Xs=0,Pd(),rn=r,Nt=u=Bs(r.current,null),Ot=a,tn=0,Ni=null,gr=!1,co=M(r,a),dp=!1,uo=Ui=pp=na=vr=xn=0,vi=Al=null,mp=!1,(a&8)!==0&&(a|=a&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=a;0<d;){var x=31-Ii(d),b=1<<x;a|=r[x],d&=~b}return Ws=a,rr(),u}function cv(r,a){Tt=null,lt.H=Tl,a===no||a===mu?(a=Je(),tn=3):a===rp?(a=Je(),tn=4):tn=a===up?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Ni=a,Nt===null&&(xn=1,Xc(r,ce(a,r.current)))}function uv(){var r=Di.current;return r===null?!0:(Ot&4194048)===Ot?is===null:(Ot&62914560)===Ot||(Ot&536870912)!==0?r===is:!1}function hv(){var r=lt.H;return lt.H=Tl,r===null?Tl:r}function fv(){var r=lt.A;return lt.A=G1,r}function eu(){xn=4,gr||(Ot&4194048)!==Ot&&Di.current!==null||(co=!0),(vr&134217727)===0&&(na&134217727)===0||rn===null||cr(rn,Ot,Ui,!1)}function Ld(r,a,u){var d=Dt;Dt|=2;var x=hv(),b=fv();(rn!==r||Ot!==a)&&(wu=null,Ga(r,a)),a=!1;var I=xn;e:do try{if(tn!==0&&Nt!==null){var k=Nt,ne=Ni;switch(tn){case 8:Pd(),I=6;break e;case 3:case 2:case 9:case 6:Di.current===null&&(a=!0);var me=tn;if(tn=0,Ni=null,Wa(r,k,ne,me),u&&co){I=0;break e}break;default:me=tn,tn=0,Ni=null,Wa(r,k,ne,me)}}Wb(),I=xn;break}catch(Ne){cv(r,Ne)}while(!0);return a&&r.shellSuspendCounter++,Vs=Zr=null,Dt=d,lt.H=x,lt.A=b,Nt===null&&(rn=null,Ot=0,rr()),I}function Wb(){for(;Nt!==null;)dv(Nt)}function Xb(r,a){var u=Dt;Dt|=2;var d=hv(),x=fv();rn!==r||Ot!==a?(wu=null,Cl=mi()+500,Ga(r,a)):co=M(r,a);e:do try{if(tn!==0&&Nt!==null){a=Nt;var b=Ni;t:switch(tn){case 1:tn=0,Ni=null,Wa(r,a,b,1);break;case 2:case 9:if(ze(b)){tn=0,Ni=null,pv(a);break}a=function(){tn!==2&&tn!==9||rn!==r||(tn=7),se(r)},b.then(a,a);break e;case 3:tn=7;break e;case 4:tn=5;break e;case 7:ze(b)?(tn=0,Ni=null,pv(a)):(tn=0,Ni=null,Wa(r,a,b,7));break;case 5:var I=null;switch(Nt.tag){case 26:I=Nt.memoizedState;case 5:case 27:var k=Nt,ne=k.type,me=k.pendingProps;if(I?Qv(I):Ov(k.stateNode,ne,me)){tn=0,Ni=null;var Ne=k.sibling;if(Ne!==null)Nt=Ne;else{var Me=k.return;Me!==null?(Nt=Me,tu(Me)):Nt=null}break t}}tn=0,Ni=null,Wa(r,a,b,5);break;case 6:tn=0,Ni=null,Wa(r,a,b,6);break;case 8:Pd(),xn=6;break e;default:throw Error(s(462))}}qb();break}catch(Ye){cv(r,Ye)}while(!0);return Vs=Zr=null,lt.H=d,lt.A=x,Dt=u,Nt!==null?0:(rn=null,Ot=0,rr(),xn)}function qb(){for(;Nt!==null&&!L1();)dv(Nt)}function dv(r){var a=U0(r.alternate,r,Ws);r.memoizedProps=r.pendingProps,a===null?tu(r):Nt=a}function pv(r){var a=r,u=a.alternate;switch(a.tag){case 15:case 0:a=R0(u,a,a.pendingProps,a.type,void 0,Ot);break;case 11:a=R0(u,a,a.pendingProps,a.type.render,a.ref,Ot);break;case 5:Gt(a);default:k0(u,a),a=Nt=Ev(a,Ws),a=U0(u,a,Ws)}r.memoizedProps=r.pendingProps,a===null?tu(r):Nt=a}function Wa(r,a,u,d){Vs=Zr=null,Gt(a),io=null,Ml=0;var x=a.return;try{if(Fb(r,x,a,u,Ot)){xn=1,Xc(r,ce(u,r.current)),Nt=null;return}}catch(b){if(x!==null)throw Nt=x,b;xn=1,Xc(r,ce(u,r.current)),Nt=null;return}a.flags&32768?(Bt||d===1?r=!0:co||(Ot&536870912)!==0?r=!1:(gr=r=!0,(d===2||d===9||d===3||d===6)&&(d=Di.current,d!==null&&d.tag===13&&(d.flags|=16384))),mv(a,r)):tu(a)}function tu(r){var a=r;do{if((a.flags&32768)!==0){mv(a,gr);return}r=a.return;var u=zb(a.alternate,a,Ws);if(u!==null){Nt=u;return}if(a=a.sibling,a!==null){Nt=a;return}Nt=a=r}while(a!==null);xn===0&&(xn=5)}function mv(r,a){do{var u=kb(r.alternate,r);if(u!==null){u.flags&=32767,Nt=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(r=r.sibling,r!==null)){Nt=r;return}Nt=r=u}while(r!==null);xn=6,Nt=null}function gv(r,a,u,d,x,b,I,k,ne){r.cancelPendingCommit=null;do ml();while(Ln!==0);if((Dt&6)!==0)throw Error(s(327));if(a!==null){if(a===r.current)throw Error(s(177));if(b=a.lanes|a.childLanes,b|=ap,F(r,u,b,I,k,ne),r===rn&&(Nt=rn=null,Ot=0),ho=a,_r=r,Xs=u,gp=b,vp=x,dx=d,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Zb(Jd,function(){return Sv(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||d){d=lt.T,lt.T=null,x=ks(),On(2),I=Dt,Dt|=4;try{Vb(r,a,u)}finally{Dt=I,On(x),lt.T=d}}Ln=1,vv(),xv(),_v()}}function vv(){if(Ln===1){Ln=0;var r=_r,a=ho,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=lt.T,lt.T=null;var d=ks();On(2);var x=Dt;Dt|=4;try{K0(a,r),lM(r.containerInfo)}finally{Dt=x,On(d),lt.T=u}}r.current=a,Ln=2}}function xv(){if(Ln===2){Ln=0;var r=_r,a=ho,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=lt.T,lt.T=null;var d=ks();On(2);var x=Dt;Dt|=4;try{Y0(r,a.alternate,a)}finally{Dt=x,On(d),lt.T=u}}Ln=3}}function _v(){if(Ln===4||Ln===3){Ln=0,D1();var r=_r,a=ho,u=Xs,d=dx;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Ln=5:(Ln=0,ho=_r=null,yv(r,r.pendingLanes));var x=r.pendingLanes;if(x===0&&(xr=null),H(u),a=a.stateNode,Pi&&typeof Pi.onCommitFiberRoot=="function")try{Pi.onCommitFiberRoot(_l,a,void 0,(a.current.flags&128)===128)}catch{}if(d!==null){a=lt.T,x=ks(),On(2),lt.T=null;try{for(var b=r.onRecoverableError,I=0;I<d.length;I++){var k=d[I];b(k.value,{componentStack:k.stack})}}finally{lt.T=a,On(x)}}(Xs&3)!==0&&ml(),se(r),x=r.pendingLanes,(u&261930)!==0&&(x&42)!==0?r===xp?Rl++:(Rl=0,xp=r):Rl=0,Jn&&v1(),de(0)}}function yv(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,C(a)))}function ml(){return vv(),xv(),_v(),Sv()}function Sv(){if(Ln!==5)return!1;var r=_r,a=gp;gp=0;var u=H(Xs),d=32>u?32:u;u=lt.T;var x=ks();try{On(d),lt.T=null,d=vp,vp=null;var b=_r,I=Xs;if(Ln=0,ho=_r=null,Xs=0,(Dt&6)!==0)throw Error(s(331));var k=Dt;if(Dt|=4,nv(b.current),Q0(b,b.current,I,d),Dt=k,de(0,!1),Pi&&typeof Pi.onPostCommitFiberRoot=="function")try{Pi.onPostCommitFiberRoot(_l,b)}catch{}return!0}finally{On(x),lt.T=u,yv(r,a)}}function bv(r,a,u){a=ce(u,a),a=ud(r.stateNode,a,2),r=Zi(r,a,2),r!==null&&(R(r,2),se(r))}function Xt(r,a,u){if(r.tag===3)bv(r,r,u);else for(;a!==null;){if(a.tag===3){bv(a,r,u);break}else if(a.tag===1){var d=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(xr===null||!xr.has(d))){r=ce(u,r),u=S0(2),d=Zi(a,u,2),d!==null&&(b0(u,d,a,r),R(d,2),se(d));break}}a=a.return}}function Dd(r,a,u){var d=r.pingCache;if(d===null){d=r.pingCache=new W1;var x=new Set;d.set(a,x)}else x=d.get(a),x===void 0&&(x=new Set,d.set(a,x));x.has(u)||(dp=!0,x.add(u),r=Yb.bind(null,r,a,u),a.then(r,r))}function Yb(r,a,u){var d=r.pingCache;d!==null&&d.delete(a),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,rn===r&&(Ot&u)===u&&(xn===4||xn===3&&(Ot&62914560)===Ot&&300>mi()-Tu?(Dt&2)===0&&Ga(r,0):pp|=u,uo===Ot&&(uo=0)),se(r)}function Mv(r,a){a===0&&(a=A()),r=ms(r,a),r!==null&&(R(r,a),se(r))}function jb(r){var a=r.memoizedState,u=0;a!==null&&(u=a.retryLane),Mv(r,u)}function $b(r,a){var u=0;switch(r.tag){case 31:case 13:var d=r.stateNode,x=r.memoizedState;x!==null&&(u=x.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(a),Mv(r,u)}function Zb(r,a){return cu(r,a)}function Kb(r,a,u,d){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Bs(r,a){var u=r.alternate;return u===null?(u=t(r.tag,a,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=a,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,a=r.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function Ev(r,a){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.depen
4111dencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,a=u.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function nu(r,a,u,d,x,b){var I=0;if(d=r,typeof r=="function")Nd(r)&&(I=1);else if(typeof r=="string")I=ns&&Pn?Yv(r,u,Xn.current)?26:nx(r)?27:5:ns?Yv(r,u,Xn.current)?26:5:Pn&&nx(r)?27:5;else e:switch(r){case Wd:return r=t(31,u,a,x),r.elementType=Wd,r.lanes=b,r;case qa:return Yr(u.children,x,b,a);case Pv:I=8,x|=24;break;case zd:return r=t(12,u,a,x|2),r.elementType=zd,r.lanes=b,r;case Vd:return r=t(13,u,a,x),r.elementType=Vd,r.lanes=b,r;case Hd:return r=t(19,u,a,x),r.elementType=Hd,r.lanes=b,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case ur:I=10;break e;case Lv:I=9;break e;case kd:I=11;break e;case Gd:I=14;break e;case hr:I=16,d=null;break e}I=29,u=Error(s(130,r===null?"null":typeof r,"")),d=null}return a=t(I,u,a,x),a.elementType=r,a.type=d,a.lanes=b,a}function Yr(r,a,u,d){return r=t(7,r,d,a),r.lanes=u,r}function Ud(r,a,u){return r=t(6,r,null,a),r.lanes=u,r}function Tv(r){var a=t(18,null,null,0);return a.stateNode=r,a}function Fd(r,a,u){return a=t(4,r.children!==null?r.children:[],r.key,a),a.lanes=u,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}function Jb(r,a,u,d,x,b,I,k,ne){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=jr,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=D(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=D(0),this.hiddenUpdates=D(null),this.identifierPrefix=d,this.onUncaughtError=x,this.onCaughtError=b,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function wv(r,a,u,d,x,b,I,k,ne,me,Ne,Me){return r=new Jb(r,a,u,I,ne,me,Ne,Me,k),a=1,b===!0&&(a|=24),b=t(3,null,null,a),r.current=b,b.stateNode=r,a=N(),a.refCount++,r.pooledCache=a,a.refCount++,b.memoizedState={element:d,isDehydrated:u,cac
4111he:a},Ba(b),r}function Av(r){return r?(r=Za,r):Za}function Cv(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=c(a),r=r!==null?h(r):null,r===null?null:gl(r.stateNode)}function Rv(r,a,u,d,x,b){x=Av(x),d.context===null?d.context=x:d.pendingContext=x,d=Ai(a),d.payload={element:u},b=b===void 0?null:b,b!==null&&(d.callback=b),u=Zi(r,d,a),u!==null&&(pi(u,r,a),vs(u,r,a))}function Iv(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<a?u:a}}function Od(r,a){Iv(r,a),(r=r.alternate)&&Iv(r,a)}var Lt={},Qb=Xm,Ri=GP,Bd=Object.assign,eM=Symbol.for("react.element"),iu=Symbol.for("react.transitional.element"),Xa=Symbol.for("react.portal"),qa=Symbol.for("react.fragment"),Pv=Symbol.for("react.strict_mode"),zd=Symbol.for("react.profiler"),Lv=Symbol.for("react.consumer"),ur=Symbol.for("react.context"),kd=Symbol.for("react.forward_ref"),Vd=Symbol.for("react.suspense"),Hd=Symbol.for("react.suspense_list"),Gd=Symbol.for("react.memo"),hr=Symbol.for("react.lazy"),Wd=Symbol.for("react.activity"),tM=Symbol.for("react.memo_cache_sentinel"),Dv=Symbol.iterator,nM=Symbol.for("react.client.reference"),su=Array.isArray,lt=Qb.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,iM=e.rendererVersion,sM=e.rendererPackageName,Nv=e.extraDevToolsConfig,gl=e.getPublicInstance,rM=e.getRootHostContext,aM=e.getChildHostContext,oM=e.prepareForCommit,lM=e.resetAfterCommit,cM=e.createInstance;e.cloneMutableInstance;var Xd=e.appendInitialChild,Uv=e.finalizeInitialChildren,ru=e.shouldSetTextContent,Fv=e.createTextInstance;e.cloneMutableTextInstance;var uM=e.scheduleTimeout,hM=e.cancelTimeout,jr=e.noTimeout,zs=e.isPrimaryRenderer;e.warnsIfNotActing;var Kn=e.supportsMutation,Ss=e.supportsPersistence,Jn=e.supportsHydration,fM=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var dM=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var On=e.setCurrentUpdatePriority,ks=e.getCurrentUpdatePriority,pM=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var mM=e.shouldAttemptEagerTransition,gM=e.detachDeletedInstance;e.requestPostPaintCallback;var vM=e.maySuspendCommit,xM=e.maySuspendCommitOnUpdate,qd=e.maySuspendCommitInSyncRender,Ov=e.preloadInstance,_M=e.startSuspendingCommit,Bv=e.suspendInstance;e.suspendOnActiveViewTransition;var yM=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var Ya=e.NotPendingTransition,$r=e.HostTransitionContext,SM=e.resetFormInstance;e.bindToConsole;var bM=e.supportsMicrotasks,MM=e.scheduleMicrotask,vl=e.supportsTestSelectors,EM=e.findFiberRoot,TM=e.getBoundingRect,wM=e.getTextContent,xl=e.isHiddenSubtree,AM=e.matchAccessibilityRole,CM=e.setFocusIfFocusable,RM=e.setupIntersectionObserver,IM=e.appendChild,PM=e.appendChildToContainer,LM=e.commitTextUpdate,DM=e.commitMount,NM=e.commitUpdate,UM=e.insertBefore,FM=e.insertInContainerBefore,OM=e.removeChild,BM=e.removeChildFromContainer,zv=e.resetTextContent,zM=e.hideInstance,kM=e.hideTextInstance,VM=e.unhideInstance,HM=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var GM=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var WM=e.cloneInstance,kv=e.createContainerChildSet,Vv=e.appendChildToContainerChildSet,XM=e.finalizeContainerChildren,Hv=e.replaceContainerChildren,Gv=e.cloneHiddenInstance,Wv=e.cloneHiddenTextInstance,Yd=e.isSuspenseInstancePending,jd=e.isSuspenseInstanceFallback,qM=e.getSuspenseInstanceFallbackErrorDetails,YM=e.registerSuspenseInstanceRetry,jM=e.canHydrateFormStateMarker,$M=e.isFormStateMarkerMatching,Xv=e.getNextHydratableSibling,ZM=e.getNextHydratableSiblingAfterSingleton,KM=e.getFirstHydratableChild,JM=e.getFirstHydratableChildWithinContainer,QM=e.getFirstHydratableChildWithinActivityInstance,e1=e.getFirstHydratableChildWithinSuspenseInstance,t1=e.getFirstHydratableChildWithinSingleton,n1=e.canHydrateInstance,i1=e.canHydrateTextInstance,s1=e.canHydrateActivityInstance,r1=e.canHydrateSuspenseInstance,a1=e.hydrateInstance,o1=e.hydrateTextInstance,l1=e.hydrateActivityInstance,c1=e.hydrateSuspenseInstance,u1=e.getNextHydratableInstanceAfterActivityInstance,h1=e.getNextHydratableInstanceAfterSuspenseInstance,f1=e.commitHydratedInstance,d1=e.commitHydratedContainer,p1=e.commitHydratedActivityInstance,m1=e.commitHydratedSuspenseInstance,g1=e.finalizeHydratedChildren,v1=e.flushHydrationEvents;e.clearActivityBoundary;var x1=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var _1=e.clearSuspenseBoundaryFromContainer,y1=e.hideDehydratedBoundary,S1=e.unhideDehydratedBoundary,qv=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var b1=e.validateHydratableInstance,M1=e.validateHydratableTextInstance,ns=e.supportsResources,Yv=e.isHostHoistableType,$d=e.getHoistableRoot,jv=e.getResource,$v=e.acquireResource,Zv=e.releaseResource,E1=e.hydrateHoistable,Kv=e.mountHoistable,Jv=e.unmountHoistable,T1=e.createHoistableInstance,w1=e.prepareToCommitHoistables,A1=e.mayResourceSuspendCommit,Qv=e.preloadResource,C1=e.suspendResource,Pn=e.supportsSingletons,ex=e.resolveSingletonInstance,R1=e.acquireSingletonInstance,tx=e.releaseSingletonInstance,nx=e.isHostSingletonType,ja=e.isSingletonScope,Zd=[],$a=-1,Za={},Ii=Math.clz32?Math.clz32:E,I1=Math.log,P1=Math.LN2,au=256,ou=262144,lu=4194304,cu=Ri.unstable_scheduleCallback,Kd=Ri.unstable_cancelCallback,L1=Ri.unstable_shouldYield,D1=Ri.unstable_requestPaint,mi=Ri.unstable_now,ix=Ri.unstable_ImmediatePriority,N1=Ri.unstable_UserBlockingPriority,Jd=Ri.unstable_NormalPriority,U1=Ri.unstable_IdlePriority,F1=Ri.log,O1=Ri.unstable_setDisableYieldValue,_l=null,Pi=null,Li=typeof Object.is=="function"?Object.is:Z,sx=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},B1=Object.prototype.hasOwnProperty,Qd,rx,ep=!1,ax=new WeakMap,Ka=[],Ja=0,uu=null,yl=0,Hi=[],Gi=0,fr=null,bs=1,Ms="",Xn=m(null),Sl=m(null),dr=m(null),hu=m(null),qn=null,dn=null,Bt=!1,pr=null,Wi=!1,tp=Error(s(519)),fu=m(null),Zr=null,Vs=null,z1=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(u,d){r.push(d)}};this.abort=function(){a.aborted=!0,r.forEach(function(u){return u()})}},k1=Ri.unstable_scheduleCallback,V1=Ri.unstable_NormalPriority,pn={$$typeof:ur,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},du=null,Qa=null,np=!1,pu=!1,ip=!1,Kr=0,bl=null,sp=0,eo=0,to=null,ox=lt.S;lt.S=function(r,a){fx=mi(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&Ce(r,a),ox!==null&&ox(r,a)};var Jr=m(null),no=Error(s(460)),rp=Error(s(474)),mu=Error(s(542)),gu={then:function(){}},Qr=null,io=null,Ml=0,ea=wi(!0),lx=wi(!1),Xi=[],so=0,ap=0,mr=!1,op=!1,ro=m(null),vu=m(0),Di=m(null),is=null,Sn=m(0),Hs=0,Tt=null,sn=null,Tn=null,xu=!1,ao=!1,ta=!1,_u=0,El=0,oo=null,H1=0,Tl={readContext:$e,use:ke,useCallback:xe,useContext:xe,useEffect:xe,useImperativeHandle:xe,useLayoutEffect:xe,useInsertionEffect:xe,useMemo:xe,useReducer:xe,useRef:xe,useState:xe,useDebugValue:xe,useDeferredValue:xe,useTransition:xe,useSyncExternalStore:xe,useId:xe,useHostTransitionStatus:xe,useFormState:xe,useActionState:xe,useOptimistic:xe,useMemoCache:xe,useCacheRefresh:xe};Tl.useEffectEvent=xe;var cx={readContext:$e,use:ke,useCallback:function(r,a){return Pt().memoizedState=[r,a===void 0?null:a],r},useContext:$e,useEffect:n0,useImperativeHandle:function(r,a,u){u=u!=null?u.concat([r]):null,Hc(4194308,4,a0.bind(null,a,r),u)},useLayoutEffect:function(r,a){return Hc(4194308,4,r,a)},useInsertionEffect:function(r,a){Hc(4,2,r,a)},useMemo:function(r,a){var u=Pt();a=a===void 0?null:a;var d=r();if(ta){W(!0);try{r()}finally{W(!1)}}return u.memoizedState=[d,a],d},useReducer:function(r,a,u){var d=Pt();if(u!==void 0){var x=u(a);if(ta){W(!0);try{u(a)}finally{W(!1)}}}else x=a;return d.memoizedState=d.baseState=x,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:x},d.queue=r,r=r.dispatch=Ub.bind(null,Tt,r),[d.memoizedState,r]}
4111,useRef:function(r){var a=Pt();return r={current:r},a.memoizedState=r},useState:function(r){r=_s(r);var a=r.queue,u=m0.bind(null,Tt,a);return a.dispatch=u,[r.memoizedState,u]},useDebugValue:rd,useDeferredValue:function(r,a){var u=Pt();return ad(u,r,a)},useTransition:function(){var r=_s(!1);return r=h0.bind(null,Tt,r.queue,!0,!1),Pt().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,u){var d=Tt,x=Pt();if(Bt){if(u===void 0)throw Error(s(407));u=u()}else{if(u=a(),rn===null)throw Error(s(349));(Ot&127)!==0||Kt(d,a,u)}x.memoizedState=u;var b={value:u,getSnapshot:a};return x.queue=b,n0(Ki.bind(null,d,b,r),[r]),d.flags|=2048,Va(9,{destroy:void 0},hn.bind(null,d,b,u,a),null),u},useId:function(){var r=Pt(),a=rn.identifierPrefix;if(Bt){var u=Ms,d=bs;u=(d&~(1<<32-Ii(d)-1)).toString(32)+u,a="_"+a+"R_"+u,u=_u++,0<u&&(a+="H"+u.toString(32)),a+="_"}else u=H1++,a="_"+a+"r_"+u.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:od,useFormState:Kg,useActionState:Kg,useOptimistic:function(r){var a=Pt();a.memoizedState=a.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=ld.bind(null,Tt,!0,u),u.dispatch=a,[r,a]},useMemoCache:Hn,useCacheRefresh:function(){return Pt().memoizedState=Nb.bind(null,Tt)},useEffectEvent:function(r){var a=Pt(),u={impl:r};return a.memoizedState=u,function(){if((Dt&2)!==0)throw Error(s(440));return u.impl.apply(void 0,arguments)}}},lp={readContext:$e,use:ke,useCallback:l0,useContext:$e,useEffect:sd,useImperativeHandle:o0,useInsertionEffect:s0,useLayoutEffect:r0,useMemo:c0,useReducer:Gn,useRef:t0,useState:function(){return Gn(Mt)},useDebugValue:rd,useDeferredValue:function(r,a){var u=yt();return u0(u,sn.memoizedState,r,a)},useTransition:function(){var r=Gn(Mt)[0],a=yt().memoizedState;return[typeof r=="boolean"?r:vn(r),a]},useSyncExternalStore:Ns,useId:d0,useHostTransitionStatus:od,useFormState:Jg,useActionState:Jg,useOptimistic:function(r,a){var u=yt();return ol(u,sn,r,a)},useMemoCache:Hn,useCacheRefresh:p0};lp.useEffectEvent=i0;var ux={readContext:$e,use:ke,useCallback:l0,useContext:$e,useEffect:sd,useImperativeHandle:o0,useInsertionEffect:s0,useLayoutEffect:r0,useMemo:c0,useReducer:Vi,useRef:t0,useState:function(){return Vi(Mt)},useDebugValue:rd,useDeferredValue:function(r,a){var u=yt();return sn===null?ad(u,r,a):u0(u,sn.memoizedState,r,a)},useTransition:function(){var r=Vi(Mt)[0],a=yt().memoizedState;return[typeof r=="boolean"?r:vn(r),a]},useSyncExternalStore:Ns,useId:d0,useHostTransitionStatus:od,useFormState:e0,useActionState:e0,useOptimistic:function(r,a){var u=yt();return sn!==null?ol(u,sn,r,a):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:Hn,useCacheRefresh:p0};ux.useEffectEvent=i0;var cp={enqueueSetState:function(r,a,u){r=r._reactInternals;var d=Ci(),x=Ai(d);x.payload=a,u!=null&&(x.callback=u),a=Zi(r,x,d),a!==null&&(pi(a,r,d),vs(a,r,d))},enqueueReplaceState:function(r,a,u){r=r._reactInternals;var d=Ci(),x=Ai(d);x.tag=1,x.payload=a,u!=null&&(x.callback=u),a=Zi(r,x,d),a!==null&&(pi(a,r,d),vs(a,r,d))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var u=Ci(),d=Ai(u);d.tag=2,a!=null&&(d.callback=a),a=Zi(r,d,u),a!==null&&(pi(a,r,u),vs(a,r,u))}},up=Error(s(461)),wn=!1,hp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Gs=!1,An=!1,fp=!1,hx=typeof WeakSet=="function"?WeakSet:Set,Bn=null,Cn=null,gi=!1,ss=null,lo=8192,G1={getCacheForType:function(r){var a=$e(pn),u=a.data.get(r);return u===void 0&&(u=r(),a.data.set(r,u)),u},cacheSignal:function(){return $e(pn).controller.signal}},yu=0,Su=1,bu=2,Mu=3,Eu=4;if(typeof Symbol=="function"&&Symbol.for){var wl=Symbol.for;yu=wl("selector.component"),Su=wl("selector.has_pseudo_class"),bu=wl("selector.role"),Mu=wl("selector.test_id"),Eu=wl("selector.text")}var W1=typeof WeakMap=="function"?WeakMap:Map,Dt=0,rn=null,Nt=null,Ot=0,tn=0,Ni=null,gr=!1,co=!1,dp=!1,Ws=0,xn=0,vr=0,na=0,pp=0,Ui=0,uo=0,Al=null,vi=null,mp=!1,Tu=0,fx=0,Cl=1/0,wu=null,xr=null,Ln=0,_r=null,ho=null,Xs=0,gp=0,vp=null,dx=null,Rl=0,xp=null;return Lt.attemptContinuousHydration=function(r){if(r.tag===13||r.tag===31){var a=ms(r,67108864);a!==null&&pi(a,r,67108864),Od(r,67108864)}},Lt.attemptHydrationAtCurrentPriority=function(r){if(r.tag===13||r.tag===31){var a=Ci();a=O(a);var u=ms(r,a);u!==null&&pi(u,r,a),Od(r,a)}},Lt.attemptSynchronousHydration=function(r){switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var a=S(r.pendingLanes);if(a!==0){for(r.pendingLanes|=2,r.entangledLanes|=2;a;){var u=1<<31-Ii(a);r.entanglements[1]|=u,a&=~u}se(r),(Dt&6)===0&&(Cl=mi()+500,de(0))}}break;case 31:case 13:a=ms(r,2),a!==null&&pi(a,r,2),lv(),Od(r,2)}},Lt.batchedUpdates=function(r,a){return r(a)},Lt.createComponentSelector=function(r){return{$$typeof:yu,value:r}},Lt.createContainer=function(r,a,u,d,x,b,I,k,ne,me){return wv(r,a,!1,null,u,d,b,null,I,k,ne,me)},Lt.createHasPseudoClassSelector=function(r){return{$$typeof:Su,value:r}},Lt.createHydrationContainer=function(r,a,u,d,x,b,I,k,ne,me,Ne,Me,Ye,Et){var Rn;return r=wv(u,d,!0,r,x,b,k,Et,ne,me,Ne,Me),r.context=Av(null),u=r.current,d=Ci(),d=O(d),x=Ai(d),x.callback=(Rn=a)!=null?Rn:null,Zi(u,x,d),a=d,r.current.lanes=a,R(r,a),se(r),r},Lt.createPortal=function(r,a,u){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xa,key:d==null?null:""+d,children:r,containerInfo:a,implementation:u}},Lt.createRoleSelector=function(r){return{$$typeof:bu,value:r}},Lt.createTestNameSelector=function(r){return{$$typeof:Mu,value:r}},Lt.createTextSelector=function(r){return{$$typeof:Eu,value:r}},Lt.defaultOnCaughtError=function(r){console.error(r)},Lt.defaultOnRecoverableError=function(r){sx(r)},Lt.defaultOnUncaughtError=function(r){sx(r)},Lt.deferredUpdates=function(r){var a=lt.T,u=ks();try{return On(32),lt.T=null,r()}finally{On(u),lt.T=a}},Lt.discreteUpdates=function(r,a,u,d,x){var b=lt.T,I=ks();try{return On(2),lt.T=null,r(a,u,d,x)}finally{On(I),lt.T=b,Dt===0&&(Cl=mi()+500)}}
4111,Lt.findAllNodes=Id,Lt.findBoundingRects=function(r,a){if(!vl)throw Error(s(363));a=Id(r,a),r=[];for(var u=0;u<a.length;u++)r.push(TM(a[u]));for(a=r.length-1;0<a;a--){u=r[a];for(var d=u.x,x=d+u.width,b=u.y,I=b+u.height,k=a-1;0<=k;k--)if(a!==k){var ne=r[k],me=ne.x,Ne=me+ne.width,Me=ne.y,Ye=Me+ne.height;if(d>=me&&b>=Me&&x<=Ne&&I<=Ye){r.splice(a,1);break}else if(d!==me||u.width!==ne.width||Ye<b||Me>I){if(!(b!==Me||u.height!==ne.height||Ne<d||me>x)){me>d&&(ne.width+=me-d,ne.x=d),Ne<x&&(ne.width=x-me),r.splice(a,1);break}}else{Me>b&&(ne.height+=Me-b,ne.y=b),Ye<I&&(ne.height=I-Me),r.splice(a,1);break}}}return r},Lt.findHostInstance=Cv,Lt.findHostInstanceWithNoPortals=function(r){return r=c(r),r=r!==null?f(r):null,r===null?null:gl(r.stateNode)},Lt.findHostInstanceWithWarning=function(r){return Cv(r)},Lt.flushPassiveEffects=ml,Lt.flushSyncFromReconciler=function(r){var a=Dt;Dt|=1;var u=lt.T,d=ks();try{if(On(2),lt.T=null,r)return r()}finally{On(d),lt.T=u,Dt=a,(Dt&6)===0&&de(0)}},Lt.flushSyncWork=lv,Lt.focusWithin=function(r,a){
4111if(!vl)throw Error(s(363));for(r=Ad(r),a=sv(r,a),a=Array.from(a),r=0;r<a.length;){var u=a[r++],d=u.tag;if(!xl(u)){if((d===5||d===26||d===27)&&CM(u.stateNode))return!0;for(u=u.child;u!==null;)a.push(u),u=u.sibling}}return!1},Lt.getFindAllNodesFailureDescription=function(r,a){if(!vl)throw Error(s(363));var u=0,d=[];r=[Ad(r),0];for(var x=0;x<r.length;){var b=r[x++],I=b.tag,k=r[x++],ne=a[k];if((I!==5&&I!==26&&I!==27||!xl(b))&&(Cd(b,ne)&&(d.push(Rd(ne)),k++,k>u&&(u=k)),k<a.length))for(b=b.child;b!==null;)r.push(b,k),b=b.sibling}if(u<a.length){for(r=[];u<a.length;u++)r.push(Rd(a[u]));return`findAllNodes was able to match part of the selector: 4112 `+(d.join(" > ")+` 4113 4114No matching component was found for: 4115 `)+r.join(" > ")}return null},Lt.getPublicRootInstance=function(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 27:case 5:return gl(r.child.stateNode);default:return r.child.stateNode}},Lt.injectIntoDevTools=function(){var r={bundleType:0,version:iM,rendererPackageName:sM,currentDispatcherRef:lt,reconcilerVersion:"19.2.0"};if(Nv!==null&&(r.rendererConfig=Nv),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")r=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)r=!0;else{try{_l=a.inject(r),Pi=a}catch{}r=!!a.checkDCE}}return r},Lt.isAlreadyRendering=function(){return(Dt&6)!==0},Lt.observeVisibleRects=function(r,a,u,d){if(!vl)throw Error(s(363));r=Id(r,a);var x=RM(r,u,d).disconnect;return{disconnect:function(){x()}}},Lt.shouldError=function(){return null},Lt.shouldSuspend=function(){return!1},Lt.startHostTransition=function(r,a,u,d){if(r.tag!==5)throw Error(s(476));var x=f0(r).queue;h0(r,x,a,Ya,u===null?n:function(){var b=f0(r);return b.next===null&&(b=r.alternate.memoizedState),ll(r,b.next.queue,{},Ci()),u(d)})},Lt.updateContainer=function(r,a,u,d){var x=a.current,b=Ci();return Rv(x,b,r,a,u,d),b},Lt.updateContainerSync=function(r,a,u,d){return Rv(a.current,2,r,a,u,d),2},Lt},i.exports.default=i.exports,Object.defineProperty(i.exports,"__esModule",{value:!0})})(Z_)),Z_.exports}var J_;function vL(){return J_||(J_=1,$_.exports=gL()),$_.exports}var xL=vL();const _L=mL(xL);function yL(i){const e=_L(i);return e.injectIntoDevTools(),e}const vb=0,$o={},SL=/^three(?=[A-Z])/,nd=i=>`${i[0].toUpperCase()}${i.slice(1)}`;let bL=0;const ML=i=>typeof i=="function";function xb(i){if(ML(i)){const e=`${bL++}`;return $o[e]=i,e}else Object.assign($o,i)}function _b(i,e){const t=nd(i),n=$o[t];if(i!=="primitive"&&!n)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(i==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function EL(i,e,t){var n;return i=nd(i)in $o?i:i.replace(SL,""),_b(i,e),i==="primitive"&&(n=e.object)!=null&&n.__r3f&&delete e.object.__r3f,pf(e.object,t,i,e)}function TL(i){if(!i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?gf(i.parent,i):yi(i.object)&&(i.object.visible=!1),i.isHidden=!0,il(i)}}function yb(i){if(i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?mf(i.parent,i):yi(i.object)&&i.props.visible!==!1&&(i.object.visible=!0),i.isHidden=!1,il(i)}}function zg(i,e,t){const n=e.root.getState();if(!(!i.parent&&i.object!==n.scene)){if(!e.object){var s,o;const l=$o[nd(e.type)];e.object=(s=e.props.object)!=null?s:new l(...(o=e.props.args)!=null?o:[]),e.object.__r3f=e}if(Pr(e.object,e.props),e.props.attach)mf(i,e);else if(yi(e.object)&&yi(i.object)){const l=i.object.children.indexOf(t?.object);if(t&&l!==-1){const c=i.object.children.indexOf(e.object);if(c!==-1){i.object.children.splice(c,1);const h=c<l?l-1:l;i.object.children.splice(h,0,e.object)}else e.object.parent=i.object,i.object.children.splice(l,0,e.object),e.object.dispatchEvent({type:"added"}),i.object.dispatchEvent({type:"childadded",child:e.object})}else i.object.add(e.object)}for(const l of e.children)zg(e,l);il(e)}}function cm(i,e){e&&(e.parent=i,i.children.push(e),zg(i,e))}function Q_(i,e,t){if(!e||!t)return;e.parent=i;
4115const n=i.children.indexOf(t);n!==-1?i.children.splice(n,0,e):i.children.push(e),zg(i,e,t)}function Sb(i){if(typeof i.dispose=="function"){const e=()=>{try{i.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():Om.unstable_scheduleCallback(Om.unstable_IdlePriority,e)}}function zm(i,e,t){if(!e)return;e.parent=null;const n=i.children.indexOf(e);n!==-1&&i.children.splice(n,1),e.props.attach?gf(i,e):yi(e.object)&&yi(i.object)&&(i.object.remove(e.object),oL(Og(e),e.object));const s=e.props.dispose!==null&&t!==!1;for(let o=e.children.length-1;o>=0;o--){const l=e.children[o];zm(e,l,s)}e.children.length=0,delete e.object.__r3f,s&&e.type!=="primitive"&&e.object.type!=="Scene"&&Sb(e.object),t===void 0&&il(e)}function wL(i,e){for(const t of[i,i.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const n=t.ref(e);typeof n=="function"&&(t.refCleanup=n)}else t.ref&&(t.ref.current=e)}const bh=[];function AL(){for(const[t]of bh){const n=t.parent;if(n){t.props.attach?gf(n,t):yi(t.object)&&yi(n.object)&&n.object.remove(t.object);for(const s of t.children)s.props.attach?gf(t,s):yi(s.object)&&yi(t.object)&&t.object.remove(s.object)}t.isHidden&&yb(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&Sb(t.object)}for(const[t,n,s]of bh){t.props=n;const o=t.parent;if(o){var i,e;const l=$o[nd(t.type)],c=t.object;
4115t.object=(i=t.props.object)!=null?i:new l(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,wL(s,t.object),aL(Og(t),c,t.object),Pr(t.object,t.props),t.props.attach?mf(o,t):yi(t.object)&&yi(o.object)&&o.object.add(t.object);for(const h of t.children)h.props.attach?mf(t,h):yi(h.object)&&yi(t.object)&&t.object.add(h.object);il(t)}}bh.length=0}const um=()=>{},ey={};let xh=vb;const CL=0,RL=4,km=yL({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:EL,removeChild:zm,appendChild:cm,appendInitialChild:cm,insertBefore:Q_,appendChildToContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||cm(t,e)},removeChildFromContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||zm(t,e)},insertInContainerBefore(i,e,t){const n=i.getState().scene.__r3f;!e||!t||!n||Q_(n,e,t)},getRootHostContext:()=>ey,getChildHostContext:()=>ey,commitUpdate(i,e,t,n,s){var o,l,c;_b(e,n);let h=!1;if((i.type==="primitive"&&t.object!==n.object||((o=n.args)==null?void 0:o.length)!==((l=t.args)==null?void 0:l.length)||(c=n.args)!=null&&c.some((p,g)=>{var m;return p!==((m=t.args)==null?void 0:m[g])}))&&(h=!0),h)bh.push([i,{...n},s]);else{const p=nL(i,n);Object.keys(p).length&&(Object.assign(i.props,p),Pr(i.object,p))}(s.sibling===null||(s.flags&RL)===CL)&&AL()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:i=>i?.object,prepareForCommit:()=>null,preparePortalMount:i=>pf(i.getState().scene,i,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:TL,unhideInstance:yb,createTextInstance:um,hideTextInstance:um,unhideTextInstance:um,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:Ze.createContext(null),setCurrentUpdatePriority(i){xh=i},getCurrentUpdatePriority(){return xh},resolveUpdatePriority(){var i;if(xh!==vb)return xh;switch(typeof window<"u"&&((i=window.event)==null?void 0:i.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return dL;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return hL;default:return fL}},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:pL.version,applyViewTransitionName(i,e,t){},restoreViewTransitionName(i,e){},cancelViewTransitionName(i,e,t){},cancelRootViewTransitionName(i){},restoreRootViewTransitionName(i){},InstanceMeasurement:null,measureInstance:i=>null,wasInstanceInViewport:i=>!0,hasInstanceChanged:(i,e)=>!1,hasInstanceAffectedParent:(i,e)=>!1,suspendOnActiveViewTransition(i,e){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(i){},createViewTransitionInstance:i=>null,getCurrentGestureOffset(i){throw new Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance(i,e){return i},cloneMutableTextInstance(i){return i},cloneRootViewTransitionContainer(i){throw new Error("Not implemented.")},removeRootViewTransitionClone(i,e){throw new Error("Not implemented.")},createFragmentInstance:i=>null,updateFragmentInstanceFiber(i,e){},commitNewChildToFragmentInstance(i,e){},deleteChildFromFragmentInstance(i,e){},measureClonedInstance:i=>null,maySuspendCommitOnUpdate:(i,e,t)=>!1,maySuspendCommitInSyncRender:(i,e)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(i,e)=>null}),Pa=new Map,Uo={objects:"shallow",strict:!1};function IL(i,e){if(!e&&typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&i.parentElement){const{width:t,height:n,top:s,left:o}=i.parentElement.getBoundingClientRect();return{width:t,height:n,top:s,left:o}}else if(!e&&typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function PL(i){const e=Pa.get(i),t=e?.fiber,n=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const s=typeof reportError=="function"?reportError:console.error,o=n||cL(Gm,
4115ny),l=t||km.createContainer(o,uL,null,!1,null,"",s,s,s,null);e||Pa.set(i,{fiber:l,store:o});let c,h,f=!1,p=null;return{async configure(g={}){let m;p=new Promise(ge=>m=ge);let{gl:v,size:y,scene:E,events:S,onCreated:_,shadows:M=!1,linear:T=!1,flat:A=!1,legacy:D=!1,orthographic:R=!1,frameloop:F="always",dpr:w=[1,2],performance:L,raycaster:U,camera:O,onPointerMissed:H}=g,W=o.getState(),Z=W.gl;if(!W.gl){const ge={canvas:i,powerPreference:"high-performance",antialias:!0,alpha:!0},we=typeof v=="function"?await v(ge):v;j_(we)?Z=we:Z=new ab({...ge,...v}),W.set({gl:Z})}let V=W.raycaster;V||W.set({raycaster:V=new $S});const{params:$,...K}=U||{};if(ln.equ(K,V,Uo)||Pr(V,{...K}),ln.equ($,V.params,Uo)||Pr(V,{params:{...V.params,...$}}),!W.camera||W.camera===h&&!ln.equ(h,O,Uo)){h=O;const ge=O?.isCamera,we=ge?O:R?new Ua(0,0,0,0,.1,1e3):new Dn(75,0,.1,1e3);ge||(we.position.z=5,O&&(Pr(we,O),we.manual||("aspect"in O||"left"in O||"right"in O||"bottom"in O||"top"in O)&&(we.manual=!0,we.updateProjectionMatrix())),!W.camera&&!(O!=null&&O.rotation)&&we.lookAt(0,0,0)),W.set({camera:we}),V.camera=we}if(!W.scene){let ge;E!=null&&E.isScene?(ge=E,pf(ge,o,"",{})):(ge=new Sc,pf(ge,o,"",{}),E&&Pr(ge,E)),W.set({scene:ge})}S&&!W.events.handlers&&W.set({events:S(o)});const he=IL(i,y);if(ln.equ(he,W.size,Uo)||W.setSize(he.width,he.height,he.top,he.left),w&&W.viewport.dpr!==fb(w)&&W.setDpr(w),W.frameloop!==F&&W.setFrameloop(F),W.onPointerMissed||W.set({onPointerMissed:H}),L&&!ln.equ(L,W.performance,Uo)&&W.set(ge=>({performance:{...ge.performance,...L}})),!W.xr){var ce;const ge=(st,rt)=>{const oe=o.getState();oe.frameloop!=="never"&&ny(st,!0,oe,rt)},we=()=>{const st=o.getState();st.gl.xr.enabled=st.gl.xr.isPresenting,st.gl.xr.setAnimationLoop(st.gl.xr.isPresenting?ge:null),st.gl.xr.isPresenting||Gm(st)},nt={connect(){const st=o.getState().gl;st.xr.addEventListener("sessionstart",we),st.xr.addEventListener("sessionend",we)},disconnect(){const st=o.getState().gl;st.xr.removeEventListener("sessionstart",we),st.xr.removeEventListener("sessionend",we)}};typeof((ce=Z.xr)==null?void 0:ce.addEventListener)=="function"&&nt.connect(),W.set({xr:nt})}if(Z.shadowMap){const ge=Z.shadowMap.enabled,we=Z.shadowMap.type;if(Z.shadowMap.enabled=!!M,ln.boo(M))Z.shadowMap.type=Zl;else if(ln.str(M)){var ye;const nt={basic:my,percentage:ko,soft:Zl,variance:xa};Z.shadowMap.type=(ye=nt[M])!=null?ye:Zl}else ln.obj(M)&&Object.assign(Z.shadowMap,M);(ge!==Z.shadowMap.enabled||we!==Z.shadowMap.type)&&(Z.shadowMap.needsUpdate=!0)}return It.enabled=!D,f||(Z.outputColorSpace=T?Fr:$t,Z.toneMapping=A?zi:yf),W.legacy!==D&&W.set(()=>({legacy:D})),W.linear!==T&&W.set(()=>({linear:T})),W.flat!==A&&W.set(()=>({flat:A})),v&&!ln.fun(v)&&!j_(v)&&!ln.equ(v,Z,Uo)&&Pr(Z,v),c=_,f=!0,m(),this},render(g){return!f&&!p&&this.configure(),p.then(()=>{km.updateContainer(Ge.jsx(LL,{store:o,children:g,onCreated:c,rootElement:i}),l,null,()=>{})}),o},unmount(){bb(i)}}}function LL({store:i,children:e,onCreated:t,rootElement:n}){return Bc(()=>{const s=i.getState();s.set(o=>({internal:{...o.internal,active:!0}})),t&&t(s),i.getState().events.connected||s.events.connect==null||s.events.connect(n)},[]),Ge.jsx(mb.Provider,{value:i,children:e})}function bb(i,e){const t=Pa.get(i),n=t?.fiber;if(n){const s=t?.store.getState();s&&(s.internal.active=!1),km.updateContainer(null,n,null,()=>{s&&setTimeout(()=>{try{var o,l,c,h;s.events.disconnect==null||s.events.disconnect(),(o=s.gl)==null||(l=o.renderLists)==null||l.dispose==null||l.dispose(),(c=s.gl)==null||c.forceContextLoss==null||c.forceContextLoss(),(h=s.gl)!=null&&h.xr&&s.xr.disconnect(),QP(s.scene),Pa.delete(i)}catch{}},500)})}}const DL=new Set,NL=new Set,UL=new Set;function hm(i,e){if(i.size)for(const{callback:t}of i.values())t(e)}function oc(i,e){switch(i){case"before":return hm(DL,e);case"after":return hm(NL,e);case"tail":return hm(UL,e)}}let fm,dm;function Vm(i,e,t){let n=e.clock.getDelta();e.frameloop==="never"&&typeof i=="number"&&(n=i-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=i),fm=e.internal.subscribers;for(let s=0;s<fm.length;s++)dm=fm[s],dm.ref.current(dm.store.getState(),n,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let vf=!1,Hm=!1,pm,ty,Fo;function Mb(i){ty=requestAnimationFrame(Mb),vf=!0,pm=0,oc("before",i),Hm=!0;for(const t of Pa.values()){var e;Fo=t.store.getState(),Fo.internal.active&&(Fo.frameloop==="always"||Fo.internal.frames>0)&&!((e=Fo.gl.xr)!=null&&e.isPresenting)&&(pm+=Vm(i,Fo))}if(Hm=!1,oc("after",i),pm===0)return oc("tail",i),vf=!1,cancelAnimationFrame(ty)}function Gm(i,e=1){var t;if(!i)return Pa.forEach(n=>Gm(n.store.getState(),e));(t=i.gl.xr)!=null&&t.isPresenting||!i.internal.active||i.frameloop==="never"||(e>1?i.internal.frames=Math.min(60,i.internal.frames+e):Hm?i.internal.frames=2:i.internal.frames=1,vf||(vf=!0,requestAnimationFrame(Mb)))}function ny(i,e=!0,t,n){if(e&&oc("before",i),t)Vm(i,t,n);else for(const s of Pa.values())Vm(i,s.store.getState());e&&oc("after",i)}
4115const mm={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function FL(i){const{handlePointer:e}=lL(i);return{priority:1,enabled:!0,compute(t,n,s){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(mm).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:s}=i.getState();(t=s.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(s.lastEvent.current)},connect:t=>{const{set:n,events:s}=i.getState();if(s.disconnect==null||s.disconnect(),n(o=>({events:{...o.events,connected:t}})),s.handlers)for(const o in s.handlers){const l=s.handlers[o],[c,h]=mm[o];t.addEventListener(c,l,{passive:h})}},disconnect:()=>{const{set:t,events:n}=i.getState();if(n.connected){if(n.handlers)for(const s in n.handlers){const o=n.handlers[s],[l]=mm[s];n.connected.removeEventListener(l,o)}t(s=>({events:{...s.events,connected:void 0}}))}}}}function iy(i,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}function OL({debounce:i,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const s=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,l]=Ze.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),c=Ze.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o,orientationHandler:null}),h=i?typeof i=="number"?i:i.scroll:null,f=i?typeof i=="number"?i:i.resize:null,p=Ze.useRef(!1);Ze.useEffect(()=>(p.current=!0,()=>{p.current=!1}));const[g,m,v]=Ze.useMemo(()=>{const _=()=>{if(!c.current.element)return;const{left:M,top:T,width:A,height:D,bottom:R,right:F,x:w,y:L}=c.current.element.getBoundingClientRect(),U={left:M,top:T,width:A,height:D,bottom:R,right:F,x:w,y:L};c.current.element instanceof HTMLElement&&n&&(U.height=c.current.element.offsetHeight,U.width=c.current.element.offsetWidth),Object.freeze(U),p.current&&!VL(c.current.lastBounds,U)&&l(c.current.lastBounds=U)};return[_,f?iy(_,f):_,h?iy(_,h):_]},[l,n,h,f]);function y(){c.current.scrollContainers&&(c.current.scrollContainers.forEach(_=>_.removeEventListener("scroll",v,!0)),c.current.scrollContainers=null),c.current.resizeObserver&&(c.current.resizeObserver.disconnect(),c.current.resizeObserver=null),c.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",c.current.orientationHandler))}function E(){c.current.element&&(c.current.resizeObserver=new s(v),c.current.resizeObserver.observe(c.current.element),e&&c.current.scrollContainers&&c.current.scrollContainers.forEach(_=>_.addEventListener("scroll",v,{capture:!0,passive:!0})),c.current.orientationHandler=()=>{v()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",c.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",c.current.orientationHandler))}const S=_=>{!_||_===c.current.element||(y(),c.current.element=_,c.current.scrollContainers=Eb(_),E())};return zL(v,!!e),BL(m),Ze.useEffect(()=>{y(),E()},[e,v,m]),Ze.useEffect(()=>y,[]),[S,o,g]}function BL(i){Ze.useEffect(()=>{const e=i;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[i])}function zL(i,e){Ze.useEffect(()=>{if(e){const t=i;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",t,!0)}}},[i,e])}function Eb(i){const e=[];if(!i||i===document.body)return e;const{overflow:t,overflowX:n,overflowY:s}=window.getComputedStyle(i);return[t,n,s].some(o=>o==="auto"||o==="scroll")&&e.push(i),[...e,...Eb(i.parentElement)]}const kL=["x","y","top","bottom","left","right","width","height"],VL=(i,e)=>kL.every(t=>i[t]===e[t]);function HL({ref:i,children:e,fallback:t,resize:n,style:s,gl:o,events:l=FL,eventSource:c,eventPrefix:h,shadows:f,linear:p,flat:g,legacy:m,orthographic:v,frameloop:y,dpr:E,performance:S,raycaster:_,camera:M,scene:T,onPointerMissed:A,onCreated:D,...R}){Ze.useMemo(()=>xb(BP),[]);const F=ZP(),[w,L]=OL({scroll:!0,debounce:{scroll:50,resize:0},...n}),U=Ze.useRef(null),O=Ze.useRef(null);Ze.useImperativeHandle(i,()=>U.current);const H=hb(A),[W,Z]=Ze.useState(!1),[V,$]=Ze.useState(!1);if(W)throw W;if(V)throw V;const K=Ze.useRef(null);Bc(()=>{const ce=U.current;if(L.width>0&&L.height>0&&ce){K.current||(K.current=PL(ce));async function ye(){await K.current.configure({gl:o,scene:T,events:l,shadows:f,linear:p,flat:g,legacy:m,orthographic:v,frameloop:y,dpr:E,performance:S,raycaster:_,camera:M,size:L,onPointerMissed:(...ge)=>H.current==null?void 0:H.current(...ge),onCreated:ge=>{ge.events.connect==null||ge.events.connect(c?jP(c)?c.current:c:O.current),h&&ge.setEvents({compute:(we,nt)=>{const st=we[h+"X"],rt=we[h+"Y"];nt.pointer.set(st/nt.size.width*2-1,-(rt/nt.size.height)*2+1),nt.raycaster.setFromCamera(nt.pointer,nt.camera)}}),D?.(ge)}}),K.current.render(Ge.jsx(F,{children:Ge.jsx(JP,{set:$,children:Ge.jsx(Ze.Suspense,{fallback:Ge.jsx(KP,{set:Z}),children:e??null})})}))}ye()}}),Ze.useEffect(()=>{const ce=U.current;if(ce)return()=>bb(ce)},[]);const he=c?"none":"auto";
4115return Ge.jsx("div",{ref:O,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:he,...s},...R,children:Ge.jsx("div",{ref:w,style:{width:"100%",height:"100%"},children:Ge.jsx("canvas",{ref:U,style:{display:"block"},children:t})})})}function GL(i){return Ge.jsx(lb,{children:Ge.jsx(HL,{...i})})}var WL=(()=>{const i=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new gt;return t.setAttribute("position",new Qt(i,3)),t.setAttribute("uv",new Qt(e,2)),t})(),Ti=class Wm{static get fullscreenGeometry(){return WL}constructor(e="Pass",t=new Sc,n=new Ua){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthBlit=!1,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new Mn(Wm.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new Sc),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=zr){}render(e,t,n,s,o){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,n){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof fn||t instanceof Vn||t instanceof un||t instanceof Wm)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},XL=class extends Ti{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(i,e,t,n,s){const o=i.state.buffers.stencil;o.setLocked(!1),o.setTest(!1)}},qL=`#ifdef COLOR_WRITE 4116#include <common> 4117#include <dithering_pars_fragment> 4118#ifdef FRAMEBUFFER_PRECISION_HIGH 4119uniform mediump sampler2D inputBuffer; 4120#else 4121uniform lowp sampler2D inputBuffer; 4122#endif 4123#endif 4124#ifdef DEPTH_WRITE 4125#include <packing> 4126#ifdef GL_FRAGMENT_PRECISION_HIGH 4127uniform highp sampler2D depthBuffer; 4128#else 4129uniform mediump sampler2D depthBuffer; 4130#endif 4131float readDepth(const in vec2 uv){ 4132#if DEPTH_PACKING == 3201 4133return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 4134#else 4135return texture2D(depthBuffer,uv).r; 4136#endif 4137} 4138#endif 4139#ifdef USE_WEIGHTS 4140uniform vec4 channelWeights; 4141#endif 4142uniform float opacity;varying vec2 vUv;void main(){ 4143#ifdef COLOR_WRITE 4144vec4 texel=texture2D(inputBuffer,vUv); 4145#ifdef USE_WEIGHTS 4146texel*=channelWeights; 4147#endif 4148gl_FragColor=opacity*texel; 4149#ifdef COLOR_SPACE_CONVERSION 4150#include <colorspace_fragment> 4151#endif 4152#include <dithering_fragment> 4153#else 4154gl_FragColor=vec4(0.0); 4155#endif 4156#ifdef DEPTH_WRITE 4157gl_FragDepth=readDepth(vUv); 4158#endif 4159}`,Tb="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",wb=class extends En{constructor(){super({name:"CopyMaterial",defines:{COLOR_SPACE_CONVERSION:"1",DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new Ut(null),depthBuffer:new Ut(null),channelWeights:new Ut(null),opacity:new Ut(1)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:qL,vertexShader:Tb}),this.depthFunc=uc}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(i){const e=i!==null;this.colorWrite!==e&&(e?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=e,this.needsUpdate=!0),this.uniforms.inputBuffer.value=i}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(i){const e=i!==null;this.depthWrite!==e&&(e?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=e,this.depthWrite=e,this.needsUpdate=!0),this.uniforms.depthBuffer.value=i}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}get colorSpaceConversion(){return this.defines.COLOR_SPACE_CONVERSION!==void 0}set colorSpaceConversion(i){this.colorSpaceConversion!==i&&(i?this.defines.COLOR_SPACE_CONVERSION=!0:delete this.defines.COLOR_SPACE_CONVERSION,this.needsUpdate=!0)}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(i){i!==null?(this.defines.USE_WEIGHTS="1",this.uniforms.channelWeights.value=i):delete this.defines.USE_WEIGHTS,this.needsUpdate=!0}setInputBuffer(i){this.uniforms.inputBuffer.value=i}getOpacity(i){return this.uniforms.opacity.value}setOpacity(i){this.uniforms.opacity.value=i}},YL=class extends Ti{constructor(i,e=!0){super("CopyPass"),this.fullscreenMaterial=new wb,this.needsSwap=!1,this.renderTarget=i,i===void 0&&(this.renderTarget=new fn(1,1,{minFilter:nn,magFilter:nn,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(i){this.autoResize=i}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(i){this.autoResize=i}render(i,e,t,n,s){this.fullscreenMaterial.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){this.autoResize&&this.renderTarget.setSize(i,e)}initialize(i,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==yn?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":i!==null&&i.outputColorSpace
vendor: 4,192 bytes, line 4159
4159===$t&&(this.renderTarget.texture.colorSpace=$t))}},sy=new Ve,Ab=class extends Ti{constructor(i=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=i,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(i,e,t){this.color=i,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(i){this.overrideClearColor=i}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(i){this.overrideClearAlpha=i}render(i,e,t,n,s){const o=this.overrideClearColor,l=this.overrideClearAlpha,c=i.getClearAlpha(),h=o!==null,f=l>=0;h?(i.getClearColor(sy),i.setClearColor(o,f?l:c)):f&&i.setClearAlpha(l),i.setRenderTarget(this.renderToScreen?null:e),i.clear(this.color,this.depth,this.stencil),h?i.setClearColor(sy,c):f&&i.setClearAlpha(c)}},jL=class extends Ti{constructor(i,e){super("MaskPass",i,e),this.needsSwap=!1,this.clearPass=new Ab(!1,!1,!0),this.inverse=!1}set mainScene(i){this.scene=i}set mainCamera(i){this.camera=i}get inverted(){return this.inverse}set inverted(i){this.inverse=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(i){this.inverted=i}render(i,e,t,n,s){const o=i.getContext(),l=i.state.buffers,c=this.scene,h=this.camera,f=this.clearPass,p=this.inverted?0:1,g=1-p;l.color.setMask(!1),l.depth.setMask(!1),l.color.setLocked(!0),l.depth.setLocked(!0),l.stencil.setTest(!0),l.stencil.setOp(o.REPLACE,o.REPLACE,o.REPLACE),l.stencil.setFunc(o.ALWAYS,p,4294967295),l.stencil.setClear(g),l.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?f.render(i,null):(f.render(i,e),f.render(i,t))),this.renderToScreen?(i.setRenderTarget(null),i.render(c,h)):(i.setRenderTarget(e),i.render(c,h),i.setRenderTarget(t),i.render(c,h)),l.color.setLocked(!1),l.depth.setLocked(!1),l.stencil.setLocked(!1),l.stencil.setFunc(o.EQUAL,1,4294967295),l.stencil.setOp(o.KEEP,o.KEEP,o.KEEP),l.stencil.setLocked(!0)}},gm=1/1e3,$L=1e3,ZL=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(i){typeof document<"u"&&document.hidden!==void 0&&(i?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=i)}get delta(){return this._delta*gm}get fixedDelta(){return this._fixedDelta*gm}set fixedDelta(i){this._fixedDelta=i*$L}get elapsed(){return this._elapsed*gm}update(i){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(i!==void 0?i:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(i){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},KL=class{constructor(i=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:n=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,s,n),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new YL,this.depthTexture=null,this.depthRenderTarget=null,this.passes=[],this.timer=new ZL,this.autoRenderToScreen=!0,this.setRenderer(i)}get multisampling(){return this.inputBuffer.samples}set multisampling(i){const e=this.inputBuffer,t=this.multisampling;t>0&&i>0?(this.inputBuffer.samples=i,this.outputBuffer.samples=i,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==i&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,i),this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(i){if(this.renderer=i,i!==null){const e=i.getSize(new ae),t=i.getContext().getContextAttributes().alpha,n=this.inputBuffer.texture.type;
4159n===yn&&i.outputColorSpace===$t&&(this.inputBuffer.texture.colorSpace=$t,this.outputBuffer.texture.colorSpace=$t,this.inputBuffer.dispose(),this.outputBuffer.dispose()),i.autoClear=!1,this.setSize(e.width,e.height);for(const s of this.passes)s.initialize(i,t,n)}}replaceRenderer(i,e=!0){const t=this.renderer,n=t.domElement.parentNode;return this.setRenderer(i),e&&n!==null&&(n.removeChild(t.domElement),n.appendChild(i.domElement)),t}createDepthTexture(){const i=this.inputBuffer,e=new Br;this.depthTexture=e,i.stencilBuffer?(e.format=er,e.type=Aa):e.type=Yn;const t=e.clone();return t.name="EffectComposer.StableDepth",this.depthRenderTarget=new fn(i.width,i.height,{depthBuffer:!0,stencilBuffer:i.stencilBuffer,depthTexture:t}),t}blitDepthBuffer(i){const e=this.renderer,t=this.depthRenderTarget,n=e.properties,s=e.getContext();e.setRenderTarget(t);const o=n.get(i).__webglFramebuffer,l=n.get(t).__webglFramebuffer,c=i.stencilBuffer?s.DEPTH_BUFFER_BIT|s.STENCIL_BUFFER_BIT:s.DEPTH_BUFFER_BIT;s.bindFramebuffer(s.READ_FRAMEBUFFER,o),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,l),s.blitFramebuffer(0,0,i.width,i.height,0,0,t.width,t.height,c,s.NEAREST),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),e.setRenderTarget(null)}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.depthRenderTarget.dispose(),this.depthRenderTarget=null,this.inputBuffer.depthTexture=null,this.outputBuffer.depthTexture=null;for(const i of this.passes)i.setDepthTexture(null)}}createBuffer(i,e,t,n){const s=this.renderer,o=s===null?new ae:s.getDrawingBufferSize(new ae),l={minFilter:nn,magFilter:nn,stencilBuffer:e,depthBuffer:i,type:t},c=new fn(o.width,o.height,l);return n>0&&(c.samples=n),t===yn&&s!==null&&s.outputColorSpace===$t&&(c.texture.colorSpace=$t),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}setMainScene(i){for(const e of this.passes)e.mainScene=i}setMainCamera(i){for(const e of this.passes)e.mainCamera=i}addPass(i,e){const t=this.passes,n=this.renderer,s=n.getDrawingBufferSize(new ae),o=n.getContext().getContextAttributes().alpha,l=this.inputBuffer.texture.type;if(i.renderer=n,i.setSize(s.width,s.height),i.initialize(n,o,l),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),i.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,i):t.push(i),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),i.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const c=this.createDepthTexture();for(i of t)i.setDepthTexture(c)}else{const c=this.depthRenderTarget.depthTexture;i.setDepthTexture(c)}}removePass(i){const e=this.passes,t=e.indexOf(i);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){const o=(c,h)=>c||h.needsDepthTexture;if(!e.reduce(o,!1)){const c=this.depthRenderTarget.depthTexture;i.getDepthTexture()===c&&i.setDepthTexture(null),this.deleteDepthTexture()}}this.autoRenderToScreen&&t===e.length&&(i.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const i=this.passes;this.deleteDepthTexture(),i.length>0&&(this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!1),this.passes=[])}render(i){const e=this.renderer,t=this.copyPass;let n=this.inputBuffer,s=this.outputBuffer,o,l=!1;
4159i===void 0&&(this.timer.update(),i=this.timer.getDelta());for(const c of this.passes)if(c.enabled){if(n.depthTexture=this.depthTexture,s.depthTexture=null,c.render(e,n,s,i,l),c.needsDepthBlit&&this.depthRenderTarget!==null&&this.blitDepthBuffer(n),c.needsSwap){if(l){t.renderToScreen=c.renderToScreen;const h=e.getContext(),f=e.state.buffers.stencil;f.setFunc(h.NOTEQUAL,1,4294967295),t.render(e,n,s,i,l),f.setFunc(h.EQUAL,1,4294967295)}o=n,n=s,s=o}c instanceof jL?l=!0:c instanceof XL&&(l=!1)}}setSize(i,e,t){const n=this.renderer,s=n.getSize(new ae);(i===void 0||e===void 0)&&(i=s.width,e=s.height),(s.width!==i||s.height!==e)&&n.setSize(i,e,t);const o=n.getDrawingBufferSize(new ae);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height),this.depthRenderTarget!==null&&this.depthRenderTarget.setSize(o.width,o.height);for(const l of this.passes)l.setSize(o.width,o.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const i of this.passes)i.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),Ti.fullscreenGeometry.dispose()}},Ta={NONE:0,DEPTH:1,CONVOLUTION:2},jt={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},JL=class{constructor(){this.shaderParts=new Map([[jt.FRAGMENT_HEAD,null],[jt.FRAGMENT_MAIN_UV,null],[jt.FRAGMENT_MAIN_IMAGE,null],[jt.VERTEX_HEAD,null],[jt.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Ta.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Fr}},vm=!1,ry=class{constructor(i=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(i),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case ni:t=this.materialsFlatShadedDoubleSide;break;case Nn:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case ni:t=this.materialsDoubleSide;break;case Nn:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(i){if(!(i instanceof En))return i.clone();const e=i.uniforms,t=new Map;for(const s in e){const o=e[s].value;o.isRenderTargetTexture&&(e[s].value=null,t.set(s,o))}const n=i.clone();for(const s of t)e[s[0]].value=s[1],n.uniforms[s[0]].value=s[1];return n}setMaterial(i){if(this.disposeMaterials(),this.material=i,i!==null){const e=this.materials=[this.cloneMaterial(i),this.cloneMaterial(i),this.cloneMaterial(i)];for(const t of e)t.uniforms=Object.assign({},i.uniforms),t.side=Is;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.side=Nn,n}),this.materialsDoubleSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.side=ni,n}),this.materialsFlatShaded=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n.side=Nn,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n.side=ni,n})}}render(i,e,t){const n=i.shadowMap.enabled;if(i.shadowMap.enabled=!1,vm){const s=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),i.render(e,t);for(const o of s)o[0].material=o[1];this.meshCount!==s.size&&s.clear()}else{const s=e.overrideMaterial;e.overrideMaterial=this.material,i.render(e,t),e.overrideMaterial=s}i.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){const i=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);
4159for(const e of i)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return vm}static set workaroundEnabled(i){vm=i}},Cr=-1,si=class extends Mi{constructor(i=null,e=Cr,t=Cr,n=1){super(),i!==null&&this.addEventListener("change",()=>i.setSize(this.baseSize.width,this.baseSize.height)),this.baseSize=new ae(1,1),this.preferredSize=new ae(e,t),this.target=this.preferredSize,this.s=n,this.effectiveSize=new ae,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const i=this.baseSize,e=this.preferredSize,t=this.effectiveSize,n=this.scale;e.width!==Cr?t.width=e.width:e.height!==Cr?t.width=Math.round(e.height*(i.width/Math.max(i.height,1))):t.width=Math.round(i.width*n),e.height!==Cr?t.height=e.height:e.width!==Cr?t.height=Math.round(e.width/Math.max(i.width/Math.max(i.height,1),1)):t.height=Math.round(i.height*n)}get width(){return this.effectiveSize.width}set width(i){this.preferredWidth=i}get height(){return this.effectiveSize.height}set height(i){this.preferredHeight=i}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(i){this.s!==i&&(this.s=i,this.preferredSize.setScalar(Cr),this.dispatchEvent({type:"change"}))}getScale(){return this.scale}setScale(i){this.scale=i}get baseWidth(){return this.baseSize.width}set baseWidth(i){this.baseSize.width!==i&&(this.baseSize.width=i,this.dispatchEvent({type:"change"}))}getBaseWidth(){return this.baseWidth}setBaseWidth(i){this.baseWidth=i}get baseHeight(){return this.baseSize.height}set baseHeight(i){this.baseSize.height!==i&&(this.baseSize.height=i,this.dispatchEvent({type:"change"}))}getBaseHeight(){return this.baseHeight}setBaseHeight(i){this.baseHeight=i}setBaseSize(i,e){(this.baseSize.width!==i||this.baseSize.height!==e)&&(this.baseSize.set(i,e),this.dispatchEvent({type:"change"}))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(i){this.preferredSize.width!==i&&(this.preferredSize.width=i,this.dispatchEvent({type:"change"}))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(i){this.preferredWidth=i}get preferredHeight(){return this.preferredSize.height}set preferredHeight(i){this.preferredSize.height!==i&&(this.preferredSize.height=i,this.dispatchEvent({type:"change"}))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(i){this.preferredHeight=i}setPreferredSize(i,e){(this.preferredSize.width!==i||this.preferredSize.height!==e)&&(this.preferredSize.set(i,e),this.dispatchEvent({type:"change"}))}copy(i){this.s=i.scale,this.baseSize.set(i.baseWidth,i.baseHeight),this.preferredSize.set(i.preferredWidth,i.preferredHeight),this.dispatchEvent({type:"change"})}static get AUTO_SIZE(){return Cr}},Rt={ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},QL="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",eD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,src.a*opacity);}",tD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=(dst.rgb+src.rgb)*0.5;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",nD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.xy,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",iD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/max(b,1e-9))),vec3(1.0),step(1.0,a));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",sD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",rD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",aD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=abs(dst.rgb-src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",oD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb/max(src.rgb,1e-9);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",lD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-2.0*dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",cD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb,1.0);vec3 b=min(src.rgb,1.0);vec3 c=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",uD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=step(1.0,dst.rgb+src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",hD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.x,a.yz));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",fD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",dD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=src.rgb*max(1.0-dst.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",pD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",mD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",gD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb+src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",vD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(2.0*src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",xD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.xy,b.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",_D="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",yD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-abs(1.0-dst.rgb-src.rgb),0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",SD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,opacity);}",bD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=2.0*src.rgb*dst.rgb;vec3 b=1.0-2.0*(1.0-src.rgb)*(1.0-dst.rgb);vec3 c=mix(a,b,step(0.5,dst.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",MD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 c=mix(mix(src2,dst.rgb,step(0.5*dst.rgb,src.rgb)),max(src2-1.0,vec3(0.0)),step(dst.rgb,src2-1.0));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",ED="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb*dst.rgb/max(1.0-src.rgb,1e-9),1.0);vec3 c=mix(a,src.rgb,step(1.0,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",TD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.x,b.y,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",wD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-min(dst.rgb*src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",AD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 d=dst.rgb+(src2-1.0);vec3 w=step(0.5,src.rgb);vec3 a=dst.rgb-(1.0-src2)*dst.rgb*(1.0-dst.rgb);vec3 b=mix(d*(sqrt(dst.rgb)-dst.rgb),d*dst.rgb*((16.0*dst.rgb-12.0)*dst.rgb+3.0),w*(1.0-step(0.25,dst.rgb)));vec3 c=mix(a,b,w);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",CD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return src;}",RD="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",ID="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=mix(max(1.0-min((1.0-dst.rgb)/(2.0*src.rgb),1.0),0.0),min(dst.rgb/(2.0*(1.0-src.rgb)),1.0),step(0.5,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",PD=new Map([[Rt.ADD,QL],[Rt.ALPHA,eD],[Rt.AVERAGE,tD],[Rt.COLOR,nD],[Rt.COLOR_BURN,iD],[Rt.COLOR_DODGE,sD],[Rt.DARKEN,rD],[Rt.DIFFERENCE,aD],[Rt.DIVIDE,oD],[Rt.DST,null],[Rt.EXCLUSION,lD],[Rt.HARD_LIGHT,cD],[Rt.HARD_MIX,uD],[Rt.HUE,hD],[Rt.INVERT,fD],[Rt.INVERT_RGB,dD],[Rt.LIGHTEN,pD],[Rt.LINEAR_BURN,mD],[Rt.LINEAR_DODGE,gD],[Rt.LINEAR_LIGHT,vD],[Rt.LUMINOSITY,xD],[Rt.MULTIPLY,_D],[Rt.NEGATION,yD],[Rt.NORMAL,SD],[Rt.OVERLAY,bD],[Rt.PIN_LIGHT,MD],[Rt.REFLECT,ED],[Rt.SATURATION,TD],[Rt.SCREEN,wD],[Rt.SOFT_LIGHT,AD],[Rt.SRC,CD],[Rt.SUBTRACT,RD],[Rt.VIVID_LIGHT,ID]]),LD=class extends Mi{constructor(i,e=1){super(),this._blendFunction=i,this.opacity=new Ut(e)}getOpacity(){return this.opacity.value}setOpacity(i){this.opacity.value=i}get blendFunction(){return this._blendFunction}set blendFunction(i){this._blendFunction=i,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(i){this.blendFunction=i}getShaderCode(){return PD.get(this.blendFunction)}},xf=class extends Mi{constructor(i,e,{attributes:t=Ta.NONE,blendFunction:n=Rt.NORMAL,defines:s=new Map,uniforms:o=new Map,extensions:l
vendor: 10,732 bytes, lines 4159-4197
4159=null,vertexShader:c=null}={}){super(),this.name=i,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=c,this.defines=s,this.uniforms=o,this.extensions=l,this.blendMode=new LD(n),this.blendMode.addEventListener("change",h=>this.setChanged()),this._inputColorSpace=Fr,this._outputColorSpace=cs}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(i){this._inputColorSpace=i,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(i){this._outputColorSpace=i,this.setChanged()}set mainScene(i){}set mainCamera(i){}getName(){return this.name}setRenderer(i){this.renderer=i}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(i){this.attributes=i,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(i){this.fragmentShader=i,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(i){this.vertexShader=i,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(i,e=zr){}update(i,e,t){}setSize(i,e){}initialize(i,e,t){}dispose(){for(const i of Object.keys(this)){const e=this[i];(e instanceof fn||e instanceof Vn||e instanceof un||e instanceof Ti)&&this[i].dispose()}}},kg={MEDIUM:2,LARGE:3},DD=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4160uniform mediump sampler2D inputBuffer; 4161#else 4162uniform lowp sampler2D inputBuffer; 4163#endif 4164varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; 4165#include <colorspace_fragment> 4166}`,ND="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",UD=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],FD=class extends En{constructor(i=new Zt){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new Ut(null),texelSize:new Ut(new Zt),scale:new Ut(1),kernel:new Ut(0)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:DD,vertexShader:ND}),this.setTexelSize(i.x,i.y),this.kernelSize=kg.MEDIUM}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.inputBuffer=i}get kernelSequence(){return UD[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(i){this.uniforms.scale.value=i}getScale(){return this.uniforms.scale.value}setScale(i){this.uniforms.scale.value=i}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(i){this.uniforms.kernel.value=i}setKernel(i){this.kernel=i}setTexelSize(i,e){this.uniforms.texelSize.value.set(i,e,i*.5,e*.5)}setSize(i,e){const t=1/i,n=1/e;this.uniforms.texelSize.value.set(t,n,t*.5,n*.5)}},OD=class extends Ti{constructor({kernelSize:i=kg.MEDIUM,resolutionScale:e=.5,width:t=si.AUTO_SIZE,height:n=si.AUTO_SIZE,resolutionX:s=t,resolutionY:o=n}={}){super("KawaseBlurPass"),this.renderTargetA=new fn(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const l=this.resolution=new si(this,s,o,e);l.addEventListener("change",c=>this.setSize(l.baseWidth,l.baseHeight)),this._blurMaterial=new FD,this._blurMaterial.kernelSize=i,this.copyMaterial=new wb}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(i){this._blurMaterial=i}get dithering(){return this.copyMaterial.dithering}set dithering(i){this.copyMaterial.dithering=i}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(i){this.blurMaterial.kernelSize=i}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get scale(){return this.blurMaterial.scale}set scale(i){this.blurMaterial.scale=i}getScale(){return this.blurMaterial.scale}setScale(i){this.blurMaterial.scale=i}getKernelSize(){return this.kernelSize}setKernelSize(i){this.kernelSize=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}render(i,e,t,n,s){const o=this.scene,l=this.camera,c=this.renderTargetA,h=this.renderTargetB,f=this.blurMaterial,p=f.kernelSequence;let g=e;this.fullscreenMaterial=f;for(let m=0,v=p.length;m<v;++m){const y=(m&1)===0?c:h;f.kernel=p[m],f.inputBuffer=g.texture,i.setRenderTarget(y),i.render(o,l),g=y}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=g.texture,i.setRenderTarget(this.renderToScreen?null:t),i.render(o,l)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e);const n=t.width,s=t.height;this.renderTargetA.setSize(n,s),this.renderTargetB.setSize(n,s),this.blurMaterial.setSize(i,e)}initialize(i,e,t){t!==void 0&&(this.renderTargetA.texture.type=t,this.renderTargetB.texture.type=t,t!==yn?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):i!==null&&i.outputColorSpace===$t&&(this.renderTargetA.texture.colorSpace=$t,this.renderTargetB.texture.colorSpace=$t))}static get AUTO_SIZE(){return si.AUTO_SIZE}},BD=`#include <common> 4167#ifdef FRAMEBUFFER_PRECISION_HIGH 4168uniform mediump sampler2D inputBuffer; 4169#else 4170uniform lowp sampler2D inputBuffer; 4171#endif 4172#ifdef RANGE 4173uniform vec2 range; 4174#elif defined(THRESHOLD) 4175uniform float threshold;uniform float smoothing; 4176#endif 4177varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0; 4178#ifdef RANGE 4179float low=step(range.x,l);float high=step(l,range.y);mask=low*high; 4180#elif defined(THRESHOLD) 4181mask=smoothstep(threshold,threshold+smoothing,l); 4182#endif 4183#ifdef COLOR 4184gl_FragColor=texel*mask; 4185#else 4186gl_FragColor=vec4(l*mask); 4187#endif 4188}`,zD=class extends En{constructor(i=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:Zo.replace(/\D+/g,"")},uniforms:{inputBuffer:new Ut(null),threshold:new Ut(0),smoothing:new Ut(1),range:new Ut(null)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:BD,vertexShader:Tb}),this.colorOutput=i,this.luminanceRange=e}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get threshold(){return this.uniforms.threshold.value}set threshold(i){this.smoothing>0||i>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=i}getThreshold(){return this.threshold}setThreshold(i){this.threshold=i}get smoothing(){return this.uniforms.smoothing.value}set smoothing(i){this.threshold>0||i>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=i}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(i){this.smoothing=i}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(i){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(i){i?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(i){return this.colorOutput}setColorOutputEnabled(i){this.colorOutput=i}get useRange(){return this.luminanceRange!==null}set useRange(i){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(i){i!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=i,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(i){this.luminanceRange=i}},kD=class extends Ti{constructor({renderTarget:i,luminanceRange:e,colorOutput:t,resolutionScale:n=1,width:s=si.AUTO_SIZE,height:o=si.AUTO_SIZE,resolutionX:l=s,resolutionY:c=o}={}){super("LuminancePass"),this.fullscreenMaterial=new zD(t,e),this.needsSwap=!1,this.renderTarget=i,this.renderTarget===void 0&&(this.renderTarget=new fn(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const h=this.resolution=new si(this,l,c,n);h.addEventListener("change",f=>this.setSize(h.baseWidth,h.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(i,e,t,n,s){const o=this.fullscreenMaterial;o.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height)}initialize(i,e,t){t!==void 0&&t!==yn&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},VD=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4189uniform mediump sampler2D inputBuffer; 4190#else 4191uniform lowp sampler2D inputBuffer; 4192#endif 4193#define WEIGHT_INNER 0.125 4194#define WEIGHT_OUTER 0.05556 4195varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; 4196#include <colorspace_fragment> 4197}`,HD="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;
4197vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",GD=class extends En{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new Ut(null),texelSize:new Ut(new ae)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:VD,vertexShader:HD})}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},WD=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4198uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; 4199#else 4200uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; 4201#endif 4202uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); 4203#include <colorspace_fragment> 4204}`,XD="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",qD=class extends En{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new Ut(null),supportBuffer:new Ut(null),texelSize:new Ut(new ae),radius:new Ut(.85)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:WD,vertexShader:XD})}set inputBuffer(i){this.uniforms.inputBuffer.value=i}set supportBuffer(i){this.uniforms.supportBuffer.value=i}get radius(){return this.uniforms.radius.value}set radius(i){this.uniforms.radius.value=i}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},YD=class extends Ti{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new fn(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new GD,this.upsamplingMaterial=new qD,this.resolution=new ae}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(i){if(this.levels!==i){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t<i;++t){const n=e.clone();n.texture.name="Downsampling.Mipmap"+t,this.downsamplingMipmaps.push(n)}this.upsamplingMipmaps.push(e);for(let t=1,n=i-1;t<n;++t){const s=e.clone();s.texture.name="Upsampling.Mipmap"+t,this.upsamplingMipmaps.push(s)}this.setSize(this.resolution.x,this.resolution.y)}}get radius(){return this.upsamplingMaterial.radius}set radius(i){this.upsamplingMaterial.radius=i}render(i,e,t,n,s){const{scene:o,camera:l}=this,{downsamplingMaterial:c,upsamplingMaterial:h}=this,{downsamplingMipmaps:f,upsamplingMipmaps:p}=this;let g=e;this.fullscreenMaterial=c;for(let m=0,v=f.length;m<v;++m){const y=f[m];c.setSize(g.width,g.height),c.inputBuffer=g.texture,i.setRenderTarget(y),i.render(o,l),g=y}this.fullscreenMaterial=h;for(let m=p.length-1;m>=0;--m){const v=p[m];h.setSize(g.width,g.height),h.inputBuffer=g.texture,h.supportBuffer=f[m].texture,i.setRenderTarget(v),i.render(o,l),g=v}}
4204setSize(i,e){const t=this.resolution;t.set(i,e);let n=t.width,s=t.height;for(let o=0,l=this.downsamplingMipmaps.length;o<l;++o)n=Math.round(n*.5),s=Math.round(s*.5),this.downsamplingMipmaps[o].setSize(n,s),o<this.upsamplingMipmaps.length&&this.upsamplingMipmaps[o].setSize(n,s)}initialize(i,e,t){if(t!==void 0){const n=this.downsamplingMipmaps.concat(this.upsamplingMipmaps);for(const s of n)s.texture.type=t;if(t!==yn)this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1";else if(i!==null&&i.outputColorSpace===$t)for(const s of n)s.texture.colorSpace=$t}}dispose(){super.dispose();for(const i of this.downsamplingMipmaps.concat(this.upsamplingMipmaps))i.dispose()}},jD=`#ifdef FRAMEBUFFER_PRECISION_HIGH 4205uniform mediump sampler2D map; 4206#else 4207uniform lowp sampler2D map; 4208#endif 4209uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,$D=class extends xf{constructor({blendFunction:i=Rt.SCREEN,luminanceThreshold:e=1,luminanceSmoothing:t=.03,mipmapBlur:n=!0,intensity:s=1,radius:o=.85,levels:l=8,kernelSize:c=kg.LARGE,resolutionScale:h=.5,width:f=si.AUTO_SIZE,height:p=si.AUTO_SIZE,resolutionX:g=f,resolutionY:m=p}={}){super("BloomEffect",jD,{blendFunction:i,uniforms:new Map([["map",new Ut(null)],["intensity",new Ut(s)]])}),this.renderTarget=new fn(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new OD({kernelSize:c}),this.luminancePass=new kD({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new YD,this.mipmapBlurPass.enabled=n,this.mipmapBlurPass.radius=o,this.mipmapBlurPass.levels=l,this.uniforms.get("map").value=n?this.mipmapBlurPass.texture:this.renderTarget.texture;const v=this.resolution=new si(this,g,m,h);v.addEventListener("change",y=>this.setSize(v.baseWidth,v.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get dithering(){return this.blurPass.dithering}set dithering(i){this.blurPass.dithering=i}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(i){this.blurPass.kernelSize=i}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(i){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(i){this.uniforms.get("intensity").value=i}getIntensity(){return this.intensity}setIntensity(i){this.intensity=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}update(i,e,t){const n=this.renderTarget,s=this.luminancePass;s.enabled?(s.render(i,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(i,s.renderTarget):this.blurPass.render(i,s.renderTarget,n)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(i,e):this.blurPass.render(i,e,n)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(i,e),this.mipmapBlurPass.setSize(i,e)}initialize(i,e,t){this.blurPass.initialize(i,e,t),this.luminancePass.initialize(i,e,t),this.mipmapBlurPass.initialize(i,e,t),t!==void 0&&(this.renderTarget.texture.type=t,i!==null&&i.outputColorSpace===$t&&(this.renderTarget.texture.colorSpace=$t))}},Cb=class extends Ti{constructor(i,e,t=null){super("RenderPass",i,e),this.needsSwap=!1,this.needsDepthBlit=!0,this.clearPass=new Ab,this.overrideMaterialManager=t===null?null:new ry(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(i){this.scene=i}set mainCamera(i){this.camera=i}get renderToScreen(){return super.renderToScreen}set renderToScreen(i){super.renderToScreen=i,this.clearPass.renderToScreen=i}get overrideMaterial(){const i=this.overrideMaterialManager;return i!==null?i.material:null}set overrideMaterial(i){const e=this.overrideMaterialManager;i!==null?e!==null?e.setMaterial(i):this.overrideMaterialManager=new ry(i):e!==null&&(e.dis
4209pose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(i){this.overrideMaterial=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getSelection(){return this.selection}setSelection(i){this.selection=i}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(i){this.ignoreBackground=i}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(i){this.skipShadowMapUpdate=i}getClearPass(){return this.clearPass}render(i,e,t,n,s){const o=this.scene,l=this.camera,c=this.selection,h=l.layers.mask,f=o.background,p=i.shadowMap.autoUpdate,g=this.renderToScreen?null:e;c!==null&&l.layers.set(c.getLayer()),this.skipShadowMapUpdate&&(i.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(o.background=null),this.clearPass.enabled&&this.clearPass.render(i,e),i.setRenderTarget(g),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(i,o,l):i.render(o,l),l.layers.mask=h,o.background=f,i.shadowMap.autoUpdate=p}},ZD=`uniform float count; 4210#ifdef SCROLL 4211uniform float scrollSpeed; 4212#endif 4213void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){float y=uv.y; 4214#ifdef SCROLL 4215y+=time*scrollSpeed; 4216#endif 4217vec2 sl=vec2(sin(y*count),cos(y*count));outputColor=vec4(sl.xyx,inputColor.a);}`,KD=class extends xf{constructor({blendFunction:i=Rt.OVERLAY,density:e=1.25,scrollSpeed:t=0}={}){super("ScanlineEffect",ZD,{blendFunction:i,uniforms:new Map([["count",new Ut(0)],["scrollSpeed",new Ut(0)]])}),this.resolution=new ae,this.d=e,this.scrollSpeed=t}get density(){return this.d}set density(i){this.d=i,this.setSize(this.resolution.width,this.resolution.height)}getDensity(){return this.density}setDensity(i){this.density=i}get scrollSpeed(){return this.uniforms.get("scrollSpeed").value}set scrollSpeed(i){this.uniforms.get("scrollSpeed").value=i,i===0?this.defines.delete("SCROLL")&&this.setChanged():this.defines.has("SCROLL")||(this.defines.set("SCROLL","1"),this.setChanged())}setSize(i,e){this.resolution.set(i,e),this.uniforms.get("count").value=Math.round(e*this.density)}},JD=`#include <packing> 4218#ifdef GL_FRAGMENT_PRECISION_HIGH 4219uniform highp sampler2D depthBuffer; 4220#else 4221uniform mediump sampler2D depthBuffer; 4222#endif 4223#ifdef DOWNSAMPLE_NORMALS 4224uniform lowp sampler2D normalBuffer; 4225#endif 4226varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){ 4227#if DEPTH_PACKING == 3201 4228return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 4229#else 4230return texture2D(depthBuffer,uv).r; 4231#endif 4232}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]<maxDistance){remaining[j++]=i;}else{rejected[k++]=i;}}for(;j<3;++j){remaining[j]=rejected[--k];}vec3 s=vec3(samples[remaining[0]],samples[remaining[1]],samples[remaining[2]]);c=(s.x+s.y+s.z)/3.0;distances[0]=abs(c-s.x);distances[1]=abs(c-s.y);distances[2]=abs(c-s.z);float minDistance=min(distances[0],min(distances[1],distances[2]));for(i=0;i<3;++i){if(distances[i]==minDistance){break;}}return remaining[i];}void main(){float d[4];d[0]=readDepth(vUv0);d[1]=readDepth(vUv1);d[2]=readDepth(vUv2);d[3]=readDepth(vUv3);int index=findBestDepth(d); 4233#ifdef DOWNSAMPLE_NORMALS 4234vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1).rgb;n[2]=texture2D(normalBuffer,vUv2).rgb;n[3]=texture2D(normalBuffer,vUv3).rgb; 4235#else 4236vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0); 4237#endif 4238gl_FragColor=vec4(n[index],d[index]);}`,QD="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}
4238",eN=class extends En{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new Ut(null),normalBuffer:new Ut(null),texelSize:new Ut(new ae)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:JD,vertexShader:QD})}set depthBuffer(i){this.uniforms.depthBuffer.value=i}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=zr){this.depthBuffer=i,this.depthPacking=e}set normalBuffer(i){this.uniforms.normalBuffer.value=i,i!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(i){this.normalBuffer=i}setTexelSize(i,e){this.uniforms.texelSize.value.set(i,e)}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},tN=class extends Ti{constructor({normalBuffer:i=null,resolutionScale:e=.5,width:t=si.AUTO_SIZE,height:n=si.AUTO_SIZE,resolutionX:s=t,resolutionY:o=n}={}){super("DepthDownsamplingPass");const l=new eN;l.normalBuffer=i,this.fullscreenMaterial=l,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new fn(1,1,{minFilter:cn,magFilter:cn,depthBuffer:!1,type:Yn}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const c=this.resolution=new si(this,s,o,e);c.addEventListener("change",h=>this.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(i,e=zr){this.fullscreenMaterial.depthBuffer=i,this.fullscreenMaterial.depthPacking=e}render(i,e,t,n,s){i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(i,e)}initialize(i,e,t){const n=i.getContext();if(!(n.getExtension("EXT_color_buffer_float")||n.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},nN=`#include <common> 4239#include <packing> 4240#include <dithering_pars_fragment> 4241#define packFloatToRGBA(v) packDepthToRGBA(v) 4242#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) 4243#ifdef FRAMEBUFFER_PRECISION_HIGH 4244uniform mediump sampler2D inputBuffer; 4245#else 4246uniform lowp sampler2D inputBuffer; 4247#endif 4248#if DEPTH_PACKING == 3201 4249uniform lowp sampler2D depthBuffer; 4250#elif defined(GL_FRAGMENT_PRECISION_HIGH) 4251uniform highp sampler2D depthBuffer; 4252#else 4253uniform mediump sampler2D depthBuffer; 4254#endif 4255uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){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.a);}float readDepth(const in vec2 uv){ 4256#if DEPTH_PACKING == 3201 4257float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv)); 4258#else 4259float depth=texture2D(depthBuffer,uv).r; 4260#endif 4261#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH) 4262float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d; 4263#elif defined(USE_REVERSED_DEPTH_BUFFER) 4264depth=1.0-depth; 4265#endif 4266return depth;}float getViewZ(const in float depth){ 4267#ifdef PERSPECTIVE_CAMERA 4268return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); 4269#else 4270return orthographicDepthToViewZ(depth,cameraNear,cameraFar); 4271#endif 4272}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0; 4273#ifdef ENCODE_OUTPUT 4274#include <colorspace_fragment> 4275#endif 4276#include <dithering_fragment> 4277}`,iN="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}
4277",sN=class extends En{constructor(i,e,t,n,s=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:Zo.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new Ut(null),depthBuffer:new Ut(null),resolution:new Ut(new ae),texelSize:new Ut(new ae),cameraNear:new Ut(.3),cameraFar:new Ut(1e3),aspect:new Ut(1),time:new Ut(0)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:s}),i&&this.setShaderParts(i),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(n)}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(i){this.uniforms.depthBuffer.value=i}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=zr){this.depthBuffer=i,this.depthPacking=e}setShaderData(i){this.setShaderParts(i.shaderParts),this.setDefines(i.defines),this.setUniforms(i.uniforms),this.setExtensions(i.extensions)}setShaderParts(i){return this.fragmentShader=nN.replace(jt.FRAGMENT_HEAD,i.get(jt.FRAGMENT_HEAD)||"").replace(jt.FRAGMENT_MAIN_UV,i.get(jt.FRAGMENT_MAIN_UV)||"").replace(jt.FRAGMENT_MAIN_IMAGE,i.get(jt.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=iN.replace(jt.VERTEX_HEAD,i.get(jt.VERTEX_HEAD)||"").replace(jt.VERTEX_MAIN_SUPPORT,i.get(jt.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(i){for(const e of i.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(i){for(const e of i.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(i){this.extensions={};for(const e of i)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(i){this.encodeOutput!==i&&(i?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(i){return this.encodeOutput}setOutputEncodingEnabled(i){this.encodeOutput=i}get time(){return this.uniforms.time.value}set time(i){this.uniforms.time.value=i}setDeltaTime(i){this.uniforms.time.value+=i}adoptCameraSettings(i){this.copyCameraSettings(i)}copyCameraSettings(i){i&&(this.uniforms.cameraNear.value=i.near,this.uniforms.cameraFar.value=i.far,i instanceof Dn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(i,e){const t=this.uniforms;t.resolution.value.set(i,e),t.texelSize.value.set(1/i,1/e),t.aspect.value=i/e}static get Section(){return jt}};function ay(i,e,t){for(const n of e){const s="$1"+i+n.charAt(0).toUpperCase()+n.slice(1),o=new RegExp("([^\\.])(\\b"+n+"\\b)","g");for(const l of t.entries())l[1]!==null&&t.set(l[0],l[1].replace(o,s))}}function rN(i,e,t){let n=e.getFragmentShader(),s=e.getVertexShader();const o=n!==void 0&&/mainImage/.test(n),l=n!==void 0&&/mainUv/.test(n);if(t.attributes|=e.getAttributes(),n===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(l&&(t.attributes&Ta.CONVOLUTION)!==0)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!o&&!l)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const c=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,h=t.shaderParts;let f=h.get(jt.FRAGMENT_HEAD)||"",p=h.get(jt.FRAGMENT_MAIN_UV)||"",g=h.get(jt.FRAGMENT_MAIN_IMAGE)||"",m=h.get(jt.VERTEX_HEAD)||"",v=h.get(jt.VERTEX_MAIN_SUPPORT)||"";const y=new Set,E=new Set;if(l&&(p+=` ${i}MainUv(UV); 4278`,t.uvTransformation=!0),s!==null&&/mainSupport/.test(s)){const M=/mainSupport *\([\w\s]*?uv\s*?\)/.test(s);v+=` ${i}MainSupport(`,v+=M?`vUv); 4279`:`); 4280`;for(const T of s.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const A of T[1].split(/\s*,\s*/))t.varyings.add(A),y.add(A),E.add(A);for(const T of s.matchAll(c))E.add(T[1])}for(const M of n.matchAll(c))E.add(M[1]);for(const M of e.defines.keys())E.add(M.replace(/\([\w\s,]*\)/g,""));for(const M of e.uniforms.keys())E.add(M);E.delete("while"),E.delete("for"),E.delete("if"),e.uniforms.forEac
4280h((M,T)=>t.uniforms.set(i+T.charAt(0).toUpperCase()+T.slice(1),M)),e.defines.forEach((M,T)=>t.defines.set(i+T.charAt(0).toUpperCase()+T.slice(1),M));const S=new Map([["fragment",n],["vertex",s]]);ay(i,E,t.defines),ay(i,E,S),n=S.get("fragment"),s=S.get("vertex");const _=e.blendMode;if(t.blendModes.set(_.blendFunction,_),o){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(g+=e.inputColorSpace===$t?`color0 = sRGBTransferOETF(color0); 4281 `:`color0 = sRGBToLinear(color0); 4282 `),e.outputColorSpace!==cs?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const M=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;g+=`${i}MainImage(color0, UV, `,(t.attributes&Ta.DEPTH)!==0&&M.test(n)&&(g+="depth, ",t.readDepth=!0),g+=`color1); 4283 `;const T=i+"BlendOpacity";t.uniforms.set(T,_.opacity),g+=`color0 = blend${_.blendFunction}(color0, color1, ${T}); 4284 4285 `,f+=`uniform float ${T}; 4286 4287`}if(f+=n+` 4288`,s!==null&&(m+=s+` 4289`),h.set(jt.FRAGMENT_HEAD,f),h.set(jt.FRAGMENT_MAIN_UV,p),h.set(jt.FRAGMENT_MAIN_IMAGE,g),h.set(jt.VERTEX_HEAD,m),h.set(jt.VERTEX_MAIN_SUPPORT,v),e.extensions!==null)for(const M of e.extensions)t.extensions.add(M)}}var aN=class extends Ti{constructor(i,...e){super("EffectPass"),this.fullscreenMaterial=new sN(null,null,null,i),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(i){for(const e of this.effects)e.mainScene=i}set mainCamera(i){this.fullscreenMaterial.copyCameraSettings(i);for(const e of this.effects)e.mainCamera=i}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(i){this.fullscreenMaterial.encodeOutput=i}get dithering(){return this.fullscreenMaterial.dithering}set dithering(i){const e=this.fullscreenMaterial;e.dithering=i,e.needsUpdate=!0}setEffects(i){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=i.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const i=new JL;let e=0;for(const l of this.effects)if(l.blendMode.blendFunction===Rt.DST)i.attributes|=l.getAttributes()&Ta.DEPTH;else{if((i.attributes&l.getAttributes()&Ta.CONVOLUTION)!==0)throw new Error(`Convolution effects cannot be merged (${l.name})`);rN("e"+e++,l,i)}let t=i.shaderParts.get(jt.FRAGMENT_HEAD),n=i.shaderParts.get(jt.FRAGMENT_MAIN_IMAGE),s=i.shaderParts.get(jt.FRAGMENT_MAIN_UV);const o=/\bblend\b/g;for(const l of i.blendModes.values())t+=l.getShaderCode().replace(o,`blend${l.blendFunction}`)+` 4290`;(i.attributes&Ta.DEPTH)!==0?(i.readDepth&&(n=`float depth = readDepth(UV); 4291 4292 `+n),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,i.colorSpace
4292===$t&&(n+=`color0 = sRGBToLinear(color0); 4293 `),i.uvTransformation?(s=`vec2 transformedUv = vUv; 4294`+s,i.defines.set("UV","transformedUv")):i.defines.set("UV","vUv"),i.shaderParts.set(jt.FRAGMENT_HEAD,t),i.shaderParts.set(jt.FRAGMENT_MAIN_IMAGE,n),i.shaderParts.set(jt.FRAGMENT_MAIN_UV,s);for(const[l,c]of i.shaderParts)c!==null&&i.shaderParts.set(l,c.trim().replace(/^#/,` 4295#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(i)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(i,e=zr){this.fullscreenMaterial.depthBuffer=i,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(i,e)}render(i,e,t,n,s){for(const o of this.effects)o.update(i,e,n);if(!this.skipRendering||this.renderToScreen){const o=this.fullscreenMaterial;o.inputBuffer=e.texture,o.time+=n*this.timeScale,i.setRenderTarget(this.renderToScreen?null:t),i.render(this.scene,this.camera)}}setSize(i,e){this.fullscreenMaterial.setSize(i,e);for(const t of this.effects)t.setSize(i,e)}initialize(i,e,t){this.renderer=i;for(const n of this.effects)n.initialize(i,e,t);this.updateMaterial(),t!==void 0&&t!==yn&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const i of this.effects)i.removeEventListener("change",this.listener),i.dispose()}handleEvent(i){i.type==="change"&&this.recompile()}},oN=class extends Ti{constructor(i,e,{renderTarget:t,resolutionScale:n=1,width:s=si.AUTO_SIZE,height:o=si.AUTO_SIZE,resolutionX:l=s,resolutionY:c=o}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new Cb(i,e,new bg);const h=this.renderPass;h.ignoreBackground=!0,h.skipShadowMapUpdate=!0;const f=h.getClearPass();f.overrideClearColor=new Ve(7829503),f.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new fn(1,1,{minFilter:cn,magFilter:cn}),this.renderTarget.texture.name="NormalPass.Target");const p=this.resolution=new si(this,l,c,n);p.addEventListener("change",g=>this.setSize(p.baseWidth,p.baseHeight))}set mainScene(i){this.renderPass.mainScene=i}set mainCamera(i){this.renderPass.mainCamera=i}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}render(i,e,t,n,s){const o=this.renderToScreen?null:this.renderTarget;this.renderPass.render(i,o,o)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height)}};function lc(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Rb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Yi=function i(e,t,n){var s=this;Rb(this,i),lc(this,"dot2",function(o,l){return s.x*o+s.y*l}),lc(this,"dot3",function(o,l,c){return s.x*o+s.y*l+s.z*c}),this.x=e,this.y=t,this.z=n},lN=[new Yi(1,1,0),new Yi(-1,1,0),new Yi(1,-1,0),new Yi(-1,-1,0),new Yi(1,0,1),new Yi(-1,0,1),new Yi(1,0,-1),new Yi(-1,0,-1),new Yi(0,1,1),new Yi(0,-1,1),new Yi(0,1,-1),new Yi(0,-1,-1)],oy=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],ly=new Array(512),
4295cy=new Array(512),cN=function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var n;t&1?n=oy[t]^e&255:n=oy[t]^e>>8&255,ly[t]=ly[t+256]=n,cy[t]=cy[t+256]=lN[n%12]}};cN(0);function uN(i){if(typeof i=="number")i=Math.abs(i);else if(typeof i=="string"){var e=i;i=0;for(var t=0;t<e.length;t++)i=(i+(t+1)*(e.charCodeAt(t)%96))%2147483647}return i===0&&(i=311),i}function uy(i){var e=uN(i);return function(){var t=e*48271%2147483647;return e=t,t/2147483647}}var hN=function i(e){var t=this;Rb(this,i),lc(this,"seed",0),lc(this,"init",function(n){t.seed=n,t.value=uy(n)}),lc(this,"value",uy(this.seed)),this.init(e)};new hN(Math.random());const fN=Ze.createContext(null),hy=i=>(i.getAttributes()&2)===2,dN=Ze.memo(Ze.forwardRef(({children:i,camera:e,scene:t,resolutionScale:n,enabled:s=!0,renderPriority:o=1,autoClear:l=!0,depthBuffer:c,enableNormalPass:h,stencilBuffer:f,multisampling:p=8,frameBufferType:g=fs},m)=>{const{gl:v,scene:y,camera:E,size:S}=Bg(),_=t||y,M=e||E,[T,A,D]=Ze.useMemo(()=>{const w=new KL(v,{depthBuffer:c,stencilBuffer:f,multisampling:p,frameBufferType:g});w.addPass(new Cb(_,M));let L=null,U=null;return h&&(U=new oN(_,M),U.enabled=!1,w.addPass(U),n!==void 0&&(L=new tN({normalBuffer:U.texture,resolutionScale:n}),L.enabled=!1,w.addPass(L))),[w,U,L]},[M,v,c,f,p,g,_,h,n]);Ze.useEffect(()=>T?.setSize(S.width,S.height),[T,S]),sl((w,L)=>{if(s){const U=v.autoClear;v.autoClear=l,f&&!l&&v.clearStencil(),T.render(L),v.autoClear=U}},s?o:0);const R=Ze.useRef(null);Ze.useLayoutEffect(()=>{const w=[],L=R.current.__r3f;if(L&&T){const U=L.children;for(let O=0;O<U.length;O++){const H=U[O].object;if(H instanceof xf){const W=[H];if(!hy(H)){let V=null;for(;(V=U[O+1]?.object)instanceof xf&&!hy(V);)W.push(V),O++}const Z=new aN(M,...W);w.push(Z)}else H instanceof Ti&&w.push(H)}for(const O of w)T?.addPass(O);A&&(A.enabled=!0),D&&(D.enabled=!0)}return()=>{for(const U of w)T?.removePass(U);A&&(A.enabled=!1),D&&(D.enabled=!1)}},[T,i,M,A,D]),Ze.useEffect(()=>{const w=v.toneMapping;return v.toneMapping=zi,()=>{v.toneMapping=w}},[v]);const F=Ze.useMemo(()=>({composer:T,normalPass:A,downSamplingPass:D,resolutionScale:n,camera:M,scene:_}),[T,A,D,n,M,_]);return Ze.useImperativeHandle(m,()=>T,[T]),Ge.jsx(fN.Provider,{value:F,children:Ge.jsx("group",{ref:R,children:i})})}));let pN=0;const fy=new WeakMap,Ib=(i,e)=>function({blendFunction:t=e?.blendFunction,opacity:n=e?.opacity,...s}){let o=fy.get(i);if(!o){const h=`@react-three/postprocessing/${i.name}-${pN++}`;xb({[h]:i}),fy.set(i,o=h)}const l=Bg(h=>h.camera),c=Xm.useMemo(()=>[...e?.args??[],...s.args??[{...e,...s}]],[JSON.stringify(s)]);return Ge.jsx(o,{camera:l,"blendMode-blendFunction":t,"blendMode-opacity-value":n,...s,args:c})},mN=Ib($D,{blendFunction:0}),gN=Ib(KD,{blendFunction:24,density:1.25});function vN({count:i=2500}){const e=Ze.useRef(null),t=Ze.useMemo(()=>{const n=new Float32Array(i*3);for(let s=0;s<i;s++)n[s*3]=(Math.random()-.5)*120,n[s*3+1]=(Math.random()-.5)*80,n[s*3+2]=(Math.random()-.5)*120;return n},[i]);return sl((n,s)=>{if(!e.current)return;const{mouseX:o,mouseY:l,reducedMotion:c}=cc.getState();c||(e.current.rotation.y+=s*.01,e.current.position.x=Js.lerp(e.current.position.x,o*1.2,.04),e.current.position.y=Js.lerp(e.current.position.y,-l*.8,.04))}),Ge.jsxs("points",{ref:e,children:[Ge.jsx("bufferGeometry",{children:Ge.jsx("bufferAttribute",{attach:"attributes-position",args:[t,3],count:i})}),Ge.jsx("pointsMaterial",{size:.06,color:"#ffffff",transparent:!0,opacity:.7,sizeAttenuation:!0,depthWrite:!1,blending:Ho})]})}function xN({visible:i=1}){const e=Ze.useRef(null),t=Ze.useRef(null),n=Ze.useMemo(()=>[1.1,1.55,2,2.5,3.05,3.65,4.3,5],[]),s=Ze.useMemo(()=>{const o=[];return n.forEach((l,c)=>{for(let f=0;f<24;f++)o.push({r:l,a:f/24*Math.PI*2,len:c%2===0?.08:.05})}),o},[n]);return sl((o,l)=>{e.current&&(e.current.rotation.z+=l*.04),t.current&&(t.current.rotation.z-=l*.06)}),i<=.001?null:Ge.jsxs("group",{ref:e,scale:i,children:[n.map((o,l)=>Ge.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[Ge.jsx("ringGeometry",{args:[o-.004,o+.004,256]}),Ge.jsx("meshBasicMaterial",{color:"#ffffff",transparent:!0,opacity:.18+l%2*.06,side:ni,depthWrite:!1})]},`r${l}`)),s.map((o,l)=>{const c=Math.cos(o.a)*o.r,h=Math.sin(o.a)*o.r;
4295return Ge.jsxs("mesh",{position:[c,h,0],rotation:[0,0,o.a],children:[Ge.jsx("planeGeometry",{args:[o.len,.012]}),Ge.jsx("meshBasicMaterial",{color:"#ffffff",transparent:!0,opacity:.35,depthWrite:!1})]},`t${l}`)}),Ge.jsxs("mesh",{children:[Ge.jsx("circleGeometry",{args:[.09,64]}),Ge.jsx("meshBasicMaterial",{color:"#ffffff"})]}),Ge.jsxs("mesh",{children:[Ge.jsx("ringGeometry",{args:[.14,.16,64]}),Ge.jsx("meshBasicMaterial",{color:"#ffffff",transparent:!0,opacity:.5})]}),[0,Math.PI/2].map((o,l)=>Ge.jsxs("mesh",{rotation:[0,0,o],children:[Ge.jsx("planeGeometry",{args:[12,.004]}),Ge.jsx("meshBasicMaterial",{color:"#ffffff",transparent:!0,opacity:.08,depthWrite:!1})]},`c${l}`)),Ge.jsx("group",{ref:t,children:n.map((o,l)=>{const c=l*.7+l*.31;return Ge.jsxs("mesh",{position:[Math.cos(c)*o,Math.sin(c)*o,0],children:[Ge.jsx("circleGeometry",{args:[.045+l%3*.01,32]}),Ge.jsx("meshBasicMaterial",{color:"#ffffff"})]},`p${l}`)})})]})}function _N({visible:i=1,count:e=2e3}){const t=Ze.useRef(null),n=Ze.useMemo(()=>{const o=new Float32Array(e*3),l=1.4,c=14,h=40;for(let f=0;f<e;f++){const p=f/e,g=p*Math.PI*2*c;o[f*3]=Math.cos(g)*l,o[f*3+1]=Math.sin(g)*l,o[f*3+2]=-h/2+p*h}return o},[e]),s=Ze.useMemo(()=>{const o=[];for(let h=0;h<=600;h++){const f=h/600,p=-40/2+f*40,g=Math.sin(f*Math.PI*18)*.5+Math.sin(f*Math.PI*4)*.2,m=Math.cos(f*Math.PI*6)*.2;o.push(new B(m,g,p))}return new gt().setFromPoints(o)},[]);return sl((o,l)=>{t.current&&(t.current.rotation.z+=l*.05)}),i<=.001?null:Ge.jsxs("group",{ref:t,children:[Ge.jsxs("points",{children:[Ge.jsx("bufferGeometry",{children:Ge.jsx("bufferAttribute",{attach:"attributes-position",args:[n,3],count:e})}),Ge.jsx("pointsMaterial",{size:.05,color:"#ffffff",transparent:!0,opacity:.85*i,sizeAttenuation:!0,depthWrite:!1,blending:Ho})]}),Ge.jsx("primitive",{object:new ir(s,new ai({color:"#ffffff",transparent:!0,opacity:.6*i}))}),Ge.jsxs("mesh",{rotation:[0,Math.PI/2,0],position:[0,0,0],children:[Ge.jsx("cylinderGeometry",{args:[.005,.005,40,8]}),Ge.jsx("meshBasicMaterial",{color:"#ffffff",transparent:!0,opacity:.15*i})]})]})}function yN({visible:i=1,count:e=6e3}){const t=Ze.useRef(null),n=Ze.useMemo(()=>{const s=new Float32Array(e*3),o=4;for(let l=0;l<e;l++){const c=Math.random(),h=Math.pow(c,.6)*14,p=l%o/o*Math.PI*2+h*.35+(Math.random()-.5)*.4,g=(1-c)*.6;s[l*3]=Math.cos(p)*h+(Math.random()-.5)*g,s[l*3+1]=Math.sin(p)*h+(Math.random()-.5)*g,s[l*3+2]=(Math.random()-.5)*g*.8}return s},[e]);return sl((s,o)=>{t.current&&(t.current.rotation.z+=o*.02)}),i<=.001?null:Ge.jsxs("points",{ref:t,children:[Ge.jsx("bufferGeometry",{children:Ge.jsx("bufferAttribute",{attach:"attributes-position",args:[n,3],count:e})}),Ge.jsx("pointsMaterial",{size:.05,color:"#ffffff",transparent:!0,opacity:.8*i,sizeAttenuation:!0,depthWrite:!1,blending:Ho})]})}function SN({visible:i=1}){return i<=.001?null:Ge.jsx("group",{position:[0,-3.2,-2],rotation:[-Math.PI/2.4,0,0],children:Ge.jsx("gridHelper",{args:[60,40,"#ffffff","#ffffff"],children:Ge.jsx("meshBasicMaterial",{attach:"material",color:"#ffffff",transparent:!0,opacity:.12*i,depthWrite:!1,side:ni})})})}const xm=[{pos:[0,0,9],look:[0,0,0]},{pos:[0,0,16],look:[0,0,0]},{pos:[0,0,-18],look:[0,0,0]},{pos:[0,0,12],look:[0,0,0]},{pos:[0,0,30],look:[0,0,0]}];function bN(i,e,t){return{pos:[Js.lerp(i.pos[0],e.pos[0],t),Js.lerp(i.pos[1],e.pos[1],t),Js.lerp(i.pos[2],e.pos[2],t)],look:[Js.lerp(i.look[0],e.look[0],t),Js.lerp(i.look[1],e.look[1],t),Js.lerp(i.look[2],e.look[2],t)]}}function MN(){const{camera:i}=Bg(),e=new B;return sl(()=>{const t=cc.getState().phase,n=Math.max(0,Math.min(4,t)),s=Math.floor(n),o=n-s,l=xm[s],c=xm[Math.min(s+1,xm.length-1)],h=bN(l,c,o);i.position.lerp(new B(...h.pos),.08),e.set(...h.look),i.lookAt(e)}),null}function Xl(i,e,t){const n=Math.max(0,Math.min(1,(t-i)/(e-i)));return n*n*(3-2*n)}function EN(){const i=cc(l=>l.phase),e=1-Xl(1.2,2,i),t=Xl(1.6,2.3,i)*(1-Xl(3.4,3.9,i)),n=Xl(3.3,4,i),s=1-Xl(1.4,2,i),o=typeof window<"u"&&window.innerWidth<768;return Ge.jsxs(Ge.Fragment,{children:[Ge.jsx(vN,{count:o?800:2400}),Ge.jsx(SN,{visible:s}),Ge.jsx(xN,{visible:e}),Ge.jsx(_N,{visible:t,count:o?700:2e3}),Ge.jsx(yN,{visible:n,count:o?2500:6e3}),Ge.jsx(MN,{})]})}function NN(){const i=cc(t=>t.setMouse),e=cc(t=>t.setReducedMotion);return Ze.useEffect(()=>{const t=window.matchMedia("(prefers-reduced-motion: reduce)");e(t.matches);const n=o=>e(o.matches);t.addEventListener("change",n);const s=o=>{i(o.clientX/window.innerWidth*2-1,o.clientY/window.innerHeight*2-1)};return window.addEventListener("mousemove",s),()=>{t.removeEventListener("change",n),window.removeEventListener("mousemove",s)}},[i,e]),Ge.jsx("div",{className:"fixed inset-0 z-0","aria-hidden":!0,
4295children:Ge.jsxs(GL,{dpr:[1,2],camera:{position:[0,0,9],fov:45,near:.1,far:200},gl:{antialias:!0,alpha:!1},style:{background:"#050506"},children:[Ge.jsx(EN,{}),Ge.jsxs(dN,{children:[Ge.jsx(mN,{intensity:.6,luminanceThreshold:.2,luminanceSmoothing:.9,mipmapBlur:!0}),Ge.jsx(gN,{blendFunction:Rt.OVERLAY,density:1.25,opacity:.05})]})]})})}export{NN as CosmicCanvas};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.