ss-component-new 1.1.581 → 1.1.582

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{index-CzHr8Wxp.js → index-BGm_2lDp.js} +1 -1
  2. package/dist/{index-CdOR6bJ0.cjs → index-BXXZLXmq.cjs} +1 -1
  3. package/dist/{index-Kaw3dB5O.js → index-BnakvLDW.js} +1 -1
  4. package/dist/{index-Cfd2uvIi.js → index-Byzjpndr.js} +4 -4
  5. package/dist/{index-D5lTkEku.cjs → index-BznkyiWy.cjs} +1 -1
  6. package/dist/{index-CGoU7h62.cjs → index-C8d0TCZX.cjs} +1 -1
  7. package/dist/{index-CJOKt1Of.js → index-C9dfEbQn.js} +1 -1
  8. package/dist/{index-D66sRE1P.cjs → index-CD4HxC7I.cjs} +1 -1
  9. package/dist/{index-DgApvpAx.cjs → index-CEHPpDvu.cjs} +1 -1
  10. package/dist/{index-BBJKGS3T.cjs → index-CLfX6Z--.cjs} +1 -1
  11. package/dist/{index-ik417mzy.cjs → index-CefvyHmF.cjs} +1 -1
  12. package/dist/{index-TOdQav2U.cjs → index-CiKTyalX.cjs} +8 -8
  13. package/dist/{index-BrJJDHk6.js → index-Cnp8NK_8.js} +2 -2
  14. package/dist/{index-DRKYPgg-.js → index-Cvdr_MqI.js} +1 -1
  15. package/dist/{index-ChYz6p0-.js → index-CvujLuu3.js} +1 -1
  16. package/dist/{index-C3d5yEDN.js → index-D4zx_CvQ.js} +816 -815
  17. package/dist/{index-ylk_HjGS.js → index-DKbkumL4.js} +1 -1
  18. package/dist/{index-D3xclGak.js → index-DPZhPeXk.js} +7 -7
  19. package/dist/{index-WpyCz4Mu.js → index-DeLz5zdN.js} +1 -1
  20. package/dist/{index-NG4hrzB7.cjs → index-DmwZn6Ss.cjs} +1 -1
  21. package/dist/{index-B_0L3kdg.cjs → index-DnZP35D7.cjs} +1 -1
  22. package/dist/{index-sqhFR4PR.js → index-Dz521Un4.js} +1 -1
  23. package/dist/{index-BUmfToiF.cjs → index-XCkHhQ_P.cjs} +1 -1
  24. package/dist/{index-CvSbx8Cs.js → index-XPrJ0nMG.js} +1 -1
  25. package/dist/{index-DDhc8LK6.cjs → index-cUzq_2qp.cjs} +1 -1
  26. package/dist/{index-Cr20TS_2.cjs → index-sMocm-V6.cjs} +1 -1
  27. package/dist/{index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-BGVvpUJH.cjs → index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-9P4JiWTG.cjs} +1 -1
  28. package/dist/{index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-LcAjKHdK.js → index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-DQLrAz4O.js} +1 -1
  29. package/dist/{index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-BRH-8bgc.js → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-B_pQ1VAc.js} +4 -4
  30. package/dist/{index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-CYHF6wRp.cjs → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-C8ielNau.cjs} +1 -1
  31. package/dist/{main-7uR7EXg3.js → main-CBx8a0Aw.js} +2 -2
  32. package/dist/{main-D0BRjhai.cjs → main-CkyZEv_0.cjs} +1 -1
  33. package/dist/ss-component.cjs +1 -1
  34. package/dist/ss-component.js +4 -4
  35. package/dist/ss-component2.cjs +1 -1
  36. package/dist/ss-component2.js +7 -7
  37. package/dist/{threeModel-_qpLo8kC.js → threeModel-C1ZEjXHQ.js} +1 -1
  38. package/dist/{threeModel-CFxOndkP.cjs → threeModel-PhC5MFta.cjs} +1 -1
  39. package/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  * @license
3
3
  * Copyright 2010-2025 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
5
- */const Al="177",Wd={ROTATE:0,DOLLY:1,PAN:2},Xd={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qd=0,rc=1,jd=2,au=1,ou=2,hi=3,Hn=0,vn=1,pn=2,wi=0,Er=1,sc=2,ac=3,oc=4,Yd=5,Vi=100,$d=101,Jd=102,Kd=103,Zd=104,Qd=200,ef=201,tf=202,nf=203,Ao=204,wo=205,rf=206,sf=207,af=208,of=209,lf=210,cf=211,hf=212,uf=213,df=214,To=0,Co=1,Ro=2,Tr=3,Do=4,Po=5,Lo=6,Io=7,ba=0,ff=1,pf=2,Ti=0,mf=1,gf=2,_f=3,lu=4,vf=5,yf=6,xf=7,lc="attached",Mf="detached",cu=300,Cr=301,Rr=302,Uo=303,No=304,Sa=306,$n=1e3,kn=1001,Fo=1002,Cn=1003,bf=1004,gs=1005,Tn=1006,Pa=1007,ui=1008,Qn=1009,hu=1010,uu=1011,is=1012,wl=1013,qi=1014,Jn=1015,hs=1016,Tl=1017,Cl=1018,rs=1020,du=35902,fu=1021,pu=1022,Un=1023,ss=1026,as=1027,mu=1028,Rl=1029,gu=1030,Dl=1031,Pl=1033,ra=33776,sa=33777,aa=33778,oa=33779,Oo=35840,zo=35841,Bo=35842,ko=35843,Vo=36196,Ho=37492,Go=37496,Wo=37808,Xo=37809,qo=37810,jo=37811,Yo=37812,$o=37813,Jo=37814,Ko=37815,Zo=37816,Qo=37817,el=37818,tl=37819,nl=37820,il=37821,la=36492,rl=36494,sl=36495,_u=36283,al=36284,ol=36285,ll=36286,fa=2300,cl=2301,La=2302,cc=2400,hc=2401,uc=2402,Sf=2500,Ef=3200,Af=3201,Ll=0,wf=1,Ai="",Tt="srgb",Dr="srgb-linear",pa="linear",Ut="srgb",ir=7680,dc=519,Tf=512,Cf=513,Rf=514,vu=515,Df=516,Pf=517,Lf=518,If=519,hl=35044,fc="300 es",di=2e3,ma=2001;class $i{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 i=n[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,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 i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const dn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let pc=1234567;const Kr=Math.PI/180,Pr=180/Math.PI;function Vn(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(dn[r&255]+dn[r>>8&255]+dn[r>>16&255]+dn[r>>24&255]+"-"+dn[e&255]+dn[e>>8&255]+"-"+dn[e>>16&15|64]+dn[e>>24&255]+"-"+dn[t&63|128]+dn[t>>8&255]+"-"+dn[t>>16&255]+dn[t>>24&255]+dn[n&255]+dn[n>>8&255]+dn[n>>16&255]+dn[n>>24&255]).toLowerCase()}function vt(r,e,t){return Math.max(e,Math.min(t,r))}function Il(r,e){return(r%e+e)%e}function Uf(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function Nf(r,e,t){return r!==e?(t-r)/(e-r):0}function Zr(r,e,t){return(1-t)*r+t*e}function Ff(r,e,t,n){return Zr(r,e,1-Math.exp(-t*n))}function Of(r,e=1){return e-Math.abs(Il(r,e*2)-e)}function zf(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Bf(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function kf(r,e){return r+Math.floor(Math.random()*(e-r+1))}function Vf(r,e){return r+Math.random()*(e-r)}function Hf(r){return r*(.5-Math.random())}function Gf(r){r!==void 0&&(pc=r);let e=pc+=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 Wf(r){return r*Kr}function Xf(r){return r*Pr}function qf(r){return(r&r-1)===0&&r!==0}function jf(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Yf(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $f(r,e,t,n,i){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),h=a((e+n)/2),u=s((e-n)/2),d=a((e-n)/2),f=s((n-e)/2),m=a((n-e)/2);switch(i){case"XYX":r.set(o*h,l*u,l*d,o*c);break;case"YZY":r.set(l*d,o*h,l*u,o*c);break;case"ZXZ":r.set(l*u,l*d,o*h,o*c);break;case"XZX":r.set(o*h,l*m,l*f,o*c);break;case"YXY":r.set(l*f,o*h,l*m,o*c);break;case"ZYZ":r.set(l*m,l*f,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Bn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function It(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const Hi={DEG2RAD:Kr,RAD2DEG:Pr,generateUUID:Vn,clamp:vt,euclideanModulo:Il,mapLinear:Uf,inverseLerp:Nf,lerp:Zr,damp:Ff,pingpong:Of,smoothstep:zf,smootherstep:Bf,randInt:kf,randFloat:Vf,randFloatSpread:Hf,seededRandom:Gf,degToRad:Wf,radToDeg:Xf,isPowerOfTwo:qf,ceilPowerOfTwo:jf,floorPowerOfTwo:Yf,setQuaternionFromProperEuler:$f,normalize:It,denormalize:Bn};class Xe{constructor(e=0,t=0){Xe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(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(vt(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),i=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*i+e.x,this.y=s*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Rn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],u=n[i+3];const d=s[a+0],f=s[a+1],m=s[a+2],_=s[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u;return}if(o===1){e[t+0]=d,e[t+1]=f,e[t+2]=m,e[t+3]=_;return}if(u!==_||l!==d||c!==f||h!==m){let g=1-o;const p=l*d+c*f+h*m+u*_,S=p>=0?1:-1,E=1-p*p;if(E>Number.EPSILON){const U=Math.sqrt(E),C=Math.atan2(U,p*S);g=Math.sin(g*C)/U,o=Math.sin(o*C)/U}const v=o*S;if(l=l*g+d*v,c=c*g+f*v,h=h*g+m*v,u=u*g+_*v,g===1-o){const U=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=U,c*=U,h*=U,u*=U}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,s,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],u=s[a],d=s[a+1],f=s[a+2],m=s[a+3];return e[t]=o*m+h*u+l*f-c*d,e[t+1]=l*m+h*d+c*u-o*f,e[t+2]=c*m+h*f+o*d-l*u,e[t+3]=h*m-o*u-l*d-c*f,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,i){return this._x=e,this._y=t,this._z=n,this._w=i,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,i=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),u=o(s/2),d=l(n/2),f=l(i/2),m=l(s/2);switch(a){case"XYZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"YZX":this._x=d*h*u+c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u-d*f*m;break;case"XZY":this._x=d*h*u-c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u+d*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],u=t[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-l)*f,this._y=(s-c)*f,this._z=(a-i)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(s+c)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(s-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-i)/f,this._x=(s+c)/f,this._y=(l+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(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(vt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),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,i=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+i*c-s*l,this._y=i*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const f=1-t;return this._w=f*a+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-t)*h)/c,d=Math.sin(t*h)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=s*u+this._z*d,this._onChangeCallback(),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(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*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}}class F{constructor(e=0,t=0,n=0){F.prototype.isVector3=!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(mc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(mc.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-s*i),u=2*(s*n-a*t);return this.x=t+l*c+a*u-o*h,this.y=n+l*h+o*c-s*u,this.z=i+l*u+s*h-a*c,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,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,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=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this.z=vt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this.z=vt(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(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,i=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-s*o,this.y=s*a-n*l,this.z=n*o-i*a,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 Ia.copy(this).projectOnVector(e),this.sub(Ia)}reflect(e){return this.sub(Ia.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(vt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}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 i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*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(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,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}}const Ia=new F,mc=new Rn;class _t{constructor(e,t,n,i,s,a,o,l,c){_t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c)}set(e,t,n,i,s,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=s,h[5]=l,h[6]=n,h[7]=a,h[8]=c,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,i=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],_=i[0],g=i[3],p=i[6],S=i[1],E=i[4],v=i[7],U=i[2],C=i[5],T=i[8];return s[0]=a*_+o*S+l*U,s[3]=a*g+o*E+l*C,s[6]=a*p+o*v+l*T,s[1]=c*_+h*S+u*U,s[4]=c*g+h*E+u*C,s[7]=c*p+h*v+u*T,s[2]=d*_+f*S+m*U,s[5]=d*g+f*E+m*C,s[8]=d*p+f*v+m*T,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],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*s*h+n*o*l+i*s*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=h*a-o*c,d=o*l-h*s,f=c*s-a*l,m=t*u+n*d+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=u*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=d*_,e[4]=(h*t-i*l)*_,e[5]=(i*s-o*t)*_,e[6]=f*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*s)*_,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,i,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ua.makeScale(e,t)),this}rotate(e){return this.premultiply(Ua.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ua.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 i=0;i<9;i++)if(t[i]!==n[i])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)}}const Ua=new _t;function yu(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function os(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Jf(){const r=os("canvas");return r.style.display="block",r}const gc={};function Ar(r){r in gc||(gc[r]=!0,console.warn(r))}function Kf(r,e,t){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function Zf(r){const e=r.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Qf(r){const e=r.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const _c=new _t().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),vc=new _t().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function ep(){const r={enabled:!0,workingColorSpace:Dr,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Ut&&(i.r=fi(i.r),i.g=fi(i.g),i.b=fi(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ut&&(i.r=wr(i.r),i.g=wr(i.g),i.b=wr(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ai?pa:this.spaces[i].transfer},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,s){return Ar("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return Ar("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return r.define({[Dr]:{primaries:e,whitePoint:n,transfer:pa,toXYZ:_c,fromXYZ:vc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Tt},outputColorSpaceConfig:{drawingBufferColorSpace:Tt}},[Tt]:{primaries:e,whitePoint:n,transfer:Ut,toXYZ:_c,fromXYZ:vc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Tt}}}),r}const xt=ep();function fi(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wr(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let rr;class tp{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{rr===void 0&&(rr=os("canvas")),rr.width=e.width,rr.height=e.height;const i=rr.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=rr}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=os("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=fi(s[a]/255)*255;return n.putImageData(i,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(fi(t[n]/255)*255):t[n]=fi(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let np=0;class Ul{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:np++}),this.uuid=Vn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight):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:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(Na(i[a].image)):s.push(Na(i[a]))}else s=Na(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function Na(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?tp.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ip=0;const Fa=new F;class cn extends $i{constructor(e=cn.DEFAULT_IMAGE,t=cn.DEFAULT_MAPPING,n=kn,i=kn,s=Tn,a=ui,o=Un,l=Qn,c=cn.DEFAULT_ANISOTROPY,h=Ai){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ip++}),this.uuid=Vn(),this.name="",this.source=new Ul(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Xe(0,0),this.repeat=new Xe(1,1),this.center=new Xe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,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}get width(){return this.source.getSize(Fa).x}get height(){return this.source.getSize(Fa).y}get depth(){return this.source.getSize(Fa).z}get image(){return this.source.data}set image(e=null){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.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){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.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,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!==cu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $n:e.x=e.x-Math.floor(e.x);break;case kn:e.x=e.x<0?0:1;break;case Fo: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 $n:e.y=e.y-Math.floor(e.y);break;case kn:e.y=e.y<0?0:1;break;case Fo: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++}}cn.DEFAULT_IMAGE=null;cn.DEFAULT_MAPPING=cu;cn.DEFAULT_ANISOTROPY=1;class Mt{constructor(e=0,t=0,n=0,i=1){Mt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}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,i){return this.x=e,this.y=t,this.z=n,this.w=i,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,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*s,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,i,s;const l=e.elements,c=l[0],h=l[4],u=l[8],d=l[1],f=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(c+1)/2,v=(f+1)/2,U=(p+1)/2,C=(h+d)/4,T=(u+_)/4,L=(m+g)/4;return E>v&&E>U?E<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(E),i=C/n,s=T/n):v>U?v<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(v),n=C/i,s=L/i):U<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(U),n=T/s,i=L/s),this.set(n,i,s,t),this}let S=Math.sqrt((g-m)*(g-m)+(u-_)*(u-_)+(d-h)*(d-h));return Math.abs(S)<.001&&(S=1),this.x=(g-m)/S,this.y=(u-_)/S,this.z=(d-h)/S,this.w=Math.acos((c+f+p-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=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this.z=vt(this.z,e.z,t.z),this.w=vt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this.z=vt(this.z,e,t),this.w=vt(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(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}}class rp extends $i{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Tn,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 Mt(0,0,e,t),this.scissorTest=!1,this.viewport=new Mt(0,0,e,t);const i={width:e,height:t,depth:n.depth},s=new cn(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].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:Tn,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 i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isArrayTexture=this.textures[i].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 i=Object.assign({},e.textures[t].image);this.textures[t].source=new Ul(i)}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}dispose(){this.dispatchEvent({type:"dispose"})}}class ji extends rp{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class xu extends cn{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Cn,this.minFilter=Cn,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class sp extends cn{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Cn,this.minFilter=Cn,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ei{constructor(e=new F(1/0,1/0,1/0),t=new F(-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(Fn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Fn.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=Fn.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 s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Fn):Fn.fromBufferAttribute(s,a),Fn.applyMatrix4(e.matrixWorld),this.expandByPoint(Fn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),_s.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),_s.copy(n.boundingBox)),_s.applyMatrix4(e.matrixWorld),this.union(_s)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],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,Fn),Fn.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(kr),vs.subVectors(this.max,kr),sr.subVectors(e.a,kr),ar.subVectors(e.b,kr),or.subVectors(e.c,kr),_i.subVectors(ar,sr),vi.subVectors(or,ar),Li.subVectors(sr,or);let t=[0,-_i.z,_i.y,0,-vi.z,vi.y,0,-Li.z,Li.y,_i.z,0,-_i.x,vi.z,0,-vi.x,Li.z,0,-Li.x,-_i.y,_i.x,0,-vi.y,vi.x,0,-Li.y,Li.x,0];return!Oa(t,sr,ar,or,vs)||(t=[1,0,0,0,1,0,0,0,1],!Oa(t,sr,ar,or,vs))?!1:(ys.crossVectors(_i,vi),t=[ys.x,ys.y,ys.z],Oa(t,sr,ar,or,vs))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Fn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Fn).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:(ri[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ri[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ri[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ri[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ri[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ri[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ri[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ri[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ri),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 ri=[new F,new F,new F,new F,new F,new F,new F,new F],Fn=new F,_s=new ei,sr=new F,ar=new F,or=new F,_i=new F,vi=new F,Li=new F,kr=new F,vs=new F,ys=new F,Ii=new F;function Oa(r,e,t,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Ii.fromArray(r,s);const o=i.x*Math.abs(Ii.x)+i.y*Math.abs(Ii.y)+i.z*Math.abs(Ii.z),l=e.dot(Ii),c=t.dot(Ii),h=n.dot(Ii);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const ap=new ei,Vr=new F,za=new F;class mi{constructor(e=new F,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):ap.setFromPoints(e).getCenter(n);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),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)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Vr.subVectors(e,this.center);const t=Vr.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Vr,i/n),this.radius+=i}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):(za.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Vr.copy(e.center).add(za)),this.expandByPoint(Vr.copy(e.center).sub(za))),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}}const si=new F,Ba=new F,xs=new F,yi=new F,ka=new F,Ms=new F,Va=new F;class Ur{constructor(e=new F,t=new F(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,si)),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=si.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(si.copy(this.origin).addScaledVector(this.direction,t),si.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ba.copy(e).add(t).multiplyScalar(.5),xs.copy(t).sub(e).normalize(),yi.copy(this.origin).sub(Ba);const s=e.distanceTo(t)*.5,a=-this.direction.dot(xs),o=yi.dot(this.direction),l=-yi.dot(xs),c=yi.lengthSq(),h=Math.abs(1-a*a);let u,d,f,m;if(h>0)if(u=a*l-o,d=a*o-l,m=s*h,u>=0)if(d>=-m)if(d<=m){const _=1/h;u*=_,d*=_,f=u*(u+a*d+2*o)+d*(a*u+d+2*l)+c}else d=s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d=-s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d<=-m?(u=Math.max(0,-(-a*s+o)),d=u>0?-s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c):d<=m?(u=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(u=Math.max(0,-(a*s+o)),d=u>0?s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c);else d=a>0?-s:s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Ba).addScaledVector(xs,d),f}intersectSphere(e,t){si.subVectors(e.center,this.origin);const n=si.dot(this.direction),i=si.dot(si)-n*n,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,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,i,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),h>=0?(s=(e.min.y-d.y)*h,a=(e.max.y-d.y)*h):(s=(e.max.y-d.y)*h,a=(e.min.y-d.y)*h),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),u>=0?(o=(e.min.z-d.z)*u,l=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,l=(e.min.z-d.z)*u),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,si)!==null}intersectTriangle(e,t,n,i,s){ka.subVectors(t,e),Ms.subVectors(n,e),Va.crossVectors(ka,Ms);let a=this.direction.dot(Va),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;yi.subVectors(this.origin,e);const l=o*this.direction.dot(Ms.crossVectors(yi,Ms));if(l<0)return null;const c=o*this.direction.dot(ka.cross(yi));if(c<0||l+c>a)return null;const h=-o*yi.dot(Va);return h<0?null:this.at(h/a,s)}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 lt{constructor(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g){lt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g)}set(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=s,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=u,p[14]=d,p[3]=f,p[7]=m,p[11]=_,p[15]=g,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 lt().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 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){const t=this.elements,n=e.elements,i=1/lr.setFromMatrixColumn(e,0).length(),s=1/lr.setFromMatrixColumn(e,1).length(),a=1/lr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,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,i=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(s),u=Math.sin(s);if(e.order==="XYZ"){const d=a*h,f=a*u,m=o*h,_=o*u;t[0]=l*h,t[4]=-l*u,t[8]=c,t[1]=f+m*c,t[5]=d-_*c,t[9]=-o*l,t[2]=_-d*c,t[6]=m+f*c,t[10]=a*l}else if(e.order==="YXZ"){const d=l*h,f=l*u,m=c*h,_=c*u;t[0]=d+_*o,t[4]=m*o-f,t[8]=a*c,t[1]=a*u,t[5]=a*h,t[9]=-o,t[2]=f*o-m,t[6]=_+d*o,t[10]=a*l}else if(e.order==="ZXY"){const d=l*h,f=l*u,m=c*h,_=c*u;t[0]=d-_*o,t[4]=-a*u,t[8]=m+f*o,t[1]=f+m*o,t[5]=a*h,t[9]=_-d*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const d=a*h,f=a*u,m=o*h,_=o*u;t[0]=l*h,t[4]=m*c-f,t[8]=d*c+_,t[1]=l*u,t[5]=_*c+d,t[9]=f*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const d=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=_-d*u,t[8]=m*u+f,t[1]=u,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=f*u+m,t[10]=d-_*u}else if(e.order==="XZY"){const d=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=-u,t[8]=c*h,t[1]=d*u+_,t[5]=a*h,t[9]=f*u-m,t[2]=m*u-f,t[6]=o*h,t[10]=_*u+d}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(op,e,lp)}lookAt(e,t,n){const i=this.elements;return An.subVectors(e,t),An.lengthSq()===0&&(An.z=1),An.normalize(),xi.crossVectors(n,An),xi.lengthSq()===0&&(Math.abs(n.z)===1?An.x+=1e-4:An.z+=1e-4,An.normalize(),xi.crossVectors(n,An)),xi.normalize(),bs.crossVectors(An,xi),i[0]=xi.x,i[4]=bs.x,i[8]=An.x,i[1]=xi.y,i[5]=bs.y,i[9]=An.y,i[2]=xi.z,i[6]=bs.z,i[10]=An.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],_=n[6],g=n[10],p=n[14],S=n[3],E=n[7],v=n[11],U=n[15],C=i[0],T=i[4],L=i[8],b=i[12],x=i[1],R=i[5],B=i[9],V=i[13],W=i[2],ee=i[6],k=i[10],Q=i[14],q=i[3],he=i[7],ye=i[11],le=i[15];return s[0]=a*C+o*x+l*W+c*q,s[4]=a*T+o*R+l*ee+c*he,s[8]=a*L+o*B+l*k+c*ye,s[12]=a*b+o*V+l*Q+c*le,s[1]=h*C+u*x+d*W+f*q,s[5]=h*T+u*R+d*ee+f*he,s[9]=h*L+u*B+d*k+f*ye,s[13]=h*b+u*V+d*Q+f*le,s[2]=m*C+_*x+g*W+p*q,s[6]=m*T+_*R+g*ee+p*he,s[10]=m*L+_*B+g*k+p*ye,s[14]=m*b+_*V+g*Q+p*le,s[3]=S*C+E*x+v*W+U*q,s[7]=S*T+E*R+v*ee+U*he,s[11]=S*L+E*B+v*k+U*ye,s[15]=S*b+E*V+v*Q+U*le,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],i=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],u=e[6],d=e[10],f=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+s*l*u-i*c*u-s*o*d+n*c*d+i*o*f-n*l*f)+_*(+t*l*f-t*c*d+s*a*d-i*a*f+i*c*h-s*l*h)+g*(+t*c*u-t*o*f-s*a*u+n*a*f+s*o*h-n*c*h)+p*(-i*o*h-t*l*u+t*o*d+i*a*u-n*a*d+n*l*h)}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 i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],f=e[11],m=e[12],_=e[13],g=e[14],p=e[15],S=u*g*c-_*d*c+_*l*f-o*g*f-u*l*p+o*d*p,E=m*d*c-h*g*c-m*l*f+a*g*f+h*l*p-a*d*p,v=h*_*c-m*u*c+m*o*f-a*_*f-h*o*p+a*u*p,U=m*u*l-h*_*l-m*o*d+a*_*d+h*o*g-a*u*g,C=t*S+n*E+i*v+s*U;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/C;return e[0]=S*T,e[1]=(_*d*s-u*g*s-_*i*f+n*g*f+u*i*p-n*d*p)*T,e[2]=(o*g*s-_*l*s+_*i*c-n*g*c-o*i*p+n*l*p)*T,e[3]=(u*l*s-o*d*s-u*i*c+n*d*c+o*i*f-n*l*f)*T,e[4]=E*T,e[5]=(h*g*s-m*d*s+m*i*f-t*g*f-h*i*p+t*d*p)*T,e[6]=(m*l*s-a*g*s-m*i*c+t*g*c+a*i*p-t*l*p)*T,e[7]=(a*d*s-h*l*s+h*i*c-t*d*c-a*i*f+t*l*f)*T,e[8]=v*T,e[9]=(m*u*s-h*_*s-m*n*f+t*_*f+h*n*p-t*u*p)*T,e[10]=(a*_*s-m*o*s+m*n*c-t*_*c-a*n*p+t*o*p)*T,e[11]=(h*o*s-a*u*s-h*n*c+t*u*c+a*n*f-t*o*f)*T,e[12]=U*T,e[13]=(h*_*i-m*u*i+m*n*d-t*_*d-h*n*g+t*u*g)*T,e[14]=(m*o*i-a*_*i-m*n*l+t*_*l+a*n*g-t*o*g)*T,e[15]=(a*u*i-h*o*i+h*n*l-t*u*l-a*n*d+t*o*d)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}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),i=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,h=s*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,s*l*l+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,i,s,a){return this.set(1,n,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,h=a+a,u=o+o,d=s*c,f=s*h,m=s*u,_=a*h,g=a*u,p=o*u,S=l*c,E=l*h,v=l*u,U=n.x,C=n.y,T=n.z;return i[0]=(1-(_+p))*U,i[1]=(f+v)*U,i[2]=(m-E)*U,i[3]=0,i[4]=(f-v)*C,i[5]=(1-(d+p))*C,i[6]=(g+S)*C,i[7]=0,i[8]=(m+E)*T,i[9]=(g-S)*T,i[10]=(1-(d+_))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=lr.set(i[0],i[1],i[2]).length();const a=lr.set(i[4],i[5],i[6]).length(),o=lr.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],On.copy(this);const c=1/s,h=1/a,u=1/o;return On.elements[0]*=c,On.elements[1]*=c,On.elements[2]*=c,On.elements[4]*=h,On.elements[5]*=h,On.elements[6]*=h,On.elements[8]*=u,On.elements[9]*=u,On.elements[10]*=u,t.setFromRotationMatrix(On),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,i,s,a,o=di){const l=this.elements,c=2*s/(t-e),h=2*s/(n-i),u=(t+e)/(t-e),d=(n+i)/(n-i);let f,m;if(o===di)f=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===ma)f=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,s,a,o=di){const l=this.elements,c=1/(t-e),h=1/(n-i),u=1/(a-s),d=(t+e)*c,f=(n+i)*h;let m,_;if(o===di)m=(a+s)*u,_=-2*u;else if(o===ma)m=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])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}}const lr=new F,On=new lt,op=new F(0,0,0),lp=new F(1,1,1),xi=new F,bs=new F,An=new F,yc=new lt,xc=new Rn;class Sn{constructor(e=0,t=0,n=0,i=Sn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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 i=e.elements,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],u=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(vt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-vt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(vt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-vt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(vt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-vt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return yc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return xc.setFromEuler(this),this.setFromQuaternion(xc,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}}Sn.DEFAULT_ORDER="XYZ";class Nl{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 cp=0;const Mc=new F,cr=new Rn,ai=new lt,Ss=new F,Hr=new F,hp=new F,up=new Rn,bc=new F(1,0,0),Sc=new F(0,1,0),Ec=new F(0,0,1),Ac={type:"added"},dp={type:"removed"},hr={type:"childadded",child:null},Ha={type:"childremoved",child:null};class Nt extends $i{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:cp++}),this.uuid=Vn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Nt.DEFAULT_UP.clone();const e=new F,t=new Sn,n=new Rn,i=new F(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),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:i},modelViewMatrix:{value:new lt},normalMatrix:{value:new _t}}),this.matrix=new lt,this.matrixWorld=new lt,this.matrixAutoUpdate=Nt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Nt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Nl,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.userData={}}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 cr.setFromAxisAngle(e,t),this.quaternion.multiply(cr),this}rotateOnWorldAxis(e,t){return cr.setFromAxisAngle(e,t),this.quaternion.premultiply(cr),this}rotateX(e){return this.rotateOnAxis(bc,e)}rotateY(e){return this.rotateOnAxis(Sc,e)}rotateZ(e){return this.rotateOnAxis(Ec,e)}translateOnAxis(e,t){return Mc.copy(e).applyQuaternion(this.quaternion),this.position.add(Mc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(bc,e)}translateY(e){return this.translateOnAxis(Sc,e)}translateZ(e){return this.translateOnAxis(Ec,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ai.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ss.copy(e):Ss.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Hr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ai.lookAt(Hr,Ss,this.up):ai.lookAt(Ss,Hr,this.up),this.quaternion.setFromRotationMatrix(ai),i&&(ai.extractRotation(i.matrixWorld),cr.setFromRotationMatrix(ai),this.quaternion.premultiply(cr.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.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(Ac),hr.child=e,this.dispatchEvent(hr),hr.child=null):console.error("THREE.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(dp),Ha.child=e,this.dispatchEvent(Ha),Ha.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),ai.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ai.multiply(e.parent.matrixWorld)),e.applyMatrix4(ai),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Ac),hr.child=e,this.dispatchEvent(hr),hr.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,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].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(Hr,e,hp),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Hr,up,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,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;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),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,i=t.length;n<i;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 i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].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 i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const u=l[c];s(e.shapes,u)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));i.material=o}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),u=a(e.shapes),d=a(e.skeletons),f=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}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.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.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Nt.DEFAULT_UP=new F(0,1,0);Nt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Nt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const zn=new F,oi=new F,Ga=new F,li=new F,ur=new F,dr=new F,wc=new F,Wa=new F,Xa=new F,qa=new F,ja=new Mt,Ya=new Mt,$a=new Mt;class In{constructor(e=new F,t=new F,n=new F){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),zn.subVectors(e,t),i.cross(zn);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){zn.subVectors(i,t),oi.subVectors(n,t),Ga.subVectors(e,t);const a=zn.dot(zn),o=zn.dot(oi),l=zn.dot(Ga),c=oi.dot(oi),h=oi.dot(Ga),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const d=1/u,f=(c*l-o*h)*d,m=(a*h-o*l)*d;return s.set(1-f-m,m,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,li)===null?!1:li.x>=0&&li.y>=0&&li.x+li.y<=1}static getInterpolation(e,t,n,i,s,a,o,l){return this.getBarycoord(e,t,n,i,li)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,li.x),l.addScaledVector(a,li.y),l.addScaledVector(o,li.z),l)}static getInterpolatedAttribute(e,t,n,i,s,a){return ja.setScalar(0),Ya.setScalar(0),$a.setScalar(0),ja.fromBufferAttribute(e,t),Ya.fromBufferAttribute(e,n),$a.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(ja,s.x),a.addScaledVector(Ya,s.y),a.addScaledVector($a,s.z),a}static isFrontFacing(e,t,n,i){return zn.subVectors(n,t),oi.subVectors(e,t),zn.cross(oi).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 zn.subVectors(this.c,this.b),oi.subVectors(this.a,this.b),zn.cross(oi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return In.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return In.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return In.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return In.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return In.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let a,o;ur.subVectors(i,n),dr.subVectors(s,n),Wa.subVectors(e,n);const l=ur.dot(Wa),c=dr.dot(Wa);if(l<=0&&c<=0)return t.copy(n);Xa.subVectors(e,i);const h=ur.dot(Xa),u=dr.dot(Xa);if(h>=0&&u<=h)return t.copy(i);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(ur,a);qa.subVectors(e,s);const f=ur.dot(qa),m=dr.dot(qa);if(m>=0&&f<=m)return t.copy(s);const _=f*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(dr,o);const g=h*m-f*u;if(g<=0&&u-h>=0&&f-m>=0)return wc.subVectors(s,i),o=(u-h)/(u-h+(f-m)),t.copy(i).addScaledVector(wc,o);const p=1/(g+_+d);return a=_*p,o=d*p,t.copy(n).addScaledVector(ur,a).addScaledVector(dr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Mu={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},Mi={h:0,s:0,l:0},Es={h:0,s:0,l:0};function Ja(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class ot{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 i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Tt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,xt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=xt.workingColorSpace){return this.r=e,this.g=t,this.b=n,xt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=xt.workingColorSpace){if(e=Il(e,1),t=vt(t,0,1),n=vt(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=Ja(a,s,e+1/3),this.g=Ja(a,s,e),this.b=Ja(a,s,e-1/3)}return xt.colorSpaceToWorking(this,i),this}setStyle(e,t=Tt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Tt){const n=Mu[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=fi(e.r),this.g=fi(e.g),this.b=fi(e.b),this}copyLinearToSRGB(e){return this.r=wr(e.r),this.g=wr(e.g),this.b=wr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tt){return xt.workingToColorSpace(fn.copy(this),e),Math.round(vt(fn.r*255,0,255))*65536+Math.round(vt(fn.g*255,0,255))*256+Math.round(vt(fn.b*255,0,255))}getHexString(e=Tt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xt.workingColorSpace){xt.workingToColorSpace(fn.copy(this),t);const n=fn.r,i=fn.g,s=fn.b,a=Math.max(n,i,s),o=Math.min(n,i,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case n:l=(i-s)/u+(i<s?6:0);break;case i:l=(s-n)/u+2;break;case s:l=(n-i)/u+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=xt.workingColorSpace){return xt.workingToColorSpace(fn.copy(this),t),e.r=fn.r,e.g=fn.g,e.b=fn.b,e}getStyle(e=Tt){xt.workingToColorSpace(fn.copy(this),e);const t=fn.r,n=fn.g,i=fn.b;return e!==Tt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Mi),this.setHSL(Mi.h+e,Mi.s+t,Mi.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(Mi),e.getHSL(Es);const n=Zr(Mi.h,Es.h,t),i=Zr(Mi.s,Es.s,t),s=Zr(Mi.l,Es.l,t);return this.setHSL(n,i,s),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,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,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 fn=new ot;ot.NAMES=Mu;let fp=0;class Nn extends $i{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fp++}),this.uuid=Vn(),this.name="",this.type="Material",this.blending=Er,this.side=Hn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ao,this.blendDst=wo,this.blendEquation=Vi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ot(0,0,0),this.blendAlpha=0,this.depthFunc=Tr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=dc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ir,this.stencilZFail=ir,this.stencilZPass=ir,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){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.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"}};n.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.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!==Er&&(n.blending=this.blending),this.side!==Hn&&(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!==Ao&&(n.blendSrc=this.blendSrc),this.blendDst!==wo&&(n.blendDst=this.blendDst),this.blendEquation!==Vi&&(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!==Tr&&(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!==dc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ir&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ir&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ir&&(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.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 i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}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 i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].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.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 Ri extends Nn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ot(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 Sn,this.combine=ba,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 qt=new F,As=new Xe;let pp=0;class Gt{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:pp++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=hl,this.updateRanges=[],this.gpuType=Jn,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;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];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++)As.fromBufferAttribute(this,t),As.applyMatrix3(e),this.setXY(t,As.x,As.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix3(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix4(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyNormalMatrix(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.transformDirection(e),this.setXYZ(t,qt.x,qt.y,qt.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=Bn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Bn(t,this.array)),t}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Bn(t,this.array)),t}setY(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}setW(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),i=It(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),i=It(i,this.array),s=It(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,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!==hl&&(e.usage=this.usage),e}}class bu extends Gt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class mp extends Gt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Su extends Gt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class mt extends Gt{constructor(e,t,n){super(new Float32Array(e),t,n)}}let gp=0;const Dn=new lt,Ka=new Nt,fr=new F,wn=new ei,Gr=new ei,Qt=new F;class Bt extends $i{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:gp++}),this.uuid=Vn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(yu(e)?Su:bu)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,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 s=new _t().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Dn.makeRotationFromQuaternion(e),this.applyMatrix4(Dn),this}rotateX(e){return Dn.makeRotationX(e),this.applyMatrix4(Dn),this}rotateY(e){return Dn.makeRotationY(e),this.applyMatrix4(Dn),this}rotateZ(e){return Dn.makeRotationZ(e),this.applyMatrix4(Dn),this}translate(e,t,n){return Dn.makeTranslation(e,t,n),this.applyMatrix4(Dn),this}scale(e,t,n){return Dn.makeScale(e,t,n),this.applyMatrix4(Dn),this}lookAt(e){return Ka.lookAt(e),Ka.updateMatrix(),this.applyMatrix4(Ka.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(fr).negate(),this.translate(fr.x,fr.y,fr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,s=e.length;i<s;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new mt(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const s=e[i];t.setXYZ(i,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.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 ei);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];wn.setFromBufferAttribute(s),this.morphTargetsRelative?(Qt.addVectors(this.boundingBox.min,wn.min),this.boundingBox.expandByPoint(Qt),Qt.addVectors(this.boundingBox.max,wn.max),this.boundingBox.expandByPoint(Qt)):(this.boundingBox.expandByPoint(wn.min),this.boundingBox.expandByPoint(wn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new mi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new F,1/0);return}if(e){const n=this.boundingSphere.center;if(wn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Gr.setFromBufferAttribute(o),this.morphTargetsRelative?(Qt.addVectors(wn.min,Gr.min),wn.expandByPoint(Qt),Qt.addVectors(wn.max,Gr.max),wn.expandByPoint(Qt)):(wn.expandByPoint(Gr.min),wn.expandByPoint(Gr.max))}wn.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)Qt.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Qt));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)Qt.fromBufferAttribute(o,c),l&&(fr.fromBufferAttribute(e,c),Qt.add(fr)),i=Math.max(i,n.distanceToSquared(Qt))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Gt(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let L=0;L<n.count;L++)o[L]=new F,l[L]=new F;const c=new F,h=new F,u=new F,d=new Xe,f=new Xe,m=new Xe,_=new F,g=new F;function p(L,b,x){c.fromBufferAttribute(n,L),h.fromBufferAttribute(n,b),u.fromBufferAttribute(n,x),d.fromBufferAttribute(s,L),f.fromBufferAttribute(s,b),m.fromBufferAttribute(s,x),h.sub(c),u.sub(c),f.sub(d),m.sub(d);const R=1/(f.x*m.y-m.x*f.y);isFinite(R)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(u,-f.y).multiplyScalar(R),g.copy(u).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(R),o[L].add(_),o[b].add(_),o[x].add(_),l[L].add(g),l[b].add(g),l[x].add(g))}let S=this.groups;S.length===0&&(S=[{start:0,count:e.count}]);for(let L=0,b=S.length;L<b;++L){const x=S[L],R=x.start,B=x.count;for(let V=R,W=R+B;V<W;V+=3)p(e.getX(V+0),e.getX(V+1),e.getX(V+2))}const E=new F,v=new F,U=new F,C=new F;function T(L){U.fromBufferAttribute(i,L),C.copy(U);const b=o[L];E.copy(b),E.sub(U.multiplyScalar(U.dot(b))).normalize(),v.crossVectors(C,b);const R=v.dot(l[L])<0?-1:1;a.setXYZW(L,E.x,E.y,E.z,R)}for(let L=0,b=S.length;L<b;++L){const x=S[L],R=x.start,B=x.count;for(let V=R,W=R+B;V<W;V+=3)T(e.getX(V+0)),T(e.getX(V+1)),T(e.getX(V+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 Gt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const i=new F,s=new F,a=new F,o=new F,l=new F,c=new F,h=new F,u=new F;if(e)for(let d=0,f=e.count;d<f;d+=3){const m=e.getX(d+0),_=e.getX(d+1),g=e.getX(d+2);i.fromBufferAttribute(t,m),s.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),h.subVectors(a,s),u.subVectors(i,s),h.cross(u),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(h),l.add(h),c.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let d=0,f=t.count;d<f;d+=3)i.fromBufferAttribute(t,d+0),s.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),h.subVectors(a,s),u.subVectors(i,s),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Qt.fromBufferAttribute(e,t),Qt.normalize(),e.setXYZ(t,Qt.x,Qt.y,Qt.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,u=o.normalized,d=new c.constructor(l.length*h);let f=0,m=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?f=l[_]*o.data.stride+o.offset:f=l[_]*h;for(let p=0;p<h;p++)d[m++]=c[f++]}return new Gt(d,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Bt,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=e(l,n);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let h=0,u=c.length;h<u;h++){const d=c[h],f=e(d,n);l.push(f)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.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 l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);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 l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){const f=c[u];h.push(f.toJSON(e.data))}h.length>0&&(i[l]=h,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.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 i=e.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(t))}const s=e.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,f=u.length;d<f;d++)h.push(u[d].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const u=a[c];this.addGroup(u.start,u.count,u.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Tc=new lt,Ui=new Ur,ws=new mi,Cc=new F,Ts=new F,Cs=new F,Rs=new F,Za=new F,Ds=new F,Rc=new F,Ps=new F;class Rt extends Nt{constructor(e=new Bt,t=new Ri){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 i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){Ds.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=o[l],u=s[l];h!==0&&(Za.fromBufferAttribute(u,e),a?Ds.addScaledVector(Za,h):Ds.addScaledVector(Za.sub(t),h))}t.add(Ds)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ws.copy(n.boundingSphere),ws.applyMatrix4(s),Ui.copy(e.ray).recast(e.near),!(ws.containsPoint(Ui.origin)===!1&&(Ui.intersectSphere(ws,Cc)===null||Ui.origin.distanceToSquared(Cc)>(e.far-e.near)**2))&&(Tc.copy(s).invert(),Ui.copy(e.ray).applyMatrix4(Tc),!(n.boundingBox!==null&&Ui.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Ui)))}_computeIntersections(e,t,n){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,d=s.groups,f=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],S=Math.max(g.start,f.start),E=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let v=S,U=E;v<U;v+=3){const C=o.getX(v),T=o.getX(v+1),L=o.getX(v+2);i=Ls(this,p,e,n,c,h,u,C,T,L),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(o.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const S=o.getX(g),E=o.getX(g+1),v=o.getX(g+2);i=Ls(this,a,e,n,c,h,u,S,E,v),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],S=Math.max(g.start,f.start),E=Math.min(l.count,Math.min(g.start+g.count,f.start+f.count));for(let v=S,U=E;v<U;v+=3){const C=v,T=v+1,L=v+2;i=Ls(this,p,e,n,c,h,u,C,T,L),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(l.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const S=g,E=g+1,v=g+2;i=Ls(this,a,e,n,c,h,u,S,E,v),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}}}function _p(r,e,t,n,i,s,a,o){let l;if(e.side===vn?l=n.intersectTriangle(a,s,i,!0,o):l=n.intersectTriangle(i,s,a,e.side===Hn,o),l===null)return null;Ps.copy(o),Ps.applyMatrix4(r.matrixWorld);const c=t.ray.origin.distanceTo(Ps);return c<t.near||c>t.far?null:{distance:c,point:Ps.clone(),object:r}}function Ls(r,e,t,n,i,s,a,o,l,c){r.getVertexPosition(o,Ts),r.getVertexPosition(l,Cs),r.getVertexPosition(c,Rs);const h=_p(r,e,t,n,Ts,Cs,Rs,Rc);if(h){const u=new F;In.getBarycoord(Rc,Ts,Cs,Rs,u),i&&(h.uv=In.getInterpolatedAttribute(i,o,l,c,u,new Xe)),s&&(h.uv1=In.getInterpolatedAttribute(s,o,l,c,u,new Xe)),a&&(h.normal=In.getInterpolatedAttribute(a,o,l,c,u,new F),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new F,materialIndex:0};In.getNormal(Ts,Cs,Rs,d.normal),h.face=d,h.barycoord=u}return h}class Nr extends Bt{constructor(e=1,t=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,n,t,e,a,s,0),m("z","y","x",1,-1,n,t,-e,a,s,1),m("x","z","y",1,1,e,n,t,i,a,2),m("x","z","y",1,-1,e,n,-t,i,a,3),m("x","y","z",1,-1,e,t,n,i,s,4),m("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new mt(c,3)),this.setAttribute("normal",new mt(h,3)),this.setAttribute("uv",new mt(u,2));function m(_,g,p,S,E,v,U,C,T,L,b){const x=v/T,R=U/L,B=v/2,V=U/2,W=C/2,ee=T+1,k=L+1;let Q=0,q=0;const he=new F;for(let ye=0;ye<k;ye++){const le=ye*R-V;for(let Le=0;Le<ee;Le++){const we=Le*x-B;he[_]=we*S,he[g]=le*E,he[p]=W,c.push(he.x,he.y,he.z),he[_]=0,he[g]=0,he[p]=C>0?1:-1,h.push(he.x,he.y,he.z),u.push(Le/T),u.push(1-ye/L),Q+=1}}for(let ye=0;ye<L;ye++)for(let le=0;le<T;le++){const Le=d+le+ee*ye,we=d+le+ee*(ye+1),Y=d+(le+1)+ee*(ye+1),re=d+(le+1)+ee*ye;l.push(Le,we,re),l.push(we,Y,re),q+=6}o.addGroup(f,q,b),f+=q,d+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Lr(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function _n(r){const e={};for(let t=0;t<r.length;t++){const n=Lr(r[t]);for(const i in n)e[i]=n[i]}return e}function vp(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function Eu(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:xt.workingColorSpace}const Fl={clone:Lr,merge:_n};var yp=`void main() {
5
+ */const Al="177",Wd={ROTATE:0,DOLLY:1,PAN:2},Xd={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qd=0,rc=1,jd=2,au=1,ou=2,hi=3,Hn=0,vn=1,pn=2,wi=0,Er=1,sc=2,ac=3,oc=4,Yd=5,Vi=100,$d=101,Jd=102,Kd=103,Zd=104,Qd=200,ef=201,tf=202,nf=203,Ao=204,wo=205,rf=206,sf=207,af=208,of=209,lf=210,cf=211,hf=212,uf=213,df=214,To=0,Co=1,Ro=2,Tr=3,Do=4,Po=5,Lo=6,Io=7,ba=0,ff=1,pf=2,Ti=0,mf=1,gf=2,_f=3,lu=4,vf=5,yf=6,xf=7,lc="attached",Mf="detached",cu=300,Cr=301,Rr=302,Uo=303,No=304,Sa=306,$n=1e3,kn=1001,Fo=1002,Cn=1003,bf=1004,gs=1005,Tn=1006,Pa=1007,ui=1008,Qn=1009,hu=1010,uu=1011,is=1012,wl=1013,qi=1014,Jn=1015,hs=1016,Tl=1017,Cl=1018,rs=1020,du=35902,fu=1021,pu=1022,Un=1023,ss=1026,as=1027,mu=1028,Rl=1029,gu=1030,Dl=1031,Pl=1033,ra=33776,sa=33777,aa=33778,oa=33779,Oo=35840,zo=35841,Bo=35842,ko=35843,Vo=36196,Ho=37492,Go=37496,Wo=37808,Xo=37809,qo=37810,jo=37811,Yo=37812,$o=37813,Jo=37814,Ko=37815,Zo=37816,Qo=37817,el=37818,tl=37819,nl=37820,il=37821,la=36492,rl=36494,sl=36495,_u=36283,al=36284,ol=36285,ll=36286,fa=2300,cl=2301,La=2302,cc=2400,hc=2401,uc=2402,Sf=2500,Ef=3200,Af=3201,Ll=0,wf=1,Ai="",Tt="srgb",Dr="srgb-linear",pa="linear",Ut="srgb",ir=7680,dc=519,Tf=512,Cf=513,Rf=514,vu=515,Df=516,Pf=517,Lf=518,If=519,hl=35044,fc="300 es",di=2e3,ma=2001;class $i{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 i=n[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,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 i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,e);e.target=null}}}const dn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let pc=1234567;const Kr=Math.PI/180,Pr=180/Math.PI;function Vn(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(dn[r&255]+dn[r>>8&255]+dn[r>>16&255]+dn[r>>24&255]+"-"+dn[e&255]+dn[e>>8&255]+"-"+dn[e>>16&15|64]+dn[e>>24&255]+"-"+dn[t&63|128]+dn[t>>8&255]+"-"+dn[t>>16&255]+dn[t>>24&255]+dn[n&255]+dn[n>>8&255]+dn[n>>16&255]+dn[n>>24&255]).toLowerCase()}function vt(r,e,t){return Math.max(e,Math.min(t,r))}function Il(r,e){return(r%e+e)%e}function Uf(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function Nf(r,e,t){return r!==e?(t-r)/(e-r):0}function Zr(r,e,t){return(1-t)*r+t*e}function Ff(r,e,t,n){return Zr(r,e,1-Math.exp(-t*n))}function Of(r,e=1){return e-Math.abs(Il(r,e*2)-e)}function zf(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Bf(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function kf(r,e){return r+Math.floor(Math.random()*(e-r+1))}function Vf(r,e){return r+Math.random()*(e-r)}function Hf(r){return r*(.5-Math.random())}function Gf(r){r!==void 0&&(pc=r);let e=pc+=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 Wf(r){return r*Kr}function Xf(r){return r*Pr}function qf(r){return(r&r-1)===0&&r!==0}function jf(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Yf(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function $f(r,e,t,n,i){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),h=a((e+n)/2),u=s((e-n)/2),d=a((e-n)/2),f=s((n-e)/2),m=a((n-e)/2);switch(i){case"XYX":r.set(o*h,l*u,l*d,o*c);break;case"YZY":r.set(l*d,o*h,l*u,o*c);break;case"ZXZ":r.set(l*u,l*d,o*h,o*c);break;case"XZX":r.set(o*h,l*m,l*f,o*c);break;case"YXY":r.set(l*f,o*h,l*m,o*c);break;case"ZYZ":r.set(l*m,l*f,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Bn(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function It(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const Hi={DEG2RAD:Kr,RAD2DEG:Pr,generateUUID:Vn,clamp:vt,euclideanModulo:Il,mapLinear:Uf,inverseLerp:Nf,lerp:Zr,damp:Ff,pingpong:Of,smoothstep:zf,smootherstep:Bf,randInt:kf,randFloat:Vf,randFloatSpread:Hf,seededRandom:Gf,degToRad:Wf,radToDeg:Xf,isPowerOfTwo:qf,ceilPowerOfTwo:jf,floorPowerOfTwo:Yf,setQuaternionFromProperEuler:$f,normalize:It,denormalize:Bn};class Xe{constructor(e=0,t=0){Xe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(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(vt(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),i=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*i+e.x,this.y=s*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Rn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],u=n[i+3];const d=s[a+0],f=s[a+1],m=s[a+2],_=s[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u;return}if(o===1){e[t+0]=d,e[t+1]=f,e[t+2]=m,e[t+3]=_;return}if(u!==_||l!==d||c!==f||h!==m){let g=1-o;const p=l*d+c*f+h*m+u*_,S=p>=0?1:-1,E=1-p*p;if(E>Number.EPSILON){const U=Math.sqrt(E),C=Math.atan2(U,p*S);g=Math.sin(g*C)/U,o=Math.sin(o*C)/U}const v=o*S;if(l=l*g+d*v,c=c*g+f*v,h=h*g+m*v,u=u*g+_*v,g===1-o){const U=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=U,c*=U,h*=U,u*=U}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,s,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],u=s[a],d=s[a+1],f=s[a+2],m=s[a+3];return e[t]=o*m+h*u+l*f-c*d,e[t+1]=l*m+h*d+c*u-o*f,e[t+2]=c*m+h*f+o*d-l*u,e[t+3]=h*m-o*u-l*d-c*f,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,i){return this._x=e,this._y=t,this._z=n,this._w=i,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,i=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),u=o(s/2),d=l(n/2),f=l(i/2),m=l(s/2);switch(a){case"XYZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"YXZ":this._x=d*h*u+c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"ZXY":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u-d*f*m;break;case"ZYX":this._x=d*h*u-c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u+d*f*m;break;case"YZX":this._x=d*h*u+c*f*m,this._y=c*f*u+d*h*m,this._z=c*h*m-d*f*u,this._w=c*h*u-d*f*m;break;case"XZY":this._x=d*h*u-c*f*m,this._y=c*f*u-d*h*m,this._z=c*h*m+d*f*u,this._w=c*h*u+d*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],u=t[10],d=n+o+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(h-l)*f,this._y=(s-c)*f,this._z=(a-i)*f}else if(n>o&&n>u){const f=2*Math.sqrt(1+n-o-u);this._w=(h-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(s+c)/f}else if(o>u){const f=2*Math.sqrt(1+o-n-u);this._w=(s-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+h)/f}else{const f=2*Math.sqrt(1+u-n-o);this._w=(a-i)/f,this._x=(s+c)/f,this._y=(l+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(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(vt(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),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,i=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+i*c-s*l,this._y=i*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const f=1-t;return this._w=f*a+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-t)*h)/c,d=Math.sin(t*h)/c;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=s*u+this._z*d,this._onChangeCallback(),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(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*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}}class F{constructor(e=0,t=0,n=0){F.prototype.isVector3=!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(mc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(mc.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-s*i),u=2*(s*n-a*t);return this.x=t+l*c+a*u-o*h,this.y=n+l*h+o*c-s*u,this.z=i+l*u+s*h-a*c,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,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,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=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this.z=vt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this.z=vt(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(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,i=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-s*o,this.y=s*a-n*l,this.z=n*o-i*a,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 Ia.copy(this).projectOnVector(e),this.sub(Ia)}reflect(e){return this.sub(Ia.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(vt(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}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 i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*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(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,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}}const Ia=new F,mc=new Rn;class _t{constructor(e,t,n,i,s,a,o,l,c){_t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c)}set(e,t,n,i,s,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=s,h[5]=l,h[6]=n,h[7]=a,h[8]=c,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,i=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],u=n[7],d=n[2],f=n[5],m=n[8],_=i[0],g=i[3],p=i[6],S=i[1],E=i[4],v=i[7],U=i[2],C=i[5],T=i[8];return s[0]=a*_+o*S+l*U,s[3]=a*g+o*E+l*C,s[6]=a*p+o*v+l*T,s[1]=c*_+h*S+u*U,s[4]=c*g+h*E+u*C,s[7]=c*p+h*v+u*T,s[2]=d*_+f*S+m*U,s[5]=d*g+f*E+m*C,s[8]=d*p+f*v+m*T,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],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*s*h+n*o*l+i*s*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=h*a-o*c,d=o*l-h*s,f=c*s-a*l,m=t*u+n*d+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=u*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=d*_,e[4]=(h*t-i*l)*_,e[5]=(i*s-o*t)*_,e[6]=f*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*s)*_,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,i,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ua.makeScale(e,t)),this}rotate(e){return this.premultiply(Ua.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ua.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 i=0;i<9;i++)if(t[i]!==n[i])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)}}const Ua=new _t;function yu(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function os(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function Jf(){const r=os("canvas");return r.style.display="block",r}const gc={};function Ar(r){r in gc||(gc[r]=!0,console.warn(r))}function Kf(r,e,t){return new Promise(function(n,i){function s(){switch(r.clientWaitSync(e,r.SYNC_FLUSH_COMMANDS_BIT,0)){case r.WAIT_FAILED:i();break;case r.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function Zf(r){const e=r.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function Qf(r){const e=r.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const _c=new _t().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),vc=new _t().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function ep(){const r={enabled:!0,workingColorSpace:Dr,spaces:{},convert:function(i,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Ut&&(i.r=fi(i.r),i.g=fi(i.g),i.b=fi(i.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[s].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ut&&(i.r=wr(i.r),i.g=wr(i.g),i.b=wr(i.b))),i},workingToColorSpace:function(i,s){return this.convert(i,this.workingColorSpace,s)},colorSpaceToWorking:function(i,s){return this.convert(i,s,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ai?pa:this.spaces[i].transfer},getLuminanceCoefficients:function(i,s=this.workingColorSpace){return i.fromArray(this.spaces[s].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,s,a){return i.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,s){return Ar("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(i,s)},toWorkingColorSpace:function(i,s){return Ar("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(i,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return r.define({[Dr]:{primaries:e,whitePoint:n,transfer:pa,toXYZ:_c,fromXYZ:vc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Tt},outputColorSpaceConfig:{drawingBufferColorSpace:Tt}},[Tt]:{primaries:e,whitePoint:n,transfer:Ut,toXYZ:_c,fromXYZ:vc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Tt}}}),r}const xt=ep();function fi(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wr(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let rr;class tp{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{rr===void 0&&(rr=os("canvas")),rr.width=e.width,rr.height=e.height;const i=rr.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=rr}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=os("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=fi(s[a]/255)*255;return n.putImageData(i,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(fi(t[n]/255)*255):t[n]=fi(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let np=0;class Ul{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:np++}),this.uuid=Vn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight):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:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?s.push(Na(i[a].image)):s.push(Na(i[a]))}else s=Na(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function Na(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?tp.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ip=0;const Fa=new F;class cn extends $i{constructor(e=cn.DEFAULT_IMAGE,t=cn.DEFAULT_MAPPING,n=kn,i=kn,s=Tn,a=ui,o=Un,l=Qn,c=cn.DEFAULT_ANISOTROPY,h=Ai){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ip++}),this.uuid=Vn(),this.name="",this.source=new Ul(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Xe(0,0),this.repeat=new Xe(1,1),this.center=new Xe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new _t,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,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}get width(){return this.source.getSize(Fa).x}get height(){return this.source.getSize(Fa).y}get depth(){return this.source.getSize(Fa).z}get image(){return this.source.data}set image(e=null){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.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){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.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,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!==cu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $n:e.x=e.x-Math.floor(e.x);break;case kn:e.x=e.x<0?0:1;break;case Fo: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 $n:e.y=e.y-Math.floor(e.y);break;case kn:e.y=e.y<0?0:1;break;case Fo: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++}}cn.DEFAULT_IMAGE=null;cn.DEFAULT_MAPPING=cu;cn.DEFAULT_ANISOTROPY=1;class Mt{constructor(e=0,t=0,n=0,i=1){Mt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}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,i){return this.x=e,this.y=t,this.z=n,this.w=i,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,i=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*s,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,i,s;const l=e.elements,c=l[0],h=l[4],u=l[8],d=l[1],f=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-d)<.01&&Math.abs(u-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(c+1)/2,v=(f+1)/2,U=(p+1)/2,C=(h+d)/4,T=(u+_)/4,L=(m+g)/4;return E>v&&E>U?E<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(E),i=C/n,s=T/n):v>U?v<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(v),n=C/i,s=L/i):U<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(U),n=T/s,i=L/s),this.set(n,i,s,t),this}let S=Math.sqrt((g-m)*(g-m)+(u-_)*(u-_)+(d-h)*(d-h));return Math.abs(S)<.001&&(S=1),this.x=(g-m)/S,this.y=(u-_)/S,this.z=(d-h)/S,this.w=Math.acos((c+f+p-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=vt(this.x,e.x,t.x),this.y=vt(this.y,e.y,t.y),this.z=vt(this.z,e.z,t.z),this.w=vt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=vt(this.x,e,t),this.y=vt(this.y,e,t),this.z=vt(this.z,e,t),this.w=vt(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(vt(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}}class rp extends $i{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Tn,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 Mt(0,0,e,t),this.scissorTest=!1,this.viewport=new Mt(0,0,e,t);const i={width:e,height:t,depth:n.depth},s=new cn(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].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:Tn,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 i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isArrayTexture=this.textures[i].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 i=Object.assign({},e.textures[t].image);this.textures[t].source=new Ul(i)}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}dispose(){this.dispatchEvent({type:"dispose"})}}class ji extends rp{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class xu extends cn{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Cn,this.minFilter=Cn,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class sp extends cn{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Cn,this.minFilter=Cn,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ei{constructor(e=new F(1/0,1/0,1/0),t=new F(-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(Fn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Fn.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=Fn.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 s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Fn):Fn.fromBufferAttribute(s,a),Fn.applyMatrix4(e.matrixWorld),this.expandByPoint(Fn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),_s.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),_s.copy(n.boundingBox)),_s.applyMatrix4(e.matrixWorld),this.union(_s)}const i=e.children;for(let s=0,a=i.length;s<a;s++)this.expandByObject(i[s],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,Fn),Fn.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(kr),vs.subVectors(this.max,kr),sr.subVectors(e.a,kr),ar.subVectors(e.b,kr),or.subVectors(e.c,kr),_i.subVectors(ar,sr),vi.subVectors(or,ar),Li.subVectors(sr,or);let t=[0,-_i.z,_i.y,0,-vi.z,vi.y,0,-Li.z,Li.y,_i.z,0,-_i.x,vi.z,0,-vi.x,Li.z,0,-Li.x,-_i.y,_i.x,0,-vi.y,vi.x,0,-Li.y,Li.x,0];return!Oa(t,sr,ar,or,vs)||(t=[1,0,0,0,1,0,0,0,1],!Oa(t,sr,ar,or,vs))?!1:(ys.crossVectors(_i,vi),t=[ys.x,ys.y,ys.z],Oa(t,sr,ar,or,vs))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Fn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Fn).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:(ri[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ri[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ri[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ri[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ri[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ri[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ri[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ri[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ri),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 ri=[new F,new F,new F,new F,new F,new F,new F,new F],Fn=new F,_s=new ei,sr=new F,ar=new F,or=new F,_i=new F,vi=new F,Li=new F,kr=new F,vs=new F,ys=new F,Ii=new F;function Oa(r,e,t,n,i){for(let s=0,a=r.length-3;s<=a;s+=3){Ii.fromArray(r,s);const o=i.x*Math.abs(Ii.x)+i.y*Math.abs(Ii.y)+i.z*Math.abs(Ii.z),l=e.dot(Ii),c=t.dot(Ii),h=n.dot(Ii);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const ap=new ei,Vr=new F,za=new F;class mi{constructor(e=new F,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):ap.setFromPoints(e).getCenter(n);let i=0;for(let s=0,a=e.length;s<a;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),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)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Vr.subVectors(e,this.center);const t=Vr.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Vr,i/n),this.radius+=i}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):(za.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Vr.copy(e.center).add(za)),this.expandByPoint(Vr.copy(e.center).sub(za))),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}}const si=new F,Ba=new F,xs=new F,yi=new F,ka=new F,Ms=new F,Va=new F;class Ur{constructor(e=new F,t=new F(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,si)),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=si.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(si.copy(this.origin).addScaledVector(this.direction,t),si.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ba.copy(e).add(t).multiplyScalar(.5),xs.copy(t).sub(e).normalize(),yi.copy(this.origin).sub(Ba);const s=e.distanceTo(t)*.5,a=-this.direction.dot(xs),o=yi.dot(this.direction),l=-yi.dot(xs),c=yi.lengthSq(),h=Math.abs(1-a*a);let u,d,f,m;if(h>0)if(u=a*l-o,d=a*o-l,m=s*h,u>=0)if(d>=-m)if(d<=m){const _=1/h;u*=_,d*=_,f=u*(u+a*d+2*o)+d*(a*u+d+2*l)+c}else d=s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d=-s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;else d<=-m?(u=Math.max(0,-(-a*s+o)),d=u>0?-s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c):d<=m?(u=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(u=Math.max(0,-(a*s+o)),d=u>0?s:Math.min(Math.max(-s,-l),s),f=-u*u+d*(d+2*l)+c);else d=a>0?-s:s,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),i&&i.copy(Ba).addScaledVector(xs,d),f}intersectSphere(e,t){si.subVectors(e.center,this.origin);const n=si.dot(this.direction),i=si.dot(si)-n*n,s=e.radius*e.radius;if(i>s)return null;const a=Math.sqrt(s-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,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,i,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),h>=0?(s=(e.min.y-d.y)*h,a=(e.max.y-d.y)*h):(s=(e.max.y-d.y)*h,a=(e.min.y-d.y)*h),n>a||s>i||((s>n||isNaN(n))&&(n=s),(a<i||isNaN(i))&&(i=a),u>=0?(o=(e.min.z-d.z)*u,l=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,l=(e.min.z-d.z)*u),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,si)!==null}intersectTriangle(e,t,n,i,s){ka.subVectors(t,e),Ms.subVectors(n,e),Va.crossVectors(ka,Ms);let a=this.direction.dot(Va),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;yi.subVectors(this.origin,e);const l=o*this.direction.dot(Ms.crossVectors(yi,Ms));if(l<0)return null;const c=o*this.direction.dot(ka.cross(yi));if(c<0||l+c>a)return null;const h=-o*yi.dot(Va);return h<0?null:this.at(h/a,s)}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 lt{constructor(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g){lt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g)}set(e,t,n,i,s,a,o,l,c,h,u,d,f,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=s,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=u,p[14]=d,p[3]=f,p[7]=m,p[11]=_,p[15]=g,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 lt().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 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){const t=this.elements,n=e.elements,i=1/lr.setFromMatrixColumn(e,0).length(),s=1/lr.setFromMatrixColumn(e,1).length(),a=1/lr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,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,i=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(s),u=Math.sin(s);if(e.order==="XYZ"){const d=a*h,f=a*u,m=o*h,_=o*u;t[0]=l*h,t[4]=-l*u,t[8]=c,t[1]=f+m*c,t[5]=d-_*c,t[9]=-o*l,t[2]=_-d*c,t[6]=m+f*c,t[10]=a*l}else if(e.order==="YXZ"){const d=l*h,f=l*u,m=c*h,_=c*u;t[0]=d+_*o,t[4]=m*o-f,t[8]=a*c,t[1]=a*u,t[5]=a*h,t[9]=-o,t[2]=f*o-m,t[6]=_+d*o,t[10]=a*l}else if(e.order==="ZXY"){const d=l*h,f=l*u,m=c*h,_=c*u;t[0]=d-_*o,t[4]=-a*u,t[8]=m+f*o,t[1]=f+m*o,t[5]=a*h,t[9]=_-d*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const d=a*h,f=a*u,m=o*h,_=o*u;t[0]=l*h,t[4]=m*c-f,t[8]=d*c+_,t[1]=l*u,t[5]=_*c+d,t[9]=f*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const d=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=_-d*u,t[8]=m*u+f,t[1]=u,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=f*u+m,t[10]=d-_*u}else if(e.order==="XZY"){const d=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=-u,t[8]=c*h,t[1]=d*u+_,t[5]=a*h,t[9]=f*u-m,t[2]=m*u-f,t[6]=o*h,t[10]=_*u+d}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(op,e,lp)}lookAt(e,t,n){const i=this.elements;return An.subVectors(e,t),An.lengthSq()===0&&(An.z=1),An.normalize(),xi.crossVectors(n,An),xi.lengthSq()===0&&(Math.abs(n.z)===1?An.x+=1e-4:An.z+=1e-4,An.normalize(),xi.crossVectors(n,An)),xi.normalize(),bs.crossVectors(An,xi),i[0]=xi.x,i[4]=bs.x,i[8]=An.x,i[1]=xi.y,i[5]=bs.y,i[9]=An.y,i[2]=xi.z,i[6]=bs.z,i[10]=An.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],u=n[5],d=n[9],f=n[13],m=n[2],_=n[6],g=n[10],p=n[14],S=n[3],E=n[7],v=n[11],U=n[15],C=i[0],T=i[4],L=i[8],b=i[12],x=i[1],R=i[5],B=i[9],V=i[13],W=i[2],ee=i[6],k=i[10],Q=i[14],q=i[3],ue=i[7],ye=i[11],le=i[15];return s[0]=a*C+o*x+l*W+c*q,s[4]=a*T+o*R+l*ee+c*ue,s[8]=a*L+o*B+l*k+c*ye,s[12]=a*b+o*V+l*Q+c*le,s[1]=h*C+u*x+d*W+f*q,s[5]=h*T+u*R+d*ee+f*ue,s[9]=h*L+u*B+d*k+f*ye,s[13]=h*b+u*V+d*Q+f*le,s[2]=m*C+_*x+g*W+p*q,s[6]=m*T+_*R+g*ee+p*ue,s[10]=m*L+_*B+g*k+p*ye,s[14]=m*b+_*V+g*Q+p*le,s[3]=S*C+E*x+v*W+U*q,s[7]=S*T+E*R+v*ee+U*ue,s[11]=S*L+E*B+v*k+U*ye,s[15]=S*b+E*V+v*Q+U*le,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],i=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],u=e[6],d=e[10],f=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+s*l*u-i*c*u-s*o*d+n*c*d+i*o*f-n*l*f)+_*(+t*l*f-t*c*d+s*a*d-i*a*f+i*c*h-s*l*h)+g*(+t*c*u-t*o*f-s*a*u+n*a*f+s*o*h-n*c*h)+p*(-i*o*h-t*l*u+t*o*d+i*a*u-n*a*d+n*l*h)}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 i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],f=e[11],m=e[12],_=e[13],g=e[14],p=e[15],S=u*g*c-_*d*c+_*l*f-o*g*f-u*l*p+o*d*p,E=m*d*c-h*g*c-m*l*f+a*g*f+h*l*p-a*d*p,v=h*_*c-m*u*c+m*o*f-a*_*f-h*o*p+a*u*p,U=m*u*l-h*_*l-m*o*d+a*_*d+h*o*g-a*u*g,C=t*S+n*E+i*v+s*U;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/C;return e[0]=S*T,e[1]=(_*d*s-u*g*s-_*i*f+n*g*f+u*i*p-n*d*p)*T,e[2]=(o*g*s-_*l*s+_*i*c-n*g*c-o*i*p+n*l*p)*T,e[3]=(u*l*s-o*d*s-u*i*c+n*d*c+o*i*f-n*l*f)*T,e[4]=E*T,e[5]=(h*g*s-m*d*s+m*i*f-t*g*f-h*i*p+t*d*p)*T,e[6]=(m*l*s-a*g*s-m*i*c+t*g*c+a*i*p-t*l*p)*T,e[7]=(a*d*s-h*l*s+h*i*c-t*d*c-a*i*f+t*l*f)*T,e[8]=v*T,e[9]=(m*u*s-h*_*s-m*n*f+t*_*f+h*n*p-t*u*p)*T,e[10]=(a*_*s-m*o*s+m*n*c-t*_*c-a*n*p+t*o*p)*T,e[11]=(h*o*s-a*u*s-h*n*c+t*u*c+a*n*f-t*o*f)*T,e[12]=U*T,e[13]=(h*_*i-m*u*i+m*n*d-t*_*d-h*n*g+t*u*g)*T,e[14]=(m*o*i-a*_*i-m*n*l+t*_*l+a*n*g-t*o*g)*T,e[15]=(a*u*i-h*o*i+h*n*l-t*u*l-a*n*d+t*o*d)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,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],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}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),i=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,h=s*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,s*l*l+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,i,s,a){return this.set(1,n,s,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,h=a+a,u=o+o,d=s*c,f=s*h,m=s*u,_=a*h,g=a*u,p=o*u,S=l*c,E=l*h,v=l*u,U=n.x,C=n.y,T=n.z;return i[0]=(1-(_+p))*U,i[1]=(f+v)*U,i[2]=(m-E)*U,i[3]=0,i[4]=(f-v)*C,i[5]=(1-(d+p))*C,i[6]=(g+S)*C,i[7]=0,i[8]=(m+E)*T,i[9]=(g-S)*T,i[10]=(1-(d+_))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=lr.set(i[0],i[1],i[2]).length();const a=lr.set(i[4],i[5],i[6]).length(),o=lr.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],On.copy(this);const c=1/s,h=1/a,u=1/o;return On.elements[0]*=c,On.elements[1]*=c,On.elements[2]*=c,On.elements[4]*=h,On.elements[5]*=h,On.elements[6]*=h,On.elements[8]*=u,On.elements[9]*=u,On.elements[10]*=u,t.setFromRotationMatrix(On),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,i,s,a,o=di){const l=this.elements,c=2*s/(t-e),h=2*s/(n-i),u=(t+e)/(t-e),d=(n+i)/(n-i);let f,m;if(o===di)f=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===ma)f=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=h,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,s,a,o=di){const l=this.elements,c=1/(t-e),h=1/(n-i),u=1/(a-s),d=(t+e)*c,f=(n+i)*h;let m,_;if(o===di)m=(a+s)*u,_=-2*u;else if(o===ma)m=s*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])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}}const lr=new F,On=new lt,op=new F(0,0,0),lp=new F(1,1,1),xi=new F,bs=new F,An=new F,yc=new lt,xc=new Rn;class Sn{constructor(e=0,t=0,n=0,i=Sn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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 i=e.elements,s=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],u=i[2],d=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(vt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-vt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(vt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-vt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(vt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-vt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return yc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return xc.setFromEuler(this),this.setFromQuaternion(xc,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}}Sn.DEFAULT_ORDER="XYZ";class Nl{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 cp=0;const Mc=new F,cr=new Rn,ai=new lt,Ss=new F,Hr=new F,hp=new F,up=new Rn,bc=new F(1,0,0),Sc=new F(0,1,0),Ec=new F(0,0,1),Ac={type:"added"},dp={type:"removed"},hr={type:"childadded",child:null},Ha={type:"childremoved",child:null};class Nt extends $i{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:cp++}),this.uuid=Vn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Nt.DEFAULT_UP.clone();const e=new F,t=new Sn,n=new Rn,i=new F(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),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:i},modelViewMatrix:{value:new lt},normalMatrix:{value:new _t}}),this.matrix=new lt,this.matrixWorld=new lt,this.matrixAutoUpdate=Nt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Nt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Nl,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.userData={}}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 cr.setFromAxisAngle(e,t),this.quaternion.multiply(cr),this}rotateOnWorldAxis(e,t){return cr.setFromAxisAngle(e,t),this.quaternion.premultiply(cr),this}rotateX(e){return this.rotateOnAxis(bc,e)}rotateY(e){return this.rotateOnAxis(Sc,e)}rotateZ(e){return this.rotateOnAxis(Ec,e)}translateOnAxis(e,t){return Mc.copy(e).applyQuaternion(this.quaternion),this.position.add(Mc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(bc,e)}translateY(e){return this.translateOnAxis(Sc,e)}translateZ(e){return this.translateOnAxis(Ec,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ai.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Ss.copy(e):Ss.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Hr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ai.lookAt(Hr,Ss,this.up):ai.lookAt(Ss,Hr,this.up),this.quaternion.setFromRotationMatrix(ai),i&&(ai.extractRotation(i.matrixWorld),cr.setFromRotationMatrix(ai),this.quaternion.premultiply(cr.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.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(Ac),hr.child=e,this.dispatchEvent(hr),hr.child=null):console.error("THREE.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(dp),Ha.child=e,this.dispatchEvent(Ha),Ha.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),ai.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ai.multiply(e.parent.matrixWorld)),e.applyMatrix4(ai),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Ac),hr.child=e,this.dispatchEvent(hr),hr.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,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].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(Hr,e,hp),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Hr,up,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,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;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),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,i=t.length;n<i;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 i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].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 i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const u=l[c];s(e.shapes,u)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));i.material=o}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),u=a(e.shapes),d=a(e.skeletons),f=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),u.length>0&&(n.shapes=u),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}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.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.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Nt.DEFAULT_UP=new F(0,1,0);Nt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Nt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const zn=new F,oi=new F,Ga=new F,li=new F,ur=new F,dr=new F,wc=new F,Wa=new F,Xa=new F,qa=new F,ja=new Mt,Ya=new Mt,$a=new Mt;class In{constructor(e=new F,t=new F,n=new F){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),zn.subVectors(e,t),i.cross(zn);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){zn.subVectors(i,t),oi.subVectors(n,t),Ga.subVectors(e,t);const a=zn.dot(zn),o=zn.dot(oi),l=zn.dot(Ga),c=oi.dot(oi),h=oi.dot(Ga),u=a*c-o*o;if(u===0)return s.set(0,0,0),null;const d=1/u,f=(c*l-o*h)*d,m=(a*h-o*l)*d;return s.set(1-f-m,m,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,li)===null?!1:li.x>=0&&li.y>=0&&li.x+li.y<=1}static getInterpolation(e,t,n,i,s,a,o,l){return this.getBarycoord(e,t,n,i,li)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,li.x),l.addScaledVector(a,li.y),l.addScaledVector(o,li.z),l)}static getInterpolatedAttribute(e,t,n,i,s,a){return ja.setScalar(0),Ya.setScalar(0),$a.setScalar(0),ja.fromBufferAttribute(e,t),Ya.fromBufferAttribute(e,n),$a.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(ja,s.x),a.addScaledVector(Ya,s.y),a.addScaledVector($a,s.z),a}static isFrontFacing(e,t,n,i){return zn.subVectors(n,t),oi.subVectors(e,t),zn.cross(oi).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 zn.subVectors(this.c,this.b),oi.subVectors(this.a,this.b),zn.cross(oi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return In.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return In.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return In.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return In.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return In.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let a,o;ur.subVectors(i,n),dr.subVectors(s,n),Wa.subVectors(e,n);const l=ur.dot(Wa),c=dr.dot(Wa);if(l<=0&&c<=0)return t.copy(n);Xa.subVectors(e,i);const h=ur.dot(Xa),u=dr.dot(Xa);if(h>=0&&u<=h)return t.copy(i);const d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(ur,a);qa.subVectors(e,s);const f=ur.dot(qa),m=dr.dot(qa);if(m>=0&&f<=m)return t.copy(s);const _=f*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(dr,o);const g=h*m-f*u;if(g<=0&&u-h>=0&&f-m>=0)return wc.subVectors(s,i),o=(u-h)/(u-h+(f-m)),t.copy(i).addScaledVector(wc,o);const p=1/(g+_+d);return a=_*p,o=d*p,t.copy(n).addScaledVector(ur,a).addScaledVector(dr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Mu={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},Mi={h:0,s:0,l:0},Es={h:0,s:0,l:0};function Ja(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class ot{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 i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Tt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,xt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=xt.workingColorSpace){return this.r=e,this.g=t,this.b=n,xt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=xt.workingColorSpace){if(e=Il(e,1),t=vt(t,0,1),n=vt(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=Ja(a,s,e+1/3),this.g=Ja(a,s,e),this.b=Ja(a,s,e-1/3)}return xt.colorSpaceToWorking(this,i),this}setStyle(e,t=Tt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Tt){const n=Mu[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=fi(e.r),this.g=fi(e.g),this.b=fi(e.b),this}copyLinearToSRGB(e){return this.r=wr(e.r),this.g=wr(e.g),this.b=wr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tt){return xt.workingToColorSpace(fn.copy(this),e),Math.round(vt(fn.r*255,0,255))*65536+Math.round(vt(fn.g*255,0,255))*256+Math.round(vt(fn.b*255,0,255))}getHexString(e=Tt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=xt.workingColorSpace){xt.workingToColorSpace(fn.copy(this),t);const n=fn.r,i=fn.g,s=fn.b,a=Math.max(n,i,s),o=Math.min(n,i,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const u=a-o;switch(c=h<=.5?u/(a+o):u/(2-a-o),a){case n:l=(i-s)/u+(i<s?6:0);break;case i:l=(s-n)/u+2;break;case s:l=(n-i)/u+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=xt.workingColorSpace){return xt.workingToColorSpace(fn.copy(this),t),e.r=fn.r,e.g=fn.g,e.b=fn.b,e}getStyle(e=Tt){xt.workingToColorSpace(fn.copy(this),e);const t=fn.r,n=fn.g,i=fn.b;return e!==Tt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Mi),this.setHSL(Mi.h+e,Mi.s+t,Mi.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(Mi),e.getHSL(Es);const n=Zr(Mi.h,Es.h,t),i=Zr(Mi.s,Es.s,t),s=Zr(Mi.l,Es.l,t);return this.setHSL(n,i,s),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,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,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 fn=new ot;ot.NAMES=Mu;let fp=0;class Nn extends $i{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fp++}),this.uuid=Vn(),this.name="",this.type="Material",this.blending=Er,this.side=Hn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ao,this.blendDst=wo,this.blendEquation=Vi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ot(0,0,0),this.blendAlpha=0,this.depthFunc=Tr,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=dc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ir,this.stencilZFail=ir,this.stencilZPass=ir,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){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.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"}};n.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.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!==Er&&(n.blending=this.blending),this.side!==Hn&&(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!==Ao&&(n.blendSrc=this.blendSrc),this.blendDst!==wo&&(n.blendDst=this.blendDst),this.blendEquation!==Vi&&(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!==Tr&&(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!==dc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ir&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ir&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ir&&(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.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 i(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=i(e.textures),a=i(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}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 i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].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.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 Ri extends Nn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ot(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 Sn,this.combine=ba,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 qt=new F,As=new Xe;let pp=0;class Gt{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:pp++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=hl,this.updateRanges=[],this.gpuType=Jn,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;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];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++)As.fromBufferAttribute(this,t),As.applyMatrix3(e),this.setXY(t,As.x,As.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix3(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix4(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyNormalMatrix(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.transformDirection(e),this.setXYZ(t,qt.x,qt.y,qt.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=Bn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=It(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Bn(t,this.array)),t}setX(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Bn(t,this.array)),t}setY(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=It(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=Bn(t,this.array)),t}setW(e,t){return this.normalized&&(t=It(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),i=It(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=It(t,this.array),n=It(n,this.array),i=It(i,this.array),s=It(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,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!==hl&&(e.usage=this.usage),e}}class bu extends Gt{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class mp extends Gt{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Su extends Gt{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class mt extends Gt{constructor(e,t,n){super(new Float32Array(e),t,n)}}let gp=0;const Dn=new lt,Ka=new Nt,fr=new F,wn=new ei,Gr=new ei,Qt=new F;class Bt extends $i{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:gp++}),this.uuid=Vn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(yu(e)?Su:bu)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,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 s=new _t().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Dn.makeRotationFromQuaternion(e),this.applyMatrix4(Dn),this}rotateX(e){return Dn.makeRotationX(e),this.applyMatrix4(Dn),this}rotateY(e){return Dn.makeRotationY(e),this.applyMatrix4(Dn),this}rotateZ(e){return Dn.makeRotationZ(e),this.applyMatrix4(Dn),this}translate(e,t,n){return Dn.makeTranslation(e,t,n),this.applyMatrix4(Dn),this}scale(e,t,n){return Dn.makeScale(e,t,n),this.applyMatrix4(Dn),this}lookAt(e){return Ka.lookAt(e),Ka.updateMatrix(),this.applyMatrix4(Ka.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(fr).negate(),this.translate(fr.x,fr.y,fr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,s=e.length;i<s;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new mt(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const s=e[i];t.setXYZ(i,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.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 ei);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];wn.setFromBufferAttribute(s),this.morphTargetsRelative?(Qt.addVectors(this.boundingBox.min,wn.min),this.boundingBox.expandByPoint(Qt),Qt.addVectors(this.boundingBox.max,wn.max),this.boundingBox.expandByPoint(Qt)):(this.boundingBox.expandByPoint(wn.min),this.boundingBox.expandByPoint(wn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new mi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new F,1/0);return}if(e){const n=this.boundingSphere.center;if(wn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Gr.setFromBufferAttribute(o),this.morphTargetsRelative?(Qt.addVectors(wn.min,Gr.min),wn.expandByPoint(Qt),Qt.addVectors(wn.max,Gr.max),wn.expandByPoint(Qt)):(wn.expandByPoint(Gr.min),wn.expandByPoint(Gr.max))}wn.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)Qt.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Qt));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)Qt.fromBufferAttribute(o,c),l&&(fr.fromBufferAttribute(e,c),Qt.add(fr)),i=Math.max(i,n.distanceToSquared(Qt))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Gt(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let L=0;L<n.count;L++)o[L]=new F,l[L]=new F;const c=new F,h=new F,u=new F,d=new Xe,f=new Xe,m=new Xe,_=new F,g=new F;function p(L,b,x){c.fromBufferAttribute(n,L),h.fromBufferAttribute(n,b),u.fromBufferAttribute(n,x),d.fromBufferAttribute(s,L),f.fromBufferAttribute(s,b),m.fromBufferAttribute(s,x),h.sub(c),u.sub(c),f.sub(d),m.sub(d);const R=1/(f.x*m.y-m.x*f.y);isFinite(R)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(u,-f.y).multiplyScalar(R),g.copy(u).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(R),o[L].add(_),o[b].add(_),o[x].add(_),l[L].add(g),l[b].add(g),l[x].add(g))}let S=this.groups;S.length===0&&(S=[{start:0,count:e.count}]);for(let L=0,b=S.length;L<b;++L){const x=S[L],R=x.start,B=x.count;for(let V=R,W=R+B;V<W;V+=3)p(e.getX(V+0),e.getX(V+1),e.getX(V+2))}const E=new F,v=new F,U=new F,C=new F;function T(L){U.fromBufferAttribute(i,L),C.copy(U);const b=o[L];E.copy(b),E.sub(U.multiplyScalar(U.dot(b))).normalize(),v.crossVectors(C,b);const R=v.dot(l[L])<0?-1:1;a.setXYZW(L,E.x,E.y,E.z,R)}for(let L=0,b=S.length;L<b;++L){const x=S[L],R=x.start,B=x.count;for(let V=R,W=R+B;V<W;V+=3)T(e.getX(V+0)),T(e.getX(V+1)),T(e.getX(V+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 Gt(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const i=new F,s=new F,a=new F,o=new F,l=new F,c=new F,h=new F,u=new F;if(e)for(let d=0,f=e.count;d<f;d+=3){const m=e.getX(d+0),_=e.getX(d+1),g=e.getX(d+2);i.fromBufferAttribute(t,m),s.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),h.subVectors(a,s),u.subVectors(i,s),h.cross(u),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(h),l.add(h),c.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let d=0,f=t.count;d<f;d+=3)i.fromBufferAttribute(t,d+0),s.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),h.subVectors(a,s),u.subVectors(i,s),h.cross(u),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Qt.fromBufferAttribute(e,t),Qt.normalize(),e.setXYZ(t,Qt.x,Qt.y,Qt.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,u=o.normalized,d=new c.constructor(l.length*h);let f=0,m=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?f=l[_]*o.data.stride+o.offset:f=l[_]*h;for(let p=0;p<h;p++)d[m++]=c[f++]}return new Gt(d,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Bt,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=e(l,n);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let h=0,u=c.length;h<u;h++){const d=c[h],f=e(d,n);l.push(f)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.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 l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);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 l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){const f=c[u];h.push(f.toJSON(e.data))}h.length>0&&(i[l]=h,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.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 i=e.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(t))}const s=e.morphAttributes;for(const c in s){const h=[],u=s[c];for(let d=0,f=u.length;d<f;d++)h.push(u[d].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const u=a[c];this.addGroup(u.start,u.count,u.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Tc=new lt,Ui=new Ur,ws=new mi,Cc=new F,Ts=new F,Cs=new F,Rs=new F,Za=new F,Ds=new F,Rc=new F,Ps=new F;class Rt extends Nt{constructor(e=new Bt,t=new Ri){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 i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=i.length;s<a;s++){const o=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(s&&o){Ds.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=o[l],u=s[l];h!==0&&(Za.fromBufferAttribute(u,e),a?Ds.addScaledVector(Za,h):Ds.addScaledVector(Za.sub(t),h))}t.add(Ds)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ws.copy(n.boundingSphere),ws.applyMatrix4(s),Ui.copy(e.ray).recast(e.near),!(ws.containsPoint(Ui.origin)===!1&&(Ui.intersectSphere(ws,Cc)===null||Ui.origin.distanceToSquared(Cc)>(e.far-e.near)**2))&&(Tc.copy(s).invert(),Ui.copy(e.ray).applyMatrix4(Tc),!(n.boundingBox!==null&&Ui.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Ui)))}_computeIntersections(e,t,n){let i;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,u=s.attributes.normal,d=s.groups,f=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],S=Math.max(g.start,f.start),E=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let v=S,U=E;v<U;v+=3){const C=o.getX(v),T=o.getX(v+1),L=o.getX(v+2);i=Ls(this,p,e,n,c,h,u,C,T,L),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(o.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const S=o.getX(g),E=o.getX(g+1),v=o.getX(g+2);i=Ls(this,a,e,n,c,h,u,S,E,v),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=d.length;m<_;m++){const g=d[m],p=a[g.materialIndex],S=Math.max(g.start,f.start),E=Math.min(l.count,Math.min(g.start+g.count,f.start+f.count));for(let v=S,U=E;v<U;v+=3){const C=v,T=v+1,L=v+2;i=Ls(this,p,e,n,c,h,u,C,T,L),i&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(l.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const S=g,E=g+1,v=g+2;i=Ls(this,a,e,n,c,h,u,S,E,v),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}}}function _p(r,e,t,n,i,s,a,o){let l;if(e.side===vn?l=n.intersectTriangle(a,s,i,!0,o):l=n.intersectTriangle(i,s,a,e.side===Hn,o),l===null)return null;Ps.copy(o),Ps.applyMatrix4(r.matrixWorld);const c=t.ray.origin.distanceTo(Ps);return c<t.near||c>t.far?null:{distance:c,point:Ps.clone(),object:r}}function Ls(r,e,t,n,i,s,a,o,l,c){r.getVertexPosition(o,Ts),r.getVertexPosition(l,Cs),r.getVertexPosition(c,Rs);const h=_p(r,e,t,n,Ts,Cs,Rs,Rc);if(h){const u=new F;In.getBarycoord(Rc,Ts,Cs,Rs,u),i&&(h.uv=In.getInterpolatedAttribute(i,o,l,c,u,new Xe)),s&&(h.uv1=In.getInterpolatedAttribute(s,o,l,c,u,new Xe)),a&&(h.normal=In.getInterpolatedAttribute(a,o,l,c,u,new F),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new F,materialIndex:0};In.getNormal(Ts,Cs,Rs,d.normal),h.face=d,h.barycoord=u}return h}class Nr extends Bt{constructor(e=1,t=1,n=1,i=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:a};const o=this;i=Math.floor(i),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],u=[];let d=0,f=0;m("z","y","x",-1,-1,n,t,e,a,s,0),m("z","y","x",1,-1,n,t,-e,a,s,1),m("x","z","y",1,1,e,n,t,i,a,2),m("x","z","y",1,-1,e,n,-t,i,a,3),m("x","y","z",1,-1,e,t,n,i,s,4),m("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new mt(c,3)),this.setAttribute("normal",new mt(h,3)),this.setAttribute("uv",new mt(u,2));function m(_,g,p,S,E,v,U,C,T,L,b){const x=v/T,R=U/L,B=v/2,V=U/2,W=C/2,ee=T+1,k=L+1;let Q=0,q=0;const ue=new F;for(let ye=0;ye<k;ye++){const le=ye*R-V;for(let Pe=0;Pe<ee;Pe++){const Te=Pe*x-B;ue[_]=Te*S,ue[g]=le*E,ue[p]=W,c.push(ue.x,ue.y,ue.z),ue[_]=0,ue[g]=0,ue[p]=C>0?1:-1,h.push(ue.x,ue.y,ue.z),u.push(Pe/T),u.push(1-ye/L),Q+=1}}for(let ye=0;ye<L;ye++)for(let le=0;le<T;le++){const Pe=d+le+ee*ye,Te=d+le+ee*(ye+1),Y=d+(le+1)+ee*(ye+1),re=d+(le+1)+ee*ye;l.push(Pe,Te,re),l.push(Te,Y,re),q+=6}o.addGroup(f,q,b),f+=q,d+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Lr(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function _n(r){const e={};for(let t=0;t<r.length;t++){const n=Lr(r[t]);for(const i in n)e[i]=n[i]}return e}function vp(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function Eu(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:xt.workingColorSpace}const Fl={clone:Lr,merge:_n};var yp=`void main() {
6
6
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
7
7
  }`,xp=`void main() {
8
8
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
@@ -3571,7 +3571,7 @@ void main() {
3571
3571
  #include <tonemapping_fragment>
3572
3572
  #include <colorspace_fragment>
3573
3573
  #include <fog_fragment>
3574
- }`,yt={alphahash_fragment:S0,alphahash_pars_fragment:E0,alphamap_fragment:A0,alphamap_pars_fragment:w0,alphatest_fragment:T0,alphatest_pars_fragment:C0,aomap_fragment:R0,aomap_pars_fragment:D0,batching_pars_vertex:P0,batching_vertex:L0,begin_vertex:I0,beginnormal_vertex:U0,bsdfs:N0,iridescence_fragment:F0,bumpmap_pars_fragment:O0,clipping_planes_fragment:z0,clipping_planes_pars_fragment:B0,clipping_planes_pars_vertex:k0,clipping_planes_vertex:V0,color_fragment:H0,color_pars_fragment:G0,color_pars_vertex:W0,color_vertex:X0,common:q0,cube_uv_reflection_fragment:j0,defaultnormal_vertex:Y0,displacementmap_pars_vertex:$0,displacementmap_vertex:J0,emissivemap_fragment:K0,emissivemap_pars_fragment:Z0,colorspace_fragment:Q0,colorspace_pars_fragment:em,envmap_fragment:tm,envmap_common_pars_fragment:nm,envmap_pars_fragment:im,envmap_pars_vertex:rm,envmap_physical_pars_fragment:mm,envmap_vertex:sm,fog_vertex:am,fog_pars_vertex:om,fog_fragment:lm,fog_pars_fragment:cm,gradientmap_pars_fragment:hm,lightmap_pars_fragment:um,lights_lambert_fragment:dm,lights_lambert_pars_fragment:fm,lights_pars_begin:pm,lights_toon_fragment:gm,lights_toon_pars_fragment:_m,lights_phong_fragment:vm,lights_phong_pars_fragment:ym,lights_physical_fragment:xm,lights_physical_pars_fragment:Mm,lights_fragment_begin:bm,lights_fragment_maps:Sm,lights_fragment_end:Em,logdepthbuf_fragment:Am,logdepthbuf_pars_fragment:wm,logdepthbuf_pars_vertex:Tm,logdepthbuf_vertex:Cm,map_fragment:Rm,map_pars_fragment:Dm,map_particle_fragment:Pm,map_particle_pars_fragment:Lm,metalnessmap_fragment:Im,metalnessmap_pars_fragment:Um,morphinstance_vertex:Nm,morphcolor_vertex:Fm,morphnormal_vertex:Om,morphtarget_pars_vertex:zm,morphtarget_vertex:Bm,normal_fragment_begin:km,normal_fragment_maps:Vm,normal_pars_fragment:Hm,normal_pars_vertex:Gm,normal_vertex:Wm,normalmap_pars_fragment:Xm,clearcoat_normal_fragment_begin:qm,clearcoat_normal_fragment_maps:jm,clearcoat_pars_fragment:Ym,iridescence_pars_fragment:$m,opaque_fragment:Jm,packing:Km,premultiplied_alpha_fragment:Zm,project_vertex:Qm,dithering_fragment:e1,dithering_pars_fragment:t1,roughnessmap_fragment:n1,roughnessmap_pars_fragment:i1,shadowmap_pars_fragment:r1,shadowmap_pars_vertex:s1,shadowmap_vertex:a1,shadowmask_pars_fragment:o1,skinbase_vertex:l1,skinning_pars_vertex:c1,skinning_vertex:h1,skinnormal_vertex:u1,specularmap_fragment:d1,specularmap_pars_fragment:f1,tonemapping_fragment:p1,tonemapping_pars_fragment:m1,transmission_fragment:g1,transmission_pars_fragment:_1,uv_pars_fragment:v1,uv_pars_vertex:y1,uv_vertex:x1,worldpos_vertex:M1,background_vert:b1,background_frag:S1,backgroundCube_vert:E1,backgroundCube_frag:A1,cube_vert:w1,cube_frag:T1,depth_vert:C1,depth_frag:R1,distanceRGBA_vert:D1,distanceRGBA_frag:P1,equirect_vert:L1,equirect_frag:I1,linedashed_vert:U1,linedashed_frag:N1,meshbasic_vert:F1,meshbasic_frag:O1,meshlambert_vert:z1,meshlambert_frag:B1,meshmatcap_vert:k1,meshmatcap_frag:V1,meshnormal_vert:H1,meshnormal_frag:G1,meshphong_vert:W1,meshphong_frag:X1,meshphysical_vert:q1,meshphysical_frag:j1,meshtoon_vert:Y1,meshtoon_frag:$1,points_vert:J1,points_frag:K1,shadow_vert:Z1,shadow_frag:Q1,sprite_vert:e2,sprite_frag:t2},Ne={common:{diffuse:{value:new ot(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},envMapRotation:{value:new _t},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new Xe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ot(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ot(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new ot(16777215)},opacity:{value:1},center:{value:new Xe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},bn={basic:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.fog]),vertexShader:yt.meshbasic_vert,fragmentShader:yt.meshbasic_frag},lambert:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new ot(0)}}]),vertexShader:yt.meshlambert_vert,fragmentShader:yt.meshlambert_frag},phong:{uniforms:_n([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new ot(0)},specular:{value:new ot(1118481)},shininess:{value:30}}]),vertexShader:yt.meshphong_vert,fragmentShader:yt.meshphong_frag},standard:{uniforms:_n([Ne.common,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.roughnessmap,Ne.metalnessmap,Ne.fog,Ne.lights,{emissive:{value:new ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag},toon:{uniforms:_n([Ne.common,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.gradientmap,Ne.fog,Ne.lights,{emissive:{value:new ot(0)}}]),vertexShader:yt.meshtoon_vert,fragmentShader:yt.meshtoon_frag},matcap:{uniforms:_n([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,{matcap:{value:null}}]),vertexShader:yt.meshmatcap_vert,fragmentShader:yt.meshmatcap_frag},points:{uniforms:_n([Ne.points,Ne.fog]),vertexShader:yt.points_vert,fragmentShader:yt.points_frag},dashed:{uniforms:_n([Ne.common,Ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yt.linedashed_vert,fragmentShader:yt.linedashed_frag},depth:{uniforms:_n([Ne.common,Ne.displacementmap]),vertexShader:yt.depth_vert,fragmentShader:yt.depth_frag},normal:{uniforms:_n([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,{opacity:{value:1}}]),vertexShader:yt.meshnormal_vert,fragmentShader:yt.meshnormal_frag},sprite:{uniforms:_n([Ne.sprite,Ne.fog]),vertexShader:yt.sprite_vert,fragmentShader:yt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yt.background_vert,fragmentShader:yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new _t}},vertexShader:yt.backgroundCube_vert,fragmentShader:yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yt.cube_vert,fragmentShader:yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yt.equirect_vert,fragmentShader:yt.equirect_frag},distanceRGBA:{uniforms:_n([Ne.common,Ne.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yt.distanceRGBA_vert,fragmentShader:yt.distanceRGBA_frag},shadow:{uniforms:_n([Ne.lights,Ne.fog,{color:{value:new ot(0)},opacity:{value:1}}]),vertexShader:yt.shadow_vert,fragmentShader:yt.shadow_frag}};bn.physical={uniforms:_n([bn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new Xe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new ot(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new Xe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new ot(0)},specularColor:{value:new ot(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new Xe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag};const qs={r:0,b:0,g:0},Fi=new Sn,n2=new lt;function i2(r,e,t,n,i,s,a){const o=new ot(0);let l=s===!0?0:1,c,h,u=null,d=0,f=null;function m(E){let v=E.isScene===!0?E.background:null;return v&&v.isTexture&&(v=(E.backgroundBlurriness>0?t:e).get(v)),v}function _(E){let v=!1;const U=m(E);U===null?p(o,l):U&&U.isColor&&(p(U,1),v=!0);const C=r.xr.getEnvironmentBlendMode();C==="additive"?n.buffers.color.setClear(0,0,0,1,a):C==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(r.autoClear||v)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function g(E,v){const U=m(v);U&&(U.isCubeTexture||U.mapping===Sa)?(h===void 0&&(h=new Rt(new Nr(1,1,1),new pi({name:"BackgroundCubeMaterial",uniforms:Lr(bn.backgroundCube.uniforms),vertexShader:bn.backgroundCube.vertexShader,fragmentShader:bn.backgroundCube.fragmentShader,side:vn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,T,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Fi.copy(v.backgroundRotation),Fi.x*=-1,Fi.y*=-1,Fi.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Fi.y*=-1,Fi.z*=-1),h.material.uniforms.envMap.value=U,h.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(n2.makeRotationFromEuler(Fi)),h.material.toneMapped=xt.getTransfer(U.colorSpace)!==Ut,(u!==U||d!==U.version||f!==r.toneMapping)&&(h.material.needsUpdate=!0,u=U,d=U.version,f=r.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):U&&U.isTexture&&(c===void 0&&(c=new Rt(new us(2,2),new pi({name:"BackgroundMaterial",uniforms:Lr(bn.background.uniforms),vertexShader:bn.background.vertexShader,fragmentShader:bn.background.fragmentShader,side:Hn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=U,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=xt.getTransfer(U.colorSpace)!==Ut,U.matrixAutoUpdate===!0&&U.updateMatrix(),c.material.uniforms.uvTransform.value.copy(U.matrix),(u!==U||d!==U.version||f!==r.toneMapping)&&(c.material.needsUpdate=!0,u=U,d=U.version,f=r.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function p(E,v){E.getRGB(qs,Eu(r)),n.buffers.color.setClear(qs.r,qs.g,qs.b,v,a)}function S(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,v=1){o.set(E),l=v,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,p(o,l)},render:_,addToRenderList:g,dispose:S}}function r2(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null);let s=i,a=!1;function o(x,R,B,V,W){let ee=!1;const k=u(V,B,R);s!==k&&(s=k,c(s.object)),ee=f(x,V,B,W),ee&&m(x,V,B,W),W!==null&&e.update(W,r.ELEMENT_ARRAY_BUFFER),(ee||a)&&(a=!1,v(x,R,B,V),W!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function l(){return r.createVertexArray()}function c(x){return r.bindVertexArray(x)}function h(x){return r.deleteVertexArray(x)}function u(x,R,B){const V=B.wireframe===!0;let W=n[x.id];W===void 0&&(W={},n[x.id]=W);let ee=W[R.id];ee===void 0&&(ee={},W[R.id]=ee);let k=ee[V];return k===void 0&&(k=d(l()),ee[V]=k),k}function d(x){const R=[],B=[],V=[];for(let W=0;W<t;W++)R[W]=0,B[W]=0,V[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:B,attributeDivisors:V,object:x,attributes:{},index:null}}function f(x,R,B,V){const W=s.attributes,ee=R.attributes;let k=0;const Q=B.getAttributes();for(const q in Q)if(Q[q].location>=0){const ye=W[q];let le=ee[q];if(le===void 0&&(q==="instanceMatrix"&&x.instanceMatrix&&(le=x.instanceMatrix),q==="instanceColor"&&x.instanceColor&&(le=x.instanceColor)),ye===void 0||ye.attribute!==le||le&&ye.data!==le.data)return!0;k++}return s.attributesNum!==k||s.index!==V}function m(x,R,B,V){const W={},ee=R.attributes;let k=0;const Q=B.getAttributes();for(const q in Q)if(Q[q].location>=0){let ye=ee[q];ye===void 0&&(q==="instanceMatrix"&&x.instanceMatrix&&(ye=x.instanceMatrix),q==="instanceColor"&&x.instanceColor&&(ye=x.instanceColor));const le={};le.attribute=ye,ye&&ye.data&&(le.data=ye.data),W[q]=le,k++}s.attributes=W,s.attributesNum=k,s.index=V}function _(){const x=s.newAttributes;for(let R=0,B=x.length;R<B;R++)x[R]=0}function g(x){p(x,0)}function p(x,R){const B=s.newAttributes,V=s.enabledAttributes,W=s.attributeDivisors;B[x]=1,V[x]===0&&(r.enableVertexAttribArray(x),V[x]=1),W[x]!==R&&(r.vertexAttribDivisor(x,R),W[x]=R)}function S(){const x=s.newAttributes,R=s.enabledAttributes;for(let B=0,V=R.length;B<V;B++)R[B]!==x[B]&&(r.disableVertexAttribArray(B),R[B]=0)}function E(x,R,B,V,W,ee,k){k===!0?r.vertexAttribIPointer(x,R,B,W,ee):r.vertexAttribPointer(x,R,B,V,W,ee)}function v(x,R,B,V){_();const W=V.attributes,ee=B.getAttributes(),k=R.defaultAttributeValues;for(const Q in ee){const q=ee[Q];if(q.location>=0){let he=W[Q];if(he===void 0&&(Q==="instanceMatrix"&&x.instanceMatrix&&(he=x.instanceMatrix),Q==="instanceColor"&&x.instanceColor&&(he=x.instanceColor)),he!==void 0){const ye=he.normalized,le=he.itemSize,Le=e.get(he);if(Le===void 0)continue;const we=Le.buffer,Y=Le.type,re=Le.bytesPerElement,ae=Y===r.INT||Y===r.UNSIGNED_INT||he.gpuType===wl;if(he.isInterleavedBufferAttribute){const oe=he.data,Se=oe.stride,_e=he.offset;if(oe.isInstancedInterleavedBuffer){for(let Ae=0;Ae<q.locationSize;Ae++)p(q.location+Ae,oe.meshPerAttribute);x.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=oe.meshPerAttribute*oe.count)}else for(let Ae=0;Ae<q.locationSize;Ae++)g(q.location+Ae);r.bindBuffer(r.ARRAY_BUFFER,we);for(let Ae=0;Ae<q.locationSize;Ae++)E(q.location+Ae,le/q.locationSize,Y,ye,Se*re,(_e+le/q.locationSize*Ae)*re,ae)}else{if(he.isInstancedBufferAttribute){for(let oe=0;oe<q.locationSize;oe++)p(q.location+oe,he.meshPerAttribute);x.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=he.meshPerAttribute*he.count)}else for(let oe=0;oe<q.locationSize;oe++)g(q.location+oe);r.bindBuffer(r.ARRAY_BUFFER,we);for(let oe=0;oe<q.locationSize;oe++)E(q.location+oe,le/q.locationSize,Y,ye,le*re,le/q.locationSize*oe*re,ae)}}else if(k!==void 0){const ye=k[Q];if(ye!==void 0)switch(ye.length){case 2:r.vertexAttrib2fv(q.location,ye);break;case 3:r.vertexAttrib3fv(q.location,ye);break;case 4:r.vertexAttrib4fv(q.location,ye);break;default:r.vertexAttrib1fv(q.location,ye)}}}}S()}function U(){L();for(const x in n){const R=n[x];for(const B in R){const V=R[B];for(const W in V)h(V[W].object),delete V[W];delete R[B]}delete n[x]}}function C(x){if(n[x.id]===void 0)return;const R=n[x.id];for(const B in R){const V=R[B];for(const W in V)h(V[W].object),delete V[W];delete R[B]}delete n[x.id]}function T(x){for(const R in n){const B=n[R];if(B[x.id]===void 0)continue;const V=B[x.id];for(const W in V)h(V[W].object),delete V[W];delete B[x.id]}}function L(){b(),a=!0,s!==i&&(s=i,c(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:L,resetDefaultState:b,dispose:U,releaseStatesOfGeometry:C,releaseStatesOfProgram:T,initAttributes:_,enableAttribute:g,disableUnusedAttributes:S}}function s2(r,e,t){let n;function i(c){n=c}function s(c,h){r.drawArrays(n,c,h),t.update(h,n,1)}function a(c,h,u){u!==0&&(r.drawArraysInstanced(n,c,h,u),t.update(h,n,u))}function o(c,h,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,u);let f=0;for(let m=0;m<u;m++)f+=h[m];t.update(f,n,1)}function l(c,h,u,d){if(u===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let m=0;m<c.length;m++)a(c[m],h[m],d[m]);else{f.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,u);let m=0;for(let _=0;_<u;_++)m+=h[_]*d[_];t.update(m,n,1)}}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function a2(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const T=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(T){return!(T!==Un&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(T){const L=T===hs&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(T!==Qn&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==Jn&&!L)}function l(T){if(T==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),S=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),U=m>0,C=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:S,maxVaryings:E,maxFragmentUniforms:v,vertexTextures:U,maxSamples:C}}function o2(r){const e=this;let t=null,n=0,i=!1,s=!1;const a=new Ei,o=new _t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||i;return i=d,n=u.length,f},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,d){t=h(u,d,0)},this.setState=function(u,d,f){const m=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,p=r.get(u);if(!i||m===null||m.length===0||s&&!g)s?h(null):c();else{const S=s?0:n,E=S*4;let v=p.clippingState||null;l.value=v,v=h(m,d,E,f);for(let U=0;U!==E;++U)v[U]=t[U];p.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,d,f,m){const _=u!==null?u.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=f+_*4,S=d.matrixWorldInverse;o.getNormalMatrix(S),(g===null||g.length<p)&&(g=new Float32Array(p));for(let E=0,v=f;E!==_;++E,v+=4)a.copy(u[E]).applyMatrix4(S,o),a.normal.toArray(g,v),g[v+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}function l2(r){let e=new WeakMap;function t(a,o){return o===Uo?a.mapping=Cr:o===No&&(a.mapping=Rr),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Uo||o===No)if(e.has(a)){const l=e.get(a).texture;return t(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new bp(l.height);return c.fromEquirectangularTexture(r,a),e.set(a,c),a.addEventListener("dispose",i),t(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}const Sr=4,sh=[.125,.215,.35,.446,.526,.582],Gi=20,ho=new Ta,ah=new ot;let uo=null,fo=0,po=0,mo=!1;const ki=(1+Math.sqrt(5))/2,xr=1/ki,oh=[new F(-ki,xr,0),new F(ki,xr,0),new F(-xr,0,ki),new F(xr,0,ki),new F(0,ki,-xr),new F(0,ki,xr),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],c2=new F;class lh{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100,s={}){const{size:a=256,position:o=c2}=s;uo=this._renderer.getRenderTarget(),fo=this._renderer.getActiveCubeFace(),po=this._renderer.getActiveMipmapLevel(),mo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=uh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=hh(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(uo,fo,po),this._renderer.xr.enabled=mo,e.scissorTest=!1,js(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Cr||e.mapping===Rr?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),uo=this._renderer.getRenderTarget(),fo=this._renderer.getActiveCubeFace(),po=this._renderer.getActiveMipmapLevel(),mo=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:Tn,minFilter:Tn,generateMipmaps:!1,type:hs,format:Un,colorSpace:Dr,depthBuffer:!1},i=ch(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=ch(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=h2(s)),this._blurMaterial=u2(s,e,t)}return i}_compileMaterial(e){const t=new Rt(this._lodPlanes[0],e);this._renderer.compile(t,ho)}_sceneToCubeUV(e,t,n,i,s){const l=new ln(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,f=u.toneMapping;u.getClearColor(ah),u.toneMapping=Ti,u.autoClear=!1;const m=new Ri({name:"PMREM.Background",side:vn,depthWrite:!1,depthTest:!1}),_=new Rt(new Nr,m);let g=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,g=!0):(m.color.copy(ah),g=!0);for(let S=0;S<6;S++){const E=S%3;E===0?(l.up.set(0,c[S],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+h[S],s.y,s.z)):E===1?(l.up.set(0,0,c[S]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+h[S],s.z)):(l.up.set(0,c[S],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+h[S]));const v=this._cubeSize;js(i,E*v,S>2?v:0,v,v),u.setRenderTarget(i),g&&u.render(_,l),u.render(e,l)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Cr||e.mapping===Rr;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=uh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=hh());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new Rt(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;js(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,ho)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=oh[(i-s-1)%oh.length];this._blur(e,s-1,s,a,o)}t.autoClear=n}_blur(e,t,n,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",s),this._halfBlur(a,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,u=new Rt(this._lodPlanes[i],c),d=c.uniforms,f=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*Gi-1),_=s/m,g=isFinite(s)?1+Math.floor(h*_):Gi;g>Gi&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Gi}`);const p=[];let S=0;for(let T=0;T<Gi;++T){const L=T/_,b=Math.exp(-L*L/2);p.push(b),T===0?S+=b:T<g&&(S+=2*b)}for(let T=0;T<p.length;T++)p[T]=p[T]/S;d.envMap.value=e.texture,d.samples.value=g,d.weights.value=p,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:E}=this;d.dTheta.value=m,d.mipInt.value=E-n;const v=this._sizeLods[i],U=3*v*(i>E-Sr?i-E+Sr:0),C=4*(this._cubeSize-v);js(t,U,C,3*v,2*v),l.setRenderTarget(t),l.render(u,ho)}}function h2(r){const e=[],t=[],n=[];let i=r;const s=r-Sr+1+sh.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);t.push(o);let l=1/o;a>r-Sr?l=sh[a-r+Sr-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,u=1+c,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,_=3,g=2,p=1,S=new Float32Array(_*m*f),E=new Float32Array(g*m*f),v=new Float32Array(p*m*f);for(let C=0;C<f;C++){const T=C%3*2/3-1,L=C>2?0:-1,b=[T,L,0,T+2/3,L,0,T+2/3,L+1,0,T,L,0,T+2/3,L+1,0,T,L+1,0];S.set(b,_*m*C),E.set(d,g*m*C);const x=[C,C,C,C,C,C];v.set(x,p*m*C)}const U=new Bt;U.setAttribute("position",new Gt(S,_)),U.setAttribute("uv",new Gt(E,g)),U.setAttribute("faceIndex",new Gt(v,p)),e.push(U),i>Sr&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function ch(r,e,t){const n=new ji(r,e,t);return n.texture.mapping=Sa,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function js(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function u2(r,e,t){const n=new Float32Array(Gi),i=new F(0,1,0);return new pi({name:"SphericalGaussianBlur",defines:{n:Gi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:$l(),fragmentShader:`
3574
+ }`,yt={alphahash_fragment:S0,alphahash_pars_fragment:E0,alphamap_fragment:A0,alphamap_pars_fragment:w0,alphatest_fragment:T0,alphatest_pars_fragment:C0,aomap_fragment:R0,aomap_pars_fragment:D0,batching_pars_vertex:P0,batching_vertex:L0,begin_vertex:I0,beginnormal_vertex:U0,bsdfs:N0,iridescence_fragment:F0,bumpmap_pars_fragment:O0,clipping_planes_fragment:z0,clipping_planes_pars_fragment:B0,clipping_planes_pars_vertex:k0,clipping_planes_vertex:V0,color_fragment:H0,color_pars_fragment:G0,color_pars_vertex:W0,color_vertex:X0,common:q0,cube_uv_reflection_fragment:j0,defaultnormal_vertex:Y0,displacementmap_pars_vertex:$0,displacementmap_vertex:J0,emissivemap_fragment:K0,emissivemap_pars_fragment:Z0,colorspace_fragment:Q0,colorspace_pars_fragment:em,envmap_fragment:tm,envmap_common_pars_fragment:nm,envmap_pars_fragment:im,envmap_pars_vertex:rm,envmap_physical_pars_fragment:mm,envmap_vertex:sm,fog_vertex:am,fog_pars_vertex:om,fog_fragment:lm,fog_pars_fragment:cm,gradientmap_pars_fragment:hm,lightmap_pars_fragment:um,lights_lambert_fragment:dm,lights_lambert_pars_fragment:fm,lights_pars_begin:pm,lights_toon_fragment:gm,lights_toon_pars_fragment:_m,lights_phong_fragment:vm,lights_phong_pars_fragment:ym,lights_physical_fragment:xm,lights_physical_pars_fragment:Mm,lights_fragment_begin:bm,lights_fragment_maps:Sm,lights_fragment_end:Em,logdepthbuf_fragment:Am,logdepthbuf_pars_fragment:wm,logdepthbuf_pars_vertex:Tm,logdepthbuf_vertex:Cm,map_fragment:Rm,map_pars_fragment:Dm,map_particle_fragment:Pm,map_particle_pars_fragment:Lm,metalnessmap_fragment:Im,metalnessmap_pars_fragment:Um,morphinstance_vertex:Nm,morphcolor_vertex:Fm,morphnormal_vertex:Om,morphtarget_pars_vertex:zm,morphtarget_vertex:Bm,normal_fragment_begin:km,normal_fragment_maps:Vm,normal_pars_fragment:Hm,normal_pars_vertex:Gm,normal_vertex:Wm,normalmap_pars_fragment:Xm,clearcoat_normal_fragment_begin:qm,clearcoat_normal_fragment_maps:jm,clearcoat_pars_fragment:Ym,iridescence_pars_fragment:$m,opaque_fragment:Jm,packing:Km,premultiplied_alpha_fragment:Zm,project_vertex:Qm,dithering_fragment:e1,dithering_pars_fragment:t1,roughnessmap_fragment:n1,roughnessmap_pars_fragment:i1,shadowmap_pars_fragment:r1,shadowmap_pars_vertex:s1,shadowmap_vertex:a1,shadowmask_pars_fragment:o1,skinbase_vertex:l1,skinning_pars_vertex:c1,skinning_vertex:h1,skinnormal_vertex:u1,specularmap_fragment:d1,specularmap_pars_fragment:f1,tonemapping_fragment:p1,tonemapping_pars_fragment:m1,transmission_fragment:g1,transmission_pars_fragment:_1,uv_pars_fragment:v1,uv_pars_vertex:y1,uv_vertex:x1,worldpos_vertex:M1,background_vert:b1,background_frag:S1,backgroundCube_vert:E1,backgroundCube_frag:A1,cube_vert:w1,cube_frag:T1,depth_vert:C1,depth_frag:R1,distanceRGBA_vert:D1,distanceRGBA_frag:P1,equirect_vert:L1,equirect_frag:I1,linedashed_vert:U1,linedashed_frag:N1,meshbasic_vert:F1,meshbasic_frag:O1,meshlambert_vert:z1,meshlambert_frag:B1,meshmatcap_vert:k1,meshmatcap_frag:V1,meshnormal_vert:H1,meshnormal_frag:G1,meshphong_vert:W1,meshphong_frag:X1,meshphysical_vert:q1,meshphysical_frag:j1,meshtoon_vert:Y1,meshtoon_frag:$1,points_vert:J1,points_frag:K1,shadow_vert:Z1,shadow_frag:Q1,sprite_vert:e2,sprite_frag:t2},Ue={common:{diffuse:{value:new ot(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},envMapRotation:{value:new _t},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new Xe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ot(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ot(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new ot(16777215)},opacity:{value:1},center:{value:new Xe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},bn={basic:{uniforms:_n([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.fog]),vertexShader:yt.meshbasic_vert,fragmentShader:yt.meshbasic_frag},lambert:{uniforms:_n([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,Ue.lights,{emissive:{value:new ot(0)}}]),vertexShader:yt.meshlambert_vert,fragmentShader:yt.meshlambert_frag},phong:{uniforms:_n([Ue.common,Ue.specularmap,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,Ue.lights,{emissive:{value:new ot(0)},specular:{value:new ot(1118481)},shininess:{value:30}}]),vertexShader:yt.meshphong_vert,fragmentShader:yt.meshphong_frag},standard:{uniforms:_n([Ue.common,Ue.envmap,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.roughnessmap,Ue.metalnessmap,Ue.fog,Ue.lights,{emissive:{value:new ot(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag},toon:{uniforms:_n([Ue.common,Ue.aomap,Ue.lightmap,Ue.emissivemap,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.gradientmap,Ue.fog,Ue.lights,{emissive:{value:new ot(0)}}]),vertexShader:yt.meshtoon_vert,fragmentShader:yt.meshtoon_frag},matcap:{uniforms:_n([Ue.common,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,Ue.fog,{matcap:{value:null}}]),vertexShader:yt.meshmatcap_vert,fragmentShader:yt.meshmatcap_frag},points:{uniforms:_n([Ue.points,Ue.fog]),vertexShader:yt.points_vert,fragmentShader:yt.points_frag},dashed:{uniforms:_n([Ue.common,Ue.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yt.linedashed_vert,fragmentShader:yt.linedashed_frag},depth:{uniforms:_n([Ue.common,Ue.displacementmap]),vertexShader:yt.depth_vert,fragmentShader:yt.depth_frag},normal:{uniforms:_n([Ue.common,Ue.bumpmap,Ue.normalmap,Ue.displacementmap,{opacity:{value:1}}]),vertexShader:yt.meshnormal_vert,fragmentShader:yt.meshnormal_frag},sprite:{uniforms:_n([Ue.sprite,Ue.fog]),vertexShader:yt.sprite_vert,fragmentShader:yt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yt.background_vert,fragmentShader:yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new _t}},vertexShader:yt.backgroundCube_vert,fragmentShader:yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yt.cube_vert,fragmentShader:yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yt.equirect_vert,fragmentShader:yt.equirect_frag},distanceRGBA:{uniforms:_n([Ue.common,Ue.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yt.distanceRGBA_vert,fragmentShader:yt.distanceRGBA_frag},shadow:{uniforms:_n([Ue.lights,Ue.fog,{color:{value:new ot(0)},opacity:{value:1}}]),vertexShader:yt.shadow_vert,fragmentShader:yt.shadow_frag}};bn.physical={uniforms:_n([bn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new Xe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new ot(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new Xe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new ot(0)},specularColor:{value:new ot(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new Xe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag};const qs={r:0,b:0,g:0},Fi=new Sn,n2=new lt;function i2(r,e,t,n,i,s,a){const o=new ot(0);let l=s===!0?0:1,c,h,u=null,d=0,f=null;function m(E){let v=E.isScene===!0?E.background:null;return v&&v.isTexture&&(v=(E.backgroundBlurriness>0?t:e).get(v)),v}function _(E){let v=!1;const U=m(E);U===null?p(o,l):U&&U.isColor&&(p(U,1),v=!0);const C=r.xr.getEnvironmentBlendMode();C==="additive"?n.buffers.color.setClear(0,0,0,1,a):C==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(r.autoClear||v)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function g(E,v){const U=m(v);U&&(U.isCubeTexture||U.mapping===Sa)?(h===void 0&&(h=new Rt(new Nr(1,1,1),new pi({name:"BackgroundCubeMaterial",uniforms:Lr(bn.backgroundCube.uniforms),vertexShader:bn.backgroundCube.vertexShader,fragmentShader:bn.backgroundCube.fragmentShader,side:vn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,T,L){this.matrixWorld.copyPosition(L.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Fi.copy(v.backgroundRotation),Fi.x*=-1,Fi.y*=-1,Fi.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Fi.y*=-1,Fi.z*=-1),h.material.uniforms.envMap.value=U,h.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(n2.makeRotationFromEuler(Fi)),h.material.toneMapped=xt.getTransfer(U.colorSpace)!==Ut,(u!==U||d!==U.version||f!==r.toneMapping)&&(h.material.needsUpdate=!0,u=U,d=U.version,f=r.toneMapping),h.layers.enableAll(),E.unshift(h,h.geometry,h.material,0,0,null)):U&&U.isTexture&&(c===void 0&&(c=new Rt(new us(2,2),new pi({name:"BackgroundMaterial",uniforms:Lr(bn.background.uniforms),vertexShader:bn.background.vertexShader,fragmentShader:bn.background.fragmentShader,side:Hn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=U,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=xt.getTransfer(U.colorSpace)!==Ut,U.matrixAutoUpdate===!0&&U.updateMatrix(),c.material.uniforms.uvTransform.value.copy(U.matrix),(u!==U||d!==U.version||f!==r.toneMapping)&&(c.material.needsUpdate=!0,u=U,d=U.version,f=r.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function p(E,v){E.getRGB(qs,Eu(r)),n.buffers.color.setClear(qs.r,qs.g,qs.b,v,a)}function S(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(E,v=1){o.set(E),l=v,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,p(o,l)},render:_,addToRenderList:g,dispose:S}}function r2(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null);let s=i,a=!1;function o(x,R,B,V,W){let ee=!1;const k=u(V,B,R);s!==k&&(s=k,c(s.object)),ee=f(x,V,B,W),ee&&m(x,V,B,W),W!==null&&e.update(W,r.ELEMENT_ARRAY_BUFFER),(ee||a)&&(a=!1,v(x,R,B,V),W!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function l(){return r.createVertexArray()}function c(x){return r.bindVertexArray(x)}function h(x){return r.deleteVertexArray(x)}function u(x,R,B){const V=B.wireframe===!0;let W=n[x.id];W===void 0&&(W={},n[x.id]=W);let ee=W[R.id];ee===void 0&&(ee={},W[R.id]=ee);let k=ee[V];return k===void 0&&(k=d(l()),ee[V]=k),k}function d(x){const R=[],B=[],V=[];for(let W=0;W<t;W++)R[W]=0,B[W]=0,V[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:R,enabledAttributes:B,attributeDivisors:V,object:x,attributes:{},index:null}}function f(x,R,B,V){const W=s.attributes,ee=R.attributes;let k=0;const Q=B.getAttributes();for(const q in Q)if(Q[q].location>=0){const ye=W[q];let le=ee[q];if(le===void 0&&(q==="instanceMatrix"&&x.instanceMatrix&&(le=x.instanceMatrix),q==="instanceColor"&&x.instanceColor&&(le=x.instanceColor)),ye===void 0||ye.attribute!==le||le&&ye.data!==le.data)return!0;k++}return s.attributesNum!==k||s.index!==V}function m(x,R,B,V){const W={},ee=R.attributes;let k=0;const Q=B.getAttributes();for(const q in Q)if(Q[q].location>=0){let ye=ee[q];ye===void 0&&(q==="instanceMatrix"&&x.instanceMatrix&&(ye=x.instanceMatrix),q==="instanceColor"&&x.instanceColor&&(ye=x.instanceColor));const le={};le.attribute=ye,ye&&ye.data&&(le.data=ye.data),W[q]=le,k++}s.attributes=W,s.attributesNum=k,s.index=V}function _(){const x=s.newAttributes;for(let R=0,B=x.length;R<B;R++)x[R]=0}function g(x){p(x,0)}function p(x,R){const B=s.newAttributes,V=s.enabledAttributes,W=s.attributeDivisors;B[x]=1,V[x]===0&&(r.enableVertexAttribArray(x),V[x]=1),W[x]!==R&&(r.vertexAttribDivisor(x,R),W[x]=R)}function S(){const x=s.newAttributes,R=s.enabledAttributes;for(let B=0,V=R.length;B<V;B++)R[B]!==x[B]&&(r.disableVertexAttribArray(B),R[B]=0)}function E(x,R,B,V,W,ee,k){k===!0?r.vertexAttribIPointer(x,R,B,W,ee):r.vertexAttribPointer(x,R,B,V,W,ee)}function v(x,R,B,V){_();const W=V.attributes,ee=B.getAttributes(),k=R.defaultAttributeValues;for(const Q in ee){const q=ee[Q];if(q.location>=0){let ue=W[Q];if(ue===void 0&&(Q==="instanceMatrix"&&x.instanceMatrix&&(ue=x.instanceMatrix),Q==="instanceColor"&&x.instanceColor&&(ue=x.instanceColor)),ue!==void 0){const ye=ue.normalized,le=ue.itemSize,Pe=e.get(ue);if(Pe===void 0)continue;const Te=Pe.buffer,Y=Pe.type,re=Pe.bytesPerElement,ae=Y===r.INT||Y===r.UNSIGNED_INT||ue.gpuType===wl;if(ue.isInterleavedBufferAttribute){const oe=ue.data,Ee=oe.stride,_e=ue.offset;if(oe.isInstancedInterleavedBuffer){for(let we=0;we<q.locationSize;we++)p(q.location+we,oe.meshPerAttribute);x.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=oe.meshPerAttribute*oe.count)}else for(let we=0;we<q.locationSize;we++)g(q.location+we);r.bindBuffer(r.ARRAY_BUFFER,Te);for(let we=0;we<q.locationSize;we++)E(q.location+we,le/q.locationSize,Y,ye,Ee*re,(_e+le/q.locationSize*we)*re,ae)}else{if(ue.isInstancedBufferAttribute){for(let oe=0;oe<q.locationSize;oe++)p(q.location+oe,ue.meshPerAttribute);x.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let oe=0;oe<q.locationSize;oe++)g(q.location+oe);r.bindBuffer(r.ARRAY_BUFFER,Te);for(let oe=0;oe<q.locationSize;oe++)E(q.location+oe,le/q.locationSize,Y,ye,le*re,le/q.locationSize*oe*re,ae)}}else if(k!==void 0){const ye=k[Q];if(ye!==void 0)switch(ye.length){case 2:r.vertexAttrib2fv(q.location,ye);break;case 3:r.vertexAttrib3fv(q.location,ye);break;case 4:r.vertexAttrib4fv(q.location,ye);break;default:r.vertexAttrib1fv(q.location,ye)}}}}S()}function U(){L();for(const x in n){const R=n[x];for(const B in R){const V=R[B];for(const W in V)h(V[W].object),delete V[W];delete R[B]}delete n[x]}}function C(x){if(n[x.id]===void 0)return;const R=n[x.id];for(const B in R){const V=R[B];for(const W in V)h(V[W].object),delete V[W];delete R[B]}delete n[x.id]}function T(x){for(const R in n){const B=n[R];if(B[x.id]===void 0)continue;const V=B[x.id];for(const W in V)h(V[W].object),delete V[W];delete B[x.id]}}function L(){b(),a=!0,s!==i&&(s=i,c(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:L,resetDefaultState:b,dispose:U,releaseStatesOfGeometry:C,releaseStatesOfProgram:T,initAttributes:_,enableAttribute:g,disableUnusedAttributes:S}}function s2(r,e,t){let n;function i(c){n=c}function s(c,h){r.drawArrays(n,c,h),t.update(h,n,1)}function a(c,h,u){u!==0&&(r.drawArraysInstanced(n,c,h,u),t.update(h,n,u))}function o(c,h,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,u);let f=0;for(let m=0;m<u;m++)f+=h[m];t.update(f,n,1)}function l(c,h,u,d){if(u===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let m=0;m<c.length;m++)a(c[m],h[m],d[m]);else{f.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,u);let m=0;for(let _=0;_<u;_++)m+=h[_]*d[_];t.update(m,n,1)}}this.setMode=i,this.render=s,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function a2(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const T=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(T){return!(T!==Un&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(T){const L=T===hs&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(T!==Qn&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==Jn&&!L)}function l(T){if(T==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const u=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),g=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),S=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),U=m>0,C=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:u,reverseDepthBuffer:d,maxTextures:f,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:S,maxVaryings:E,maxFragmentUniforms:v,vertexTextures:U,maxSamples:C}}function o2(r){const e=this;let t=null,n=0,i=!1,s=!1;const a=new Ei,o=new _t,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,d){const f=u.length!==0||d||n!==0||i;return i=d,n=u.length,f},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(u,d){t=h(u,d,0)},this.setState=function(u,d,f){const m=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,p=r.get(u);if(!i||m===null||m.length===0||s&&!g)s?h(null):c();else{const S=s?0:n,E=S*4;let v=p.clippingState||null;l.value=v,v=h(m,d,E,f);for(let U=0;U!==E;++U)v[U]=t[U];p.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(u,d,f,m){const _=u!==null?u.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=f+_*4,S=d.matrixWorldInverse;o.getNormalMatrix(S),(g===null||g.length<p)&&(g=new Float32Array(p));for(let E=0,v=f;E!==_;++E,v+=4)a.copy(u[E]).applyMatrix4(S,o),a.normal.toArray(g,v),g[v+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}function l2(r){let e=new WeakMap;function t(a,o){return o===Uo?a.mapping=Cr:o===No&&(a.mapping=Rr),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Uo||o===No)if(e.has(a)){const l=e.get(a).texture;return t(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new bp(l.height);return c.fromEquirectangularTexture(r,a),e.set(a,c),a.addEventListener("dispose",i),t(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}const Sr=4,sh=[.125,.215,.35,.446,.526,.582],Gi=20,ho=new Ta,ah=new ot;let uo=null,fo=0,po=0,mo=!1;const ki=(1+Math.sqrt(5))/2,xr=1/ki,oh=[new F(-ki,xr,0),new F(ki,xr,0),new F(-xr,0,ki),new F(xr,0,ki),new F(0,ki,-xr),new F(0,ki,xr),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],c2=new F;class lh{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100,s={}){const{size:a=256,position:o=c2}=s;uo=this._renderer.getRenderTarget(),fo=this._renderer.getActiveCubeFace(),po=this._renderer.getActiveMipmapLevel(),mo=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=uh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=hh(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(uo,fo,po),this._renderer.xr.enabled=mo,e.scissorTest=!1,js(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Cr||e.mapping===Rr?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),uo=this._renderer.getRenderTarget(),fo=this._renderer.getActiveCubeFace(),po=this._renderer.getActiveMipmapLevel(),mo=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:Tn,minFilter:Tn,generateMipmaps:!1,type:hs,format:Un,colorSpace:Dr,depthBuffer:!1},i=ch(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=ch(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=h2(s)),this._blurMaterial=u2(s,e,t)}return i}_compileMaterial(e){const t=new Rt(this._lodPlanes[0],e);this._renderer.compile(t,ho)}_sceneToCubeUV(e,t,n,i,s){const l=new ln(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,f=u.toneMapping;u.getClearColor(ah),u.toneMapping=Ti,u.autoClear=!1;const m=new Ri({name:"PMREM.Background",side:vn,depthWrite:!1,depthTest:!1}),_=new Rt(new Nr,m);let g=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,g=!0):(m.color.copy(ah),g=!0);for(let S=0;S<6;S++){const E=S%3;E===0?(l.up.set(0,c[S],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+h[S],s.y,s.z)):E===1?(l.up.set(0,0,c[S]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+h[S],s.z)):(l.up.set(0,c[S],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+h[S]));const v=this._cubeSize;js(i,E*v,S>2?v:0,v,v),u.setRenderTarget(i),g&&u.render(_,l),u.render(e,l)}_.geometry.dispose(),_.material.dispose(),u.toneMapping=f,u.autoClear=d,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Cr||e.mapping===Rr;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=uh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=hh());const s=i?this._cubemapMaterial:this._equirectMaterial,a=new Rt(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;js(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,ho)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=oh[(i-s-1)%oh.length];this._blur(e,s-1,s,a,o)}t.autoClear=n}_blur(e,t,n,i,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",s),this._halfBlur(a,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,u=new Rt(this._lodPlanes[i],c),d=c.uniforms,f=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*Gi-1),_=s/m,g=isFinite(s)?1+Math.floor(h*_):Gi;g>Gi&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Gi}`);const p=[];let S=0;for(let T=0;T<Gi;++T){const L=T/_,b=Math.exp(-L*L/2);p.push(b),T===0?S+=b:T<g&&(S+=2*b)}for(let T=0;T<p.length;T++)p[T]=p[T]/S;d.envMap.value=e.texture,d.samples.value=g,d.weights.value=p,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:E}=this;d.dTheta.value=m,d.mipInt.value=E-n;const v=this._sizeLods[i],U=3*v*(i>E-Sr?i-E+Sr:0),C=4*(this._cubeSize-v);js(t,U,C,3*v,2*v),l.setRenderTarget(t),l.render(u,ho)}}function h2(r){const e=[],t=[],n=[];let i=r;const s=r-Sr+1+sh.length;for(let a=0;a<s;a++){const o=Math.pow(2,i);t.push(o);let l=1/o;a>r-Sr?l=sh[a-r+Sr-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,u=1+c,d=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,m=6,_=3,g=2,p=1,S=new Float32Array(_*m*f),E=new Float32Array(g*m*f),v=new Float32Array(p*m*f);for(let C=0;C<f;C++){const T=C%3*2/3-1,L=C>2?0:-1,b=[T,L,0,T+2/3,L,0,T+2/3,L+1,0,T,L,0,T+2/3,L+1,0,T,L+1,0];S.set(b,_*m*C),E.set(d,g*m*C);const x=[C,C,C,C,C,C];v.set(x,p*m*C)}const U=new Bt;U.setAttribute("position",new Gt(S,_)),U.setAttribute("uv",new Gt(E,g)),U.setAttribute("faceIndex",new Gt(v,p)),e.push(U),i>Sr&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function ch(r,e,t){const n=new ji(r,e,t);return n.texture.mapping=Sa,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function js(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function u2(r,e,t){const n=new Float32Array(Gi),i=new F(0,1,0);return new pi({name:"SphericalGaussianBlur",defines:{n:Gi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:$l(),fragmentShader:`
3575
3575
 
3576
3576
  precision mediump float;
3577
3577
  precision mediump int;
@@ -3772,7 +3772,7 @@ Material Type: `+R.type+`
3772
3772
 
3773
3773
  Program Info Log: `+B+`
3774
3774
  `+Q+`
3775
- `+q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(V===""||W==="")&&(k=!1);k&&(R.diagnostics={runnable:ee,programLog:B,vertexShader:{log:V,prefix:g},fragmentShader:{log:W,prefix:p}})}i.deleteShader(U),i.deleteShader(C),L=new ca(i,_),b=vg(i,_)}let L;this.getUniforms=function(){return L===void 0&&T(this),L};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let x=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return x===!1&&(x=i.getProgramParameter(_,cg)),x},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=hg++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=U,this.fragmentShader=C,this}let Dg=0;class Pg{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.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 Lg(e),t.set(e,n)),n}}class Lg{constructor(e){this.id=Dg++,this.code=e,this.usedTimes=0}}function Ig(r,e,t,n,i,s,a){const o=new Nl,l=new Pg,c=new Set,h=[],u=i.logarithmicDepthBuffer,d=i.vertexTextures;let f=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,x,R,B,V){const W=B.fog,ee=V.geometry,k=b.isMeshStandardMaterial?B.environment:null,Q=(b.isMeshStandardMaterial?t:e).get(b.envMap||k),q=Q&&Q.mapping===Sa?Q.image.height:null,he=m[b.type];b.precision!==null&&(f=i.getMaxPrecision(b.precision),f!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const ye=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,le=ye!==void 0?ye.length:0;let Le=0;ee.morphAttributes.position!==void 0&&(Le=1),ee.morphAttributes.normal!==void 0&&(Le=2),ee.morphAttributes.color!==void 0&&(Le=3);let we,Y,re,ae;if(he){const pt=bn[he];we=pt.vertexShader,Y=pt.fragmentShader}else we=b.vertexShader,Y=b.fragmentShader,l.update(b),re=l.getVertexShaderID(b),ae=l.getFragmentShaderID(b);const oe=r.getRenderTarget(),Se=r.state.buffers.depth.getReversed(),_e=V.isInstancedMesh===!0,Ae=V.isBatchedMesh===!0,ke=!!b.map,tt=!!b.matcap,Ze=!!Q,O=!!b.aoMap,bt=!!b.lightMap,$=!!b.bumpMap,pe=!!b.normalMap,te=!!b.displacementMap,Te=!!b.emissiveMap,ce=!!b.metalnessMap,ue=!!b.roughnessMap,De=b.anisotropy>0,N=b.clearcoat>0,A=b.dispersion>0,G=b.iridescence>0,z=b.sheen>0,se=b.transmission>0,ne=De&&!!b.anisotropyMap,Ce=N&&!!b.clearcoatMap,Ee=N&&!!b.clearcoatNormalMap,Be=N&&!!b.clearcoatRoughnessMap,Ve=G&&!!b.iridescenceMap,me=G&&!!b.iridescenceThicknessMap,Pe=z&&!!b.sheenColorMap,Je=z&&!!b.sheenRoughnessMap,nt=!!b.specularMap,Ie=!!b.specularColorMap,ct=!!b.specularIntensityMap,H=se&&!!b.transmissionMap,Fe=se&&!!b.thicknessMap,ve=!!b.gradientMap,He=!!b.alphaMap,Me=b.alphaTest>0,ge=!!b.alphaHash,qe=!!b.extensions;let ht=Ti;b.toneMapped&&(oe===null||oe.isXRRenderTarget===!0)&&(ht=r.toneMapping);const Dt={shaderID:he,shaderType:b.type,shaderName:b.name,vertexShader:we,fragmentShader:Y,defines:b.defines,customVertexShaderID:re,customFragmentShaderID:ae,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:Ae,batchingColor:Ae&&V._colorsTexture!==null,instancing:_e,instancingColor:_e&&V.instanceColor!==null,instancingMorph:_e&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:oe===null?r.outputColorSpace:oe.isXRRenderTarget===!0?oe.texture.colorSpace:Dr,alphaToCoverage:!!b.alphaToCoverage,map:ke,matcap:tt,envMap:Ze,envMapMode:Ze&&Q.mapping,envMapCubeUVHeight:q,aoMap:O,lightMap:bt,bumpMap:$,normalMap:pe,displacementMap:d&&te,emissiveMap:Te,normalMapObjectSpace:pe&&b.normalMapType===wf,normalMapTangentSpace:pe&&b.normalMapType===Ll,metalnessMap:ce,roughnessMap:ue,anisotropy:De,anisotropyMap:ne,clearcoat:N,clearcoatMap:Ce,clearcoatNormalMap:Ee,clearcoatRoughnessMap:Be,dispersion:A,iridescence:G,iridescenceMap:Ve,iridescenceThicknessMap:me,sheen:z,sheenColorMap:Pe,sheenRoughnessMap:Je,specularMap:nt,specularColorMap:Ie,specularIntensityMap:ct,transmission:se,transmissionMap:H,thicknessMap:Fe,gradientMap:ve,opaque:b.transparent===!1&&b.blending===Er&&b.alphaToCoverage===!1,alphaMap:He,alphaTest:Me,alphaHash:ge,combine:b.combine,mapUv:ke&&_(b.map.channel),aoMapUv:O&&_(b.aoMap.channel),lightMapUv:bt&&_(b.lightMap.channel),bumpMapUv:$&&_(b.bumpMap.channel),normalMapUv:pe&&_(b.normalMap.channel),displacementMapUv:te&&_(b.displacementMap.channel),emissiveMapUv:Te&&_(b.emissiveMap.channel),metalnessMapUv:ce&&_(b.metalnessMap.channel),roughnessMapUv:ue&&_(b.roughnessMap.channel),anisotropyMapUv:ne&&_(b.anisotropyMap.channel),clearcoatMapUv:Ce&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Ee&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Be&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ve&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:me&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:Pe&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Je&&_(b.sheenRoughnessMap.channel),specularMapUv:nt&&_(b.specularMap.channel),specularColorMapUv:Ie&&_(b.specularColorMap.channel),specularIntensityMapUv:ct&&_(b.specularIntensityMap.channel),transmissionMapUv:H&&_(b.transmissionMap.channel),thicknessMapUv:Fe&&_(b.thicknessMap.channel),alphaMapUv:He&&_(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(pe||De),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!ee.attributes.uv&&(ke||He),fog:!!W,useFog:b.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:Se,skinning:V.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:Le,numDirLights:x.directional.length,numPointLights:x.point.length,numSpotLights:x.spot.length,numSpotLightMaps:x.spotLightMap.length,numRectAreaLights:x.rectArea.length,numHemiLights:x.hemi.length,numDirLightShadows:x.directionalShadowMap.length,numPointLightShadows:x.pointShadowMap.length,numSpotLightShadows:x.spotShadowMap.length,numSpotLightShadowsWithMaps:x.numSpotLightShadowsWithMaps,numLightProbes:x.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&R.length>0,shadowMapType:r.shadowMap.type,toneMapping:ht,decodeVideoTexture:ke&&b.map.isVideoTexture===!0&&xt.getTransfer(b.map.colorSpace)===Ut,decodeVideoTextureEmissive:Te&&b.emissiveMap.isVideoTexture===!0&&xt.getTransfer(b.emissiveMap.colorSpace)===Ut,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===pn,flipSided:b.side===vn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:qe&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(qe&&b.extensions.multiDraw===!0||Ae)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Dt.vertexUv1s=c.has(1),Dt.vertexUv2s=c.has(2),Dt.vertexUv3s=c.has(3),c.clear(),Dt}function p(b){const x=[];if(b.shaderID?x.push(b.shaderID):(x.push(b.customVertexShaderID),x.push(b.customFragmentShaderID)),b.defines!==void 0)for(const R in b.defines)x.push(R),x.push(b.defines[R]);return b.isRawShaderMaterial===!1&&(S(x,b),E(x,b),x.push(r.outputColorSpace)),x.push(b.customProgramCacheKey),x.join()}function S(b,x){b.push(x.precision),b.push(x.outputColorSpace),b.push(x.envMapMode),b.push(x.envMapCubeUVHeight),b.push(x.mapUv),b.push(x.alphaMapUv),b.push(x.lightMapUv),b.push(x.aoMapUv),b.push(x.bumpMapUv),b.push(x.normalMapUv),b.push(x.displacementMapUv),b.push(x.emissiveMapUv),b.push(x.metalnessMapUv),b.push(x.roughnessMapUv),b.push(x.anisotropyMapUv),b.push(x.clearcoatMapUv),b.push(x.clearcoatNormalMapUv),b.push(x.clearcoatRoughnessMapUv),b.push(x.iridescenceMapUv),b.push(x.iridescenceThicknessMapUv),b.push(x.sheenColorMapUv),b.push(x.sheenRoughnessMapUv),b.push(x.specularMapUv),b.push(x.specularColorMapUv),b.push(x.specularIntensityMapUv),b.push(x.transmissionMapUv),b.push(x.thicknessMapUv),b.push(x.combine),b.push(x.fogExp2),b.push(x.sizeAttenuation),b.push(x.morphTargetsCount),b.push(x.morphAttributeCount),b.push(x.numDirLights),b.push(x.numPointLights),b.push(x.numSpotLights),b.push(x.numSpotLightMaps),b.push(x.numHemiLights),b.push(x.numRectAreaLights),b.push(x.numDirLightShadows),b.push(x.numPointLightShadows),b.push(x.numSpotLightShadows),b.push(x.numSpotLightShadowsWithMaps),b.push(x.numLightProbes),b.push(x.shadowMapType),b.push(x.toneMapping),b.push(x.numClippingPlanes),b.push(x.numClipIntersection),b.push(x.depthPacking)}function E(b,x){o.disableAll(),x.supportsVertexTextures&&o.enable(0),x.instancing&&o.enable(1),x.instancingColor&&o.enable(2),x.instancingMorph&&o.enable(3),x.matcap&&o.enable(4),x.envMap&&o.enable(5),x.normalMapObjectSpace&&o.enable(6),x.normalMapTangentSpace&&o.enable(7),x.clearcoat&&o.enable(8),x.iridescence&&o.enable(9),x.alphaTest&&o.enable(10),x.vertexColors&&o.enable(11),x.vertexAlphas&&o.enable(12),x.vertexUv1s&&o.enable(13),x.vertexUv2s&&o.enable(14),x.vertexUv3s&&o.enable(15),x.vertexTangents&&o.enable(16),x.anisotropy&&o.enable(17),x.alphaHash&&o.enable(18),x.batching&&o.enable(19),x.dispersion&&o.enable(20),x.batchingColor&&o.enable(21),b.push(o.mask),o.disableAll(),x.fog&&o.enable(0),x.useFog&&o.enable(1),x.flatShading&&o.enable(2),x.logarithmicDepthBuffer&&o.enable(3),x.reverseDepthBuffer&&o.enable(4),x.skinning&&o.enable(5),x.morphTargets&&o.enable(6),x.morphNormals&&o.enable(7),x.morphColors&&o.enable(8),x.premultipliedAlpha&&o.enable(9),x.shadowMapEnabled&&o.enable(10),x.doubleSided&&o.enable(11),x.flipSided&&o.enable(12),x.useDepthPacking&&o.enable(13),x.dithering&&o.enable(14),x.transmission&&o.enable(15),x.sheen&&o.enable(16),x.opaque&&o.enable(17),x.pointsUvs&&o.enable(18),x.decodeVideoTexture&&o.enable(19),x.decodeVideoTextureEmissive&&o.enable(20),x.alphaToCoverage&&o.enable(21),b.push(o.mask)}function v(b){const x=m[b.type];let R;if(x){const B=bn[x];R=Fl.clone(B.uniforms)}else R=b.uniforms;return R}function U(b,x){let R;for(let B=0,V=h.length;B<V;B++){const W=h[B];if(W.cacheKey===x){R=W,++R.usedTimes;break}}return R===void 0&&(R=new Rg(r,x,b,s),h.push(R)),R}function C(b){if(--b.usedTimes===0){const x=h.indexOf(b);h[x]=h[h.length-1],h.pop(),b.destroy()}}function T(b){l.remove(b)}function L(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:v,acquireProgram:U,releaseProgram:C,releaseShaderCache:T,programs:h,dispose:L}}function Ug(){let r=new WeakMap;function e(a){return r.has(a)}function t(a){let o=r.get(a);return o===void 0&&(o={},r.set(a,o)),o}function n(a){r.delete(a)}function i(a,o,l){r.get(a)[o]=l}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function Ng(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function wh(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Th(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function a(u,d,f,m,_,g){let p=r[e];return p===void 0?(p={id:u.id,object:u,geometry:d,material:f,groupOrder:m,renderOrder:u.renderOrder,z:_,group:g},r[e]=p):(p.id=u.id,p.object=u,p.geometry=d,p.material=f,p.groupOrder=m,p.renderOrder=u.renderOrder,p.z=_,p.group=g),e++,p}function o(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.push(p):f.transparent===!0?i.push(p):t.push(p)}function l(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):t.unshift(p)}function c(u,d){t.length>1&&t.sort(u||Ng),n.length>1&&n.sort(d||wh),i.length>1&&i.sort(d||wh)}function h(){for(let u=e,d=r.length;u<d;u++){const f=r[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:o,unshift:l,finish:h,sort:c}}function Fg(){let r=new WeakMap;function e(n,i){const s=r.get(n);let a;return s===void 0?(a=new Th,r.set(n,[a])):i>=s.length?(a=new Th,s.push(a)):a=s[i],a}function t(){r=new WeakMap}return{get:e,dispose:t}}function Og(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new ot};break;case"SpotLight":t={position:new F,direction:new F,color:new ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new ot,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new ot,groundColor:new ot};break;case"RectAreaLight":t={color:new ot,position:new F,halfWidth:new F,halfHeight:new F};break}return r[e.id]=t,t}}}function zg(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let Bg=0;function kg(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function Vg(r){const e=new Og,t=zg(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new F);const i=new F,s=new lt,a=new lt;function o(c){let h=0,u=0,d=0;for(let b=0;b<9;b++)n.probe[b].set(0,0,0);let f=0,m=0,_=0,g=0,p=0,S=0,E=0,v=0,U=0,C=0,T=0;c.sort(kg);for(let b=0,x=c.length;b<x;b++){const R=c[b],B=R.color,V=R.intensity,W=R.distance,ee=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)h+=B.r*V,u+=B.g*V,d+=B.b*V;else if(R.isLightProbe){for(let k=0;k<9;k++)n.probe[k].addScaledVector(R.sh.coefficients[k],V);T++}else if(R.isDirectionalLight){const k=e.get(R);if(k.color.copy(R.color).multiplyScalar(R.intensity),R.castShadow){const Q=R.shadow,q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,n.directionalShadow[f]=q,n.directionalShadowMap[f]=ee,n.directionalShadowMatrix[f]=R.shadow.matrix,S++}n.directional[f]=k,f++}else if(R.isSpotLight){const k=e.get(R);k.position.setFromMatrixPosition(R.matrixWorld),k.color.copy(B).multiplyScalar(V),k.distance=W,k.coneCos=Math.cos(R.angle),k.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),k.decay=R.decay,n.spot[_]=k;const Q=R.shadow;if(R.map&&(n.spotLightMap[U]=R.map,U++,Q.updateMatrices(R),R.castShadow&&C++),n.spotLightMatrix[_]=Q.matrix,R.castShadow){const q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,n.spotShadow[_]=q,n.spotShadowMap[_]=ee,v++}_++}else if(R.isRectAreaLight){const k=e.get(R);k.color.copy(B).multiplyScalar(V),k.halfWidth.set(R.width*.5,0,0),k.halfHeight.set(0,R.height*.5,0),n.rectArea[g]=k,g++}else if(R.isPointLight){const k=e.get(R);if(k.color.copy(R.color).multiplyScalar(R.intensity),k.distance=R.distance,k.decay=R.decay,R.castShadow){const Q=R.shadow,q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,q.shadowCameraNear=Q.camera.near,q.shadowCameraFar=Q.camera.far,n.pointShadow[m]=q,n.pointShadowMap[m]=ee,n.pointShadowMatrix[m]=R.shadow.matrix,E++}n.point[m]=k,m++}else if(R.isHemisphereLight){const k=e.get(R);k.skyColor.copy(R.color).multiplyScalar(V),k.groundColor.copy(R.groundColor).multiplyScalar(V),n.hemi[p]=k,p++}}g>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ne.LTC_FLOAT_1,n.rectAreaLTC2=Ne.LTC_FLOAT_2):(n.rectAreaLTC1=Ne.LTC_HALF_1,n.rectAreaLTC2=Ne.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const L=n.hash;(L.directionalLength!==f||L.pointLength!==m||L.spotLength!==_||L.rectAreaLength!==g||L.hemiLength!==p||L.numDirectionalShadows!==S||L.numPointShadows!==E||L.numSpotShadows!==v||L.numSpotMaps!==U||L.numLightProbes!==T)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=S,n.directionalShadowMap.length=S,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=v,n.spotShadowMap.length=v,n.directionalShadowMatrix.length=S,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=v+U-C,n.spotLightMap.length=U,n.numSpotLightShadowsWithMaps=C,n.numLightProbes=T,L.directionalLength=f,L.pointLength=m,L.spotLength=_,L.rectAreaLength=g,L.hemiLength=p,L.numDirectionalShadows=S,L.numPointShadows=E,L.numSpotShadows=v,L.numSpotMaps=U,L.numLightProbes=T,n.version=Bg++)}function l(c,h){let u=0,d=0,f=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,S=c.length;p<S;p++){const E=c[p];if(E.isDirectionalLight){const v=n.directional[u];v.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(g),u++}else if(E.isSpotLight){const v=n.spot[f];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),v.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(g),f++}else if(E.isRectAreaLight){const v=n.rectArea[m];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),a.identity(),s.copy(E.matrixWorld),s.premultiply(g),a.extractRotation(s),v.halfWidth.set(E.width*.5,0,0),v.halfHeight.set(0,E.height*.5,0),v.halfWidth.applyMatrix4(a),v.halfHeight.applyMatrix4(a),m++}else if(E.isPointLight){const v=n.point[d];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),d++}else if(E.isHemisphereLight){const v=n.hemi[_];v.direction.setFromMatrixPosition(E.matrixWorld),v.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function Ch(r){const e=new Vg(r),t=[],n=[];function i(h){c.camera=h,t.length=0,n.length=0}function s(h){t.push(h)}function a(h){n.push(h)}function o(){e.setup(t)}function l(h){e.setupView(t,h)}const c={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:s,pushShadow:a}}function Hg(r){let e=new WeakMap;function t(i,s=0){const a=e.get(i);let o;return a===void 0?(o=new Ch(r),e.set(i,[o])):s>=a.length?(o=new Ch(r),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const Gg=`void main() {
3775
+ `+q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(V===""||W==="")&&(k=!1);k&&(R.diagnostics={runnable:ee,programLog:B,vertexShader:{log:V,prefix:g},fragmentShader:{log:W,prefix:p}})}i.deleteShader(U),i.deleteShader(C),L=new ca(i,_),b=vg(i,_)}let L;this.getUniforms=function(){return L===void 0&&T(this),L};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let x=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return x===!1&&(x=i.getProgramParameter(_,cg)),x},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=hg++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=U,this.fragmentShader=C,this}let Dg=0;class Pg{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(s)===!1&&(a.add(s),s.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 Lg(e),t.set(e,n)),n}}class Lg{constructor(e){this.id=Dg++,this.code=e,this.usedTimes=0}}function Ig(r,e,t,n,i,s,a){const o=new Nl,l=new Pg,c=new Set,h=[],u=i.logarithmicDepthBuffer,d=i.vertexTextures;let f=i.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(b){return c.add(b),b===0?"uv":`uv${b}`}function g(b,x,R,B,V){const W=B.fog,ee=V.geometry,k=b.isMeshStandardMaterial?B.environment:null,Q=(b.isMeshStandardMaterial?t:e).get(b.envMap||k),q=Q&&Q.mapping===Sa?Q.image.height:null,ue=m[b.type];b.precision!==null&&(f=i.getMaxPrecision(b.precision),f!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const ye=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,le=ye!==void 0?ye.length:0;let Pe=0;ee.morphAttributes.position!==void 0&&(Pe=1),ee.morphAttributes.normal!==void 0&&(Pe=2),ee.morphAttributes.color!==void 0&&(Pe=3);let Te,Y,re,ae;if(ue){const pt=bn[ue];Te=pt.vertexShader,Y=pt.fragmentShader}else Te=b.vertexShader,Y=b.fragmentShader,l.update(b),re=l.getVertexShaderID(b),ae=l.getFragmentShaderID(b);const oe=r.getRenderTarget(),Ee=r.state.buffers.depth.getReversed(),_e=V.isInstancedMesh===!0,we=V.isBatchedMesh===!0,ke=!!b.map,tt=!!b.matcap,Qe=!!Q,O=!!b.aoMap,bt=!!b.lightMap,$=!!b.bumpMap,pe=!!b.normalMap,te=!!b.displacementMap,Se=!!b.emissiveMap,he=!!b.metalnessMap,ce=!!b.roughnessMap,Fe=b.anisotropy>0,N=b.clearcoat>0,A=b.dispersion>0,G=b.iridescence>0,z=b.sheen>0,se=b.transmission>0,ne=Fe&&!!b.anisotropyMap,Ce=N&&!!b.clearcoatMap,Ae=N&&!!b.clearcoatNormalMap,Be=N&&!!b.clearcoatRoughnessMap,Ve=G&&!!b.iridescenceMap,me=G&&!!b.iridescenceThicknessMap,De=z&&!!b.sheenColorMap,Je=z&&!!b.sheenRoughnessMap,nt=!!b.specularMap,Le=!!b.specularColorMap,ct=!!b.specularIntensityMap,H=se&&!!b.transmissionMap,Ne=se&&!!b.thicknessMap,ve=!!b.gradientMap,He=!!b.alphaMap,Me=b.alphaTest>0,ge=!!b.alphaHash,qe=!!b.extensions;let ht=Ti;b.toneMapped&&(oe===null||oe.isXRRenderTarget===!0)&&(ht=r.toneMapping);const Dt={shaderID:ue,shaderType:b.type,shaderName:b.name,vertexShader:Te,fragmentShader:Y,defines:b.defines,customVertexShaderID:re,customFragmentShaderID:ae,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:we,batchingColor:we&&V._colorsTexture!==null,instancing:_e,instancingColor:_e&&V.instanceColor!==null,instancingMorph:_e&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:oe===null?r.outputColorSpace:oe.isXRRenderTarget===!0?oe.texture.colorSpace:Dr,alphaToCoverage:!!b.alphaToCoverage,map:ke,matcap:tt,envMap:Qe,envMapMode:Qe&&Q.mapping,envMapCubeUVHeight:q,aoMap:O,lightMap:bt,bumpMap:$,normalMap:pe,displacementMap:d&&te,emissiveMap:Se,normalMapObjectSpace:pe&&b.normalMapType===wf,normalMapTangentSpace:pe&&b.normalMapType===Ll,metalnessMap:he,roughnessMap:ce,anisotropy:Fe,anisotropyMap:ne,clearcoat:N,clearcoatMap:Ce,clearcoatNormalMap:Ae,clearcoatRoughnessMap:Be,dispersion:A,iridescence:G,iridescenceMap:Ve,iridescenceThicknessMap:me,sheen:z,sheenColorMap:De,sheenRoughnessMap:Je,specularMap:nt,specularColorMap:Le,specularIntensityMap:ct,transmission:se,transmissionMap:H,thicknessMap:Ne,gradientMap:ve,opaque:b.transparent===!1&&b.blending===Er&&b.alphaToCoverage===!1,alphaMap:He,alphaTest:Me,alphaHash:ge,combine:b.combine,mapUv:ke&&_(b.map.channel),aoMapUv:O&&_(b.aoMap.channel),lightMapUv:bt&&_(b.lightMap.channel),bumpMapUv:$&&_(b.bumpMap.channel),normalMapUv:pe&&_(b.normalMap.channel),displacementMapUv:te&&_(b.displacementMap.channel),emissiveMapUv:Se&&_(b.emissiveMap.channel),metalnessMapUv:he&&_(b.metalnessMap.channel),roughnessMapUv:ce&&_(b.roughnessMap.channel),anisotropyMapUv:ne&&_(b.anisotropyMap.channel),clearcoatMapUv:Ce&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:Ae&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Be&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ve&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:me&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:De&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:Je&&_(b.sheenRoughnessMap.channel),specularMapUv:nt&&_(b.specularMap.channel),specularColorMapUv:Le&&_(b.specularColorMap.channel),specularIntensityMapUv:ct&&_(b.specularIntensityMap.channel),transmissionMapUv:H&&_(b.transmissionMap.channel),thicknessMapUv:Ne&&_(b.thicknessMap.channel),alphaMapUv:He&&_(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(pe||Fe),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!ee.attributes.uv&&(ke||He),fog:!!W,useFog:b.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:u,reverseDepthBuffer:Ee,skinning:V.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:Pe,numDirLights:x.directional.length,numPointLights:x.point.length,numSpotLights:x.spot.length,numSpotLightMaps:x.spotLightMap.length,numRectAreaLights:x.rectArea.length,numHemiLights:x.hemi.length,numDirLightShadows:x.directionalShadowMap.length,numPointLightShadows:x.pointShadowMap.length,numSpotLightShadows:x.spotShadowMap.length,numSpotLightShadowsWithMaps:x.numSpotLightShadowsWithMaps,numLightProbes:x.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&R.length>0,shadowMapType:r.shadowMap.type,toneMapping:ht,decodeVideoTexture:ke&&b.map.isVideoTexture===!0&&xt.getTransfer(b.map.colorSpace)===Ut,decodeVideoTextureEmissive:Se&&b.emissiveMap.isVideoTexture===!0&&xt.getTransfer(b.emissiveMap.colorSpace)===Ut,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===pn,flipSided:b.side===vn,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:qe&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(qe&&b.extensions.multiDraw===!0||we)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Dt.vertexUv1s=c.has(1),Dt.vertexUv2s=c.has(2),Dt.vertexUv3s=c.has(3),c.clear(),Dt}function p(b){const x=[];if(b.shaderID?x.push(b.shaderID):(x.push(b.customVertexShaderID),x.push(b.customFragmentShaderID)),b.defines!==void 0)for(const R in b.defines)x.push(R),x.push(b.defines[R]);return b.isRawShaderMaterial===!1&&(S(x,b),E(x,b),x.push(r.outputColorSpace)),x.push(b.customProgramCacheKey),x.join()}function S(b,x){b.push(x.precision),b.push(x.outputColorSpace),b.push(x.envMapMode),b.push(x.envMapCubeUVHeight),b.push(x.mapUv),b.push(x.alphaMapUv),b.push(x.lightMapUv),b.push(x.aoMapUv),b.push(x.bumpMapUv),b.push(x.normalMapUv),b.push(x.displacementMapUv),b.push(x.emissiveMapUv),b.push(x.metalnessMapUv),b.push(x.roughnessMapUv),b.push(x.anisotropyMapUv),b.push(x.clearcoatMapUv),b.push(x.clearcoatNormalMapUv),b.push(x.clearcoatRoughnessMapUv),b.push(x.iridescenceMapUv),b.push(x.iridescenceThicknessMapUv),b.push(x.sheenColorMapUv),b.push(x.sheenRoughnessMapUv),b.push(x.specularMapUv),b.push(x.specularColorMapUv),b.push(x.specularIntensityMapUv),b.push(x.transmissionMapUv),b.push(x.thicknessMapUv),b.push(x.combine),b.push(x.fogExp2),b.push(x.sizeAttenuation),b.push(x.morphTargetsCount),b.push(x.morphAttributeCount),b.push(x.numDirLights),b.push(x.numPointLights),b.push(x.numSpotLights),b.push(x.numSpotLightMaps),b.push(x.numHemiLights),b.push(x.numRectAreaLights),b.push(x.numDirLightShadows),b.push(x.numPointLightShadows),b.push(x.numSpotLightShadows),b.push(x.numSpotLightShadowsWithMaps),b.push(x.numLightProbes),b.push(x.shadowMapType),b.push(x.toneMapping),b.push(x.numClippingPlanes),b.push(x.numClipIntersection),b.push(x.depthPacking)}function E(b,x){o.disableAll(),x.supportsVertexTextures&&o.enable(0),x.instancing&&o.enable(1),x.instancingColor&&o.enable(2),x.instancingMorph&&o.enable(3),x.matcap&&o.enable(4),x.envMap&&o.enable(5),x.normalMapObjectSpace&&o.enable(6),x.normalMapTangentSpace&&o.enable(7),x.clearcoat&&o.enable(8),x.iridescence&&o.enable(9),x.alphaTest&&o.enable(10),x.vertexColors&&o.enable(11),x.vertexAlphas&&o.enable(12),x.vertexUv1s&&o.enable(13),x.vertexUv2s&&o.enable(14),x.vertexUv3s&&o.enable(15),x.vertexTangents&&o.enable(16),x.anisotropy&&o.enable(17),x.alphaHash&&o.enable(18),x.batching&&o.enable(19),x.dispersion&&o.enable(20),x.batchingColor&&o.enable(21),b.push(o.mask),o.disableAll(),x.fog&&o.enable(0),x.useFog&&o.enable(1),x.flatShading&&o.enable(2),x.logarithmicDepthBuffer&&o.enable(3),x.reverseDepthBuffer&&o.enable(4),x.skinning&&o.enable(5),x.morphTargets&&o.enable(6),x.morphNormals&&o.enable(7),x.morphColors&&o.enable(8),x.premultipliedAlpha&&o.enable(9),x.shadowMapEnabled&&o.enable(10),x.doubleSided&&o.enable(11),x.flipSided&&o.enable(12),x.useDepthPacking&&o.enable(13),x.dithering&&o.enable(14),x.transmission&&o.enable(15),x.sheen&&o.enable(16),x.opaque&&o.enable(17),x.pointsUvs&&o.enable(18),x.decodeVideoTexture&&o.enable(19),x.decodeVideoTextureEmissive&&o.enable(20),x.alphaToCoverage&&o.enable(21),b.push(o.mask)}function v(b){const x=m[b.type];let R;if(x){const B=bn[x];R=Fl.clone(B.uniforms)}else R=b.uniforms;return R}function U(b,x){let R;for(let B=0,V=h.length;B<V;B++){const W=h[B];if(W.cacheKey===x){R=W,++R.usedTimes;break}}return R===void 0&&(R=new Rg(r,x,b,s),h.push(R)),R}function C(b){if(--b.usedTimes===0){const x=h.indexOf(b);h[x]=h[h.length-1],h.pop(),b.destroy()}}function T(b){l.remove(b)}function L(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:v,acquireProgram:U,releaseProgram:C,releaseShaderCache:T,programs:h,dispose:L}}function Ug(){let r=new WeakMap;function e(a){return r.has(a)}function t(a){let o=r.get(a);return o===void 0&&(o={},r.set(a,o)),o}function n(a){r.delete(a)}function i(a,o,l){r.get(a)[o]=l}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function Ng(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function wh(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function Th(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function a(u,d,f,m,_,g){let p=r[e];return p===void 0?(p={id:u.id,object:u,geometry:d,material:f,groupOrder:m,renderOrder:u.renderOrder,z:_,group:g},r[e]=p):(p.id=u.id,p.object=u,p.geometry=d,p.material=f,p.groupOrder=m,p.renderOrder=u.renderOrder,p.z=_,p.group=g),e++,p}function o(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.push(p):f.transparent===!0?i.push(p):t.push(p)}function l(u,d,f,m,_,g){const p=a(u,d,f,m,_,g);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):t.unshift(p)}function c(u,d){t.length>1&&t.sort(u||Ng),n.length>1&&n.sort(d||wh),i.length>1&&i.sort(d||wh)}function h(){for(let u=e,d=r.length;u<d;u++){const f=r[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:o,unshift:l,finish:h,sort:c}}function Fg(){let r=new WeakMap;function e(n,i){const s=r.get(n);let a;return s===void 0?(a=new Th,r.set(n,[a])):i>=s.length?(a=new Th,s.push(a)):a=s[i],a}function t(){r=new WeakMap}return{get:e,dispose:t}}function Og(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new ot};break;case"SpotLight":t={position:new F,direction:new F,color:new ot,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new ot,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new ot,groundColor:new ot};break;case"RectAreaLight":t={color:new ot,position:new F,halfWidth:new F,halfHeight:new F};break}return r[e.id]=t,t}}}function zg(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let Bg=0;function kg(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function Vg(r){const e=new Og,t=zg(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new F);const i=new F,s=new lt,a=new lt;function o(c){let h=0,u=0,d=0;for(let b=0;b<9;b++)n.probe[b].set(0,0,0);let f=0,m=0,_=0,g=0,p=0,S=0,E=0,v=0,U=0,C=0,T=0;c.sort(kg);for(let b=0,x=c.length;b<x;b++){const R=c[b],B=R.color,V=R.intensity,W=R.distance,ee=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)h+=B.r*V,u+=B.g*V,d+=B.b*V;else if(R.isLightProbe){for(let k=0;k<9;k++)n.probe[k].addScaledVector(R.sh.coefficients[k],V);T++}else if(R.isDirectionalLight){const k=e.get(R);if(k.color.copy(R.color).multiplyScalar(R.intensity),R.castShadow){const Q=R.shadow,q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,n.directionalShadow[f]=q,n.directionalShadowMap[f]=ee,n.directionalShadowMatrix[f]=R.shadow.matrix,S++}n.directional[f]=k,f++}else if(R.isSpotLight){const k=e.get(R);k.position.setFromMatrixPosition(R.matrixWorld),k.color.copy(B).multiplyScalar(V),k.distance=W,k.coneCos=Math.cos(R.angle),k.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),k.decay=R.decay,n.spot[_]=k;const Q=R.shadow;if(R.map&&(n.spotLightMap[U]=R.map,U++,Q.updateMatrices(R),R.castShadow&&C++),n.spotLightMatrix[_]=Q.matrix,R.castShadow){const q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,n.spotShadow[_]=q,n.spotShadowMap[_]=ee,v++}_++}else if(R.isRectAreaLight){const k=e.get(R);k.color.copy(B).multiplyScalar(V),k.halfWidth.set(R.width*.5,0,0),k.halfHeight.set(0,R.height*.5,0),n.rectArea[g]=k,g++}else if(R.isPointLight){const k=e.get(R);if(k.color.copy(R.color).multiplyScalar(R.intensity),k.distance=R.distance,k.decay=R.decay,R.castShadow){const Q=R.shadow,q=t.get(R);q.shadowIntensity=Q.intensity,q.shadowBias=Q.bias,q.shadowNormalBias=Q.normalBias,q.shadowRadius=Q.radius,q.shadowMapSize=Q.mapSize,q.shadowCameraNear=Q.camera.near,q.shadowCameraFar=Q.camera.far,n.pointShadow[m]=q,n.pointShadowMap[m]=ee,n.pointShadowMatrix[m]=R.shadow.matrix,E++}n.point[m]=k,m++}else if(R.isHemisphereLight){const k=e.get(R);k.skyColor.copy(R.color).multiplyScalar(V),k.groundColor.copy(R.groundColor).multiplyScalar(V),n.hemi[p]=k,p++}}g>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ue.LTC_FLOAT_1,n.rectAreaLTC2=Ue.LTC_FLOAT_2):(n.rectAreaLTC1=Ue.LTC_HALF_1,n.rectAreaLTC2=Ue.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=u,n.ambient[2]=d;const L=n.hash;(L.directionalLength!==f||L.pointLength!==m||L.spotLength!==_||L.rectAreaLength!==g||L.hemiLength!==p||L.numDirectionalShadows!==S||L.numPointShadows!==E||L.numSpotShadows!==v||L.numSpotMaps!==U||L.numLightProbes!==T)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=S,n.directionalShadowMap.length=S,n.pointShadow.length=E,n.pointShadowMap.length=E,n.spotShadow.length=v,n.spotShadowMap.length=v,n.directionalShadowMatrix.length=S,n.pointShadowMatrix.length=E,n.spotLightMatrix.length=v+U-C,n.spotLightMap.length=U,n.numSpotLightShadowsWithMaps=C,n.numLightProbes=T,L.directionalLength=f,L.pointLength=m,L.spotLength=_,L.rectAreaLength=g,L.hemiLength=p,L.numDirectionalShadows=S,L.numPointShadows=E,L.numSpotShadows=v,L.numSpotMaps=U,L.numLightProbes=T,n.version=Bg++)}function l(c,h){let u=0,d=0,f=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,S=c.length;p<S;p++){const E=c[p];if(E.isDirectionalLight){const v=n.directional[u];v.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(g),u++}else if(E.isSpotLight){const v=n.spot[f];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),v.direction.setFromMatrixPosition(E.matrixWorld),i.setFromMatrixPosition(E.target.matrixWorld),v.direction.sub(i),v.direction.transformDirection(g),f++}else if(E.isRectAreaLight){const v=n.rectArea[m];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),a.identity(),s.copy(E.matrixWorld),s.premultiply(g),a.extractRotation(s),v.halfWidth.set(E.width*.5,0,0),v.halfHeight.set(0,E.height*.5,0),v.halfWidth.applyMatrix4(a),v.halfHeight.applyMatrix4(a),m++}else if(E.isPointLight){const v=n.point[d];v.position.setFromMatrixPosition(E.matrixWorld),v.position.applyMatrix4(g),d++}else if(E.isHemisphereLight){const v=n.hemi[_];v.direction.setFromMatrixPosition(E.matrixWorld),v.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function Ch(r){const e=new Vg(r),t=[],n=[];function i(h){c.camera=h,t.length=0,n.length=0}function s(h){t.push(h)}function a(h){n.push(h)}function o(){e.setup(t)}function l(h){e.setupView(t,h)}const c={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:s,pushShadow:a}}function Hg(r){let e=new WeakMap;function t(i,s=0){const a=e.get(i);let o;return a===void 0?(o=new Ch(r),e.set(i,[o])):s>=a.length?(o=new Ch(r),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const Gg=`void main() {
3776
3776
  gl_Position = vec4( position, 1.0 );
3777
3777
  }`,Wg=`uniform sampler2D shadow_pass;
3778
3778
  uniform vec2 resolution;
@@ -3800,7 +3800,7 @@ void main() {
3800
3800
  squared_mean = squared_mean / samples;
3801
3801
  float std_dev = sqrt( squared_mean - mean * mean );
3802
3802
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3803
- }`;function Xg(r,e,t){let n=new kl;const i=new Xe,s=new Xe,a=new Mt,o=new $p({depthPacking:Af}),l=new Jp,c={},h=t.maxTextureSize,u={[Hn]:vn,[vn]:Hn,[pn]:pn},d=new pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Xe},radius:{value:4}},vertexShader:Gg,fragmentShader:Wg}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new Bt;m.setAttribute("position",new Gt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Rt(m,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=au;let p=this.type;this.render=function(C,T,L){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||C.length===0)return;const b=r.getRenderTarget(),x=r.getActiveCubeFace(),R=r.getActiveMipmapLevel(),B=r.state;B.setBlending(wi),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const V=p!==hi&&this.type===hi,W=p===hi&&this.type!==hi;for(let ee=0,k=C.length;ee<k;ee++){const Q=C[ee],q=Q.shadow;if(q===void 0){console.warn("THREE.WebGLShadowMap:",Q,"has no shadow.");continue}if(q.autoUpdate===!1&&q.needsUpdate===!1)continue;i.copy(q.mapSize);const he=q.getFrameExtents();if(i.multiply(he),s.copy(q.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/he.x),i.x=s.x*he.x,q.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/he.y),i.y=s.y*he.y,q.mapSize.y=s.y)),q.map===null||V===!0||W===!0){const le=this.type!==hi?{minFilter:Cn,magFilter:Cn}:{};q.map!==null&&q.map.dispose(),q.map=new ji(i.x,i.y,le),q.map.texture.name=Q.name+".shadowMap",q.camera.updateProjectionMatrix()}r.setRenderTarget(q.map),r.clear();const ye=q.getViewportCount();for(let le=0;le<ye;le++){const Le=q.getViewport(le);a.set(s.x*Le.x,s.y*Le.y,s.x*Le.z,s.y*Le.w),B.viewport(a),q.updateMatrices(Q,le),n=q.getFrustum(),v(T,L,q.camera,Q,this.type)}q.isPointLightShadow!==!0&&this.type===hi&&S(q,L),q.needsUpdate=!1}p=this.type,g.needsUpdate=!1,r.setRenderTarget(b,x,R)};function S(C,T){const L=e.update(_);d.defines.VSM_SAMPLES!==C.blurSamples&&(d.defines.VSM_SAMPLES=C.blurSamples,f.defines.VSM_SAMPLES=C.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),C.mapPass===null&&(C.mapPass=new ji(i.x,i.y)),d.uniforms.shadow_pass.value=C.map.texture,d.uniforms.resolution.value=C.mapSize,d.uniforms.radius.value=C.radius,r.setRenderTarget(C.mapPass),r.clear(),r.renderBufferDirect(T,null,L,d,_,null),f.uniforms.shadow_pass.value=C.mapPass.texture,f.uniforms.resolution.value=C.mapSize,f.uniforms.radius.value=C.radius,r.setRenderTarget(C.map),r.clear(),r.renderBufferDirect(T,null,L,f,_,null)}function E(C,T,L,b){let x=null;const R=L.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(R!==void 0)x=R;else if(x=L.isPointLight===!0?l:o,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const B=x.uuid,V=T.uuid;let W=c[B];W===void 0&&(W={},c[B]=W);let ee=W[V];ee===void 0&&(ee=x.clone(),W[V]=ee,T.addEventListener("dispose",U)),x=ee}if(x.visible=T.visible,x.wireframe=T.wireframe,b===hi?x.side=T.shadowSide!==null?T.shadowSide:T.side:x.side=T.shadowSide!==null?T.shadowSide:u[T.side],x.alphaMap=T.alphaMap,x.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,x.map=T.map,x.clipShadows=T.clipShadows,x.clippingPlanes=T.clippingPlanes,x.clipIntersection=T.clipIntersection,x.displacementMap=T.displacementMap,x.displacementScale=T.displacementScale,x.displacementBias=T.displacementBias,x.wireframeLinewidth=T.wireframeLinewidth,x.linewidth=T.linewidth,L.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const B=r.properties.get(x);B.light=L}return x}function v(C,T,L,b,x){if(C.visible===!1)return;if(C.layers.test(T.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&x===hi)&&(!C.frustumCulled||n.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,C.matrixWorld);const V=e.update(C),W=C.material;if(Array.isArray(W)){const ee=V.groups;for(let k=0,Q=ee.length;k<Q;k++){const q=ee[k],he=W[q.materialIndex];if(he&&he.visible){const ye=E(C,he,b,x);C.onBeforeShadow(r,C,T,L,V,ye,q),r.renderBufferDirect(L,null,V,ye,C,q),C.onAfterShadow(r,C,T,L,V,ye,q)}}}else if(W.visible){const ee=E(C,W,b,x);C.onBeforeShadow(r,C,T,L,V,ee,null),r.renderBufferDirect(L,null,V,ee,C,null),C.onAfterShadow(r,C,T,L,V,ee,null)}}const B=C.children;for(let V=0,W=B.length;V<W;V++)v(B[V],T,L,b,x)}function U(C){C.target.removeEventListener("dispose",U);for(const L in c){const b=c[L],x=C.target.uuid;x in b&&(b[x].dispose(),delete b[x])}}}const qg={[To]:Co,[Ro]:Lo,[Do]:Io,[Tr]:Po,[Co]:To,[Lo]:Ro,[Io]:Do,[Po]:Tr};function jg(r,e){function t(){let H=!1;const Fe=new Mt;let ve=null;const He=new Mt(0,0,0,0);return{setMask:function(Me){ve!==Me&&!H&&(r.colorMask(Me,Me,Me,Me),ve=Me)},setLocked:function(Me){H=Me},setClear:function(Me,ge,qe,ht,Dt){Dt===!0&&(Me*=ht,ge*=ht,qe*=ht),Fe.set(Me,ge,qe,ht),He.equals(Fe)===!1&&(r.clearColor(Me,ge,qe,ht),He.copy(Fe))},reset:function(){H=!1,ve=null,He.set(-1,0,0,0)}}}function n(){let H=!1,Fe=!1,ve=null,He=null,Me=null;return{setReversed:function(ge){if(Fe!==ge){const qe=e.get("EXT_clip_control");ge?qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.ZERO_TO_ONE_EXT):qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.NEGATIVE_ONE_TO_ONE_EXT),Fe=ge;const ht=Me;Me=null,this.setClear(ht)}},getReversed:function(){return Fe},setTest:function(ge){ge?oe(r.DEPTH_TEST):Se(r.DEPTH_TEST)},setMask:function(ge){ve!==ge&&!H&&(r.depthMask(ge),ve=ge)},setFunc:function(ge){if(Fe&&(ge=qg[ge]),He!==ge){switch(ge){case To:r.depthFunc(r.NEVER);break;case Co:r.depthFunc(r.ALWAYS);break;case Ro:r.depthFunc(r.LESS);break;case Tr:r.depthFunc(r.LEQUAL);break;case Do:r.depthFunc(r.EQUAL);break;case Po:r.depthFunc(r.GEQUAL);break;case Lo:r.depthFunc(r.GREATER);break;case Io:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}He=ge}},setLocked:function(ge){H=ge},setClear:function(ge){Me!==ge&&(Fe&&(ge=1-ge),r.clearDepth(ge),Me=ge)},reset:function(){H=!1,ve=null,He=null,Me=null,Fe=!1}}}function i(){let H=!1,Fe=null,ve=null,He=null,Me=null,ge=null,qe=null,ht=null,Dt=null;return{setTest:function(pt){H||(pt?oe(r.STENCIL_TEST):Se(r.STENCIL_TEST))},setMask:function(pt){Fe!==pt&&!H&&(r.stencilMask(pt),Fe=pt)},setFunc:function(pt,en,je){(ve!==pt||He!==en||Me!==je)&&(r.stencilFunc(pt,en,je),ve=pt,He=en,Me=je)},setOp:function(pt,en,je){(ge!==pt||qe!==en||ht!==je)&&(r.stencilOp(pt,en,je),ge=pt,qe=en,ht=je)},setLocked:function(pt){H=pt},setClear:function(pt){Dt!==pt&&(r.clearStencil(pt),Dt=pt)},reset:function(){H=!1,Fe=null,ve=null,He=null,Me=null,ge=null,qe=null,ht=null,Dt=null}}}const s=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,S=null,E=null,v=null,U=null,C=null,T=new ot(0,0,0),L=0,b=!1,x=null,R=null,B=null,V=null,W=null;const ee=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let k=!1,Q=0;const q=r.getParameter(r.VERSION);q.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec(q)[1]),k=Q>=1):q.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),k=Q>=2);let he=null,ye={};const le=r.getParameter(r.SCISSOR_BOX),Le=r.getParameter(r.VIEWPORT),we=new Mt().fromArray(le),Y=new Mt().fromArray(Le);function re(H,Fe,ve,He){const Me=new Uint8Array(4),ge=r.createTexture();r.bindTexture(H,ge),r.texParameteri(H,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(H,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let qe=0;qe<ve;qe++)H===r.TEXTURE_3D||H===r.TEXTURE_2D_ARRAY?r.texImage3D(Fe,0,r.RGBA,1,1,He,0,r.RGBA,r.UNSIGNED_BYTE,Me):r.texImage2D(Fe+qe,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Me);return ge}const ae={};ae[r.TEXTURE_2D]=re(r.TEXTURE_2D,r.TEXTURE_2D,1),ae[r.TEXTURE_CUBE_MAP]=re(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ae[r.TEXTURE_2D_ARRAY]=re(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ae[r.TEXTURE_3D]=re(r.TEXTURE_3D,r.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),oe(r.DEPTH_TEST),a.setFunc(Tr),$(!1),pe(rc),oe(r.CULL_FACE),O(wi);function oe(H){h[H]!==!0&&(r.enable(H),h[H]=!0)}function Se(H){h[H]!==!1&&(r.disable(H),h[H]=!1)}function _e(H,Fe){return u[H]!==Fe?(r.bindFramebuffer(H,Fe),u[H]=Fe,H===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=Fe),H===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=Fe),!0):!1}function Ae(H,Fe){let ve=f,He=!1;if(H){ve=d.get(Fe),ve===void 0&&(ve=[],d.set(Fe,ve));const Me=H.textures;if(ve.length!==Me.length||ve[0]!==r.COLOR_ATTACHMENT0){for(let ge=0,qe=Me.length;ge<qe;ge++)ve[ge]=r.COLOR_ATTACHMENT0+ge;ve.length=Me.length,He=!0}}else ve[0]!==r.BACK&&(ve[0]=r.BACK,He=!0);He&&r.drawBuffers(ve)}function ke(H){return m!==H?(r.useProgram(H),m=H,!0):!1}const tt={[Vi]:r.FUNC_ADD,[$d]:r.FUNC_SUBTRACT,[Jd]:r.FUNC_REVERSE_SUBTRACT};tt[Kd]=r.MIN,tt[Zd]=r.MAX;const Ze={[Qd]:r.ZERO,[ef]:r.ONE,[tf]:r.SRC_COLOR,[Ao]:r.SRC_ALPHA,[lf]:r.SRC_ALPHA_SATURATE,[af]:r.DST_COLOR,[rf]:r.DST_ALPHA,[nf]:r.ONE_MINUS_SRC_COLOR,[wo]:r.ONE_MINUS_SRC_ALPHA,[of]:r.ONE_MINUS_DST_COLOR,[sf]:r.ONE_MINUS_DST_ALPHA,[cf]:r.CONSTANT_COLOR,[hf]:r.ONE_MINUS_CONSTANT_COLOR,[uf]:r.CONSTANT_ALPHA,[df]:r.ONE_MINUS_CONSTANT_ALPHA};function O(H,Fe,ve,He,Me,ge,qe,ht,Dt,pt){if(H===wi){_===!0&&(Se(r.BLEND),_=!1);return}if(_===!1&&(oe(r.BLEND),_=!0),H!==Yd){if(H!==g||pt!==b){if((p!==Vi||v!==Vi)&&(r.blendEquation(r.FUNC_ADD),p=Vi,v=Vi),pt)switch(H){case Er:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case sc:r.blendFunc(r.ONE,r.ONE);break;case ac:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case oc:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}else switch(H){case Er:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case sc:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case ac:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case oc:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}S=null,E=null,U=null,C=null,T.set(0,0,0),L=0,g=H,b=pt}return}Me=Me||Fe,ge=ge||ve,qe=qe||He,(Fe!==p||Me!==v)&&(r.blendEquationSeparate(tt[Fe],tt[Me]),p=Fe,v=Me),(ve!==S||He!==E||ge!==U||qe!==C)&&(r.blendFuncSeparate(Ze[ve],Ze[He],Ze[ge],Ze[qe]),S=ve,E=He,U=ge,C=qe),(ht.equals(T)===!1||Dt!==L)&&(r.blendColor(ht.r,ht.g,ht.b,Dt),T.copy(ht),L=Dt),g=H,b=!1}function bt(H,Fe){H.side===pn?Se(r.CULL_FACE):oe(r.CULL_FACE);let ve=H.side===vn;Fe&&(ve=!ve),$(ve),H.blending===Er&&H.transparent===!1?O(wi):O(H.blending,H.blendEquation,H.blendSrc,H.blendDst,H.blendEquationAlpha,H.blendSrcAlpha,H.blendDstAlpha,H.blendColor,H.blendAlpha,H.premultipliedAlpha),a.setFunc(H.depthFunc),a.setTest(H.depthTest),a.setMask(H.depthWrite),s.setMask(H.colorWrite);const He=H.stencilWrite;o.setTest(He),He&&(o.setMask(H.stencilWriteMask),o.setFunc(H.stencilFunc,H.stencilRef,H.stencilFuncMask),o.setOp(H.stencilFail,H.stencilZFail,H.stencilZPass)),Te(H.polygonOffset,H.polygonOffsetFactor,H.polygonOffsetUnits),H.alphaToCoverage===!0?oe(r.SAMPLE_ALPHA_TO_COVERAGE):Se(r.SAMPLE_ALPHA_TO_COVERAGE)}function $(H){x!==H&&(H?r.frontFace(r.CW):r.frontFace(r.CCW),x=H)}function pe(H){H!==qd?(oe(r.CULL_FACE),H!==R&&(H===rc?r.cullFace(r.BACK):H===jd?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Se(r.CULL_FACE),R=H}function te(H){H!==B&&(k&&r.lineWidth(H),B=H)}function Te(H,Fe,ve){H?(oe(r.POLYGON_OFFSET_FILL),(V!==Fe||W!==ve)&&(r.polygonOffset(Fe,ve),V=Fe,W=ve)):Se(r.POLYGON_OFFSET_FILL)}function ce(H){H?oe(r.SCISSOR_TEST):Se(r.SCISSOR_TEST)}function ue(H){H===void 0&&(H=r.TEXTURE0+ee-1),he!==H&&(r.activeTexture(H),he=H)}function De(H,Fe,ve){ve===void 0&&(he===null?ve=r.TEXTURE0+ee-1:ve=he);let He=ye[ve];He===void 0&&(He={type:void 0,texture:void 0},ye[ve]=He),(He.type!==H||He.texture!==Fe)&&(he!==ve&&(r.activeTexture(ve),he=ve),r.bindTexture(H,Fe||ae[H]),He.type=H,He.texture=Fe)}function N(){const H=ye[he];H!==void 0&&H.type!==void 0&&(r.bindTexture(H.type,null),H.type=void 0,H.texture=void 0)}function A(){try{r.compressedTexImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function G(){try{r.compressedTexImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function z(){try{r.texSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function se(){try{r.texSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function ne(){try{r.compressedTexSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ce(){try{r.compressedTexSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ee(){try{r.texStorage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Be(){try{r.texStorage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ve(){try{r.texImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function me(){try{r.texImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Pe(H){we.equals(H)===!1&&(r.scissor(H.x,H.y,H.z,H.w),we.copy(H))}function Je(H){Y.equals(H)===!1&&(r.viewport(H.x,H.y,H.z,H.w),Y.copy(H))}function nt(H,Fe){let ve=c.get(Fe);ve===void 0&&(ve=new WeakMap,c.set(Fe,ve));let He=ve.get(H);He===void 0&&(He=r.getUniformBlockIndex(Fe,H.name),ve.set(H,He))}function Ie(H,Fe){const He=c.get(Fe).get(H);l.get(Fe)!==He&&(r.uniformBlockBinding(Fe,He,H.__bindingPointIndex),l.set(Fe,He))}function ct(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),a.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),h={},he=null,ye={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,S=null,E=null,v=null,U=null,C=null,T=new ot(0,0,0),L=0,b=!1,x=null,R=null,B=null,V=null,W=null,we.set(0,0,r.canvas.width,r.canvas.height),Y.set(0,0,r.canvas.width,r.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:oe,disable:Se,bindFramebuffer:_e,drawBuffers:Ae,useProgram:ke,setBlending:O,setMaterial:bt,setFlipSided:$,setCullFace:pe,setLineWidth:te,setPolygonOffset:Te,setScissorTest:ce,activeTexture:ue,bindTexture:De,unbindTexture:N,compressedTexImage2D:A,compressedTexImage3D:G,texImage2D:Ve,texImage3D:me,updateUBOMapping:nt,uniformBlockBinding:Ie,texStorage2D:Ee,texStorage3D:Be,texSubImage2D:z,texSubImage3D:se,compressedTexSubImage2D:ne,compressedTexSubImage3D:Ce,scissor:Pe,viewport:Je,reset:ct}}function Yg(r,e,t,n,i,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Xe,h=new WeakMap;let u;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(N,A){return f?new OffscreenCanvas(N,A):os("canvas")}function _(N,A,G){let z=1;const se=De(N);if((se.width>G||se.height>G)&&(z=G/Math.max(se.width,se.height)),z<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 ne=Math.floor(z*se.width),Ce=Math.floor(z*se.height);u===void 0&&(u=m(ne,Ce));const Ee=A?m(ne,Ce):u;return Ee.width=ne,Ee.height=Ce,Ee.getContext("2d").drawImage(N,0,0,ne,Ce),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+ne+"x"+Ce+")."),Ee}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),N;return N}function g(N){return N.generateMipmaps}function p(N){r.generateMipmap(N)}function S(N){return N.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:N.isWebGL3DRenderTarget?r.TEXTURE_3D:N.isWebGLArrayRenderTarget||N.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function E(N,A,G,z,se=!1){if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let ne=A;if(A===r.RED&&(G===r.FLOAT&&(ne=r.R32F),G===r.HALF_FLOAT&&(ne=r.R16F),G===r.UNSIGNED_BYTE&&(ne=r.R8)),A===r.RED_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.R8UI),G===r.UNSIGNED_SHORT&&(ne=r.R16UI),G===r.UNSIGNED_INT&&(ne=r.R32UI),G===r.BYTE&&(ne=r.R8I),G===r.SHORT&&(ne=r.R16I),G===r.INT&&(ne=r.R32I)),A===r.RG&&(G===r.FLOAT&&(ne=r.RG32F),G===r.HALF_FLOAT&&(ne=r.RG16F),G===r.UNSIGNED_BYTE&&(ne=r.RG8)),A===r.RG_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RG8UI),G===r.UNSIGNED_SHORT&&(ne=r.RG16UI),G===r.UNSIGNED_INT&&(ne=r.RG32UI),G===r.BYTE&&(ne=r.RG8I),G===r.SHORT&&(ne=r.RG16I),G===r.INT&&(ne=r.RG32I)),A===r.RGB_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RGB8UI),G===r.UNSIGNED_SHORT&&(ne=r.RGB16UI),G===r.UNSIGNED_INT&&(ne=r.RGB32UI),G===r.BYTE&&(ne=r.RGB8I),G===r.SHORT&&(ne=r.RGB16I),G===r.INT&&(ne=r.RGB32I)),A===r.RGBA_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RGBA8UI),G===r.UNSIGNED_SHORT&&(ne=r.RGBA16UI),G===r.UNSIGNED_INT&&(ne=r.RGBA32UI),G===r.BYTE&&(ne=r.RGBA8I),G===r.SHORT&&(ne=r.RGBA16I),G===r.INT&&(ne=r.RGBA32I)),A===r.RGB&&G===r.UNSIGNED_INT_5_9_9_9_REV&&(ne=r.RGB9_E5),A===r.RGBA){const Ce=se?pa:xt.getTransfer(z);G===r.FLOAT&&(ne=r.RGBA32F),G===r.HALF_FLOAT&&(ne=r.RGBA16F),G===r.UNSIGNED_BYTE&&(ne=Ce===Ut?r.SRGB8_ALPHA8:r.RGBA8),G===r.UNSIGNED_SHORT_4_4_4_4&&(ne=r.RGBA4),G===r.UNSIGNED_SHORT_5_5_5_1&&(ne=r.RGB5_A1)}return(ne===r.R16F||ne===r.R32F||ne===r.RG16F||ne===r.RG32F||ne===r.RGBA16F||ne===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ne}function v(N,A){let G;return N?A===null||A===qi||A===rs?G=r.DEPTH24_STENCIL8:A===Jn?G=r.DEPTH32F_STENCIL8:A===is&&(G=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):A===null||A===qi||A===rs?G=r.DEPTH_COMPONENT24:A===Jn?G=r.DEPTH_COMPONENT32F:A===is&&(G=r.DEPTH_COMPONENT16),G}function U(N,A){return g(N)===!0||N.isFramebufferTexture&&N.minFilter!==Cn&&N.minFilter!==Tn?Math.log2(Math.max(A.width,A.height))+1:N.mipmaps!==void 0&&N.mipmaps.length>0?N.mipmaps.length:N.isCompressedTexture&&Array.isArray(N.image)?A.mipmaps.length:1}function C(N){const A=N.target;A.removeEventListener("dispose",C),L(A),A.isVideoTexture&&h.delete(A)}function T(N){const A=N.target;A.removeEventListener("dispose",T),x(A)}function L(N){const A=n.get(N);if(A.__webglInit===void 0)return;const G=N.source,z=d.get(G);if(z){const se=z[A.__cacheKey];se.usedTimes--,se.usedTimes===0&&b(N),Object.keys(z).length===0&&d.delete(G)}n.remove(N)}function b(N){const A=n.get(N);r.deleteTexture(A.__webglTexture);const G=N.source,z=d.get(G);delete z[A.__cacheKey],a.memory.textures--}function x(N){const A=n.get(N);if(N.depthTexture&&(N.depthTexture.dispose(),n.remove(N.depthTexture)),N.isWebGLCubeRenderTarget)for(let z=0;z<6;z++){if(Array.isArray(A.__webglFramebuffer[z]))for(let se=0;se<A.__webglFramebuffer[z].length;se++)r.deleteFramebuffer(A.__webglFramebuffer[z][se]);else r.deleteFramebuffer(A.__webglFramebuffer[z]);A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[z])}else{if(Array.isArray(A.__webglFramebuffer))for(let z=0;z<A.__webglFramebuffer.length;z++)r.deleteFramebuffer(A.__webglFramebuffer[z]);else r.deleteFramebuffer(A.__webglFramebuffer);if(A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer),A.__webglMultisampledFramebuffer&&r.deleteFramebuffer(A.__webglMultisampledFramebuffer),A.__webglColorRenderbuffer)for(let z=0;z<A.__webglColorRenderbuffer.length;z++)A.__webglColorRenderbuffer[z]&&r.deleteRenderbuffer(A.__webglColorRenderbuffer[z]);A.__webglDepthRenderbuffer&&r.deleteRenderbuffer(A.__webglDepthRenderbuffer)}const G=N.textures;for(let z=0,se=G.length;z<se;z++){const ne=n.get(G[z]);ne.__webglTexture&&(r.deleteTexture(ne.__webglTexture),a.memory.textures--),n.remove(G[z])}n.remove(N)}let R=0;function B(){R=0}function V(){const N=R;return N>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+i.maxTextures),R+=1,N}function W(N){const A=[];return A.push(N.wrapS),A.push(N.wrapT),A.push(N.wrapR||0),A.push(N.magFilter),A.push(N.minFilter),A.push(N.anisotropy),A.push(N.internalFormat),A.push(N.format),A.push(N.type),A.push(N.generateMipmaps),A.push(N.premultiplyAlpha),A.push(N.flipY),A.push(N.unpackAlignment),A.push(N.colorSpace),A.join()}function ee(N,A){const G=n.get(N);if(N.isVideoTexture&&ce(N),N.isRenderTargetTexture===!1&&N.version>0&&G.__version!==N.version){const z=N.image;if(z===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(z.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(G,N,A);return}}t.bindTexture(r.TEXTURE_2D,G.__webglTexture,r.TEXTURE0+A)}function k(N,A){const G=n.get(N);if(N.version>0&&G.__version!==N.version){ae(G,N,A);return}t.bindTexture(r.TEXTURE_2D_ARRAY,G.__webglTexture,r.TEXTURE0+A)}function Q(N,A){const G=n.get(N);if(N.version>0&&G.__version!==N.version){ae(G,N,A);return}t.bindTexture(r.TEXTURE_3D,G.__webglTexture,r.TEXTURE0+A)}function q(N,A){const G=n.get(N);if(N.version>0&&G.__version!==N.version){oe(G,N,A);return}t.bindTexture(r.TEXTURE_CUBE_MAP,G.__webglTexture,r.TEXTURE0+A)}const he={[$n]:r.REPEAT,[kn]:r.CLAMP_TO_EDGE,[Fo]:r.MIRRORED_REPEAT},ye={[Cn]:r.NEAREST,[bf]:r.NEAREST_MIPMAP_NEAREST,[gs]:r.NEAREST_MIPMAP_LINEAR,[Tn]:r.LINEAR,[Pa]:r.LINEAR_MIPMAP_NEAREST,[ui]:r.LINEAR_MIPMAP_LINEAR},le={[Tf]:r.NEVER,[If]:r.ALWAYS,[Cf]:r.LESS,[vu]:r.LEQUAL,[Rf]:r.EQUAL,[Lf]:r.GEQUAL,[Df]:r.GREATER,[Pf]:r.NOTEQUAL};function Le(N,A){if(A.type===Jn&&e.has("OES_texture_float_linear")===!1&&(A.magFilter===Tn||A.magFilter===Pa||A.magFilter===gs||A.magFilter===ui||A.minFilter===Tn||A.minFilter===Pa||A.minFilter===gs||A.minFilter===ui)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(N,r.TEXTURE_WRAP_S,he[A.wrapS]),r.texParameteri(N,r.TEXTURE_WRAP_T,he[A.wrapT]),(N===r.TEXTURE_3D||N===r.TEXTURE_2D_ARRAY)&&r.texParameteri(N,r.TEXTURE_WRAP_R,he[A.wrapR]),r.texParameteri(N,r.TEXTURE_MAG_FILTER,ye[A.magFilter]),r.texParameteri(N,r.TEXTURE_MIN_FILTER,ye[A.minFilter]),A.compareFunction&&(r.texParameteri(N,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(N,r.TEXTURE_COMPARE_FUNC,le[A.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(A.magFilter===Cn||A.minFilter!==gs&&A.minFilter!==ui||A.type===Jn&&e.has("OES_texture_float_linear")===!1)return;if(A.anisotropy>1||n.get(A).__currentAnisotropy){const G=e.get("EXT_texture_filter_anisotropic");r.texParameterf(N,G.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,i.getMaxAnisotropy())),n.get(A).__currentAnisotropy=A.anisotropy}}}function we(N,A){let G=!1;N.__webglInit===void 0&&(N.__webglInit=!0,A.addEventListener("dispose",C));const z=A.source;let se=d.get(z);se===void 0&&(se={},d.set(z,se));const ne=W(A);if(ne!==N.__cacheKey){se[ne]===void 0&&(se[ne]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,G=!0),se[ne].usedTimes++;const Ce=se[N.__cacheKey];Ce!==void 0&&(se[N.__cacheKey].usedTimes--,Ce.usedTimes===0&&b(A)),N.__cacheKey=ne,N.__webglTexture=se[ne].texture}return G}function Y(N,A,G){return Math.floor(Math.floor(N/G)/A)}function re(N,A,G,z){const ne=N.updateRanges;if(ne.length===0)t.texSubImage2D(r.TEXTURE_2D,0,0,0,A.width,A.height,G,z,A.data);else{ne.sort((me,Pe)=>me.start-Pe.start);let Ce=0;for(let me=1;me<ne.length;me++){const Pe=ne[Ce],Je=ne[me],nt=Pe.start+Pe.count,Ie=Y(Je.start,A.width,4),ct=Y(Pe.start,A.width,4);Je.start<=nt+1&&Ie===ct&&Y(Je.start+Je.count-1,A.width,4)===Ie?Pe.count=Math.max(Pe.count,Je.start+Je.count-Pe.start):(++Ce,ne[Ce]=Je)}ne.length=Ce+1;const Ee=r.getParameter(r.UNPACK_ROW_LENGTH),Be=r.getParameter(r.UNPACK_SKIP_PIXELS),Ve=r.getParameter(r.UNPACK_SKIP_ROWS);r.pixelStorei(r.UNPACK_ROW_LENGTH,A.width);for(let me=0,Pe=ne.length;me<Pe;me++){const Je=ne[me],nt=Math.floor(Je.start/4),Ie=Math.ceil(Je.count/4),ct=nt%A.width,H=Math.floor(nt/A.width),Fe=Ie,ve=1;r.pixelStorei(r.UNPACK_SKIP_PIXELS,ct),r.pixelStorei(r.UNPACK_SKIP_ROWS,H),t.texSubImage2D(r.TEXTURE_2D,0,ct,H,Fe,ve,G,z,A.data)}N.clearUpdateRanges(),r.pixelStorei(r.UNPACK_ROW_LENGTH,Ee),r.pixelStorei(r.UNPACK_SKIP_PIXELS,Be),r.pixelStorei(r.UNPACK_SKIP_ROWS,Ve)}}function ae(N,A,G){let z=r.TEXTURE_2D;(A.isDataArrayTexture||A.isCompressedArrayTexture)&&(z=r.TEXTURE_2D_ARRAY),A.isData3DTexture&&(z=r.TEXTURE_3D);const se=we(N,A),ne=A.source;t.bindTexture(z,N.__webglTexture,r.TEXTURE0+G);const Ce=n.get(ne);if(ne.version!==Ce.__version||se===!0){t.activeTexture(r.TEXTURE0+G);const Ee=xt.getPrimaries(xt.workingColorSpace),Be=A.colorSpace===Ai?null:xt.getPrimaries(A.colorSpace),Ve=A.colorSpace===Ai||Ee===Be?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);let me=_(A.image,!1,i.maxTextureSize);me=ue(A,me);const Pe=s.convert(A.format,A.colorSpace),Je=s.convert(A.type);let nt=E(A.internalFormat,Pe,Je,A.colorSpace,A.isVideoTexture);Le(z,A);let Ie;const ct=A.mipmaps,H=A.isVideoTexture!==!0,Fe=Ce.__version===void 0||se===!0,ve=ne.dataReady,He=U(A,me);if(A.isDepthTexture)nt=v(A.format===as,A.type),Fe&&(H?t.texStorage2D(r.TEXTURE_2D,1,nt,me.width,me.height):t.texImage2D(r.TEXTURE_2D,0,nt,me.width,me.height,0,Pe,Je,null));else if(A.isDataTexture)if(ct.length>0){H&&Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,ct[0].width,ct[0].height);for(let Me=0,ge=ct.length;Me<ge;Me++)Ie=ct[Me],H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Ie.width,Ie.height,Pe,Je,Ie.data):t.texImage2D(r.TEXTURE_2D,Me,nt,Ie.width,Ie.height,0,Pe,Je,Ie.data);A.generateMipmaps=!1}else H?(Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,me.width,me.height),ve&&re(A,me,Pe,Je)):t.texImage2D(r.TEXTURE_2D,0,nt,me.width,me.height,0,Pe,Je,me.data);else if(A.isCompressedTexture)if(A.isCompressedArrayTexture){H&&Fe&&t.texStorage3D(r.TEXTURE_2D_ARRAY,He,nt,ct[0].width,ct[0].height,me.depth);for(let Me=0,ge=ct.length;Me<ge;Me++)if(Ie=ct[Me],A.format!==Un)if(Pe!==null)if(H){if(ve)if(A.layerUpdates.size>0){const qe=rh(Ie.width,Ie.height,A.format,A.type);for(const ht of A.layerUpdates){const Dt=Ie.data.subarray(ht*qe/Ie.data.BYTES_PER_ELEMENT,(ht+1)*qe/Ie.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,ht,Ie.width,Ie.height,1,Pe,Dt)}A.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,0,Ie.width,Ie.height,me.depth,Pe,Ie.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Me,nt,Ie.width,Ie.height,me.depth,0,Ie.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else H?ve&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,0,Ie.width,Ie.height,me.depth,Pe,Je,Ie.data):t.texImage3D(r.TEXTURE_2D_ARRAY,Me,nt,Ie.width,Ie.height,me.depth,0,Pe,Je,Ie.data)}else{H&&Fe&&t.texStorage2D(r.TEXTURE_2D,He,nt,ct[0].width,ct[0].height);for(let Me=0,ge=ct.length;Me<ge;Me++)Ie=ct[Me],A.format!==Un?Pe!==null?H?ve&&t.compressedTexSubImage2D(r.TEXTURE_2D,Me,0,0,Ie.width,Ie.height,Pe,Ie.data):t.compressedTexImage2D(r.TEXTURE_2D,Me,nt,Ie.width,Ie.height,0,Ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Ie.width,Ie.height,Pe,Je,Ie.data):t.texImage2D(r.TEXTURE_2D,Me,nt,Ie.width,Ie.height,0,Pe,Je,Ie.data)}else if(A.isDataArrayTexture)if(H){if(Fe&&t.texStorage3D(r.TEXTURE_2D_ARRAY,He,nt,me.width,me.height,me.depth),ve)if(A.layerUpdates.size>0){const Me=rh(me.width,me.height,A.format,A.type);for(const ge of A.layerUpdates){const qe=me.data.subarray(ge*Me/me.data.BYTES_PER_ELEMENT,(ge+1)*Me/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,ge,me.width,me.height,1,Pe,Je,qe)}A.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,Pe,Je,me.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,nt,me.width,me.height,me.depth,0,Pe,Je,me.data);else if(A.isData3DTexture)H?(Fe&&t.texStorage3D(r.TEXTURE_3D,He,nt,me.width,me.height,me.depth),ve&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,Pe,Je,me.data)):t.texImage3D(r.TEXTURE_3D,0,nt,me.width,me.height,me.depth,0,Pe,Je,me.data);else if(A.isFramebufferTexture){if(Fe)if(H)t.texStorage2D(r.TEXTURE_2D,He,nt,me.width,me.height);else{let Me=me.width,ge=me.height;for(let qe=0;qe<He;qe++)t.texImage2D(r.TEXTURE_2D,qe,nt,Me,ge,0,Pe,Je,null),Me>>=1,ge>>=1}}else if(ct.length>0){if(H&&Fe){const Me=De(ct[0]);t.texStorage2D(r.TEXTURE_2D,He,nt,Me.width,Me.height)}for(let Me=0,ge=ct.length;Me<ge;Me++)Ie=ct[Me],H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Pe,Je,Ie):t.texImage2D(r.TEXTURE_2D,Me,nt,Pe,Je,Ie);A.generateMipmaps=!1}else if(H){if(Fe){const Me=De(me);t.texStorage2D(r.TEXTURE_2D,He,nt,Me.width,Me.height)}ve&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Pe,Je,me)}else t.texImage2D(r.TEXTURE_2D,0,nt,Pe,Je,me);g(A)&&p(z),Ce.__version=ne.version,A.onUpdate&&A.onUpdate(A)}N.__version=A.version}function oe(N,A,G){if(A.image.length!==6)return;const z=we(N,A),se=A.source;t.bindTexture(r.TEXTURE_CUBE_MAP,N.__webglTexture,r.TEXTURE0+G);const ne=n.get(se);if(se.version!==ne.__version||z===!0){t.activeTexture(r.TEXTURE0+G);const Ce=xt.getPrimaries(xt.workingColorSpace),Ee=A.colorSpace===Ai?null:xt.getPrimaries(A.colorSpace),Be=A.colorSpace===Ai||Ce===Ee?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);const Ve=A.isCompressedTexture||A.image[0].isCompressedTexture,me=A.image[0]&&A.image[0].isDataTexture,Pe=[];for(let ge=0;ge<6;ge++)!Ve&&!me?Pe[ge]=_(A.image[ge],!0,i.maxCubemapSize):Pe[ge]=me?A.image[ge].image:A.image[ge],Pe[ge]=ue(A,Pe[ge]);const Je=Pe[0],nt=s.convert(A.format,A.colorSpace),Ie=s.convert(A.type),ct=E(A.internalFormat,nt,Ie,A.colorSpace),H=A.isVideoTexture!==!0,Fe=ne.__version===void 0||z===!0,ve=se.dataReady;let He=U(A,Je);Le(r.TEXTURE_CUBE_MAP,A);let Me;if(Ve){H&&Fe&&t.texStorage2D(r.TEXTURE_CUBE_MAP,He,ct,Je.width,Je.height);for(let ge=0;ge<6;ge++){Me=Pe[ge].mipmaps;for(let qe=0;qe<Me.length;qe++){const ht=Me[qe];A.format!==Un?nt!==null?H?ve&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,0,0,ht.width,ht.height,nt,ht.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,ct,ht.width,ht.height,0,ht.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,0,0,ht.width,ht.height,nt,Ie,ht.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,ct,ht.width,ht.height,0,nt,Ie,ht.data)}}}else{if(Me=A.mipmaps,H&&Fe){Me.length>0&&He++;const ge=De(Pe[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,He,ct,ge.width,ge.height)}for(let ge=0;ge<6;ge++)if(me){H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,Pe[ge].width,Pe[ge].height,nt,Ie,Pe[ge].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,ct,Pe[ge].width,Pe[ge].height,0,nt,Ie,Pe[ge].data);for(let qe=0;qe<Me.length;qe++){const Dt=Me[qe].image[ge].image;H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,0,0,Dt.width,Dt.height,nt,Ie,Dt.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,ct,Dt.width,Dt.height,0,nt,Ie,Dt.data)}}else{H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,nt,Ie,Pe[ge]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,ct,nt,Ie,Pe[ge]);for(let qe=0;qe<Me.length;qe++){const ht=Me[qe];H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,0,0,nt,Ie,ht.image[ge]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,ct,nt,Ie,ht.image[ge])}}}g(A)&&p(r.TEXTURE_CUBE_MAP),ne.__version=se.version,A.onUpdate&&A.onUpdate(A)}N.__version=A.version}function Se(N,A,G,z,se,ne){const Ce=s.convert(G.format,G.colorSpace),Ee=s.convert(G.type),Be=E(G.internalFormat,Ce,Ee,G.colorSpace),Ve=n.get(A),me=n.get(G);if(me.__renderTarget=A,!Ve.__hasExternalTextures){const Pe=Math.max(1,A.width>>ne),Je=Math.max(1,A.height>>ne);se===r.TEXTURE_3D||se===r.TEXTURE_2D_ARRAY?t.texImage3D(se,ne,Be,Pe,Je,A.depth,0,Ce,Ee,null):t.texImage2D(se,ne,Be,Pe,Je,0,Ce,Ee,null)}t.bindFramebuffer(r.FRAMEBUFFER,N),Te(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,z,se,me.__webglTexture,0,te(A)):(se===r.TEXTURE_2D||se>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&se<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,z,se,me.__webglTexture,ne),t.bindFramebuffer(r.FRAMEBUFFER,null)}function _e(N,A,G){if(r.bindRenderbuffer(r.RENDERBUFFER,N),A.depthBuffer){const z=A.depthTexture,se=z&&z.isDepthTexture?z.type:null,ne=v(A.stencilBuffer,se),Ce=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ee=te(A);Te(A)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ee,ne,A.width,A.height):G?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ee,ne,A.width,A.height):r.renderbufferStorage(r.RENDERBUFFER,ne,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Ce,r.RENDERBUFFER,N)}else{const z=A.textures;for(let se=0;se<z.length;se++){const ne=z[se],Ce=s.convert(ne.format,ne.colorSpace),Ee=s.convert(ne.type),Be=E(ne.internalFormat,Ce,Ee,ne.colorSpace),Ve=te(A);G&&Te(A)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ve,Be,A.width,A.height):Te(A)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ve,Be,A.width,A.height):r.renderbufferStorage(r.RENDERBUFFER,Be,A.width,A.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ae(N,A){if(A&&A.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,N),!(A.depthTexture&&A.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const z=n.get(A.depthTexture);z.__renderTarget=A,(!z.__webglTexture||A.depthTexture.image.width!==A.width||A.depthTexture.image.height!==A.height)&&(A.depthTexture.image.width=A.width,A.depthTexture.image.height=A.height,A.depthTexture.needsUpdate=!0),ee(A.depthTexture,0);const se=z.__webglTexture,ne=te(A);if(A.depthTexture.format===ss)Te(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,se,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,se,0);else if(A.depthTexture.format===as)Te(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,se,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,se,0);else throw new Error("Unknown depthTexture format")}function ke(N){const A=n.get(N),G=N.isWebGLCubeRenderTarget===!0;if(A.__boundDepthTexture!==N.depthTexture){const z=N.depthTexture;if(A.__depthDisposeCallback&&A.__depthDisposeCallback(),z){const se=()=>{delete A.__boundDepthTexture,delete A.__depthDisposeCallback,z.removeEventListener("dispose",se)};z.addEventListener("dispose",se),A.__depthDisposeCallback=se}A.__boundDepthTexture=z}if(N.depthTexture&&!A.__autoAllocateDepthBuffer){if(G)throw new Error("target.depthTexture not supported in Cube render targets");const z=N.texture.mipmaps;z&&z.length>0?Ae(A.__webglFramebuffer[0],N):Ae(A.__webglFramebuffer,N)}else if(G){A.__webglDepthbuffer=[];for(let z=0;z<6;z++)if(t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[z]),A.__webglDepthbuffer[z]===void 0)A.__webglDepthbuffer[z]=r.createRenderbuffer(),_e(A.__webglDepthbuffer[z],N,!1);else{const se=N.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=A.__webglDepthbuffer[z];r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,se,r.RENDERBUFFER,ne)}}else{const z=N.texture.mipmaps;if(z&&z.length>0?t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[0]):t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer),A.__webglDepthbuffer===void 0)A.__webglDepthbuffer=r.createRenderbuffer(),_e(A.__webglDepthbuffer,N,!1);else{const se=N.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=A.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,se,r.RENDERBUFFER,ne)}}t.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(N,A,G){const z=n.get(N);A!==void 0&&Se(z.__webglFramebuffer,N,N.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),G!==void 0&&ke(N)}function Ze(N){const A=N.texture,G=n.get(N),z=n.get(A);N.addEventListener("dispose",T);const se=N.textures,ne=N.isWebGLCubeRenderTarget===!0,Ce=se.length>1;if(Ce||(z.__webglTexture===void 0&&(z.__webglTexture=r.createTexture()),z.__version=A.version,a.memory.textures++),ne){G.__webglFramebuffer=[];for(let Ee=0;Ee<6;Ee++)if(A.mipmaps&&A.mipmaps.length>0){G.__webglFramebuffer[Ee]=[];for(let Be=0;Be<A.mipmaps.length;Be++)G.__webglFramebuffer[Ee][Be]=r.createFramebuffer()}else G.__webglFramebuffer[Ee]=r.createFramebuffer()}else{if(A.mipmaps&&A.mipmaps.length>0){G.__webglFramebuffer=[];for(let Ee=0;Ee<A.mipmaps.length;Ee++)G.__webglFramebuffer[Ee]=r.createFramebuffer()}else G.__webglFramebuffer=r.createFramebuffer();if(Ce)for(let Ee=0,Be=se.length;Ee<Be;Ee++){const Ve=n.get(se[Ee]);Ve.__webglTexture===void 0&&(Ve.__webglTexture=r.createTexture(),a.memory.textures++)}if(N.samples>0&&Te(N)===!1){G.__webglMultisampledFramebuffer=r.createFramebuffer(),G.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,G.__webglMultisampledFramebuffer);for(let Ee=0;Ee<se.length;Ee++){const Be=se[Ee];G.__webglColorRenderbuffer[Ee]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,G.__webglColorRenderbuffer[Ee]);const Ve=s.convert(Be.format,Be.colorSpace),me=s.convert(Be.type),Pe=E(Be.internalFormat,Ve,me,Be.colorSpace,N.isXRRenderTarget===!0),Je=te(N);r.renderbufferStorageMultisample(r.RENDERBUFFER,Je,Pe,N.width,N.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ee,r.RENDERBUFFER,G.__webglColorRenderbuffer[Ee])}r.bindRenderbuffer(r.RENDERBUFFER,null),N.depthBuffer&&(G.__webglDepthRenderbuffer=r.createRenderbuffer(),_e(G.__webglDepthRenderbuffer,N,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ne){t.bindTexture(r.TEXTURE_CUBE_MAP,z.__webglTexture),Le(r.TEXTURE_CUBE_MAP,A);for(let Ee=0;Ee<6;Ee++)if(A.mipmaps&&A.mipmaps.length>0)for(let Be=0;Be<A.mipmaps.length;Be++)Se(G.__webglFramebuffer[Ee][Be],N,A,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,Be);else Se(G.__webglFramebuffer[Ee],N,A,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ee,0);g(A)&&p(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ce){for(let Ee=0,Be=se.length;Ee<Be;Ee++){const Ve=se[Ee],me=n.get(Ve);t.bindTexture(r.TEXTURE_2D,me.__webglTexture),Le(r.TEXTURE_2D,Ve),Se(G.__webglFramebuffer,N,Ve,r.COLOR_ATTACHMENT0+Ee,r.TEXTURE_2D,0),g(Ve)&&p(r.TEXTURE_2D)}t.unbindTexture()}else{let Ee=r.TEXTURE_2D;if((N.isWebGL3DRenderTarget||N.isWebGLArrayRenderTarget)&&(Ee=N.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ee,z.__webglTexture),Le(Ee,A),A.mipmaps&&A.mipmaps.length>0)for(let Be=0;Be<A.mipmaps.length;Be++)Se(G.__webglFramebuffer[Be],N,A,r.COLOR_ATTACHMENT0,Ee,Be);else Se(G.__webglFramebuffer,N,A,r.COLOR_ATTACHMENT0,Ee,0);g(A)&&p(Ee),t.unbindTexture()}N.depthBuffer&&ke(N)}function O(N){const A=N.textures;for(let G=0,z=A.length;G<z;G++){const se=A[G];if(g(se)){const ne=S(N),Ce=n.get(se).__webglTexture;t.bindTexture(ne,Ce),p(ne),t.unbindTexture()}}}const bt=[],$=[];function pe(N){if(N.samples>0){if(Te(N)===!1){const A=N.textures,G=N.width,z=N.height;let se=r.COLOR_BUFFER_BIT;const ne=N.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ce=n.get(N),Ee=A.length>1;if(Ee)for(let Ve=0;Ve<A.length;Ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer);const Be=N.texture.mipmaps;Be&&Be.length>0?t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer[0]):t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let Ve=0;Ve<A.length;Ve++){if(N.resolveDepthBuffer&&(N.depthBuffer&&(se|=r.DEPTH_BUFFER_BIT),N.stencilBuffer&&N.resolveStencilBuffer&&(se|=r.STENCIL_BUFFER_BIT)),Ee){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[Ve]);const me=n.get(A[Ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,me,0)}r.blitFramebuffer(0,0,G,z,0,0,G,z,se,r.NEAREST),l===!0&&(bt.length=0,$.length=0,bt.push(r.COLOR_ATTACHMENT0+Ve),N.depthBuffer&&N.resolveDepthBuffer===!1&&(bt.push(ne),$.push(ne),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,$)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,bt))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Ee)for(let Ve=0;Ve<A.length;Ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[Ve]);const me=n.get(A[Ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,me,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}else if(N.depthBuffer&&N.resolveDepthBuffer===!1&&l){const A=N.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[A])}}}function te(N){return Math.min(i.maxSamples,N.samples)}function Te(N){const A=n.get(N);return N.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&A.__useRenderToTexture!==!1}function ce(N){const A=a.render.frame;h.get(N)!==A&&(h.set(N,A),N.update())}function ue(N,A){const G=N.colorSpace,z=N.format,se=N.type;return N.isCompressedTexture===!0||N.isVideoTexture===!0||G!==Dr&&G!==Ai&&(xt.getTransfer(G)===Ut?(z!==Un||se!==Qn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",G)),A}function De(N){return typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement?(c.width=N.naturalWidth||N.width,c.height=N.naturalHeight||N.height):typeof VideoFrame<"u"&&N instanceof VideoFrame?(c.width=N.displayWidth,c.height=N.displayHeight):(c.width=N.width,c.height=N.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=B,this.setTexture2D=ee,this.setTexture2DArray=k,this.setTexture3D=Q,this.setTextureCube=q,this.rebindTextures=tt,this.setupRenderTarget=Ze,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=pe,this.setupDepthRenderbuffer=ke,this.setupFrameBufferTexture=Se,this.useMultisampledRTT=Te}function $g(r,e){function t(n,i=Ai){let s;const a=xt.getTransfer(i);if(n===Qn)return r.UNSIGNED_BYTE;if(n===Tl)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Cl)return r.UNSIGNED_SHORT_5_5_5_1;if(n===du)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hu)return r.BYTE;if(n===uu)return r.SHORT;if(n===is)return r.UNSIGNED_SHORT;if(n===wl)return r.INT;if(n===qi)return r.UNSIGNED_INT;if(n===Jn)return r.FLOAT;if(n===hs)return r.HALF_FLOAT;if(n===fu)return r.ALPHA;if(n===pu)return r.RGB;if(n===Un)return r.RGBA;if(n===ss)return r.DEPTH_COMPONENT;if(n===as)return r.DEPTH_STENCIL;if(n===mu)return r.RED;if(n===Rl)return r.RED_INTEGER;if(n===gu)return r.RG;if(n===Dl)return r.RG_INTEGER;if(n===Pl)return r.RGBA_INTEGER;if(n===ra||n===sa||n===aa||n===oa)if(a===Ut)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===ra)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===sa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===aa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===oa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===ra)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===sa)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===aa)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===oa)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Oo||n===zo||n===Bo||n===ko)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===Oo)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===zo)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Bo)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ko)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Vo||n===Ho||n===Go)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Vo||n===Ho)return a===Ut?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Go)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Wo||n===Xo||n===qo||n===jo||n===Yo||n===$o||n===Jo||n===Ko||n===Zo||n===Qo||n===el||n===tl||n===nl||n===il)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Wo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Xo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===qo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===jo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Yo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===$o)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Jo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Ko)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Zo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Qo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===el)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===tl)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===nl)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===il)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===la||n===rl||n===sl)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===la)return a===Ut?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===rl)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===sl)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===_u||n===al||n===ol||n===ll)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===la)return s.COMPRESSED_RED_RGTC1_EXT;if(n===al)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ol)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===ll)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===rs?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const Jg=`
3803
+ }`;function Xg(r,e,t){let n=new kl;const i=new Xe,s=new Xe,a=new Mt,o=new $p({depthPacking:Af}),l=new Jp,c={},h=t.maxTextureSize,u={[Hn]:vn,[vn]:Hn,[pn]:pn},d=new pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Xe},radius:{value:4}},vertexShader:Gg,fragmentShader:Wg}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new Bt;m.setAttribute("position",new Gt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Rt(m,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=au;let p=this.type;this.render=function(C,T,L){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||C.length===0)return;const b=r.getRenderTarget(),x=r.getActiveCubeFace(),R=r.getActiveMipmapLevel(),B=r.state;B.setBlending(wi),B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const V=p!==hi&&this.type===hi,W=p===hi&&this.type!==hi;for(let ee=0,k=C.length;ee<k;ee++){const Q=C[ee],q=Q.shadow;if(q===void 0){console.warn("THREE.WebGLShadowMap:",Q,"has no shadow.");continue}if(q.autoUpdate===!1&&q.needsUpdate===!1)continue;i.copy(q.mapSize);const ue=q.getFrameExtents();if(i.multiply(ue),s.copy(q.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/ue.x),i.x=s.x*ue.x,q.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/ue.y),i.y=s.y*ue.y,q.mapSize.y=s.y)),q.map===null||V===!0||W===!0){const le=this.type!==hi?{minFilter:Cn,magFilter:Cn}:{};q.map!==null&&q.map.dispose(),q.map=new ji(i.x,i.y,le),q.map.texture.name=Q.name+".shadowMap",q.camera.updateProjectionMatrix()}r.setRenderTarget(q.map),r.clear();const ye=q.getViewportCount();for(let le=0;le<ye;le++){const Pe=q.getViewport(le);a.set(s.x*Pe.x,s.y*Pe.y,s.x*Pe.z,s.y*Pe.w),B.viewport(a),q.updateMatrices(Q,le),n=q.getFrustum(),v(T,L,q.camera,Q,this.type)}q.isPointLightShadow!==!0&&this.type===hi&&S(q,L),q.needsUpdate=!1}p=this.type,g.needsUpdate=!1,r.setRenderTarget(b,x,R)};function S(C,T){const L=e.update(_);d.defines.VSM_SAMPLES!==C.blurSamples&&(d.defines.VSM_SAMPLES=C.blurSamples,f.defines.VSM_SAMPLES=C.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),C.mapPass===null&&(C.mapPass=new ji(i.x,i.y)),d.uniforms.shadow_pass.value=C.map.texture,d.uniforms.resolution.value=C.mapSize,d.uniforms.radius.value=C.radius,r.setRenderTarget(C.mapPass),r.clear(),r.renderBufferDirect(T,null,L,d,_,null),f.uniforms.shadow_pass.value=C.mapPass.texture,f.uniforms.resolution.value=C.mapSize,f.uniforms.radius.value=C.radius,r.setRenderTarget(C.map),r.clear(),r.renderBufferDirect(T,null,L,f,_,null)}function E(C,T,L,b){let x=null;const R=L.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(R!==void 0)x=R;else if(x=L.isPointLight===!0?l:o,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const B=x.uuid,V=T.uuid;let W=c[B];W===void 0&&(W={},c[B]=W);let ee=W[V];ee===void 0&&(ee=x.clone(),W[V]=ee,T.addEventListener("dispose",U)),x=ee}if(x.visible=T.visible,x.wireframe=T.wireframe,b===hi?x.side=T.shadowSide!==null?T.shadowSide:T.side:x.side=T.shadowSide!==null?T.shadowSide:u[T.side],x.alphaMap=T.alphaMap,x.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,x.map=T.map,x.clipShadows=T.clipShadows,x.clippingPlanes=T.clippingPlanes,x.clipIntersection=T.clipIntersection,x.displacementMap=T.displacementMap,x.displacementScale=T.displacementScale,x.displacementBias=T.displacementBias,x.wireframeLinewidth=T.wireframeLinewidth,x.linewidth=T.linewidth,L.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const B=r.properties.get(x);B.light=L}return x}function v(C,T,L,b,x){if(C.visible===!1)return;if(C.layers.test(T.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&x===hi)&&(!C.frustumCulled||n.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,C.matrixWorld);const V=e.update(C),W=C.material;if(Array.isArray(W)){const ee=V.groups;for(let k=0,Q=ee.length;k<Q;k++){const q=ee[k],ue=W[q.materialIndex];if(ue&&ue.visible){const ye=E(C,ue,b,x);C.onBeforeShadow(r,C,T,L,V,ye,q),r.renderBufferDirect(L,null,V,ye,C,q),C.onAfterShadow(r,C,T,L,V,ye,q)}}}else if(W.visible){const ee=E(C,W,b,x);C.onBeforeShadow(r,C,T,L,V,ee,null),r.renderBufferDirect(L,null,V,ee,C,null),C.onAfterShadow(r,C,T,L,V,ee,null)}}const B=C.children;for(let V=0,W=B.length;V<W;V++)v(B[V],T,L,b,x)}function U(C){C.target.removeEventListener("dispose",U);for(const L in c){const b=c[L],x=C.target.uuid;x in b&&(b[x].dispose(),delete b[x])}}}const qg={[To]:Co,[Ro]:Lo,[Do]:Io,[Tr]:Po,[Co]:To,[Lo]:Ro,[Io]:Do,[Po]:Tr};function jg(r,e){function t(){let H=!1;const Ne=new Mt;let ve=null;const He=new Mt(0,0,0,0);return{setMask:function(Me){ve!==Me&&!H&&(r.colorMask(Me,Me,Me,Me),ve=Me)},setLocked:function(Me){H=Me},setClear:function(Me,ge,qe,ht,Dt){Dt===!0&&(Me*=ht,ge*=ht,qe*=ht),Ne.set(Me,ge,qe,ht),He.equals(Ne)===!1&&(r.clearColor(Me,ge,qe,ht),He.copy(Ne))},reset:function(){H=!1,ve=null,He.set(-1,0,0,0)}}}function n(){let H=!1,Ne=!1,ve=null,He=null,Me=null;return{setReversed:function(ge){if(Ne!==ge){const qe=e.get("EXT_clip_control");ge?qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.ZERO_TO_ONE_EXT):qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.NEGATIVE_ONE_TO_ONE_EXT),Ne=ge;const ht=Me;Me=null,this.setClear(ht)}},getReversed:function(){return Ne},setTest:function(ge){ge?oe(r.DEPTH_TEST):Ee(r.DEPTH_TEST)},setMask:function(ge){ve!==ge&&!H&&(r.depthMask(ge),ve=ge)},setFunc:function(ge){if(Ne&&(ge=qg[ge]),He!==ge){switch(ge){case To:r.depthFunc(r.NEVER);break;case Co:r.depthFunc(r.ALWAYS);break;case Ro:r.depthFunc(r.LESS);break;case Tr:r.depthFunc(r.LEQUAL);break;case Do:r.depthFunc(r.EQUAL);break;case Po:r.depthFunc(r.GEQUAL);break;case Lo:r.depthFunc(r.GREATER);break;case Io:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}He=ge}},setLocked:function(ge){H=ge},setClear:function(ge){Me!==ge&&(Ne&&(ge=1-ge),r.clearDepth(ge),Me=ge)},reset:function(){H=!1,ve=null,He=null,Me=null,Ne=!1}}}function i(){let H=!1,Ne=null,ve=null,He=null,Me=null,ge=null,qe=null,ht=null,Dt=null;return{setTest:function(pt){H||(pt?oe(r.STENCIL_TEST):Ee(r.STENCIL_TEST))},setMask:function(pt){Ne!==pt&&!H&&(r.stencilMask(pt),Ne=pt)},setFunc:function(pt,en,je){(ve!==pt||He!==en||Me!==je)&&(r.stencilFunc(pt,en,je),ve=pt,He=en,Me=je)},setOp:function(pt,en,je){(ge!==pt||qe!==en||ht!==je)&&(r.stencilOp(pt,en,je),ge=pt,qe=en,ht=je)},setLocked:function(pt){H=pt},setClear:function(pt){Dt!==pt&&(r.clearStencil(pt),Dt=pt)},reset:function(){H=!1,Ne=null,ve=null,He=null,Me=null,ge=null,qe=null,ht=null,Dt=null}}}const s=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,S=null,E=null,v=null,U=null,C=null,T=new ot(0,0,0),L=0,b=!1,x=null,R=null,B=null,V=null,W=null;const ee=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let k=!1,Q=0;const q=r.getParameter(r.VERSION);q.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec(q)[1]),k=Q>=1):q.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),k=Q>=2);let ue=null,ye={};const le=r.getParameter(r.SCISSOR_BOX),Pe=r.getParameter(r.VIEWPORT),Te=new Mt().fromArray(le),Y=new Mt().fromArray(Pe);function re(H,Ne,ve,He){const Me=new Uint8Array(4),ge=r.createTexture();r.bindTexture(H,ge),r.texParameteri(H,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(H,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let qe=0;qe<ve;qe++)H===r.TEXTURE_3D||H===r.TEXTURE_2D_ARRAY?r.texImage3D(Ne,0,r.RGBA,1,1,He,0,r.RGBA,r.UNSIGNED_BYTE,Me):r.texImage2D(Ne+qe,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Me);return ge}const ae={};ae[r.TEXTURE_2D]=re(r.TEXTURE_2D,r.TEXTURE_2D,1),ae[r.TEXTURE_CUBE_MAP]=re(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ae[r.TEXTURE_2D_ARRAY]=re(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ae[r.TEXTURE_3D]=re(r.TEXTURE_3D,r.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),oe(r.DEPTH_TEST),a.setFunc(Tr),$(!1),pe(rc),oe(r.CULL_FACE),O(wi);function oe(H){h[H]!==!0&&(r.enable(H),h[H]=!0)}function Ee(H){h[H]!==!1&&(r.disable(H),h[H]=!1)}function _e(H,Ne){return u[H]!==Ne?(r.bindFramebuffer(H,Ne),u[H]=Ne,H===r.DRAW_FRAMEBUFFER&&(u[r.FRAMEBUFFER]=Ne),H===r.FRAMEBUFFER&&(u[r.DRAW_FRAMEBUFFER]=Ne),!0):!1}function we(H,Ne){let ve=f,He=!1;if(H){ve=d.get(Ne),ve===void 0&&(ve=[],d.set(Ne,ve));const Me=H.textures;if(ve.length!==Me.length||ve[0]!==r.COLOR_ATTACHMENT0){for(let ge=0,qe=Me.length;ge<qe;ge++)ve[ge]=r.COLOR_ATTACHMENT0+ge;ve.length=Me.length,He=!0}}else ve[0]!==r.BACK&&(ve[0]=r.BACK,He=!0);He&&r.drawBuffers(ve)}function ke(H){return m!==H?(r.useProgram(H),m=H,!0):!1}const tt={[Vi]:r.FUNC_ADD,[$d]:r.FUNC_SUBTRACT,[Jd]:r.FUNC_REVERSE_SUBTRACT};tt[Kd]=r.MIN,tt[Zd]=r.MAX;const Qe={[Qd]:r.ZERO,[ef]:r.ONE,[tf]:r.SRC_COLOR,[Ao]:r.SRC_ALPHA,[lf]:r.SRC_ALPHA_SATURATE,[af]:r.DST_COLOR,[rf]:r.DST_ALPHA,[nf]:r.ONE_MINUS_SRC_COLOR,[wo]:r.ONE_MINUS_SRC_ALPHA,[of]:r.ONE_MINUS_DST_COLOR,[sf]:r.ONE_MINUS_DST_ALPHA,[cf]:r.CONSTANT_COLOR,[hf]:r.ONE_MINUS_CONSTANT_COLOR,[uf]:r.CONSTANT_ALPHA,[df]:r.ONE_MINUS_CONSTANT_ALPHA};function O(H,Ne,ve,He,Me,ge,qe,ht,Dt,pt){if(H===wi){_===!0&&(Ee(r.BLEND),_=!1);return}if(_===!1&&(oe(r.BLEND),_=!0),H!==Yd){if(H!==g||pt!==b){if((p!==Vi||v!==Vi)&&(r.blendEquation(r.FUNC_ADD),p=Vi,v=Vi),pt)switch(H){case Er:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case sc:r.blendFunc(r.ONE,r.ONE);break;case ac:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case oc:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}else switch(H){case Er:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case sc:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case ac:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case oc:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}S=null,E=null,U=null,C=null,T.set(0,0,0),L=0,g=H,b=pt}return}Me=Me||Ne,ge=ge||ve,qe=qe||He,(Ne!==p||Me!==v)&&(r.blendEquationSeparate(tt[Ne],tt[Me]),p=Ne,v=Me),(ve!==S||He!==E||ge!==U||qe!==C)&&(r.blendFuncSeparate(Qe[ve],Qe[He],Qe[ge],Qe[qe]),S=ve,E=He,U=ge,C=qe),(ht.equals(T)===!1||Dt!==L)&&(r.blendColor(ht.r,ht.g,ht.b,Dt),T.copy(ht),L=Dt),g=H,b=!1}function bt(H,Ne){H.side===pn?Ee(r.CULL_FACE):oe(r.CULL_FACE);let ve=H.side===vn;Ne&&(ve=!ve),$(ve),H.blending===Er&&H.transparent===!1?O(wi):O(H.blending,H.blendEquation,H.blendSrc,H.blendDst,H.blendEquationAlpha,H.blendSrcAlpha,H.blendDstAlpha,H.blendColor,H.blendAlpha,H.premultipliedAlpha),a.setFunc(H.depthFunc),a.setTest(H.depthTest),a.setMask(H.depthWrite),s.setMask(H.colorWrite);const He=H.stencilWrite;o.setTest(He),He&&(o.setMask(H.stencilWriteMask),o.setFunc(H.stencilFunc,H.stencilRef,H.stencilFuncMask),o.setOp(H.stencilFail,H.stencilZFail,H.stencilZPass)),Se(H.polygonOffset,H.polygonOffsetFactor,H.polygonOffsetUnits),H.alphaToCoverage===!0?oe(r.SAMPLE_ALPHA_TO_COVERAGE):Ee(r.SAMPLE_ALPHA_TO_COVERAGE)}function $(H){x!==H&&(H?r.frontFace(r.CW):r.frontFace(r.CCW),x=H)}function pe(H){H!==qd?(oe(r.CULL_FACE),H!==R&&(H===rc?r.cullFace(r.BACK):H===jd?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):Ee(r.CULL_FACE),R=H}function te(H){H!==B&&(k&&r.lineWidth(H),B=H)}function Se(H,Ne,ve){H?(oe(r.POLYGON_OFFSET_FILL),(V!==Ne||W!==ve)&&(r.polygonOffset(Ne,ve),V=Ne,W=ve)):Ee(r.POLYGON_OFFSET_FILL)}function he(H){H?oe(r.SCISSOR_TEST):Ee(r.SCISSOR_TEST)}function ce(H){H===void 0&&(H=r.TEXTURE0+ee-1),ue!==H&&(r.activeTexture(H),ue=H)}function Fe(H,Ne,ve){ve===void 0&&(ue===null?ve=r.TEXTURE0+ee-1:ve=ue);let He=ye[ve];He===void 0&&(He={type:void 0,texture:void 0},ye[ve]=He),(He.type!==H||He.texture!==Ne)&&(ue!==ve&&(r.activeTexture(ve),ue=ve),r.bindTexture(H,Ne||ae[H]),He.type=H,He.texture=Ne)}function N(){const H=ye[ue];H!==void 0&&H.type!==void 0&&(r.bindTexture(H.type,null),H.type=void 0,H.texture=void 0)}function A(){try{r.compressedTexImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function G(){try{r.compressedTexImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function z(){try{r.texSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function se(){try{r.texSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function ne(){try{r.compressedTexSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ce(){try{r.compressedTexSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ae(){try{r.texStorage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Be(){try{r.texStorage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ve(){try{r.texImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function me(){try{r.texImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function De(H){Te.equals(H)===!1&&(r.scissor(H.x,H.y,H.z,H.w),Te.copy(H))}function Je(H){Y.equals(H)===!1&&(r.viewport(H.x,H.y,H.z,H.w),Y.copy(H))}function nt(H,Ne){let ve=c.get(Ne);ve===void 0&&(ve=new WeakMap,c.set(Ne,ve));let He=ve.get(H);He===void 0&&(He=r.getUniformBlockIndex(Ne,H.name),ve.set(H,He))}function Le(H,Ne){const He=c.get(Ne).get(H);l.get(Ne)!==He&&(r.uniformBlockBinding(Ne,He,H.__bindingPointIndex),l.set(Ne,He))}function ct(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),a.setReversed(!1),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),h={},ue=null,ye={},u={},d=new WeakMap,f=[],m=null,_=!1,g=null,p=null,S=null,E=null,v=null,U=null,C=null,T=new ot(0,0,0),L=0,b=!1,x=null,R=null,B=null,V=null,W=null,Te.set(0,0,r.canvas.width,r.canvas.height),Y.set(0,0,r.canvas.width,r.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:oe,disable:Ee,bindFramebuffer:_e,drawBuffers:we,useProgram:ke,setBlending:O,setMaterial:bt,setFlipSided:$,setCullFace:pe,setLineWidth:te,setPolygonOffset:Se,setScissorTest:he,activeTexture:ce,bindTexture:Fe,unbindTexture:N,compressedTexImage2D:A,compressedTexImage3D:G,texImage2D:Ve,texImage3D:me,updateUBOMapping:nt,uniformBlockBinding:Le,texStorage2D:Ae,texStorage3D:Be,texSubImage2D:z,texSubImage3D:se,compressedTexSubImage2D:ne,compressedTexSubImage3D:Ce,scissor:De,viewport:Je,reset:ct}}function Yg(r,e,t,n,i,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Xe,h=new WeakMap;let u;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(N,A){return f?new OffscreenCanvas(N,A):os("canvas")}function _(N,A,G){let z=1;const se=Fe(N);if((se.width>G||se.height>G)&&(z=G/Math.max(se.width,se.height)),z<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 ne=Math.floor(z*se.width),Ce=Math.floor(z*se.height);u===void 0&&(u=m(ne,Ce));const Ae=A?m(ne,Ce):u;return Ae.width=ne,Ae.height=Ce,Ae.getContext("2d").drawImage(N,0,0,ne,Ce),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+ne+"x"+Ce+")."),Ae}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),N;return N}function g(N){return N.generateMipmaps}function p(N){r.generateMipmap(N)}function S(N){return N.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:N.isWebGL3DRenderTarget?r.TEXTURE_3D:N.isWebGLArrayRenderTarget||N.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function E(N,A,G,z,se=!1){if(N!==null){if(r[N]!==void 0)return r[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let ne=A;if(A===r.RED&&(G===r.FLOAT&&(ne=r.R32F),G===r.HALF_FLOAT&&(ne=r.R16F),G===r.UNSIGNED_BYTE&&(ne=r.R8)),A===r.RED_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.R8UI),G===r.UNSIGNED_SHORT&&(ne=r.R16UI),G===r.UNSIGNED_INT&&(ne=r.R32UI),G===r.BYTE&&(ne=r.R8I),G===r.SHORT&&(ne=r.R16I),G===r.INT&&(ne=r.R32I)),A===r.RG&&(G===r.FLOAT&&(ne=r.RG32F),G===r.HALF_FLOAT&&(ne=r.RG16F),G===r.UNSIGNED_BYTE&&(ne=r.RG8)),A===r.RG_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RG8UI),G===r.UNSIGNED_SHORT&&(ne=r.RG16UI),G===r.UNSIGNED_INT&&(ne=r.RG32UI),G===r.BYTE&&(ne=r.RG8I),G===r.SHORT&&(ne=r.RG16I),G===r.INT&&(ne=r.RG32I)),A===r.RGB_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RGB8UI),G===r.UNSIGNED_SHORT&&(ne=r.RGB16UI),G===r.UNSIGNED_INT&&(ne=r.RGB32UI),G===r.BYTE&&(ne=r.RGB8I),G===r.SHORT&&(ne=r.RGB16I),G===r.INT&&(ne=r.RGB32I)),A===r.RGBA_INTEGER&&(G===r.UNSIGNED_BYTE&&(ne=r.RGBA8UI),G===r.UNSIGNED_SHORT&&(ne=r.RGBA16UI),G===r.UNSIGNED_INT&&(ne=r.RGBA32UI),G===r.BYTE&&(ne=r.RGBA8I),G===r.SHORT&&(ne=r.RGBA16I),G===r.INT&&(ne=r.RGBA32I)),A===r.RGB&&G===r.UNSIGNED_INT_5_9_9_9_REV&&(ne=r.RGB9_E5),A===r.RGBA){const Ce=se?pa:xt.getTransfer(z);G===r.FLOAT&&(ne=r.RGBA32F),G===r.HALF_FLOAT&&(ne=r.RGBA16F),G===r.UNSIGNED_BYTE&&(ne=Ce===Ut?r.SRGB8_ALPHA8:r.RGBA8),G===r.UNSIGNED_SHORT_4_4_4_4&&(ne=r.RGBA4),G===r.UNSIGNED_SHORT_5_5_5_1&&(ne=r.RGB5_A1)}return(ne===r.R16F||ne===r.R32F||ne===r.RG16F||ne===r.RG32F||ne===r.RGBA16F||ne===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ne}function v(N,A){let G;return N?A===null||A===qi||A===rs?G=r.DEPTH24_STENCIL8:A===Jn?G=r.DEPTH32F_STENCIL8:A===is&&(G=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):A===null||A===qi||A===rs?G=r.DEPTH_COMPONENT24:A===Jn?G=r.DEPTH_COMPONENT32F:A===is&&(G=r.DEPTH_COMPONENT16),G}function U(N,A){return g(N)===!0||N.isFramebufferTexture&&N.minFilter!==Cn&&N.minFilter!==Tn?Math.log2(Math.max(A.width,A.height))+1:N.mipmaps!==void 0&&N.mipmaps.length>0?N.mipmaps.length:N.isCompressedTexture&&Array.isArray(N.image)?A.mipmaps.length:1}function C(N){const A=N.target;A.removeEventListener("dispose",C),L(A),A.isVideoTexture&&h.delete(A)}function T(N){const A=N.target;A.removeEventListener("dispose",T),x(A)}function L(N){const A=n.get(N);if(A.__webglInit===void 0)return;const G=N.source,z=d.get(G);if(z){const se=z[A.__cacheKey];se.usedTimes--,se.usedTimes===0&&b(N),Object.keys(z).length===0&&d.delete(G)}n.remove(N)}function b(N){const A=n.get(N);r.deleteTexture(A.__webglTexture);const G=N.source,z=d.get(G);delete z[A.__cacheKey],a.memory.textures--}function x(N){const A=n.get(N);if(N.depthTexture&&(N.depthTexture.dispose(),n.remove(N.depthTexture)),N.isWebGLCubeRenderTarget)for(let z=0;z<6;z++){if(Array.isArray(A.__webglFramebuffer[z]))for(let se=0;se<A.__webglFramebuffer[z].length;se++)r.deleteFramebuffer(A.__webglFramebuffer[z][se]);else r.deleteFramebuffer(A.__webglFramebuffer[z]);A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[z])}else{if(Array.isArray(A.__webglFramebuffer))for(let z=0;z<A.__webglFramebuffer.length;z++)r.deleteFramebuffer(A.__webglFramebuffer[z]);else r.deleteFramebuffer(A.__webglFramebuffer);if(A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer),A.__webglMultisampledFramebuffer&&r.deleteFramebuffer(A.__webglMultisampledFramebuffer),A.__webglColorRenderbuffer)for(let z=0;z<A.__webglColorRenderbuffer.length;z++)A.__webglColorRenderbuffer[z]&&r.deleteRenderbuffer(A.__webglColorRenderbuffer[z]);A.__webglDepthRenderbuffer&&r.deleteRenderbuffer(A.__webglDepthRenderbuffer)}const G=N.textures;for(let z=0,se=G.length;z<se;z++){const ne=n.get(G[z]);ne.__webglTexture&&(r.deleteTexture(ne.__webglTexture),a.memory.textures--),n.remove(G[z])}n.remove(N)}let R=0;function B(){R=0}function V(){const N=R;return N>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+i.maxTextures),R+=1,N}function W(N){const A=[];return A.push(N.wrapS),A.push(N.wrapT),A.push(N.wrapR||0),A.push(N.magFilter),A.push(N.minFilter),A.push(N.anisotropy),A.push(N.internalFormat),A.push(N.format),A.push(N.type),A.push(N.generateMipmaps),A.push(N.premultiplyAlpha),A.push(N.flipY),A.push(N.unpackAlignment),A.push(N.colorSpace),A.join()}function ee(N,A){const G=n.get(N);if(N.isVideoTexture&&he(N),N.isRenderTargetTexture===!1&&N.version>0&&G.__version!==N.version){const z=N.image;if(z===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(z.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(G,N,A);return}}t.bindTexture(r.TEXTURE_2D,G.__webglTexture,r.TEXTURE0+A)}function k(N,A){const G=n.get(N);if(N.version>0&&G.__version!==N.version){ae(G,N,A);return}t.bindTexture(r.TEXTURE_2D_ARRAY,G.__webglTexture,r.TEXTURE0+A)}function Q(N,A){const G=n.get(N);if(N.version>0&&G.__version!==N.version){ae(G,N,A);return}t.bindTexture(r.TEXTURE_3D,G.__webglTexture,r.TEXTURE0+A)}function q(N,A){const G=n.get(N);if(N.version>0&&G.__version!==N.version){oe(G,N,A);return}t.bindTexture(r.TEXTURE_CUBE_MAP,G.__webglTexture,r.TEXTURE0+A)}const ue={[$n]:r.REPEAT,[kn]:r.CLAMP_TO_EDGE,[Fo]:r.MIRRORED_REPEAT},ye={[Cn]:r.NEAREST,[bf]:r.NEAREST_MIPMAP_NEAREST,[gs]:r.NEAREST_MIPMAP_LINEAR,[Tn]:r.LINEAR,[Pa]:r.LINEAR_MIPMAP_NEAREST,[ui]:r.LINEAR_MIPMAP_LINEAR},le={[Tf]:r.NEVER,[If]:r.ALWAYS,[Cf]:r.LESS,[vu]:r.LEQUAL,[Rf]:r.EQUAL,[Lf]:r.GEQUAL,[Df]:r.GREATER,[Pf]:r.NOTEQUAL};function Pe(N,A){if(A.type===Jn&&e.has("OES_texture_float_linear")===!1&&(A.magFilter===Tn||A.magFilter===Pa||A.magFilter===gs||A.magFilter===ui||A.minFilter===Tn||A.minFilter===Pa||A.minFilter===gs||A.minFilter===ui)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(N,r.TEXTURE_WRAP_S,ue[A.wrapS]),r.texParameteri(N,r.TEXTURE_WRAP_T,ue[A.wrapT]),(N===r.TEXTURE_3D||N===r.TEXTURE_2D_ARRAY)&&r.texParameteri(N,r.TEXTURE_WRAP_R,ue[A.wrapR]),r.texParameteri(N,r.TEXTURE_MAG_FILTER,ye[A.magFilter]),r.texParameteri(N,r.TEXTURE_MIN_FILTER,ye[A.minFilter]),A.compareFunction&&(r.texParameteri(N,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(N,r.TEXTURE_COMPARE_FUNC,le[A.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(A.magFilter===Cn||A.minFilter!==gs&&A.minFilter!==ui||A.type===Jn&&e.has("OES_texture_float_linear")===!1)return;if(A.anisotropy>1||n.get(A).__currentAnisotropy){const G=e.get("EXT_texture_filter_anisotropic");r.texParameterf(N,G.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,i.getMaxAnisotropy())),n.get(A).__currentAnisotropy=A.anisotropy}}}function Te(N,A){let G=!1;N.__webglInit===void 0&&(N.__webglInit=!0,A.addEventListener("dispose",C));const z=A.source;let se=d.get(z);se===void 0&&(se={},d.set(z,se));const ne=W(A);if(ne!==N.__cacheKey){se[ne]===void 0&&(se[ne]={texture:r.createTexture(),usedTimes:0},a.memory.textures++,G=!0),se[ne].usedTimes++;const Ce=se[N.__cacheKey];Ce!==void 0&&(se[N.__cacheKey].usedTimes--,Ce.usedTimes===0&&b(A)),N.__cacheKey=ne,N.__webglTexture=se[ne].texture}return G}function Y(N,A,G){return Math.floor(Math.floor(N/G)/A)}function re(N,A,G,z){const ne=N.updateRanges;if(ne.length===0)t.texSubImage2D(r.TEXTURE_2D,0,0,0,A.width,A.height,G,z,A.data);else{ne.sort((me,De)=>me.start-De.start);let Ce=0;for(let me=1;me<ne.length;me++){const De=ne[Ce],Je=ne[me],nt=De.start+De.count,Le=Y(Je.start,A.width,4),ct=Y(De.start,A.width,4);Je.start<=nt+1&&Le===ct&&Y(Je.start+Je.count-1,A.width,4)===Le?De.count=Math.max(De.count,Je.start+Je.count-De.start):(++Ce,ne[Ce]=Je)}ne.length=Ce+1;const Ae=r.getParameter(r.UNPACK_ROW_LENGTH),Be=r.getParameter(r.UNPACK_SKIP_PIXELS),Ve=r.getParameter(r.UNPACK_SKIP_ROWS);r.pixelStorei(r.UNPACK_ROW_LENGTH,A.width);for(let me=0,De=ne.length;me<De;me++){const Je=ne[me],nt=Math.floor(Je.start/4),Le=Math.ceil(Je.count/4),ct=nt%A.width,H=Math.floor(nt/A.width),Ne=Le,ve=1;r.pixelStorei(r.UNPACK_SKIP_PIXELS,ct),r.pixelStorei(r.UNPACK_SKIP_ROWS,H),t.texSubImage2D(r.TEXTURE_2D,0,ct,H,Ne,ve,G,z,A.data)}N.clearUpdateRanges(),r.pixelStorei(r.UNPACK_ROW_LENGTH,Ae),r.pixelStorei(r.UNPACK_SKIP_PIXELS,Be),r.pixelStorei(r.UNPACK_SKIP_ROWS,Ve)}}function ae(N,A,G){let z=r.TEXTURE_2D;(A.isDataArrayTexture||A.isCompressedArrayTexture)&&(z=r.TEXTURE_2D_ARRAY),A.isData3DTexture&&(z=r.TEXTURE_3D);const se=Te(N,A),ne=A.source;t.bindTexture(z,N.__webglTexture,r.TEXTURE0+G);const Ce=n.get(ne);if(ne.version!==Ce.__version||se===!0){t.activeTexture(r.TEXTURE0+G);const Ae=xt.getPrimaries(xt.workingColorSpace),Be=A.colorSpace===Ai?null:xt.getPrimaries(A.colorSpace),Ve=A.colorSpace===Ai||Ae===Be?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);let me=_(A.image,!1,i.maxTextureSize);me=ce(A,me);const De=s.convert(A.format,A.colorSpace),Je=s.convert(A.type);let nt=E(A.internalFormat,De,Je,A.colorSpace,A.isVideoTexture);Pe(z,A);let Le;const ct=A.mipmaps,H=A.isVideoTexture!==!0,Ne=Ce.__version===void 0||se===!0,ve=ne.dataReady,He=U(A,me);if(A.isDepthTexture)nt=v(A.format===as,A.type),Ne&&(H?t.texStorage2D(r.TEXTURE_2D,1,nt,me.width,me.height):t.texImage2D(r.TEXTURE_2D,0,nt,me.width,me.height,0,De,Je,null));else if(A.isDataTexture)if(ct.length>0){H&&Ne&&t.texStorage2D(r.TEXTURE_2D,He,nt,ct[0].width,ct[0].height);for(let Me=0,ge=ct.length;Me<ge;Me++)Le=ct[Me],H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Le.width,Le.height,De,Je,Le.data):t.texImage2D(r.TEXTURE_2D,Me,nt,Le.width,Le.height,0,De,Je,Le.data);A.generateMipmaps=!1}else H?(Ne&&t.texStorage2D(r.TEXTURE_2D,He,nt,me.width,me.height),ve&&re(A,me,De,Je)):t.texImage2D(r.TEXTURE_2D,0,nt,me.width,me.height,0,De,Je,me.data);else if(A.isCompressedTexture)if(A.isCompressedArrayTexture){H&&Ne&&t.texStorage3D(r.TEXTURE_2D_ARRAY,He,nt,ct[0].width,ct[0].height,me.depth);for(let Me=0,ge=ct.length;Me<ge;Me++)if(Le=ct[Me],A.format!==Un)if(De!==null)if(H){if(ve)if(A.layerUpdates.size>0){const qe=rh(Le.width,Le.height,A.format,A.type);for(const ht of A.layerUpdates){const Dt=Le.data.subarray(ht*qe/Le.data.BYTES_PER_ELEMENT,(ht+1)*qe/Le.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,ht,Le.width,Le.height,1,De,Dt)}A.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,0,Le.width,Le.height,me.depth,De,Le.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Me,nt,Le.width,Le.height,me.depth,0,Le.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else H?ve&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,Me,0,0,0,Le.width,Le.height,me.depth,De,Je,Le.data):t.texImage3D(r.TEXTURE_2D_ARRAY,Me,nt,Le.width,Le.height,me.depth,0,De,Je,Le.data)}else{H&&Ne&&t.texStorage2D(r.TEXTURE_2D,He,nt,ct[0].width,ct[0].height);for(let Me=0,ge=ct.length;Me<ge;Me++)Le=ct[Me],A.format!==Un?De!==null?H?ve&&t.compressedTexSubImage2D(r.TEXTURE_2D,Me,0,0,Le.width,Le.height,De,Le.data):t.compressedTexImage2D(r.TEXTURE_2D,Me,nt,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,Le.width,Le.height,De,Je,Le.data):t.texImage2D(r.TEXTURE_2D,Me,nt,Le.width,Le.height,0,De,Je,Le.data)}else if(A.isDataArrayTexture)if(H){if(Ne&&t.texStorage3D(r.TEXTURE_2D_ARRAY,He,nt,me.width,me.height,me.depth),ve)if(A.layerUpdates.size>0){const Me=rh(me.width,me.height,A.format,A.type);for(const ge of A.layerUpdates){const qe=me.data.subarray(ge*Me/me.data.BYTES_PER_ELEMENT,(ge+1)*Me/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,ge,me.width,me.height,1,De,Je,qe)}A.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,De,Je,me.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,nt,me.width,me.height,me.depth,0,De,Je,me.data);else if(A.isData3DTexture)H?(Ne&&t.texStorage3D(r.TEXTURE_3D,He,nt,me.width,me.height,me.depth),ve&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,De,Je,me.data)):t.texImage3D(r.TEXTURE_3D,0,nt,me.width,me.height,me.depth,0,De,Je,me.data);else if(A.isFramebufferTexture){if(Ne)if(H)t.texStorage2D(r.TEXTURE_2D,He,nt,me.width,me.height);else{let Me=me.width,ge=me.height;for(let qe=0;qe<He;qe++)t.texImage2D(r.TEXTURE_2D,qe,nt,Me,ge,0,De,Je,null),Me>>=1,ge>>=1}}else if(ct.length>0){if(H&&Ne){const Me=Fe(ct[0]);t.texStorage2D(r.TEXTURE_2D,He,nt,Me.width,Me.height)}for(let Me=0,ge=ct.length;Me<ge;Me++)Le=ct[Me],H?ve&&t.texSubImage2D(r.TEXTURE_2D,Me,0,0,De,Je,Le):t.texImage2D(r.TEXTURE_2D,Me,nt,De,Je,Le);A.generateMipmaps=!1}else if(H){if(Ne){const Me=Fe(me);t.texStorage2D(r.TEXTURE_2D,He,nt,Me.width,Me.height)}ve&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,De,Je,me)}else t.texImage2D(r.TEXTURE_2D,0,nt,De,Je,me);g(A)&&p(z),Ce.__version=ne.version,A.onUpdate&&A.onUpdate(A)}N.__version=A.version}function oe(N,A,G){if(A.image.length!==6)return;const z=Te(N,A),se=A.source;t.bindTexture(r.TEXTURE_CUBE_MAP,N.__webglTexture,r.TEXTURE0+G);const ne=n.get(se);if(se.version!==ne.__version||z===!0){t.activeTexture(r.TEXTURE0+G);const Ce=xt.getPrimaries(xt.workingColorSpace),Ae=A.colorSpace===Ai?null:xt.getPrimaries(A.colorSpace),Be=A.colorSpace===Ai||Ce===Ae?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);const Ve=A.isCompressedTexture||A.image[0].isCompressedTexture,me=A.image[0]&&A.image[0].isDataTexture,De=[];for(let ge=0;ge<6;ge++)!Ve&&!me?De[ge]=_(A.image[ge],!0,i.maxCubemapSize):De[ge]=me?A.image[ge].image:A.image[ge],De[ge]=ce(A,De[ge]);const Je=De[0],nt=s.convert(A.format,A.colorSpace),Le=s.convert(A.type),ct=E(A.internalFormat,nt,Le,A.colorSpace),H=A.isVideoTexture!==!0,Ne=ne.__version===void 0||z===!0,ve=se.dataReady;let He=U(A,Je);Pe(r.TEXTURE_CUBE_MAP,A);let Me;if(Ve){H&&Ne&&t.texStorage2D(r.TEXTURE_CUBE_MAP,He,ct,Je.width,Je.height);for(let ge=0;ge<6;ge++){Me=De[ge].mipmaps;for(let qe=0;qe<Me.length;qe++){const ht=Me[qe];A.format!==Un?nt!==null?H?ve&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,0,0,ht.width,ht.height,nt,ht.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,ct,ht.width,ht.height,0,ht.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,0,0,ht.width,ht.height,nt,Le,ht.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe,ct,ht.width,ht.height,0,nt,Le,ht.data)}}}else{if(Me=A.mipmaps,H&&Ne){Me.length>0&&He++;const ge=Fe(De[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,He,ct,ge.width,ge.height)}for(let ge=0;ge<6;ge++)if(me){H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,De[ge].width,De[ge].height,nt,Le,De[ge].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,ct,De[ge].width,De[ge].height,0,nt,Le,De[ge].data);for(let qe=0;qe<Me.length;qe++){const Dt=Me[qe].image[ge].image;H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,0,0,Dt.width,Dt.height,nt,Le,Dt.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,ct,Dt.width,Dt.height,0,nt,Le,Dt.data)}}else{H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,0,0,nt,Le,De[ge]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,0,ct,nt,Le,De[ge]);for(let qe=0;qe<Me.length;qe++){const ht=Me[qe];H?ve&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,0,0,nt,Le,ht.image[ge]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ge,qe+1,ct,nt,Le,ht.image[ge])}}}g(A)&&p(r.TEXTURE_CUBE_MAP),ne.__version=se.version,A.onUpdate&&A.onUpdate(A)}N.__version=A.version}function Ee(N,A,G,z,se,ne){const Ce=s.convert(G.format,G.colorSpace),Ae=s.convert(G.type),Be=E(G.internalFormat,Ce,Ae,G.colorSpace),Ve=n.get(A),me=n.get(G);if(me.__renderTarget=A,!Ve.__hasExternalTextures){const De=Math.max(1,A.width>>ne),Je=Math.max(1,A.height>>ne);se===r.TEXTURE_3D||se===r.TEXTURE_2D_ARRAY?t.texImage3D(se,ne,Be,De,Je,A.depth,0,Ce,Ae,null):t.texImage2D(se,ne,Be,De,Je,0,Ce,Ae,null)}t.bindFramebuffer(r.FRAMEBUFFER,N),Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,z,se,me.__webglTexture,0,te(A)):(se===r.TEXTURE_2D||se>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&se<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,z,se,me.__webglTexture,ne),t.bindFramebuffer(r.FRAMEBUFFER,null)}function _e(N,A,G){if(r.bindRenderbuffer(r.RENDERBUFFER,N),A.depthBuffer){const z=A.depthTexture,se=z&&z.isDepthTexture?z.type:null,ne=v(A.stencilBuffer,se),Ce=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ae=te(A);Se(A)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,ne,A.width,A.height):G?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,ne,A.width,A.height):r.renderbufferStorage(r.RENDERBUFFER,ne,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Ce,r.RENDERBUFFER,N)}else{const z=A.textures;for(let se=0;se<z.length;se++){const ne=z[se],Ce=s.convert(ne.format,ne.colorSpace),Ae=s.convert(ne.type),Be=E(ne.internalFormat,Ce,Ae,ne.colorSpace),Ve=te(A);G&&Se(A)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ve,Be,A.width,A.height):Se(A)?o.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ve,Be,A.width,A.height):r.renderbufferStorage(r.RENDERBUFFER,Be,A.width,A.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function we(N,A){if(A&&A.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,N),!(A.depthTexture&&A.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const z=n.get(A.depthTexture);z.__renderTarget=A,(!z.__webglTexture||A.depthTexture.image.width!==A.width||A.depthTexture.image.height!==A.height)&&(A.depthTexture.image.width=A.width,A.depthTexture.image.height=A.height,A.depthTexture.needsUpdate=!0),ee(A.depthTexture,0);const se=z.__webglTexture,ne=te(A);if(A.depthTexture.format===ss)Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,se,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,se,0);else if(A.depthTexture.format===as)Se(A)?o.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,se,0,ne):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,se,0);else throw new Error("Unknown depthTexture format")}function ke(N){const A=n.get(N),G=N.isWebGLCubeRenderTarget===!0;if(A.__boundDepthTexture!==N.depthTexture){const z=N.depthTexture;if(A.__depthDisposeCallback&&A.__depthDisposeCallback(),z){const se=()=>{delete A.__boundDepthTexture,delete A.__depthDisposeCallback,z.removeEventListener("dispose",se)};z.addEventListener("dispose",se),A.__depthDisposeCallback=se}A.__boundDepthTexture=z}if(N.depthTexture&&!A.__autoAllocateDepthBuffer){if(G)throw new Error("target.depthTexture not supported in Cube render targets");const z=N.texture.mipmaps;z&&z.length>0?we(A.__webglFramebuffer[0],N):we(A.__webglFramebuffer,N)}else if(G){A.__webglDepthbuffer=[];for(let z=0;z<6;z++)if(t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[z]),A.__webglDepthbuffer[z]===void 0)A.__webglDepthbuffer[z]=r.createRenderbuffer(),_e(A.__webglDepthbuffer[z],N,!1);else{const se=N.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=A.__webglDepthbuffer[z];r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,se,r.RENDERBUFFER,ne)}}else{const z=N.texture.mipmaps;if(z&&z.length>0?t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer[0]):t.bindFramebuffer(r.FRAMEBUFFER,A.__webglFramebuffer),A.__webglDepthbuffer===void 0)A.__webglDepthbuffer=r.createRenderbuffer(),_e(A.__webglDepthbuffer,N,!1);else{const se=N.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,ne=A.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,ne),r.framebufferRenderbuffer(r.FRAMEBUFFER,se,r.RENDERBUFFER,ne)}}t.bindFramebuffer(r.FRAMEBUFFER,null)}function tt(N,A,G){const z=n.get(N);A!==void 0&&Ee(z.__webglFramebuffer,N,N.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),G!==void 0&&ke(N)}function Qe(N){const A=N.texture,G=n.get(N),z=n.get(A);N.addEventListener("dispose",T);const se=N.textures,ne=N.isWebGLCubeRenderTarget===!0,Ce=se.length>1;if(Ce||(z.__webglTexture===void 0&&(z.__webglTexture=r.createTexture()),z.__version=A.version,a.memory.textures++),ne){G.__webglFramebuffer=[];for(let Ae=0;Ae<6;Ae++)if(A.mipmaps&&A.mipmaps.length>0){G.__webglFramebuffer[Ae]=[];for(let Be=0;Be<A.mipmaps.length;Be++)G.__webglFramebuffer[Ae][Be]=r.createFramebuffer()}else G.__webglFramebuffer[Ae]=r.createFramebuffer()}else{if(A.mipmaps&&A.mipmaps.length>0){G.__webglFramebuffer=[];for(let Ae=0;Ae<A.mipmaps.length;Ae++)G.__webglFramebuffer[Ae]=r.createFramebuffer()}else G.__webglFramebuffer=r.createFramebuffer();if(Ce)for(let Ae=0,Be=se.length;Ae<Be;Ae++){const Ve=n.get(se[Ae]);Ve.__webglTexture===void 0&&(Ve.__webglTexture=r.createTexture(),a.memory.textures++)}if(N.samples>0&&Se(N)===!1){G.__webglMultisampledFramebuffer=r.createFramebuffer(),G.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,G.__webglMultisampledFramebuffer);for(let Ae=0;Ae<se.length;Ae++){const Be=se[Ae];G.__webglColorRenderbuffer[Ae]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,G.__webglColorRenderbuffer[Ae]);const Ve=s.convert(Be.format,Be.colorSpace),me=s.convert(Be.type),De=E(Be.internalFormat,Ve,me,Be.colorSpace,N.isXRRenderTarget===!0),Je=te(N);r.renderbufferStorageMultisample(r.RENDERBUFFER,Je,De,N.width,N.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ae,r.RENDERBUFFER,G.__webglColorRenderbuffer[Ae])}r.bindRenderbuffer(r.RENDERBUFFER,null),N.depthBuffer&&(G.__webglDepthRenderbuffer=r.createRenderbuffer(),_e(G.__webglDepthRenderbuffer,N,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ne){t.bindTexture(r.TEXTURE_CUBE_MAP,z.__webglTexture),Pe(r.TEXTURE_CUBE_MAP,A);for(let Ae=0;Ae<6;Ae++)if(A.mipmaps&&A.mipmaps.length>0)for(let Be=0;Be<A.mipmaps.length;Be++)Ee(G.__webglFramebuffer[Ae][Be],N,A,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,Be);else Ee(G.__webglFramebuffer[Ae],N,A,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0);g(A)&&p(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ce){for(let Ae=0,Be=se.length;Ae<Be;Ae++){const Ve=se[Ae],me=n.get(Ve);t.bindTexture(r.TEXTURE_2D,me.__webglTexture),Pe(r.TEXTURE_2D,Ve),Ee(G.__webglFramebuffer,N,Ve,r.COLOR_ATTACHMENT0+Ae,r.TEXTURE_2D,0),g(Ve)&&p(r.TEXTURE_2D)}t.unbindTexture()}else{let Ae=r.TEXTURE_2D;if((N.isWebGL3DRenderTarget||N.isWebGLArrayRenderTarget)&&(Ae=N.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ae,z.__webglTexture),Pe(Ae,A),A.mipmaps&&A.mipmaps.length>0)for(let Be=0;Be<A.mipmaps.length;Be++)Ee(G.__webglFramebuffer[Be],N,A,r.COLOR_ATTACHMENT0,Ae,Be);else Ee(G.__webglFramebuffer,N,A,r.COLOR_ATTACHMENT0,Ae,0);g(A)&&p(Ae),t.unbindTexture()}N.depthBuffer&&ke(N)}function O(N){const A=N.textures;for(let G=0,z=A.length;G<z;G++){const se=A[G];if(g(se)){const ne=S(N),Ce=n.get(se).__webglTexture;t.bindTexture(ne,Ce),p(ne),t.unbindTexture()}}}const bt=[],$=[];function pe(N){if(N.samples>0){if(Se(N)===!1){const A=N.textures,G=N.width,z=N.height;let se=r.COLOR_BUFFER_BIT;const ne=N.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ce=n.get(N),Ae=A.length>1;if(Ae)for(let Ve=0;Ve<A.length;Ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer);const Be=N.texture.mipmaps;Be&&Be.length>0?t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer[0]):t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let Ve=0;Ve<A.length;Ve++){if(N.resolveDepthBuffer&&(N.depthBuffer&&(se|=r.DEPTH_BUFFER_BIT),N.stencilBuffer&&N.resolveStencilBuffer&&(se|=r.STENCIL_BUFFER_BIT)),Ae){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[Ve]);const me=n.get(A[Ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,me,0)}r.blitFramebuffer(0,0,G,z,0,0,G,z,se,r.NEAREST),l===!0&&(bt.length=0,$.length=0,bt.push(r.COLOR_ATTACHMENT0+Ve),N.depthBuffer&&N.resolveDepthBuffer===!1&&(bt.push(ne),$.push(ne),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,$)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,bt))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Ae)for(let Ve=0;Ve<A.length;Ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[Ve]);const me=n.get(A[Ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,me,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}else if(N.depthBuffer&&N.resolveDepthBuffer===!1&&l){const A=N.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[A])}}}function te(N){return Math.min(i.maxSamples,N.samples)}function Se(N){const A=n.get(N);return N.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&A.__useRenderToTexture!==!1}function he(N){const A=a.render.frame;h.get(N)!==A&&(h.set(N,A),N.update())}function ce(N,A){const G=N.colorSpace,z=N.format,se=N.type;return N.isCompressedTexture===!0||N.isVideoTexture===!0||G!==Dr&&G!==Ai&&(xt.getTransfer(G)===Ut?(z!==Un||se!==Qn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",G)),A}function Fe(N){return typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement?(c.width=N.naturalWidth||N.width,c.height=N.naturalHeight||N.height):typeof VideoFrame<"u"&&N instanceof VideoFrame?(c.width=N.displayWidth,c.height=N.displayHeight):(c.width=N.width,c.height=N.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=B,this.setTexture2D=ee,this.setTexture2DArray=k,this.setTexture3D=Q,this.setTextureCube=q,this.rebindTextures=tt,this.setupRenderTarget=Qe,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=pe,this.setupDepthRenderbuffer=ke,this.setupFrameBufferTexture=Ee,this.useMultisampledRTT=Se}function $g(r,e){function t(n,i=Ai){let s;const a=xt.getTransfer(i);if(n===Qn)return r.UNSIGNED_BYTE;if(n===Tl)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Cl)return r.UNSIGNED_SHORT_5_5_5_1;if(n===du)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hu)return r.BYTE;if(n===uu)return r.SHORT;if(n===is)return r.UNSIGNED_SHORT;if(n===wl)return r.INT;if(n===qi)return r.UNSIGNED_INT;if(n===Jn)return r.FLOAT;if(n===hs)return r.HALF_FLOAT;if(n===fu)return r.ALPHA;if(n===pu)return r.RGB;if(n===Un)return r.RGBA;if(n===ss)return r.DEPTH_COMPONENT;if(n===as)return r.DEPTH_STENCIL;if(n===mu)return r.RED;if(n===Rl)return r.RED_INTEGER;if(n===gu)return r.RG;if(n===Dl)return r.RG_INTEGER;if(n===Pl)return r.RGBA_INTEGER;if(n===ra||n===sa||n===aa||n===oa)if(a===Ut)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===ra)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===sa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===aa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===oa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===ra)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===sa)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===aa)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===oa)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Oo||n===zo||n===Bo||n===ko)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===Oo)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===zo)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Bo)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ko)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Vo||n===Ho||n===Go)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Vo||n===Ho)return a===Ut?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Go)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Wo||n===Xo||n===qo||n===jo||n===Yo||n===$o||n===Jo||n===Ko||n===Zo||n===Qo||n===el||n===tl||n===nl||n===il)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===Wo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Xo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===qo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===jo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Yo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===$o)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Jo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Ko)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Zo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Qo)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===el)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===tl)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===nl)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===il)return a===Ut?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===la||n===rl||n===sl)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===la)return a===Ut?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===rl)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===sl)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===_u||n===al||n===ol||n===ll)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===la)return s.COMPRESSED_RED_RGTC1_EXT;if(n===al)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ol)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===ll)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===rs?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const Jg=`
3804
3804
  void main() {
3805
3805
 
3806
3806
  gl_Position = vec4( position, 1.0 );
@@ -3824,7 +3824,7 @@ void main() {
3824
3824
 
3825
3825
  }
3826
3826
 
3827
- }`;class Zg{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new cn,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new pi({vertexShader:Jg,fragmentShader:Kg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Rt(new us(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Qg extends $i{constructor(e,t){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,f=null,m=null;const _=new Zg,g=t.getContextAttributes();let p=null,S=null;const E=[],v=[],U=new Xe;let C=null;const T=new ln;T.viewport=new Mt;const L=new ln;L.viewport=new Mt;const b=[T,L],x=new m0;let R=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let re=E[Y];return re===void 0&&(re=new Qa,E[Y]=re),re.getTargetRaySpace()},this.getControllerGrip=function(Y){let re=E[Y];return re===void 0&&(re=new Qa,E[Y]=re),re.getGripSpace()},this.getHand=function(Y){let re=E[Y];return re===void 0&&(re=new Qa,E[Y]=re),re.getHandSpace()};function V(Y){const re=v.indexOf(Y.inputSource);if(re===-1)return;const ae=E[re];ae!==void 0&&(ae.update(Y.inputSource,Y.frame,c||a),ae.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){i.removeEventListener("select",V),i.removeEventListener("selectstart",V),i.removeEventListener("selectend",V),i.removeEventListener("squeeze",V),i.removeEventListener("squeezestart",V),i.removeEventListener("squeezeend",V),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",ee);for(let Y=0;Y<E.length;Y++){const re=v[Y];re!==null&&(v[Y]=null,E[Y].disconnect(re))}R=null,B=null,_.reset(),e.setRenderTarget(p),f=null,d=null,u=null,i=null,S=null,we.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(U.width,U.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){o=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(Y){if(i=Y,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",V),i.addEventListener("selectstart",V),i.addEventListener("selectend",V),i.addEventListener("squeeze",V),i.addEventListener("squeezestart",V),i.addEventListener("squeezeend",V),i.addEventListener("end",W),i.addEventListener("inputsourceschange",ee),g.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(U),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let ae=null,oe=null,Se=null;g.depth&&(Se=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ae=g.stencil?as:ss,oe=g.stencil?rs:qi);const _e={colorFormat:t.RGBA8,depthFormat:Se,scaleFactor:s};u=new XRWebGLBinding(i,t),d=u.createProjectionLayer(_e),i.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),S=new ji(d.textureWidth,d.textureHeight,{format:Un,type:Qn,depthTexture:new Pu(d.textureWidth,d.textureHeight,oe,void 0,void 0,void 0,void 0,void 0,void 0,ae),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const ae={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,t,ae),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),S=new ji(f.framebufferWidth,f.framebufferHeight,{format:Un,type:Qn,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),we.setContext(i),we.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function ee(Y){for(let re=0;re<Y.removed.length;re++){const ae=Y.removed[re],oe=v.indexOf(ae);oe>=0&&(v[oe]=null,E[oe].disconnect(ae))}for(let re=0;re<Y.added.length;re++){const ae=Y.added[re];let oe=v.indexOf(ae);if(oe===-1){for(let _e=0;_e<E.length;_e++)if(_e>=v.length){v.push(ae),oe=_e;break}else if(v[_e]===null){v[_e]=ae,oe=_e;break}if(oe===-1)break}const Se=E[oe];Se&&Se.connect(ae)}}const k=new F,Q=new F;function q(Y,re,ae){k.setFromMatrixPosition(re.matrixWorld),Q.setFromMatrixPosition(ae.matrixWorld);const oe=k.distanceTo(Q),Se=re.projectionMatrix.elements,_e=ae.projectionMatrix.elements,Ae=Se[14]/(Se[10]-1),ke=Se[14]/(Se[10]+1),tt=(Se[9]+1)/Se[5],Ze=(Se[9]-1)/Se[5],O=(Se[8]-1)/Se[0],bt=(_e[8]+1)/_e[0],$=Ae*O,pe=Ae*bt,te=oe/(-O+bt),Te=te*-O;if(re.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Te),Y.translateZ(te),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Se[10]===-1)Y.projectionMatrix.copy(re.projectionMatrix),Y.projectionMatrixInverse.copy(re.projectionMatrixInverse);else{const ce=Ae+te,ue=ke+te,De=$-Te,N=pe+(oe-Te),A=tt*ke/ue*ce,G=Ze*ke/ue*ce;Y.projectionMatrix.makePerspective(De,N,A,G,ce,ue),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function he(Y,re){re===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(re.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;let re=Y.near,ae=Y.far;_.texture!==null&&(_.depthNear>0&&(re=_.depthNear),_.depthFar>0&&(ae=_.depthFar)),x.near=L.near=T.near=re,x.far=L.far=T.far=ae,(R!==x.near||B!==x.far)&&(i.updateRenderState({depthNear:x.near,depthFar:x.far}),R=x.near,B=x.far),T.layers.mask=Y.layers.mask|2,L.layers.mask=Y.layers.mask|4,x.layers.mask=T.layers.mask|L.layers.mask;const oe=Y.parent,Se=x.cameras;he(x,oe);for(let _e=0;_e<Se.length;_e++)he(Se[_e],oe);Se.length===2?q(x,T,L):x.projectionMatrix.copy(T.projectionMatrix),ye(Y,x,oe)};function ye(Y,re,ae){ae===null?Y.matrix.copy(re.matrixWorld):(Y.matrix.copy(ae.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(re.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(re.projectionMatrix),Y.projectionMatrixInverse.copy(re.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=Pr*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return x},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(Y){l=Y,d!==null&&(d.fixedFoveation=Y),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Y)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(x)};let le=null;function Le(Y,re){if(h=re.getViewerPose(c||a),m=re,h!==null){const ae=h.views;f!==null&&(e.setRenderTargetFramebuffer(S,f.framebuffer),e.setRenderTarget(S));let oe=!1;ae.length!==x.cameras.length&&(x.cameras.length=0,oe=!0);for(let Ae=0;Ae<ae.length;Ae++){const ke=ae[Ae];let tt=null;if(f!==null)tt=f.getViewport(ke);else{const O=u.getViewSubImage(d,ke);tt=O.viewport,Ae===0&&(e.setRenderTargetTextures(S,O.colorTexture,O.depthStencilTexture),e.setRenderTarget(S))}let Ze=b[Ae];Ze===void 0&&(Ze=new ln,Ze.layers.enable(Ae),Ze.viewport=new Mt,b[Ae]=Ze),Ze.matrix.fromArray(ke.transform.matrix),Ze.matrix.decompose(Ze.position,Ze.quaternion,Ze.scale),Ze.projectionMatrix.fromArray(ke.projectionMatrix),Ze.projectionMatrixInverse.copy(Ze.projectionMatrix).invert(),Ze.viewport.set(tt.x,tt.y,tt.width,tt.height),Ae===0&&(x.matrix.copy(Ze.matrix),x.matrix.decompose(x.position,x.quaternion,x.scale)),oe===!0&&x.cameras.push(Ze)}const Se=i.enabledFeatures;if(Se&&Se.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&u){const Ae=u.getDepthInformation(ae[0]);Ae&&Ae.isValid&&Ae.texture&&_.init(e,Ae,i.renderState)}}for(let ae=0;ae<E.length;ae++){const oe=v[ae],Se=E[ae];oe!==null&&Se!==void 0&&Se.update(oe,re,c||a)}le&&le(Y,re),re.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:re}),m=null}const we=new Vu;we.setAnimationLoop(Le),this.setAnimationLoop=function(Y){le=Y},this.dispose=function(){}}}const Oi=new Sn,e3=new lt;function t3(r,e){function t(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,Eu(r)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,S,E,v){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(g,p):p.isMeshToonMaterial?(s(g,p),u(g,p)):p.isMeshPhongMaterial?(s(g,p),h(g,p)):p.isMeshStandardMaterial?(s(g,p),d(g,p),p.isMeshPhysicalMaterial&&f(g,p,v)):p.isMeshMatcapMaterial?(s(g,p),m(g,p)):p.isMeshDepthMaterial?s(g,p):p.isMeshDistanceMaterial?(s(g,p),_(g,p)):p.isMeshNormalMaterial?s(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,S,E):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,t(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===vn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,t(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===vn&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,t(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,t(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const S=e.get(p),E=S.envMap,v=S.envMapRotation;E&&(g.envMap.value=E,Oi.copy(v),Oi.x*=-1,Oi.y*=-1,Oi.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Oi.y*=-1,Oi.z*=-1),g.envMapRotation.value.setFromMatrix4(e3.makeRotationFromEuler(Oi)),g.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform))}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,S,E){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*S,g.scale.value=E*.5,p.map&&(g.map.value=p.map,t(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,S){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===vn&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=S.texture,g.transmissionSamplerSize.value.set(S.width,S.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const S=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(S.matrixWorld),g.nearDistance.value=S.shadow.camera.near,g.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function n3(r,e,t,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,E){const v=E.program;n.uniformBlockBinding(S,v)}function c(S,E){let v=i[S.id];v===void 0&&(m(S),v=h(S),i[S.id]=v,S.addEventListener("dispose",g));const U=E.program;n.updateUBOMapping(S,U);const C=e.render.frame;s[S.id]!==C&&(d(S),s[S.id]=C)}function h(S){const E=u();S.__bindingPointIndex=E;const v=r.createBuffer(),U=S.__size,C=S.usage;return r.bindBuffer(r.UNIFORM_BUFFER,v),r.bufferData(r.UNIFORM_BUFFER,U,C),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,E,v),v}function u(){for(let S=0;S<o;S++)if(a.indexOf(S)===-1)return a.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(S){const E=i[S.id],v=S.uniforms,U=S.__cache;r.bindBuffer(r.UNIFORM_BUFFER,E);for(let C=0,T=v.length;C<T;C++){const L=Array.isArray(v[C])?v[C]:[v[C]];for(let b=0,x=L.length;b<x;b++){const R=L[b];if(f(R,C,b,U)===!0){const B=R.__offset,V=Array.isArray(R.value)?R.value:[R.value];let W=0;for(let ee=0;ee<V.length;ee++){const k=V[ee],Q=_(k);typeof k=="number"||typeof k=="boolean"?(R.__data[0]=k,r.bufferSubData(r.UNIFORM_BUFFER,B+W,R.__data)):k.isMatrix3?(R.__data[0]=k.elements[0],R.__data[1]=k.elements[1],R.__data[2]=k.elements[2],R.__data[3]=0,R.__data[4]=k.elements[3],R.__data[5]=k.elements[4],R.__data[6]=k.elements[5],R.__data[7]=0,R.__data[8]=k.elements[6],R.__data[9]=k.elements[7],R.__data[10]=k.elements[8],R.__data[11]=0):(k.toArray(R.__data,W),W+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,B,R.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function f(S,E,v,U){const C=S.value,T=E+"_"+v;if(U[T]===void 0)return typeof C=="number"||typeof C=="boolean"?U[T]=C:U[T]=C.clone(),!0;{const L=U[T];if(typeof C=="number"||typeof C=="boolean"){if(L!==C)return U[T]=C,!0}else if(L.equals(C)===!1)return L.copy(C),!0}return!1}function m(S){const E=S.uniforms;let v=0;const U=16;for(let T=0,L=E.length;T<L;T++){const b=Array.isArray(E[T])?E[T]:[E[T]];for(let x=0,R=b.length;x<R;x++){const B=b[x],V=Array.isArray(B.value)?B.value:[B.value];for(let W=0,ee=V.length;W<ee;W++){const k=V[W],Q=_(k),q=v%U,he=q%Q.boundary,ye=q+he;v+=he,ye!==0&&U-ye<Q.storage&&(v+=U-ye),B.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=v,v+=Q.storage}}}const C=v%U;return C>0&&(v+=U-C),S.__size=v,S.__cache={},this}function _(S){const E={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(E.boundary=4,E.storage=4):S.isVector2?(E.boundary=8,E.storage=8):S.isVector3||S.isColor?(E.boundary=16,E.storage=12):S.isVector4?(E.boundary=16,E.storage=16):S.isMatrix3?(E.boundary=48,E.storage=48):S.isMatrix4?(E.boundary=64,E.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),E}function g(S){const E=S.target;E.removeEventListener("dispose",g);const v=a.indexOf(E.__bindingPointIndex);a.splice(v,1),r.deleteBuffer(i[E.id]),delete i[E.id],delete s[E.id]}function p(){for(const S in i)r.deleteBuffer(i[S]);a=[],i={},s={}}return{bind:l,update:c,dispose:p}}class i3{constructor(e={}){const{canvas:t=Jf(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const S=[],E=[];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=Ti,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let U=!1;this._outputColorSpace=Tt;let C=0,T=0,L=null,b=-1,x=null;const R=new Mt,B=new Mt;let V=null;const W=new ot(0);let ee=0,k=t.width,Q=t.height,q=1,he=null,ye=null;const le=new Mt(0,0,k,Q),Le=new Mt(0,0,k,Q);let we=!1;const Y=new kl;let re=!1,ae=!1;const oe=new lt,Se=new lt,_e=new F,Ae=new Mt,ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let tt=!1;function Ze(){return L===null?q:1}let O=n;function bt(D,X){return t.getContext(D,X)}try{const D={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Al}`),t.addEventListener("webglcontextlost",He,!1),t.addEventListener("webglcontextrestored",Me,!1),t.addEventListener("webglcontextcreationerror",ge,!1),O===null){const X="webgl2";if(O=bt(X,D),O===null)throw bt(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let $,pe,te,Te,ce,ue,De,N,A,G,z,se,ne,Ce,Ee,Be,Ve,me,Pe,Je,nt,Ie,ct,H;function Fe(){$=new f2(O),$.init(),Ie=new $g(O,$),pe=new a2(O,$,e,Ie),te=new jg(O,$),pe.reverseDepthBuffer&&d&&te.buffers.depth.setReversed(!0),Te=new g2(O),ce=new Ug,ue=new Yg(O,$,te,ce,pe,Ie,Te),De=new l2(v),N=new d2(v),A=new b0(O),ct=new r2(O,A),G=new p2(O,A,Te,ct),z=new v2(O,G,A,Te),Pe=new _2(O,pe,ue),Be=new o2(ce),se=new Ig(v,De,N,$,pe,ct,Be),ne=new t3(v,ce),Ce=new Fg,Ee=new Hg($),me=new i2(v,De,N,te,z,f,l),Ve=new Xg(v,z,pe),H=new n3(O,Te,pe,te),Je=new s2(O,$,Te),nt=new m2(O,$,Te),Te.programs=se.programs,v.capabilities=pe,v.extensions=$,v.properties=ce,v.renderLists=Ce,v.shadowMap=Ve,v.state=te,v.info=Te}Fe();const ve=new Qg(v,O);this.xr=ve,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){const D=$.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){const D=$.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(D){D!==void 0&&(q=D,this.setSize(k,Q,!1))},this.getSize=function(D){return D.set(k,Q)},this.setSize=function(D,X,J=!0){if(ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}k=D,Q=X,t.width=Math.floor(D*q),t.height=Math.floor(X*q),J===!0&&(t.style.width=D+"px",t.style.height=X+"px"),this.setViewport(0,0,D,X)},this.getDrawingBufferSize=function(D){return D.set(k*q,Q*q).floor()},this.setDrawingBufferSize=function(D,X,J){k=D,Q=X,q=J,t.width=Math.floor(D*J),t.height=Math.floor(X*J),this.setViewport(0,0,D,X)},this.getCurrentViewport=function(D){return D.copy(R)},this.getViewport=function(D){return D.copy(le)},this.setViewport=function(D,X,J,Z){D.isVector4?le.set(D.x,D.y,D.z,D.w):le.set(D,X,J,Z),te.viewport(R.copy(le).multiplyScalar(q).round())},this.getScissor=function(D){return D.copy(Le)},this.setScissor=function(D,X,J,Z){D.isVector4?Le.set(D.x,D.y,D.z,D.w):Le.set(D,X,J,Z),te.scissor(B.copy(Le).multiplyScalar(q).round())},this.getScissorTest=function(){return we},this.setScissorTest=function(D){te.setScissorTest(we=D)},this.setOpaqueSort=function(D){he=D},this.setTransparentSort=function(D){ye=D},this.getClearColor=function(D){return D.copy(me.getClearColor())},this.setClearColor=function(){me.setClearColor(...arguments)},this.getClearAlpha=function(){return me.getClearAlpha()},this.setClearAlpha=function(){me.setClearAlpha(...arguments)},this.clear=function(D=!0,X=!0,J=!0){let Z=0;if(D){let j=!1;if(L!==null){const be=L.texture.format;j=be===Pl||be===Dl||be===Rl}if(j){const be=L.texture.type,Oe=be===Qn||be===qi||be===is||be===rs||be===Tl||be===Cl,Ye=me.getClearColor(),Ge=me.getClearAlpha(),ut=Ye.r,dt=Ye.g,et=Ye.b;Oe?(m[0]=ut,m[1]=dt,m[2]=et,m[3]=Ge,O.clearBufferuiv(O.COLOR,0,m)):(_[0]=ut,_[1]=dt,_[2]=et,_[3]=Ge,O.clearBufferiv(O.COLOR,0,_))}else Z|=O.COLOR_BUFFER_BIT}X&&(Z|=O.DEPTH_BUFFER_BIT),J&&(Z|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(Z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",He,!1),t.removeEventListener("webglcontextrestored",Me,!1),t.removeEventListener("webglcontextcreationerror",ge,!1),me.dispose(),Ce.dispose(),Ee.dispose(),ce.dispose(),De.dispose(),N.dispose(),z.dispose(),ct.dispose(),H.dispose(),se.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Zt),ve.removeEventListener("sessionend",jt),tn.stop()};function He(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const D=Te.autoReset,X=Ve.enabled,J=Ve.autoUpdate,Z=Ve.needsUpdate,j=Ve.type;Fe(),Te.autoReset=D,Ve.enabled=X,Ve.autoUpdate=J,Ve.needsUpdate=Z,Ve.type=j}function ge(D){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",D.statusMessage)}function qe(D){const X=D.target;X.removeEventListener("dispose",qe),ht(X)}function ht(D){Dt(D),ce.remove(D)}function Dt(D){const X=ce.get(D).programs;X!==void 0&&(X.forEach(function(J){se.releaseProgram(J)}),D.isShaderMaterial&&se.releaseShaderCache(D))}this.renderBufferDirect=function(D,X,J,Z,j,be){X===null&&(X=ke);const Oe=j.isMesh&&j.matrixWorld.determinant()<0,Ye=En(D,X,J,Z,j);te.setMaterial(Z,Oe);let Ge=J.index,ut=1;if(Z.wireframe===!0){if(Ge=G.getWireframeAttribute(J),Ge===void 0)return;ut=2}const dt=J.drawRange,et=J.attributes.position;let gt=dt.start*ut,Ct=(dt.start+dt.count)*ut;be!==null&&(gt=Math.max(gt,be.start*ut),Ct=Math.min(Ct,(be.start+be.count)*ut)),Ge!==null?(gt=Math.max(gt,0),Ct=Math.min(Ct,Ge.count)):et!=null&&(gt=Math.max(gt,0),Ct=Math.min(Ct,et.count));const Ot=Ct-gt;if(Ot<0||Ot===1/0)return;ct.setup(j,Z,Ye,J,Ge);let kt,St=Je;if(Ge!==null&&(kt=A.get(Ge),St=nt,St.setIndex(kt)),j.isMesh)Z.wireframe===!0?(te.setLineWidth(Z.wireframeLinewidth*Ze()),St.setMode(O.LINES)):St.setMode(O.TRIANGLES);else if(j.isLine){let st=Z.linewidth;st===void 0&&(st=1),te.setLineWidth(st*Ze()),j.isLineSegments?St.setMode(O.LINES):j.isLineLoop?St.setMode(O.LINE_LOOP):St.setMode(O.LINE_STRIP)}else j.isPoints?St.setMode(O.POINTS):j.isSprite&&St.setMode(O.TRIANGLES);if(j.isBatchedMesh)if(j._multiDrawInstances!==null)Ar("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),St.renderMultiDrawInstances(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount,j._multiDrawInstances);else if($.get("WEBGL_multi_draw"))St.renderMultiDraw(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount);else{const st=j._multiDrawStarts,Yt=j._multiDrawCounts,Et=j._multiDrawCount,yn=Ge?A.get(Ge).bytesPerElement:1,zt=ce.get(Z).currentProgram.getUniforms();for(let rn=0;rn<Et;rn++)zt.setValue(O,"_gl_DrawID",rn),St.render(st[rn]/yn,Yt[rn])}else if(j.isInstancedMesh)St.renderInstances(gt,Ot,j.count);else if(J.isInstancedBufferGeometry){const st=J._maxInstanceCount!==void 0?J._maxInstanceCount:1/0,Yt=Math.min(J.instanceCount,st);St.renderInstances(gt,Ot,Yt)}else St.render(gt,Ot)};function pt(D,X,J){D.transparent===!0&&D.side===pn&&D.forceSinglePass===!1?(D.side=vn,D.needsUpdate=!0,nn(D,X,J),D.side=Hn,D.needsUpdate=!0,nn(D,X,J),D.side=pn):nn(D,X,J)}this.compile=function(D,X,J=null){J===null&&(J=D),p=Ee.get(J),p.init(X),E.push(p),J.traverseVisible(function(j){j.isLight&&j.layers.test(X.layers)&&(p.pushLight(j),j.castShadow&&p.pushShadow(j))}),D!==J&&D.traverseVisible(function(j){j.isLight&&j.layers.test(X.layers)&&(p.pushLight(j),j.castShadow&&p.pushShadow(j))}),p.setupLights();const Z=new Set;return D.traverse(function(j){if(!(j.isMesh||j.isPoints||j.isLine||j.isSprite))return;const be=j.material;if(be)if(Array.isArray(be))for(let Oe=0;Oe<be.length;Oe++){const Ye=be[Oe];pt(Ye,J,j),Z.add(Ye)}else pt(be,J,j),Z.add(be)}),p=E.pop(),Z},this.compileAsync=function(D,X,J=null){const Z=this.compile(D,X,J);return new Promise(j=>{function be(){if(Z.forEach(function(Oe){ce.get(Oe).currentProgram.isReady()&&Z.delete(Oe)}),Z.size===0){j(D);return}setTimeout(be,10)}$.get("KHR_parallel_shader_compile")!==null?be():setTimeout(be,10)})};let en=null;function je(D){en&&en(D)}function Zt(){tn.stop()}function jt(){tn.start()}const tn=new Vu;tn.setAnimationLoop(je),typeof self<"u"&&tn.setContext(self),this.setAnimationLoop=function(D){en=D,ve.setAnimationLoop(D),D===null?tn.stop():tn.start()},ve.addEventListener("sessionstart",Zt),ve.addEventListener("sessionend",jt),this.render=function(D,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),ve.enabled===!0&&ve.isPresenting===!0&&(ve.cameraAutoUpdate===!0&&ve.updateCamera(X),X=ve.getCamera()),D.isScene===!0&&D.onBeforeRender(v,D,X,L),p=Ee.get(D,E.length),p.init(X),E.push(p),Se.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),Y.setFromProjectionMatrix(Se),ae=this.localClippingEnabled,re=Be.init(this.clippingPlanes,ae),g=Ce.get(D,S.length),g.init(),S.push(g),ve.enabled===!0&&ve.isPresenting===!0){const be=v.xr.getDepthSensingMesh();be!==null&&Di(be,X,-1/0,v.sortObjects)}Di(D,X,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(he,ye),tt=ve.enabled===!1||ve.isPresenting===!1||ve.hasDepthSensing()===!1,tt&&me.addToRenderList(g,D),this.info.render.frame++,re===!0&&Be.beginShadows();const J=p.state.shadowsArray;Ve.render(J,D,X),re===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset();const Z=g.opaque,j=g.transmissive;if(p.setupLights(),X.isArrayCamera){const be=X.cameras;if(j.length>0)for(let Oe=0,Ye=be.length;Oe<Ye;Oe++){const Ge=be[Oe];rt(Z,j,D,Ge)}tt&&me.render(D);for(let Oe=0,Ye=be.length;Oe<Ye;Oe++){const Ge=be[Oe];ti(g,D,Ge,Ge.viewport)}}else j.length>0&&rt(Z,j,D,X),tt&&me.render(D),ti(g,D,X);L!==null&&T===0&&(ue.updateMultisampleRenderTarget(L),ue.updateRenderTargetMipmap(L)),D.isScene===!0&&D.onAfterRender(v,D,X),ct.resetDefaultState(),b=-1,x=null,E.pop(),E.length>0?(p=E[E.length-1],re===!0&&Be.setGlobalState(v.clippingPlanes,p.state.camera)):p=null,S.pop(),S.length>0?g=S[S.length-1]:g=null};function Di(D,X,J,Z){if(D.visible===!1)return;if(D.layers.test(X.layers)){if(D.isGroup)J=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(X);else if(D.isLight)p.pushLight(D),D.castShadow&&p.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||Y.intersectsSprite(D)){Z&&Ae.setFromMatrixPosition(D.matrixWorld).applyMatrix4(Se);const Oe=z.update(D),Ye=D.material;Ye.visible&&g.push(D,Oe,Ye,J,Ae.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(!D.frustumCulled||Y.intersectsObject(D))){const Oe=z.update(D),Ye=D.material;if(Z&&(D.boundingSphere!==void 0?(D.boundingSphere===null&&D.computeBoundingSphere(),Ae.copy(D.boundingSphere.center)):(Oe.boundingSphere===null&&Oe.computeBoundingSphere(),Ae.copy(Oe.boundingSphere.center)),Ae.applyMatrix4(D.matrixWorld).applyMatrix4(Se)),Array.isArray(Ye)){const Ge=Oe.groups;for(let ut=0,dt=Ge.length;ut<dt;ut++){const et=Ge[ut],gt=Ye[et.materialIndex];gt&&gt.visible&&g.push(D,Oe,gt,J,Ae.z,et)}}else Ye.visible&&g.push(D,Oe,Ye,J,Ae.z,null)}}const be=D.children;for(let Oe=0,Ye=be.length;Oe<Ye;Oe++)Di(be[Oe],X,J,Z)}function ti(D,X,J,Z){const j=D.opaque,be=D.transmissive,Oe=D.transparent;p.setupLightsView(J),re===!0&&Be.setGlobalState(v.clippingPlanes,J),Z&&te.viewport(R.copy(Z)),j.length>0&&Re(j,X,J),be.length>0&&Re(be,X,J),Oe.length>0&&Re(Oe,X,J),te.buffers.depth.setTest(!0),te.buffers.depth.setMask(!0),te.buffers.color.setMask(!0),te.setPolygonOffset(!1)}function rt(D,X,J,Z){if((J.isScene===!0?J.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[Z.id]===void 0&&(p.state.transmissionRenderTarget[Z.id]=new ji(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?hs:Qn,minFilter:ui,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:xt.workingColorSpace}));const be=p.state.transmissionRenderTarget[Z.id],Oe=Z.viewport||R;be.setSize(Oe.z*v.transmissionResolutionScale,Oe.w*v.transmissionResolutionScale);const Ye=v.getRenderTarget();v.setRenderTarget(be),v.getClearColor(W),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),tt&&me.render(J);const Ge=v.toneMapping;v.toneMapping=Ti;const ut=Z.viewport;if(Z.viewport!==void 0&&(Z.viewport=void 0),p.setupLightsView(Z),re===!0&&Be.setGlobalState(v.clippingPlanes,Z),Re(D,J,Z),ue.updateMultisampleRenderTarget(be),ue.updateRenderTargetMipmap(be),$.has("WEBGL_multisampled_render_to_texture")===!1){let dt=!1;for(let et=0,gt=X.length;et<gt;et++){const Ct=X[et],Ot=Ct.object,kt=Ct.geometry,St=Ct.material,st=Ct.group;if(St.side===pn&&Ot.layers.test(Z.layers)){const Yt=St.side;St.side=vn,St.needsUpdate=!0,Ht(Ot,J,Z,kt,St,st),St.side=Yt,St.needsUpdate=!0,dt=!0}}dt===!0&&(ue.updateMultisampleRenderTarget(be),ue.updateRenderTargetMipmap(be))}v.setRenderTarget(Ye),v.setClearColor(W,ee),ut!==void 0&&(Z.viewport=ut),v.toneMapping=Ge}function Re(D,X,J){const Z=X.isScene===!0?X.overrideMaterial:null;for(let j=0,be=D.length;j<be;j++){const Oe=D[j],Ye=Oe.object,Ge=Oe.geometry,ut=Oe.group;let dt=Oe.material;dt.allowOverride===!0&&Z!==null&&(dt=Z),Ye.layers.test(J.layers)&&Ht(Ye,X,J,Ge,dt,ut)}}function Ht(D,X,J,Z,j,be){D.onBeforeRender(v,X,J,Z,j,be),D.modelViewMatrix.multiplyMatrices(J.matrixWorldInverse,D.matrixWorld),D.normalMatrix.getNormalMatrix(D.modelViewMatrix),j.onBeforeRender(v,X,J,Z,D,be),j.transparent===!0&&j.side===pn&&j.forceSinglePass===!1?(j.side=vn,j.needsUpdate=!0,v.renderBufferDirect(J,X,Z,j,D,be),j.side=Hn,j.needsUpdate=!0,v.renderBufferDirect(J,X,Z,j,D,be),j.side=pn):v.renderBufferDirect(J,X,Z,j,D,be),D.onAfterRender(v,X,J,Z,j,be)}function nn(D,X,J){X.isScene!==!0&&(X=ke);const Z=ce.get(D),j=p.state.lights,be=p.state.shadowsArray,Oe=j.state.version,Ye=se.getParameters(D,j.state,be,X,J),Ge=se.getProgramCacheKey(Ye);let ut=Z.programs;Z.environment=D.isMeshStandardMaterial?X.environment:null,Z.fog=X.fog,Z.envMap=(D.isMeshStandardMaterial?N:De).get(D.envMap||Z.environment),Z.envMapRotation=Z.environment!==null&&D.envMap===null?X.environmentRotation:D.envMapRotation,ut===void 0&&(D.addEventListener("dispose",qe),ut=new Map,Z.programs=ut);let dt=ut.get(Ge);if(dt!==void 0){if(Z.currentProgram===dt&&Z.lightsStateVersion===Oe)return hn(D,Ye),dt}else Ye.uniforms=se.getUniforms(D),D.onBeforeCompile(Ye,v),dt=se.acquireProgram(Ye,Ge),ut.set(Ge,dt),Z.uniforms=Ye.uniforms;const et=Z.uniforms;return(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(et.clippingPlanes=Be.uniform),hn(D,Ye),Z.needsLights=Ki(D),Z.lightsStateVersion=Oe,Z.needsLights&&(et.ambientLightColor.value=j.state.ambient,et.lightProbe.value=j.state.probe,et.directionalLights.value=j.state.directional,et.directionalLightShadows.value=j.state.directionalShadow,et.spotLights.value=j.state.spot,et.spotLightShadows.value=j.state.spotShadow,et.rectAreaLights.value=j.state.rectArea,et.ltc_1.value=j.state.rectAreaLTC1,et.ltc_2.value=j.state.rectAreaLTC2,et.pointLights.value=j.state.point,et.pointLightShadows.value=j.state.pointShadow,et.hemisphereLights.value=j.state.hemi,et.directionalShadowMap.value=j.state.directionalShadowMap,et.directionalShadowMatrix.value=j.state.directionalShadowMatrix,et.spotShadowMap.value=j.state.spotShadowMap,et.spotLightMatrix.value=j.state.spotLightMatrix,et.spotLightMap.value=j.state.spotLightMap,et.pointShadowMap.value=j.state.pointShadowMap,et.pointShadowMatrix.value=j.state.pointShadowMatrix),Z.currentProgram=dt,Z.uniformsList=null,dt}function Wt(D){if(D.uniformsList===null){const X=D.currentProgram.getUniforms();D.uniformsList=ca.seqWithValue(X.seq,D.uniforms)}return D.uniformsList}function hn(D,X){const J=ce.get(D);J.outputColorSpace=X.outputColorSpace,J.batching=X.batching,J.batchingColor=X.batchingColor,J.instancing=X.instancing,J.instancingColor=X.instancingColor,J.instancingMorph=X.instancingMorph,J.skinning=X.skinning,J.morphTargets=X.morphTargets,J.morphNormals=X.morphNormals,J.morphColors=X.morphColors,J.morphTargetsCount=X.morphTargetsCount,J.numClippingPlanes=X.numClippingPlanes,J.numIntersection=X.numClipIntersection,J.vertexAlphas=X.vertexAlphas,J.vertexTangents=X.vertexTangents,J.toneMapping=X.toneMapping}function En(D,X,J,Z,j){X.isScene!==!0&&(X=ke),ue.resetTextureUnits();const be=X.fog,Oe=Z.isMeshStandardMaterial?X.environment:null,Ye=L===null?v.outputColorSpace:L.isXRRenderTarget===!0?L.texture.colorSpace:Dr,Ge=(Z.isMeshStandardMaterial?N:De).get(Z.envMap||Oe),ut=Z.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,dt=!!J.attributes.tangent&&(!!Z.normalMap||Z.anisotropy>0),et=!!J.morphAttributes.position,gt=!!J.morphAttributes.normal,Ct=!!J.morphAttributes.color;let Ot=Ti;Z.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Ot=v.toneMapping);const kt=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,St=kt!==void 0?kt.length:0,st=ce.get(Z),Yt=p.state.lights;if(re===!0&&(ae===!0||D!==x)){const Xt=D===x&&Z.id===b;Be.setState(Z,D,Xt)}let Et=!1;Z.version===st.__version?(st.needsLights&&st.lightsStateVersion!==Yt.state.version||st.outputColorSpace!==Ye||j.isBatchedMesh&&st.batching===!1||!j.isBatchedMesh&&st.batching===!0||j.isBatchedMesh&&st.batchingColor===!0&&j.colorTexture===null||j.isBatchedMesh&&st.batchingColor===!1&&j.colorTexture!==null||j.isInstancedMesh&&st.instancing===!1||!j.isInstancedMesh&&st.instancing===!0||j.isSkinnedMesh&&st.skinning===!1||!j.isSkinnedMesh&&st.skinning===!0||j.isInstancedMesh&&st.instancingColor===!0&&j.instanceColor===null||j.isInstancedMesh&&st.instancingColor===!1&&j.instanceColor!==null||j.isInstancedMesh&&st.instancingMorph===!0&&j.morphTexture===null||j.isInstancedMesh&&st.instancingMorph===!1&&j.morphTexture!==null||st.envMap!==Ge||Z.fog===!0&&st.fog!==be||st.numClippingPlanes!==void 0&&(st.numClippingPlanes!==Be.numPlanes||st.numIntersection!==Be.numIntersection)||st.vertexAlphas!==ut||st.vertexTangents!==dt||st.morphTargets!==et||st.morphNormals!==gt||st.morphColors!==Ct||st.toneMapping!==Ot||st.morphTargetsCount!==St)&&(Et=!0):(Et=!0,st.__version=Z.version);let yn=st.currentProgram;Et===!0&&(yn=nn(Z,X,j));let zt=!1,rn=!1,Pi=!1;const Ft=yn.getUniforms(),mn=st.uniforms;if(te.useProgram(yn.program)&&(zt=!0,rn=!0,Pi=!0),Z.id!==b&&(b=Z.id,rn=!0),zt||x!==D){te.buffers.depth.getReversed()?(oe.copy(D.projectionMatrix),Zf(oe),Qf(oe),Ft.setValue(O,"projectionMatrix",oe)):Ft.setValue(O,"projectionMatrix",D.projectionMatrix),Ft.setValue(O,"viewMatrix",D.matrixWorldInverse);const $t=Ft.map.cameraPosition;$t!==void 0&&$t.setValue(O,_e.setFromMatrixPosition(D.matrixWorld)),pe.logarithmicDepthBuffer&&Ft.setValue(O,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),(Z.isMeshPhongMaterial||Z.isMeshToonMaterial||Z.isMeshLambertMaterial||Z.isMeshBasicMaterial||Z.isMeshStandardMaterial||Z.isShaderMaterial)&&Ft.setValue(O,"isOrthographic",D.isOrthographicCamera===!0),x!==D&&(x=D,rn=!0,Pi=!0)}if(j.isSkinnedMesh){Ft.setOptional(O,j,"bindMatrix"),Ft.setOptional(O,j,"bindMatrixInverse");const Xt=j.skeleton;Xt&&(Xt.boneTexture===null&&Xt.computeBoneTexture(),Ft.setValue(O,"boneTexture",Xt.boneTexture,ue))}j.isBatchedMesh&&(Ft.setOptional(O,j,"batchingTexture"),Ft.setValue(O,"batchingTexture",j._matricesTexture,ue),Ft.setOptional(O,j,"batchingIdTexture"),Ft.setValue(O,"batchingIdTexture",j._indirectTexture,ue),Ft.setOptional(O,j,"batchingColorTexture"),j._colorsTexture!==null&&Ft.setValue(O,"batchingColorTexture",j._colorsTexture,ue));const un=J.morphAttributes;if((un.position!==void 0||un.normal!==void 0||un.color!==void 0)&&Pe.update(j,J,yn),(rn||st.receiveShadow!==j.receiveShadow)&&(st.receiveShadow=j.receiveShadow,Ft.setValue(O,"receiveShadow",j.receiveShadow)),Z.isMeshGouraudMaterial&&Z.envMap!==null&&(mn.envMap.value=Ge,mn.flipEnvMap.value=Ge.isCubeTexture&&Ge.isRenderTargetTexture===!1?-1:1),Z.isMeshStandardMaterial&&Z.envMap===null&&X.environment!==null&&(mn.envMapIntensity.value=X.environmentIntensity),rn&&(Ft.setValue(O,"toneMappingExposure",v.toneMappingExposure),st.needsLights&&Ji(mn,Pi),be&&Z.fog===!0&&ne.refreshFogUniforms(mn,be),ne.refreshMaterialUniforms(mn,Z,q,Q,p.state.transmissionRenderTarget[D.id]),ca.upload(O,Wt(st),mn,ue)),Z.isShaderMaterial&&Z.uniformsNeedUpdate===!0&&(ca.upload(O,Wt(st),mn,ue),Z.uniformsNeedUpdate=!1),Z.isSpriteMaterial&&Ft.setValue(O,"center",j.center),Ft.setValue(O,"modelViewMatrix",j.modelViewMatrix),Ft.setValue(O,"normalMatrix",j.normalMatrix),Ft.setValue(O,"modelMatrix",j.matrixWorld),Z.isShaderMaterial||Z.isRawShaderMaterial){const Xt=Z.uniformsGroups;for(let $t=0,tr=Xt.length;$t<tr;$t++){const ni=Xt[$t];H.update(ni,yn),H.bind(ni,yn)}}return yn}function Ji(D,X){D.ambientLightColor.needsUpdate=X,D.lightProbe.needsUpdate=X,D.directionalLights.needsUpdate=X,D.directionalLightShadows.needsUpdate=X,D.pointLights.needsUpdate=X,D.pointLightShadows.needsUpdate=X,D.spotLights.needsUpdate=X,D.spotLightShadows.needsUpdate=X,D.rectAreaLights.needsUpdate=X,D.hemisphereLights.needsUpdate=X}function Ki(D){return D.isMeshLambertMaterial||D.isMeshToonMaterial||D.isMeshPhongMaterial||D.isMeshStandardMaterial||D.isShadowMaterial||D.isShaderMaterial&&D.lights===!0}this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return L},this.setRenderTargetTextures=function(D,X,J){const Z=ce.get(D);Z.__autoAllocateDepthBuffer=D.resolveDepthBuffer===!1,Z.__autoAllocateDepthBuffer===!1&&(Z.__useRenderToTexture=!1),ce.get(D.texture).__webglTexture=X,ce.get(D.depthTexture).__webglTexture=Z.__autoAllocateDepthBuffer?void 0:J,Z.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(D,X){const J=ce.get(D);J.__webglFramebuffer=X,J.__useDefaultFramebuffer=X===void 0};const Zi=O.createFramebuffer();this.setRenderTarget=function(D,X=0,J=0){L=D,C=X,T=J;let Z=!0,j=null,be=!1,Oe=!1;if(D){const Ge=ce.get(D);if(Ge.__useDefaultFramebuffer!==void 0)te.bindFramebuffer(O.FRAMEBUFFER,null),Z=!1;else if(Ge.__webglFramebuffer===void 0)ue.setupRenderTarget(D);else if(Ge.__hasExternalTextures)ue.rebindTextures(D,ce.get(D.texture).__webglTexture,ce.get(D.depthTexture).__webglTexture);else if(D.depthBuffer){const et=D.depthTexture;if(Ge.__boundDepthTexture!==et){if(et!==null&&ce.has(et)&&(D.width!==et.image.width||D.height!==et.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ue.setupDepthRenderbuffer(D)}}const ut=D.texture;(ut.isData3DTexture||ut.isDataArrayTexture||ut.isCompressedArrayTexture)&&(Oe=!0);const dt=ce.get(D).__webglFramebuffer;D.isWebGLCubeRenderTarget?(Array.isArray(dt[X])?j=dt[X][J]:j=dt[X],be=!0):D.samples>0&&ue.useMultisampledRTT(D)===!1?j=ce.get(D).__webglMultisampledFramebuffer:Array.isArray(dt)?j=dt[J]:j=dt,R.copy(D.viewport),B.copy(D.scissor),V=D.scissorTest}else R.copy(le).multiplyScalar(q).floor(),B.copy(Le).multiplyScalar(q).floor(),V=we;if(J!==0&&(j=Zi),te.bindFramebuffer(O.FRAMEBUFFER,j)&&Z&&te.drawBuffers(D,j),te.viewport(R),te.scissor(B),te.setScissorTest(V),be){const Ge=ce.get(D.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+X,Ge.__webglTexture,J)}else if(Oe){const Ge=ce.get(D.texture),ut=X;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,Ge.__webglTexture,J,ut)}else if(D!==null&&J!==0){const Ge=ce.get(D.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Ge.__webglTexture,J)}b=-1},this.readRenderTargetPixels=function(D,X,J,Z,j,be,Oe,Ye=0){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ge=ce.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Oe!==void 0&&(Ge=Ge[Oe]),Ge){te.bindFramebuffer(O.FRAMEBUFFER,Ge);try{const ut=D.textures[Ye],dt=ut.format,et=ut.type;if(!pe.textureFormatReadable(dt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!pe.textureTypeReadable(et)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=D.width-Z&&J>=0&&J<=D.height-j&&(D.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Ye),O.readPixels(X,J,Z,j,Ie.convert(dt),Ie.convert(et),be))}finally{const ut=L!==null?ce.get(L).__webglFramebuffer:null;te.bindFramebuffer(O.FRAMEBUFFER,ut)}}},this.readRenderTargetPixelsAsync=async function(D,X,J,Z,j,be,Oe,Ye=0){if(!(D&&D.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ge=ce.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Oe!==void 0&&(Ge=Ge[Oe]),Ge)if(X>=0&&X<=D.width-Z&&J>=0&&J<=D.height-j){te.bindFramebuffer(O.FRAMEBUFFER,Ge);const ut=D.textures[Ye],dt=ut.format,et=ut.type;if(!pe.textureFormatReadable(dt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!pe.textureTypeReadable(et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const gt=O.createBuffer();O.bindBuffer(O.PIXEL_PACK_BUFFER,gt),O.bufferData(O.PIXEL_PACK_BUFFER,be.byteLength,O.STREAM_READ),D.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Ye),O.readPixels(X,J,Z,j,Ie.convert(dt),Ie.convert(et),0);const Ct=L!==null?ce.get(L).__webglFramebuffer:null;te.bindFramebuffer(O.FRAMEBUFFER,Ct);const Ot=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0);return O.flush(),await Kf(O,Ot,4),O.bindBuffer(O.PIXEL_PACK_BUFFER,gt),O.getBufferSubData(O.PIXEL_PACK_BUFFER,0,be),O.deleteBuffer(gt),O.deleteSync(Ot),be}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(D,X=null,J=0){const Z=Math.pow(2,-J),j=Math.floor(D.image.width*Z),be=Math.floor(D.image.height*Z),Oe=X!==null?X.x:0,Ye=X!==null?X.y:0;ue.setTexture2D(D,0),O.copyTexSubImage2D(O.TEXTURE_2D,J,0,0,Oe,Ye,j,be),te.unbindTexture()};const Qi=O.createFramebuffer(),er=O.createFramebuffer();this.copyTextureToTexture=function(D,X,J=null,Z=null,j=0,be=null){be===null&&(j!==0?(Ar("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),be=j,j=0):be=0);let Oe,Ye,Ge,ut,dt,et,gt,Ct,Ot;const kt=D.isCompressedTexture?D.mipmaps[be]:D.image;if(J!==null)Oe=J.max.x-J.min.x,Ye=J.max.y-J.min.y,Ge=J.isBox3?J.max.z-J.min.z:1,ut=J.min.x,dt=J.min.y,et=J.isBox3?J.min.z:0;else{const un=Math.pow(2,-j);Oe=Math.floor(kt.width*un),Ye=Math.floor(kt.height*un),D.isDataArrayTexture?Ge=kt.depth:D.isData3DTexture?Ge=Math.floor(kt.depth*un):Ge=1,ut=0,dt=0,et=0}Z!==null?(gt=Z.x,Ct=Z.y,Ot=Z.z):(gt=0,Ct=0,Ot=0);const St=Ie.convert(X.format),st=Ie.convert(X.type);let Yt;X.isData3DTexture?(ue.setTexture3D(X,0),Yt=O.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(ue.setTexture2DArray(X,0),Yt=O.TEXTURE_2D_ARRAY):(ue.setTexture2D(X,0),Yt=O.TEXTURE_2D),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,X.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,X.unpackAlignment);const Et=O.getParameter(O.UNPACK_ROW_LENGTH),yn=O.getParameter(O.UNPACK_IMAGE_HEIGHT),zt=O.getParameter(O.UNPACK_SKIP_PIXELS),rn=O.getParameter(O.UNPACK_SKIP_ROWS),Pi=O.getParameter(O.UNPACK_SKIP_IMAGES);O.pixelStorei(O.UNPACK_ROW_LENGTH,kt.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,kt.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,ut),O.pixelStorei(O.UNPACK_SKIP_ROWS,dt),O.pixelStorei(O.UNPACK_SKIP_IMAGES,et);const Ft=D.isDataArrayTexture||D.isData3DTexture,mn=X.isDataArrayTexture||X.isData3DTexture;if(D.isDepthTexture){const un=ce.get(D),Xt=ce.get(X),$t=ce.get(un.__renderTarget),tr=ce.get(Xt.__renderTarget);te.bindFramebuffer(O.READ_FRAMEBUFFER,$t.__webglFramebuffer),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,tr.__webglFramebuffer);for(let ni=0;ni<Ge;ni++)Ft&&(O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,ce.get(D).__webglTexture,j,et+ni),O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,ce.get(X).__webglTexture,be,Ot+ni)),O.blitFramebuffer(ut,dt,Oe,Ye,gt,Ct,Oe,Ye,O.DEPTH_BUFFER_BIT,O.NEAREST);te.bindFramebuffer(O.READ_FRAMEBUFFER,null),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else if(j!==0||D.isRenderTargetTexture||ce.has(D)){const un=ce.get(D),Xt=ce.get(X);te.bindFramebuffer(O.READ_FRAMEBUFFER,Qi),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,er);for(let $t=0;$t<Ge;$t++)Ft?O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,un.__webglTexture,j,et+$t):O.framebufferTexture2D(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,un.__webglTexture,j),mn?O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,Xt.__webglTexture,be,Ot+$t):O.framebufferTexture2D(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Xt.__webglTexture,be),j!==0?O.blitFramebuffer(ut,dt,Oe,Ye,gt,Ct,Oe,Ye,O.COLOR_BUFFER_BIT,O.NEAREST):mn?O.copyTexSubImage3D(Yt,be,gt,Ct,Ot+$t,ut,dt,Oe,Ye):O.copyTexSubImage2D(Yt,be,gt,Ct,ut,dt,Oe,Ye);te.bindFramebuffer(O.READ_FRAMEBUFFER,null),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else mn?D.isDataTexture||D.isData3DTexture?O.texSubImage3D(Yt,be,gt,Ct,Ot,Oe,Ye,Ge,St,st,kt.data):X.isCompressedArrayTexture?O.compressedTexSubImage3D(Yt,be,gt,Ct,Ot,Oe,Ye,Ge,St,kt.data):O.texSubImage3D(Yt,be,gt,Ct,Ot,Oe,Ye,Ge,St,st,kt):D.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,be,gt,Ct,Oe,Ye,St,st,kt.data):D.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,be,gt,Ct,kt.width,kt.height,St,kt.data):O.texSubImage2D(O.TEXTURE_2D,be,gt,Ct,Oe,Ye,St,st,kt);O.pixelStorei(O.UNPACK_ROW_LENGTH,Et),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,yn),O.pixelStorei(O.UNPACK_SKIP_PIXELS,zt),O.pixelStorei(O.UNPACK_SKIP_ROWS,rn),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Pi),be===0&&X.generateMipmaps&&O.generateMipmap(Yt),te.unbindTexture()},this.copyTextureToTexture3D=function(D,X,J=null,Z=null,j=0){return Ar('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(D,X,J,Z,j)},this.initRenderTarget=function(D){ce.get(D).__webglFramebuffer===void 0&&ue.setupRenderTarget(D)},this.initTexture=function(D){D.isCubeTexture?ue.setTextureCube(D,0):D.isData3DTexture?ue.setTexture3D(D,0):D.isDataArrayTexture||D.isCompressedArrayTexture?ue.setTexture2DArray(D,0):ue.setTexture2D(D,0),te.unbindTexture()},this.resetState=function(){C=0,T=0,L=null,te.reset(),ct.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return di}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=xt._getDrawingBufferColorSpace(e),t.unpackColorSpace=xt._getUnpackColorSpace()}}var r3=Object.defineProperty,s3=(r,e,t)=>e in r?r3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Pt=(r,e,t)=>s3(r,typeof e!="symbol"?e+"":e,t);const qu=(r,e)=>{const[t,n]=e.split("-");return Object.assign(r.style,{left:n==="left"?"0":n==="center"?"50%":"",right:n==="right"?"0":"",top:t==="top"?"0":t==="bottom"?"":"50%",bottom:t==="bottom"?"0":"",transform:`${n==="center"?"translateX(-50%)":""} ${t==="center"?"translateY(-50%)":""}`}),e},a3=({placement:r,size:e,offset:t,id:n,className:i})=>{const s=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=t;return Object.assign(s.style,{id:n,position:"absolute",zIndex:"1000",height:`${e}px`,width:`${e}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),qu(s,r),n&&(s.id=n),i&&(s.className=i),s},o3=r=>{const e=typeof r=="string"?document.querySelector(r):r;if(!e)throw Error("Invalid DOM element");return e};function ml(r,e,t){return Math.max(e,Math.min(t,r))}const l3=[["x",0,3],["y",1,4],["z",2,5]],Rh=new F;function Dh({isSphere:r},e,t){r&&(Rh.set(0,0,1).applyQuaternion(t.quaternion),l3.forEach(([n,i,s])=>{const a=Rh[n];let o=e[i],l=o.userData.opacity;o.material.opacity=ml(a>=0?l:l/2,0,1),o=e[s],l=o.userData.opacity,o.material.opacity=ml(a>=0?l/2:l,0,1)}))}const c3=(r,e,t=10)=>Math.abs(r.clientX-e.x)<t&&Math.abs(r.clientY-e.y)<t,Ph=new _0,Lh=new Xe,Ih=(r,e,t,n)=>{Lh.set((r.clientX-e.left)/e.width*2-1,-((r.clientY-e.top)/e.height)*2+1),Ph.setFromCamera(Lh,t);const i=Ph.intersectObjects(n,!1),s=i.length?i[0]:null;return!s||!s.object.visible?null:s},_o=1e-6,h3=2*Math.PI,ju=["x","y","z"],ls=[...ju,"nx","ny","nz"],u3=["x","z","y","nx","nz","ny"],d3=["z","x","y","nz","nx","ny"],gl="Right",ha="Top",_l="Front",vl="Left",ua="Bottom",yl="Back",f3=[gl,ha,_l,vl,ua,yl].map(r=>r.toLocaleLowerCase()),Yu=1.3,Uh=(r,e=!0)=>{const{material:t,userData:n}=r,{color:i,opacity:s}=e?n.hover:n;t.color.set(i),t.opacity=s},zi=r=>JSON.parse(JSON.stringify(r)),p3=r=>{const e=r.type||"sphere",t=e==="sphere",n=r.resolution||t?64:128,i=Nt.DEFAULT_UP,s=i.z===1,a=i.x===1,{container:o}=r;r.container=void 0,r=JSON.parse(JSON.stringify(r)),r.container=o;const l=s?u3:a?d3:ls;f3.forEach((d,f)=>{r[d]&&(r[l[f]]=r[d])});const c={enabled:!0,color:16777215,opacity:1,scale:.7,labelColor:2236962,line:!1,border:{size:0,color:14540253},hover:{color:t?16777215:9688043,labelColor:2236962,opacity:1,scale:.7,border:{size:0,color:14540253}}},h={line:!1,scale:t?.45:.7,hover:{scale:t?.5:.7}},u={type:e,container:document.body,size:128,placement:"top-right",resolution:n,lineWidth:4,radius:t?1:.2,smoothness:18,animated:!0,speed:1,background:{enabled:!0,color:t?16777215:14739180,opacity:t?0:1,hover:{color:t?16777215:14739180,opacity:t?.2:1}},font:{family:"sans-serif",weight:900},offset:{top:10,left:10,bottom:10,right:10},corners:{enabled:!t,color:t?15915362:16777215,opacity:1,scale:t?.15:.2,radius:1,smoothness:18,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:.225}},edges:{enabled:!t,color:t?15915362:16777215,opacity:t?1:0,radius:t?1:.125,smoothness:18,scale:t?.15:1,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:1}},x:{...zi(c),...t?{label:"X",color:16725587,line:!0}:{label:a?ha:gl}},y:{...zi(c),...t?{label:"Y",color:9100032,line:!0}:{label:s||a?_l:ha}},z:{...zi(c),...t?{label:"Z",color:2920447,line:!0}:{label:s?ha:a?gl:_l}},nx:{...zi(h),label:t?"":a?ua:vl},ny:{...zi(h),label:t?"":s||a?yl:ua},nz:{...zi(h),label:t?"":s?ua:a?vl:yl}};return xl(r,u),ju.forEach(d=>xl(r[`n${d}`],zi(r[d]))),{...r,isSphere:t}};function xl(r,...e){if(r instanceof HTMLElement||typeof r!="object"||r===null)return r;for(const t of e)for(const n in t)n!=="container"&&n in t&&(r[n]===void 0?r[n]=t[n]:typeof t[n]=="object"&&!Array.isArray(t[n])&&(r[n]=xl(r[n]||{},t[n])));return r}const m3=(r,e=2)=>{const t=new ot,n=e*2,{isSphere:i,resolution:s,radius:a,font:o,corners:l,edges:c}=r,h=ls.map(T=>({...r[T],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const u=document.createElement("canvas"),d=u.getContext("2d");u.width=s*2+n*2,u.height=s*h.length+n*h.length;const[f,m]=U(h,s,o);h.forEach(({radius:T,label:L,color:b,labelColor:x,border:R,hover:{color:B,labelColor:V,border:W}},ee)=>{const k=s*ee+ee*n+e;v(e,k,e,s,T,L,R,b,x),v(s+e*3,k,e,s,T,L,W??R,B??b,V??x)});const _=h.length,g=e/(s*2),p=e/(s*6),S=1/_,E=new Dp(u);return E.repeat.set(.5-2*g,S-2*p),E.offset.set(g,1-p),Object.assign(E,{colorSpace:Tt,wrapS:$n,wrapT:$n,userData:{offsetX:g,offsetY:p,cellHeight:S}}),E;function v(T,L,b,x,R,B,V,W,ee){if(R=R*(x/2),W!=null&&W!==""&&(k(),d.fillStyle=t.set(W).getStyle(),d.fill()),V&&V.size){const Q=V.size*x/2;T+=Q,L+=Q,x-=V.size*x,R=Math.max(0,R-Q),k(),d.strokeStyle=t.set(V.color).getStyle(),d.lineWidth=V.size*x,d.stroke()}B&&C(d,T+x/2,L+(x+b)/2,B,t.set(ee).getStyle());function k(){d.beginPath(),d.moveTo(T+R,L),d.lineTo(T+x-R,L),d.arcTo(T+x,L,T+x,L+R,R),d.lineTo(T+x,L+x-R),d.arcTo(T+x,L+x,T+x-R,L+x,R),d.lineTo(T+R,L+x),d.arcTo(T,L+x,T,L+x-R,R),d.lineTo(T,L+R),d.arcTo(T,L,T+R,L,R),d.closePath()}}function U(T,L,b){const x=[...T].sort((ye,le)=>{var Le,we;return(((Le=ye.label)==null?void 0:Le.length)||0)-(((we=le.label)==null?void 0:we.length)||0)}).pop().label,{family:R,weight:B}=b,V=i?Math.sqrt(Math.pow(L*.7,2)/2):L;let W=V,ee=0,k=0;do{d.font=`${B} ${W}px ${R}`;const ye=d.measureText(x);ee=ye.width,k=ye.fontBoundingBoxDescent,W--}while(ee>V&&W>0);const Q=V/k,q=Math.min(V/ee,Q),he=Math.floor(W*q);return[`${B} ${he}px ${R}`,Q]}function C(T,L,b,x,R){T.font=f,T.textAlign="center",T.textBaseline="middle",T.fillStyle=R,T.fillText(x,L,b+(i?m:0))}},g3=(r,e)=>r.offset.x=(e?.5:0)+r.userData.offsetX,Jl=(r,e)=>{const{offset:t,userData:{offsetY:n,cellHeight:i}}=r;t.y=1-(e+1)*i+n};function Kl(r,e,t=2,n=2){const i=t/2-r,s=n/2-r,a=r/t,o=(t-r)/t,l=r/n,c=(n-r)/n,h=[i,s,0,-i,s,0,-i,-s,0,i,-s,0],u=[o,c,a,c,a,l,o,l],d=[3*(e+1)+3,3*(e+1)+4,e+4,e+5,2*(e+1)+4,2,1,2*(e+1)+3,3,4*(e+1)+3,4,0],f=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11].map(C=>d[C]);let m,_,g,p,S,E,v,U;for(let C=0;C<4;C++){p=C<1||C>2?i:-i,S=C<2?s:-s,E=C<1||C>2?o:a,v=C<2?c:l;for(let T=0;T<=e;T++)m=Math.PI/2*(C+T/e),_=Math.cos(m),g=Math.sin(m),h.push(p+r*_,S+r*g,0),u.push(E+a*_,v+l*g),T<e&&(U=(e+1)*C+T+4,f.push(C,U,U+1))}return new Bt().setIndex(new Gt(new Uint32Array(f),1)).setAttribute("position",new Gt(new Float32Array(h),3)).setAttribute("uv",new Gt(new Float32Array(u),2))}const _3=(r,e)=>{const t=new F,{isSphere:n,radius:i,smoothness:s}=r,a=Kl(i,s);return ls.map((o,l)=>{const c=l<3,h=ls[l],u=l?e.clone():e;Jl(u,l);const{enabled:d,scale:f,opacity:m,hover:_}=r[h],g={map:u,opacity:m,transparent:!0},p=n?new zl(new Ea(g)):new Rt(a,new Ri(g)),S=c?h:h[1];return p.position[S]=(c?1:-1)*(n?Yu:1),n||p.lookAt(t.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(f),p.renderOrder=1,p.visible=d,p.userData={scale:f,opacity:m,hover:_},p})},v3=(r,e)=>{const{isSphere:t,corners:n}=r;if(!n.enabled)return[];const{color:i,opacity:s,scale:a,radius:o,smoothness:l,hover:c}=n,h=t?null:Kl(o,l),u={transparent:!0,opacity:s},d=[1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1].map(m=>m*.85),f=new F;return Array(d.length/3).fill(0).map((m,_)=>{if(t){const S=e.clone();Jl(S,6),u.map=S}else u.color=i;const g=t?new zl(new Ea(u)):new Rt(h,new Ri(u)),p=_*3;return g.position.set(d[p],d[p+1],d[p+2]),t&&g.position.normalize().multiplyScalar(1.7),g.scale.setScalar(a),g.lookAt(f.copy(g.position).multiplyScalar(2)),g.renderOrder=1,g.userData={color:i,opacity:s,scale:a,hover:c},g})},y3=(r,e,t)=>{const{isSphere:n,edges:i}=r;if(!i.enabled)return[];const{color:s,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,u=n?null:Kl(c,h,1.2,.25),d={transparent:!0,opacity:a},f=[0,1,1,0,-1,1,1,0,1,-1,0,1,0,1,-1,0,-1,-1,1,0,-1,-1,0,-1,1,1,0,1,-1,0,-1,1,0,-1,-1,0].map(g=>g*.925),m=new F,_=new F(0,1,0);return Array(f.length/3).fill(0).map((g,p)=>{if(n){const v=e.clone();Jl(v,t),d.map=v}else d.color=s;const S=n?new zl(new Ea(d)):new Rt(u,new Ri(d)),E=p*3;return S.position.set(f[E],f[E+1],f[E+2]),n&&S.position.normalize().multiplyScalar(1.7),S.scale.setScalar(o),S.up.copy(_),S.lookAt(m.copy(S.position).multiplyScalar(2)),!n&&!S.position.y&&(S.rotation.z=Math.PI/2),S.renderOrder=1,S.userData={color:s,opacity:a,scale:o,hover:l},S})};function x3(r,e=!1){const t=r[0].index!==null,n=new Set(Object.keys(r[0].attributes)),i=new Set(Object.keys(r[0].morphAttributes)),s={},a={},o=r[0].morphTargetsRelative,l=new Bt;let c=0;for(let h=0;h<r.length;++h){const u=r[h];let d=0;if(t!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const f in u.attributes){if(!n.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;s[f]===void 0&&(s[f]=[]),s[f].push(u.attributes[f]),d++}if(d!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const f in u.morphAttributes){if(!i.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[f]===void 0&&(a[f]=[]),a[f].push(u.morphAttributes[f])}if(e){let f;if(t)f=u.index.count;else if(u.attributes.position!==void 0)f=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,f,h),c+=f}}if(t){let h=0;const u=[];for(let d=0;d<r.length;++d){const f=r[d].index;for(let m=0;m<f.count;++m)u.push(f.getX(m)+h);h+=r[d].attributes.position.count}l.setIndex(u)}for(const h in s){const u=Nh(s[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,u)}for(const h in a){const u=a[h][0].length;if(u===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let d=0;d<u;++d){const f=[];for(let _=0;_<a[h].length;++_)f.push(a[h][_][d]);const m=Nh(f);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(m)}}return l}function Nh(r){let e,t,n,i=-1,s=0;for(let c=0;c<r.length;++c){const h=r[c];if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=h.itemSize),t!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=h.count*t}const a=new e(s),o=new Gt(a,t,n);let l=0;for(let c=0;c<r.length;++c){const h=r[c];if(h.isInterleavedBufferAttribute){const u=l/t;for(let d=0,f=h.count;d<f;d++)for(let m=0;m<t;m++){const _=h.getComponent(d,m);o.setComponent(d+u,m,_)}}else a.set(h.array,l);l+=h.count*t}return i!==void 0&&(o.gpuType=i),o}const M3=(r,e)=>{const{isSphere:t,background:{enabled:n,color:i,opacity:s,hover:a}}=e;let o;const l=new Ri({color:i,side:vn,opacity:s,transparent:!0,depthWrite:!1});if(!n)return null;if(t)o=new Rt(new Aa(1.8,64,64),l);else{let c;r.forEach(h=>{const u=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const d=h.geometry.clone();d.applyMatrix4(h.matrix),c=c?x3([c,d]):d,h.scale.setScalar(u)}),o=new Rt(c,l)}return o.userData={color:i,opacity:s,hover:a},o},Fh=new ei,$s=new F;class $u extends p0{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new mt(e,3)),this.setAttribute("uv",new mt(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new dl(t,6,1);return this.setAttribute("instanceStart",new Zn(n,3,0)),this.setAttribute("instanceEnd",new Zn(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new dl(t,6,1);return this.setAttribute("instanceColorStart",new Zn(n,3,0)),this.setAttribute("instanceColorEnd",new Zn(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new qp(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ei);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Fh.setFromBufferAttribute(t),this.boundingBox.union(Fh))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new mi),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)$s.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared($s)),$s.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared($s));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}Ne.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Xe(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};bn.line={uniforms:Fl.merge([Ne.common,Ne.fog,Ne.line]),vertexShader:`
3827
+ }`;class Zg{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new cn,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new pi({vertexShader:Jg,fragmentShader:Kg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Rt(new us(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Qg extends $i{constructor(e,t){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,f=null,m=null;const _=new Zg,g=t.getContextAttributes();let p=null,S=null;const E=[],v=[],U=new Xe;let C=null;const T=new ln;T.viewport=new Mt;const L=new ln;L.viewport=new Mt;const b=[T,L],x=new m0;let R=null,B=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let re=E[Y];return re===void 0&&(re=new Qa,E[Y]=re),re.getTargetRaySpace()},this.getControllerGrip=function(Y){let re=E[Y];return re===void 0&&(re=new Qa,E[Y]=re),re.getGripSpace()},this.getHand=function(Y){let re=E[Y];return re===void 0&&(re=new Qa,E[Y]=re),re.getHandSpace()};function V(Y){const re=v.indexOf(Y.inputSource);if(re===-1)return;const ae=E[re];ae!==void 0&&(ae.update(Y.inputSource,Y.frame,c||a),ae.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){i.removeEventListener("select",V),i.removeEventListener("selectstart",V),i.removeEventListener("selectend",V),i.removeEventListener("squeeze",V),i.removeEventListener("squeezestart",V),i.removeEventListener("squeezeend",V),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",ee);for(let Y=0;Y<E.length;Y++){const re=v[Y];re!==null&&(v[Y]=null,E[Y].disconnect(re))}R=null,B=null,_.reset(),e.setRenderTarget(p),f=null,d=null,u=null,i=null,S=null,Te.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(U.width,U.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){o=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(Y){if(i=Y,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",V),i.addEventListener("selectstart",V),i.addEventListener("selectend",V),i.addEventListener("squeeze",V),i.addEventListener("squeezestart",V),i.addEventListener("squeezeend",V),i.addEventListener("end",W),i.addEventListener("inputsourceschange",ee),g.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(U),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let ae=null,oe=null,Ee=null;g.depth&&(Ee=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ae=g.stencil?as:ss,oe=g.stencil?rs:qi);const _e={colorFormat:t.RGBA8,depthFormat:Ee,scaleFactor:s};u=new XRWebGLBinding(i,t),d=u.createProjectionLayer(_e),i.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),S=new ji(d.textureWidth,d.textureHeight,{format:Un,type:Qn,depthTexture:new Pu(d.textureWidth,d.textureHeight,oe,void 0,void 0,void 0,void 0,void 0,void 0,ae),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const ae={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,t,ae),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),S=new ji(f.framebufferWidth,f.framebufferHeight,{format:Un,type:Qn,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Te.setContext(i),Te.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function ee(Y){for(let re=0;re<Y.removed.length;re++){const ae=Y.removed[re],oe=v.indexOf(ae);oe>=0&&(v[oe]=null,E[oe].disconnect(ae))}for(let re=0;re<Y.added.length;re++){const ae=Y.added[re];let oe=v.indexOf(ae);if(oe===-1){for(let _e=0;_e<E.length;_e++)if(_e>=v.length){v.push(ae),oe=_e;break}else if(v[_e]===null){v[_e]=ae,oe=_e;break}if(oe===-1)break}const Ee=E[oe];Ee&&Ee.connect(ae)}}const k=new F,Q=new F;function q(Y,re,ae){k.setFromMatrixPosition(re.matrixWorld),Q.setFromMatrixPosition(ae.matrixWorld);const oe=k.distanceTo(Q),Ee=re.projectionMatrix.elements,_e=ae.projectionMatrix.elements,we=Ee[14]/(Ee[10]-1),ke=Ee[14]/(Ee[10]+1),tt=(Ee[9]+1)/Ee[5],Qe=(Ee[9]-1)/Ee[5],O=(Ee[8]-1)/Ee[0],bt=(_e[8]+1)/_e[0],$=we*O,pe=we*bt,te=oe/(-O+bt),Se=te*-O;if(re.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Se),Y.translateZ(te),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Ee[10]===-1)Y.projectionMatrix.copy(re.projectionMatrix),Y.projectionMatrixInverse.copy(re.projectionMatrixInverse);else{const he=we+te,ce=ke+te,Fe=$-Se,N=pe+(oe-Se),A=tt*ke/ce*he,G=Qe*ke/ce*he;Y.projectionMatrix.makePerspective(Fe,N,A,G,he,ce),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function ue(Y,re){re===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(re.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;let re=Y.near,ae=Y.far;_.texture!==null&&(_.depthNear>0&&(re=_.depthNear),_.depthFar>0&&(ae=_.depthFar)),x.near=L.near=T.near=re,x.far=L.far=T.far=ae,(R!==x.near||B!==x.far)&&(i.updateRenderState({depthNear:x.near,depthFar:x.far}),R=x.near,B=x.far),T.layers.mask=Y.layers.mask|2,L.layers.mask=Y.layers.mask|4,x.layers.mask=T.layers.mask|L.layers.mask;const oe=Y.parent,Ee=x.cameras;ue(x,oe);for(let _e=0;_e<Ee.length;_e++)ue(Ee[_e],oe);Ee.length===2?q(x,T,L):x.projectionMatrix.copy(T.projectionMatrix),ye(Y,x,oe)};function ye(Y,re,ae){ae===null?Y.matrix.copy(re.matrixWorld):(Y.matrix.copy(ae.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(re.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(re.projectionMatrix),Y.projectionMatrixInverse.copy(re.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=Pr*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return x},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(Y){l=Y,d!==null&&(d.fixedFoveation=Y),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Y)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(x)};let le=null;function Pe(Y,re){if(h=re.getViewerPose(c||a),m=re,h!==null){const ae=h.views;f!==null&&(e.setRenderTargetFramebuffer(S,f.framebuffer),e.setRenderTarget(S));let oe=!1;ae.length!==x.cameras.length&&(x.cameras.length=0,oe=!0);for(let we=0;we<ae.length;we++){const ke=ae[we];let tt=null;if(f!==null)tt=f.getViewport(ke);else{const O=u.getViewSubImage(d,ke);tt=O.viewport,we===0&&(e.setRenderTargetTextures(S,O.colorTexture,O.depthStencilTexture),e.setRenderTarget(S))}let Qe=b[we];Qe===void 0&&(Qe=new ln,Qe.layers.enable(we),Qe.viewport=new Mt,b[we]=Qe),Qe.matrix.fromArray(ke.transform.matrix),Qe.matrix.decompose(Qe.position,Qe.quaternion,Qe.scale),Qe.projectionMatrix.fromArray(ke.projectionMatrix),Qe.projectionMatrixInverse.copy(Qe.projectionMatrix).invert(),Qe.viewport.set(tt.x,tt.y,tt.width,tt.height),we===0&&(x.matrix.copy(Qe.matrix),x.matrix.decompose(x.position,x.quaternion,x.scale)),oe===!0&&x.cameras.push(Qe)}const Ee=i.enabledFeatures;if(Ee&&Ee.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&u){const we=u.getDepthInformation(ae[0]);we&&we.isValid&&we.texture&&_.init(e,we,i.renderState)}}for(let ae=0;ae<E.length;ae++){const oe=v[ae],Ee=E[ae];oe!==null&&Ee!==void 0&&Ee.update(oe,re,c||a)}le&&le(Y,re),re.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:re}),m=null}const Te=new Vu;Te.setAnimationLoop(Pe),this.setAnimationLoop=function(Y){le=Y},this.dispose=function(){}}}const Oi=new Sn,e3=new lt;function t3(r,e){function t(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,Eu(r)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,S,E,v){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(g,p):p.isMeshToonMaterial?(s(g,p),u(g,p)):p.isMeshPhongMaterial?(s(g,p),h(g,p)):p.isMeshStandardMaterial?(s(g,p),d(g,p),p.isMeshPhysicalMaterial&&f(g,p,v)):p.isMeshMatcapMaterial?(s(g,p),m(g,p)):p.isMeshDepthMaterial?s(g,p):p.isMeshDistanceMaterial?(s(g,p),_(g,p)):p.isMeshNormalMaterial?s(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,S,E):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,t(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===vn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,t(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===vn&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,t(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,t(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const S=e.get(p),E=S.envMap,v=S.envMapRotation;E&&(g.envMap.value=E,Oi.copy(v),Oi.x*=-1,Oi.y*=-1,Oi.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Oi.y*=-1,Oi.z*=-1),g.envMapRotation.value.setFromMatrix4(e3.makeRotationFromEuler(Oi)),g.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform))}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,S,E){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*S,g.scale.value=E*.5,p.map&&(g.map.value=p.map,t(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,S){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===vn&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=S.texture,g.transmissionSamplerSize.value.set(S.width,S.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const S=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(S.matrixWorld),g.nearDistance.value=S.shadow.camera.near,g.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function n3(r,e,t,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,E){const v=E.program;n.uniformBlockBinding(S,v)}function c(S,E){let v=i[S.id];v===void 0&&(m(S),v=h(S),i[S.id]=v,S.addEventListener("dispose",g));const U=E.program;n.updateUBOMapping(S,U);const C=e.render.frame;s[S.id]!==C&&(d(S),s[S.id]=C)}function h(S){const E=u();S.__bindingPointIndex=E;const v=r.createBuffer(),U=S.__size,C=S.usage;return r.bindBuffer(r.UNIFORM_BUFFER,v),r.bufferData(r.UNIFORM_BUFFER,U,C),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,E,v),v}function u(){for(let S=0;S<o;S++)if(a.indexOf(S)===-1)return a.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(S){const E=i[S.id],v=S.uniforms,U=S.__cache;r.bindBuffer(r.UNIFORM_BUFFER,E);for(let C=0,T=v.length;C<T;C++){const L=Array.isArray(v[C])?v[C]:[v[C]];for(let b=0,x=L.length;b<x;b++){const R=L[b];if(f(R,C,b,U)===!0){const B=R.__offset,V=Array.isArray(R.value)?R.value:[R.value];let W=0;for(let ee=0;ee<V.length;ee++){const k=V[ee],Q=_(k);typeof k=="number"||typeof k=="boolean"?(R.__data[0]=k,r.bufferSubData(r.UNIFORM_BUFFER,B+W,R.__data)):k.isMatrix3?(R.__data[0]=k.elements[0],R.__data[1]=k.elements[1],R.__data[2]=k.elements[2],R.__data[3]=0,R.__data[4]=k.elements[3],R.__data[5]=k.elements[4],R.__data[6]=k.elements[5],R.__data[7]=0,R.__data[8]=k.elements[6],R.__data[9]=k.elements[7],R.__data[10]=k.elements[8],R.__data[11]=0):(k.toArray(R.__data,W),W+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,B,R.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function f(S,E,v,U){const C=S.value,T=E+"_"+v;if(U[T]===void 0)return typeof C=="number"||typeof C=="boolean"?U[T]=C:U[T]=C.clone(),!0;{const L=U[T];if(typeof C=="number"||typeof C=="boolean"){if(L!==C)return U[T]=C,!0}else if(L.equals(C)===!1)return L.copy(C),!0}return!1}function m(S){const E=S.uniforms;let v=0;const U=16;for(let T=0,L=E.length;T<L;T++){const b=Array.isArray(E[T])?E[T]:[E[T]];for(let x=0,R=b.length;x<R;x++){const B=b[x],V=Array.isArray(B.value)?B.value:[B.value];for(let W=0,ee=V.length;W<ee;W++){const k=V[W],Q=_(k),q=v%U,ue=q%Q.boundary,ye=q+ue;v+=ue,ye!==0&&U-ye<Q.storage&&(v+=U-ye),B.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),B.__offset=v,v+=Q.storage}}}const C=v%U;return C>0&&(v+=U-C),S.__size=v,S.__cache={},this}function _(S){const E={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(E.boundary=4,E.storage=4):S.isVector2?(E.boundary=8,E.storage=8):S.isVector3||S.isColor?(E.boundary=16,E.storage=12):S.isVector4?(E.boundary=16,E.storage=16):S.isMatrix3?(E.boundary=48,E.storage=48):S.isMatrix4?(E.boundary=64,E.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),E}function g(S){const E=S.target;E.removeEventListener("dispose",g);const v=a.indexOf(E.__bindingPointIndex);a.splice(v,1),r.deleteBuffer(i[E.id]),delete i[E.id],delete s[E.id]}function p(){for(const S in i)r.deleteBuffer(i[S]);a=[],i={},s={}}return{bind:l,update:c,dispose:p}}class i3{constructor(e={}){const{canvas:t=Jf(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const S=[],E=[];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=Ti,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let U=!1;this._outputColorSpace=Tt;let C=0,T=0,L=null,b=-1,x=null;const R=new Mt,B=new Mt;let V=null;const W=new ot(0);let ee=0,k=t.width,Q=t.height,q=1,ue=null,ye=null;const le=new Mt(0,0,k,Q),Pe=new Mt(0,0,k,Q);let Te=!1;const Y=new kl;let re=!1,ae=!1;const oe=new lt,Ee=new lt,_e=new F,we=new Mt,ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let tt=!1;function Qe(){return L===null?q:1}let O=n;function bt(D,X){return t.getContext(D,X)}try{const D={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Al}`),t.addEventListener("webglcontextlost",He,!1),t.addEventListener("webglcontextrestored",Me,!1),t.addEventListener("webglcontextcreationerror",ge,!1),O===null){const X="webgl2";if(O=bt(X,D),O===null)throw bt(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let $,pe,te,Se,he,ce,Fe,N,A,G,z,se,ne,Ce,Ae,Be,Ve,me,De,Je,nt,Le,ct,H;function Ne(){$=new f2(O),$.init(),Le=new $g(O,$),pe=new a2(O,$,e,Le),te=new jg(O,$),pe.reverseDepthBuffer&&d&&te.buffers.depth.setReversed(!0),Se=new g2(O),he=new Ug,ce=new Yg(O,$,te,he,pe,Le,Se),Fe=new l2(v),N=new d2(v),A=new b0(O),ct=new r2(O,A),G=new p2(O,A,Se,ct),z=new v2(O,G,A,Se),De=new _2(O,pe,ce),Be=new o2(he),se=new Ig(v,Fe,N,$,pe,ct,Be),ne=new t3(v,he),Ce=new Fg,Ae=new Hg($),me=new i2(v,Fe,N,te,z,f,l),Ve=new Xg(v,z,pe),H=new n3(O,Se,pe,te),Je=new s2(O,$,Se),nt=new m2(O,$,Se),Se.programs=se.programs,v.capabilities=pe,v.extensions=$,v.properties=he,v.renderLists=Ce,v.shadowMap=Ve,v.state=te,v.info=Se}Ne();const ve=new Qg(v,O);this.xr=ve,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){const D=$.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){const D=$.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(D){D!==void 0&&(q=D,this.setSize(k,Q,!1))},this.getSize=function(D){return D.set(k,Q)},this.setSize=function(D,X,J=!0){if(ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}k=D,Q=X,t.width=Math.floor(D*q),t.height=Math.floor(X*q),J===!0&&(t.style.width=D+"px",t.style.height=X+"px"),this.setViewport(0,0,D,X)},this.getDrawingBufferSize=function(D){return D.set(k*q,Q*q).floor()},this.setDrawingBufferSize=function(D,X,J){k=D,Q=X,q=J,t.width=Math.floor(D*J),t.height=Math.floor(X*J),this.setViewport(0,0,D,X)},this.getCurrentViewport=function(D){return D.copy(R)},this.getViewport=function(D){return D.copy(le)},this.setViewport=function(D,X,J,Z){D.isVector4?le.set(D.x,D.y,D.z,D.w):le.set(D,X,J,Z),te.viewport(R.copy(le).multiplyScalar(q).round())},this.getScissor=function(D){return D.copy(Pe)},this.setScissor=function(D,X,J,Z){D.isVector4?Pe.set(D.x,D.y,D.z,D.w):Pe.set(D,X,J,Z),te.scissor(B.copy(Pe).multiplyScalar(q).round())},this.getScissorTest=function(){return Te},this.setScissorTest=function(D){te.setScissorTest(Te=D)},this.setOpaqueSort=function(D){ue=D},this.setTransparentSort=function(D){ye=D},this.getClearColor=function(D){return D.copy(me.getClearColor())},this.setClearColor=function(){me.setClearColor(...arguments)},this.getClearAlpha=function(){return me.getClearAlpha()},this.setClearAlpha=function(){me.setClearAlpha(...arguments)},this.clear=function(D=!0,X=!0,J=!0){let Z=0;if(D){let j=!1;if(L!==null){const be=L.texture.format;j=be===Pl||be===Dl||be===Rl}if(j){const be=L.texture.type,Oe=be===Qn||be===qi||be===is||be===rs||be===Tl||be===Cl,Ye=me.getClearColor(),Ge=me.getClearAlpha(),ut=Ye.r,dt=Ye.g,et=Ye.b;Oe?(m[0]=ut,m[1]=dt,m[2]=et,m[3]=Ge,O.clearBufferuiv(O.COLOR,0,m)):(_[0]=ut,_[1]=dt,_[2]=et,_[3]=Ge,O.clearBufferiv(O.COLOR,0,_))}else Z|=O.COLOR_BUFFER_BIT}X&&(Z|=O.DEPTH_BUFFER_BIT),J&&(Z|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(Z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",He,!1),t.removeEventListener("webglcontextrestored",Me,!1),t.removeEventListener("webglcontextcreationerror",ge,!1),me.dispose(),Ce.dispose(),Ae.dispose(),he.dispose(),Fe.dispose(),N.dispose(),z.dispose(),ct.dispose(),H.dispose(),se.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Zt),ve.removeEventListener("sessionend",jt),tn.stop()};function He(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const D=Se.autoReset,X=Ve.enabled,J=Ve.autoUpdate,Z=Ve.needsUpdate,j=Ve.type;Ne(),Se.autoReset=D,Ve.enabled=X,Ve.autoUpdate=J,Ve.needsUpdate=Z,Ve.type=j}function ge(D){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",D.statusMessage)}function qe(D){const X=D.target;X.removeEventListener("dispose",qe),ht(X)}function ht(D){Dt(D),he.remove(D)}function Dt(D){const X=he.get(D).programs;X!==void 0&&(X.forEach(function(J){se.releaseProgram(J)}),D.isShaderMaterial&&se.releaseShaderCache(D))}this.renderBufferDirect=function(D,X,J,Z,j,be){X===null&&(X=ke);const Oe=j.isMesh&&j.matrixWorld.determinant()<0,Ye=En(D,X,J,Z,j);te.setMaterial(Z,Oe);let Ge=J.index,ut=1;if(Z.wireframe===!0){if(Ge=G.getWireframeAttribute(J),Ge===void 0)return;ut=2}const dt=J.drawRange,et=J.attributes.position;let gt=dt.start*ut,Ct=(dt.start+dt.count)*ut;be!==null&&(gt=Math.max(gt,be.start*ut),Ct=Math.min(Ct,(be.start+be.count)*ut)),Ge!==null?(gt=Math.max(gt,0),Ct=Math.min(Ct,Ge.count)):et!=null&&(gt=Math.max(gt,0),Ct=Math.min(Ct,et.count));const Ot=Ct-gt;if(Ot<0||Ot===1/0)return;ct.setup(j,Z,Ye,J,Ge);let kt,St=Je;if(Ge!==null&&(kt=A.get(Ge),St=nt,St.setIndex(kt)),j.isMesh)Z.wireframe===!0?(te.setLineWidth(Z.wireframeLinewidth*Qe()),St.setMode(O.LINES)):St.setMode(O.TRIANGLES);else if(j.isLine){let st=Z.linewidth;st===void 0&&(st=1),te.setLineWidth(st*Qe()),j.isLineSegments?St.setMode(O.LINES):j.isLineLoop?St.setMode(O.LINE_LOOP):St.setMode(O.LINE_STRIP)}else j.isPoints?St.setMode(O.POINTS):j.isSprite&&St.setMode(O.TRIANGLES);if(j.isBatchedMesh)if(j._multiDrawInstances!==null)Ar("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),St.renderMultiDrawInstances(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount,j._multiDrawInstances);else if($.get("WEBGL_multi_draw"))St.renderMultiDraw(j._multiDrawStarts,j._multiDrawCounts,j._multiDrawCount);else{const st=j._multiDrawStarts,Yt=j._multiDrawCounts,Et=j._multiDrawCount,yn=Ge?A.get(Ge).bytesPerElement:1,zt=he.get(Z).currentProgram.getUniforms();for(let rn=0;rn<Et;rn++)zt.setValue(O,"_gl_DrawID",rn),St.render(st[rn]/yn,Yt[rn])}else if(j.isInstancedMesh)St.renderInstances(gt,Ot,j.count);else if(J.isInstancedBufferGeometry){const st=J._maxInstanceCount!==void 0?J._maxInstanceCount:1/0,Yt=Math.min(J.instanceCount,st);St.renderInstances(gt,Ot,Yt)}else St.render(gt,Ot)};function pt(D,X,J){D.transparent===!0&&D.side===pn&&D.forceSinglePass===!1?(D.side=vn,D.needsUpdate=!0,nn(D,X,J),D.side=Hn,D.needsUpdate=!0,nn(D,X,J),D.side=pn):nn(D,X,J)}this.compile=function(D,X,J=null){J===null&&(J=D),p=Ae.get(J),p.init(X),E.push(p),J.traverseVisible(function(j){j.isLight&&j.layers.test(X.layers)&&(p.pushLight(j),j.castShadow&&p.pushShadow(j))}),D!==J&&D.traverseVisible(function(j){j.isLight&&j.layers.test(X.layers)&&(p.pushLight(j),j.castShadow&&p.pushShadow(j))}),p.setupLights();const Z=new Set;return D.traverse(function(j){if(!(j.isMesh||j.isPoints||j.isLine||j.isSprite))return;const be=j.material;if(be)if(Array.isArray(be))for(let Oe=0;Oe<be.length;Oe++){const Ye=be[Oe];pt(Ye,J,j),Z.add(Ye)}else pt(be,J,j),Z.add(be)}),p=E.pop(),Z},this.compileAsync=function(D,X,J=null){const Z=this.compile(D,X,J);return new Promise(j=>{function be(){if(Z.forEach(function(Oe){he.get(Oe).currentProgram.isReady()&&Z.delete(Oe)}),Z.size===0){j(D);return}setTimeout(be,10)}$.get("KHR_parallel_shader_compile")!==null?be():setTimeout(be,10)})};let en=null;function je(D){en&&en(D)}function Zt(){tn.stop()}function jt(){tn.start()}const tn=new Vu;tn.setAnimationLoop(je),typeof self<"u"&&tn.setContext(self),this.setAnimationLoop=function(D){en=D,ve.setAnimationLoop(D),D===null?tn.stop():tn.start()},ve.addEventListener("sessionstart",Zt),ve.addEventListener("sessionend",jt),this.render=function(D,X){if(X!==void 0&&X.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),ve.enabled===!0&&ve.isPresenting===!0&&(ve.cameraAutoUpdate===!0&&ve.updateCamera(X),X=ve.getCamera()),D.isScene===!0&&D.onBeforeRender(v,D,X,L),p=Ae.get(D,E.length),p.init(X),E.push(p),Ee.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),Y.setFromProjectionMatrix(Ee),ae=this.localClippingEnabled,re=Be.init(this.clippingPlanes,ae),g=Ce.get(D,S.length),g.init(),S.push(g),ve.enabled===!0&&ve.isPresenting===!0){const be=v.xr.getDepthSensingMesh();be!==null&&Di(be,X,-1/0,v.sortObjects)}Di(D,X,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(ue,ye),tt=ve.enabled===!1||ve.isPresenting===!1||ve.hasDepthSensing()===!1,tt&&me.addToRenderList(g,D),this.info.render.frame++,re===!0&&Be.beginShadows();const J=p.state.shadowsArray;Ve.render(J,D,X),re===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset();const Z=g.opaque,j=g.transmissive;if(p.setupLights(),X.isArrayCamera){const be=X.cameras;if(j.length>0)for(let Oe=0,Ye=be.length;Oe<Ye;Oe++){const Ge=be[Oe];rt(Z,j,D,Ge)}tt&&me.render(D);for(let Oe=0,Ye=be.length;Oe<Ye;Oe++){const Ge=be[Oe];ti(g,D,Ge,Ge.viewport)}}else j.length>0&&rt(Z,j,D,X),tt&&me.render(D),ti(g,D,X);L!==null&&T===0&&(ce.updateMultisampleRenderTarget(L),ce.updateRenderTargetMipmap(L)),D.isScene===!0&&D.onAfterRender(v,D,X),ct.resetDefaultState(),b=-1,x=null,E.pop(),E.length>0?(p=E[E.length-1],re===!0&&Be.setGlobalState(v.clippingPlanes,p.state.camera)):p=null,S.pop(),S.length>0?g=S[S.length-1]:g=null};function Di(D,X,J,Z){if(D.visible===!1)return;if(D.layers.test(X.layers)){if(D.isGroup)J=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(X);else if(D.isLight)p.pushLight(D),D.castShadow&&p.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||Y.intersectsSprite(D)){Z&&we.setFromMatrixPosition(D.matrixWorld).applyMatrix4(Ee);const Oe=z.update(D),Ye=D.material;Ye.visible&&g.push(D,Oe,Ye,J,we.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(!D.frustumCulled||Y.intersectsObject(D))){const Oe=z.update(D),Ye=D.material;if(Z&&(D.boundingSphere!==void 0?(D.boundingSphere===null&&D.computeBoundingSphere(),we.copy(D.boundingSphere.center)):(Oe.boundingSphere===null&&Oe.computeBoundingSphere(),we.copy(Oe.boundingSphere.center)),we.applyMatrix4(D.matrixWorld).applyMatrix4(Ee)),Array.isArray(Ye)){const Ge=Oe.groups;for(let ut=0,dt=Ge.length;ut<dt;ut++){const et=Ge[ut],gt=Ye[et.materialIndex];gt&&gt.visible&&g.push(D,Oe,gt,J,we.z,et)}}else Ye.visible&&g.push(D,Oe,Ye,J,we.z,null)}}const be=D.children;for(let Oe=0,Ye=be.length;Oe<Ye;Oe++)Di(be[Oe],X,J,Z)}function ti(D,X,J,Z){const j=D.opaque,be=D.transmissive,Oe=D.transparent;p.setupLightsView(J),re===!0&&Be.setGlobalState(v.clippingPlanes,J),Z&&te.viewport(R.copy(Z)),j.length>0&&Re(j,X,J),be.length>0&&Re(be,X,J),Oe.length>0&&Re(Oe,X,J),te.buffers.depth.setTest(!0),te.buffers.depth.setMask(!0),te.buffers.color.setMask(!0),te.setPolygonOffset(!1)}function rt(D,X,J,Z){if((J.isScene===!0?J.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[Z.id]===void 0&&(p.state.transmissionRenderTarget[Z.id]=new ji(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?hs:Qn,minFilter:ui,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:xt.workingColorSpace}));const be=p.state.transmissionRenderTarget[Z.id],Oe=Z.viewport||R;be.setSize(Oe.z*v.transmissionResolutionScale,Oe.w*v.transmissionResolutionScale);const Ye=v.getRenderTarget();v.setRenderTarget(be),v.getClearColor(W),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),tt&&me.render(J);const Ge=v.toneMapping;v.toneMapping=Ti;const ut=Z.viewport;if(Z.viewport!==void 0&&(Z.viewport=void 0),p.setupLightsView(Z),re===!0&&Be.setGlobalState(v.clippingPlanes,Z),Re(D,J,Z),ce.updateMultisampleRenderTarget(be),ce.updateRenderTargetMipmap(be),$.has("WEBGL_multisampled_render_to_texture")===!1){let dt=!1;for(let et=0,gt=X.length;et<gt;et++){const Ct=X[et],Ot=Ct.object,kt=Ct.geometry,St=Ct.material,st=Ct.group;if(St.side===pn&&Ot.layers.test(Z.layers)){const Yt=St.side;St.side=vn,St.needsUpdate=!0,Ht(Ot,J,Z,kt,St,st),St.side=Yt,St.needsUpdate=!0,dt=!0}}dt===!0&&(ce.updateMultisampleRenderTarget(be),ce.updateRenderTargetMipmap(be))}v.setRenderTarget(Ye),v.setClearColor(W,ee),ut!==void 0&&(Z.viewport=ut),v.toneMapping=Ge}function Re(D,X,J){const Z=X.isScene===!0?X.overrideMaterial:null;for(let j=0,be=D.length;j<be;j++){const Oe=D[j],Ye=Oe.object,Ge=Oe.geometry,ut=Oe.group;let dt=Oe.material;dt.allowOverride===!0&&Z!==null&&(dt=Z),Ye.layers.test(J.layers)&&Ht(Ye,X,J,Ge,dt,ut)}}function Ht(D,X,J,Z,j,be){D.onBeforeRender(v,X,J,Z,j,be),D.modelViewMatrix.multiplyMatrices(J.matrixWorldInverse,D.matrixWorld),D.normalMatrix.getNormalMatrix(D.modelViewMatrix),j.onBeforeRender(v,X,J,Z,D,be),j.transparent===!0&&j.side===pn&&j.forceSinglePass===!1?(j.side=vn,j.needsUpdate=!0,v.renderBufferDirect(J,X,Z,j,D,be),j.side=Hn,j.needsUpdate=!0,v.renderBufferDirect(J,X,Z,j,D,be),j.side=pn):v.renderBufferDirect(J,X,Z,j,D,be),D.onAfterRender(v,X,J,Z,j,be)}function nn(D,X,J){X.isScene!==!0&&(X=ke);const Z=he.get(D),j=p.state.lights,be=p.state.shadowsArray,Oe=j.state.version,Ye=se.getParameters(D,j.state,be,X,J),Ge=se.getProgramCacheKey(Ye);let ut=Z.programs;Z.environment=D.isMeshStandardMaterial?X.environment:null,Z.fog=X.fog,Z.envMap=(D.isMeshStandardMaterial?N:Fe).get(D.envMap||Z.environment),Z.envMapRotation=Z.environment!==null&&D.envMap===null?X.environmentRotation:D.envMapRotation,ut===void 0&&(D.addEventListener("dispose",qe),ut=new Map,Z.programs=ut);let dt=ut.get(Ge);if(dt!==void 0){if(Z.currentProgram===dt&&Z.lightsStateVersion===Oe)return hn(D,Ye),dt}else Ye.uniforms=se.getUniforms(D),D.onBeforeCompile(Ye,v),dt=se.acquireProgram(Ye,Ge),ut.set(Ge,dt),Z.uniforms=Ye.uniforms;const et=Z.uniforms;return(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(et.clippingPlanes=Be.uniform),hn(D,Ye),Z.needsLights=Ki(D),Z.lightsStateVersion=Oe,Z.needsLights&&(et.ambientLightColor.value=j.state.ambient,et.lightProbe.value=j.state.probe,et.directionalLights.value=j.state.directional,et.directionalLightShadows.value=j.state.directionalShadow,et.spotLights.value=j.state.spot,et.spotLightShadows.value=j.state.spotShadow,et.rectAreaLights.value=j.state.rectArea,et.ltc_1.value=j.state.rectAreaLTC1,et.ltc_2.value=j.state.rectAreaLTC2,et.pointLights.value=j.state.point,et.pointLightShadows.value=j.state.pointShadow,et.hemisphereLights.value=j.state.hemi,et.directionalShadowMap.value=j.state.directionalShadowMap,et.directionalShadowMatrix.value=j.state.directionalShadowMatrix,et.spotShadowMap.value=j.state.spotShadowMap,et.spotLightMatrix.value=j.state.spotLightMatrix,et.spotLightMap.value=j.state.spotLightMap,et.pointShadowMap.value=j.state.pointShadowMap,et.pointShadowMatrix.value=j.state.pointShadowMatrix),Z.currentProgram=dt,Z.uniformsList=null,dt}function Wt(D){if(D.uniformsList===null){const X=D.currentProgram.getUniforms();D.uniformsList=ca.seqWithValue(X.seq,D.uniforms)}return D.uniformsList}function hn(D,X){const J=he.get(D);J.outputColorSpace=X.outputColorSpace,J.batching=X.batching,J.batchingColor=X.batchingColor,J.instancing=X.instancing,J.instancingColor=X.instancingColor,J.instancingMorph=X.instancingMorph,J.skinning=X.skinning,J.morphTargets=X.morphTargets,J.morphNormals=X.morphNormals,J.morphColors=X.morphColors,J.morphTargetsCount=X.morphTargetsCount,J.numClippingPlanes=X.numClippingPlanes,J.numIntersection=X.numClipIntersection,J.vertexAlphas=X.vertexAlphas,J.vertexTangents=X.vertexTangents,J.toneMapping=X.toneMapping}function En(D,X,J,Z,j){X.isScene!==!0&&(X=ke),ce.resetTextureUnits();const be=X.fog,Oe=Z.isMeshStandardMaterial?X.environment:null,Ye=L===null?v.outputColorSpace:L.isXRRenderTarget===!0?L.texture.colorSpace:Dr,Ge=(Z.isMeshStandardMaterial?N:Fe).get(Z.envMap||Oe),ut=Z.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,dt=!!J.attributes.tangent&&(!!Z.normalMap||Z.anisotropy>0),et=!!J.morphAttributes.position,gt=!!J.morphAttributes.normal,Ct=!!J.morphAttributes.color;let Ot=Ti;Z.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Ot=v.toneMapping);const kt=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,St=kt!==void 0?kt.length:0,st=he.get(Z),Yt=p.state.lights;if(re===!0&&(ae===!0||D!==x)){const Xt=D===x&&Z.id===b;Be.setState(Z,D,Xt)}let Et=!1;Z.version===st.__version?(st.needsLights&&st.lightsStateVersion!==Yt.state.version||st.outputColorSpace!==Ye||j.isBatchedMesh&&st.batching===!1||!j.isBatchedMesh&&st.batching===!0||j.isBatchedMesh&&st.batchingColor===!0&&j.colorTexture===null||j.isBatchedMesh&&st.batchingColor===!1&&j.colorTexture!==null||j.isInstancedMesh&&st.instancing===!1||!j.isInstancedMesh&&st.instancing===!0||j.isSkinnedMesh&&st.skinning===!1||!j.isSkinnedMesh&&st.skinning===!0||j.isInstancedMesh&&st.instancingColor===!0&&j.instanceColor===null||j.isInstancedMesh&&st.instancingColor===!1&&j.instanceColor!==null||j.isInstancedMesh&&st.instancingMorph===!0&&j.morphTexture===null||j.isInstancedMesh&&st.instancingMorph===!1&&j.morphTexture!==null||st.envMap!==Ge||Z.fog===!0&&st.fog!==be||st.numClippingPlanes!==void 0&&(st.numClippingPlanes!==Be.numPlanes||st.numIntersection!==Be.numIntersection)||st.vertexAlphas!==ut||st.vertexTangents!==dt||st.morphTargets!==et||st.morphNormals!==gt||st.morphColors!==Ct||st.toneMapping!==Ot||st.morphTargetsCount!==St)&&(Et=!0):(Et=!0,st.__version=Z.version);let yn=st.currentProgram;Et===!0&&(yn=nn(Z,X,j));let zt=!1,rn=!1,Pi=!1;const Ft=yn.getUniforms(),mn=st.uniforms;if(te.useProgram(yn.program)&&(zt=!0,rn=!0,Pi=!0),Z.id!==b&&(b=Z.id,rn=!0),zt||x!==D){te.buffers.depth.getReversed()?(oe.copy(D.projectionMatrix),Zf(oe),Qf(oe),Ft.setValue(O,"projectionMatrix",oe)):Ft.setValue(O,"projectionMatrix",D.projectionMatrix),Ft.setValue(O,"viewMatrix",D.matrixWorldInverse);const $t=Ft.map.cameraPosition;$t!==void 0&&$t.setValue(O,_e.setFromMatrixPosition(D.matrixWorld)),pe.logarithmicDepthBuffer&&Ft.setValue(O,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),(Z.isMeshPhongMaterial||Z.isMeshToonMaterial||Z.isMeshLambertMaterial||Z.isMeshBasicMaterial||Z.isMeshStandardMaterial||Z.isShaderMaterial)&&Ft.setValue(O,"isOrthographic",D.isOrthographicCamera===!0),x!==D&&(x=D,rn=!0,Pi=!0)}if(j.isSkinnedMesh){Ft.setOptional(O,j,"bindMatrix"),Ft.setOptional(O,j,"bindMatrixInverse");const Xt=j.skeleton;Xt&&(Xt.boneTexture===null&&Xt.computeBoneTexture(),Ft.setValue(O,"boneTexture",Xt.boneTexture,ce))}j.isBatchedMesh&&(Ft.setOptional(O,j,"batchingTexture"),Ft.setValue(O,"batchingTexture",j._matricesTexture,ce),Ft.setOptional(O,j,"batchingIdTexture"),Ft.setValue(O,"batchingIdTexture",j._indirectTexture,ce),Ft.setOptional(O,j,"batchingColorTexture"),j._colorsTexture!==null&&Ft.setValue(O,"batchingColorTexture",j._colorsTexture,ce));const un=J.morphAttributes;if((un.position!==void 0||un.normal!==void 0||un.color!==void 0)&&De.update(j,J,yn),(rn||st.receiveShadow!==j.receiveShadow)&&(st.receiveShadow=j.receiveShadow,Ft.setValue(O,"receiveShadow",j.receiveShadow)),Z.isMeshGouraudMaterial&&Z.envMap!==null&&(mn.envMap.value=Ge,mn.flipEnvMap.value=Ge.isCubeTexture&&Ge.isRenderTargetTexture===!1?-1:1),Z.isMeshStandardMaterial&&Z.envMap===null&&X.environment!==null&&(mn.envMapIntensity.value=X.environmentIntensity),rn&&(Ft.setValue(O,"toneMappingExposure",v.toneMappingExposure),st.needsLights&&Ji(mn,Pi),be&&Z.fog===!0&&ne.refreshFogUniforms(mn,be),ne.refreshMaterialUniforms(mn,Z,q,Q,p.state.transmissionRenderTarget[D.id]),ca.upload(O,Wt(st),mn,ce)),Z.isShaderMaterial&&Z.uniformsNeedUpdate===!0&&(ca.upload(O,Wt(st),mn,ce),Z.uniformsNeedUpdate=!1),Z.isSpriteMaterial&&Ft.setValue(O,"center",j.center),Ft.setValue(O,"modelViewMatrix",j.modelViewMatrix),Ft.setValue(O,"normalMatrix",j.normalMatrix),Ft.setValue(O,"modelMatrix",j.matrixWorld),Z.isShaderMaterial||Z.isRawShaderMaterial){const Xt=Z.uniformsGroups;for(let $t=0,tr=Xt.length;$t<tr;$t++){const ni=Xt[$t];H.update(ni,yn),H.bind(ni,yn)}}return yn}function Ji(D,X){D.ambientLightColor.needsUpdate=X,D.lightProbe.needsUpdate=X,D.directionalLights.needsUpdate=X,D.directionalLightShadows.needsUpdate=X,D.pointLights.needsUpdate=X,D.pointLightShadows.needsUpdate=X,D.spotLights.needsUpdate=X,D.spotLightShadows.needsUpdate=X,D.rectAreaLights.needsUpdate=X,D.hemisphereLights.needsUpdate=X}function Ki(D){return D.isMeshLambertMaterial||D.isMeshToonMaterial||D.isMeshPhongMaterial||D.isMeshStandardMaterial||D.isShadowMaterial||D.isShaderMaterial&&D.lights===!0}this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return L},this.setRenderTargetTextures=function(D,X,J){const Z=he.get(D);Z.__autoAllocateDepthBuffer=D.resolveDepthBuffer===!1,Z.__autoAllocateDepthBuffer===!1&&(Z.__useRenderToTexture=!1),he.get(D.texture).__webglTexture=X,he.get(D.depthTexture).__webglTexture=Z.__autoAllocateDepthBuffer?void 0:J,Z.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(D,X){const J=he.get(D);J.__webglFramebuffer=X,J.__useDefaultFramebuffer=X===void 0};const Zi=O.createFramebuffer();this.setRenderTarget=function(D,X=0,J=0){L=D,C=X,T=J;let Z=!0,j=null,be=!1,Oe=!1;if(D){const Ge=he.get(D);if(Ge.__useDefaultFramebuffer!==void 0)te.bindFramebuffer(O.FRAMEBUFFER,null),Z=!1;else if(Ge.__webglFramebuffer===void 0)ce.setupRenderTarget(D);else if(Ge.__hasExternalTextures)ce.rebindTextures(D,he.get(D.texture).__webglTexture,he.get(D.depthTexture).__webglTexture);else if(D.depthBuffer){const et=D.depthTexture;if(Ge.__boundDepthTexture!==et){if(et!==null&&he.has(et)&&(D.width!==et.image.width||D.height!==et.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ce.setupDepthRenderbuffer(D)}}const ut=D.texture;(ut.isData3DTexture||ut.isDataArrayTexture||ut.isCompressedArrayTexture)&&(Oe=!0);const dt=he.get(D).__webglFramebuffer;D.isWebGLCubeRenderTarget?(Array.isArray(dt[X])?j=dt[X][J]:j=dt[X],be=!0):D.samples>0&&ce.useMultisampledRTT(D)===!1?j=he.get(D).__webglMultisampledFramebuffer:Array.isArray(dt)?j=dt[J]:j=dt,R.copy(D.viewport),B.copy(D.scissor),V=D.scissorTest}else R.copy(le).multiplyScalar(q).floor(),B.copy(Pe).multiplyScalar(q).floor(),V=Te;if(J!==0&&(j=Zi),te.bindFramebuffer(O.FRAMEBUFFER,j)&&Z&&te.drawBuffers(D,j),te.viewport(R),te.scissor(B),te.setScissorTest(V),be){const Ge=he.get(D.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+X,Ge.__webglTexture,J)}else if(Oe){const Ge=he.get(D.texture),ut=X;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,Ge.__webglTexture,J,ut)}else if(D!==null&&J!==0){const Ge=he.get(D.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Ge.__webglTexture,J)}b=-1},this.readRenderTargetPixels=function(D,X,J,Z,j,be,Oe,Ye=0){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ge=he.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Oe!==void 0&&(Ge=Ge[Oe]),Ge){te.bindFramebuffer(O.FRAMEBUFFER,Ge);try{const ut=D.textures[Ye],dt=ut.format,et=ut.type;if(!pe.textureFormatReadable(dt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!pe.textureTypeReadable(et)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}X>=0&&X<=D.width-Z&&J>=0&&J<=D.height-j&&(D.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Ye),O.readPixels(X,J,Z,j,Le.convert(dt),Le.convert(et),be))}finally{const ut=L!==null?he.get(L).__webglFramebuffer:null;te.bindFramebuffer(O.FRAMEBUFFER,ut)}}},this.readRenderTargetPixelsAsync=async function(D,X,J,Z,j,be,Oe,Ye=0){if(!(D&&D.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ge=he.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Oe!==void 0&&(Ge=Ge[Oe]),Ge)if(X>=0&&X<=D.width-Z&&J>=0&&J<=D.height-j){te.bindFramebuffer(O.FRAMEBUFFER,Ge);const ut=D.textures[Ye],dt=ut.format,et=ut.type;if(!pe.textureFormatReadable(dt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!pe.textureTypeReadable(et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const gt=O.createBuffer();O.bindBuffer(O.PIXEL_PACK_BUFFER,gt),O.bufferData(O.PIXEL_PACK_BUFFER,be.byteLength,O.STREAM_READ),D.textures.length>1&&O.readBuffer(O.COLOR_ATTACHMENT0+Ye),O.readPixels(X,J,Z,j,Le.convert(dt),Le.convert(et),0);const Ct=L!==null?he.get(L).__webglFramebuffer:null;te.bindFramebuffer(O.FRAMEBUFFER,Ct);const Ot=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0);return O.flush(),await Kf(O,Ot,4),O.bindBuffer(O.PIXEL_PACK_BUFFER,gt),O.getBufferSubData(O.PIXEL_PACK_BUFFER,0,be),O.deleteBuffer(gt),O.deleteSync(Ot),be}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(D,X=null,J=0){const Z=Math.pow(2,-J),j=Math.floor(D.image.width*Z),be=Math.floor(D.image.height*Z),Oe=X!==null?X.x:0,Ye=X!==null?X.y:0;ce.setTexture2D(D,0),O.copyTexSubImage2D(O.TEXTURE_2D,J,0,0,Oe,Ye,j,be),te.unbindTexture()};const Qi=O.createFramebuffer(),er=O.createFramebuffer();this.copyTextureToTexture=function(D,X,J=null,Z=null,j=0,be=null){be===null&&(j!==0?(Ar("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),be=j,j=0):be=0);let Oe,Ye,Ge,ut,dt,et,gt,Ct,Ot;const kt=D.isCompressedTexture?D.mipmaps[be]:D.image;if(J!==null)Oe=J.max.x-J.min.x,Ye=J.max.y-J.min.y,Ge=J.isBox3?J.max.z-J.min.z:1,ut=J.min.x,dt=J.min.y,et=J.isBox3?J.min.z:0;else{const un=Math.pow(2,-j);Oe=Math.floor(kt.width*un),Ye=Math.floor(kt.height*un),D.isDataArrayTexture?Ge=kt.depth:D.isData3DTexture?Ge=Math.floor(kt.depth*un):Ge=1,ut=0,dt=0,et=0}Z!==null?(gt=Z.x,Ct=Z.y,Ot=Z.z):(gt=0,Ct=0,Ot=0);const St=Le.convert(X.format),st=Le.convert(X.type);let Yt;X.isData3DTexture?(ce.setTexture3D(X,0),Yt=O.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(ce.setTexture2DArray(X,0),Yt=O.TEXTURE_2D_ARRAY):(ce.setTexture2D(X,0),Yt=O.TEXTURE_2D),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,X.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,X.unpackAlignment);const Et=O.getParameter(O.UNPACK_ROW_LENGTH),yn=O.getParameter(O.UNPACK_IMAGE_HEIGHT),zt=O.getParameter(O.UNPACK_SKIP_PIXELS),rn=O.getParameter(O.UNPACK_SKIP_ROWS),Pi=O.getParameter(O.UNPACK_SKIP_IMAGES);O.pixelStorei(O.UNPACK_ROW_LENGTH,kt.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,kt.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,ut),O.pixelStorei(O.UNPACK_SKIP_ROWS,dt),O.pixelStorei(O.UNPACK_SKIP_IMAGES,et);const Ft=D.isDataArrayTexture||D.isData3DTexture,mn=X.isDataArrayTexture||X.isData3DTexture;if(D.isDepthTexture){const un=he.get(D),Xt=he.get(X),$t=he.get(un.__renderTarget),tr=he.get(Xt.__renderTarget);te.bindFramebuffer(O.READ_FRAMEBUFFER,$t.__webglFramebuffer),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,tr.__webglFramebuffer);for(let ni=0;ni<Ge;ni++)Ft&&(O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,he.get(D).__webglTexture,j,et+ni),O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,he.get(X).__webglTexture,be,Ot+ni)),O.blitFramebuffer(ut,dt,Oe,Ye,gt,Ct,Oe,Ye,O.DEPTH_BUFFER_BIT,O.NEAREST);te.bindFramebuffer(O.READ_FRAMEBUFFER,null),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else if(j!==0||D.isRenderTargetTexture||he.has(D)){const un=he.get(D),Xt=he.get(X);te.bindFramebuffer(O.READ_FRAMEBUFFER,Qi),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,er);for(let $t=0;$t<Ge;$t++)Ft?O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,un.__webglTexture,j,et+$t):O.framebufferTexture2D(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,un.__webglTexture,j),mn?O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,Xt.__webglTexture,be,Ot+$t):O.framebufferTexture2D(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,Xt.__webglTexture,be),j!==0?O.blitFramebuffer(ut,dt,Oe,Ye,gt,Ct,Oe,Ye,O.COLOR_BUFFER_BIT,O.NEAREST):mn?O.copyTexSubImage3D(Yt,be,gt,Ct,Ot+$t,ut,dt,Oe,Ye):O.copyTexSubImage2D(Yt,be,gt,Ct,ut,dt,Oe,Ye);te.bindFramebuffer(O.READ_FRAMEBUFFER,null),te.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else mn?D.isDataTexture||D.isData3DTexture?O.texSubImage3D(Yt,be,gt,Ct,Ot,Oe,Ye,Ge,St,st,kt.data):X.isCompressedArrayTexture?O.compressedTexSubImage3D(Yt,be,gt,Ct,Ot,Oe,Ye,Ge,St,kt.data):O.texSubImage3D(Yt,be,gt,Ct,Ot,Oe,Ye,Ge,St,st,kt):D.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,be,gt,Ct,Oe,Ye,St,st,kt.data):D.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,be,gt,Ct,kt.width,kt.height,St,kt.data):O.texSubImage2D(O.TEXTURE_2D,be,gt,Ct,Oe,Ye,St,st,kt);O.pixelStorei(O.UNPACK_ROW_LENGTH,Et),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,yn),O.pixelStorei(O.UNPACK_SKIP_PIXELS,zt),O.pixelStorei(O.UNPACK_SKIP_ROWS,rn),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Pi),be===0&&X.generateMipmaps&&O.generateMipmap(Yt),te.unbindTexture()},this.copyTextureToTexture3D=function(D,X,J=null,Z=null,j=0){return Ar('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(D,X,J,Z,j)},this.initRenderTarget=function(D){he.get(D).__webglFramebuffer===void 0&&ce.setupRenderTarget(D)},this.initTexture=function(D){D.isCubeTexture?ce.setTextureCube(D,0):D.isData3DTexture?ce.setTexture3D(D,0):D.isDataArrayTexture||D.isCompressedArrayTexture?ce.setTexture2DArray(D,0):ce.setTexture2D(D,0),te.unbindTexture()},this.resetState=function(){C=0,T=0,L=null,te.reset(),ct.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return di}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=xt._getDrawingBufferColorSpace(e),t.unpackColorSpace=xt._getUnpackColorSpace()}}var r3=Object.defineProperty,s3=(r,e,t)=>e in r?r3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Pt=(r,e,t)=>s3(r,typeof e!="symbol"?e+"":e,t);const qu=(r,e)=>{const[t,n]=e.split("-");return Object.assign(r.style,{left:n==="left"?"0":n==="center"?"50%":"",right:n==="right"?"0":"",top:t==="top"?"0":t==="bottom"?"":"50%",bottom:t==="bottom"?"0":"",transform:`${n==="center"?"translateX(-50%)":""} ${t==="center"?"translateY(-50%)":""}`}),e},a3=({placement:r,size:e,offset:t,id:n,className:i})=>{const s=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=t;return Object.assign(s.style,{id:n,position:"absolute",zIndex:"1000",height:`${e}px`,width:`${e}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),qu(s,r),n&&(s.id=n),i&&(s.className=i),s},o3=r=>{const e=typeof r=="string"?document.querySelector(r):r;if(!e)throw Error("Invalid DOM element");return e};function ml(r,e,t){return Math.max(e,Math.min(t,r))}const l3=[["x",0,3],["y",1,4],["z",2,5]],Rh=new F;function Dh({isSphere:r},e,t){r&&(Rh.set(0,0,1).applyQuaternion(t.quaternion),l3.forEach(([n,i,s])=>{const a=Rh[n];let o=e[i],l=o.userData.opacity;o.material.opacity=ml(a>=0?l:l/2,0,1),o=e[s],l=o.userData.opacity,o.material.opacity=ml(a>=0?l/2:l,0,1)}))}const c3=(r,e,t=10)=>Math.abs(r.clientX-e.x)<t&&Math.abs(r.clientY-e.y)<t,Ph=new _0,Lh=new Xe,Ih=(r,e,t,n)=>{Lh.set((r.clientX-e.left)/e.width*2-1,-((r.clientY-e.top)/e.height)*2+1),Ph.setFromCamera(Lh,t);const i=Ph.intersectObjects(n,!1),s=i.length?i[0]:null;return!s||!s.object.visible?null:s},_o=1e-6,h3=2*Math.PI,ju=["x","y","z"],ls=[...ju,"nx","ny","nz"],u3=["x","z","y","nx","nz","ny"],d3=["z","x","y","nz","nx","ny"],gl="Right",ha="Top",_l="Front",vl="Left",ua="Bottom",yl="Back",f3=[gl,ha,_l,vl,ua,yl].map(r=>r.toLocaleLowerCase()),Yu=1.3,Uh=(r,e=!0)=>{const{material:t,userData:n}=r,{color:i,opacity:s}=e?n.hover:n;t.color.set(i),t.opacity=s},zi=r=>JSON.parse(JSON.stringify(r)),p3=r=>{const e=r.type||"sphere",t=e==="sphere",n=r.resolution||t?64:128,i=Nt.DEFAULT_UP,s=i.z===1,a=i.x===1,{container:o}=r;r.container=void 0,r=JSON.parse(JSON.stringify(r)),r.container=o;const l=s?u3:a?d3:ls;f3.forEach((d,f)=>{r[d]&&(r[l[f]]=r[d])});const c={enabled:!0,color:16777215,opacity:1,scale:.7,labelColor:2236962,line:!1,border:{size:0,color:14540253},hover:{color:t?16777215:9688043,labelColor:2236962,opacity:1,scale:.7,border:{size:0,color:14540253}}},h={line:!1,scale:t?.45:.7,hover:{scale:t?.5:.7}},u={type:e,container:document.body,size:128,placement:"top-right",resolution:n,lineWidth:4,radius:t?1:.2,smoothness:18,animated:!0,speed:1,background:{enabled:!0,color:t?16777215:14739180,opacity:t?0:1,hover:{color:t?16777215:14739180,opacity:t?.2:1}},font:{family:"sans-serif",weight:900},offset:{top:10,left:10,bottom:10,right:10},corners:{enabled:!t,color:t?15915362:16777215,opacity:1,scale:t?.15:.2,radius:1,smoothness:18,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:.225}},edges:{enabled:!t,color:t?15915362:16777215,opacity:t?1:0,radius:t?1:.125,smoothness:18,scale:t?.15:1,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:1}},x:{...zi(c),...t?{label:"X",color:16725587,line:!0}:{label:a?ha:gl}},y:{...zi(c),...t?{label:"Y",color:9100032,line:!0}:{label:s||a?_l:ha}},z:{...zi(c),...t?{label:"Z",color:2920447,line:!0}:{label:s?ha:a?gl:_l}},nx:{...zi(h),label:t?"":a?ua:vl},ny:{...zi(h),label:t?"":s||a?yl:ua},nz:{...zi(h),label:t?"":s?ua:a?vl:yl}};return xl(r,u),ju.forEach(d=>xl(r[`n${d}`],zi(r[d]))),{...r,isSphere:t}};function xl(r,...e){if(r instanceof HTMLElement||typeof r!="object"||r===null)return r;for(const t of e)for(const n in t)n!=="container"&&n in t&&(r[n]===void 0?r[n]=t[n]:typeof t[n]=="object"&&!Array.isArray(t[n])&&(r[n]=xl(r[n]||{},t[n])));return r}const m3=(r,e=2)=>{const t=new ot,n=e*2,{isSphere:i,resolution:s,radius:a,font:o,corners:l,edges:c}=r,h=ls.map(T=>({...r[T],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const u=document.createElement("canvas"),d=u.getContext("2d");u.width=s*2+n*2,u.height=s*h.length+n*h.length;const[f,m]=U(h,s,o);h.forEach(({radius:T,label:L,color:b,labelColor:x,border:R,hover:{color:B,labelColor:V,border:W}},ee)=>{const k=s*ee+ee*n+e;v(e,k,e,s,T,L,R,b,x),v(s+e*3,k,e,s,T,L,W??R,B??b,V??x)});const _=h.length,g=e/(s*2),p=e/(s*6),S=1/_,E=new Dp(u);return E.repeat.set(.5-2*g,S-2*p),E.offset.set(g,1-p),Object.assign(E,{colorSpace:Tt,wrapS:$n,wrapT:$n,userData:{offsetX:g,offsetY:p,cellHeight:S}}),E;function v(T,L,b,x,R,B,V,W,ee){if(R=R*(x/2),W!=null&&W!==""&&(k(),d.fillStyle=t.set(W).getStyle(),d.fill()),V&&V.size){const Q=V.size*x/2;T+=Q,L+=Q,x-=V.size*x,R=Math.max(0,R-Q),k(),d.strokeStyle=t.set(V.color).getStyle(),d.lineWidth=V.size*x,d.stroke()}B&&C(d,T+x/2,L+(x+b)/2,B,t.set(ee).getStyle());function k(){d.beginPath(),d.moveTo(T+R,L),d.lineTo(T+x-R,L),d.arcTo(T+x,L,T+x,L+R,R),d.lineTo(T+x,L+x-R),d.arcTo(T+x,L+x,T+x-R,L+x,R),d.lineTo(T+R,L+x),d.arcTo(T,L+x,T,L+x-R,R),d.lineTo(T,L+R),d.arcTo(T,L,T+R,L,R),d.closePath()}}function U(T,L,b){const x=[...T].sort((ye,le)=>{var Pe,Te;return(((Pe=ye.label)==null?void 0:Pe.length)||0)-(((Te=le.label)==null?void 0:Te.length)||0)}).pop().label,{family:R,weight:B}=b,V=i?Math.sqrt(Math.pow(L*.7,2)/2):L;let W=V,ee=0,k=0;do{d.font=`${B} ${W}px ${R}`;const ye=d.measureText(x);ee=ye.width,k=ye.fontBoundingBoxDescent,W--}while(ee>V&&W>0);const Q=V/k,q=Math.min(V/ee,Q),ue=Math.floor(W*q);return[`${B} ${ue}px ${R}`,Q]}function C(T,L,b,x,R){T.font=f,T.textAlign="center",T.textBaseline="middle",T.fillStyle=R,T.fillText(x,L,b+(i?m:0))}},g3=(r,e)=>r.offset.x=(e?.5:0)+r.userData.offsetX,Jl=(r,e)=>{const{offset:t,userData:{offsetY:n,cellHeight:i}}=r;t.y=1-(e+1)*i+n};function Kl(r,e,t=2,n=2){const i=t/2-r,s=n/2-r,a=r/t,o=(t-r)/t,l=r/n,c=(n-r)/n,h=[i,s,0,-i,s,0,-i,-s,0,i,-s,0],u=[o,c,a,c,a,l,o,l],d=[3*(e+1)+3,3*(e+1)+4,e+4,e+5,2*(e+1)+4,2,1,2*(e+1)+3,3,4*(e+1)+3,4,0],f=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11].map(C=>d[C]);let m,_,g,p,S,E,v,U;for(let C=0;C<4;C++){p=C<1||C>2?i:-i,S=C<2?s:-s,E=C<1||C>2?o:a,v=C<2?c:l;for(let T=0;T<=e;T++)m=Math.PI/2*(C+T/e),_=Math.cos(m),g=Math.sin(m),h.push(p+r*_,S+r*g,0),u.push(E+a*_,v+l*g),T<e&&(U=(e+1)*C+T+4,f.push(C,U,U+1))}return new Bt().setIndex(new Gt(new Uint32Array(f),1)).setAttribute("position",new Gt(new Float32Array(h),3)).setAttribute("uv",new Gt(new Float32Array(u),2))}const _3=(r,e)=>{const t=new F,{isSphere:n,radius:i,smoothness:s}=r,a=Kl(i,s);return ls.map((o,l)=>{const c=l<3,h=ls[l],u=l?e.clone():e;Jl(u,l);const{enabled:d,scale:f,opacity:m,hover:_}=r[h],g={map:u,opacity:m,transparent:!0},p=n?new zl(new Ea(g)):new Rt(a,new Ri(g)),S=c?h:h[1];return p.position[S]=(c?1:-1)*(n?Yu:1),n||p.lookAt(t.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(f),p.renderOrder=1,p.visible=d,p.userData={scale:f,opacity:m,hover:_},p})},v3=(r,e)=>{const{isSphere:t,corners:n}=r;if(!n.enabled)return[];const{color:i,opacity:s,scale:a,radius:o,smoothness:l,hover:c}=n,h=t?null:Kl(o,l),u={transparent:!0,opacity:s},d=[1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1].map(m=>m*.85),f=new F;return Array(d.length/3).fill(0).map((m,_)=>{if(t){const S=e.clone();Jl(S,6),u.map=S}else u.color=i;const g=t?new zl(new Ea(u)):new Rt(h,new Ri(u)),p=_*3;return g.position.set(d[p],d[p+1],d[p+2]),t&&g.position.normalize().multiplyScalar(1.7),g.scale.setScalar(a),g.lookAt(f.copy(g.position).multiplyScalar(2)),g.renderOrder=1,g.userData={color:i,opacity:s,scale:a,hover:c},g})},y3=(r,e,t)=>{const{isSphere:n,edges:i}=r;if(!i.enabled)return[];const{color:s,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,u=n?null:Kl(c,h,1.2,.25),d={transparent:!0,opacity:a},f=[0,1,1,0,-1,1,1,0,1,-1,0,1,0,1,-1,0,-1,-1,1,0,-1,-1,0,-1,1,1,0,1,-1,0,-1,1,0,-1,-1,0].map(g=>g*.925),m=new F,_=new F(0,1,0);return Array(f.length/3).fill(0).map((g,p)=>{if(n){const v=e.clone();Jl(v,t),d.map=v}else d.color=s;const S=n?new zl(new Ea(d)):new Rt(u,new Ri(d)),E=p*3;return S.position.set(f[E],f[E+1],f[E+2]),n&&S.position.normalize().multiplyScalar(1.7),S.scale.setScalar(o),S.up.copy(_),S.lookAt(m.copy(S.position).multiplyScalar(2)),!n&&!S.position.y&&(S.rotation.z=Math.PI/2),S.renderOrder=1,S.userData={color:s,opacity:a,scale:o,hover:l},S})};function x3(r,e=!1){const t=r[0].index!==null,n=new Set(Object.keys(r[0].attributes)),i=new Set(Object.keys(r[0].morphAttributes)),s={},a={},o=r[0].morphTargetsRelative,l=new Bt;let c=0;for(let h=0;h<r.length;++h){const u=r[h];let d=0;if(t!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const f in u.attributes){if(!n.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;s[f]===void 0&&(s[f]=[]),s[f].push(u.attributes[f]),d++}if(d!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const f in u.morphAttributes){if(!i.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[f]===void 0&&(a[f]=[]),a[f].push(u.morphAttributes[f])}if(e){let f;if(t)f=u.index.count;else if(u.attributes.position!==void 0)f=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,f,h),c+=f}}if(t){let h=0;const u=[];for(let d=0;d<r.length;++d){const f=r[d].index;for(let m=0;m<f.count;++m)u.push(f.getX(m)+h);h+=r[d].attributes.position.count}l.setIndex(u)}for(const h in s){const u=Nh(s[h]);if(!u)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,u)}for(const h in a){const u=a[h][0].length;if(u===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let d=0;d<u;++d){const f=[];for(let _=0;_<a[h].length;++_)f.push(a[h][_][d]);const m=Nh(f);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(m)}}return l}function Nh(r){let e,t,n,i=-1,s=0;for(let c=0;c<r.length;++c){const h=r[c];if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=h.itemSize),t!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=h.count*t}const a=new e(s),o=new Gt(a,t,n);let l=0;for(let c=0;c<r.length;++c){const h=r[c];if(h.isInterleavedBufferAttribute){const u=l/t;for(let d=0,f=h.count;d<f;d++)for(let m=0;m<t;m++){const _=h.getComponent(d,m);o.setComponent(d+u,m,_)}}else a.set(h.array,l);l+=h.count*t}return i!==void 0&&(o.gpuType=i),o}const M3=(r,e)=>{const{isSphere:t,background:{enabled:n,color:i,opacity:s,hover:a}}=e;let o;const l=new Ri({color:i,side:vn,opacity:s,transparent:!0,depthWrite:!1});if(!n)return null;if(t)o=new Rt(new Aa(1.8,64,64),l);else{let c;r.forEach(h=>{const u=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const d=h.geometry.clone();d.applyMatrix4(h.matrix),c=c?x3([c,d]):d,h.scale.setScalar(u)}),o=new Rt(c,l)}return o.userData={color:i,opacity:s,hover:a},o},Fh=new ei,$s=new F;class $u extends p0{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new mt(e,3)),this.setAttribute("uv",new mt(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new dl(t,6,1);return this.setAttribute("instanceStart",new Zn(n,3,0)),this.setAttribute("instanceEnd",new Zn(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new dl(t,6,1);return this.setAttribute("instanceColorStart",new Zn(n,3,0)),this.setAttribute("instanceColorEnd",new Zn(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new qp(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ei);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Fh.setFromBufferAttribute(t),this.boundingBox.union(Fh))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new mi),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let s=0,a=e.count;s<a;s++)$s.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared($s)),$s.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared($s));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}Ue.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Xe(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};bn.line={uniforms:Fl.merge([Ue.common,Ue.fog,Ue.line]),vertexShader:`
3828
3828
  #include <common>
3829
3829
  #include <color_pars_vertex>
3830
3830
  #include <fog_pars_vertex>
@@ -4201,7 +4201,7 @@ void main() {
4201
4201
  `);let i=[];for(let o=0,l=n.length;o<l;o++){const c=n[o].trimStart();if(c.length===0)continue;const h=c.charAt(0);if(h!=="#")if(h==="v"){const u=c.split(Gh);switch(u[0]){case"v":t.vertices.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3])),u.length>=7?(Zs.setRGB(parseFloat(u[4]),parseFloat(u[5]),parseFloat(u[6]),Tt),t.colors.push(Zs.r,Zs.g,Zs.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(u[1]),parseFloat(u[2]),parseFloat(u[3]));break;case"vt":t.uvs.push(parseFloat(u[1]),parseFloat(u[2]));break}}else if(h==="f"){const d=c.slice(1).trim().split(Gh),f=[];for(let _=0,g=d.length;_<g;_++){const p=d[_];if(p.length>0){const S=p.split("/");f.push(S)}}const m=f[0];for(let _=1,g=f.length-1;_<g;_++){const p=f[_],S=f[_+1];t.addFace(m[0],p[0],S[0],m[1],p[1],S[1],m[2],p[2],S[2])}}else if(h==="l"){const u=c.substring(1).trim().split(" ");let d=[];const f=[];if(c.indexOf("/")===-1)d=u;else for(let m=0,_=u.length;m<_;m++){const g=u[m].split("/");g[0]!==""&&d.push(g[0]),g[1]!==""&&f.push(g[1])}t.addLineGeometry(d,f)}else if(h==="p"){const d=c.slice(1).trim().split(" ");t.addPointGeometry(d)}else if((i=D3.exec(c))!==null){const u=(" "+i[0].slice(1).trim()).slice(1);t.startObject(u)}else if(L3.test(c))t.object.startMaterial(c.substring(7).trim(),t.materialLibraries);else if(P3.test(c))t.materialLibraries.push(c.substring(7).trim());else if(I3.test(c))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(h==="s"){if(i=c.split(" "),i.length>1){const d=i[1].trim().toLowerCase();t.object.smooth=d!=="0"&&d!=="off"}else t.object.smooth=!0;const u=t.object.currentMaterial();u&&(u.smooth=t.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}t.finalize();const s=new Kn;if(s.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let o=0,l=t.objects.length;o<l;o++){const c=t.objects[o],h=c.geometry,u=c.materials,d=h.type==="Line",f=h.type==="Points";let m=!1;if(h.vertices.length===0)continue;const _=new Bt;_.setAttribute("position",new mt(h.vertices,3)),h.normals.length>0&&_.setAttribute("normal",new mt(h.normals,3)),h.colors.length>0&&(m=!0,_.setAttribute("color",new mt(h.colors,3))),h.hasUVIndices===!0&&_.setAttribute("uv",new mt(h.uvs,2));const g=[];for(let S=0,E=u.length;S<E;S++){const v=u[S],U=v.name+"_"+v.smooth+"_"+m;let C=t.materials[U];if(this.materials!==null){if(C=this.materials.create(v.name),d&&C&&!(C instanceof Ci)){const T=new Ci;Nn.prototype.copy.call(T,C),T.color.copy(C.color),C=T}else if(f&&C&&!(C instanceof Wi)){const T=new Wi({size:10,sizeAttenuation:!1});Nn.prototype.copy.call(T,C),T.color.copy(C.color),T.map=C.map,C=T}}C===void 0&&(d?C=new Ci:f?C=new Wi({size:1,sizeAttenuation:!1}):C=new Mn,C.name=v.name,C.flatShading=!v.smooth,C.vertexColors=m,t.materials[U]=C),g.push(C)}let p;if(g.length>1){for(let S=0,E=u.length;S<E;S++){const v=u[S];_.addGroup(v.groupStart,v.groupCount,S)}d?p=new va(_,g):f?p=new Qr(_,g):p=new Rt(_,g)}else d?p=new va(_,g[0]):f?p=new Qr(_,g[0]):p=new Rt(_,g[0]);p.name=c.name,s.add(p)}else if(t.vertices.length>0){const o=new Wi({size:1,sizeAttenuation:!1}),l=new Bt;l.setAttribute("position",new mt(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(l.setAttribute("color",new mt(t.colors,3)),o.vertexColors=!0);const c=new Qr(l,o);s.add(c)}return s}}class So extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=this.path===""?Yl.extractUrlBase(e):this.path,o=new zr(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(l,a))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},n,i)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const n=e.split(`
4202
4202
  `);let i={};const s=/\s+/,a={};for(let l=0;l<n.length;l++){let c=n[l];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const h=c.indexOf(" ");let u=h>=0?c.substring(0,h):c;u=u.toLowerCase();let d=h>=0?c.substring(h+1):"";if(d=d.trim(),u==="newmtl")i={name:d},a[d]=i;else if(u==="ka"||u==="kd"||u==="ks"||u==="ke"){const f=d.split(s,3);i[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else i[u]=d}const o=new N3(this.resourcePath||t,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(a),o}}class N3{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:Hn,this.wrap=this.options.wrap!==void 0?this.options.wrap:$n}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const n in e){const i=e[n],s={};t[n]=s;for(const a in i){let o=!0,l=i[a];const c=a.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(l=[l[0]/255,l[1]/255,l[2]/255]),this.options&&this.options.ignoreZeroRGBs&&l[0]===0&&l[1]===0&&l[2]===0&&(o=!1);break}o&&(s[c]=l)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,n=this.materialsInfo[e],i={name:e,side:this.side};function s(o,l){return typeof l!="string"||l===""?"":/^https?:\/\//i.test(l)?l:o+l}function a(o,l){if(i[o])return;const c=t.getTextureParams(l,i),h=t.loadTexture(s(t.baseUrl,c.url));h.repeat.copy(c.scale),h.offset.copy(c.offset),h.wrapS=t.wrap,h.wrapT=t.wrap,(o==="map"||o==="emissiveMap")&&(h.colorSpace=Tt),i[o]=h}for(const o in n){const l=n[o];let c;if(l!=="")switch(o.toLowerCase()){case"kd":i.color=xt.colorSpaceToWorking(new ot().fromArray(l),Tt);break;case"ks":i.specular=xt.colorSpaceToWorking(new ot().fromArray(l),Tt);break;case"ke":i.emissive=xt.colorSpaceToWorking(new ot().fromArray(l),Tt);break;case"map_kd":a("map",l);break;case"map_ks":a("specularMap",l);break;case"map_ke":a("emissiveMap",l);break;case"norm":a("normalMap",l);break;case"map_bump":case"bump":a("bumpMap",l);break;case"disp":a("displacementMap",l);break;case"map_d":a("alphaMap",l),i.transparent=!0;break;case"ns":i.shininess=parseFloat(l);break;case"d":c=parseFloat(l),c<1&&(i.opacity=c,i.transparent=!0);break;case"tr":c=parseFloat(l),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(i.opacity=1-c,i.transparent=!0);break}}return this.materials[e]=new Mn(i),this.materials[e]}getTextureParams(e,t){const n={scale:new Xe(1,1),offset:new Xe(0,0)},i=e.split(/\s+/);let s;return s=i.indexOf("-bm"),s>=0&&(t.bumpScale=parseFloat(i[s+1]),i.splice(s,2)),s=i.indexOf("-mm"),s>=0&&(t.displacementBias=parseFloat(i[s+1]),t.displacementScale=parseFloat(i[s+2]),i.splice(s,3)),s=i.indexOf("-s"),s>=0&&(n.scale.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),s=i.indexOf("-o"),s>=0&&(n.offset.set(parseFloat(i[s+1]),parseFloat(i[s+2])),i.splice(s,4)),n.url=i.join(" ").trim(),n}loadTexture(e,t,n,i,s){const a=this.manager!==void 0?this.manager:Xl;let o=a.getHandler(e);o===null&&(o=new ql(a)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(e,n,i,s);return t!==void 0&&(l.mapping=t),l}}class da extends Gn{constructor(e){super(e)}load(e,t,n,i){const s=this,a=new zr(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){function t(c){const h=new DataView(c),u=32/8*3+32/8*3*3+16/8,d=h.getUint32(80,!0);if(80+32/8+d*u===h.byteLength)return!0;const m=[115,111,108,105,100];for(let _=0;_<5;_++)if(n(m,h,_))return!1;return!0}function n(c,h,u){for(let d=0,f=c.length;d<f;d++)if(c[d]!==h.getUint8(u+d))return!1;return!0}function i(c){const h=new DataView(c),u=h.getUint32(80,!0);let d,f,m,_=!1,g,p,S,E,v;for(let R=0;R<70;R++)h.getUint32(R,!1)==1129270351&&h.getUint8(R+4)==82&&h.getUint8(R+5)==61&&(_=!0,g=new Float32Array(u*3*3),p=h.getUint8(R+6)/255,S=h.getUint8(R+7)/255,E=h.getUint8(R+8)/255,v=h.getUint8(R+9)/255);const U=84,C=12*4+2,T=new Bt,L=new Float32Array(u*3*3),b=new Float32Array(u*3*3),x=new ot;for(let R=0;R<u;R++){const B=U+R*C,V=h.getFloat32(B,!0),W=h.getFloat32(B+4,!0),ee=h.getFloat32(B+8,!0);if(_){const k=h.getUint16(B+48,!0);(k&32768)===0?(d=(k&31)/31,f=(k>>5&31)/31,m=(k>>10&31)/31):(d=p,f=S,m=E)}for(let k=1;k<=3;k++){const Q=B+k*12,q=R*3*3+(k-1)*3;L[q]=h.getFloat32(Q,!0),L[q+1]=h.getFloat32(Q+4,!0),L[q+2]=h.getFloat32(Q+8,!0),b[q]=V,b[q+1]=W,b[q+2]=ee,_&&(x.setRGB(d,f,m,Tt),g[q]=x.r,g[q+1]=x.g,g[q+2]=x.b)}}return T.setAttribute("position",new Gt(L,3)),T.setAttribute("normal",new Gt(b,3)),_&&(T.setAttribute("color",new Gt(g,3)),T.hasColors=!0,T.alpha=v),T}function s(c){const h=new Bt,u=/solid([\s\S]*?)endsolid/g,d=/facet([\s\S]*?)endfacet/g,f=/solid\s(.+)/;let m=0;const _=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+_+_+_,"g"),p=new RegExp("normal"+_+_+_,"g"),S=[],E=[],v=[],U=new F;let C,T=0,L=0,b=0;for(;(C=u.exec(c))!==null;){L=b;const x=C[0],R=(C=f.exec(x))!==null?C[1]:"";for(v.push(R);(C=d.exec(x))!==null;){let W=0,ee=0;const k=C[0];for(;(C=p.exec(k))!==null;)U.x=parseFloat(C[1]),U.y=parseFloat(C[2]),U.z=parseFloat(C[3]),ee++;for(;(C=g.exec(k))!==null;)S.push(parseFloat(C[1]),parseFloat(C[2]),parseFloat(C[3])),E.push(U.x,U.y,U.z),W++,b++;ee!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+m),W!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+m),m++}const B=L,V=b-L;h.userData.groupNames=v,h.addGroup(B,V,T),T++}return h.setAttribute("position",new mt(S,3)),h.setAttribute("normal",new mt(E,3)),h}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function o(c){if(typeof c=="string"){const h=new Uint8Array(c.length);for(let u=0;u<c.length;u++)h[u]=c.charCodeAt(u)&255;return h.buffer||h}else return c}const l=o(e);return t(l)?i(l):s(a(e))}}class F3 extends Gn{constructor(e){super(e),this.littleEndian=!0}load(e,t,n,i){const s=this,a=new zr(s.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(o))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}_getDataView(e,t,n,i){switch(n){case"F":return i===8?e.getFloat64(t,this.littleEndian):e.getFloat32(t,this.littleEndian);case"I":return i===1?e.getInt8(t):i===2?e.getInt16(t,this.littleEndian):e.getInt32(t,this.littleEndian);case"U":return i===1?e.getUint8(t):i===2?e.getUint16(t,this.littleEndian):e.getUint32(t,this.littleEndian)}}parse(e){function t(f,m){const _=f.length,g=new Uint8Array(m);let p=0,S=0,E,v,U;do if(E=f[p++],E<32){if(E++,S+E>m)throw new Error("Output buffer is not large enough");if(p+E>_)throw new Error("Invalid compressed data");do g[S++]=f[p++];while(--E)}else{if(v=E>>5,U=S-((E&31)<<8)-1,p>=_)throw new Error("Invalid compressed data");if(v===7&&(v+=f[p++],p>=_))throw new Error("Invalid compressed data");if(U-=f[p++],S+v+2>m)throw new Error("Output buffer is not large enough");if(U<0)throw new Error("Invalid compressed data");if(U>=S)throw new Error("Invalid compressed data");do g[S++]=g[U++];while(--v+2)}while(p<_);return g}function n(f){const m={},_=new Uint8Array(f);let g="",p="",S=0,E=!1;const v=_.length;for(;S<v&&E===!1;){const L=String.fromCharCode(_[S++]);L===`
4203
4203
  `||L==="\r"?(p.trim().toLowerCase().startsWith("data")&&(E=!0),p=""):p+=L,g+=L}const U=g.search(/[\r\n]DATA\s(\S*)\s/i),C=/[\r\n]DATA\s(\S*)\s/i.exec(g.slice(U-1));if(m.data=C[1],m.headerLen=C[0].length+U,m.str=g.slice(0,m.headerLen),m.str=m.str.replace(/#.*/gi,""),m.version=/^VERSION (.*)/im.exec(m.str),m.fields=/^FIELDS (.*)/im.exec(m.str),m.size=/^SIZE (.*)/im.exec(m.str),m.type=/^TYPE (.*)/im.exec(m.str),m.count=/^COUNT (.*)/im.exec(m.str),m.width=/^WIDTH (.*)/im.exec(m.str),m.height=/^HEIGHT (.*)/im.exec(m.str),m.viewpoint=/^VIEWPOINT (.*)/im.exec(m.str),m.points=/^POINTS (.*)/im.exec(m.str),m.version!==null&&(m.version=parseFloat(m.version[1])),m.fields=m.fields!==null?m.fields[1].split(" "):[],m.type!==null&&(m.type=m.type[1].split(" ")),m.width!==null&&(m.width=parseInt(m.width[1])),m.height!==null&&(m.height=parseInt(m.height[1])),m.viewpoint!==null&&(m.viewpoint=m.viewpoint[1]),m.points!==null&&(m.points=parseInt(m.points[1],10)),m.points===null&&(m.points=m.width*m.height),m.size!==null&&(m.size=m.size[1].split(" ").map(function(L){return parseInt(L,10)})),m.count!==null)m.count=m.count[1].split(" ").map(function(L){return parseInt(L,10)});else{m.count=[];for(let L=0,b=m.fields.length;L<b;L++)m.count.push(1)}m.offset={};let T=0;for(let L=0,b=m.fields.length;L<b;L++)m.data==="ascii"?m.offset[m.fields[L]]=L:(m.offset[m.fields[L]]=T,T+=m.size[L]*m.count[L]);return m.rowSize=T,m}const i=n(e),s=[],a=[],o=[],l=[],c=[],h=new ot;if(i.data==="ascii"){const f=i.offset,g=new TextDecoder().decode(e).slice(i.headerLen).split(`
4204
- `);for(let p=0,S=g.length;p<S;p++){if(g[p]==="")continue;const E=g[p].split(" ");if(f.x!==void 0&&(s.push(parseFloat(E[f.x])),s.push(parseFloat(E[f.y])),s.push(parseFloat(E[f.z]))),f.rgb!==void 0){const v=i.fields.findIndex(R=>R==="rgb"),U=i.type[v],C=parseFloat(E[f.rgb]);let T=C;if(U==="F"){const R=new Float32Array(1);R[0]=C,T=new Int32Array(R.buffer)[0]}const L=(T>>16&255)/255,b=(T>>8&255)/255,x=(T>>0&255)/255;h.setRGB(L,b,x,Tt),o.push(h.r,h.g,h.b)}f.normal_x!==void 0&&(a.push(parseFloat(E[f.normal_x])),a.push(parseFloat(E[f.normal_y])),a.push(parseFloat(E[f.normal_z]))),f.intensity!==void 0&&l.push(parseFloat(E[f.intensity])),f.label!==void 0&&c.push(parseInt(E[f.label]))}}if(i.data==="binary_compressed"){const f=new Uint32Array(e.slice(i.headerLen,i.headerLen+8)),m=f[0],_=f[1],g=t(new Uint8Array(e,i.headerLen+8,m),_),p=new DataView(g.buffer),S=i.offset;for(let E=0;E<i.points;E++){if(S.x!==void 0){const v=i.fields.indexOf("x"),U=i.fields.indexOf("y"),C=i.fields.indexOf("z");s.push(this._getDataView(p,i.points*S.x+i.size[v]*E,i.type[v],i.size[v])),s.push(this._getDataView(p,i.points*S.y+i.size[U]*E,i.type[U],i.size[U])),s.push(this._getDataView(p,i.points*S.z+i.size[C]*E,i.type[C],i.size[C]))}if(S.rgb!==void 0){const v=i.fields.indexOf("rgb"),U=p.getUint8(i.points*S.rgb+i.size[v]*E+2)/255,C=p.getUint8(i.points*S.rgb+i.size[v]*E+1)/255,T=p.getUint8(i.points*S.rgb+i.size[v]*E+0)/255;h.setRGB(U,C,T,Tt),o.push(h.r,h.g,h.b)}if(S.normal_x!==void 0){const v=i.fields.indexOf("normal_x"),U=i.fields.indexOf("normal_y"),C=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*S.normal_x+i.size[v]*E,i.type[v],i.size[v])),a.push(this._getDataView(p,i.points*S.normal_y+i.size[U]*E,i.type[U],i.size[U])),a.push(this._getDataView(p,i.points*S.normal_z+i.size[C]*E,i.type[C],i.size[C]))}if(S.intensity!==void 0){const v=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*S.intensity+i.size[v]*E,i.type[v],i.size[v]))}if(S.label!==void 0){const v=i.fields.indexOf("label");c.push(p.getInt32(i.points*S.label+i.size[v]*E,this.littleEndian))}}}if(i.data==="binary"){const f=new DataView(e,i.headerLen),m=i.offset;for(let _=0,g=0;_<i.points;_++,g+=i.rowSize){if(m.x!==void 0){const p=i.fields.indexOf("x"),S=i.fields.indexOf("y"),E=i.fields.indexOf("z");s.push(this._getDataView(f,g+m.x,i.type[p],i.size[p])),s.push(this._getDataView(f,g+m.y,i.type[S],i.size[S])),s.push(this._getDataView(f,g+m.z,i.type[E],i.size[E]))}if(m.rgb!==void 0){const p=f.getUint8(g+m.rgb+2)/255,S=f.getUint8(g+m.rgb+1)/255,E=f.getUint8(g+m.rgb+0)/255;h.setRGB(p,S,E,Tt),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),S=i.fields.indexOf("normal_y"),E=i.fields.indexOf("normal_z");a.push(this._getDataView(f,g+m.normal_x,i.type[p],i.size[p])),a.push(this._getDataView(f,g+m.normal_y,i.type[S],i.size[S])),a.push(this._getDataView(f,g+m.normal_z,i.type[E],i.size[E]))}if(m.intensity!==void 0){const p=i.fields.indexOf("intensity");l.push(this._getDataView(f,g+m.intensity,i.type[p],i.size[p]))}m.label!==void 0&&c.push(f.getInt32(g+m.label,this.littleEndian))}}const u=new Bt;s.length>0&&u.setAttribute("position",new mt(s,3)),a.length>0&&u.setAttribute("normal",new mt(a,3)),o.length>0&&u.setAttribute("color",new mt(o,3)),l.length>0&&u.setAttribute("intensity",new mt(l,1)),c.length>0&&u.setAttribute("label",new mp(c,1)),u.computeBoundingSphere();const d=new Wi({size:.005});return o.length>0&&(d.vertexColors=!0),new Qr(u,d)}}class jh extends l0{constructor(e){super(e)}parse(e){function t(k){switch(k.image_type){case d:case _:if(k.colormap_length>256||k.colormap_size!==24||k.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case f:case m:case g:case p:if(k.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case u:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+k.image_type)}if(k.width<=0||k.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(k.pixel_size!==8&&k.pixel_size!==16&&k.pixel_size!==24&&k.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+k.pixel_size)}function n(k,Q,q,he,ye){let le,Le;const we=q.pixel_size>>3,Y=q.width*q.height*we;if(Q&&(Le=ye.subarray(he,he+=q.colormap_length*(q.colormap_size>>3))),k){le=new Uint8Array(Y);let re,ae,oe,Se=0;const _e=new Uint8Array(we);for(;Se<Y;)if(re=ye[he++],ae=(re&127)+1,re&128){for(oe=0;oe<we;++oe)_e[oe]=ye[he++];for(oe=0;oe<ae;++oe)le.set(_e,Se+oe*we);Se+=we*ae}else{for(ae*=we,oe=0;oe<ae;++oe)le[Se+oe]=ye[he++];Se+=ae}}else le=ye.subarray(he,he+=Q?q.width*q.height:Y);return{pixel_data:le,palettes:Le}}function i(k,Q,q,he,ye,le,Le,we,Y){const re=Y;let ae,oe=0,Se,_e;const Ae=x.width;for(_e=Q;_e!==he;_e+=q)for(Se=ye;Se!==Le;Se+=le,oe++)ae=we[oe],k[(Se+Ae*_e)*4+3]=255,k[(Se+Ae*_e)*4+2]=re[ae*3+0],k[(Se+Ae*_e)*4+1]=re[ae*3+1],k[(Se+Ae*_e)*4+0]=re[ae*3+2];return k}function s(k,Q,q,he,ye,le,Le,we){let Y,re=0,ae,oe;const Se=x.width;for(oe=Q;oe!==he;oe+=q)for(ae=ye;ae!==Le;ae+=le,re+=2)Y=we[re+0]+(we[re+1]<<8),k[(ae+Se*oe)*4+0]=(Y&31744)>>7,k[(ae+Se*oe)*4+1]=(Y&992)>>2,k[(ae+Se*oe)*4+2]=(Y&31)<<3,k[(ae+Se*oe)*4+3]=Y&32768?0:255;return k}function a(k,Q,q,he,ye,le,Le,we){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==he;ae+=q)for(re=ye;re!==Le;re+=le,Y+=3)k[(re+oe*ae)*4+3]=255,k[(re+oe*ae)*4+2]=we[Y+0],k[(re+oe*ae)*4+1]=we[Y+1],k[(re+oe*ae)*4+0]=we[Y+2];return k}function o(k,Q,q,he,ye,le,Le,we){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==he;ae+=q)for(re=ye;re!==Le;re+=le,Y+=4)k[(re+oe*ae)*4+2]=we[Y+0],k[(re+oe*ae)*4+1]=we[Y+1],k[(re+oe*ae)*4+0]=we[Y+2],k[(re+oe*ae)*4+3]=we[Y+3];return k}function l(k,Q,q,he,ye,le,Le,we){let Y,re=0,ae,oe;const Se=x.width;for(oe=Q;oe!==he;oe+=q)for(ae=ye;ae!==Le;ae+=le,re++)Y=we[re],k[(ae+Se*oe)*4+0]=Y,k[(ae+Se*oe)*4+1]=Y,k[(ae+Se*oe)*4+2]=Y,k[(ae+Se*oe)*4+3]=255;return k}function c(k,Q,q,he,ye,le,Le,we){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==he;ae+=q)for(re=ye;re!==Le;re+=le,Y+=2)k[(re+oe*ae)*4+0]=we[Y+0],k[(re+oe*ae)*4+1]=we[Y+0],k[(re+oe*ae)*4+2]=we[Y+0],k[(re+oe*ae)*4+3]=we[Y+1];return k}function h(k,Q,q,he,ye){let le,Le,we,Y,re,ae;switch((x.flags&S)>>E){default:case C:le=0,we=1,re=Q,Le=0,Y=1,ae=q;break;case v:le=0,we=1,re=Q,Le=q-1,Y=-1,ae=-1;break;case T:le=Q-1,we=-1,re=-1,Le=0,Y=1,ae=q;break;case U:le=Q-1,we=-1,re=-1,Le=q-1,Y=-1,ae=-1;break}if(V)switch(x.pixel_size){case 8:l(k,Le,Y,ae,le,we,re,he);break;case 16:c(k,Le,Y,ae,le,we,re,he);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(x.pixel_size){case 8:i(k,Le,Y,ae,le,we,re,he,ye);break;case 16:s(k,Le,Y,ae,le,we,re,he);break;case 24:a(k,Le,Y,ae,le,we,re,he);break;case 32:o(k,Le,Y,ae,le,we,re,he);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return k}const u=0,d=1,f=2,m=3,_=9,g=10,p=11,S=48,E=4,v=0,U=1,C=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let L=0;const b=new Uint8Array(e),x={id_length:b[L++],colormap_type:b[L++],image_type:b[L++],colormap_index:b[L++]|b[L++]<<8,colormap_length:b[L++]|b[L++]<<8,colormap_size:b[L++],origin:[b[L++]|b[L++]<<8,b[L++]|b[L++]<<8],width:b[L++]|b[L++]<<8,height:b[L++]|b[L++]<<8,pixel_size:b[L++],flags:b[L++]};if(t(x),x.id_length+L>e.length)throw new Error("THREE.TGALoader: No data.");L+=x.id_length;let R=!1,B=!1,V=!1;switch(x.image_type){case _:R=!0,B=!0;break;case d:B=!0;break;case g:R=!0;break;case f:break;case p:R=!0,V=!0;break;case m:V=!0;break}const W=new Uint8Array(x.width*x.height*4),ee=n(R,B,x,L,b);return h(W,x.width,x.height,ee.pixel_data,ee.palettes),{data:W,width:x.width,height:x.height,flipY:!0,generateMipmaps:!0,minFilter:ui}}}class O3 extends Gn{load(e,t,n,i){const s=this,a=s.path===""?Yl.extractUrlBase(e):s.path,o=new zr(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(l,a))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},n,i)}parse(e,t){function n(M,y){const P=[],w=M.childNodes;for(let I=0,ie=w.length;I<ie;I++){const de=w[I];de.nodeName===y&&P.push(de)}return P}function i(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=y[w];return P}function s(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=parseFloat(y[w]);return P}function a(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=parseInt(y[w]);return P}function o(M){return M.substring(1)}function l(){return"three_default_"+ni++}function c(M){return Object.keys(M).length===0}function h(M){return{unit:u(n(M,"unit")[0]),upAxis:d(n(M,"up_axis")[0])}}function u(M){return M!==void 0&&M.hasAttribute("meter")===!0?parseFloat(M.getAttribute("meter")):1}function d(M){return M!==void 0?M.textContent:"Y_UP"}function f(M,y,P,w){const I=n(M,y)[0];if(I!==void 0){const ie=n(I,P);for(let de=0;de<ie.length;de++)w(ie[de])}}function m(M,y){for(const P in M){const w=M[P];w.build=y(M[P])}}function _(M,y){return M.build!==void 0||(M.build=y(M)),M.build}function g(M){const y={sources:{},samplers:{},channels:{}};let P=!1;for(let w=0,I=M.childNodes.length;w<I;w++){const ie=M.childNodes[w];if(ie.nodeType!==1)continue;let de;switch(ie.nodeName){case"source":de=ie.getAttribute("id"),y.sources[de]=ve(ie);break;case"sampler":de=ie.getAttribute("id"),y.samplers[de]=p(ie);break;case"channel":de=ie.getAttribute("target"),y.channels[de]=S(ie);break;case"animation":g(ie),P=!0;break;default:console.log(ie)}}P===!1&&(ft.animations[M.getAttribute("id")||Hi.generateUUID()]=y)}function p(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=o(I.getAttribute("source")),de=I.getAttribute("semantic");y.inputs[de]=ie;break}}return y}function S(M){const y={};let w=M.getAttribute("target").split("/");const I=w.shift();let ie=w.shift();const de=ie.indexOf("(")!==-1,We=ie.indexOf(".")!==-1;if(We)w=ie.split("."),ie=w.shift(),y.member=w.shift();else if(de){const Ue=ie.split("(");ie=Ue.shift();for(let ze=0;ze<Ue.length;ze++)Ue[ze]=parseInt(Ue[ze].replace(/\)/,""));y.indices=Ue}return y.id=I,y.sid=ie,y.arraySyntax=de,y.memberSyntax=We,y.sampler=o(M.getAttribute("source")),y}function E(M){const y=[],P=M.channels,w=M.samplers,I=M.sources;for(const ie in P)if(P.hasOwnProperty(ie)){const de=P[ie],We=w[de.sampler],Ue=We.inputs.INPUT,ze=We.inputs.OUTPUT,Qe=I[Ue],xe=I[ze],Ke=U(de,Qe,xe);x(Ke,y)}return y}function v(M){return _(ft.animations[M],E)}function U(M,y,P){const w=ft.nodes[M.id],I=gt(w.id),ie=w.transforms[M.sid],de=w.matrix.clone().transpose();let We,Ue,ze,Qe,xe,Ke;const $e={};switch(ie){case"matrix":for(ze=0,Qe=y.array.length;ze<Qe;ze++)if(We=y.array[ze],Ue=ze*P.stride,$e[We]===void 0&&($e[We]={}),M.arraySyntax===!0){const Vt=P.array[Ue],Lt=M.indices[0]+4*M.indices[1];$e[We][Lt]=Vt}else for(xe=0,Ke=P.stride;xe<Ke;xe++)$e[We][xe]=P.array[Ue+xe];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break}const at=C($e,de);return{name:I.uuid,keyframes:at}}function C(M,y){const P=[];for(const I in M)P.push({time:parseFloat(I),value:M[I]});P.sort(w);for(let I=0;I<16;I++)R(P,I,y.elements[I]);return P;function w(I,ie){return I.time-ie.time}}const T=new F,L=new F,b=new Rn;function x(M,y){const P=M.keyframes,w=M.name,I=[],ie=[],de=[],We=[];for(let Ue=0,ze=P.length;Ue<ze;Ue++){const Qe=P[Ue],xe=Qe.time,Ke=Qe.value;X.fromArray(Ke).transpose(),X.decompose(T,b,L),I.push(xe),ie.push(T.x,T.y,T.z),de.push(b.x,b.y,b.z,b.w),We.push(L.x,L.y,L.z)}return ie.length>0&&y.push(new Ir(w+".position",I,ie)),de.length>0&&y.push(new ds(w+".quaternion",I,de)),We.length>0&&y.push(new Ir(w+".scale",I,We)),y}function R(M,y,P){let w,I=!0,ie,de;for(ie=0,de=M.length;ie<de;ie++)w=M[ie],w.value[y]===void 0?w.value[y]=null:I=!1;if(I===!0)for(ie=0,de=M.length;ie<de;ie++)w=M[ie],w.value[y]=P;else B(M,y)}function B(M,y){let P,w;for(let I=0,ie=M.length;I<ie;I++){const de=M[I];if(de.value[y]===null){if(P=V(M,I,y),w=W(M,I,y),P===null){de.value[y]=w.value[y];continue}if(w===null){de.value[y]=P.value[y];continue}ee(de,P,w,y)}}}function V(M,y,P){for(;y>=0;){const w=M[y];if(w.value[P]!==null)return w;y--}return null}function W(M,y,P){for(;y<M.length;){const w=M[y];if(w.value[P]!==null)return w;y++}return null}function ee(M,y,P,w){if(P.time-y.time===0){M.value[w]=y.value[w];return}M.value[w]=(M.time-y.time)*(P.value[w]-y.value[w])/(P.time-y.time)+y.value[w]}function k(M){const y={name:M.getAttribute("id")||"default",start:parseFloat(M.getAttribute("start")||0),end:parseFloat(M.getAttribute("end")||0),animations:[]};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"instance_animation":y.animations.push(o(I.getAttribute("url")));break}}ft.clips[M.getAttribute("id")]=y}function Q(M){const y=[],P=M.name,w=M.end-M.start||-1,I=M.animations;for(let ie=0,de=I.length;ie<de;ie++){const We=v(I[ie]);for(let Ue=0,ze=We.length;Ue<ze;Ue++)y.push(We[Ue])}return new Jc(P,w,y)}function q(M){return _(ft.clips[M],Q)}function he(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"skin":y.id=o(I.getAttribute("source")),y.skin=ye(I);break;case"morph":y.id=o(I.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}ft.controllers[M.getAttribute("id")]=y}function ye(M){const y={sources:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"bind_shape_matrix":y.bindShapeMatrix=s(I.textContent);break;case"source":const ie=I.getAttribute("id");y.sources[ie]=ve(I);break;case"joints":y.joints=le(I);break;case"vertex_weights":y.vertexWeights=Le(I);break}}return y}function le(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=I.getAttribute("semantic"),de=o(I.getAttribute("source"));y.inputs[ie]=de;break}}return y}function Le(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=I.getAttribute("semantic"),de=o(I.getAttribute("source")),We=parseInt(I.getAttribute("offset"));y.inputs[ie]={id:de,offset:We};break;case"vcount":y.vcount=a(I.textContent);break;case"v":y.v=a(I.textContent);break}}return y}function we(M){const y={id:M.id},P=ft.geometries[y.id];return M.skin!==void 0&&(y.skin=Y(M.skin),P.sources.skinIndices=y.skin.indices,P.sources.skinWeights=y.skin.weights),y}function Y(M){const P={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},w=M.sources,I=M.vertexWeights,ie=I.vcount,de=I.v,We=I.inputs.JOINT.offset,Ue=I.inputs.WEIGHT.offset,ze=M.sources[M.joints.inputs.JOINT],Qe=M.sources[M.joints.inputs.INV_BIND_MATRIX],xe=w[I.inputs.WEIGHT.id].array;let Ke=0,$e,at,it;for($e=0,it=ie.length;$e<it;$e++){const Lt=ie[$e],At=[];for(at=0;at<Lt;at++){const wt=de[Ke+We],ii=de[Ke+Ue],xn=xe[ii];At.push({index:wt,weight:xn}),Ke+=2}for(At.sort(Vt),at=0;at<4;at++){const wt=At[at];wt!==void 0?(P.indices.array.push(wt.index),P.weights.array.push(wt.weight)):(P.indices.array.push(0),P.weights.array.push(0))}}for(M.bindShapeMatrix?P.bindMatrix=new lt().fromArray(M.bindShapeMatrix).transpose():P.bindMatrix=new lt().identity(),$e=0,it=ze.array.length;$e<it;$e++){const Lt=ze.array[$e],At=new lt().fromArray(Qe.array,$e*Qe.stride).transpose();P.joints.push({name:Lt,boneInverse:At})}return P;function Vt(Lt,At){return At.weight-Lt.weight}}function re(M){return _(ft.controllers[M],we)}function ae(M){const y={init_from:n(M,"init_from")[0].textContent};ft.images[M.getAttribute("id")]=y}function oe(M){return M.build!==void 0?M.build:M.init_from}function Se(M){const y=ft.images[M];return y!==void 0?_(y,oe):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",M),null)}function _e(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"profile_COMMON":y.profile=Ae(I);break}}ft.effects[M.getAttribute("id")]=y}function Ae(M){const y={surfaces:{},samplers:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"newparam":ke(I,y);break;case"technique":y.technique=O(I);break;case"extra":y.extra=ce(I);break}}return y}function ke(M,y){const P=M.getAttribute("sid");for(let w=0,I=M.childNodes.length;w<I;w++){const ie=M.childNodes[w];if(ie.nodeType===1)switch(ie.nodeName){case"surface":y.surfaces[P]=tt(ie);break;case"sampler2D":y.samplers[P]=Ze(ie);break}}}function tt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"init_from":y.init_from=I.textContent;break}}return y}function Ze(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"source":y.source=I.textContent;break}}return y}function O(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"constant":case"lambert":case"blinn":case"phong":y.type=I.nodeName,y.parameters=bt(I);break;case"extra":y.extra=ce(I);break}}return y}function bt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":y[I.nodeName]=$(I);break;case"transparent":y[I.nodeName]={opaque:I.hasAttribute("opaque")?I.getAttribute("opaque"):"A_ONE",data:$(I)};break}}return y}function $(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"color":y[I.nodeName]=s(I.textContent);break;case"float":y[I.nodeName]=parseFloat(I.textContent);break;case"texture":y[I.nodeName]={id:I.getAttribute("texture"),extra:pe(I)};break}}return y}function pe(M){const y={technique:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"extra":te(I,y);break}}return y}function te(M,y){for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique":Te(I,y);break}}}function Te(M,y){for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":y.technique[I.nodeName]=parseFloat(I.textContent);break;case"wrapU":case"wrapV":I.textContent.toUpperCase()==="TRUE"?y.technique[I.nodeName]=1:I.textContent.toUpperCase()==="FALSE"?y.technique[I.nodeName]=0:y.technique[I.nodeName]=parseInt(I.textContent);break;case"bump":y[I.nodeName]=De(I);break}}}function ce(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique":y.technique=ue(I);break}}return y}function ue(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"double_sided":y[I.nodeName]=parseInt(I.textContent);break;case"bump":y[I.nodeName]=De(I);break}}return y}function De(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"texture":y[I.nodeName]={id:I.getAttribute("texture"),texcoord:I.getAttribute("texcoord"),extra:pe(I)};break}}return y}function N(M){return M}function A(M){return _(ft.effects[M],N)}function G(M){const y={name:M.getAttribute("name")};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"instance_effect":y.url=o(I.getAttribute("url"));break}}ft.materials[M.getAttribute("id")]=y}function z(M){let y,P=M.slice((M.lastIndexOf(".")-1>>>0)+2);switch(P=P.toLowerCase(),P){case"tga":y=un;break;default:y=mn}return y}function se(M){const y=A(M.url),P=y.profile.technique;let w;switch(P.type){case"phong":case"blinn":w=new Mn;break;case"lambert":w=new Yp;break;default:w=new Ri;break}w.name=M.name||"";function I(Ue,ze=null){const Qe=y.profile.samplers[Ue.id];let xe=null;if(Qe!==void 0){const Ke=y.profile.surfaces[Qe.source];xe=Se(Ke.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),xe=Se(Ue.id);if(xe!==null){const Ke=z(xe);if(Ke!==void 0){const $e=Ke.load(xe),at=Ue.extra;if(at!==void 0&&at.technique!==void 0&&c(at.technique)===!1){const it=at.technique;$e.wrapS=it.wrapU?$n:kn,$e.wrapT=it.wrapV?$n:kn,$e.offset.set(it.offsetU||0,it.offsetV||0),$e.repeat.set(it.repeatU||1,it.repeatV||1)}else $e.wrapS=$n,$e.wrapT=$n;return ze!==null&&($e.colorSpace=ze),$e}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",xe),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Ue.id),null}const ie=P.parameters;for(const Ue in ie){const ze=ie[Ue];switch(Ue){case"diffuse":ze.color&&w.color.fromArray(ze.color),ze.texture&&(w.map=I(ze.texture,Tt));break;case"specular":ze.color&&w.specular&&w.specular.fromArray(ze.color),ze.texture&&(w.specularMap=I(ze.texture));break;case"bump":ze.texture&&(w.normalMap=I(ze.texture));break;case"ambient":ze.texture&&(w.lightMap=I(ze.texture,Tt));break;case"shininess":ze.float&&w.shininess&&(w.shininess=ze.float);break;case"emission":ze.color&&w.emissive&&w.emissive.fromArray(ze.color),ze.texture&&(w.emissiveMap=I(ze.texture,Tt));break}}xt.colorSpaceToWorking(w.color,Tt),w.specular&&xt.colorSpaceToWorking(w.specular,Tt),w.emissive&&xt.colorSpaceToWorking(w.emissive,Tt);let de=ie.transparent,We=ie.transparency;if(We===void 0&&de&&(We={float:1}),de===void 0&&We&&(de={opaque:"A_ONE",data:{color:[1,1,1,1]}}),de&&We)if(de.data.texture)w.transparent=!0;else{const Ue=de.data.color;switch(de.opaque){case"A_ONE":w.opacity=Ue[3]*We.float;break;case"RGB_ZERO":w.opacity=1-Ue[0]*We.float;break;case"A_ZERO":w.opacity=1-Ue[3]*We.float;break;case"RGB_ONE":w.opacity=Ue[0]*We.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',de.opaque)}w.opacity<1&&(w.transparent=!0)}if(P.extra!==void 0&&P.extra.technique!==void 0){const Ue=P.extra.technique;for(const ze in Ue){const Qe=Ue[ze];switch(ze){case"double_sided":w.side=Qe===1?pn:Hn;break;case"bump":w.normalMap=I(Qe.texture),w.normalScale=new Xe(1,1);break}}}return w}function ne(M){return _(ft.materials[M],se)}function Ce(M){const y={name:M.getAttribute("name")};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"optics":y.optics=Ee(I);break}}ft.cameras[M.getAttribute("id")]=y}function Ee(M){for(let y=0;y<M.childNodes.length;y++){const P=M.childNodes[y];switch(P.nodeName){case"technique_common":return Be(P)}}return{}}function Be(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"perspective":case"orthographic":y.technique=w.nodeName,y.parameters=Ve(w);break}}return y}function Ve(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":y[w.nodeName]=parseFloat(w.textContent);break}}return y}function me(M){let y;switch(M.optics.technique){case"perspective":y=new ln(M.optics.parameters.yfov,M.optics.parameters.aspect_ratio,M.optics.parameters.znear,M.optics.parameters.zfar);break;case"orthographic":let P=M.optics.parameters.ymag,w=M.optics.parameters.xmag;const I=M.optics.parameters.aspect_ratio;w=w===void 0?P*I:w,P=P===void 0?w/I:P,w*=.5,P*=.5,y=new Ta(-w,w,P,-P,M.optics.parameters.znear,M.optics.parameters.zfar);break;default:y=new ln;break}return y.name=M.name||"",y}function Pe(M){const y=ft.cameras[M];return y!==void 0?_(y,me):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",M),null)}function Je(M){let y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique_common":y=nt(I);break}}ft.lights[M.getAttribute("id")]=y}function nt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"directional":case"point":case"spot":case"ambient":y.technique=I.nodeName,y.parameters=Ie(I)}}return y}function Ie(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"color":const ie=s(I.textContent);y.color=new ot().fromArray(ie),xt.colorSpaceToWorking(y.color,Tt);break;case"falloff_angle":y.falloffAngle=parseFloat(I.textContent);break;case"quadratic_attenuation":const de=parseFloat(I.textContent);y.distance=de?Math.sqrt(1/de):0;break}}return y}function ct(M){let y;switch(M.technique){case"directional":y=new zu;break;case"point":y=new Ou;break;case"spot":y=new u0;break;case"ambient":y=new Bu;break}return M.parameters.color&&y.color.copy(M.parameters.color),M.parameters.distance&&(y.distance=M.parameters.distance),y}function H(M){const y=ft.lights[M];return y!==void 0?_(y,ct):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",M),null)}function Fe(M){const y={name:M.getAttribute("name"),sources:{},vertices:{},primitives:[]},P=n(M,"mesh")[0];if(P!==void 0){for(let w=0;w<P.childNodes.length;w++){const I=P.childNodes[w];if(I.nodeType!==1)continue;const ie=I.getAttribute("id");switch(I.nodeName){case"source":y.sources[ie]=ve(I);break;case"vertices":y.vertices=He(I);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",I.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":y.primitives.push(Me(I));break;default:console.log(I)}}ft.geometries[M.getAttribute("id")]=y}}function ve(M){const y={array:[],stride:3};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"float_array":y.array=s(w.textContent);break;case"Name_array":y.array=i(w.textContent);break;case"technique_common":const I=n(w,"accessor")[0];I!==void 0&&(y.stride=parseInt(I.getAttribute("stride")));break}}return y}function He(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];w.nodeType===1&&(y[w.getAttribute("semantic")]=o(w.getAttribute("source")))}return y}function Me(M){const y={type:M.nodeName,material:M.getAttribute("material"),count:parseInt(M.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=o(I.getAttribute("source")),de=I.getAttribute("semantic"),We=parseInt(I.getAttribute("offset")),Ue=parseInt(I.getAttribute("set")),ze=Ue>0?de+Ue:de;y.inputs[ze]={id:ie,offset:We},y.stride=Math.max(y.stride,We+1),de==="TEXCOORD"&&(y.hasUV=!0);break;case"vcount":y.vcount=a(I.textContent);break;case"p":y.p=a(I.textContent);break}}return y}function ge(M){const y={};for(let P=0;P<M.length;P++){const w=M[P];y[w.type]===void 0&&(y[w.type]=[]),y[w.type].push(w)}return y}function qe(M){let y=0;for(let P=0,w=M.length;P<w;P++)M[P].hasUV===!0&&y++;y>0&&y<M.length&&(M.uvsNeedsFix=!0)}function ht(M){const y={},P=M.sources,w=M.vertices,I=M.primitives;if(I.length===0)return{};const ie=ge(I);for(const de in ie){const We=ie[de];qe(We),y[de]=Dt(We,P,w)}return y}function Dt(M,y,P){const w={},I={array:[],stride:0},ie={array:[],stride:0},de={array:[],stride:0},We={array:[],stride:0},Ue={array:[],stride:0},ze={array:[],stride:4},Qe={array:[],stride:4},xe=new Bt,Ke=[];let $e=0;for(let at=0;at<M.length;at++){const it=M[at],Vt=it.inputs;let Lt=0;switch(it.type){case"lines":case"linestrips":Lt=it.count*2;break;case"triangles":Lt=it.count*3;break;case"polylist":for(let At=0;At<it.count;At++){const wt=it.vcount[At];switch(wt){case 3:Lt+=3;break;case 4:Lt+=6;break;default:Lt+=(wt-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",it.type)}xe.addGroup($e,Lt,at),$e+=Lt,it.material&&Ke.push(it.material);for(const At in Vt){const wt=Vt[At];switch(At){case"VERTEX":for(const ii in P){const xn=P[ii];switch(ii){case"POSITION":const nr=I.array.length;if(pt(it,y[xn],wt.offset,I.array),I.stride=y[xn].stride,y.skinWeights&&y.skinIndices&&(pt(it,y.skinIndices,wt.offset,ze.array),pt(it,y.skinWeights,wt.offset,Qe.array)),it.hasUV===!1&&M.uvsNeedsFix===!0){const ad=(I.array.length-nr)/I.stride;for(let Ql=0;Ql<ad;Ql++)de.array.push(0,0)}break;case"NORMAL":pt(it,y[xn],wt.offset,ie.array),ie.stride=y[xn].stride;break;case"COLOR":pt(it,y[xn],wt.offset,Ue.array),Ue.stride=y[xn].stride;break;case"TEXCOORD":pt(it,y[xn],wt.offset,de.array),de.stride=y[xn].stride;break;case"TEXCOORD1":pt(it,y[xn],wt.offset,We.array),de.stride=y[xn].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',ii)}}break;case"NORMAL":pt(it,y[wt.id],wt.offset,ie.array),ie.stride=y[wt.id].stride;break;case"COLOR":pt(it,y[wt.id],wt.offset,Ue.array,!0),Ue.stride=y[wt.id].stride;break;case"TEXCOORD":pt(it,y[wt.id],wt.offset,de.array),de.stride=y[wt.id].stride;break;case"TEXCOORD1":pt(it,y[wt.id],wt.offset,We.array),We.stride=y[wt.id].stride;break}}}return I.array.length>0&&xe.setAttribute("position",new mt(I.array,I.stride)),ie.array.length>0&&xe.setAttribute("normal",new mt(ie.array,ie.stride)),Ue.array.length>0&&xe.setAttribute("color",new mt(Ue.array,Ue.stride)),de.array.length>0&&xe.setAttribute("uv",new mt(de.array,de.stride)),We.array.length>0&&xe.setAttribute("uv1",new mt(We.array,We.stride)),ze.array.length>0&&xe.setAttribute("skinIndex",new mt(ze.array,ze.stride)),Qe.array.length>0&&xe.setAttribute("skinWeight",new mt(Qe.array,Qe.stride)),w.data=xe,w.type=M[0].type,w.materialKeys=Ke,w}function pt(M,y,P,w,I=!1){const ie=M.p,de=M.stride,We=M.vcount;function Ue(xe){let Ke=ie[xe+P]*Qe;const $e=Ke+Qe;for(;Ke<$e;Ke++)w.push(ze[Ke]);if(I){const at=w.length-Qe-1;Xt.setRGB(w[at+0],w[at+1],w[at+2],Tt),w[at+0]=Xt.r,w[at+1]=Xt.g,w[at+2]=Xt.b}}const ze=y.array,Qe=y.stride;if(M.vcount!==void 0){let xe=0;for(let Ke=0,$e=We.length;Ke<$e;Ke++){const at=We[Ke];if(at===4){const it=xe+de*0,Vt=xe+de*1,Lt=xe+de*2,At=xe+de*3;Ue(it),Ue(Vt),Ue(At),Ue(Vt),Ue(Lt),Ue(At)}else if(at===3){const it=xe+de*0,Vt=xe+de*1,Lt=xe+de*2;Ue(it),Ue(Vt),Ue(Lt)}else if(at>4)for(let it=1,Vt=at-2;it<=Vt;it++){const Lt=xe+de*0,At=xe+de*it,wt=xe+de*(it+1);Ue(Lt),Ue(At),Ue(wt)}xe+=de*at}}else for(let xe=0,Ke=ie.length;xe<Ke;xe+=de)Ue(xe)}function en(M){return _(ft.geometries[M],ht)}function je(M){const y={name:M.getAttribute("name")||"",joints:{},links:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"technique_common":tn(w,y);break}}ft.kinematicsModels[M.getAttribute("id")]=y}function Zt(M){return M.build!==void 0?M.build:M}function jt(M){return _(ft.kinematicsModels[M],Zt)}function tn(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"joint":y.joints[w.getAttribute("sid")]=Di(w);break;case"link":y.links.push(rt(w));break}}}function Di(M){let y;for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"prismatic":case"revolute":y=ti(w);break}}return y}function ti(M){const y={sid:M.getAttribute("sid"),name:M.getAttribute("name")||"",axis:new F,limits:{min:0,max:0},type:M.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"axis":const I=s(w.textContent);y.axis.fromArray(I);break;case"limits":const ie=w.getElementsByTagName("max")[0],de=w.getElementsByTagName("min")[0];y.limits.max=parseFloat(ie.textContent),y.limits.min=parseFloat(de.textContent);break}}return y.limits.min>=y.limits.max&&(y.static=!0),y.middlePosition=(y.limits.min+y.limits.max)/2,y}function rt(M){const y={sid:M.getAttribute("sid"),name:M.getAttribute("name")||"",attachments:[],transforms:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"attachment_full":y.attachments.push(Re(w));break;case"matrix":case"translate":case"rotate":y.transforms.push(Ht(w));break}}return y}function Re(M){const y={joint:M.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"link":y.links.push(rt(w));break;case"matrix":case"translate":case"rotate":y.transforms.push(Ht(w));break}}return y}function Ht(M){const y={type:M.nodeName},P=s(M.textContent);switch(y.type){case"matrix":y.obj=new lt,y.obj.fromArray(P).transpose();break;case"translate":y.obj=new F,y.obj.fromArray(P);break;case"rotate":y.obj=new F,y.obj.fromArray(P),y.angle=Hi.degToRad(P[3]);break}return y}function nn(M){const y={name:M.getAttribute("name")||"",rigidBodies:{}};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"rigid_body":y.rigidBodies[w.getAttribute("name")]={},Wt(w,y.rigidBodies[w.getAttribute("name")]);break}}ft.physicsModels[M.getAttribute("id")]=y}function Wt(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"technique_common":hn(w,y);break}}}function hn(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"inertia":y.inertia=s(w.textContent);break;case"mass":y.mass=s(w.textContent)[0];break}}}function En(M){const y={bindJointAxis:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"bind_joint_axis":y.bindJointAxis.push(Ji(w));break}}ft.kinematicsScenes[o(M.getAttribute("url"))]=y}function Ji(M){const y={target:M.getAttribute("target").split("/").pop()};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"axis":const I=w.getElementsByTagName("param")[0];y.axis=I.textContent;const ie=y.axis.split("inst_").pop().split("axis")[0];y.jointIndex=ie.substring(0,ie.length-1);break}}return y}function Ki(M){return M.build!==void 0?M.build:M}function Zi(M){return _(ft.kinematicsScenes[M],Ki)}function Qi(){const M=Object.keys(ft.kinematicsModels)[0],y=Object.keys(ft.kinematicsScenes)[0],P=Object.keys(ft.visualScenes)[0];if(M===void 0||y===void 0)return;const w=jt(M),I=Zi(y),ie=St(P),de=I.bindJointAxis,We={};for(let Qe=0,xe=de.length;Qe<xe;Qe++){const Ke=de[Qe],$e=zt.querySelector('[sid="'+Ke.target+'"]');if($e){const at=$e.parentElement;Ue(Ke.jointIndex,at)}}function Ue(Qe,xe){const Ke=xe.getAttribute("name"),$e=w.joints[Qe];ie.traverse(function(at){at.name===Ke&&(We[Qe]={object:at,transforms:er(xe),joint:$e,position:$e.zeroPosition})})}const ze=new lt;tr={joints:w&&w.joints,getJointValue:function(Qe){const xe=We[Qe];if(xe)return xe.position;console.warn("THREE.ColladaLoader: Joint "+Qe+" doesn't exist.")},setJointValue:function(Qe,xe){const Ke=We[Qe];if(Ke){const $e=Ke.joint;if(xe>$e.limits.max||xe<$e.limits.min)console.warn("THREE.ColladaLoader: Joint "+Qe+" value "+xe+" outside of limits (min: "+$e.limits.min+", max: "+$e.limits.max+").");else if($e.static)console.warn("THREE.ColladaLoader: Joint "+Qe+" is static.");else{const at=Ke.object,it=$e.axis,Vt=Ke.transforms;X.identity();for(let Lt=0;Lt<Vt.length;Lt++){const At=Vt[Lt];if(At.sid&&At.sid.indexOf(Qe)!==-1)switch($e.type){case"revolute":X.multiply(ze.makeRotationAxis(it,Hi.degToRad(xe)));break;case"prismatic":X.multiply(ze.makeTranslation(it.x*xe,it.y*xe,it.z*xe));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+$e.type);break}else switch(At.type){case"matrix":X.multiply(At.obj);break;case"translate":X.multiply(ze.makeTranslation(At.obj.x,At.obj.y,At.obj.z));break;case"scale":X.scale(At.obj);break;case"rotate":X.multiply(ze.makeRotationAxis(At.obj,At.angle));break}}at.matrix.copy(X),at.matrix.decompose(at.position,at.quaternion,at.scale),We[Qe].position=xe}}else console.log("THREE.ColladaLoader: "+Qe+" does not exist.")}}}function er(M){const y=[],P=zt.querySelector('[id="'+M.id+'"]');for(let w=0;w<P.childNodes.length;w++){const I=P.childNodes[w];if(I.nodeType!==1)continue;let ie,de;switch(I.nodeName){case"matrix":ie=s(I.textContent);const We=new lt().fromArray(ie).transpose();y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:We});break;case"translate":case"scale":ie=s(I.textContent),de=new F().fromArray(ie),y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:de});break;case"rotate":ie=s(I.textContent),de=new F().fromArray(ie);const Ue=Hi.degToRad(ie[3]);y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:de,angle:Ue});break}}return y}function D(M){const y=M.getElementsByTagName("node");for(let P=0;P<y.length;P++){const w=y[P];w.hasAttribute("id")===!1&&w.setAttribute("id",l())}}const X=new lt,J=new F;function Z(M){const y={name:M.getAttribute("name")||"",type:M.getAttribute("type"),id:M.getAttribute("id"),sid:M.getAttribute("sid"),matrix:new lt,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType!==1)continue;let I;switch(w.nodeName){case"node":y.nodes.push(w.getAttribute("id")),Z(w);break;case"instance_camera":y.instanceCameras.push(o(w.getAttribute("url")));break;case"instance_controller":y.instanceControllers.push(j(w));break;case"instance_light":y.instanceLights.push(o(w.getAttribute("url")));break;case"instance_geometry":y.instanceGeometries.push(j(w));break;case"instance_node":y.instanceNodes.push(o(w.getAttribute("url")));break;case"matrix":I=s(w.textContent),y.matrix.multiply(X.fromArray(I).transpose()),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"translate":I=s(w.textContent),J.fromArray(I),y.matrix.multiply(X.makeTranslation(J.x,J.y,J.z)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"rotate":I=s(w.textContent);const ie=Hi.degToRad(I[3]);y.matrix.multiply(X.makeRotationAxis(J.fromArray(I),ie)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"scale":I=s(w.textContent),y.matrix.scale(J.fromArray(I)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"extra":break;default:console.log(w)}}return et(y.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",y.id):ft.nodes[y.id]=y,y}function j(M){const y={id:o(M.getAttribute("url")),materials:{},skeletons:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"bind_material":const I=w.getElementsByTagName("instance_material");for(let ie=0;ie<I.length;ie++){const de=I[ie],We=de.getAttribute("symbol"),Ue=de.getAttribute("target");y.materials[We]=o(Ue)}break;case"skeleton":y.skeletons.push(o(w.textContent));break}}return y}function be(M,y){const P=[],w=[];let I,ie,de;for(I=0;I<M.length;I++){const ze=M[I];let Qe;if(et(ze))Qe=gt(ze),Oe(Qe,y,P);else if(kt(ze)){const Ke=ft.visualScenes[ze].children;for(let $e=0;$e<Ke.length;$e++){const at=Ke[$e];if(at.type==="JOINT"){const it=gt(at.id);Oe(it,y,P)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",ze)}for(I=0;I<y.length;I++)for(ie=0;ie<P.length;ie++)if(de=P[ie],de.bone.name===y[I].name){w[I]=de,de.processed=!0;break}for(I=0;I<P.length;I++)de=P[I],de.processed===!1&&(w.push(de),de.processed=!0);const We=[],Ue=[];for(I=0;I<w.length;I++)de=w[I],We.push(de.bone),Ue.push(de.boneInverse);return new Bl(We,Ue)}function Oe(M,y,P){M.traverse(function(w){if(w.isBone===!0){let I;for(let ie=0;ie<y.length;ie++){const de=y[ie];if(de.name===w.name){I=de.boneInverse;break}}I===void 0&&(I=new lt),P.push({bone:w,boneInverse:I,processed:!1})}})}function Ye(M){const y=[],P=M.matrix,w=M.nodes,I=M.type,ie=M.instanceCameras,de=M.instanceControllers,We=M.instanceLights,Ue=M.instanceGeometries,ze=M.instanceNodes;for(let xe=0,Ke=w.length;xe<Ke;xe++)y.push(gt(w[xe]));for(let xe=0,Ke=ie.length;xe<Ke;xe++){const $e=Pe(ie[xe]);$e!==null&&y.push($e.clone())}for(let xe=0,Ke=de.length;xe<Ke;xe++){const $e=de[xe],at=re($e.id),it=en(at.id),Vt=dt(it,$e.materials),Lt=$e.skeletons,At=at.skin.joints,wt=be(Lt,At);for(let ii=0,xn=Vt.length;ii<xn;ii++){const nr=Vt[ii];nr.isSkinnedMesh&&(nr.bind(wt,at.skin.bindMatrix),nr.normalizeSkinWeights()),y.push(nr)}}for(let xe=0,Ke=We.length;xe<Ke;xe++){const $e=H(We[xe]);$e!==null&&y.push($e.clone())}for(let xe=0,Ke=Ue.length;xe<Ke;xe++){const $e=Ue[xe],at=en($e.id),it=dt(at,$e.materials);for(let Vt=0,Lt=it.length;Vt<Lt;Vt++)y.push(it[Vt])}for(let xe=0,Ke=ze.length;xe<Ke;xe++)y.push(gt(ze[xe]).clone());let Qe;if(w.length===0&&y.length===1)Qe=y[0];else{Qe=I==="JOINT"?new Ru:new Kn;for(let xe=0;xe<y.length;xe++)Qe.add(y[xe])}return Qe.name=I==="JOINT"?M.sid:M.name,Qe.matrix.copy(P),Qe.matrix.decompose(Qe.position,Qe.quaternion,Qe.scale),Qe}const Ge=new Ri({name:Gn.DEFAULT_MATERIAL_NAME,color:16711935});function ut(M,y){const P=[];for(let w=0,I=M.length;w<I;w++){const ie=y[M[w]];ie===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",M[w]),P.push(Ge)):P.push(ne(ie))}return P}function dt(M,y){const P=[];for(const w in M){const I=M[w],ie=ut(I.materialKeys,y);if(ie.length===0&&(w==="lines"||w==="linestrips"?ie.push(new Ci):ie.push(new Mn)),w==="lines"||w==="linestrips")for(let ze=0,Qe=ie.length;ze<Qe;ze++){const xe=ie[ze];if(xe.isMeshPhongMaterial===!0||xe.isMeshLambertMaterial===!0){const Ke=new Ci;Ke.color.copy(xe.color),Ke.opacity=xe.opacity,Ke.transparent=xe.transparent,ie[ze]=Ke}}const de=I.data.attributes.skinIndex!==void 0,We=ie.length===1?ie[0]:ie;let Ue;switch(w){case"lines":Ue=new va(I.data,We);break;case"linestrips":Ue=new Vl(I.data,We);break;case"triangles":case"polylist":de?Ue=new wp(I.data,We):Ue=new Rt(I.data,We);break}P.push(Ue)}return P}function et(M){return ft.nodes[M]!==void 0}function gt(M){return _(ft.nodes[M],Ye)}function Ct(M){const y={name:M.getAttribute("name"),children:[]};D(M);const P=n(M,"node");for(let w=0;w<P.length;w++)y.children.push(Z(P[w]));ft.visualScenes[M.getAttribute("id")]=y}function Ot(M){const y=new Kn;y.name=M.name;const P=M.children;for(let w=0;w<P.length;w++){const I=P[w];y.add(gt(I.id))}return y}function kt(M){return ft.visualScenes[M]!==void 0}function St(M){return _(ft.visualScenes[M],Ot)}function st(M){const y=n(M,"instance_visual_scene")[0];return St(o(y.getAttribute("url")))}function Yt(){const M=ft.clips;if(c(M)===!0){if(c(ft.animations)===!1){const y=[];for(const P in ft.animations){const w=v(P);for(let I=0,ie=w.length;I<ie;I++)y.push(w[I])}$t.push(new Jc("default",-1,y))}}else for(const y in M)$t.push(q(y))}function Et(M){let y="";const P=[M];for(;P.length;){const w=P.shift();w.nodeType===Node.TEXT_NODE?y+=w.textContent:(y+=`
4204
+ `);for(let p=0,S=g.length;p<S;p++){if(g[p]==="")continue;const E=g[p].split(" ");if(f.x!==void 0&&(s.push(parseFloat(E[f.x])),s.push(parseFloat(E[f.y])),s.push(parseFloat(E[f.z]))),f.rgb!==void 0){const v=i.fields.findIndex(R=>R==="rgb"),U=i.type[v],C=parseFloat(E[f.rgb]);let T=C;if(U==="F"){const R=new Float32Array(1);R[0]=C,T=new Int32Array(R.buffer)[0]}const L=(T>>16&255)/255,b=(T>>8&255)/255,x=(T>>0&255)/255;h.setRGB(L,b,x,Tt),o.push(h.r,h.g,h.b)}f.normal_x!==void 0&&(a.push(parseFloat(E[f.normal_x])),a.push(parseFloat(E[f.normal_y])),a.push(parseFloat(E[f.normal_z]))),f.intensity!==void 0&&l.push(parseFloat(E[f.intensity])),f.label!==void 0&&c.push(parseInt(E[f.label]))}}if(i.data==="binary_compressed"){const f=new Uint32Array(e.slice(i.headerLen,i.headerLen+8)),m=f[0],_=f[1],g=t(new Uint8Array(e,i.headerLen+8,m),_),p=new DataView(g.buffer),S=i.offset;for(let E=0;E<i.points;E++){if(S.x!==void 0){const v=i.fields.indexOf("x"),U=i.fields.indexOf("y"),C=i.fields.indexOf("z");s.push(this._getDataView(p,i.points*S.x+i.size[v]*E,i.type[v],i.size[v])),s.push(this._getDataView(p,i.points*S.y+i.size[U]*E,i.type[U],i.size[U])),s.push(this._getDataView(p,i.points*S.z+i.size[C]*E,i.type[C],i.size[C]))}if(S.rgb!==void 0){const v=i.fields.indexOf("rgb"),U=p.getUint8(i.points*S.rgb+i.size[v]*E+2)/255,C=p.getUint8(i.points*S.rgb+i.size[v]*E+1)/255,T=p.getUint8(i.points*S.rgb+i.size[v]*E+0)/255;h.setRGB(U,C,T,Tt),o.push(h.r,h.g,h.b)}if(S.normal_x!==void 0){const v=i.fields.indexOf("normal_x"),U=i.fields.indexOf("normal_y"),C=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*S.normal_x+i.size[v]*E,i.type[v],i.size[v])),a.push(this._getDataView(p,i.points*S.normal_y+i.size[U]*E,i.type[U],i.size[U])),a.push(this._getDataView(p,i.points*S.normal_z+i.size[C]*E,i.type[C],i.size[C]))}if(S.intensity!==void 0){const v=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*S.intensity+i.size[v]*E,i.type[v],i.size[v]))}if(S.label!==void 0){const v=i.fields.indexOf("label");c.push(p.getInt32(i.points*S.label+i.size[v]*E,this.littleEndian))}}}if(i.data==="binary"){const f=new DataView(e,i.headerLen),m=i.offset;for(let _=0,g=0;_<i.points;_++,g+=i.rowSize){if(m.x!==void 0){const p=i.fields.indexOf("x"),S=i.fields.indexOf("y"),E=i.fields.indexOf("z");s.push(this._getDataView(f,g+m.x,i.type[p],i.size[p])),s.push(this._getDataView(f,g+m.y,i.type[S],i.size[S])),s.push(this._getDataView(f,g+m.z,i.type[E],i.size[E]))}if(m.rgb!==void 0){const p=f.getUint8(g+m.rgb+2)/255,S=f.getUint8(g+m.rgb+1)/255,E=f.getUint8(g+m.rgb+0)/255;h.setRGB(p,S,E,Tt),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),S=i.fields.indexOf("normal_y"),E=i.fields.indexOf("normal_z");a.push(this._getDataView(f,g+m.normal_x,i.type[p],i.size[p])),a.push(this._getDataView(f,g+m.normal_y,i.type[S],i.size[S])),a.push(this._getDataView(f,g+m.normal_z,i.type[E],i.size[E]))}if(m.intensity!==void 0){const p=i.fields.indexOf("intensity");l.push(this._getDataView(f,g+m.intensity,i.type[p],i.size[p]))}m.label!==void 0&&c.push(f.getInt32(g+m.label,this.littleEndian))}}const u=new Bt;s.length>0&&u.setAttribute("position",new mt(s,3)),a.length>0&&u.setAttribute("normal",new mt(a,3)),o.length>0&&u.setAttribute("color",new mt(o,3)),l.length>0&&u.setAttribute("intensity",new mt(l,1)),c.length>0&&u.setAttribute("label",new mp(c,1)),u.computeBoundingSphere();const d=new Wi({size:.005});return o.length>0&&(d.vertexColors=!0),new Qr(u,d)}}class jh extends l0{constructor(e){super(e)}parse(e){function t(k){switch(k.image_type){case d:case _:if(k.colormap_length>256||k.colormap_size!==24||k.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case f:case m:case g:case p:if(k.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case u:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+k.image_type)}if(k.width<=0||k.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(k.pixel_size!==8&&k.pixel_size!==16&&k.pixel_size!==24&&k.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+k.pixel_size)}function n(k,Q,q,ue,ye){let le,Pe;const Te=q.pixel_size>>3,Y=q.width*q.height*Te;if(Q&&(Pe=ye.subarray(ue,ue+=q.colormap_length*(q.colormap_size>>3))),k){le=new Uint8Array(Y);let re,ae,oe,Ee=0;const _e=new Uint8Array(Te);for(;Ee<Y;)if(re=ye[ue++],ae=(re&127)+1,re&128){for(oe=0;oe<Te;++oe)_e[oe]=ye[ue++];for(oe=0;oe<ae;++oe)le.set(_e,Ee+oe*Te);Ee+=Te*ae}else{for(ae*=Te,oe=0;oe<ae;++oe)le[Ee+oe]=ye[ue++];Ee+=ae}}else le=ye.subarray(ue,ue+=Q?q.width*q.height:Y);return{pixel_data:le,palettes:Pe}}function i(k,Q,q,ue,ye,le,Pe,Te,Y){const re=Y;let ae,oe=0,Ee,_e;const we=x.width;for(_e=Q;_e!==ue;_e+=q)for(Ee=ye;Ee!==Pe;Ee+=le,oe++)ae=Te[oe],k[(Ee+we*_e)*4+3]=255,k[(Ee+we*_e)*4+2]=re[ae*3+0],k[(Ee+we*_e)*4+1]=re[ae*3+1],k[(Ee+we*_e)*4+0]=re[ae*3+2];return k}function s(k,Q,q,ue,ye,le,Pe,Te){let Y,re=0,ae,oe;const Ee=x.width;for(oe=Q;oe!==ue;oe+=q)for(ae=ye;ae!==Pe;ae+=le,re+=2)Y=Te[re+0]+(Te[re+1]<<8),k[(ae+Ee*oe)*4+0]=(Y&31744)>>7,k[(ae+Ee*oe)*4+1]=(Y&992)>>2,k[(ae+Ee*oe)*4+2]=(Y&31)<<3,k[(ae+Ee*oe)*4+3]=Y&32768?0:255;return k}function a(k,Q,q,ue,ye,le,Pe,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==ue;ae+=q)for(re=ye;re!==Pe;re+=le,Y+=3)k[(re+oe*ae)*4+3]=255,k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+1],k[(re+oe*ae)*4+0]=Te[Y+2];return k}function o(k,Q,q,ue,ye,le,Pe,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==ue;ae+=q)for(re=ye;re!==Pe;re+=le,Y+=4)k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+1],k[(re+oe*ae)*4+0]=Te[Y+2],k[(re+oe*ae)*4+3]=Te[Y+3];return k}function l(k,Q,q,ue,ye,le,Pe,Te){let Y,re=0,ae,oe;const Ee=x.width;for(oe=Q;oe!==ue;oe+=q)for(ae=ye;ae!==Pe;ae+=le,re++)Y=Te[re],k[(ae+Ee*oe)*4+0]=Y,k[(ae+Ee*oe)*4+1]=Y,k[(ae+Ee*oe)*4+2]=Y,k[(ae+Ee*oe)*4+3]=255;return k}function c(k,Q,q,ue,ye,le,Pe,Te){let Y=0,re,ae;const oe=x.width;for(ae=Q;ae!==ue;ae+=q)for(re=ye;re!==Pe;re+=le,Y+=2)k[(re+oe*ae)*4+0]=Te[Y+0],k[(re+oe*ae)*4+1]=Te[Y+0],k[(re+oe*ae)*4+2]=Te[Y+0],k[(re+oe*ae)*4+3]=Te[Y+1];return k}function h(k,Q,q,ue,ye){let le,Pe,Te,Y,re,ae;switch((x.flags&S)>>E){default:case C:le=0,Te=1,re=Q,Pe=0,Y=1,ae=q;break;case v:le=0,Te=1,re=Q,Pe=q-1,Y=-1,ae=-1;break;case T:le=Q-1,Te=-1,re=-1,Pe=0,Y=1,ae=q;break;case U:le=Q-1,Te=-1,re=-1,Pe=q-1,Y=-1,ae=-1;break}if(V)switch(x.pixel_size){case 8:l(k,Pe,Y,ae,le,Te,re,ue);break;case 16:c(k,Pe,Y,ae,le,Te,re,ue);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(x.pixel_size){case 8:i(k,Pe,Y,ae,le,Te,re,ue,ye);break;case 16:s(k,Pe,Y,ae,le,Te,re,ue);break;case 24:a(k,Pe,Y,ae,le,Te,re,ue);break;case 32:o(k,Pe,Y,ae,le,Te,re,ue);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return k}const u=0,d=1,f=2,m=3,_=9,g=10,p=11,S=48,E=4,v=0,U=1,C=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let L=0;const b=new Uint8Array(e),x={id_length:b[L++],colormap_type:b[L++],image_type:b[L++],colormap_index:b[L++]|b[L++]<<8,colormap_length:b[L++]|b[L++]<<8,colormap_size:b[L++],origin:[b[L++]|b[L++]<<8,b[L++]|b[L++]<<8],width:b[L++]|b[L++]<<8,height:b[L++]|b[L++]<<8,pixel_size:b[L++],flags:b[L++]};if(t(x),x.id_length+L>e.length)throw new Error("THREE.TGALoader: No data.");L+=x.id_length;let R=!1,B=!1,V=!1;switch(x.image_type){case _:R=!0,B=!0;break;case d:B=!0;break;case g:R=!0;break;case f:break;case p:R=!0,V=!0;break;case m:V=!0;break}const W=new Uint8Array(x.width*x.height*4),ee=n(R,B,x,L,b);return h(W,x.width,x.height,ee.pixel_data,ee.palettes),{data:W,width:x.width,height:x.height,flipY:!0,generateMipmaps:!0,minFilter:ui}}}class O3 extends Gn{load(e,t,n,i){const s=this,a=s.path===""?Yl.extractUrlBase(e):s.path,o=new zr(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(l,a))}catch(c){i?i(c):console.error(c),s.manager.itemError(e)}},n,i)}parse(e,t){function n(M,y){const P=[],w=M.childNodes;for(let I=0,ie=w.length;I<ie;I++){const de=w[I];de.nodeName===y&&P.push(de)}return P}function i(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=y[w];return P}function s(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=parseFloat(y[w]);return P}function a(M){if(M.length===0)return[];const y=M.trim().split(/\s+/),P=new Array(y.length);for(let w=0,I=y.length;w<I;w++)P[w]=parseInt(y[w]);return P}function o(M){return M.substring(1)}function l(){return"three_default_"+ni++}function c(M){return Object.keys(M).length===0}function h(M){return{unit:u(n(M,"unit")[0]),upAxis:d(n(M,"up_axis")[0])}}function u(M){return M!==void 0&&M.hasAttribute("meter")===!0?parseFloat(M.getAttribute("meter")):1}function d(M){return M!==void 0?M.textContent:"Y_UP"}function f(M,y,P,w){const I=n(M,y)[0];if(I!==void 0){const ie=n(I,P);for(let de=0;de<ie.length;de++)w(ie[de])}}function m(M,y){for(const P in M){const w=M[P];w.build=y(M[P])}}function _(M,y){return M.build!==void 0||(M.build=y(M)),M.build}function g(M){const y={sources:{},samplers:{},channels:{}};let P=!1;for(let w=0,I=M.childNodes.length;w<I;w++){const ie=M.childNodes[w];if(ie.nodeType!==1)continue;let de;switch(ie.nodeName){case"source":de=ie.getAttribute("id"),y.sources[de]=ve(ie);break;case"sampler":de=ie.getAttribute("id"),y.samplers[de]=p(ie);break;case"channel":de=ie.getAttribute("target"),y.channels[de]=S(ie);break;case"animation":g(ie),P=!0;break;default:console.log(ie)}}P===!1&&(ft.animations[M.getAttribute("id")||Hi.generateUUID()]=y)}function p(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=o(I.getAttribute("source")),de=I.getAttribute("semantic");y.inputs[de]=ie;break}}return y}function S(M){const y={};let w=M.getAttribute("target").split("/");const I=w.shift();let ie=w.shift();const de=ie.indexOf("(")!==-1,We=ie.indexOf(".")!==-1;if(We)w=ie.split("."),ie=w.shift(),y.member=w.shift();else if(de){const Ie=ie.split("(");ie=Ie.shift();for(let ze=0;ze<Ie.length;ze++)Ie[ze]=parseInt(Ie[ze].replace(/\)/,""));y.indices=Ie}return y.id=I,y.sid=ie,y.arraySyntax=de,y.memberSyntax=We,y.sampler=o(M.getAttribute("source")),y}function E(M){const y=[],P=M.channels,w=M.samplers,I=M.sources;for(const ie in P)if(P.hasOwnProperty(ie)){const de=P[ie],We=w[de.sampler],Ie=We.inputs.INPUT,ze=We.inputs.OUTPUT,Ze=I[Ie],xe=I[ze],Ke=U(de,Ze,xe);x(Ke,y)}return y}function v(M){return _(ft.animations[M],E)}function U(M,y,P){const w=ft.nodes[M.id],I=gt(w.id),ie=w.transforms[M.sid],de=w.matrix.clone().transpose();let We,Ie,ze,Ze,xe,Ke;const $e={};switch(ie){case"matrix":for(ze=0,Ze=y.array.length;ze<Ze;ze++)if(We=y.array[ze],Ie=ze*P.stride,$e[We]===void 0&&($e[We]={}),M.arraySyntax===!0){const Vt=P.array[Ie],Lt=M.indices[0]+4*M.indices[1];$e[We][Lt]=Vt}else for(xe=0,Ke=P.stride;xe<Ke;xe++)$e[We][xe]=P.array[Ie+xe];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break}const at=C($e,de);return{name:I.uuid,keyframes:at}}function C(M,y){const P=[];for(const I in M)P.push({time:parseFloat(I),value:M[I]});P.sort(w);for(let I=0;I<16;I++)R(P,I,y.elements[I]);return P;function w(I,ie){return I.time-ie.time}}const T=new F,L=new F,b=new Rn;function x(M,y){const P=M.keyframes,w=M.name,I=[],ie=[],de=[],We=[];for(let Ie=0,ze=P.length;Ie<ze;Ie++){const Ze=P[Ie],xe=Ze.time,Ke=Ze.value;X.fromArray(Ke).transpose(),X.decompose(T,b,L),I.push(xe),ie.push(T.x,T.y,T.z),de.push(b.x,b.y,b.z,b.w),We.push(L.x,L.y,L.z)}return ie.length>0&&y.push(new Ir(w+".position",I,ie)),de.length>0&&y.push(new ds(w+".quaternion",I,de)),We.length>0&&y.push(new Ir(w+".scale",I,We)),y}function R(M,y,P){let w,I=!0,ie,de;for(ie=0,de=M.length;ie<de;ie++)w=M[ie],w.value[y]===void 0?w.value[y]=null:I=!1;if(I===!0)for(ie=0,de=M.length;ie<de;ie++)w=M[ie],w.value[y]=P;else B(M,y)}function B(M,y){let P,w;for(let I=0,ie=M.length;I<ie;I++){const de=M[I];if(de.value[y]===null){if(P=V(M,I,y),w=W(M,I,y),P===null){de.value[y]=w.value[y];continue}if(w===null){de.value[y]=P.value[y];continue}ee(de,P,w,y)}}}function V(M,y,P){for(;y>=0;){const w=M[y];if(w.value[P]!==null)return w;y--}return null}function W(M,y,P){for(;y<M.length;){const w=M[y];if(w.value[P]!==null)return w;y++}return null}function ee(M,y,P,w){if(P.time-y.time===0){M.value[w]=y.value[w];return}M.value[w]=(M.time-y.time)*(P.value[w]-y.value[w])/(P.time-y.time)+y.value[w]}function k(M){const y={name:M.getAttribute("id")||"default",start:parseFloat(M.getAttribute("start")||0),end:parseFloat(M.getAttribute("end")||0),animations:[]};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"instance_animation":y.animations.push(o(I.getAttribute("url")));break}}ft.clips[M.getAttribute("id")]=y}function Q(M){const y=[],P=M.name,w=M.end-M.start||-1,I=M.animations;for(let ie=0,de=I.length;ie<de;ie++){const We=v(I[ie]);for(let Ie=0,ze=We.length;Ie<ze;Ie++)y.push(We[Ie])}return new Jc(P,w,y)}function q(M){return _(ft.clips[M],Q)}function ue(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"skin":y.id=o(I.getAttribute("source")),y.skin=ye(I);break;case"morph":y.id=o(I.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}ft.controllers[M.getAttribute("id")]=y}function ye(M){const y={sources:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"bind_shape_matrix":y.bindShapeMatrix=s(I.textContent);break;case"source":const ie=I.getAttribute("id");y.sources[ie]=ve(I);break;case"joints":y.joints=le(I);break;case"vertex_weights":y.vertexWeights=Pe(I);break}}return y}function le(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=I.getAttribute("semantic"),de=o(I.getAttribute("source"));y.inputs[ie]=de;break}}return y}function Pe(M){const y={inputs:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=I.getAttribute("semantic"),de=o(I.getAttribute("source")),We=parseInt(I.getAttribute("offset"));y.inputs[ie]={id:de,offset:We};break;case"vcount":y.vcount=a(I.textContent);break;case"v":y.v=a(I.textContent);break}}return y}function Te(M){const y={id:M.id},P=ft.geometries[y.id];return M.skin!==void 0&&(y.skin=Y(M.skin),P.sources.skinIndices=y.skin.indices,P.sources.skinWeights=y.skin.weights),y}function Y(M){const P={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},w=M.sources,I=M.vertexWeights,ie=I.vcount,de=I.v,We=I.inputs.JOINT.offset,Ie=I.inputs.WEIGHT.offset,ze=M.sources[M.joints.inputs.JOINT],Ze=M.sources[M.joints.inputs.INV_BIND_MATRIX],xe=w[I.inputs.WEIGHT.id].array;let Ke=0,$e,at,it;for($e=0,it=ie.length;$e<it;$e++){const Lt=ie[$e],At=[];for(at=0;at<Lt;at++){const wt=de[Ke+We],ii=de[Ke+Ie],xn=xe[ii];At.push({index:wt,weight:xn}),Ke+=2}for(At.sort(Vt),at=0;at<4;at++){const wt=At[at];wt!==void 0?(P.indices.array.push(wt.index),P.weights.array.push(wt.weight)):(P.indices.array.push(0),P.weights.array.push(0))}}for(M.bindShapeMatrix?P.bindMatrix=new lt().fromArray(M.bindShapeMatrix).transpose():P.bindMatrix=new lt().identity(),$e=0,it=ze.array.length;$e<it;$e++){const Lt=ze.array[$e],At=new lt().fromArray(Ze.array,$e*Ze.stride).transpose();P.joints.push({name:Lt,boneInverse:At})}return P;function Vt(Lt,At){return At.weight-Lt.weight}}function re(M){return _(ft.controllers[M],Te)}function ae(M){const y={init_from:n(M,"init_from")[0].textContent};ft.images[M.getAttribute("id")]=y}function oe(M){return M.build!==void 0?M.build:M.init_from}function Ee(M){const y=ft.images[M];return y!==void 0?_(y,oe):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",M),null)}function _e(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"profile_COMMON":y.profile=we(I);break}}ft.effects[M.getAttribute("id")]=y}function we(M){const y={surfaces:{},samplers:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"newparam":ke(I,y);break;case"technique":y.technique=O(I);break;case"extra":y.extra=he(I);break}}return y}function ke(M,y){const P=M.getAttribute("sid");for(let w=0,I=M.childNodes.length;w<I;w++){const ie=M.childNodes[w];if(ie.nodeType===1)switch(ie.nodeName){case"surface":y.surfaces[P]=tt(ie);break;case"sampler2D":y.samplers[P]=Qe(ie);break}}}function tt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"init_from":y.init_from=I.textContent;break}}return y}function Qe(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"source":y.source=I.textContent;break}}return y}function O(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"constant":case"lambert":case"blinn":case"phong":y.type=I.nodeName,y.parameters=bt(I);break;case"extra":y.extra=he(I);break}}return y}function bt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":y[I.nodeName]=$(I);break;case"transparent":y[I.nodeName]={opaque:I.hasAttribute("opaque")?I.getAttribute("opaque"):"A_ONE",data:$(I)};break}}return y}function $(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"color":y[I.nodeName]=s(I.textContent);break;case"float":y[I.nodeName]=parseFloat(I.textContent);break;case"texture":y[I.nodeName]={id:I.getAttribute("texture"),extra:pe(I)};break}}return y}function pe(M){const y={technique:{}};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"extra":te(I,y);break}}return y}function te(M,y){for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique":Se(I,y);break}}}function Se(M,y){for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":y.technique[I.nodeName]=parseFloat(I.textContent);break;case"wrapU":case"wrapV":I.textContent.toUpperCase()==="TRUE"?y.technique[I.nodeName]=1:I.textContent.toUpperCase()==="FALSE"?y.technique[I.nodeName]=0:y.technique[I.nodeName]=parseInt(I.textContent);break;case"bump":y[I.nodeName]=Fe(I);break}}}function he(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique":y.technique=ce(I);break}}return y}function ce(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"double_sided":y[I.nodeName]=parseInt(I.textContent);break;case"bump":y[I.nodeName]=Fe(I);break}}return y}function Fe(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"texture":y[I.nodeName]={id:I.getAttribute("texture"),texcoord:I.getAttribute("texcoord"),extra:pe(I)};break}}return y}function N(M){return M}function A(M){return _(ft.effects[M],N)}function G(M){const y={name:M.getAttribute("name")};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"instance_effect":y.url=o(I.getAttribute("url"));break}}ft.materials[M.getAttribute("id")]=y}function z(M){let y,P=M.slice((M.lastIndexOf(".")-1>>>0)+2);switch(P=P.toLowerCase(),P){case"tga":y=un;break;default:y=mn}return y}function se(M){const y=A(M.url),P=y.profile.technique;let w;switch(P.type){case"phong":case"blinn":w=new Mn;break;case"lambert":w=new Yp;break;default:w=new Ri;break}w.name=M.name||"";function I(Ie,ze=null){const Ze=y.profile.samplers[Ie.id];let xe=null;if(Ze!==void 0){const Ke=y.profile.surfaces[Ze.source];xe=Ee(Ke.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),xe=Ee(Ie.id);if(xe!==null){const Ke=z(xe);if(Ke!==void 0){const $e=Ke.load(xe),at=Ie.extra;if(at!==void 0&&at.technique!==void 0&&c(at.technique)===!1){const it=at.technique;$e.wrapS=it.wrapU?$n:kn,$e.wrapT=it.wrapV?$n:kn,$e.offset.set(it.offsetU||0,it.offsetV||0),$e.repeat.set(it.repeatU||1,it.repeatV||1)}else $e.wrapS=$n,$e.wrapT=$n;return ze!==null&&($e.colorSpace=ze),$e}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",xe),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Ie.id),null}const ie=P.parameters;for(const Ie in ie){const ze=ie[Ie];switch(Ie){case"diffuse":ze.color&&w.color.fromArray(ze.color),ze.texture&&(w.map=I(ze.texture,Tt));break;case"specular":ze.color&&w.specular&&w.specular.fromArray(ze.color),ze.texture&&(w.specularMap=I(ze.texture));break;case"bump":ze.texture&&(w.normalMap=I(ze.texture));break;case"ambient":ze.texture&&(w.lightMap=I(ze.texture,Tt));break;case"shininess":ze.float&&w.shininess&&(w.shininess=ze.float);break;case"emission":ze.color&&w.emissive&&w.emissive.fromArray(ze.color),ze.texture&&(w.emissiveMap=I(ze.texture,Tt));break}}xt.colorSpaceToWorking(w.color,Tt),w.specular&&xt.colorSpaceToWorking(w.specular,Tt),w.emissive&&xt.colorSpaceToWorking(w.emissive,Tt);let de=ie.transparent,We=ie.transparency;if(We===void 0&&de&&(We={float:1}),de===void 0&&We&&(de={opaque:"A_ONE",data:{color:[1,1,1,1]}}),de&&We)if(de.data.texture)w.transparent=!0;else{const Ie=de.data.color;switch(de.opaque){case"A_ONE":w.opacity=Ie[3]*We.float;break;case"RGB_ZERO":w.opacity=1-Ie[0]*We.float;break;case"A_ZERO":w.opacity=1-Ie[3]*We.float;break;case"RGB_ONE":w.opacity=Ie[0]*We.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',de.opaque)}w.opacity<1&&(w.transparent=!0)}if(P.extra!==void 0&&P.extra.technique!==void 0){const Ie=P.extra.technique;for(const ze in Ie){const Ze=Ie[ze];switch(ze){case"double_sided":w.side=Ze===1?pn:Hn;break;case"bump":w.normalMap=I(Ze.texture),w.normalScale=new Xe(1,1);break}}}return w}function ne(M){return _(ft.materials[M],se)}function Ce(M){const y={name:M.getAttribute("name")};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"optics":y.optics=Ae(I);break}}ft.cameras[M.getAttribute("id")]=y}function Ae(M){for(let y=0;y<M.childNodes.length;y++){const P=M.childNodes[y];switch(P.nodeName){case"technique_common":return Be(P)}}return{}}function Be(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"perspective":case"orthographic":y.technique=w.nodeName,y.parameters=Ve(w);break}}return y}function Ve(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":y[w.nodeName]=parseFloat(w.textContent);break}}return y}function me(M){let y;switch(M.optics.technique){case"perspective":y=new ln(M.optics.parameters.yfov,M.optics.parameters.aspect_ratio,M.optics.parameters.znear,M.optics.parameters.zfar);break;case"orthographic":let P=M.optics.parameters.ymag,w=M.optics.parameters.xmag;const I=M.optics.parameters.aspect_ratio;w=w===void 0?P*I:w,P=P===void 0?w/I:P,w*=.5,P*=.5,y=new Ta(-w,w,P,-P,M.optics.parameters.znear,M.optics.parameters.zfar);break;default:y=new ln;break}return y.name=M.name||"",y}function De(M){const y=ft.cameras[M];return y!==void 0?_(y,me):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",M),null)}function Je(M){let y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"technique_common":y=nt(I);break}}ft.lights[M.getAttribute("id")]=y}function nt(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"directional":case"point":case"spot":case"ambient":y.technique=I.nodeName,y.parameters=Le(I)}}return y}function Le(M){const y={};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"color":const ie=s(I.textContent);y.color=new ot().fromArray(ie),xt.colorSpaceToWorking(y.color,Tt);break;case"falloff_angle":y.falloffAngle=parseFloat(I.textContent);break;case"quadratic_attenuation":const de=parseFloat(I.textContent);y.distance=de?Math.sqrt(1/de):0;break}}return y}function ct(M){let y;switch(M.technique){case"directional":y=new zu;break;case"point":y=new Ou;break;case"spot":y=new u0;break;case"ambient":y=new Bu;break}return M.parameters.color&&y.color.copy(M.parameters.color),M.parameters.distance&&(y.distance=M.parameters.distance),y}function H(M){const y=ft.lights[M];return y!==void 0?_(y,ct):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",M),null)}function Ne(M){const y={name:M.getAttribute("name"),sources:{},vertices:{},primitives:[]},P=n(M,"mesh")[0];if(P!==void 0){for(let w=0;w<P.childNodes.length;w++){const I=P.childNodes[w];if(I.nodeType!==1)continue;const ie=I.getAttribute("id");switch(I.nodeName){case"source":y.sources[ie]=ve(I);break;case"vertices":y.vertices=He(I);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",I.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":y.primitives.push(Me(I));break;default:console.log(I)}}ft.geometries[M.getAttribute("id")]=y}}function ve(M){const y={array:[],stride:3};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"float_array":y.array=s(w.textContent);break;case"Name_array":y.array=i(w.textContent);break;case"technique_common":const I=n(w,"accessor")[0];I!==void 0&&(y.stride=parseInt(I.getAttribute("stride")));break}}return y}function He(M){const y={};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];w.nodeType===1&&(y[w.getAttribute("semantic")]=o(w.getAttribute("source")))}return y}function Me(M){const y={type:M.nodeName,material:M.getAttribute("material"),count:parseInt(M.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let P=0,w=M.childNodes.length;P<w;P++){const I=M.childNodes[P];if(I.nodeType===1)switch(I.nodeName){case"input":const ie=o(I.getAttribute("source")),de=I.getAttribute("semantic"),We=parseInt(I.getAttribute("offset")),Ie=parseInt(I.getAttribute("set")),ze=Ie>0?de+Ie:de;y.inputs[ze]={id:ie,offset:We},y.stride=Math.max(y.stride,We+1),de==="TEXCOORD"&&(y.hasUV=!0);break;case"vcount":y.vcount=a(I.textContent);break;case"p":y.p=a(I.textContent);break}}return y}function ge(M){const y={};for(let P=0;P<M.length;P++){const w=M[P];y[w.type]===void 0&&(y[w.type]=[]),y[w.type].push(w)}return y}function qe(M){let y=0;for(let P=0,w=M.length;P<w;P++)M[P].hasUV===!0&&y++;y>0&&y<M.length&&(M.uvsNeedsFix=!0)}function ht(M){const y={},P=M.sources,w=M.vertices,I=M.primitives;if(I.length===0)return{};const ie=ge(I);for(const de in ie){const We=ie[de];qe(We),y[de]=Dt(We,P,w)}return y}function Dt(M,y,P){const w={},I={array:[],stride:0},ie={array:[],stride:0},de={array:[],stride:0},We={array:[],stride:0},Ie={array:[],stride:0},ze={array:[],stride:4},Ze={array:[],stride:4},xe=new Bt,Ke=[];let $e=0;for(let at=0;at<M.length;at++){const it=M[at],Vt=it.inputs;let Lt=0;switch(it.type){case"lines":case"linestrips":Lt=it.count*2;break;case"triangles":Lt=it.count*3;break;case"polylist":for(let At=0;At<it.count;At++){const wt=it.vcount[At];switch(wt){case 3:Lt+=3;break;case 4:Lt+=6;break;default:Lt+=(wt-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",it.type)}xe.addGroup($e,Lt,at),$e+=Lt,it.material&&Ke.push(it.material);for(const At in Vt){const wt=Vt[At];switch(At){case"VERTEX":for(const ii in P){const xn=P[ii];switch(ii){case"POSITION":const nr=I.array.length;if(pt(it,y[xn],wt.offset,I.array),I.stride=y[xn].stride,y.skinWeights&&y.skinIndices&&(pt(it,y.skinIndices,wt.offset,ze.array),pt(it,y.skinWeights,wt.offset,Ze.array)),it.hasUV===!1&&M.uvsNeedsFix===!0){const ad=(I.array.length-nr)/I.stride;for(let Ql=0;Ql<ad;Ql++)de.array.push(0,0)}break;case"NORMAL":pt(it,y[xn],wt.offset,ie.array),ie.stride=y[xn].stride;break;case"COLOR":pt(it,y[xn],wt.offset,Ie.array),Ie.stride=y[xn].stride;break;case"TEXCOORD":pt(it,y[xn],wt.offset,de.array),de.stride=y[xn].stride;break;case"TEXCOORD1":pt(it,y[xn],wt.offset,We.array),de.stride=y[xn].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',ii)}}break;case"NORMAL":pt(it,y[wt.id],wt.offset,ie.array),ie.stride=y[wt.id].stride;break;case"COLOR":pt(it,y[wt.id],wt.offset,Ie.array,!0),Ie.stride=y[wt.id].stride;break;case"TEXCOORD":pt(it,y[wt.id],wt.offset,de.array),de.stride=y[wt.id].stride;break;case"TEXCOORD1":pt(it,y[wt.id],wt.offset,We.array),We.stride=y[wt.id].stride;break}}}return I.array.length>0&&xe.setAttribute("position",new mt(I.array,I.stride)),ie.array.length>0&&xe.setAttribute("normal",new mt(ie.array,ie.stride)),Ie.array.length>0&&xe.setAttribute("color",new mt(Ie.array,Ie.stride)),de.array.length>0&&xe.setAttribute("uv",new mt(de.array,de.stride)),We.array.length>0&&xe.setAttribute("uv1",new mt(We.array,We.stride)),ze.array.length>0&&xe.setAttribute("skinIndex",new mt(ze.array,ze.stride)),Ze.array.length>0&&xe.setAttribute("skinWeight",new mt(Ze.array,Ze.stride)),w.data=xe,w.type=M[0].type,w.materialKeys=Ke,w}function pt(M,y,P,w,I=!1){const ie=M.p,de=M.stride,We=M.vcount;function Ie(xe){let Ke=ie[xe+P]*Ze;const $e=Ke+Ze;for(;Ke<$e;Ke++)w.push(ze[Ke]);if(I){const at=w.length-Ze-1;Xt.setRGB(w[at+0],w[at+1],w[at+2],Tt),w[at+0]=Xt.r,w[at+1]=Xt.g,w[at+2]=Xt.b}}const ze=y.array,Ze=y.stride;if(M.vcount!==void 0){let xe=0;for(let Ke=0,$e=We.length;Ke<$e;Ke++){const at=We[Ke];if(at===4){const it=xe+de*0,Vt=xe+de*1,Lt=xe+de*2,At=xe+de*3;Ie(it),Ie(Vt),Ie(At),Ie(Vt),Ie(Lt),Ie(At)}else if(at===3){const it=xe+de*0,Vt=xe+de*1,Lt=xe+de*2;Ie(it),Ie(Vt),Ie(Lt)}else if(at>4)for(let it=1,Vt=at-2;it<=Vt;it++){const Lt=xe+de*0,At=xe+de*it,wt=xe+de*(it+1);Ie(Lt),Ie(At),Ie(wt)}xe+=de*at}}else for(let xe=0,Ke=ie.length;xe<Ke;xe+=de)Ie(xe)}function en(M){return _(ft.geometries[M],ht)}function je(M){const y={name:M.getAttribute("name")||"",joints:{},links:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"technique_common":tn(w,y);break}}ft.kinematicsModels[M.getAttribute("id")]=y}function Zt(M){return M.build!==void 0?M.build:M}function jt(M){return _(ft.kinematicsModels[M],Zt)}function tn(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"joint":y.joints[w.getAttribute("sid")]=Di(w);break;case"link":y.links.push(rt(w));break}}}function Di(M){let y;for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"prismatic":case"revolute":y=ti(w);break}}return y}function ti(M){const y={sid:M.getAttribute("sid"),name:M.getAttribute("name")||"",axis:new F,limits:{min:0,max:0},type:M.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"axis":const I=s(w.textContent);y.axis.fromArray(I);break;case"limits":const ie=w.getElementsByTagName("max")[0],de=w.getElementsByTagName("min")[0];y.limits.max=parseFloat(ie.textContent),y.limits.min=parseFloat(de.textContent);break}}return y.limits.min>=y.limits.max&&(y.static=!0),y.middlePosition=(y.limits.min+y.limits.max)/2,y}function rt(M){const y={sid:M.getAttribute("sid"),name:M.getAttribute("name")||"",attachments:[],transforms:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"attachment_full":y.attachments.push(Re(w));break;case"matrix":case"translate":case"rotate":y.transforms.push(Ht(w));break}}return y}function Re(M){const y={joint:M.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"link":y.links.push(rt(w));break;case"matrix":case"translate":case"rotate":y.transforms.push(Ht(w));break}}return y}function Ht(M){const y={type:M.nodeName},P=s(M.textContent);switch(y.type){case"matrix":y.obj=new lt,y.obj.fromArray(P).transpose();break;case"translate":y.obj=new F,y.obj.fromArray(P);break;case"rotate":y.obj=new F,y.obj.fromArray(P),y.angle=Hi.degToRad(P[3]);break}return y}function nn(M){const y={name:M.getAttribute("name")||"",rigidBodies:{}};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"rigid_body":y.rigidBodies[w.getAttribute("name")]={},Wt(w,y.rigidBodies[w.getAttribute("name")]);break}}ft.physicsModels[M.getAttribute("id")]=y}function Wt(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"technique_common":hn(w,y);break}}}function hn(M,y){for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"inertia":y.inertia=s(w.textContent);break;case"mass":y.mass=s(w.textContent)[0];break}}}function En(M){const y={bindJointAxis:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"bind_joint_axis":y.bindJointAxis.push(Ji(w));break}}ft.kinematicsScenes[o(M.getAttribute("url"))]=y}function Ji(M){const y={target:M.getAttribute("target").split("/").pop()};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType===1)switch(w.nodeName){case"axis":const I=w.getElementsByTagName("param")[0];y.axis=I.textContent;const ie=y.axis.split("inst_").pop().split("axis")[0];y.jointIndex=ie.substring(0,ie.length-1);break}}return y}function Ki(M){return M.build!==void 0?M.build:M}function Zi(M){return _(ft.kinematicsScenes[M],Ki)}function Qi(){const M=Object.keys(ft.kinematicsModels)[0],y=Object.keys(ft.kinematicsScenes)[0],P=Object.keys(ft.visualScenes)[0];if(M===void 0||y===void 0)return;const w=jt(M),I=Zi(y),ie=St(P),de=I.bindJointAxis,We={};for(let Ze=0,xe=de.length;Ze<xe;Ze++){const Ke=de[Ze],$e=zt.querySelector('[sid="'+Ke.target+'"]');if($e){const at=$e.parentElement;Ie(Ke.jointIndex,at)}}function Ie(Ze,xe){const Ke=xe.getAttribute("name"),$e=w.joints[Ze];ie.traverse(function(at){at.name===Ke&&(We[Ze]={object:at,transforms:er(xe),joint:$e,position:$e.zeroPosition})})}const ze=new lt;tr={joints:w&&w.joints,getJointValue:function(Ze){const xe=We[Ze];if(xe)return xe.position;console.warn("THREE.ColladaLoader: Joint "+Ze+" doesn't exist.")},setJointValue:function(Ze,xe){const Ke=We[Ze];if(Ke){const $e=Ke.joint;if(xe>$e.limits.max||xe<$e.limits.min)console.warn("THREE.ColladaLoader: Joint "+Ze+" value "+xe+" outside of limits (min: "+$e.limits.min+", max: "+$e.limits.max+").");else if($e.static)console.warn("THREE.ColladaLoader: Joint "+Ze+" is static.");else{const at=Ke.object,it=$e.axis,Vt=Ke.transforms;X.identity();for(let Lt=0;Lt<Vt.length;Lt++){const At=Vt[Lt];if(At.sid&&At.sid.indexOf(Ze)!==-1)switch($e.type){case"revolute":X.multiply(ze.makeRotationAxis(it,Hi.degToRad(xe)));break;case"prismatic":X.multiply(ze.makeTranslation(it.x*xe,it.y*xe,it.z*xe));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+$e.type);break}else switch(At.type){case"matrix":X.multiply(At.obj);break;case"translate":X.multiply(ze.makeTranslation(At.obj.x,At.obj.y,At.obj.z));break;case"scale":X.scale(At.obj);break;case"rotate":X.multiply(ze.makeRotationAxis(At.obj,At.angle));break}}at.matrix.copy(X),at.matrix.decompose(at.position,at.quaternion,at.scale),We[Ze].position=xe}}else console.log("THREE.ColladaLoader: "+Ze+" does not exist.")}}}function er(M){const y=[],P=zt.querySelector('[id="'+M.id+'"]');for(let w=0;w<P.childNodes.length;w++){const I=P.childNodes[w];if(I.nodeType!==1)continue;let ie,de;switch(I.nodeName){case"matrix":ie=s(I.textContent);const We=new lt().fromArray(ie).transpose();y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:We});break;case"translate":case"scale":ie=s(I.textContent),de=new F().fromArray(ie),y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:de});break;case"rotate":ie=s(I.textContent),de=new F().fromArray(ie);const Ie=Hi.degToRad(ie[3]);y.push({sid:I.getAttribute("sid"),type:I.nodeName,obj:de,angle:Ie});break}}return y}function D(M){const y=M.getElementsByTagName("node");for(let P=0;P<y.length;P++){const w=y[P];w.hasAttribute("id")===!1&&w.setAttribute("id",l())}}const X=new lt,J=new F;function Z(M){const y={name:M.getAttribute("name")||"",type:M.getAttribute("type"),id:M.getAttribute("id"),sid:M.getAttribute("sid"),matrix:new lt,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];if(w.nodeType!==1)continue;let I;switch(w.nodeName){case"node":y.nodes.push(w.getAttribute("id")),Z(w);break;case"instance_camera":y.instanceCameras.push(o(w.getAttribute("url")));break;case"instance_controller":y.instanceControllers.push(j(w));break;case"instance_light":y.instanceLights.push(o(w.getAttribute("url")));break;case"instance_geometry":y.instanceGeometries.push(j(w));break;case"instance_node":y.instanceNodes.push(o(w.getAttribute("url")));break;case"matrix":I=s(w.textContent),y.matrix.multiply(X.fromArray(I).transpose()),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"translate":I=s(w.textContent),J.fromArray(I),y.matrix.multiply(X.makeTranslation(J.x,J.y,J.z)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"rotate":I=s(w.textContent);const ie=Hi.degToRad(I[3]);y.matrix.multiply(X.makeRotationAxis(J.fromArray(I),ie)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"scale":I=s(w.textContent),y.matrix.scale(J.fromArray(I)),y.transforms[w.getAttribute("sid")]=w.nodeName;break;case"extra":break;default:console.log(w)}}return et(y.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",y.id):ft.nodes[y.id]=y,y}function j(M){const y={id:o(M.getAttribute("url")),materials:{},skeletons:[]};for(let P=0;P<M.childNodes.length;P++){const w=M.childNodes[P];switch(w.nodeName){case"bind_material":const I=w.getElementsByTagName("instance_material");for(let ie=0;ie<I.length;ie++){const de=I[ie],We=de.getAttribute("symbol"),Ie=de.getAttribute("target");y.materials[We]=o(Ie)}break;case"skeleton":y.skeletons.push(o(w.textContent));break}}return y}function be(M,y){const P=[],w=[];let I,ie,de;for(I=0;I<M.length;I++){const ze=M[I];let Ze;if(et(ze))Ze=gt(ze),Oe(Ze,y,P);else if(kt(ze)){const Ke=ft.visualScenes[ze].children;for(let $e=0;$e<Ke.length;$e++){const at=Ke[$e];if(at.type==="JOINT"){const it=gt(at.id);Oe(it,y,P)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",ze)}for(I=0;I<y.length;I++)for(ie=0;ie<P.length;ie++)if(de=P[ie],de.bone.name===y[I].name){w[I]=de,de.processed=!0;break}for(I=0;I<P.length;I++)de=P[I],de.processed===!1&&(w.push(de),de.processed=!0);const We=[],Ie=[];for(I=0;I<w.length;I++)de=w[I],We.push(de.bone),Ie.push(de.boneInverse);return new Bl(We,Ie)}function Oe(M,y,P){M.traverse(function(w){if(w.isBone===!0){let I;for(let ie=0;ie<y.length;ie++){const de=y[ie];if(de.name===w.name){I=de.boneInverse;break}}I===void 0&&(I=new lt),P.push({bone:w,boneInverse:I,processed:!1})}})}function Ye(M){const y=[],P=M.matrix,w=M.nodes,I=M.type,ie=M.instanceCameras,de=M.instanceControllers,We=M.instanceLights,Ie=M.instanceGeometries,ze=M.instanceNodes;for(let xe=0,Ke=w.length;xe<Ke;xe++)y.push(gt(w[xe]));for(let xe=0,Ke=ie.length;xe<Ke;xe++){const $e=De(ie[xe]);$e!==null&&y.push($e.clone())}for(let xe=0,Ke=de.length;xe<Ke;xe++){const $e=de[xe],at=re($e.id),it=en(at.id),Vt=dt(it,$e.materials),Lt=$e.skeletons,At=at.skin.joints,wt=be(Lt,At);for(let ii=0,xn=Vt.length;ii<xn;ii++){const nr=Vt[ii];nr.isSkinnedMesh&&(nr.bind(wt,at.skin.bindMatrix),nr.normalizeSkinWeights()),y.push(nr)}}for(let xe=0,Ke=We.length;xe<Ke;xe++){const $e=H(We[xe]);$e!==null&&y.push($e.clone())}for(let xe=0,Ke=Ie.length;xe<Ke;xe++){const $e=Ie[xe],at=en($e.id),it=dt(at,$e.materials);for(let Vt=0,Lt=it.length;Vt<Lt;Vt++)y.push(it[Vt])}for(let xe=0,Ke=ze.length;xe<Ke;xe++)y.push(gt(ze[xe]).clone());let Ze;if(w.length===0&&y.length===1)Ze=y[0];else{Ze=I==="JOINT"?new Ru:new Kn;for(let xe=0;xe<y.length;xe++)Ze.add(y[xe])}return Ze.name=I==="JOINT"?M.sid:M.name,Ze.matrix.copy(P),Ze.matrix.decompose(Ze.position,Ze.quaternion,Ze.scale),Ze}const Ge=new Ri({name:Gn.DEFAULT_MATERIAL_NAME,color:16711935});function ut(M,y){const P=[];for(let w=0,I=M.length;w<I;w++){const ie=y[M[w]];ie===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",M[w]),P.push(Ge)):P.push(ne(ie))}return P}function dt(M,y){const P=[];for(const w in M){const I=M[w],ie=ut(I.materialKeys,y);if(ie.length===0&&(w==="lines"||w==="linestrips"?ie.push(new Ci):ie.push(new Mn)),w==="lines"||w==="linestrips")for(let ze=0,Ze=ie.length;ze<Ze;ze++){const xe=ie[ze];if(xe.isMeshPhongMaterial===!0||xe.isMeshLambertMaterial===!0){const Ke=new Ci;Ke.color.copy(xe.color),Ke.opacity=xe.opacity,Ke.transparent=xe.transparent,ie[ze]=Ke}}const de=I.data.attributes.skinIndex!==void 0,We=ie.length===1?ie[0]:ie;let Ie;switch(w){case"lines":Ie=new va(I.data,We);break;case"linestrips":Ie=new Vl(I.data,We);break;case"triangles":case"polylist":de?Ie=new wp(I.data,We):Ie=new Rt(I.data,We);break}P.push(Ie)}return P}function et(M){return ft.nodes[M]!==void 0}function gt(M){return _(ft.nodes[M],Ye)}function Ct(M){const y={name:M.getAttribute("name"),children:[]};D(M);const P=n(M,"node");for(let w=0;w<P.length;w++)y.children.push(Z(P[w]));ft.visualScenes[M.getAttribute("id")]=y}function Ot(M){const y=new Kn;y.name=M.name;const P=M.children;for(let w=0;w<P.length;w++){const I=P[w];y.add(gt(I.id))}return y}function kt(M){return ft.visualScenes[M]!==void 0}function St(M){return _(ft.visualScenes[M],Ot)}function st(M){const y=n(M,"instance_visual_scene")[0];return St(o(y.getAttribute("url")))}function Yt(){const M=ft.clips;if(c(M)===!0){if(c(ft.animations)===!1){const y=[];for(const P in ft.animations){const w=v(P);for(let I=0,ie=w.length;I<ie;I++)y.push(w[I])}$t.push(new Jc("default",-1,y))}}else for(const y in M)$t.push(q(y))}function Et(M){let y="";const P=[M];for(;P.length;){const w=P.shift();w.nodeType===Node.TEXT_NODE?y+=w.textContent:(y+=`
4205
4205
  `,P.push(...w.childNodes))}return y.trim()}if(e.length===0)return{scene:new Ol};const yn=new DOMParser().parseFromString(e,"application/xml"),zt=n(yn,"COLLADA")[0],rn=yn.getElementsByTagName("parsererror")[0];if(rn!==void 0){const M=n(rn,"div")[0];let y;return M?y=M.textContent:y=Et(rn),console.error(`THREE.ColladaLoader: Failed to parse collada file.
4206
- `,y),null}const Pi=zt.getAttribute("version");console.debug("THREE.ColladaLoader: File version",Pi);const Ft=h(n(zt,"asset")[0]),mn=new ql(this.manager);mn.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);let un;jh&&(un=new jh(this.manager),un.setPath(this.resourcePath||t));const Xt=new ot,$t=[];let tr={},ni=0;const ft={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};f(zt,"library_animations","animation",g),f(zt,"library_animation_clips","animation_clip",k),f(zt,"library_controllers","controller",he),f(zt,"library_images","image",ae),f(zt,"library_effects","effect",_e),f(zt,"library_materials","material",G),f(zt,"library_cameras","camera",Ce),f(zt,"library_lights","light",Je),f(zt,"library_geometries","geometry",Fe),f(zt,"library_nodes","node",Z),f(zt,"library_visual_scenes","visual_scene",Ct),f(zt,"library_kinematics_models","kinematics_model",je),f(zt,"library_physics_models","physics_model",nn),f(zt,"scene","instance_kinematics_scene",En),m(ft.animations,E),m(ft.clips,Q),m(ft.controllers,we),m(ft.images,oe),m(ft.effects,N),m(ft.materials,se),m(ft.cameras,me),m(ft.lights,ct),m(ft.geometries,ht),m(ft.visualScenes,Ot),Yt(),Qi();const ps=st(n(zt,"scene")[0]);return ps.animations=$t,Ft.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),ps.rotation.set(-Math.PI/2,0,0)),ps.scale.multiplyScalar(Ft.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),$t},kinematics:tr,library:ft,scene:ps}}}const Yh=new F,z3=new Sn,Qs=new lt,Si=new lt,ea=new Rn,ta=new F(1,1,1),na=new F;class Ra extends Nt{constructor(...e){super(...e),this.urdfNode=null,this.urdfName=""}copy(e,t){return super.copy(e,t),this.urdfNode=e.urdfNode,this.urdfName=e.urdfName,this}}class B3 extends Ra{constructor(...e){super(...e),this.isURDFCollider=!0,this.type="URDFCollider"}}class k3 extends Ra{constructor(...e){super(...e),this.isURDFVisual=!0,this.type="URDFVisual"}}class Ku extends Ra{constructor(...e){super(...e),this.isURDFLink=!0,this.type="URDFLink"}}class Zu extends Ra{get jointType(){return this._jointType}set jointType(e){if(this.jointType!==e)switch(this._jointType=e,this.matrixWorldNeedsUpdate=!0,e){case"fixed":this.jointValue=[];break;case"continuous":case"revolute":case"prismatic":this.jointValue=new Array(1).fill(0);break;case"planar":this.jointValue=new Array(3).fill(0),this.axis=new F(0,0,1);break;case"floating":this.jointValue=new Array(6).fill(0);break}}get angle(){return this.jointValue[0]}constructor(...e){super(...e),this.isURDFJoint=!0,this.type="URDFJoint",this.jointValue=null,this.jointType="fixed",this.axis=new F(1,0,0),this.limit={lower:0,upper:0},this.ignoreLimits=!1,this.origPosition=null,this.origQuaternion=null,this.mimicJoints=[]}copy(e,t){return super.copy(e,t),this.jointType=e.jointType,this.axis=e.axis.clone(),this.limit.lower=e.limit.lower,this.limit.upper=e.limit.upper,this.ignoreLimits=!1,this.jointValue=[...e.jointValue],this.origPosition=e.origPosition?e.origPosition.clone():null,this.origQuaternion=e.origQuaternion?e.origQuaternion.clone():null,this.mimicJoints=[...e.mimicJoints],this}setJointValue(...e){e=e.map(n=>n===null?null:parseFloat(n)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let t=!1;switch(this.mimicJoints.forEach(n=>{t=n.updateFromMimickedJoint(...e)||t}),this.jointType){case"fixed":return t;case"continuous":case"revolute":{let n=e[0];return n==null||n===this.jointValue[0]?t:(!this.ignoreLimits&&this.jointType==="revolute"&&(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.quaternion.setFromAxisAngle(this.axis,n).premultiply(this.origQuaternion),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"prismatic":{let n=e[0];return n==null||n===this.jointValue[0]?t:(this.ignoreLimits||(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.position.copy(this.origPosition),Yh.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Yh,n),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"floating":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],Si.compose(this.origPosition,this.origQuaternion,ta),ea.setFromEuler(z3.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),na.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),Qs.compose(na,ea,ta),Si.premultiply(Qs),this.position.setFromMatrixPosition(Si),this.rotation.setFromRotationMatrix(Si),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],Si.compose(this.origPosition,this.origQuaternion,ta),ea.setFromAxisAngle(this.axis,this.jointValue[2]),na.set(this.jointValue[0],this.jointValue[1],0),Qs.compose(na,ea,ta),Si.premultiply(Qs),this.position.setFromMatrixPosition(Si),this.rotation.setFromRotationMatrix(Si),this.matrixWorldNeedsUpdate=!0,!0)}return t}}class $h extends Zu{constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const t=e.map(n=>n*this.multiplier+this.offset);return super.setJointValue(...t)}copy(e,t){return super.copy(e,t),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class V3 extends Ku{constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,t){super.copy(e,t),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(n=>{n.isURDFJoint&&n.urdfName in e.joints&&(this.joints[n.urdfName]=n),n.isURDFLink&&n.urdfName in e.links&&(this.links[n.urdfName]=n),n.isURDFCollider&&n.urdfName in e.colliders&&(this.colliders[n.urdfName]=n),n.isURDFVisual&&n.urdfName in e.visual&&(this.visual[n.urdfName]=n)});for(const n in this.joints)this.joints[n].mimicJoints=this.joints[n].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...t){const n=this.joints[e];return n?n.setJointValue(...t):!1}setJointValues(e){let t=!1;for(const n in e){const i=e[n];Array.isArray(i)?t=this.setJointValue(n,...i)||t:t=this.setJointValue(n,i)||t}return t}}const Eo=new Rn,Jh=new Sn;function br(r){return r?r.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function Kh(r,e,t=!1){t||r.rotation.set(0,0,0),Jh.set(e[0],e[1],e[2],"ZYX"),Eo.setFromEuler(Jh),Eo.multiply(r.quaternion),r.quaternion.copy(Eo)}class H3{constructor(e){this.manager=e||Xl,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((t,n)=>{this.load(e,t,null,n)})}load(e,t,n,i){const s=this.manager,a=Yl.extractUrlBase(e),o=this.manager.resolveURL(e);s.itemStart(o),fetch(o,this.fetchOptions).then(l=>{if(l.ok)return n&&n(null),l.text();throw new Error(`URDFLoader: Failed to load url '${o}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);t(c),s.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),s.itemError(o),s.itemEnd(o)})}parse(e,t=this.workingPath){const n=this.packages,i=this.loadMeshCb,s=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function u(S){if(!/^package:\/\//.test(S))return t?t+S:S;const[E,v]=S.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(E)?n+"/"+v:n+"/"+E+"/"+v;if(n instanceof Function)return n(E)+"/"+v;if(typeof n=="object")return E in n?n[E]+"/"+v:(console.error(`URDFLoader : ${E} not found in provided package list.`),null)}function d(S){let E;S instanceof Document?E=[...S.children]:S instanceof Element?E=[S]:E=[...new DOMParser().parseFromString(S,"text/xml").children];const v=E.filter(U=>U.nodeName==="robot").pop();return f(v)}function f(S){const E=[...S.children],v=E.filter(R=>R.nodeName.toLowerCase()==="link"),U=E.filter(R=>R.nodeName.toLowerCase()==="joint"),C=E.filter(R=>R.nodeName.toLowerCase()==="material"),T=new V3;T.robotName=S.getAttribute("name"),T.urdfRobotNode=S,C.forEach(R=>{const B=R.getAttribute("name");h[B]=g(R)});const L={},b={};v.forEach(R=>{const B=R.getAttribute("name"),V=S.querySelector(`child[link="${B}"]`)===null;l[B]=_(R,L,b,V?T:null)}),U.forEach(R=>{const B=R.getAttribute("name");c[B]=m(R)}),T.joints=c,T.links=l,T.colliders=b,T.visual=L;const x=Object.values(c);return x.forEach(R=>{R instanceof $h&&c[R.mimicJoint].mimicJoints.push(R)}),x.forEach(R=>{const B=new Set,V=W=>{if(B.has(W))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");B.add(W),W.mimicJoints.forEach(ee=>{V(ee)})};V(R)}),T.frames={...b,...L,...l,...c},T}function m(S){const E=[...S.children],v=S.getAttribute("type");let U;const C=E.find(B=>B.nodeName.toLowerCase()==="mimic");C?(U=new $h,U.mimicJoint=C.getAttribute("joint"),U.multiplier=parseFloat(C.getAttribute("multiplier")||1),U.offset=parseFloat(C.getAttribute("offset")||0)):U=new Zu,U.urdfNode=S,U.name=S.getAttribute("name"),U.urdfName=U.name,U.jointType=v;let T=null,L=null,b=[0,0,0],x=[0,0,0];E.forEach(B=>{const V=B.nodeName.toLowerCase();V==="origin"?(b=br(B.getAttribute("xyz")),x=br(B.getAttribute("rpy"))):V==="child"?L=l[B.getAttribute("link")]:V==="parent"?T=l[B.getAttribute("link")]:V==="limit"&&(U.limit.lower=parseFloat(B.getAttribute("lower")||U.limit.lower),U.limit.upper=parseFloat(B.getAttribute("upper")||U.limit.upper))}),T.add(U),U.add(L),Kh(U,x),U.position.set(b[0],b[1],b[2]);const R=E.filter(B=>B.nodeName.toLowerCase()==="axis")[0];if(R){const B=R.getAttribute("xyz").split(/\s+/g).map(V=>parseFloat(V));U.axis=new F(B[0],B[1],B[2]),U.axis.normalize()}return U}function _(S,E,v,U=null){U===null&&(U=new Ku);const C=[...S.children];return U.name=S.getAttribute("name"),U.urdfName=U.name,U.urdfNode=S,s&&C.filter(L=>L.nodeName.toLowerCase()==="visual").forEach(L=>{const b=p(L,h);if(U.add(b),L.hasAttribute("name")){const x=L.getAttribute("name");b.name=x,b.urdfName=x,E[x]=b}}),a&&C.filter(L=>L.nodeName.toLowerCase()==="collision").forEach(L=>{const b=p(L);if(U.add(b),L.hasAttribute("name")){const x=L.getAttribute("name");b.name=x,b.urdfName=x,v[x]=b}}),U}function g(S){const E=[...S.children],v=new Mn;return v.name=S.getAttribute("name")||"",E.forEach(U=>{const C=U.nodeName.toLowerCase();if(C==="color"){const T=U.getAttribute("rgba").split(/\s/g).map(L=>parseFloat(L));v.color.setRGB(T[0],T[1],T[2]),v.opacity=T[3],v.transparent=T[3]<1,v.depthWrite=!v.transparent}else if(C==="texture"){const T=U.getAttribute("filename");if(T){const L=new ql(o),b=u(T);v.map=L.load(b),v.map.colorSpace=Tt}}}),v}function p(S,E={}){const v=S.nodeName.toLowerCase()==="collision",U=[...S.children];let C=null;const T=U.filter(b=>b.nodeName.toLowerCase()==="material")[0];if(T){const b=T.getAttribute("name");b&&b in E?C=E[b]:C=g(T)}else C=new Mn;const L=v?new B3:new k3;return L.urdfNode=S,U.forEach(b=>{const x=b.nodeName.toLowerCase();if(x==="geometry"){const R=b.children[0].nodeName.toLowerCase();if(R==="mesh"){const B=b.children[0].getAttribute("filename"),V=u(B);if(V!==null){const W=b.children[0].getAttribute("scale");if(W){const ee=br(W);L.scale.set(ee[0],ee[1],ee[2])}i(V,o,(ee,k)=>{k?console.error("URDFLoader: Error loading mesh.",k):ee&&(ee instanceof Rt&&(ee.material=C),ee.position.set(0,0,0),ee.quaternion.identity(),L.add(ee))})}}else if(R==="box"){const B=new Rt;B.geometry=new Nr(1,1,1),B.material=C;const V=br(b.children[0].getAttribute("size"));B.scale.set(V[0],V[1],V[2]),L.add(B)}else if(R==="sphere"){const B=new Rt;B.geometry=new Aa(1,30,30),B.material=C;const V=parseFloat(b.children[0].getAttribute("radius"))||0;B.scale.set(V,V,V),L.add(B)}else if(R==="cylinder"){const B=new Rt;B.geometry=new Hl(1,1,1,30),B.material=C;const V=parseFloat(b.children[0].getAttribute("radius"))||0,W=parseFloat(b.children[0].getAttribute("length"))||0;B.scale.set(V,W,V),B.rotation.set(Math.PI/2,0,0),L.add(B)}}else if(x==="origin"){const R=br(b.getAttribute("xyz")),B=br(b.getAttribute("rpy"));L.position.set(R[0],R[1],R[2]),L.rotation.set(0,0,0),Kh(L,B)}}),L}return d(e)}defaultMeshLoader(e,t,n){/\.stl$/i.test(e)?new da(t).load(e,s=>{const a=new Rt(s,new Mn);n(a)}):/\.dae$/i.test(e)?new O3(t).load(e,s=>n(s.scene)):console.warn(`URDFLoader: Could not load model at ${e}.
4207
- No loader available`)}}const G3=tu.useModelComp(fe.pinia),{systemPath:Zh}=fe.storeToRefs(G3),ia=K.ref();function W3(r,e,t,n,i){const s=async d=>{try{const f=await jn.downloadAvatarApi({url:d});if(f.status!==200)throw new Error(`下载失败: ${f.status}`);return f.data}catch(f){throw console.error("addModelFromUrl失败:",f),f}},a=d=>new Promise((f,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,E=new So().parse(p);E.preload(),f(E)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(d)}),o=async d=>{const f={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new Mn({color:8947848,side:pn}))},getAsArray:function(){const m=[];for(const _ in this.materials)m.push(this.materials[_]);return m},preload:function(){for(const m in this.materials)this.materials[m].map&&(this.materials[m].map.needsUpdate=!0)}};for(const m of d){const _=await a(m);Object.assign(f.materials,_.materials)}return f.preload(),f},l=async(d,f=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const S=p.target.result;let E=null;f&&f.length>0&&(f.length===1?E=await a(f[0]):E=await o(f));const v=new bo;E&&v.setMaterials(E);const U=v.parse(S);E||U.traverse(C=>{C.isMesh&&(C.material=new Mn({color:8947848,side:pn}))}),m(U)}catch(S){_(S)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(d)}),c=async d=>{var f;try{t.value=!0;const{scene:m}=r();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<d.length;g++){const p=d[g];n.value=`正在加载模型 ${g+1}/${d.length}...`;const S=await s(p.objUrl),E=((f=p.objUrl)==null?void 0:f.split("/").pop())||`model_${g}.obj`,v=new File([S],E,{type:S.type});let U=[];if(p.mtlUrls){const T=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let L=0;L<T.length;L++){const b=T[L],x=await s(b),R=(b==null?void 0:b.split("/").pop())||`material_${g}_${L}.mtl`,B=new File([x],R,{type:x.type});U.push(B)}}const C=await l(v,U);m.add(C),e.value.push(C),_.push(C)}return t.value=!1,_}catch(m){throw console.error("加载模型失败:",m),t.value=!1,m}},h=async(d,f,m=[],_=[])=>{let g;const p=d.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const S=await f.text();if(p===".txt"||p===".cpt"){const _e=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,ke=[...S.matchAll(_e)].map(O=>({x:parseFloat(O[1]),y:parseFloat(O[2]),z:parseFloat(O[3])})),tt=new Bt,Ze=ke.flatMap(O=>[O.x,O.y,O.z]);if(tt.setAttribute("position",new mt(Ze,3)),p===".txt"){const O=new Wi({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Qr(tt,O)}else if(p===".cpt"){const O=new Ci({color:"#5B5C99",linewidth:100});g=new Vl(tt,O)}}else if(p===".obj"){const _e=new bo;if(m&&m.length>0){const Ae=new So;for(const ke of m){const tt=await ke.text(),Ze=Ae.parse(tt);Ze.preload(),_e.setMaterials(Ze);break}}g=_e.parse(S),(!m||m.length===0)&&g.traverse(Ae=>{Ae.isMesh&&(Ae.material=new Mn({color:"#B3B3D4"})),Ae instanceof Rt&&(Ae.material.side=pn)})}break;case".stl":const E=await f.arrayBuffer(),U=new da().parse(E),C=new Mn({color:"#B3B3D4",side:pn});g=new Rt(U,C);break;case".nc":const T=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],L={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},b=new Kn,x=T.map(_e=>new Promise((Ae,ke)=>{new da().load(Zh.value===""?`/model/${_e}`:`${Zh.value}\\${_e}`,Ze=>{const O=new Mn({color:L[_e]||"#B3B3D4",side:pn}),bt=new Rt(Ze,O);Ae(bt)},void 0,ke)}));try{(await Promise.all(x)).forEach(Ae=>b.add(Ae)),g=b}catch(_e){throw console.error("加载NC文件对应的STL文件失败:",_e),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const R=new F3,B=new Kn;try{const _e=await fe.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),Ae=new Blob([_e.data],{type:"application/octet-stream;charset=UTF-8"}),ke=await fe.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),tt=new Blob([ke.data],{type:"application/octet-stream;charset=UTF-8"}),Ze=await new Promise((bt,$)=>{const pe=URL.createObjectURL(Ae);R.load(pe,te=>{const Te=new Float32Array(te.geometry.attributes.position.count*3);for(let ce=0;ce<te.geometry.attributes.position.count;ce++)Te[ce*3]=1,Te[ce*3+1]=0,Te[ce*3+2]=0;te.geometry.setAttribute("color",new Gt(Te,3)),te.material.vertexColors=!0,te.scale.set(.3,.3,.3),URL.revokeObjectURL(pe),bt(te)},void 0,$)}),O=await new Promise((bt,$)=>{const pe=URL.createObjectURL(tt);R.load(pe,te=>{const Te=new Float32Array(te.geometry.attributes.position.count*3);for(let ce=0;ce<te.geometry.attributes.position.count;ce++)Te[ce*3]=0,Te[ce*3+1]=1,Te[ce*3+2]=0;te.geometry.setAttribute("color",new Gt(Te,3)),te.material.vertexColors=!0,te.scale.set(.3,.3,.3),URL.revokeObjectURL(pe),bt(te)},void 0,$)});B.add(Ze),B.add(O),g=B}catch(_e){throw console.error("PCD文件加载失败:",_e),new Error("无法加载PCD文件")}break;case".urdf":const V=URL.createObjectURL(f),W=new H3,ee="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",k={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},Q=new Map,q=new Map,he=new Map,ye=async _e=>{if(Q.has(_e))return console.log(`从缓存加载: ${_e}`),Q.get(_e);try{const Ae=await fe.axios.get(`${ee}/${_e}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),ke=new Blob([Ae.data],{type:"application/octet-stream;charset=UTF-8"});return k.enableCache&&Q.set(_e,ke),ke}catch(Ae){throw console.error(`加载文件失败: ${_e}`,Ae),new Error(`无法加载文件: ${_e}`)}},le=(_e="default")=>{if(q.has(_e))return q.get(_e);const Ae=new Mn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Hn});return q.set(_e,Ae),Ae},Le=_e=>{try{_e.isBufferGeometry&&_e.mergeVertices&&_e.mergeVertices(),_e.computeVertexNormals&&_e.computeVertexNormals(),_e.computeBoundingSphere&&_e.computeBoundingSphere(),_e.deleteAttribute&&_e.deleteAttribute("uv2")}catch(Ae){console.warn("几何体优化失败,使用原始几何体:",Ae)}return _e},we=async(_e,Ae,ke)=>{const tt=`stl_${Ae}`;if(he.has(tt)){const $=he.get(tt);return new Rt($,le())}const Ze=await _e.arrayBuffer();let bt=new da(ke).parse(Ze);return bt=Le(bt),he.set(tt,bt),new Rt(bt,le())},Y=async(_e,Ae,ke)=>{const tt=`obj_${Ae}`;if(Q.has(tt))return Q.get(tt).clone();const Ze=await _e.text(),O=new bo(ke),bt=Ae.replace(".obj",".mtl");try{const te=await(await ye(bt)).text(),ce=new So(ke).parse(te);ce.preload(),O.setMaterials(ce)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${bt}`)}const $=O.parse(Ze);return $.traverse(pe=>{pe.isMesh&&(pe.geometry=Le(pe.geometry),pe.castShadow=!0,pe.receiveShadow=!0,pe.renderOrder=1)}),Q.set(tt,$),$},re=(_e,Ae)=>{const ke=new Ep;if(ke.addLevel(_e,0),_e.geometry){const tt=_e.geometry.clone(),Ze=new Rt(tt,_e.material);ke.addLevel(Ze,50)}return ke};let ae=0,oe=0;const Se=[];W.loadMeshCb=async(_e,Ae,ke,tt,Ze)=>{const O=_e.split("/").pop(),bt=ke||(()=>{}),$=Ze||(()=>{});ae++;const pe=new Promise(async(te,Te)=>{try{const ce=await ye(O);if(!ce||ce.size===0)throw new Error(`文件为空: ${O}`);const ue=O.split(".").pop().toLowerCase();let De;switch(ue){case"stl":De=await we(ce,O,Ae);break;case"obj":De=await Y(ce,O,Ae);break;default:throw new Error(`不支持的文件格式: ${ue}`)}k.enableLOD&&De.isMesh&&(De=re(De,O)),bt(De),oe++,tt&&tt({loaded:oe,total:ae,progress:oe/ae}),te(De)}catch(ce){console.error(`mesh文件加载失败: ${O}`,ce),new Kn,$(ce),Te(ce)}});Se.push(pe)};try{if(!V){ia.value=void 0;break}if(g=await W.loadAsync(V),console.log(`URDF文件加载完成,等待${ae}个mesh文件加载...`),Se.length>0)try{await Promise.allSettled(Se),console.log(`所有mesh文件处理完成,成功加载: ${oe}/${ae}`)}catch(_e){console.warn("部分mesh文件加载失败,但继续显示模型",_e)}g.traverse(_e=>{_e.isMesh&&(_e.castShadow=!0,_e.receiveShadow=!0,_e.renderOrder=1,_e.material&&(_e.material.needsUpdate=!0))}),ia.value=g,console.log("URDF模型加载完成并优化")}catch(_e){console.error("URDF加载失败:",_e),ia.value=void 0}finally{V&&URL.revokeObjectURL(V)}break;default:throw new Error(`不支持的文件格式: ${d}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async d=>{console.log(d);try{t.value=!0,n.value="正在加载模型...";const{scene:f}=r();if(!f)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<d.length;_++){const g=d[_],p=await h(g.suffix,g.blob,g.mtlBlobs||[],g.meshFiles||[]);p&&(f.add(p),e.value.push(p),m.push(p))}return t.value=!1,n.value="",m}catch(f){throw console.error("加载模型失败:",f),t.value=!1,n.value="",f}},urdfModel:ia}}window._iconfont_svg_string_4634042='<svg><symbol id="icon-lookAround" viewBox="0 0 1041 1024"><path d="M520.685026 798.355937c-10.788594 0-21.577187-2.790872-31.241101-8.372615l-291.583615-168.36871A62.482203 62.482203 0 0 1 166.619208 567.505024V230.850913c0-22.368629 11.913273-42.987756 31.241102-54.109588l291.583615-168.36871a62.482203 62.482203 0 0 1 62.482203 0l291.583615 168.36871c19.327828 11.121832 31.241102 31.740959 31.241101 54.109588v336.654111a62.482203 62.482203 0 0 1-31.241101 54.109588l-291.583615 168.36871a62.857096 62.857096 0 0 1-31.241102 8.372615zM291.583615 531.39031l229.101411 132.295652 229.101412-132.295652v-264.507993l-229.101412-132.295651L291.583615 266.923972v264.466338z m520.685026 36.114714h0.416548-0.416548z" fill="#aaaaaa" ></path><path d="M520.685026 461.660172c-10.788594 0-21.577187-2.790872-31.241101-8.372616l-291.583615-168.327055a62.482203 62.482203 0 0 1 62.482203-108.219176L520.685026 326.990196l260.342513-150.248871a62.482203 62.482203 0 1 1 62.482204 108.219176l-291.583615 168.327055a62.857096 62.857096 0 0 1-31.241102 8.372616z" fill="#aaaaaa" ></path><path d="M520.685026 798.355937a62.482203 62.482203 0 0 1-62.482203-62.482203V399.177969a62.482203 62.482203 0 1 1 124.964406 0v336.695765a62.482203 62.482203 0 0 1-62.482203 62.482203z" fill="#aaaaaa" ></path><path d="M520.685026 1003.172599c-53.276492 0-520.685026-5.248505-520.685026-187.446609 0-62.982061 54.776065-111.259976 162.870276-143.584103 33.073913-9.622259 67.855673 8.914128 77.769516 41.98804s-8.872473 67.897327-41.946386 77.769516c-30.324696 9.080747-49.194321 17.619981-60.649392 24.11813 46.32014 26.242525 178.657446 62.19062 382.641012 62.19062s336.320872-35.948094 382.641012-62.19062c-11.455071-6.498149-30.324696-15.037384-60.649392-24.11813a62.482203 62.482203 0 1 1 35.82313-119.757556c108.094211 32.324126 162.870276 80.643697 162.870276 143.584103 0 182.198104-467.408534 187.446609-520.685026 187.446609z m398.886385-175.366717h0.416548-0.416548z" fill="#72B02D" ></path></symbol><symbol id="icon-xuanzhuan" viewBox="0 0 1024 1024"><path d="M378.963454 724.443778l91.182641 163.473426c6.246088 11.212239 2.252687 25.39393-9.010749 31.691216l-163.473427 91.18264c-18.123894 10.085896-39.422029-6.758062-33.739113-26.673866l72.290786-254.707264c5.682916-19.967002 32.663967-23.090045 42.749862-4.966152z" fill="#FC794B" ></path><path d="M414.64807 903.9932c-1.228739 0-2.40628-0.051197-3.635018-0.204789C169.002752 879.367232 0.000003 771.443028 0.000003 641.452727c0-52.221389 27.032248-102.19009 78.127293-144.581571a35.827969 35.827969 0 0 1 50.480676 4.710165 35.827969 35.827969 0 0 1-4.710164 50.480676C100.090998 571.824209 71.727616 603.310634 71.727616 641.452727c0 88.929954 148.984551 171.050647 346.504275 191.068847 19.711014 1.9967 34.046298 19.557422 32.049597 39.268436a35.879166 35.879166 0 0 1-35.633418 32.20319zM608.430381 904.095595c-18.175091 0-33.79031-13.772111-35.633418-32.254387-1.945503-19.711014 12.389781-37.271736 32.100795-39.217239 198.134093-19.813409 347.528224-101.985301 347.528223-191.171242 0-23.550822-10.649068-47.050447-31.58882-69.935703-13.362532-14.59127-12.389781-37.271736 2.20149-50.634268 14.59127-13.362532 37.271736-12.389781 50.634268 2.20149 32.971151 35.9918 50.429479 76.898555 50.429478 118.368481 0 130.297485-169.463527 238.221689-412.088195 262.489276-1.177541 0.102395-2.40628 0.153592-3.583821 0.153592z" fill="#FC794B" ></path><path d="M846.703267 184.413179l-325.308534 184.464377L196.137396 184.413179 521.394733 0z" fill="#BEC5CB" ></path><path d="M521.394733 737.703915l325.308534-184.41318V184.413179l-325.308534 184.464377z" fill="#808487" ></path><path d="M521.394733 737.703915L196.137396 553.290735V184.413179l325.257337 184.464377z" fill="#9CA3A9" ></path></symbol><symbol id="icon-clipping" viewBox="0 0 1024 1024"><path d="M341.930667 201.770667l353.706666 204.245333v408.448l-353.706666-204.245333z" fill="#4A80FF" fill-opacity="0.15" ></path><path d="M320.853333 165.248l396.117334 228.608v457.173333l-395.946667-228.608z m353.749334 252.970667L362.837333 238.336v359.722667l311.466667 179.882666z" fill="#72B02D" ></path><path d="M544.384 746.453333l-211.669333-211.669333 18.688-18.688 211.669333 211.669333z" fill="#72B02D" ></path><path d="M693.717333 530.261333l-266.453333-266.325333 20.906667-20.906667 266.325333 266.453334z" fill="#72B02D" ></path><path d="M688.853333 621.098667l-366.933333-366.933334 24.448-24.704 366.933333 366.933334z" fill="#72B02D" ></path><path d="M689.664 713.856L321.578667 345.770667l24.618666-24.618667 368.085334 368.128z" fill="#72B02D" ></path><path d="M683.605333 799.317333l-355.712-355.712 24.234667-24.234666 355.712 355.712z" fill="#72B02D" ></path><path d="M537.770667 944.938667h-51.2v-418.602667l-362.666667-209.28 25.6-44.330667 362.666667 209.066667 362.666666-209.066667 25.6 44.330667-362.666666 209.066667z" fill="#AAAAAA" ></path><path d="M512.170667 53.461333a31.146667 31.146667 0 0 1 15.488 4.266667l370.090666 213.632a31.232 31.232 0 0 1 15.317334 26.794667v426.922666a31.274667 31.274667 0 0 1-15.317334 26.837334l-369.834666 213.333333a31.488 31.488 0 0 1-31.061334 0l-369.834666-213.333333a31.146667 31.146667 0 0 1-15.914667-26.837334V298.069333a31.146667 31.146667 0 0 1 15.573333-27.008l369.792-213.333333a30.976 30.976 0 0 1 15.701334-4.266667z m349.866666 256l-349.866666-201.642666-349.866667 201.856v403.84l349.866667 201.813333 349.866666-201.898667z" fill="#AAAAAA" ></path></symbol><symbol id="icon-viewReset" viewBox="0 0 1024 1024"><path d="M643.2 515.2c-89.6-67.2-179.2-60.8-268.8 0-32 22.4-67.2 57.6-105.6 89.6 38.4 32 70.4 70.4 108.8 96 28.8 19.2 60.8 32 96 38.4 118.4 19.2 188.8-57.6 268.8-137.6-35.2-28.8-60.8-64-99.2-86.4zM508.8 704c-51.2 0-96-41.6-96-99.2s41.6-105.6 96-105.6 96 41.6 96 99.2c0 64-38.4 105.6-96 105.6z" fill="#AAAAAA" ></path><path d="M515.2 544c-3.2 41.6 12.8 60.8 51.2 51.2 0 32-19.2 57.6-51.2 57.6s-57.6-22.4-51.2-57.6c-6.4-32 16-51.2 51.2-51.2" fill="#AAAAAA" ></path><path d="M652.8 3.2c9.6-3.2 19.2-3.2 28.8 0 9.6 3.2 12.8 12.8 12.8 22.4v108.8c70.4 28.8 131.2 70.4 179.2 128 80 89.6 118.4 214.4 108.8 336-9.6 124.8-70.4 236.8-166.4 313.6-96 80-224 118.4-345.6 108.8-124.8-9.6-243.2-67.2-323.2-160S32 649.6 41.6 524.8c9.6-118.4 70.4-233.6 160-307.2 22.4-19.2 60.8-19.2 80 3.2 19.2 22.4 19.2 57.6-3.2 80-70.4 57.6-115.2 140.8-124.8 233.6s22.4 185.6 80 249.6c60.8 70.4 147.2 115.2 243.2 124.8 96 9.6 188.8-19.2 259.2-80s118.4-140.8 124.8-236.8c9.6-89.6-22.4-185.6-80-249.6-28.8-28.8-57.6-57.6-89.6-76.8v89.6c0 9.6-3.2 19.2-12.8 22.4-9.6 3.2-19.2 3.2-28.8 0l-227.2-160c-3.2-3.2-9.6-12.8-9.6-19.2 0-9.6 3.2-12.8 9.6-19.2L652.8 3.2z" fill="#72B02D" ></path></symbol><symbol id="icon-donghuafangzhen" viewBox="0 0 1024 1024"><path d="M868.864 228.864c-19.968 0-38.912 7.68-53.248 20.992l-291.328-170.496c-7.168-5.12-16.896-5.12-24.064 0L208.896 248.832c-14.336-12.8-33.28-20.48-53.76-20.48-43.52 0-79.872 36.864-79.872 80.896 0 33.792 21.504 63.488 53.248 74.24v318.976c0 9.216 4.608 17.408 12.288 22.016L437.248 896c11.776 30.72 41.472 51.712 74.752 52.224 33.28-0.512 62.464-20.992 74.752-52.224l296.448-171.52c7.68-4.608 12.288-13.312 12.288-22.016V386.048c31.744-11.776 53.248-42.496 53.248-76.288 0-44.032-36.352-80.896-79.872-80.896zM155.136 339.456c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 15.872-12.8 28.672-29.184 29.184zM512 897.024c-16.896 0-29.184-12.288-29.184-29.696 0-14.848 12.288-29.696 29.184-29.696h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 14.848-14.848 29.696-29.184 29.696z m74.752-58.368c-11.776-30.208-40.96-51.712-74.752-51.712-27.136 0-52.224 14.336-67.072 37.376l-3.072 1.024c-4.608 2.048-8.704 5.632-9.728 10.752l-252.416-146.944V384.512C212.48 373.76 234.496 343.04 235.52 308.736l3.072 0.512h2.048c3.584 0 7.168-1.536 10.24-3.584 7.168-5.632 8.192-16.384 2.048-23.552L512 130.56l278.528 162.816c-7.68 36.864 11.264 74.24 45.568 90.624 0.512 5.632 3.584 10.24 8.704 13.312v291.328l-258.048 150.016z m282.112-499.2c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696v2.56c-1.024 14.848-13.824 27.136-29.184 26.624z" fill="#AAAAAA" ></path><path d="M422.912 724.992c-3.072-8.704-12.288-12.8-20.992-9.728-8.704 3.072-12.8 12.8-9.728 21.504l19.968 54.784c2.56 6.656 8.192 10.752 15.36 10.752 2.048 0 3.584-0.512 5.12-1.024 8.704-3.072 12.8-12.8 9.728-21.504l-19.456-54.784zM706.048 507.392c0-107.52-86.016-195.072-192-196.096-2.048-1.536-4.608-2.56-7.68-3.072l-24.064-3.072c-8.192-1.024-15.872 4.096-17.92 11.776-5.632 1.536-11.776 3.584-16.896 5.632 0.512-1.536 1.024-3.072 1.536-5.12 1.024-9.216-5.12-17.408-14.336-18.432l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.608 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l44.032 5.12C384 353.28 351.232 388.608 333.312 432.64c-25.088 60.928-17.92 130.048 18.432 184.832-1.024 3.584-1.024 7.168 0.512 10.24l19.968 54.784c1.024 3.072 3.072 5.632 6.144 7.68 7.168 5.12 17.408 3.072 22.528-4.096 3.072-4.608 3.584-10.24 2.048-15.36l-0.512-1.536c53.76 37.888 123.392 45.568 184.32 19.968 46.08-19.456 82.944-55.808 102.912-101.376l12.8-14.336c6.144-6.656 5.632-17.408-0.512-23.04 2.56-14.336 4.096-28.672 4.096-43.008z m-193.536 156.16C427.52 663.552 358.4 593.92 358.4 507.392c0-86.016 69.12-156.16 154.112-156.16s154.112 69.632 154.112 156.16c0 86.016-69.12 156.16-154.112 156.16z" fill="#72B02D" ></path><path d="M765.44 478.72c-6.144-5.632-15.872-5.632-22.016 0l-32.256 35.84c-4.096 4.608-5.632 11.776-3.072 17.92 2.56 6.144 8.192 9.728 14.848 9.728 4.608 0 8.704-2.048 11.776-5.12l32.256-35.84c5.12-7.168 4.608-16.896-1.536-22.528zM823.296 401.92c-5.632-1.024-11.776 0.512-15.872 5.12l-32.256 35.84c-4.608 4.608-5.632 11.776-3.072 17.92 1.024 2.048 2.56 4.096 4.096 5.632 6.656 6.144 16.896 5.632 23.04-1.536l32.256-35.84c4.096-4.096 5.632-10.752 3.584-16.384-1.024-5.632-5.632-9.728-11.776-10.752zM336.384 321.024c8.704 0 15.872-6.656 16.384-15.36 0.512-8.704-5.632-16.384-14.336-17.408l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.096 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l48.128 5.632h2.048z" fill="#72B02D" ></path></symbol><symbol id="icon-guanjianjiexi" viewBox="0 0 1024 1024"><path d="M298.496 200.704v83.456h-39.936v177.664h137.728V389.12h47.104v245.76h-47.104v-79.872H211.456c-10.752-3.584-54.272-14.336-54.272-57.856V280.064h-32.768V200.704h174.08m47.104-47.104H77.824v177.152h36.352v169.984c0 68.608 61.44 97.792 97.792 104.96H353.28v79.872h141.312V342.016H349.184v72.192h-43.52v-87.04h39.936V153.6zM627.712 389.12v79.872H812.544c10.752 3.584 54.272 14.336 54.272 54.272V740.352h32.768v83.456h-173.568v-83.456h39.936v-177.664h-137.728V634.88h-47.104V389.12h46.592m47.104-47.104h-141.312v340.48h141.312v-72.192h43.52v83.456h-39.936V870.4h267.776v-177.152h-36.352v-169.984c0-68.608-61.44-97.792-97.792-104.96H670.72V342.528h4.096z" fill="#AAAAAA" ></path></symbol><symbol id="icon-gongyishengcheng" viewBox="0 0 1024 1024"><path d="M889.344 391.68h29.696v-43.008h-208.896l1.024 45.056 28.16 3.072v20.992c55.808 5.632 108.032 28.672 150.016 66.56-0.512 0 0-92.672 0-92.672z m-366.592 102.912c13.312-13.312 27.648-24.576 43.008-34.816-2.048-70.144-5.632-153.088-8.704-179.712-5.632-48.64-34.816-204.288-226.816-202.752-191.488 1.536-223.744 164.864-230.912 207.36s-11.776 197.632-11.776 197.632h-24.576v43.008l208.896 1.024v-40.96h-24.064V316.928S245.76 230.912 335.36 231.424C424.448 232.448 415.232 327.68 414.72 327.68v313.856c4.608 0 6.144 77.824 50.176 144.896-13.312-32.256-20.48-67.072-20.48-102.912 0-71.168 27.648-138.24 78.336-188.928z" fill="#AAAAAA" ></path><path d="M75.264 601.6h31.232v281.088s41.984 29.184 141.824 0v-274.944l29.184-2.56v-44.032H75.264v40.448zM906.24 263.168h-29.184l1.024-188.416s-53.76-27.648-144.384 0l1.024 192-31.744 1.024V307.2h203.776l-0.512-44.032z" fill="#AAAAAA" ></path><path d="M934.912 627.712c-9.216-4.608-20.48-2.048-29.184 6.656l-21.504 21.504c-9.216 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l21.504-21.504c8.704-8.704 11.264-19.968 6.656-29.184-5.632-10.752-18.432-15.36-34.304-13.312-25.6 4.096-48.64 15.36-66.56 33.792-27.136 27.136-39.424 65.536-33.792 103.936l-178.176 178.176c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l178.176-178.176c37.888 6.144 76.288-6.656 103.936-33.792 17.92-17.92 29.696-41.472 33.792-66.56 2.048-15.872-2.56-28.672-13.312-34.304z m-9.728 30.72c-3.072 20.48-12.8 38.912-27.136 53.76-23.04 23.04-56.32 33.28-89.088 26.624l-6.144-1.536-186.88 186.88c-8.704 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l186.88-186.88-1.536-6.144c-6.656-32.256 3.072-65.536 26.624-89.088 14.848-14.848 33.28-24.064 53.76-27.136 1.536-0.512 3.072-0.512 4.608-0.512 2.56 0 4.608 0.512 5.12 1.024-0.512 0.512-1.024 1.536-2.048 2.56l-21.504 21.504c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l21.504-21.504c1.024-1.024 2.048-1.536 2.56-2.048 0.512 1.536 1.024 4.608 0.512 9.728z" fill="#72B02D" ></path><path d="M560.64 870.912c-12.8 12.8-12.8 33.28 0 45.568 6.144 6.144 14.336 9.216 23.04 9.216s16.896-3.072 23.04-9.216c6.144-6.144 9.728-14.336 9.728-23.04 0-8.704-3.584-16.896-9.728-23.04-12.8-12.288-33.792-12.288-46.08 0.512z m28.672 28.672c-3.072 3.072-8.704 3.072-11.776 0-3.072-3.072-3.072-8.704 0-11.776 1.536-1.536 3.584-2.56 6.144-2.56 2.048 0 4.096 1.024 6.144 2.56 1.536 1.536 2.56 3.584 2.56 6.144-0.512 2.048-1.536 4.096-3.072 5.632z m225.28-107.008c-4.096-4.096-10.24-4.096-14.336 0l-43.52 43.52c-4.096 4.096-4.096 10.24 0 14.336l102.4 102.4c15.872 15.872 41.984 15.872 57.856 0 15.872-15.872 15.872-41.984 0-57.856l-102.4-102.4z m-237.056-150.528l70.656 70.656 28.672-28.672-70.656-70.656-15.872-30.208-50.688-36.352-28.672 28.672 36.352 50.688 30.208 15.872z" fill="#72B02D" ></path></symbol><symbol id="icon-mojupipei" viewBox="0 0 1024 1024"><path d="M880.64 117.248c32.768 0 58.88 23.04 64.512 54.784l1.024 7.68v663.04c0.512 31.744-22.528 58.368-53.76 62.464l-7.68 1.024H151.552c-34.816 0-66.048-22.528-72.192-53.248l-1.024-6.656V183.296c0-31.744 27.648-59.904 61.952-65.024l7.168-1.024h142.848c24.064 0 44.032 16.896 48.64 39.936l1.024 6.656V406.528c0 7.68 5.12 14.848 12.288 16.896l3.584 0.512H424.96c13.312 0 25.088 9.216 29.184 22.528 6.144 23.552 33.792 46.08 58.368 46.08 22.528 0 48.128-19.456 55.808-39.424l2.048-5.632c2.048-10.24 9.216-18.432 19.456-21.504l5.12-1.024 3.072-0.512h71.168c6.144 0 11.776-3.584 14.336-9.728l1.024-3.584V164.864c0-23.04 15.872-41.984 37.888-46.592l6.144-1.024H880.64zM273.92 184.32H151.552l-2.048 0.512-2.048 0.512-2.56 1.536-1.536 649.728 3.072 1.536 3.072 1.024h1.024l328.192 3.072 2.048-286.72-2.048-0.512-10.24-3.584c-24.576-10.24-45.568-27.136-60.928-49.152l-6.144-9.216 1.024-1.536H349.184c-37.888-4.096-68.608-33.792-74.24-71.68l-1.024-8.192v-4.096V184.32z m476.16-3.072V409.6l-0.512 8.704c-3.584 36.864-32.256 66.56-68.608 72.192l-8.192 1.024h-4.096l-45.568-1.536-6.144 9.728c-14.848 22.528-36.352 40.448-61.44 51.2l-10.752 4.096-3.072 284.16h337.408v-655.36l-129.024-2.56z" fill="#AAAAAA" ></path></symbol><symbol id="icon-buchangshezhi" viewBox="0 0 1024 1024"><path d="M792.576 75.264h-686.08c-17.408 0-31.232 13.824-31.232 31.232v686.08c0 17.408 13.824 31.232 31.232 31.232h436.736c17.408 0 31.232-13.824 31.232-31.232s-13.824-31.232-31.232-31.232H137.728V262.656h624.128v280.576c0 17.408 13.824 31.232 31.232 31.232s31.232-13.824 31.232-31.232V106.496c-0.512-17.408-14.336-31.232-31.744-31.232z" fill="#AAAAAA" ></path><path d="M792.576 948.736c-17.408 0-31.232-13.824-31.232-31.232v-93.696h-93.696c-17.408 0-31.232-13.824-31.232-31.232 0-17.408 13.824-31.232 31.232-31.232h93.696v-93.696c0-17.408 13.824-31.232 31.232-31.232 17.408 0 31.232 13.824 31.232 31.232v93.696h93.696c17.408 0 31.232 13.824 31.232 31.232 0 17.408-13.824 31.232-31.232 31.232h-93.696v93.696c0 17.408-13.824 31.232-31.232 31.232z" fill="#72B02D" ></path><path d="M372.224 518.144l-110.08 110.08c-20.992 20.992-20.992 55.296 0 76.288s55.296 20.992 76.288 0l110.08-110.08c-16.896-6.144-32.768-15.872-46.592-29.696-13.824-13.312-23.552-29.696-29.696-46.592z m-57.856 162.304c-7.68 7.68-20.48 7.68-28.672 0-7.68-7.68-7.68-20.48 0-28.672 7.68-7.68 20.48-7.68 28.672 0 7.68 8.192 7.68 20.992 0 28.672z m340.48-292.864L592.384 450.56c-20.992 20.992-55.296 20.992-76.288 0s-20.992-55.296 0-76.288l62.976-62.976c-51.712-8.704-116.224 14.848-151.552 50.176-49.152 49.152-49.152 128.512 0 177.664s129.024 49.152 177.664 0c35.328-35.328 58.368-99.84 49.664-151.552z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shuchujiagongchengxu" viewBox="0 0 1024 1024"><path d="M876.544 473.6v374.272c0 16.384-13.312 29.696-29.696 29.696h-522.24c-16.384 0-29.696-13.312-29.696-29.696V503.296c0-16.384 13.312-29.696 29.696-29.696h551.936m40.96-70.656H253.952c-16.384 0-29.696 13.312-29.696 29.696v486.4c0 16.384 13.312 29.696 29.696 29.696h663.552c16.384 0 29.696-13.312 29.696-29.696v-486.4c0-16.384-13.312-29.696-29.696-29.696z" fill="#AAAAAA" ></path><path d="M489.984 211.968H814.08l-41.984-41.984c-13.824-13.824-13.824-36.352 0-50.176 13.824-13.824 36.352-13.824 50.176 0L947.712 245.76l-0.512 0.512 0.512 0.512-125.952 125.952c-13.824 13.824-36.352 13.824-50.176 0-13.824-13.824-13.824-36.352 0-50.176l38.912-38.912H489.472c-19.456 0-35.328-15.872-35.328-35.328 0.512-20.48 16.384-36.352 35.84-36.352z" fill="#72B02D" ></path><path d="M531.456 717.824c0-11.776-7.68-22.016-18.944-25.6l-55.808-16.896-14.848-4.608 14.848-4.608 55.808-16.896c11.264-3.584 18.944-13.824 18.944-25.6v-2.048c0-18.432-17.92-31.232-35.328-25.088L363.52 641.024c-10.752 3.584-17.92 13.824-17.92 25.088v8.192c0 11.264 7.168 21.504 17.92 25.088l132.608 45.568c17.408 6.144 35.328-7.168 35.328-25.088v-2.048z m123.392-96.768v2.048c0 11.776 7.68 22.016 18.944 25.6l56.32 16.896 14.848 4.608-14.848 4.608-56.32 16.896c-11.264 3.584-18.944 13.824-18.944 25.6v2.56c0 18.432 17.92 31.232 35.328 25.088l132.608-45.568c10.752-3.584 17.92-13.824 17.92-25.088v-8.192c0-11.264-7.168-21.504-17.92-25.088l-132.608-45.568c-17.408-6.144-35.328 7.168-35.328 25.6z m-54.784-64l-70.144 248.32c-4.608 16.896 8.192 33.792 25.6 33.792 11.776 0 22.528-8.192 25.6-19.456l70.144-248.32c4.608-16.896-8.192-33.792-25.6-33.792-11.776 0-22.016 8.192-25.6 19.456zM147.456 814.08V173.056c0-14.848 11.776-26.624 26.624-26.624h463.872c19.456 0 35.328-15.872 35.328-35.328 0-19.456-15.872-35.328-35.328-35.328H107.008c-16.896 0-30.72 13.824-30.72 30.72v748.032c0 16.896 13.824 30.72 30.72 30.72h40.448c19.456 0 35.328-15.872 35.328-35.328 0.512-19.968-15.36-35.84-35.328-35.84z" fill="#AAAAAA" ></path></symbol><symbol id="icon-guanjiekongzhi" viewBox="0 0 1024 1024"><path d="M648.192 377.344h-71.68c-18.432 0-33.792-14.848-33.792-33.792H366.592c12.288-30.72 25.088-80.896 0-134.656H542.72c0-18.432 15.36-33.792 33.792-33.792h67.584c1.536 0 2.56 0 4.096 0.512L719.36 87.04c10.752-13.312 29.184-16.384 44.032-7.68l168.96 100.864c15.872 9.728 20.992 30.208 11.776 46.08-9.728 15.872-30.208 20.992-46.592 11.264l-143.872-85.504L677.888 245.76v61.44l75.776 93.696 143.872-85.504c15.872-9.728 36.864-4.608 46.592 11.776 9.728 15.872 4.608 36.352-11.264 46.08h-0.512l-168.96 100.864c-14.336 8.704-33.28 5.12-44.032-7.68l-71.168-89.088zM319.488 780.8L102.912 415.744c76.8 69.632 185.344 48.64 231.424-13.312l222.72 378.368H711.68c18.432 0 33.792 14.848 33.792 33.792v100.864c0 18.432-15.36 33.792-33.792 33.792H170.496c-18.432 0-33.792-14.848-33.792-33.792v-100.864c0-18.432 15.36-33.792 33.792-33.792h148.992z" fill="#AAAAAA" ></path><path d="M204.288 148.48C133.12 148.48 75.264 205.824 75.264 276.48S133.12 404.48 204.288 404.48c71.168 0 129.024-57.344 129.024-128S275.456 148.48 204.288 148.48z m0 202.752c-41.472 0-74.752-33.28-74.752-74.752 0-40.96 33.792-74.24 74.752-74.24C245.76 202.24 279.04 235.52 279.04 276.48c0 41.472-33.792 75.264-74.752 74.752z" fill="#72B02D" ></path></symbol><symbol id="icon-jiegoushu" viewBox="0 0 1024 1024"><path d="M233.984 472.064h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44v238.08h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V233.984h-39.936c-22.016 0-39.936-17.92-39.936-39.936V115.2c0-22.016 17.92-39.936 39.936-39.936h158.72c22.016 0 39.936 17.92 39.936 39.936V194.56c0 22.016-17.92 39.936-39.936 39.936h-39.936v237.568z" fill="#AAAAAA" ></path><path d="M551.936 75.264h317.44c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V154.624c-0.512-44.032 35.328-79.36 79.36-79.36z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaitui" viewBox="0 0 1024 1024"><path d="M512 148.992c199.68 0 361.984 162.304 361.984 361.984S711.68 872.448 512 872.448s-361.984-162.304-361.984-361.984S312.32 148.992 512 148.992m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M670.72 456.192v109.056l-75.264-54.784L670.72 456.192m25.6-102.912c-10.24 0-20.992 3.072-30.208 10.24l-144.896 105.472c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-52.224-52.224z" fill="#72B02D" ></path><path d="M499.712 456.192v109.056L424.96 510.976l74.752-54.784m26.112-102.912c-10.24 0-20.992 3.072-30.208 10.24L350.208 468.992c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-51.712-52.224z" fill="#72B02D" ></path><path d="M314.368 381.44c-21.504 0-38.912 17.408-38.912 38.912v181.248c0 21.504 17.408 38.912 38.912 38.912s38.912-17.408 38.912-38.912V420.352c0-21.504-17.408-38.912-38.912-38.912z" fill="#72B02D" ></path></symbol><symbol id="icon-bofang" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M491.008 445.952l115.712 66.048-115.712 66.048V445.952m-23.552-87.04c-24.576 0-46.592 19.456-46.592 46.592v212.48c0 27.136 22.528 46.592 46.592 46.592 7.68 0 15.36-2.048 23.04-6.144l185.856-106.496c31.232-17.92 31.232-62.976 0-80.896L490.496 365.056c-7.168-4.096-15.36-6.144-23.04-6.144z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaijin" viewBox="0 0 1024 1024"><path d="M515.584 151.04c199.168 0 360.96 161.792 360.96 360.96s-161.792 360.96-360.96 360.96-360.96-161.792-360.96-360.96 161.792-360.96 360.96-360.96m0-74.752c-240.64 0-435.712 195.072-435.712 435.712s195.072 435.712 435.712 435.712 435.712-195.072 435.712-435.712-195.072-435.712-435.712-435.712z" fill="#AAAAAA" ></path><path d="M358.912 458.24L433.152 512l-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432L363.52 366.592c-9.216-6.656-19.456-9.728-29.696-9.728z" fill="#72B02D" ></path><path d="M527.36 458.24l74.24 53.76-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432l-142.848-103.936c-9.216-7.168-19.968-10.24-29.696-10.24z" fill="#72B02D" ></path><path d="M710.144 384.512c-20.992 0-38.4 17.408-38.4 38.4v178.688c0 20.992 17.408 38.4 38.4 38.4s38.4-17.408 38.4-38.4V422.912c0-21.504-17.408-38.4-38.4-38.4z" fill="#72B02D" ></path></symbol><symbol id="icon-zanting" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M416.768 353.28c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c-0.512-21.504-17.92-39.424-39.936-39.424z m190.464 0c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c0-21.504-17.92-39.424-39.936-39.424z" fill="#72B02D" ></path></symbol><symbol id="icon-zhongzhi" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M580.096 421.376c12.288 0 22.528 10.24 22.528 22.528v136.192c0 12.288-10.24 22.528-22.528 22.528H443.904c-12.288 0-22.528-10.24-22.528-22.528V443.904c0-12.288 10.24-22.528 22.528-22.528h136.192m0-68.096H443.904C393.728 353.28 353.28 393.728 353.28 443.904v136.192c0 50.176 40.448 90.624 90.624 90.624h136.192c50.176 0 90.624-40.448 90.624-90.624V443.904c0-50.176-40.448-90.624-90.624-90.624z" fill="#72B02D" ></path></symbol><symbol id="icon-suoxiao" viewBox="0 0 1024 1024"><path d="M491.008 463.36c32.256 0 58.88-26.112 58.88-58.88s-26.112-58.88-58.88-58.88H285.696c-32.256 0-58.88 26.112-58.88 58.88s26.112 58.88 58.88 58.88h205.312z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848 13.312 0 26.112-5.12 36.352-14.848 19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangda" viewBox="0 0 1024 1024"><path d="M488.96 333.824h-47.104V286.72c0-34.816-28.16-62.976-62.976-62.976-34.816 0-62.976 28.16-62.976 62.976v47.104h-47.104c-34.816 0-62.976 28.16-62.976 62.976s28.16 62.976 62.976 62.976h47.104V506.88c0 34.816 28.16 62.976 62.976 62.976 34.816 0 62.976-28.16 62.976-62.976v-47.104h47.104c34.816 0 62.976-28.16 62.976-62.976 0-34.304-28.16-62.976-62.976-62.976z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangdazhichuangkou" viewBox="0 0 1024 1024"><path d="M949.248 858.624l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 142.848-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.616-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-96.768 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M216.576 919.04h109.056v-102.912H216.576c-29.696 0-53.76-24.064-53.76-53.76V233.984c0-29.696 24.064-53.76 53.76-53.76H798.72c29.696 0 53.76 24.064 53.76 53.76v81.92h102.912v-81.92c0-86.528-70.144-156.672-156.672-156.672H216.576c-86.528 0-156.672 70.144-156.672 156.672v528.384c0 86.528 70.144 156.672 156.672 156.672z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shiyingpingmu" viewBox="0 0 1024 1024"><path d="M876.032 75.264H147.968c-39.936 0-72.704 32.768-72.704 72.704v728.064c0 39.936 32.768 72.704 72.704 72.704h728.064c39.936 0 72.704-32.768 72.704-72.704V147.968c0-39.936-32.768-72.704-72.704-72.704z m0 764.416c0 22.016-14.336 36.352-36.352 36.352H184.32c-22.016 0-36.352-14.336-36.352-36.352V184.32c0-22.016 14.336-36.352 36.352-36.352h655.36c22.016 0 36.352 14.336 36.352 36.352v655.36z" fill="#AAAAAA" ></path><path d="M329.728 184.32H220.672c-3.584 0-10.752 0-14.336 3.584-7.168 3.584-14.336 10.752-18.432 18.432-3.584 3.584-3.584 10.752-3.584 14.336v109.056c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352v-22.016l47.104 47.104c7.168 7.168 14.336 10.752 25.6 10.752 10.752 0 18.432-3.584 25.6-10.752 14.336-14.336 14.336-36.352 0-51.2l-47.104-47.104h22.016c22.016 0 36.352-14.336 36.352-36.352 0-21.504-14.848-35.84-36.864-35.84zM329.728 766.976h-22.016l47.104-47.104c14.336-14.336 14.336-36.352 0-51.2-14.336-14.336-36.352-14.336-51.2 0l-47.104 47.104v-22.016c0-22.016-14.336-36.352-36.352-36.352s-36.352 14.336-36.352 36.352v109.056c0 3.584 0 10.752 3.584 14.336 3.584 7.168 10.752 14.336 18.432 18.432 3.584 3.584 10.752 3.584 14.336 3.584h109.056c22.016 0 36.352-14.336 36.352-36.352s-13.824-35.84-35.84-35.84zM817.664 187.904c-3.584-3.584-10.752-3.584-14.336-3.584h-109.056c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h22.016l-47.104 47.104c-14.336 14.336-14.336 36.352 0 51.2 7.168 7.168 14.336 10.752 25.6 10.752s18.432-3.584 25.6-10.752l47.104-47.104v22.016c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352V220.672c0-3.584 0-10.752-3.584-14.336-4.096-7.68-11.264-14.848-18.944-18.432zM803.328 657.408c-22.016 0-36.352 14.336-36.352 36.352v22.016l-47.104-47.104c-14.336-14.336-36.352-14.336-51.2 0-14.336 14.336-14.336 36.352 0 51.2l47.104 47.104h-22.016c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h109.056c3.584 0 10.752 0 14.336-3.584 7.168-3.584 14.336-10.752 18.432-18.432 3.584-3.584 3.584-10.752 3.584-14.336v-109.056c0.512-22.016-13.824-36.864-35.84-36.864z" fill="#72B02D" ></path></symbol><symbol id="icon-yangshitu-01" viewBox="0 0 1024 1024"><path d="M645.632 882.688H150.528l252.928-204.8 477.696 0.512z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512z m-542.72 23.552H880.64l-234.496 203.264-228.864 0.512V140.8z m0 247.296l217.088-0.512-1.024 247.296H417.28V388.096z m-43.008-223.744v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m532.48 493.568H150.528l252.928-204.288 477.696 0.512-235.52 203.776z m271.36-247.808h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-zuoshitu-01" viewBox="0 0 1024 1024"><path d="M374.272 644.096l-262.656 211.968L112.64 373.76l261.632-209.408z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM112.64 373.76l261.632-209.408v479.744l-263.168 211.968L112.64 373.76z m520.192 507.904l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-qianshitu-01" viewBox="0 0 1024 1024"><path d="M112.64 389.12h520.704v493.056H112.64z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m259.584 717.824H112.64V389.12h520.704v493.056z m12.288-537.6l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-youshitu-01" viewBox="0 0 1024 1024"><path d="M916.992 659.456l-239.616 196.096V375.808l239.616-208.896z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m270.848 314.88l-239.104 196.096V375.808l239.104-208.896v492.544z" fill="#AAAAAA" ></path></symbol><symbol id="icon-houshitu-01" viewBox="0 0 1024 1024"><path d="M960 118.784V117.76v-1.024-1.024-1.024-0.512-0.512c1.536 7.68-1.024 15.872-6.656 20.992L677.376 373.76v299.52h-43.008V389.12H374.272v254.976l-262.656 211.968L112.64 389.12l261.632-0.512v-42.496h269.824l280.064-243.2c3.072-2.56 6.656-4.096 10.752-5.12H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c-0.512 0.512-0.512 1.024-1.024 2.048 0 0.512 0 0.512-0.512 1.024 0 0.512 0 0.512-0.512 1.024 0 0.512 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V907.264c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024c0 0.512 0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024s0 0.512 0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-242.176 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V658.944v-2.048V118.272c1.536 1.024 1.536 1.024 1.536 0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m258.56 717.312l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m44.544-26.112v-177.664H880.64l-203.264 177.664z m281.6-741.376v-0.512-0.512 1.024z" fill="#AAAAAA" ></path><path d="M916.992 634.88h-239.616V375.808l239.616-211.456zM644.096 346.112H417.28V141.824h462.336zM417.28 389.12H634.88v245.76H417.28z" fill="#72B02D" ></path><path d="M958.976 114.176c0 0.512 0.512 0.512 0 0z m-20.48-16.384H945.152l0.512 0.512 0.512 0.512h1.024l0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512c0 0.512 0.512 0.512 0.512 1.024s0 0.512 0.512 0.512c0 0.512 0.512 1.024 0.512 1.536 0 0.512 0.512 1.024 0.512 1.024-3.072-10.24-13.312-16.896-24.064-14.848h4.608v1.024z" fill="#C1272D" ></path></symbol><symbol id="icon-dingshitu-01" viewBox="0 0 1024 1024"><path d="M880.64 140.8l-234.496 203.776-497.664 1.536 256-206.336z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-497.664 1.536 256-205.824 476.16 1.024-234.496 203.264z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-toushitu-01" viewBox="0 0 1024 1024"><path d="M965.632 114.176V112.64v-1.024-0.512-1.024-0.512s0-0.512-0.512-1.024v-0.512c-0.512-1.024-0.512-2.048-1.024-3.072v-0.512c0-0.512-0.512-0.512-0.512-1.024s0-0.512-0.512-0.512l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512s-0.512-1.024-1.024-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024s-0.512 0-0.512-0.512c0 0-0.512 0-0.512-0.512H950.784h-0.512H392.704c-5.12 0-9.728 1.536-13.312 4.608l-312.32 251.392-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536 0 0 0 0.512-0.512 0.512 0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024c0 0.512 0 0.512-0.512 1.024s0 0.512 0 1.024 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V912.896c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024l0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512 0 0.512 0.512 0.512 1.024 1.024l0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512h583.168c7.68 0 14.848-4.096 18.432-10.752L957.44 675.84l1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V661.504v-1.536V658.432l1.024-544.256zM372.736 343.04l-229.888 0.512L372.736 158.72v184.32z m43.008 43.008l220.672-0.512-0.512 251.392h-220.16v-250.88z m-43.008 0v260.096l-267.264 215.552 1.536-474.624 265.728-1.024z m-227.84 502.272l257.024-208.384h233.984l-0.512 206.848-490.496 1.536z m503.296-545.792l-172.544 0.512H415.232V135.68h471.04l-238.08 206.848z m31.232 337.408h207.36l-207.36 181.248v-181.248z m0-43.008V373.76l243.2-212.48v475.648h-243.2z" fill="#AAAAAA" ></path></symbol><symbol id="icon-a-jixiebi3" viewBox="0 0 1024 1024"><path d="M483.386004 821.695719H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M483.386004 776.399147H164.779715l29.075502 22.648286h260.455285l29.075502-22.648286z" fill="#7A807D" ></path><path d="M483.386004 776.399147H164.779715l29.075502-22.648285h260.455285l29.075502 22.648285z" fill="#3F3F3F" ></path><path d="M483.386004 730.796518H164.779715l29.075502 22.954344h260.455285l29.075502-22.954344zM483.386004 685.499947H164.779715l29.075502 22.648285h260.455285l29.075502-22.648285z" fill="#7A807D" ></path><path d="M483.386004 730.796518H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M150.701051 623.064132h339.418227v62.435815H150.701051z" fill="#F7A53F" ></path><path d="M150.701051 821.695719h339.418227v31.217907H150.701051z" fill="#FFFFFF" ></path><path d="M607.951575 339.654504a74.984189 74.984189 0 0 1-23.872517 103.447575 75.290247 75.290247 0 0 1-103.753633-23.872518L293.324039 120.823095A75.290247 75.290247 0 0 1 317.196557 17.069462a75.290247 75.290247 0 0 1 103.753633 23.872517zM441.762128 517.474152v105.58998H198.752144v-105.58998a122.423166 122.423166 0 1 1 244.846331 0z" fill="#FFC200" ></path><path d="M627.233224 377.605685a103.141517 103.141517 0 0 1-52.948019 82.635637l-165.88339 118.750471-2.448463 1.836347a112.93537 112.93537 0 1 1-112.017197-194.346775l195.571007-84.471985a132.523077 132.523077 0 0 1 48.357151-12.854432A89.062853 89.062853 0 0 1 627.233224 377.605685z" fill="#FFE610" ></path><path d="M401.056425 493.601635a71.005436 71.005436 0 1 1-71.005436-71.311494 71.005436 71.005436 0 0 1 71.005436 71.311494z" fill="#FFFFFF" ></path><path d="M375.34756 493.601635a45.296571 45.296571 0 1 1-45.296571-45.60263 45.296571 45.296571 0 0 1 45.296571 45.60263z" fill="#48B8BF" ></path><path d="M592.342622 376.381453a49.88744 49.88744 0 1 1-49.581382-49.88744 49.88744 49.88744 0 0 1 49.581382 49.88744z" fill="#FFFFFF" ></path><path d="M574.285205 376.381453a30.605791 30.605791 0 1 1-30.605792-30.605791 30.605791 30.605791 0 0 1 30.605792 30.605791z" fill="#48B8BF" ></path><path d="M731.048068 230.789704l165.975207-62.099151 18.883774 50.46895-165.975207 62.068545z" fill="#FFE610" ></path><path d="M734.047436 202.785404l145.836596-54.294674 9.426584 25.31099-145.867202 54.294674z" fill="#F7A53F" ></path><path d="M808.419509 259.161272l23.872517 63.353988 31.523966 35.808776-19.893765 18.057417-48.051092-38.257239-27.851271-63.660046 40.399645-15.302896zM854.940312 242.022029l23.56646 63.04793-0.306058 47.745035 26.627038 0.612116 11.324143-60.293409-20.811938-66.414568-40.399645 15.302896zM716.173654 94.379691l102.345766-38.257239 37.216643 99.468822-102.345767 38.257239z" fill="#7A807D" ></path><path d="M841.473764 83.790087a66.108509 66.108509 0 0 1-65.802452 66.10851l-407.669142 15.608953a67.944857 67.944857 0 0 1-11.324142 0 82.635637 82.635637 0 0 1 0-165.271273 67.944857 67.944857 0 0 1 11.324142 0l407.669142 17.445301A66.108509 66.108509 0 0 1 841.473764 83.790087z" fill="#FFE610" ></path><path d="M402.892773 83.790087a46.520803 46.520803 0 1 1-46.520803-46.214745A46.520803 46.520803 0 0 1 402.892773 83.790087z" fill="#FFFFFF" ></path><path d="M386.059587 83.790087a30.605791 30.605791 0 1 1-30.605791-30.605791 30.605791 30.605791 0 0 1 30.605791 30.605791z" fill="#48B8BF" ></path><path d="M810.867972 83.790087a38.257239 38.257239 0 1 1-39.787528-38.257239A38.257239 38.257239 0 0 1 810.867972 83.790087z" fill="#FFFFFF" ></path><path d="M795.565077 83.790087a24.484633 24.484633 0 1 1-24.484633-24.484633 24.484633 24.484633 0 0 1 24.484633 24.484633z" fill="#48B8BF" ></path><path d="M106.93477 852.913626h639.66104v171.086374H106.93477z" fill="#FFE610" ></path><path d="M383.305066 709.678522h337.275822v207.201208H383.305066z" fill="#4D4D4D" ></path><path d="M407.177584 732.02075h291.061076v161.904636H407.177584z" fill="#FFFFFF" ></path><path d="M429.825869 755.893267h159.150116v16.22107h-159.150116zM429.825869 784.356653h131.604903v16.22107h-131.604903zM429.825869 812.820039h199.855818v16.22107h-199.855818zM429.825869 841.283425h146.601741v16.22107h-146.601741z" fill="#92D5D2" ></path><path d="M507.564579 732.326808l-31.830023 161.904636H407.177584v-161.904636h100.386995z" fill="#F5F5F5" opacity=".5" ></path><path d="M474.816383 916.87973h155.783478v31.830023h-155.783478z" fill="#7A807D" ></path><path d="M106.93477 977.173139h639.66104v46.826861H106.93477z" fill="#F7A53F" ></path><path d="M252.006221 899.740487h66.414567v48.969266H252.006221z" fill="#7A807D" ></path><path d="M319.64502 817.716966l-3.672695 11.324143-21.730112 70.699378h-21.730112l23.872518-76.820537 3.366637-11.324143 19.893764 6.121159z" fill="#999999" ></path><path d="M341.069074 809.147344A28.463386 28.463386 0 1 1 321.17531 773.950684a28.463386 28.463386 0 0 1 19.893764 35.19666z" fill="#48B8BF" ></path><path d="M322.705599 793.538391a13.16049 13.16049 0 1 1-26.014923 0 13.16049 13.16049 0 0 1 26.014923 0z" fill="#FFFFFF" ></path><path d="M165.085773 899.740487h66.414568v49.275324H165.085773z" fill="#7A807D" ></path><path d="M163.861542 817.716966l3.366637 11.324143 22.03617 70.699378h21.730111l-23.872517-76.820537-3.672695-11.324143-19.587706 6.121159z" fill="#999999" ></path><path d="M142.437488 809.147344a28.157328 28.157328 0 1 0 18.669532-35.19666 28.157328 28.157328 0 0 0-18.669532 35.19666z" fill="#F7A53F" ></path><path d="M160.800963 793.538391a13.16049 13.16049 0 1 0 12.854432-12.854433 12.854432 12.854432 0 0 0-12.854432 12.854433z" fill="#FFFFFF" ></path></symbol><symbol id="icon-jixiebi2" viewBox="0 0 1164 1024"><path d="M848.55632 485.108049h233.370249v430.146938h-233.370249z" fill="#FFE610" ></path><path d="M974.217224 605.245396h154.314351v64.211341h-154.314351zM974.217224 689.82485h154.314351v64.211341h-154.314351zM974.217224 774.749527h154.314351v64.211341h-154.314351z" fill="#54D9D9" ></path><path d="M306.557369 245.869021l99.078789 31.760448 69.389675 22.094225 145.683794 46.259783 69.734897 22.094225 119.101681 37.974449 66.627896 21.058558 1.035667-2.761778 21.749003-69.044453 23.129891-72.151453-22.784669-7.249667-79.746343-25.201225-20.368113-6.559223-337.972595-107.364124-21.40378-6.904445-87.686455-27.617781-45.224116 142.576794-0.345222 1.035667z" fill="#FFE610" ></path><path d="M412.33347 357.755556l10.70189-33.555604 441.470229 140.401894-10.667368 33.555604z" fill="#A3A3A3" ></path><path d="M380.331366 357.686512l25.408359-79.953476 69.424197 22.094225-25.408359 79.918953zM595.508402 425.626253l25.408359-79.953476 69.389674 22.059703-25.373836 79.953476z" fill="#3F3F3F" ></path><path d="M809.200982 411.575707a144.302906 144.302906 0 0 0 4.833112 37.284004 138.088905 138.088905 0 0 0 18.987224 43.152783 144.302906 144.302906 0 0 0 15.535002 19.677669 146.719461 146.719461 0 0 0 256.154919-100.114456 144.648128 144.648128 0 0 0-34.522226-94.5909 180.206021 180.206021 0 0 0-15.880224-16.570668 146.719461 146.719461 0 0 0-96.317012-34.522227 148.445573 148.445573 0 0 0-58.687784 10.356668 146.719461 146.719461 0 0 0-89.757788 129.803571 34.522226 34.522226 0 0 0-0.345223 5.523556z" fill="#FFC200" ></path><path d="M876.174101 411.575707A80.091565 80.091565 0 1 0 956.265666 331.484142a80.091565 80.091565 0 0 0-80.091565 80.091565z" fill="#FFFFFF" ></path><path d="M904.827549 411.575707a51.438117 51.438117 0 1 0 51.438117-51.092895 51.438117 51.438117 0 0 0-51.438117 51.092895z" fill="#54D9D9" ></path><path d="M218.076903 216.594173l37.007826-117.202958 88.894733 28.06657L306.902591 244.660743zM86.512699 119.345062l92.450522-16.467102 19.401491 108.745013-92.450522 16.467102z" fill="#8A8A8A" ></path><path d="M0 65.317778l45.224116 254.083585 21.058558-3.797445 31.415226-5.523556 22.094225-4.142667-13.808891-77.675009-19.332446-109.090235-12.082779-67.318341-14.499335 2.761778-21.403781 3.797445-38.664893 6.904445z" fill="#292929" ></path><path d="M95.626567 436.43171l16.570668-3.107-14.499335-123.244348-31.415226 5.523556 29.343893 120.827792z" fill="#7A807D" ></path><path d="M138.088905 153.349455a80.782009 80.782009 0 0 0 31.070003 63.520896 79.40112 79.40112 0 0 0 49.021562 16.915891 75.258453 75.258453 0 0 0 32.10567-6.904445 80.091565 80.091565 0 0 0 48.331117-73.532342 78.710676 78.710676 0 0 0-13.808891-44.18845 76.984564 76.984564 0 0 0-31.760448-27.617781l-7.59489-3.452222a83.543787 83.543787 0 0 0-12.428001-3.452223H217.835247A80.091565 80.091565 0 0 0 138.088905 153.349455z" fill="#FFC200" ></path><path d="M167.087575 153.694677A51.092895 51.092895 0 1 0 217.835247 103.637449a50.747673 50.747673 0 0 0-50.747672 50.057228z" fill="#FFFFFF" ></path><path d="M185.384355 153.694677a32.450893 32.450893 0 1 0 32.450892-34.522226 32.450893 32.450893 0 0 0-32.450892 34.522226z" fill="#54D9D9" ></path><path d="M38.664893 58.413333l21.403781-3.797445C66.627897 19.74844 108.745013 11.117883 141.88635 14.915328a89.757788 89.757788 0 0 1 81.472454 58.687784h9.321001a83.543787 83.543787 0 0 1 12.428001 3.452223l7.59489 3.452223c53.854673-42.807561 165.016241-17.951558 187.110466 48.331116l21.40378 6.904446C439.813162 59.449 307.593036 24.581551 241.655583 69.115223a113.923346 113.923346 0 0 0-108.745012-69.044452C90.793455 0.070771 41.081449 10.772661 38.664893 58.413333zM799.189537 244.14291l20.368113 6.559223a345.222262 345.222262 0 0 0 89.412566-34.522226c48.331117-22.784669 133.601015-34.522226 144.99335 34.522226a114.613791 114.613791 0 0 1 0 48.676339 180.206021 180.206021 0 0 1 15.880224 16.570668c15.880224-50.057228 3.797445-107.364124-54.545117-124.280014-83.198565-22.439447-141.541127 45.569339-216.109136 52.473784z" fill="#3F3F3F" ></path><path d="M44.18845 731.251522a105.638012 105.638012 0 0 0 105.638012 105.638012h698.729858v-31.415226H149.826462a74.222786 74.222786 0 0 1 0-148.445573h698.729858v-31.415225H149.826462a105.638012 105.638012 0 0 0-105.638012 105.638012z" fill="#8A8A8A" ></path><path d="M75.603675 731.251522a74.222786 74.222786 0 0 0 74.222787 74.222786h698.729858V655.993069H149.826462a74.222786 74.222786 0 0 0-74.222787 75.258453z" fill="#FFE610" ></path><path d="M103.566679 731.251522a51.092895 51.092895 0 1 0 50.747672-50.747673A50.747673 50.747673 0 0 0 103.566679 731.251522z" fill="#FFFFFF" ></path><path d="M121.863459 731.251522a32.450893 32.450893 0 1 0 32.450892-32.450893 32.450893 32.450893 0 0 0-32.450892 32.450893zM290.331922 731.251522a34.522226 34.522226 0 0 0 34.522227 34.522226h414.266714a34.522226 34.522226 0 0 0 34.522226-34.522226 34.522226 34.522226 0 0 0-34.522226-34.522226h-414.266714a34.522226 34.522226 0 0 0-34.522227 34.522226z" fill="#54D9D9" ></path><path d="M827.15254 877.625761h276.523032v61.794785h-276.523032z" fill="#F7A53F" ></path><path d="M839.925764 939.765768h250.976584v31.070004h-250.976584z" fill="#707070" ></path><path d="M747.75142 657.028735v148.445573h43.152783v31.415226h57.652117v-211.276024h-57.652117v31.415225h-43.152783z" fill="#B3B3B3" opacity=".76" ></path><path d="M14.499335 970.490549h1149.590133v53.509451H14.499335z" fill="#B86805" ></path><path d="M154.314351 836.889534H272.725587v133.601015H154.314351zM614.150404 836.889534h118.411236v133.601015h-118.411236z" fill="#F7A53F" ></path><path d="M614.150404 836.889534h118.411236v78.365453h-118.411236zM154.314351 836.889534H272.725587v78.365453H154.314351z" fill="#B3B3B3" opacity=".76" ></path></symbol><symbol id="icon-jixiebi4" viewBox="0 0 1123 1024"><path d="M502.569098 505.335276h543.234824v85.15391H502.569098z" fill="#FFE610" ></path><path d="M483.047648 203.089382a81.451566 81.451566 0 0 1-41.06236 73.373725l-302.919047 173.33701a82.124719 82.124719 0 0 1-81.788143-143.045105l302.919047-173.33701a82.124719 82.124719 0 0 1 83.807603 0 79.768682 79.768682 0 0 1 27.935868 28.945597A77.412645 77.412645 0 0 1 483.047648 203.089382z" fill="#FFC200" ></path><path d="M39.776109 803.542249h1082.094151v220.121174H39.776109z" fill="#FFE610" ></path><path d="M39.776109 971.830609h1082.094151v52.169391H39.776109zM466.218812 723.43699v146.747449H219.844654v-146.747449a123.187079 123.187079 0 0 1 246.374158 0z" fill="#FFC200" ></path><path d="M396.210854 790.415757a100.973016 100.973016 0 0 1-141.698798-23.896947l-235.603704-331.864645a100.973016 100.973016 0 0 1 23.896947-141.362222 100.973016 100.973016 0 0 1 141.698799 23.896947l235.603703 331.528068a100.973016 100.973016 0 0 1-24.233523 141.698799z" fill="#FFE610" ></path><path d="M146.470929 451.146424a86.16364 86.16364 0 1 1 29.282174-118.138428 86.16364 86.16364 0 0 1-29.282174 118.138428z" fill="#B8B8B8" ></path><path d="M131.661553 424.556864a56.881466 56.881466 0 1 1 19.52145-78.085799 56.544889 56.544889 0 0 1-19.52145 78.085799z" fill="#B8B8B8" ></path><path d="M120.554522 405.035414a35.677132 35.677132 0 0 1-36.686863-60.920386A35.677132 35.677132 0 1 1 120.554522 405.035414z" fill="#FFFFFF" ></path><path d="M370.9676 757.767815a56.881466 56.881466 0 1 1 19.184873-78.085798 56.881466 56.881466 0 0 1-19.184873 78.085798z" fill="#B8B8B8" ></path><path d="M358.850839 739.592672a35.677132 35.677132 0 1 1 12.116761-48.803624 35.677132 35.677132 0 0 1-12.116761 48.803624z" fill="#FFFFFF" ></path><path d="M423.136992 384.167657l-112.416624 66.305614-32.984519-55.871735 112.753201-65.969037 9.760725 16.492259 13.463069 22.887217 9.424148 16.155682z" fill="#8A8A8A" ></path><path d="M400.18246 345.023785l70.512822-41.398937 13.463069 22.887217-70.512823 41.432594z" fill="#C4C4C4" ></path><path d="M489.442606 313.823123a21.877487 21.877487 0 0 1-11.780186 27.935868 21.54091 21.54091 0 0 1-27.935867-12.116762l-29.955328-73.373725a21.54091 21.54091 0 0 1 12.116762-27.935868 21.204333 21.204333 0 0 1 27.599291 11.780186z" fill="#F7A53F" ></path><path d="M482.037918 318.19862a12.453339 12.453339 0 0 1-9.424148 14.809376 12.789915 12.789915 0 0 1-14.809376-9.424148 12.789915 12.789915 0 0 1 9.424148-14.809376 12.453339 12.453339 0 0 1 14.809376 9.424148z" fill="#707070" ></path><path d="M303.652257 388.543155a24.5701 24.5701 0 0 0-7.404688 8.077841l-24.906677 45.10128 32.311365 44.764704 36.350285-65.63246a24.906677 24.906677 0 0 0-36.013709-33.657672z m12.453338 6.394957a14.472799 14.472799 0 0 1 16.155683 12.116762 14.136222 14.136222 0 0 1-12.116762 16.155683 13.799645 13.799645 0 0 1-16.155683-11.780185 14.136222 14.136222 0 0 1 13.463069-16.49226z" fill="#B86805" ></path><path d="M305.33514 411.430372a13.799645 13.799645 0 0 0 16.155683 11.780185 14.136222 14.136222 0 0 0 12.116762-16.155683 14.472799 14.472799 0 0 0-16.155683-12.116762 14.136222 14.136222 0 0 0-12.116762 16.49226z" fill="#5E5E5E" ></path><path d="M625.4196 163.709906l-19.858026 12.116762-37.360016 22.55064-19.858027 12.116762-20.867756-34.667402-40.389207-66.64219-19.184872-31.301635 9.424148-5.721804 58.227772-35.340556 9.424148-5.385227 80.441836 132.27465z" fill="#8A8A8A" ></path><path d="M568.066927 198.276335l37.124412-22.516982 36.484917 60.14626-37.15807 22.55064z" fill="#4D4D4D" ></path><path d="M931.031261 336.373763l-85.15391 217.765137h-128.572307l-46.447587-118.811581-30.965058-79.768683-7.404688-19.184873 46.111011-46.447587h205.648375l46.784164 46.447587z" fill="#AEBABD" ></path><path d="M744.668732 483.861681l105.954351-43.182793 2.423352 5.890093-105.988009 43.182793zM840.8287 361.953594l-120.157889-26.252984 1.682884-6.058381 119.821312 26.252984-1.346307 6.058381zM683.916634 363.838423l6.125696-1.851172 32.984518 109.252803-6.159353 1.851172z" fill="#6A5060" ></path><path d="M880.544753 403.015954a49.813354 49.813354 0 1 1-49.813354-49.813355 50.149931 50.149931 0 0 1 49.813354 49.813355zM746.923796 359.597557a33.657672 33.657672 0 1 1-33.657672-33.657672 33.657672 33.657672 0 0 1 33.657672 33.657672zM767.454975 465.282647a26.589561 26.589561 0 0 1-26.58956 26.252984A26.252984 26.252984 0 0 1 741.201991 438.693086a26.589561 26.589561 0 0 1 26.252984 26.589561z" fill="#FFFFFF" ></path><path d="M846.887081 403.015954a16.155683 16.155683 0 1 1-16.155682-16.155683 16.155683 16.155683 0 0 1 16.155682 16.155683zM724.709732 359.597557a10.097302 10.097302 0 0 1-10.097302 9.760725 9.760725 9.760725 0 1 1 0-19.52145 10.097302 10.097302 0 0 1 10.097302 9.760725zM748.943256 465.282647A7.741265 7.741265 0 0 1 741.201991 472.350758a8.077841 8.077841 0 0 1-8.077841-8.077842 8.077841 8.077841 0 0 1 8.077841-8.077841 8.077841 8.077841 0 0 1 7.741265 9.087572z" fill="#788B90" opacity=".37" ></path><path d="M698.456748 219.581642h166.268899v46.11101h-166.268899z" fill="#F7A53F" ></path><path d="M702.159092 223.620562h5.048651v38.03317h-5.048651zM711.246663 223.620562h5.048651v38.03317h-5.048651zM720.334235 223.620562h5.048651v38.03317h-5.048651zM729.421806 223.620562h5.048651v38.03317h-5.048651zM738.509378 223.620562h5.04865v38.03317h-5.04865zM747.596949 223.620562h5.048651v38.03317h-5.048651zM756.68452 223.620562h5.048651v38.03317h-5.048651zM765.772092 223.620562h5.048651v38.03317h-5.048651zM774.859663 223.620562h5.048651v38.03317H774.859663zM783.610658 223.620562h5.048651v38.03317h-5.048651zM792.698229 223.620562h5.048651v38.03317h-5.048651zM801.785801 223.620562h5.04865v38.03317h-5.04865zM810.873372 223.620562h5.048651v38.03317h-5.048651zM819.960944 223.620562h5.04865v38.03317h-5.04865zM829.048515 223.620562h5.048651v38.03317h-5.048651zM838.136086 223.620562h5.048651v38.03317h-5.048651zM847.223658 223.620562h5.048651v38.03317h-5.048651zM856.311229 223.620562h5.048651v38.03317h-5.048651z" fill="#788B90" opacity=".38" ></path><path d="M738.845954 265.692652h85.490487v23.896947h-85.490487z" fill="#707070" ></path><path d="M735.816764 288.916446h-1.682884L640.228976 355.558636l-39.0429 26.926138-4.712074 3.365767-16.492259-23.896947a25.916407 25.916407 0 0 1 6.731534-36.013709l97.270672-67.315344a25.916407 25.916407 0 0 1 36.013709 6.731534z" fill="#58BFD2" ></path><path d="M670.857457 435.327319h-33.657672a12.116762 12.116762 0 0 1-10.433878-8.414418l-24.906677-44.428127 39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M827.365631 288.916446h1.682884l94.241481 65.63246 39.0429 26.926138 4.712074 3.365767 16.492259-23.896947a25.916407 25.916407 0 0 0-6.731534-35.003979l-97.270672-67.315344a25.916407 25.916407 0 0 0-36.013709 6.731534z" fill="#58BFD2" ></path><path d="M892.324938 435.327319h33.657672a12.116762 12.116762 0 0 0 10.433878-8.414418l24.906677-44.428127-39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M738.845954 265.692652h85.490487v12.116762h-85.490487zM922.95342 355.558636l-31.301635 79.768683-46.447588 118.811581 49.140201-194.541343-70.007957-69.671381h4.038921l94.578058 65.63246z" fill="#848484" opacity=".25" ></path><path d="M661.433309 321.900964l-48.467048-67.988497 21.204334-12.789915 38.033169 74.383455-10.770455 6.394957z" fill="#7A807D" ></path><path d="M535.553616 36.820483l-58.227772 33.657672-11.780186-19.184873A33.657672 33.657672 0 0 1 502.905674 1.143351a33.657672 33.657672 0 0 1 21.204334 15.482529z" fill="#F7A53F" ></path><path d="M527.475775 175.826668L483.047648 203.089382A77.412645 77.412645 0 0 0 471.940616 164.046483a79.768682 79.768682 0 0 0-27.599291-28.272444l42.745243-25.916408zM527.475775 175.826668l-40.389207-66.64219 40.389207 66.64219z" fill="#C4C4C4" ></path><path d="M956.274515 854.028757H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M650.999431 304.062398l-70.007958 14.809376 69.671381 8.414418-4.712074 38.033169 25.243254-25.243254 22.887217 25.243254-3.702344-36.350286 35.003979-1.682883-31.974789-19.52145 14.809376-35.677132-33.657672 24.906677-26.252984-43.754973 2.692614 50.823084z" fill="#FFFFFF" ></path><path d="M956.274515 803.542249H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 803.542249H600.512923l32.311365-25.579831h290.802285l32.647942 25.579831z" fill="#999999" ></path><path d="M956.274515 752.719165H600.512923l32.311365 25.243253h290.802285l32.647942-25.243253zM956.274515 702.232657H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 752.719165H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M584.693817 632.561276h378.985386v69.671381H584.693817zM584.693817 854.028757h378.985386v34.667402H584.693817z" fill="#FFC200" ></path><path d="M502.569098 590.489186h543.234824v42.07209H502.569098z" fill="#F7A53F" ></path><path d="M273.696929 882.637778h80.441836v59.574079H273.696929z" fill="#7A807D" ></path><path d="M355.821648 783.011069l-4.375497 13.799646-26.589561 85.827063h-26.252984l28.945598-93.231751 4.375497-13.799646 23.896947 7.404688z" fill="#999999" ></path><path d="M381.738055 772.913768a33.657672 33.657672 0 1 1-22.55064-43.08182 33.657672 33.657672 0 0 1 22.55064 43.08182z" fill="#F7A53F" ></path><path d="M359.523992 753.728895a15.819106 15.819106 0 1 1-15.819106-15.819106 15.819106 15.819106 0 0 1 15.819106 15.819106z" fill="#FFFFFF" ></path><path d="M168.348416 882.637778h80.441835v59.574079H168.348416z" fill="#7A807D" ></path><path d="M166.665532 783.011069l4.375497 13.799646 26.589561 85.827063h26.252984l-28.945598-93.231751-4.03892-13.799646-24.233524 7.404688z" fill="#999999" ></path><path d="M140.749125 772.913768a33.657672 33.657672 0 1 0 67.315343-20.53118 33.657672 33.657672 0 0 0-43.08182-22.55064 33.657672 33.657672 0 0 0-24.233523 43.08182z" fill="#68FF4B" ></path><path d="M162.963188 753.728895a15.819106 15.819106 0 1 0 15.819106-15.819106 15.819106 15.819106 0 0 0-15.819106 15.819106z" fill="#FFFFFF" ></path></symbol></svg>',(r=>{var e=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var n,i,s,a,o,l=function(u,d){d.parentNode.insertBefore(u,d)};if(e&&!r.__iconfont__svg__cssinject__){r.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(u){console&&console.log(u)}}n=function(){var u,d=document.createElement("div");d.innerHTML=r._iconfont_svg_string_4634042,(d=d.getElementsByTagName("svg")[0])&&(d.setAttribute("aria-hidden","true"),d.style.position="absolute",d.style.width=0,d.style.height=0,d.style.overflow="hidden",d=d,(u=document.body).firstChild?l(d,u.firstChild):u.appendChild(d))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(s=n,a=r.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,s())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Qu=fe.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(r){this.selectArray=r},setSelectString(r){this.selectString=r}}}),X3={class:"calculator-content"},q3={class:"calculator-child"},j3={class:"calculator-child"},Y3=K.defineComponent({__name:"calculator",setup(r){const e=K.ref(),t=K.ref();return K.onMounted(()=>{e.value=[{type:"Upload",label:"输入",name:"input"}],t.value=[{type:"Upload",label:"输出",name:"output"}]}),(n,i)=>(K.openBlock(),K.createElementBlock("div",X3,[K.createElementVNode("div",q3,[K.createVNode(jn.ssForm,{rowContents:e.value,isRowFlex:!0},null,8,["rowContents"])]),K.createElementVNode("div",j3,[K.createVNode(jn.ssForm,{rowContents:t.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),$3=Sl._export_sfc(Y3,[["__scopeId","data-v-73db0fe7"]]),ed=fe.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(r){this.selectIndex=r},setSelectMenu(r){this.selectMenu=r},setSelectTitle(r){this.selectTitle=r}}}),td=(r,e)=>{let t=r,n=e;return Array.isArray(t)&&(t=t==null?void 0:t.map((i,s)=>{if(Array.isArray(i)){let a={};return i=i==null?void 0:i.forEach((o,l)=>{var c;(c=n==null?void 0:n[l])!=null&&c.prop?a[n[l].prop]=o:Array.isArray(o)&&(a.children=td(o,n))}),Object.assign(a,{id:s})}else return i})),t},nd=(r,e,t)=>{let n=r,i=e;return n=n==null?void 0:n.map((s,a)=>{var o,l;return!Array.isArray(s)||!((o=i==null?void 0:i[a])!=null&&o.label)&&!t||(s.unshift(((l=i==null?void 0:i[a])==null?void 0:l.label)??""),s.some(c=>Array.isArray(c))&&(s=s==null?void 0:s.map(c=>{var h;return Array.isArray(c)&&(c=nd(c,(h=i==null?void 0:i[a])==null?void 0:h.children,t)),c}))),s}),n},J3=(r,e,t)=>{if(e==="")return r==null?void 0:r.filter(n=>(n==null?void 0:n.id)!==t);{const n=e.split("-");return K3(r,n,t)}},K3=(r,e,t)=>{let n=r,i=e;return(i==null?void 0:i.length)===0?n=n==null?void 0:n.filter(s=>s.id!==t):n=n==null?void 0:n.map(s=>(s.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),s=id(s,i,t)),s)),n},id=(r,e,t)=>{var s,a;let n=r,i=e;return(i==null?void 0:i.length)===0?n.children=(s=n.children)==null?void 0:s.filter(o=>o.id!==t):n.children=(a=n.children)==null?void 0:a.map(o=>(o.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),o=id(o,i,t)),o)),n},Z3=(r,e,t)=>{if(e==="")return t;{const n=e.split("-");return Q3(r,n,t)}},Q3=(r,e,t)=>{let n=r,i=e;return(i==null?void 0:i.length)===0?n=t:n=n==null?void 0:n.map(s=>(s.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),s=rd(s,i,t)),s)),n},rd=(r,e,t)=>{var s;let n=r,i=e;return(i==null?void 0:i.length)===0?n.children=t:n.children=(s=n.children)==null?void 0:s.map(a=>(a.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),a=rd(a,i,t)),a)),n},Ma=(r,e)=>r==null?void 0:r.map(n=>{var i,s,a,o,l,c;if(Array.isArray(n)?n=n:n=[n],(i=n==null?void 0:n.filter(h=>!(h!=null&&h.id)||typeof(h==null?void 0:h.id)=="string"))!=null&&i.every(h=>typeof h!="object"||h===null))return n;if((s=n==null?void 0:n.filter(h=>!(h!=null&&h.id)||typeof(h==null?void 0:h.id)=="string"))!=null&&s.some(h=>Array.isArray(h)))return n;{let h=[];if(h.push(n==null?void 0:n.find(u=>(u==null?void 0:u.id)&&typeof(u==null?void 0:u.id)=="number")),Array.isArray(e==null?void 0:e[0])){const u=(a=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:a[0];(o=Ln.getColumnChild(fe.cloneDeep(e==null?void 0:e[0])))==null||o.forEach(d=>{h.push(u==null?void 0:u[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}else{const u=(l=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:l[0];(c=Ln.getColumnChild(fe.cloneDeep(e)))==null||c.forEach(d=>{h.push(u==null?void 0:u[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}return h}}),e_=r=>{try{return JSON.parse(r),!0}catch{return!1}},Qh=(r,e)=>su(r,e),Yi=r=>{let e=[];function t(i){Array.isArray(i)&&(i==null||i.forEach(s=>{Array.isArray(s)||(s=[s]),s==null||s.forEach(a=>{!(a!=null&&a.children)||a.children.length===0?e.push(a.label):n(a.children)})}))}function n(i){i==null||i.forEach(s=>{!(s!=null&&s.children)||s.children.length===0?e.push(s.label):n(s.children)})}return t(r),e},t_=(r,e,t)=>{var i;let n=(i=fe.cloneDeep(r))==null?void 0:i.map(s=>(s=s.filter(a=>!(a!=null&&a.id)),s));return n=n==null?void 0:n.map(s=>{var a;return s=(a=s.map((o,l)=>{let c={};if(t!=null&&t.find(h=>h===e[l]))return c[e[l]]=o,c}))==null?void 0:a.filter(o=>o),s}),n},n_=(r,e)=>{var a,o;const t=fe.cloneDeep(r),n=(a=t==null?void 0:t.find(l=>(l==null?void 0:l.key)==="header"))==null?void 0:a.contents,i=(o=t==null?void 0:t.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:o.contents;return t_(i,Yi(n).slice(0,Yi(n).length-1),e)},i_=r=>{let e={};return r==null||r.forEach(t=>{e[t.key]=t.value}),e},r_=r=>{var t;let e=[];return(t=fe.cloneDeep(r))==null||t.forEach(n=>{let i={};n==null||n.forEach(s=>{i[Object.keys(s)[0]]=Object.values(s)[0]}),e.push(i)}),e},s_=(r,e)=>{if(e!=null&&e[r])return e==null?void 0:e[r]},a_=async(r,e)=>{var o,l,c;if(!(r!=null&&r.extra))return;let t=(o=r==null?void 0:r.extra)==null?void 0:o.tableId,n=r==null?void 0:r.contents;const s=(c=(await fe.getInsofDataApi({key:{type:"data",pageKey:(l=r==null?void 0:r.extra)==null?void 0:l.pageKey,tableId:t,systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:c.map(h=>h==null?void 0:h.id);s&&(s==null?void 0:s.length)>0&&await fe.batchDeleteInsofDataApi({ids:s});let a=[];n==null||n.forEach(h=>{var d,f;let u={};(d=Object.keys(h))==null||d.forEach(m=>{e!=null&&e.find(_=>(_==null?void 0:_.label.toUpperCase())===m.toUpperCase())&&(u[e.find(_=>_.label.toUpperCase()===m.toUpperCase()).label]=h[m])}),a.push({key:{type:"data",pageKey:(f=r==null?void 0:r.extra)==null?void 0:f.pageKey,tableId:t,systemKey:sessionStorage.getItem("systemKey")},value:{tableData:u}})}),(a==null?void 0:a.length)>0&&await fe.batchAddInsofDataApi({dataList:a})},o_=(r,e)=>{var s;let t=fe.cloneDeep(r),n=!1,i=Object.keys(e);return(s=t.compData)==null||s.forEach(a=>{var o;Array.isArray(a==null?void 0:a.contents)&&((o=a==null?void 0:a.contents)==null||o.forEach(l=>{n=i.includes(l.key)}))}),n},l_=(r,e)=>{var i;let t=fe.cloneDeep(r);return o_(fe.cloneDeep(t),e)&&(t.compData=(i=t.compData)==null?void 0:i.map(s=>{var a;return(s==null?void 0:s.key)==="formContent"&&(s.contents=(a=s==null?void 0:s.contents)==null?void 0:a.map(o=>(Object.keys(e).includes(o.key)&&(o.value=e[o.key]),o))),s})),t},c_=r=>{let e=fe.cloneDeep(r);return e==null||e.forEach(t=>{let n={};for(let i in t)n[i.toUpperCase()]=t[i]}),e},h_=async r=>{var a,o,l,c,h;let e=(o=(a=r==null?void 0:r[0])==null?void 0:a.find(u=>u==null?void 0:u.id))==null?void 0:o.id;const t=await fe.getInsofDataApi({id:e});let n=await((h=(c=(l=t==null?void 0:t.data)==null?void 0:l.result)==null?void 0:c[0])==null?void 0:h.key),i=n==null?void 0:n.pageKey,s=n==null?void 0:n.tableId;return{pageKey:i,tableId:s}},u_=async r=>{let e={comp:r==null?void 0:r.comp,compData:r==null?void 0:r.compData,name:r==null?void 0:r.name};await fe.updateInsofDataApi({id:r==null?void 0:r.id,value:{pageData:e}})},d_=async r=>{let e=r==null?void 0:r.map(async t=>{var i,s,a;let n;return(t==null?void 0:t.comp)==="Form"?n=await u_(t):(t==null?void 0:t.comp)==="Table"&&(n=await a_((i=t==null?void 0:t.compData)==null?void 0:i.find(o=>(o==null?void 0:o.key)==="tableContents"),(a=(s=t==null?void 0:t.compData)==null?void 0:s.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:a.contents)),n});await Promise.all(e)},f_=r=>{var i,s,a,o;const e=r;let t=[];e.compData=(i=e.compData)==null?void 0:i.filter(l=>(l==null?void 0:l.key)!=="tableContents"&&(l==null?void 0:l.key)!=="tableIndex");const n=(a=(s=fe.cloneDeep(e.compData))==null?void 0:s.find(l=>(l==null?void 0:l.key)==="tableIndexColumn"))==null?void 0:a.contents;return(o=fe.cloneDeep(e.compData))==null||o.forEach(l=>{if((l==null?void 0:l.key)!=="tableIndexColumn"&&(l==null?void 0:l.key)!=="header")t.push(l);else if((l==null?void 0:l.key)==="header"){let c=l.contents;n&&(c!=null&&c.every(h=>Array.isArray(h))?c==null||c[0].unshift({label:n}):c.unshift({label:n})),t.push({key:"header",contents:c})}}),e.compData=t,e},p_=r=>{var s,a,o,l,c;const e=(s=r.compData)==null?void 0:s.filter(h=>(h==null?void 0:h.key)==="tableContents"||(h==null?void 0:h.key)==="tableIndex"),t=(o=(a=e==null?void 0:e.find(h=>(h==null?void 0:h.key)==="tableIndex"))==null?void 0:a.contents)==null?void 0:o.map(h=>h.label),n=(l=e==null?void 0:e.find(h=>(h==null?void 0:h.key)==="tableContents"))==null?void 0:l.contents;let i=[];return(t==null?void 0:t.length)>0&&(n!=null&&n.every(h=>Array.isArray(h)))?i=t==null?void 0:t.map((h,u)=>n[u]?[h,...n[u]]:[h]):Array.isArray(n==null?void 0:n[0])&&((c=n==null?void 0:n[0])!=null&&c.every(h=>Array.isArray(h)))?i=n==null?void 0:n[0]:Array.isArray(n==null?void 0:n[0])?i=n:i.push(n),i},m_=r=>{const e=[];function t(n){!n||n.length===0||(e.push(n==null?void 0:n.map(i=>({label:i.label}))),n==null||n.forEach(i=>{i!=null&&i.children&&(i==null?void 0:i.children.length)>0&&t(i==null?void 0:i.children)}))}return t(r),e},g_=r=>{const e=[];function t(n,i=[]){!n||n.length===0||(e.push({key:i==null?void 0:i.filter(s=>!Array.isArray(s)),value:n}),n==null||n.forEach(s=>{s!=null&&s.some(a=>Array.isArray(a))&&t(s.find(a=>Array.isArray(a)),s)}))}return t(r),e},__=r=>{const e=[];function t(n){!n||n.length===0||(e.push(n==null?void 0:n.map(i=>i==null?void 0:i.filter(s=>!Array.isArray(s)))),n==null||n.forEach(i=>{i!=null&&i.some(s=>Array.isArray(s))&&t(i.find(s=>Array.isArray(s)))}))}return t(r),e},v_=r=>{const e=[];function t(n){var i;!n||n.length===0||(n!=null&&n.every(s=>!Array.isArray(s))?e.push(n):(e.push((i=n==null?void 0:n.map(s=>s==null?void 0:s.filter(a=>!Array.isArray(a))))==null?void 0:i[0]),n==null||n.forEach(s=>{s!=null&&s.some(a=>Array.isArray(a))&&t(s.find(a=>Array.isArray(a)))})))}return t(r),e},y_=(r,e)=>{let t;function n(i,s,a=1){var l;if(!i||i.length===0)return;const o=(l=fe.cloneDeep(s))==null?void 0:l.map(c=>c==null?void 0:c.filter(h=>!Array.isArray(h)));return o!=null&&o.find(c=>Qh(c,i==null?void 0:i.key))?(s==null||s.forEach(c=>{!n(i,c.find(u=>Array.isArray(u)))&&Qh(c.filter(u=>!Array.isArray(u)),i==null?void 0:i.key)&&(t={type:a,contents:c.filter(u=>!Array.isArray(u))})}),!0):!1}return n(r,e,0),t},eu=(r,e)=>{function t(n,i){return!n||n.length===0||n==null?void 0:n.map((a,o)=>{var c,h;let l=a;return l.unshift((c=i==null?void 0:i[o])==null?void 0:c.label),l.some(u=>Array.isArray(u))&&(l[l.length-1]=t(l.find(u=>Array.isArray(u)),(h=i==null?void 0:i[o])==null?void 0:h.children)),l})}return t(r,e)},x_=r=>{var t,n,i,s,a,o,l,c,h,u,d,f,m,_,g,p,S,E,v,U,C,T,L,b,x;const e=r;if((r==null?void 0:r.comp)==="Table"){if((i=(n=(t=r.compData)==null?void 0:t.find(R=>(R==null?void 0:R.key)==="tableIndex"))==null?void 0:n.contents)!=null&&i.every(R=>!(R!=null&&R.children))||!((s=r.compData)!=null&&s.find(R=>(R==null?void 0:R.key)==="tableIndex")))return((l=(o=(a=e.compData)==null?void 0:a.find(R=>(R==null?void 0:R.key)==="tableContents"))==null?void 0:o.contents)==null?void 0:l.length)===1&&((d=(u=(h=(c=e.compData)==null?void 0:c.find(R=>(R==null?void 0:R.key)==="tableContents"))==null?void 0:h.contents)==null?void 0:u[0])!=null&&d.every(R=>Array.isArray(R)))?(e.compData=(f=e.compData)==null?void 0:f.map(R=>{var B;return(R==null?void 0:R.key)==="tableContents"&&(R.contents=(B=R.contents)==null?void 0:B[0]),R}),[e]):[e];{let R=[];const B=e.compData,V=(m=fe.cloneDeep(B))==null?void 0:m.find(le=>(le==null?void 0:le.key)==="tableIndexColumn"),W=(_=fe.cloneDeep(B))==null?void 0:_.find(le=>(le==null?void 0:le.key)==="extraButton"),ee=(g=fe.cloneDeep(B))==null?void 0:g.find(le=>(le==null?void 0:le.key)==="rowButton"),k=v_((S=(p=fe.cloneDeep(B))==null?void 0:p.find(le=>(le==null?void 0:le.key)==="header"))==null?void 0:S.contents),Q=(E=fe.cloneDeep(B))==null?void 0:E.find(le=>(le==null?void 0:le.key)==="tableIndex"),q=__((U=(v=fe.cloneDeep(B))==null?void 0:v.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:U.contents),he=eu((T=(C=fe.cloneDeep(B))==null?void 0:C.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:T.contents,Q==null?void 0:Q.contents),ye=g_(eu((b=(L=fe.cloneDeep(B))==null?void 0:L.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:b.contents,Q==null?void 0:Q.contents));if(Q)return(x=m_(Q.contents))==null||x.forEach((le,Le)=>{var Y;let we=[];we.push({key:"tableIndex",contents:le}),we.push(V),we.push(W),we.push(ee),we.push({key:"tableContents",contents:q[Le]}),we.push({key:"header",contents:k!=null&&k[Le]?[k==null?void 0:k[Le]]:[k==null?void 0:k[0]]}),R.push({comp:"Table",compData:we,name:"",parentTableContents:((Y=y_(ye[Le],he))==null?void 0:Y.contents)??""})}),R}}else return[e]},cs=(r,e)=>{let t={};return Array.isArray(r)?r==null||r.forEach((n,i)=>{e!=null&&e[i]&&(t[e[i]]=n)}):[r].forEach((n,i)=>{t[e[i]]=n}),t},M_=async r=>{const e=fe.cloneDeep(r);let t=[],n=[];e==null||e.forEach(i=>{!(n!=null&&n.find(s=>(s==null?void 0:s.parentKey)===(i==null?void 0:i.parentKey)))&&(i==null?void 0:i.parentKey)!==""&&n.push(i)}),n=n==null?void 0:n.map(i=>{var s;return i.content=(s=i.content)==null?void 0:s.map(a=>{var o;return a.key={pageKey:(i==null?void 0:i.parentKey)??"",systemKey:((o=a.key)==null?void 0:o.systemKey)??"",version:1,type:"subStructure"},a}),i.content}),(n==null?void 0:n.length)>0&&(t=n==null?void 0:n.map(async i=>{let s;return(i==null?void 0:i.length)>0&&(s=await fe.batchAddInsofDataApi({dataList:i})),s})),await Promise.all(t)},Ml=fe.useMenuState(fe.pinia),{activeMenuPath:b_}=fe.storeToRefs(Ml),S_=async(r,e)=>{var c,h,u,d,f,m,_,g,p,S,E,v,U,C,T,L;const t=(h=(c=r==null?void 0:r.find(b=>(b==null?void 0:b.key)==="header"))==null?void 0:c.contents)==null?void 0:h.find(b=>b==null?void 0:b.columnPath);let n=(d=(u=fe.cloneDeep(t==null?void 0:t.columnPath))==null?void 0:u.split("["))==null?void 0:d[0],i=(p=(g=(_=(m=(f=fe.cloneDeep(t==null?void 0:t.columnPath))==null?void 0:f.split("["))==null?void 0:m[1])==null?void 0:_.split("]"))==null?void 0:g[0])==null?void 0:p.replaceAll("'",""),s=[];const a=await fe.getInsofDataApi({key:{pageKey:n,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),o=await fe.getInsofDataApi({key:{pageKey:b_.value,systemKey:sessionStorage.getItem("systemKey"),tableId:parseInt(e),type:"data"}}),l=[];if((E=(S=o==null?void 0:o.data)==null?void 0:S.result)==null||E.forEach(b=>{l.push([{id:b==null?void 0:b.id},b.value.tableData])}),Array.isArray((v=a==null?void 0:a.data)==null?void 0:v.result)&&((C=(U=a==null?void 0:a.data)==null?void 0:U.result)==null?void 0:C.length)>0){const b=await((L=(T=a==null?void 0:a.data)==null?void 0:T.result)==null?void 0:L.map(async x=>{var R,B,V,W,ee,k,Q,q,he,ye,le,Le,we,Y,re;if(((B=(R=x==null?void 0:x.value)==null?void 0:R.pageData)==null?void 0:B.name)===i){s=fe.cloneDeep((W=(V=x==null?void 0:x.value)==null?void 0:V.pageData)==null?void 0:W.compData);const ae=await fe.getInsofDataApi({key:{pageKey:n,systemKey:sessionStorage.getItem("systemKey"),tableId:x==null?void 0:x.id,type:"data"}}),oe=(k=(ee=ae==null?void 0:ae.data)==null?void 0:ee.result)==null?void 0:k.map(ke=>{var Ze;let tt=[];return tt.push({id:ke==null?void 0:ke.id}),tt.push((Ze=ke==null?void 0:ke.value)==null?void 0:Ze.tableData),tt});let Se=Ma(l,(ye=(he=(q=(Q=x==null?void 0:x.value)==null?void 0:Q.pageData)==null?void 0:q.compData)==null?void 0:he.find(ke=>(ke==null?void 0:ke.key)==="header"))==null?void 0:ye.contents),_e=!1;_e=((le=fe.cloneDeep(Se))==null?void 0:le.map(ke=>ke.slice(1))).every(ke=>ke.every(tt=>tt===void 0)),_e?s.push({key:"tableContents",contents:Ma(oe,(re=(Y=(we=(Le=x==null?void 0:x.value)==null?void 0:Le.pageData)==null?void 0:we.compData)==null?void 0:Y.find(ke=>(ke==null?void 0:ke.key)==="header"))==null?void 0:re.contents)}):s.push({key:"tableContents",contents:Se})}}));await Promise.all(b)}return s},bl=async(r,e,t="",n=!1,i)=>{var f,m,_,g,p,S,E;let s;s=await fe.getInsofDataApi({key:{pageKey:r,systemKey:e,parentTable:t}});const a=await fe.getInsofDataApi({key:{pageKey:r,systemKey:e,type:"structureMethod"}}),o=(m=(f=s==null?void 0:s.data)==null?void 0:f.result)==null?void 0:m.map(v=>v.id);if(!o)return;const l=o==null?void 0:o.map(v=>fe.getInsofDataApi({key:{pageKey:r,systemKey:e,type:"data",tableId:v}})),c=await Promise.all(l),h=[];c==null||c.forEach(v=>{var T,L,b,x;const U=(T=v.data.result)==null?void 0:T.map(R=>{const B=Array.isArray(R.value.tableData)?R.value.tableData:[R.value.tableData];return B.unshift({id:R.id}),B}),C=(x=(b=(L=v.data.result)==null?void 0:L[0])==null?void 0:b.key)==null?void 0:x.tableId;h.push({key:C,contents:U})});let u=[];const d=await((_=s.data.result)==null?void 0:_.map(async v=>{var L,b,x,R,B,V;const U=v.value.pageData,C=v==null?void 0:v.id;let T=(L=fe.cloneDeep(U.compData))==null?void 0:L.filter(W=>(W==null?void 0:W.key)!=="tableContents");if(T&&(T!=null&&T.find(W=>(W==null?void 0:W.key)==="header"))&&((x=(b=T==null?void 0:T.find(W=>(W==null?void 0:W.key)==="header"))==null?void 0:b.contents)!=null&&x.every(W=>!(W!=null&&W.columnPath)))?T.push({key:"tableContents",contents:Ma((R=h==null?void 0:h.find(W=>(W==null?void 0:W.key)===v.id))==null?void 0:R.contents,(B=T==null?void 0:T.find(W=>(W==null?void 0:W.key)==="header"))==null?void 0:B.contents)}):T&&(T!=null&&T.find(W=>(W==null?void 0:W.key)==="header"))&&(T=await S_(fe.cloneDeep(T),C)),U.compData=T,U.id=v.id,((V=v.key)==null?void 0:V.type)!=="method")u.push(U);else{let W;W={name:"",compData:[U],comp:"calculator"},u.push(W)}}));return await Promise.all(d),((p=(g=a.data.result)==null?void 0:g.map(v=>v.value.pageData))==null?void 0:p.filter(v=>Object.values(v).length>0).length)>0&&u.push({comp:"methodButton",name:"",compData:(E=(S=a.data.result)==null?void 0:S.map(v=>v.value.pageData))==null?void 0:E.filter(v=>Object.values(v).length>0)}),u=u.sort((v,U)=>v.id-U.id),u},E_=async r=>{await fe.deleteInsofDataApi({id:r})},A_=async(r,e,t,n,i,s,a)=>{var l,c,h,u,d,f,m,_,g,p,S,E,v;const o=((c=(l=a==null?void 0:a.content)==null?void 0:l[0])==null?void 0:c.id)??"";if(o!==""&&((h=a==null?void 0:a.content)==null?void 0:h.length)>1){const U=await fe.getInsofDataApi({id:o});let C=((m=(f=(d=(u=U==null?void 0:U.data)==null?void 0:u.result)==null?void 0:d[0])==null?void 0:f.key)==null?void 0:m.tableId)??"",T=((S=(p=(g=(_=U==null?void 0:U.data)==null?void 0:_.result)==null?void 0:g[0])==null?void 0:p.key)==null?void 0:S.pageKey)??"";await fe.createInsofDataApi({key:{type:r,pageKey:T,tableId:C,systemKey:n},value:{tableData:cs(i,(E=Yi(s))==null?void 0:E.filter(L=>L!=="操作"))}})}else await fe.createInsofDataApi({key:{type:r,pageKey:e,tableId:t,systemKey:n},value:{tableData:cs(i,(v=Yi(s))==null?void 0:v.filter(U=>U!=="操作"))}})},w_=async(r,e,t,n,i,s,a)=>{var h,u,d,f,m,_,g,p,S,E;const o=await fe.getInsofDataApi({id:n});let l=((f=(d=(u=(h=o==null?void 0:o.data)==null?void 0:h.result)==null?void 0:u[0])==null?void 0:d.key)==null?void 0:f.tableId)??"",c=((p=(g=(_=(m=o==null?void 0:o.data)==null?void 0:m.result)==null?void 0:_[0])==null?void 0:g.key)==null?void 0:p.pageKey)??"";l&&l!==""?await fe.updateInsofDataApi({key:{type:r,pageKey:c,tableId:l,systemKey:i},value:{tableData:cs(s,(S=Yi(a))==null?void 0:S.filter(v=>v!=="操作"))},id:n}):await fe.updateInsofDataApi({key:{type:r,pageKey:e,tableId:t,systemKey:i},value:{tableData:cs(s,(E=Yi(a))==null?void 0:E.filter(v=>v!=="操作"))},id:n})},T_=async(r,e)=>{await fe.updateInsofDataApi({value:{pageData:e},id:r})},C_=async(r,e)=>await fe.getInsofDataApi({key:r,valueLikes:e}),R_=async()=>{var r,e,t,n,i,s,a,o,l;try{const c=await fe.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),layer:"superAdmin"}});((r=c==null?void 0:c.data)==null?void 0:r.code)===200&&(Ml.setPlatform(((i=(n=(t=(e=c==null?void 0:c.data)==null?void 0:e.result)==null?void 0:t[0])==null?void 0:n.key)==null?void 0:i.systemType)==="制造系统"?"client":"browser"),Ml.setPlatName(((l=(o=(a=(s=c==null?void 0:c.data)==null?void 0:s.result)==null?void 0:a[0])==null?void 0:o.key)==null?void 0:l.name)??""))}catch(c){return Promise.reject(c)}},sd=fe.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(r){this.tableIndex=r},setTableShowThree(r){this.tableShowThree=r}}}),D_={class:"table-content"},P_={class:"menu-config-wrap"},L_=["onClick"],I_={class:"form-content"},U_={key:0,class:"dialog-footer"},N_={class:"dialog-footer"},F_={__name:"index",props:{compName:{type:String,default:"",required:!1},operatingForm:{type:Object,default:()=>{}},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0}},emits:["change","contentChange","onButtonClick","contentClick","pageChange","rowClick"],setup(r,{emit:e}){const t=r,n=e,i=K.ref([]),s=K.ref(!1),a=K.ref(),o=fe.useMenuState(),{activeMenuPath:l}=fe.storeToRefs(o),c=sd(fe.pinia),h=tu.useModelComp(fe.pinia),{extraContents:u}=fe.storeToRefs(h),d=K.ref([]);K.ref(!1);const f=K.ref("");K.ref();const m=K.ref(!0),_=K.ref(0),g=K.ref(!1),p=K.ref(""),S=K.ref(!1),E=K.ref({label:"查看三维模型"}),v=K.ref(!1),U=K.ref(),C=K.ref([]),T=K.ref([]),L=K.ref(!1),b=K.ref([]),x=K.ref([]),R=K.ref(),B=K.ref(),V=Qu(fe.pinia),W=K.ref(),ee=ed(fe.pinia),{selectIndex:k,selectMenu:Q,selectTitle:q}=fe.storeToRefs(ee),{selectString:he}=fe.storeToRefs(V),ye=K.ref(720),le=()=>{S.value=!1},Le=$=>{n("clickTrigger",$)},we=($,pe)=>{if(Object.values(pe).length!==0)return Object.values(pe).find(te=>{var Te,ce,ue;return((Te=te==null?void 0:te.toString())==null?void 0:Te.includes(".txt"))||((ce=te==null?void 0:te.toString())==null?void 0:ce.includes(".cpt"))||((ue=te==null?void 0:te.toString())==null?void 0:ue.includes(".obj"))})?[...$,E.value]:$},Y=$=>{var ce;he.value===""?$==null||$[0]:($==null?void 0:$.find(ue=>(ue==null?void 0:ue.selectLabel)==="("+he.value+")"))??($==null||$.find(ue=>!(ue!=null&&ue.selectLabel)));let pe=$;(ce=i.value)!=null&&ce.find(ue=>ue.prop==="index");let te=R.value;const Te=[];return pe==null||pe.forEach((ue,De)=>{var A;let N={};if(Array.isArray(ue)){let G=[];ue==null||ue.filter(z=>!(z!=null&&z.id)).forEach((z,se)=>{var ne,Ce,Ee,Be,Ve;if((ne=te==null?void 0:te[se])!=null&&ne.prop&&!Array.isArray(z)){let me={};me[te[se].column]=z,u!=null&&u.value&&((Ce=u==null?void 0:u.value)==null?void 0:Ce.length)>0&&((Ee=u==null?void 0:u.value)!=null&&Ee.find(Pe=>JSON.stringify(Pe==null?void 0:Pe[0])===JSON.stringify(me)))&&(G=(Be=u==null?void 0:u.value)==null?void 0:Be.find(Pe=>JSON.stringify(Pe==null?void 0:Pe[0])===JSON.stringify(me))),G&&G.length>0?N[te[se].prop]=G!=null&&G.find(Pe=>{var Je;return((Je=Object.keys(Pe))==null?void 0:Je[0])===te[se].column})?(Ve=G==null?void 0:G.find(Pe=>{var Je;return((Je=Object.keys(Pe))==null?void 0:Je[0])===te[se].column}))==null?void 0:Ve[te[se].column]:z:N[te[se].prop]=z}})}else N=ue;Array.isArray(ue)&&ue.some(G=>G==null?void 0:G.id)?Te.push(Object.assign(N,{id:(A=ue==null?void 0:ue.find(G=>G.id))==null?void 0:A.id})):N.id?Te.push(N):Te.push(Object.assign(N,{id:De}))}),Te},re=async $=>{var ce,ue,De,N,A;let pe={};for(let G in $)$[G]!==""&&(pe["tableData."+G]=$[G]);const te=await C_({type:"data",tableId:t==null?void 0:t.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:l.value},pe),Te=(De=(ue=(ce=fe.cloneDeep(te))==null?void 0:ce.data)==null?void 0:ue.result)==null?void 0:De.map(G=>{var se;let z=[];return z.push({id:G.id}),z.push((se=G==null?void 0:G.value)==null?void 0:se.tableData),z});d.value=Y(Ma(Te,(A=(N=fe.cloneDeep(i.value))==null?void 0:N.map(G=>G.label))==null?void 0:A.filter(G=>G!=="操作")))},ae=async $=>{var Te,ce,ue,De,N,A,G,z,se,ne;const pe=(Te=fe.cloneDeep(i.value))==null?void 0:Te.filter(Ce=>Ce==null?void 0:Ce.isRoute);if((pe==null?void 0:pe.length)>0){let Ce=(ce=pe==null?void 0:pe[0])==null?void 0:ce.prop,Ee=l.value+"/"+($==null?void 0:$[Ce]),Be=l.value,Ve=await bl(Ee,sessionStorage.getItem("systemKey"),"");if((Ve==null?void 0:Ve.length)>0)h.setRouteToChildPath(Be),o.setActiveMenuPath(Ee);else{const me=await Ln.findFirstContent(t==null?void 0:t.index);me&&(Ee=l.value+"/"+(me==null?void 0:me[(ue=pe==null?void 0:pe[0])==null?void 0:ue.label]),await Ln.loadingConstruct(Ee,l.value+"/"+($==null?void 0:$[Ce])),h.setRouteToChildPath(Be),o.setActiveMenuPath(l.value+"/"+($==null?void 0:$[Ce])))}}let te=await bl(l.value,sessionStorage.getItem("systemKey"),$.id);if(te=te==null?void 0:te.filter(Ce=>Ce.comp!=="methodButton"),te&&te.length>0){const Ce=!Array.isArray(q.value)&&((De=q.value)==null?void 0:De.key)!=="main"?[]:q.value;Ce.push({key:Q.value===""?(N=$==null?void 0:$.id)==null?void 0:N.toString():Q.value+"-"+((A=$==null?void 0:$.id)==null?void 0:A.toString()),value:$[(G=Object.keys($))==null?void 0:G.filter(Ee=>Ee!=="index"&&Ee!=="id")[0]]}),ee.setSelectMenu(Q.value===""?(z=$==null?void 0:$.id)==null?void 0:z.toString():Q.value+"-"+((se=$==null?void 0:$.id)==null?void 0:se.toString())),ee.setSelectTitle(Ce),ee.setSelectIndex((ne=$==null?void 0:$.id)==null?void 0:ne.toString()),n("pageChange",te)}},oe=$=>{var pe;(pe=fe.cloneDeep(t.itemData))==null||pe.map(te=>((te==null?void 0:te.key)==="tableContents"&&(te.contents=$),te))},Se=async($,pe,te,Te)=>{var ce;if((Te==null?void 0:Te.data)==="查看"&&($!=null&&$.every(ue=>(ue==null?void 0:ue.url)&&(ue==null?void 0:ue.name)))){let ue=fe.cloneDeep($);ue=await((ce=fe.cloneDeep(ue))==null?void 0:ce.map(async N=>{var z,se,ne,Ce;const A=await jn.downloadAvatarApi({url:N==null?void 0:N.url});let G=URL.createObjectURL(A.data);return{name:(N==null?void 0:N.name)+"."+((Ce=(z=N==null?void 0:N.url)==null?void 0:z.split("."))==null?void 0:Ce[((ne=(se=N==null?void 0:N.url)==null?void 0:se.split("."))==null?void 0:ne.length)-1]),blobUrl:G}}));let De=await Promise.all(ue);a.value=De,s.value=!0}n("contentClick",$,pe,te,{id:t==null?void 0:t.index,type:"table"})},_e=()=>{s.value=!1},Ae=$=>{n("rowClick",$)};K.watch(()=>t.changedContent,()=>{var te,Te;if(!t.changedContent)return;let $=(te=d.value)==null?void 0:te.map(ce=>{var ue;return ce.id===((ue=t.changedContent)==null?void 0:ue.id)&&(ce={...t.changedContent,id:t.changedContent.newId?t.changedContent.newId:t.changedContent.id},delete ce.newId),ce});const pe=(Te=t.itemData)==null?void 0:Te.map(ce=>((ce==null?void 0:ce.key)==="tableContents"&&(ce.contents=$),ce));d.value=$,n("contentChange",{contents:pe,index:t.index}),n("change",{content:$,index:t==null?void 0:t.index,buttonName:"",id:t==null?void 0:t.index})},{deep:!0,immediate:!0});const ke=()=>{},tt=($,pe,te)=>{var Te,ce,ue;if(f.value="",L.value=!0,m.value=!0,n("onButtonClick",$,pe),$==="删除"){d.value=(Te=fe.cloneDeep(d.value))==null?void 0:Te.filter(N=>(N==null?void 0:N.id)!==(pe==null?void 0:pe.id));const De=J3(W.value,Q.value,pe==null?void 0:pe.id);oe(De),n("change",{content:d.value,singleContent:pe,index:t==null?void 0:t.index,type:"delete",buttonName:$,column:i.value})}else if($==="新增")p.value="新增",Ze(""),S.value=!0;else if($==="编辑")p.value="编辑",Ze(pe),S.value=!0;else if($==="查看")p.value="查看",Ze(pe),L.value=!1,m.value=!1,S.value=!0;else if($==="查看三维模型"){const De={};for(let A in pe)A!=="id"&&(De[A]=pe[A]);let N=(ce=Object.values(De))==null?void 0:ce[1];c.setTableShowThree(N)}else((ue=te==null?void 0:te.extra)==null?void 0:ue.type)==="modelExample"&&(p.value=$,v.value=!0)},Ze=$=>{var ce,ue,De,N,A,G;const pe=[];let te=[];for(let z in $)Array.isArray($==null?void 0:$[z])&&te.push(z);(ue=Ln.getColumnChild((ce=fe.cloneDeep(i.value))==null?void 0:ce.filter(z=>(z==null?void 0:z.label)!=="操作")))==null||ue.forEach((z,se)=>{var ne;te.find(Ce=>Ce===(z==null?void 0:z.prop))||(z!=null&&z.formType&&((ne=z==null?void 0:z.formType)==null?void 0:ne.toUpperCase())==="SELECT"?pe.push({label:(z==null?void 0:z.label)??"",name:(z==null?void 0:z.prop)??"t"+se,type:!(z!=null&&z.formType)||(z==null?void 0:z.formType)===""?"Input":z==null?void 0:z.formType,value:($==null?void 0:$[z==null?void 0:z.prop])??(z==null?void 0:z.value)??"",id:(z==null?void 0:z.id)??se,contents:(z==null?void 0:z.options)??[],width:1,isFormColHidden:z==null?void 0:z.isFormColHidden,optionUrl:{groupSelect:z==null?void 0:z.groupSelect,menuSelect:z==null?void 0:z.formMenuSelect,type:"Select",selectRelateType:z==null?void 0:z.selectRelateType}}):pe.push({label:(z==null?void 0:z.label)??"",name:(z==null?void 0:z.prop)??"t"+se,type:!(z!=null&&z.formType)||(z==null?void 0:z.formType)===""?"Input":z==null?void 0:z.formType,value:($==null?void 0:$[z==null?void 0:z.prop])??(z==null?void 0:z.value)??"",id:(z==null?void 0:z.id)??se,contents:(z==null?void 0:z.options)??[],width:1,isFormColHidden:z==null?void 0:z.isFormColHidden}))}),$===""||!$||(f.value=$==null?void 0:$.id);let Te=Ln.getColumnChild((De=fe.cloneDeep(i.value))==null?void 0:De.filter(z=>(z==null?void 0:z.label)!=="操作"));C.value&&((N=C.value)==null?void 0:N.length)>0&&(C.value=(A=fe.cloneDeep(C).value)==null?void 0:A.map(z=>{var ne;let se=(ne=Te==null?void 0:Te.find(Ce=>(Ce==null?void 0:Ce.label)===(z==null?void 0:z.label)))==null?void 0:ne.prop;return se&&(z.value=$[se]),z})),x.value=C.value&&((G=C.value)==null?void 0:G.length)>0?Ln.getTableFormToForm(C.value):pe};K.onMounted(()=>{U.value=window.innerWidth-240*2});const O=()=>{var ce;let $=Ln.getColumnChild((ce=fe.cloneDeep(i.value))==null?void 0:ce.filter(ue=>(ue==null?void 0:ue.label)!=="操作")),pe,te=fe.cloneDeep(d.value);f.value===""?(_.value++,te.push(Object.assign(B.value,{id:_.value})),pe=Object.assign(B.value,{id:_.value})):te=te==null?void 0:te.map(ue=>{var De;if((ue==null?void 0:ue.id)===f.value){let N={};for(let A in ue){let G=(De=$==null?void 0:$.find(z=>(z==null?void 0:z.prop)===A))==null?void 0:De.label;G?N[A]=B.value[G]:N[A]=ue[A]}ue=Object.assign(N,B.value),pe=ue}return ue}),d.value=te;const Te=Z3(W.value,Q.value,te);oe(Te),S.value=!1,n("change",{content:Te,singleContent:pe,index:t==null?void 0:t.index,buttonName:p.value,column:i.value})},bt=$=>{B.value=$,n("onFormChange",$)};return K.watch(()=>[t.itemData,he.value,k.value,Q.value,u==null?void 0:u.value],()=>{var A,G,z,se,ne,Ce,Ee,Be,Ve,me,Pe,Je,nt,Ie,ct,H,Fe,ve,He,Me,ge,qe,ht,Dt,pt,en;const $=(A=fe.cloneDeep(t.itemData))==null?void 0:A.filter(je=>(je==null?void 0:je.key)==="header");(G=fe.cloneDeep(t.itemData))==null||G.filter(je=>(je==null?void 0:je.key)==="tableIndexColumn")[0];const pe=(z=fe.cloneDeep(t.itemData))==null?void 0:z.find(je=>(je==null?void 0:je.key)==="page"),te=(se=fe.cloneDeep(t.itemData))==null?void 0:se.find(je=>(je==null?void 0:je.key)==="rowButton"),Te=(ne=fe.cloneDeep(t.itemData))==null?void 0:ne.find(je=>(je==null?void 0:je.key)==="extraButton"),ce=(Ce=fe.cloneDeep(t.itemData))==null?void 0:Ce.filter(je=>(je==null?void 0:je.key)==="tableContents"),ue=(Ee=fe.cloneDeep(t.itemData))==null?void 0:Ee.filter(je=>(je==null?void 0:je.key)==="tableIndex");C.value=(me=(Ve=(Be=fe.cloneDeep(t.itemData))==null?void 0:Be.filter(je=>(je==null?void 0:je.key)==="tableToForm"))==null?void 0:Ve[0])==null?void 0:me.contents,g.value=(pe==null?void 0:pe.contents)??!1;let De=[];he.value===""?De=$==null?void 0:$[0]:De=($==null?void 0:$.find(je=>(je==null?void 0:je.selectLabel)==="("+he.value+")"))??($==null?void 0:$.find(je=>!(je!=null&&je.selectLabel)));let N=[];if(he.value===""?N=ue==null?void 0:ue[0]:N=(ue==null?void 0:ue.find(je=>(je==null?void 0:je.selectLabel)==="("+he.value+")"))??(ue==null?void 0:ue.find(je=>!(je!=null&&je.selectLabel))),((Pe=De==null?void 0:De.contents)==null?void 0:Pe.length)>0){let je=[];if(De!=null&&De.contents.some(rt=>Array.isArray(rt)&&(rt==null?void 0:rt.find(Re=>Re.children))))Q.value===""?je=(nt=(Je=Ln.getGradeColumns(fe.cloneDeep(De==null?void 0:De.contents)))==null?void 0:Je[0])==null?void 0:nt.filter(rt=>!Array.isArray(rt)):(Q.value.split("-"),je=(Ie=Ln.getGradeColumns(fe.cloneDeep(De==null?void 0:De.contents)))==null?void 0:Ie[0]);else{const rt=De!=null&&De.contents.some(Re=>Array.isArray(Re))?(ct=De==null?void 0:De.contents)==null?void 0:ct[0]:De==null?void 0:De.contents;rt==null||rt.forEach((Re,Ht)=>{var nn;je.push({label:(Re==null?void 0:Re.label)??"",prop:(Re==null?void 0:Re.label)==="操作"?"operate":(Re==null?void 0:Re.prop)??"a"+Ht,width:Re!=null&&Re.width?parseInt(Re.width):"",fixed:(Re==null?void 0:Re.fixed)??void 0,sortable:(Re==null?void 0:Re.sortable)??!1,align:(Re==null?void 0:Re.align)??"center",showOverflowTooltip:(Re==null?void 0:Re.showOverflowTooltip)??!0,isNotDrag:(Re==null?void 0:Re.isNotDrag)??!1,isEditCol:(Re==null?void 0:Re.isEditCol)??!1,isOperate:(Re==null?void 0:Re.isOperate)??!1,id:(Re==null?void 0:Re.id)??Ht,type:(Re==null?void 0:Re.label)==="操作"?"operate":void 0,formType:(Re==null?void 0:Re.formType)??(Re!=null&&Re.groupSelect?"Select":""),isTableColHidden:Re==null?void 0:Re.isTableColHidden,isFormColHidden:Re==null?void 0:Re.isFormColHidden,options:(Re==null?void 0:Re.options)??[],value:(Re==null?void 0:Re.value)??"",formMenuSelect:(Re==null?void 0:Re.formMenuSelect)??[],isRoute:(Re==null?void 0:Re.isRoute)??!1,groupSelect:Re!=null&&Re.groupSelect?(nn=Re==null?void 0:Re.groupSelect)==null?void 0:nn.replaceAll('"',"").split(":"):[]})})}i.value=je;let Zt=(Fe=(H=Ln.getAllLeafNodes(fe.cloneDeep(i.value)))==null?void 0:H.filter(rt=>(rt==null?void 0:rt.type)!=="operate"))==null?void 0:Fe.map((rt,Re)=>({prop:(rt==null?void 0:rt.prop)??"a"+Re,column:rt.label}));R.value=Zt;let jt=[];he.value===""?jt=ce==null?void 0:ce[0]:jt=(ce==null?void 0:ce.find(rt=>(rt==null?void 0:rt.selectLabel)==="("+he.value+")"))??(ce==null?void 0:ce.find(rt=>!(rt!=null&&rt.selectLabel)));let tn=Array.isArray((ve=jt==null?void 0:jt.contents)==null?void 0:ve[0])&&((He=jt==null?void 0:jt.contents)!=null&&He[0].every(rt=>Array.isArray(rt)))?(Me=fe.cloneDeep(jt==null?void 0:jt.contents))==null?void 0:Me[0]:fe.cloneDeep(jt==null?void 0:jt.contents);N!=null&&N.contents&&((ge=N==null?void 0:N.contents)==null?void 0:ge.length)!==0&&(tn=(qe=fe.cloneDeep(tn))==null?void 0:qe.map((rt,Re)=>{if(!Array.isArray(rt)){let Ht={};for(let nn in rt)nn!=="id"&&nn!=="index"&&(Ht[nn]=rt[nn]);rt=Object.values(Ht)}return rt}));const Di=!!((ht=i.value)!=null&&ht.find(rt=>rt.prop==="index"));tn=nd(fe.cloneDeep(tn),N==null?void 0:N.contents,Di);const ti=[];tn==null||tn.forEach((rt,Re)=>{var nn;let Ht={};if(Array.isArray(rt)){let Wt=[];rt==null||rt.filter(hn=>!(hn!=null&&hn.id)).forEach((hn,En)=>{var Ji,Ki,Zi,Qi,er,D;if((Ji=Zt==null?void 0:Zt[En])!=null&&Ji.prop&&!Array.isArray(hn)){let X={};X[Zt[En].column]=hn,u!=null&&u.value&&((Ki=u==null?void 0:u.value)==null?void 0:Ki.length)>0&&((Zi=u==null?void 0:u.value)!=null&&Zi.find(J=>JSON.stringify(J==null?void 0:J[0])===JSON.stringify(X)))&&(Wt=(Qi=u==null?void 0:u.value)==null?void 0:Qi.find(J=>JSON.stringify(J==null?void 0:J[0])===JSON.stringify(X))),Wt&&Wt.length>0?Ht[Zt[En].prop]=Wt!=null&&Wt.find(J=>{var Z;return((Z=Object.keys(J))==null?void 0:Z[0])===Zt[En].column})?(er=Wt==null?void 0:Wt.find(J=>{var Z;return((Z=Object.keys(J))==null?void 0:Z[0])===Zt[En].column}))==null?void 0:er[Zt[En].column]:hn:Ht[Zt[En].prop]=hn}else Array.isArray(hn)&&((D=Zt[En])!=null&&D.prop?Ht[Zt[En].prop]=hn:Ht.children=td(hn,Zt))})}else Ht=rt;Array.isArray(rt)&&rt.some(Wt=>Wt==null?void 0:Wt.id)?ti.push(Object.assign(Ht,{id:(nn=rt==null?void 0:rt.find(Wt=>Wt.id))==null?void 0:nn.id})):Ht.id?ti.push(Ht):ti.push(Object.assign(Ht,{id:Re}))}),d.value=ti}else i.value=[],d.value=[];((Dt=te==null?void 0:te.contents)==null?void 0:Dt.length)>0?T.value=te==null?void 0:te.contents:T.value=[],((pt=Te==null?void 0:Te.contents)==null?void 0:pt.length)>0?b.value=Te==null?void 0:Te.contents:b.value=[],_.value=((en=d==null?void 0:d.value)==null?void 0:en.length)??0,W.value=d.value},{deep:!0,immediate:!0}),K.watch(()=>t==null?void 0:t.operatingForm,$=>{$!=null&&$.form&&(Ze($==null?void 0:$.form),p.value=$==null?void 0:$.dialogTitle,L.value=!0,S.value=!0)},{immediate:!0,deep:!0}),($,pe)=>{var ue;const te=K.resolveComponent("el-icon"),Te=K.resolveComponent("el-popover"),ce=K.resolveComponent("el-button");return K.openBlock(),K.createElementBlock("div",D_,[(K.openBlock(),K.createBlock(jn.ssTable,{columns:i.value,key:i.value,tableData:d.value,isShowPagination:g.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:ae,extraButton:b.value,onContentClick:Se,onRowClick:Ae},K.createSlots({headerButton:K.withCtx(De=>[r.showHeader?(K.openBlock(),K.createBlock(Gd,{key:0,compName:r.compName,buttons:De.buttons,onButtonClick:pe[0]||(pe[0]=N=>tt(N,"",{})),columns:i.value,onFilter:re},null,8,["compName","buttons","columns"])):K.createCommentVNode("",!0)]),_:2},[((ue=T.value)==null?void 0:ue.length)>0?{name:"actions",fn:K.withCtx(({item:De})=>[K.createVNode(Te,{class:"box-item",title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:K.withCtx(()=>[K.createVNode(te,null,{default:K.withCtx(()=>[K.createVNode(K.unref(fe.more_filled_default))]),_:1})]),default:K.withCtx(()=>[K.createElementVNode("div",P_,[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(we(T.value,De),(N,A)=>(K.openBlock(),K.createElementBlock("div",{class:"menu-config-item",key:A},[K.createElementVNode("div",{style:K.normalizeStyle({color:N==null?void 0:N.textColor}),class:"extra-button-label",onClick:G=>tt(N==null?void 0:N.label,De,{extra:N})},K.toDisplayString(N==null?void 0:N.label),13,L_)]))),128))])]),_:2},1024)]),key:"0"}:void 0]),1032,["columns","tableData","isShowPagination","extraButton"])),K.createVNode(jn.ssDialog,{title:p.value,visible:S.value,width:ye.value,onBeforeDestroy:le},{default:K.withCtx(()=>[K.createElementVNode("div",I_,[K.createVNode(jn.ssForm,{rowContents:x.value,isEnableWrap:!1,onChange:bt,onClickTrigger:Le,isEdit:m.value},null,8,["rowContents","isEdit"])])]),footer:K.withCtx(()=>[L.value?(K.openBlock(),K.createElementBlock("div",U_,[K.createVNode(ce,{onClick:pe[1]||(pe[1]=De=>S.value=!1),id:"themeBorderButton"},{default:K.withCtx(()=>pe[4]||(pe[4]=[K.createTextVNode(K.toDisplayString("取消"))])),_:1,__:[4]}),K.createVNode(ce,{class:"ok-button",onClick:O,id:"themeButton"},{default:K.withCtx(()=>pe[5]||(pe[5]=[K.createTextVNode(K.toDisplayString("确认"))])),_:1,__:[5]})])):K.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),K.createVNode(jn.ssDialog,{title:p.value,visible:v.value,width:U.value,onBeforeDestroy:pe[3]||(pe[3]=De=>v.value=!1)},{default:K.withCtx(()=>[K.createVNode($3)]),footer:K.withCtx(()=>[K.createElementVNode("div",N_,[K.createVNode(ce,{onClick:pe[2]||(pe[2]=De=>v.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:K.withCtx(()=>pe[6]||(pe[6]=[K.createTextVNode(K.toDisplayString("取消"))])),_:1,__:[6]}),K.createVNode(ce,{class:"ok-button",onClick:ke,id:"themeButton"},{default:K.withCtx(()=>pe[7]||(pe[7]=[K.createTextVNode(K.toDisplayString("确认"))])),_:1,__:[7]})])]),_:1},8,["title","visible","width"]),s.value?(K.openBlock(),K.createBlock(jn.ssFilePreview,{key:0,fileDataList:a.value,onDestroy:_e},null,8,["fileDataList"])):K.createCommentVNode("",!0)])}}},O_=Sl._export_sfc(F_,[["__scopeId","data-v-c1156fac"]]);exports.ACESFilmicToneMapping=lu;exports.AmbientLight=Bu;exports.Box3=ei;exports.CatmullRomCurve3=Iu;exports.Color=ot;exports.Controls=x0;exports.DirectionalLight=zu;exports.DoubleSide=pn;exports.Euler=Sn;exports.GridHelper=y0;exports.HemisphereLight=c0;exports.IsJson=e_;exports.MOUSE=Wd;exports.MathUtils=Hi;exports.Matrix4=lt;exports.Mesh=Rt;exports.MeshPhongMaterial=Mn;exports.PCFSoftShadowMap=ou;exports.PerspectiveCamera=ln;exports.Plane=Ei;exports.PlaneGeometry=us;exports.PointLight=Ou;exports.Quaternion=Rn;exports.Ray=Ur;exports.SRGBColorSpace=Tt;exports.Scene=Ol;exports.SetCache=ns;exports.ShadowMaterial=jp;exports.Spherical=ku;exports.TOUCH=Xd;exports.TubeGeometry=Wl;exports.Vector2=Xe;exports.Vector3=F;exports.WebGLRenderer=i3;exports.Xe=R3;exports.addTableContents=A_;exports.baseIsEqual=El;exports.cacheHas=nu;exports.deleteTableContents=E_;exports.fixFormContents=T_;exports.fixTableContents=w_;exports.getColumnContents=Yi;exports.getFixExtraContent=h_;exports.getFormContents=i_;exports.getFormToContent=s_;exports.getFormToData=l_;exports.getItemData=bl;exports.getNewTableContents=c_;exports.getParentConstruct=M_;exports.getProjectContent=d_;exports.getTableToContent=r_;exports.getValueToObjectValue=cs;exports.isEqual=su;exports.loadingSystemType=R_;exports.methodTableToContent=n_;exports.setToArray=ru;exports.ssTable=O_;exports.tableEveryContents=x_;exports.tableToContents=p_;exports.tableToStruct=f_;exports.useFormToTableComp=Qu;exports.useModelLoader=W3;exports.useTableComp=sd;exports.useUnit=ed;
4206
+ `,y),null}const Pi=zt.getAttribute("version");console.debug("THREE.ColladaLoader: File version",Pi);const Ft=h(n(zt,"asset")[0]),mn=new ql(this.manager);mn.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);let un;jh&&(un=new jh(this.manager),un.setPath(this.resourcePath||t));const Xt=new ot,$t=[];let tr={},ni=0;const ft={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};f(zt,"library_animations","animation",g),f(zt,"library_animation_clips","animation_clip",k),f(zt,"library_controllers","controller",ue),f(zt,"library_images","image",ae),f(zt,"library_effects","effect",_e),f(zt,"library_materials","material",G),f(zt,"library_cameras","camera",Ce),f(zt,"library_lights","light",Je),f(zt,"library_geometries","geometry",Ne),f(zt,"library_nodes","node",Z),f(zt,"library_visual_scenes","visual_scene",Ct),f(zt,"library_kinematics_models","kinematics_model",je),f(zt,"library_physics_models","physics_model",nn),f(zt,"scene","instance_kinematics_scene",En),m(ft.animations,E),m(ft.clips,Q),m(ft.controllers,Te),m(ft.images,oe),m(ft.effects,N),m(ft.materials,se),m(ft.cameras,me),m(ft.lights,ct),m(ft.geometries,ht),m(ft.visualScenes,Ot),Yt(),Qi();const ps=st(n(zt,"scene")[0]);return ps.animations=$t,Ft.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),ps.rotation.set(-Math.PI/2,0,0)),ps.scale.multiplyScalar(Ft.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),$t},kinematics:tr,library:ft,scene:ps}}}const Yh=new F,z3=new Sn,Qs=new lt,Si=new lt,ea=new Rn,ta=new F(1,1,1),na=new F;class Ra extends Nt{constructor(...e){super(...e),this.urdfNode=null,this.urdfName=""}copy(e,t){return super.copy(e,t),this.urdfNode=e.urdfNode,this.urdfName=e.urdfName,this}}class B3 extends Ra{constructor(...e){super(...e),this.isURDFCollider=!0,this.type="URDFCollider"}}class k3 extends Ra{constructor(...e){super(...e),this.isURDFVisual=!0,this.type="URDFVisual"}}class Ku extends Ra{constructor(...e){super(...e),this.isURDFLink=!0,this.type="URDFLink"}}class Zu extends Ra{get jointType(){return this._jointType}set jointType(e){if(this.jointType!==e)switch(this._jointType=e,this.matrixWorldNeedsUpdate=!0,e){case"fixed":this.jointValue=[];break;case"continuous":case"revolute":case"prismatic":this.jointValue=new Array(1).fill(0);break;case"planar":this.jointValue=new Array(3).fill(0),this.axis=new F(0,0,1);break;case"floating":this.jointValue=new Array(6).fill(0);break}}get angle(){return this.jointValue[0]}constructor(...e){super(...e),this.isURDFJoint=!0,this.type="URDFJoint",this.jointValue=null,this.jointType="fixed",this.axis=new F(1,0,0),this.limit={lower:0,upper:0},this.ignoreLimits=!1,this.origPosition=null,this.origQuaternion=null,this.mimicJoints=[]}copy(e,t){return super.copy(e,t),this.jointType=e.jointType,this.axis=e.axis.clone(),this.limit.lower=e.limit.lower,this.limit.upper=e.limit.upper,this.ignoreLimits=!1,this.jointValue=[...e.jointValue],this.origPosition=e.origPosition?e.origPosition.clone():null,this.origQuaternion=e.origQuaternion?e.origQuaternion.clone():null,this.mimicJoints=[...e.mimicJoints],this}setJointValue(...e){e=e.map(n=>n===null?null:parseFloat(n)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let t=!1;switch(this.mimicJoints.forEach(n=>{t=n.updateFromMimickedJoint(...e)||t}),this.jointType){case"fixed":return t;case"continuous":case"revolute":{let n=e[0];return n==null||n===this.jointValue[0]?t:(!this.ignoreLimits&&this.jointType==="revolute"&&(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.quaternion.setFromAxisAngle(this.axis,n).premultiply(this.origQuaternion),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"prismatic":{let n=e[0];return n==null||n===this.jointValue[0]?t:(this.ignoreLimits||(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.position.copy(this.origPosition),Yh.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Yh,n),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"floating":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],Si.compose(this.origPosition,this.origQuaternion,ta),ea.setFromEuler(z3.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),na.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),Qs.compose(na,ea,ta),Si.premultiply(Qs),this.position.setFromMatrixPosition(Si),this.rotation.setFromRotationMatrix(Si),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],Si.compose(this.origPosition,this.origQuaternion,ta),ea.setFromAxisAngle(this.axis,this.jointValue[2]),na.set(this.jointValue[0],this.jointValue[1],0),Qs.compose(na,ea,ta),Si.premultiply(Qs),this.position.setFromMatrixPosition(Si),this.rotation.setFromRotationMatrix(Si),this.matrixWorldNeedsUpdate=!0,!0)}return t}}class $h extends Zu{constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const t=e.map(n=>n*this.multiplier+this.offset);return super.setJointValue(...t)}copy(e,t){return super.copy(e,t),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class V3 extends Ku{constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,t){super.copy(e,t),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(n=>{n.isURDFJoint&&n.urdfName in e.joints&&(this.joints[n.urdfName]=n),n.isURDFLink&&n.urdfName in e.links&&(this.links[n.urdfName]=n),n.isURDFCollider&&n.urdfName in e.colliders&&(this.colliders[n.urdfName]=n),n.isURDFVisual&&n.urdfName in e.visual&&(this.visual[n.urdfName]=n)});for(const n in this.joints)this.joints[n].mimicJoints=this.joints[n].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...t){const n=this.joints[e];return n?n.setJointValue(...t):!1}setJointValues(e){let t=!1;for(const n in e){const i=e[n];Array.isArray(i)?t=this.setJointValue(n,...i)||t:t=this.setJointValue(n,i)||t}return t}}const Eo=new Rn,Jh=new Sn;function br(r){return r?r.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function Kh(r,e,t=!1){t||r.rotation.set(0,0,0),Jh.set(e[0],e[1],e[2],"ZYX"),Eo.setFromEuler(Jh),Eo.multiply(r.quaternion),r.quaternion.copy(Eo)}class H3{constructor(e){this.manager=e||Xl,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((t,n)=>{this.load(e,t,null,n)})}load(e,t,n,i){const s=this.manager,a=Yl.extractUrlBase(e),o=this.manager.resolveURL(e);s.itemStart(o),fetch(o,this.fetchOptions).then(l=>{if(l.ok)return n&&n(null),l.text();throw new Error(`URDFLoader: Failed to load url '${o}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);t(c),s.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),s.itemError(o),s.itemEnd(o)})}parse(e,t=this.workingPath){const n=this.packages,i=this.loadMeshCb,s=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function u(S){if(!/^package:\/\//.test(S))return t?t+S:S;const[E,v]=S.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(E)?n+"/"+v:n+"/"+E+"/"+v;if(n instanceof Function)return n(E)+"/"+v;if(typeof n=="object")return E in n?n[E]+"/"+v:(console.error(`URDFLoader : ${E} not found in provided package list.`),null)}function d(S){let E;S instanceof Document?E=[...S.children]:S instanceof Element?E=[S]:E=[...new DOMParser().parseFromString(S,"text/xml").children];const v=E.filter(U=>U.nodeName==="robot").pop();return f(v)}function f(S){const E=[...S.children],v=E.filter(R=>R.nodeName.toLowerCase()==="link"),U=E.filter(R=>R.nodeName.toLowerCase()==="joint"),C=E.filter(R=>R.nodeName.toLowerCase()==="material"),T=new V3;T.robotName=S.getAttribute("name"),T.urdfRobotNode=S,C.forEach(R=>{const B=R.getAttribute("name");h[B]=g(R)});const L={},b={};v.forEach(R=>{const B=R.getAttribute("name"),V=S.querySelector(`child[link="${B}"]`)===null;l[B]=_(R,L,b,V?T:null)}),U.forEach(R=>{const B=R.getAttribute("name");c[B]=m(R)}),T.joints=c,T.links=l,T.colliders=b,T.visual=L;const x=Object.values(c);return x.forEach(R=>{R instanceof $h&&c[R.mimicJoint].mimicJoints.push(R)}),x.forEach(R=>{const B=new Set,V=W=>{if(B.has(W))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");B.add(W),W.mimicJoints.forEach(ee=>{V(ee)})};V(R)}),T.frames={...b,...L,...l,...c},T}function m(S){const E=[...S.children],v=S.getAttribute("type");let U;const C=E.find(B=>B.nodeName.toLowerCase()==="mimic");C?(U=new $h,U.mimicJoint=C.getAttribute("joint"),U.multiplier=parseFloat(C.getAttribute("multiplier")||1),U.offset=parseFloat(C.getAttribute("offset")||0)):U=new Zu,U.urdfNode=S,U.name=S.getAttribute("name"),U.urdfName=U.name,U.jointType=v;let T=null,L=null,b=[0,0,0],x=[0,0,0];E.forEach(B=>{const V=B.nodeName.toLowerCase();V==="origin"?(b=br(B.getAttribute("xyz")),x=br(B.getAttribute("rpy"))):V==="child"?L=l[B.getAttribute("link")]:V==="parent"?T=l[B.getAttribute("link")]:V==="limit"&&(U.limit.lower=parseFloat(B.getAttribute("lower")||U.limit.lower),U.limit.upper=parseFloat(B.getAttribute("upper")||U.limit.upper))}),T.add(U),U.add(L),Kh(U,x),U.position.set(b[0],b[1],b[2]);const R=E.filter(B=>B.nodeName.toLowerCase()==="axis")[0];if(R){const B=R.getAttribute("xyz").split(/\s+/g).map(V=>parseFloat(V));U.axis=new F(B[0],B[1],B[2]),U.axis.normalize()}return U}function _(S,E,v,U=null){U===null&&(U=new Ku);const C=[...S.children];return U.name=S.getAttribute("name"),U.urdfName=U.name,U.urdfNode=S,s&&C.filter(L=>L.nodeName.toLowerCase()==="visual").forEach(L=>{const b=p(L,h);if(U.add(b),L.hasAttribute("name")){const x=L.getAttribute("name");b.name=x,b.urdfName=x,E[x]=b}}),a&&C.filter(L=>L.nodeName.toLowerCase()==="collision").forEach(L=>{const b=p(L);if(U.add(b),L.hasAttribute("name")){const x=L.getAttribute("name");b.name=x,b.urdfName=x,v[x]=b}}),U}function g(S){const E=[...S.children],v=new Mn;return v.name=S.getAttribute("name")||"",E.forEach(U=>{const C=U.nodeName.toLowerCase();if(C==="color"){const T=U.getAttribute("rgba").split(/\s/g).map(L=>parseFloat(L));v.color.setRGB(T[0],T[1],T[2]),v.opacity=T[3],v.transparent=T[3]<1,v.depthWrite=!v.transparent}else if(C==="texture"){const T=U.getAttribute("filename");if(T){const L=new ql(o),b=u(T);v.map=L.load(b),v.map.colorSpace=Tt}}}),v}function p(S,E={}){const v=S.nodeName.toLowerCase()==="collision",U=[...S.children];let C=null;const T=U.filter(b=>b.nodeName.toLowerCase()==="material")[0];if(T){const b=T.getAttribute("name");b&&b in E?C=E[b]:C=g(T)}else C=new Mn;const L=v?new B3:new k3;return L.urdfNode=S,U.forEach(b=>{const x=b.nodeName.toLowerCase();if(x==="geometry"){const R=b.children[0].nodeName.toLowerCase();if(R==="mesh"){const B=b.children[0].getAttribute("filename"),V=u(B);if(V!==null){const W=b.children[0].getAttribute("scale");if(W){const ee=br(W);L.scale.set(ee[0],ee[1],ee[2])}i(V,o,(ee,k)=>{k?console.error("URDFLoader: Error loading mesh.",k):ee&&(ee instanceof Rt&&(ee.material=C),ee.position.set(0,0,0),ee.quaternion.identity(),L.add(ee))})}}else if(R==="box"){const B=new Rt;B.geometry=new Nr(1,1,1),B.material=C;const V=br(b.children[0].getAttribute("size"));B.scale.set(V[0],V[1],V[2]),L.add(B)}else if(R==="sphere"){const B=new Rt;B.geometry=new Aa(1,30,30),B.material=C;const V=parseFloat(b.children[0].getAttribute("radius"))||0;B.scale.set(V,V,V),L.add(B)}else if(R==="cylinder"){const B=new Rt;B.geometry=new Hl(1,1,1,30),B.material=C;const V=parseFloat(b.children[0].getAttribute("radius"))||0,W=parseFloat(b.children[0].getAttribute("length"))||0;B.scale.set(V,W,V),B.rotation.set(Math.PI/2,0,0),L.add(B)}}else if(x==="origin"){const R=br(b.getAttribute("xyz")),B=br(b.getAttribute("rpy"));L.position.set(R[0],R[1],R[2]),L.rotation.set(0,0,0),Kh(L,B)}}),L}return d(e)}defaultMeshLoader(e,t,n){/\.stl$/i.test(e)?new da(t).load(e,s=>{const a=new Rt(s,new Mn);n(a)}):/\.dae$/i.test(e)?new O3(t).load(e,s=>n(s.scene)):console.warn(`URDFLoader: Could not load model at ${e}.
4207
+ No loader available`)}}const G3=tu.useModelComp(fe.pinia),{systemPath:Zh}=fe.storeToRefs(G3),ia=K.ref();function W3(r,e,t,n,i){const s=async d=>{try{const f=await jn.downloadAvatarApi({url:d});if(f.status!==200)throw new Error(`下载失败: ${f.status}`);return f.data}catch(f){throw console.error("addModelFromUrl失败:",f),f}},a=d=>new Promise((f,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,E=new So().parse(p);E.preload(),f(E)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(d)}),o=async d=>{const f={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new Mn({color:8947848,side:pn}))},getAsArray:function(){const m=[];for(const _ in this.materials)m.push(this.materials[_]);return m},preload:function(){for(const m in this.materials)this.materials[m].map&&(this.materials[m].map.needsUpdate=!0)}};for(const m of d){const _=await a(m);Object.assign(f.materials,_.materials)}return f.preload(),f},l=async(d,f=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const S=p.target.result;let E=null;f&&f.length>0&&(f.length===1?E=await a(f[0]):E=await o(f));const v=new bo;E&&v.setMaterials(E);const U=v.parse(S);E||U.traverse(C=>{C.isMesh&&(C.material=new Mn({color:8947848,side:pn}))}),m(U)}catch(S){_(S)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(d)}),c=async d=>{var f;try{t.value=!0;const{scene:m}=r();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<d.length;g++){const p=d[g];n.value=`正在加载模型 ${g+1}/${d.length}...`;const S=await s(p.objUrl),E=((f=p.objUrl)==null?void 0:f.split("/").pop())||`model_${g}.obj`,v=new File([S],E,{type:S.type});let U=[];if(p.mtlUrls){const T=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let L=0;L<T.length;L++){const b=T[L],x=await s(b),R=(b==null?void 0:b.split("/").pop())||`material_${g}_${L}.mtl`,B=new File([x],R,{type:x.type});U.push(B)}}const C=await l(v,U);m.add(C),e.value.push(C),_.push(C)}return t.value=!1,_}catch(m){throw console.error("加载模型失败:",m),t.value=!1,m}},h=async(d,f,m=[],_=[])=>{let g;const p=d.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const S=await f.text();if(p===".txt"||p===".cpt"){const _e=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,ke=[...S.matchAll(_e)].map(O=>({x:parseFloat(O[1]),y:parseFloat(O[2]),z:parseFloat(O[3])})),tt=new Bt,Qe=ke.flatMap(O=>[O.x,O.y,O.z]);if(tt.setAttribute("position",new mt(Qe,3)),p===".txt"){const O=new Wi({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Qr(tt,O)}else if(p===".cpt"){const O=new Ci({color:"#5B5C99",linewidth:100});g=new Vl(tt,O)}}else if(p===".obj"){const _e=new bo;if(m&&m.length>0){const we=new So;for(const ke of m){const tt=await ke.text(),Qe=we.parse(tt);Qe.preload(),_e.setMaterials(Qe);break}}g=_e.parse(S),(!m||m.length===0)&&g.traverse(we=>{we.isMesh&&(we.material=new Mn({color:"#B3B3D4"})),we instanceof Rt&&(we.material.side=pn)})}break;case".stl":const E=await f.arrayBuffer(),U=new da().parse(E),C=new Mn({color:"#B3B3D4",side:pn});g=new Rt(U,C);break;case".nc":const T=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],L={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},b=new Kn,x=T.map(_e=>new Promise((we,ke)=>{new da().load(Zh.value===""?`/model/${_e}`:`${Zh.value}\\${_e}`,Qe=>{const O=new Mn({color:L[_e]||"#B3B3D4",side:pn}),bt=new Rt(Qe,O);we(bt)},void 0,ke)}));try{(await Promise.all(x)).forEach(we=>b.add(we)),g=b}catch(_e){throw console.error("加载NC文件对应的STL文件失败:",_e),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const R=new F3,B=new Kn;try{const _e=await fe.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),we=new Blob([_e.data],{type:"application/octet-stream;charset=UTF-8"}),ke=await fe.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),tt=new Blob([ke.data],{type:"application/octet-stream;charset=UTF-8"}),Qe=await new Promise((bt,$)=>{const pe=URL.createObjectURL(we);R.load(pe,te=>{const Se=new Float32Array(te.geometry.attributes.position.count*3);for(let he=0;he<te.geometry.attributes.position.count;he++)Se[he*3]=1,Se[he*3+1]=0,Se[he*3+2]=0;te.geometry.setAttribute("color",new Gt(Se,3)),te.material.vertexColors=!0,te.scale.set(.3,.3,.3),URL.revokeObjectURL(pe),bt(te)},void 0,$)}),O=await new Promise((bt,$)=>{const pe=URL.createObjectURL(tt);R.load(pe,te=>{const Se=new Float32Array(te.geometry.attributes.position.count*3);for(let he=0;he<te.geometry.attributes.position.count;he++)Se[he*3]=0,Se[he*3+1]=1,Se[he*3+2]=0;te.geometry.setAttribute("color",new Gt(Se,3)),te.material.vertexColors=!0,te.scale.set(.3,.3,.3),URL.revokeObjectURL(pe),bt(te)},void 0,$)});B.add(Qe),B.add(O),g=B}catch(_e){throw console.error("PCD文件加载失败:",_e),new Error("无法加载PCD文件")}break;case".urdf":const V=URL.createObjectURL(f),W=new H3,ee="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",k={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},Q=new Map,q=new Map,ue=new Map,ye=async _e=>{if(Q.has(_e))return console.log(`从缓存加载: ${_e}`),Q.get(_e);try{const we=await fe.axios.get(`${ee}/${_e}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),ke=new Blob([we.data],{type:"application/octet-stream;charset=UTF-8"});return k.enableCache&&Q.set(_e,ke),ke}catch(we){throw console.error(`加载文件失败: ${_e}`,we),new Error(`无法加载文件: ${_e}`)}},le=(_e="default")=>{if(q.has(_e))return q.get(_e);const we=new Mn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Hn});return q.set(_e,we),we},Pe=_e=>{try{_e.isBufferGeometry&&_e.mergeVertices&&_e.mergeVertices(),_e.computeVertexNormals&&_e.computeVertexNormals(),_e.computeBoundingSphere&&_e.computeBoundingSphere(),_e.deleteAttribute&&_e.deleteAttribute("uv2")}catch(we){console.warn("几何体优化失败,使用原始几何体:",we)}return _e},Te=async(_e,we,ke)=>{const tt=`stl_${we}`;if(ue.has(tt)){const $=ue.get(tt);return new Rt($,le())}const Qe=await _e.arrayBuffer();let bt=new da(ke).parse(Qe);return bt=Pe(bt),ue.set(tt,bt),new Rt(bt,le())},Y=async(_e,we,ke)=>{const tt=`obj_${we}`;if(Q.has(tt))return Q.get(tt).clone();const Qe=await _e.text(),O=new bo(ke),bt=we.replace(".obj",".mtl");try{const te=await(await ye(bt)).text(),he=new So(ke).parse(te);he.preload(),O.setMaterials(he)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${bt}`)}const $=O.parse(Qe);return $.traverse(pe=>{pe.isMesh&&(pe.geometry=Pe(pe.geometry),pe.castShadow=!0,pe.receiveShadow=!0,pe.renderOrder=1)}),Q.set(tt,$),$},re=(_e,we)=>{const ke=new Ep;if(ke.addLevel(_e,0),_e.geometry){const tt=_e.geometry.clone(),Qe=new Rt(tt,_e.material);ke.addLevel(Qe,50)}return ke};let ae=0,oe=0;const Ee=[];W.loadMeshCb=async(_e,we,ke,tt,Qe)=>{const O=_e.split("/").pop(),bt=ke||(()=>{});ae++;const $=new Promise(async(pe,te)=>{try{const Se=await ye(O);if(!Se||Se.size===0)throw new Error(`文件为空: ${O}`);const he=O.split(".").pop().toLowerCase();let ce;switch(he){case"stl":ce=await Te(Se,O,we);break;case"obj":ce=await Y(Se,O,we);break;default:throw new Error(`不支持的文件格式: ${he}`)}k.enableLOD&&ce.isMesh&&(ce=re(ce,O)),bt(ce),oe++,tt&&tt({loaded:oe,total:ae,progress:oe/ae}),pe(ce)}catch(Se){console.error(`mesh文件加载失败: ${O}`,Se);const he=new Kn;bt(he),pe(he)}});Ee.push($)};try{if(!V){ia.value=void 0;break}if(g=await W.loadAsync(V),console.log(`URDF文件加载完成,等待${ae}个mesh文件加载...`),Ee.length>0)try{await Promise.allSettled(Ee),console.log(`所有mesh文件处理完成,成功加载: ${oe}/${ae}`)}catch(_e){console.warn("部分mesh文件加载失败,但继续显示模型",_e)}g.traverse(_e=>{_e.isMesh&&(_e.castShadow=!0,_e.receiveShadow=!0,_e.renderOrder=1,_e.material&&(_e.material.needsUpdate=!0))}),ia.value=g,console.log("URDF模型加载完成并优化")}catch(_e){console.error("URDF加载失败:",_e),ia.value=void 0}finally{V&&URL.revokeObjectURL(V)}break;default:throw new Error(`不支持的文件格式: ${d}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async d=>{console.log(d);try{t.value=!0,n.value="正在加载模型...";const{scene:f}=r();if(!f)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<d.length;_++){const g=d[_],p=await h(g.suffix,g.blob,g.mtlBlobs||[],g.meshFiles||[]);p&&(f.add(p),e.value.push(p),m.push(p))}return t.value=!1,n.value="",m}catch(f){throw console.error("加载模型失败:",f),t.value=!1,n.value="",f}},urdfModel:ia}}window._iconfont_svg_string_4634042='<svg><symbol id="icon-lookAround" viewBox="0 0 1041 1024"><path d="M520.685026 798.355937c-10.788594 0-21.577187-2.790872-31.241101-8.372615l-291.583615-168.36871A62.482203 62.482203 0 0 1 166.619208 567.505024V230.850913c0-22.368629 11.913273-42.987756 31.241102-54.109588l291.583615-168.36871a62.482203 62.482203 0 0 1 62.482203 0l291.583615 168.36871c19.327828 11.121832 31.241102 31.740959 31.241101 54.109588v336.654111a62.482203 62.482203 0 0 1-31.241101 54.109588l-291.583615 168.36871a62.857096 62.857096 0 0 1-31.241102 8.372615zM291.583615 531.39031l229.101411 132.295652 229.101412-132.295652v-264.507993l-229.101412-132.295651L291.583615 266.923972v264.466338z m520.685026 36.114714h0.416548-0.416548z" fill="#aaaaaa" ></path><path d="M520.685026 461.660172c-10.788594 0-21.577187-2.790872-31.241101-8.372616l-291.583615-168.327055a62.482203 62.482203 0 0 1 62.482203-108.219176L520.685026 326.990196l260.342513-150.248871a62.482203 62.482203 0 1 1 62.482204 108.219176l-291.583615 168.327055a62.857096 62.857096 0 0 1-31.241102 8.372616z" fill="#aaaaaa" ></path><path d="M520.685026 798.355937a62.482203 62.482203 0 0 1-62.482203-62.482203V399.177969a62.482203 62.482203 0 1 1 124.964406 0v336.695765a62.482203 62.482203 0 0 1-62.482203 62.482203z" fill="#aaaaaa" ></path><path d="M520.685026 1003.172599c-53.276492 0-520.685026-5.248505-520.685026-187.446609 0-62.982061 54.776065-111.259976 162.870276-143.584103 33.073913-9.622259 67.855673 8.914128 77.769516 41.98804s-8.872473 67.897327-41.946386 77.769516c-30.324696 9.080747-49.194321 17.619981-60.649392 24.11813 46.32014 26.242525 178.657446 62.19062 382.641012 62.19062s336.320872-35.948094 382.641012-62.19062c-11.455071-6.498149-30.324696-15.037384-60.649392-24.11813a62.482203 62.482203 0 1 1 35.82313-119.757556c108.094211 32.324126 162.870276 80.643697 162.870276 143.584103 0 182.198104-467.408534 187.446609-520.685026 187.446609z m398.886385-175.366717h0.416548-0.416548z" fill="#72B02D" ></path></symbol><symbol id="icon-xuanzhuan" viewBox="0 0 1024 1024"><path d="M378.963454 724.443778l91.182641 163.473426c6.246088 11.212239 2.252687 25.39393-9.010749 31.691216l-163.473427 91.18264c-18.123894 10.085896-39.422029-6.758062-33.739113-26.673866l72.290786-254.707264c5.682916-19.967002 32.663967-23.090045 42.749862-4.966152z" fill="#FC794B" ></path><path d="M414.64807 903.9932c-1.228739 0-2.40628-0.051197-3.635018-0.204789C169.002752 879.367232 0.000003 771.443028 0.000003 641.452727c0-52.221389 27.032248-102.19009 78.127293-144.581571a35.827969 35.827969 0 0 1 50.480676 4.710165 35.827969 35.827969 0 0 1-4.710164 50.480676C100.090998 571.824209 71.727616 603.310634 71.727616 641.452727c0 88.929954 148.984551 171.050647 346.504275 191.068847 19.711014 1.9967 34.046298 19.557422 32.049597 39.268436a35.879166 35.879166 0 0 1-35.633418 32.20319zM608.430381 904.095595c-18.175091 0-33.79031-13.772111-35.633418-32.254387-1.945503-19.711014 12.389781-37.271736 32.100795-39.217239 198.134093-19.813409 347.528224-101.985301 347.528223-191.171242 0-23.550822-10.649068-47.050447-31.58882-69.935703-13.362532-14.59127-12.389781-37.271736 2.20149-50.634268 14.59127-13.362532 37.271736-12.389781 50.634268 2.20149 32.971151 35.9918 50.429479 76.898555 50.429478 118.368481 0 130.297485-169.463527 238.221689-412.088195 262.489276-1.177541 0.102395-2.40628 0.153592-3.583821 0.153592z" fill="#FC794B" ></path><path d="M846.703267 184.413179l-325.308534 184.464377L196.137396 184.413179 521.394733 0z" fill="#BEC5CB" ></path><path d="M521.394733 737.703915l325.308534-184.41318V184.413179l-325.308534 184.464377z" fill="#808487" ></path><path d="M521.394733 737.703915L196.137396 553.290735V184.413179l325.257337 184.464377z" fill="#9CA3A9" ></path></symbol><symbol id="icon-clipping" viewBox="0 0 1024 1024"><path d="M341.930667 201.770667l353.706666 204.245333v408.448l-353.706666-204.245333z" fill="#4A80FF" fill-opacity="0.15" ></path><path d="M320.853333 165.248l396.117334 228.608v457.173333l-395.946667-228.608z m353.749334 252.970667L362.837333 238.336v359.722667l311.466667 179.882666z" fill="#72B02D" ></path><path d="M544.384 746.453333l-211.669333-211.669333 18.688-18.688 211.669333 211.669333z" fill="#72B02D" ></path><path d="M693.717333 530.261333l-266.453333-266.325333 20.906667-20.906667 266.325333 266.453334z" fill="#72B02D" ></path><path d="M688.853333 621.098667l-366.933333-366.933334 24.448-24.704 366.933333 366.933334z" fill="#72B02D" ></path><path d="M689.664 713.856L321.578667 345.770667l24.618666-24.618667 368.085334 368.128z" fill="#72B02D" ></path><path d="M683.605333 799.317333l-355.712-355.712 24.234667-24.234666 355.712 355.712z" fill="#72B02D" ></path><path d="M537.770667 944.938667h-51.2v-418.602667l-362.666667-209.28 25.6-44.330667 362.666667 209.066667 362.666666-209.066667 25.6 44.330667-362.666666 209.066667z" fill="#AAAAAA" ></path><path d="M512.170667 53.461333a31.146667 31.146667 0 0 1 15.488 4.266667l370.090666 213.632a31.232 31.232 0 0 1 15.317334 26.794667v426.922666a31.274667 31.274667 0 0 1-15.317334 26.837334l-369.834666 213.333333a31.488 31.488 0 0 1-31.061334 0l-369.834666-213.333333a31.146667 31.146667 0 0 1-15.914667-26.837334V298.069333a31.146667 31.146667 0 0 1 15.573333-27.008l369.792-213.333333a30.976 30.976 0 0 1 15.701334-4.266667z m349.866666 256l-349.866666-201.642666-349.866667 201.856v403.84l349.866667 201.813333 349.866666-201.898667z" fill="#AAAAAA" ></path></symbol><symbol id="icon-viewReset" viewBox="0 0 1024 1024"><path d="M643.2 515.2c-89.6-67.2-179.2-60.8-268.8 0-32 22.4-67.2 57.6-105.6 89.6 38.4 32 70.4 70.4 108.8 96 28.8 19.2 60.8 32 96 38.4 118.4 19.2 188.8-57.6 268.8-137.6-35.2-28.8-60.8-64-99.2-86.4zM508.8 704c-51.2 0-96-41.6-96-99.2s41.6-105.6 96-105.6 96 41.6 96 99.2c0 64-38.4 105.6-96 105.6z" fill="#AAAAAA" ></path><path d="M515.2 544c-3.2 41.6 12.8 60.8 51.2 51.2 0 32-19.2 57.6-51.2 57.6s-57.6-22.4-51.2-57.6c-6.4-32 16-51.2 51.2-51.2" fill="#AAAAAA" ></path><path d="M652.8 3.2c9.6-3.2 19.2-3.2 28.8 0 9.6 3.2 12.8 12.8 12.8 22.4v108.8c70.4 28.8 131.2 70.4 179.2 128 80 89.6 118.4 214.4 108.8 336-9.6 124.8-70.4 236.8-166.4 313.6-96 80-224 118.4-345.6 108.8-124.8-9.6-243.2-67.2-323.2-160S32 649.6 41.6 524.8c9.6-118.4 70.4-233.6 160-307.2 22.4-19.2 60.8-19.2 80 3.2 19.2 22.4 19.2 57.6-3.2 80-70.4 57.6-115.2 140.8-124.8 233.6s22.4 185.6 80 249.6c60.8 70.4 147.2 115.2 243.2 124.8 96 9.6 188.8-19.2 259.2-80s118.4-140.8 124.8-236.8c9.6-89.6-22.4-185.6-80-249.6-28.8-28.8-57.6-57.6-89.6-76.8v89.6c0 9.6-3.2 19.2-12.8 22.4-9.6 3.2-19.2 3.2-28.8 0l-227.2-160c-3.2-3.2-9.6-12.8-9.6-19.2 0-9.6 3.2-12.8 9.6-19.2L652.8 3.2z" fill="#72B02D" ></path></symbol><symbol id="icon-donghuafangzhen" viewBox="0 0 1024 1024"><path d="M868.864 228.864c-19.968 0-38.912 7.68-53.248 20.992l-291.328-170.496c-7.168-5.12-16.896-5.12-24.064 0L208.896 248.832c-14.336-12.8-33.28-20.48-53.76-20.48-43.52 0-79.872 36.864-79.872 80.896 0 33.792 21.504 63.488 53.248 74.24v318.976c0 9.216 4.608 17.408 12.288 22.016L437.248 896c11.776 30.72 41.472 51.712 74.752 52.224 33.28-0.512 62.464-20.992 74.752-52.224l296.448-171.52c7.68-4.608 12.288-13.312 12.288-22.016V386.048c31.744-11.776 53.248-42.496 53.248-76.288 0-44.032-36.352-80.896-79.872-80.896zM155.136 339.456c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 15.872-12.8 28.672-29.184 29.184zM512 897.024c-16.896 0-29.184-12.288-29.184-29.696 0-14.848 12.288-29.696 29.184-29.696h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 14.848-14.848 29.696-29.184 29.696z m74.752-58.368c-11.776-30.208-40.96-51.712-74.752-51.712-27.136 0-52.224 14.336-67.072 37.376l-3.072 1.024c-4.608 2.048-8.704 5.632-9.728 10.752l-252.416-146.944V384.512C212.48 373.76 234.496 343.04 235.52 308.736l3.072 0.512h2.048c3.584 0 7.168-1.536 10.24-3.584 7.168-5.632 8.192-16.384 2.048-23.552L512 130.56l278.528 162.816c-7.68 36.864 11.264 74.24 45.568 90.624 0.512 5.632 3.584 10.24 8.704 13.312v291.328l-258.048 150.016z m282.112-499.2c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696v2.56c-1.024 14.848-13.824 27.136-29.184 26.624z" fill="#AAAAAA" ></path><path d="M422.912 724.992c-3.072-8.704-12.288-12.8-20.992-9.728-8.704 3.072-12.8 12.8-9.728 21.504l19.968 54.784c2.56 6.656 8.192 10.752 15.36 10.752 2.048 0 3.584-0.512 5.12-1.024 8.704-3.072 12.8-12.8 9.728-21.504l-19.456-54.784zM706.048 507.392c0-107.52-86.016-195.072-192-196.096-2.048-1.536-4.608-2.56-7.68-3.072l-24.064-3.072c-8.192-1.024-15.872 4.096-17.92 11.776-5.632 1.536-11.776 3.584-16.896 5.632 0.512-1.536 1.024-3.072 1.536-5.12 1.024-9.216-5.12-17.408-14.336-18.432l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.608 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l44.032 5.12C384 353.28 351.232 388.608 333.312 432.64c-25.088 60.928-17.92 130.048 18.432 184.832-1.024 3.584-1.024 7.168 0.512 10.24l19.968 54.784c1.024 3.072 3.072 5.632 6.144 7.68 7.168 5.12 17.408 3.072 22.528-4.096 3.072-4.608 3.584-10.24 2.048-15.36l-0.512-1.536c53.76 37.888 123.392 45.568 184.32 19.968 46.08-19.456 82.944-55.808 102.912-101.376l12.8-14.336c6.144-6.656 5.632-17.408-0.512-23.04 2.56-14.336 4.096-28.672 4.096-43.008z m-193.536 156.16C427.52 663.552 358.4 593.92 358.4 507.392c0-86.016 69.12-156.16 154.112-156.16s154.112 69.632 154.112 156.16c0 86.016-69.12 156.16-154.112 156.16z" fill="#72B02D" ></path><path d="M765.44 478.72c-6.144-5.632-15.872-5.632-22.016 0l-32.256 35.84c-4.096 4.608-5.632 11.776-3.072 17.92 2.56 6.144 8.192 9.728 14.848 9.728 4.608 0 8.704-2.048 11.776-5.12l32.256-35.84c5.12-7.168 4.608-16.896-1.536-22.528zM823.296 401.92c-5.632-1.024-11.776 0.512-15.872 5.12l-32.256 35.84c-4.608 4.608-5.632 11.776-3.072 17.92 1.024 2.048 2.56 4.096 4.096 5.632 6.656 6.144 16.896 5.632 23.04-1.536l32.256-35.84c4.096-4.096 5.632-10.752 3.584-16.384-1.024-5.632-5.632-9.728-11.776-10.752zM336.384 321.024c8.704 0 15.872-6.656 16.384-15.36 0.512-8.704-5.632-16.384-14.336-17.408l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.096 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l48.128 5.632h2.048z" fill="#72B02D" ></path></symbol><symbol id="icon-guanjianjiexi" viewBox="0 0 1024 1024"><path d="M298.496 200.704v83.456h-39.936v177.664h137.728V389.12h47.104v245.76h-47.104v-79.872H211.456c-10.752-3.584-54.272-14.336-54.272-57.856V280.064h-32.768V200.704h174.08m47.104-47.104H77.824v177.152h36.352v169.984c0 68.608 61.44 97.792 97.792 104.96H353.28v79.872h141.312V342.016H349.184v72.192h-43.52v-87.04h39.936V153.6zM627.712 389.12v79.872H812.544c10.752 3.584 54.272 14.336 54.272 54.272V740.352h32.768v83.456h-173.568v-83.456h39.936v-177.664h-137.728V634.88h-47.104V389.12h46.592m47.104-47.104h-141.312v340.48h141.312v-72.192h43.52v83.456h-39.936V870.4h267.776v-177.152h-36.352v-169.984c0-68.608-61.44-97.792-97.792-104.96H670.72V342.528h4.096z" fill="#AAAAAA" ></path></symbol><symbol id="icon-gongyishengcheng" viewBox="0 0 1024 1024"><path d="M889.344 391.68h29.696v-43.008h-208.896l1.024 45.056 28.16 3.072v20.992c55.808 5.632 108.032 28.672 150.016 66.56-0.512 0 0-92.672 0-92.672z m-366.592 102.912c13.312-13.312 27.648-24.576 43.008-34.816-2.048-70.144-5.632-153.088-8.704-179.712-5.632-48.64-34.816-204.288-226.816-202.752-191.488 1.536-223.744 164.864-230.912 207.36s-11.776 197.632-11.776 197.632h-24.576v43.008l208.896 1.024v-40.96h-24.064V316.928S245.76 230.912 335.36 231.424C424.448 232.448 415.232 327.68 414.72 327.68v313.856c4.608 0 6.144 77.824 50.176 144.896-13.312-32.256-20.48-67.072-20.48-102.912 0-71.168 27.648-138.24 78.336-188.928z" fill="#AAAAAA" ></path><path d="M75.264 601.6h31.232v281.088s41.984 29.184 141.824 0v-274.944l29.184-2.56v-44.032H75.264v40.448zM906.24 263.168h-29.184l1.024-188.416s-53.76-27.648-144.384 0l1.024 192-31.744 1.024V307.2h203.776l-0.512-44.032z" fill="#AAAAAA" ></path><path d="M934.912 627.712c-9.216-4.608-20.48-2.048-29.184 6.656l-21.504 21.504c-9.216 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l21.504-21.504c8.704-8.704 11.264-19.968 6.656-29.184-5.632-10.752-18.432-15.36-34.304-13.312-25.6 4.096-48.64 15.36-66.56 33.792-27.136 27.136-39.424 65.536-33.792 103.936l-178.176 178.176c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l178.176-178.176c37.888 6.144 76.288-6.656 103.936-33.792 17.92-17.92 29.696-41.472 33.792-66.56 2.048-15.872-2.56-28.672-13.312-34.304z m-9.728 30.72c-3.072 20.48-12.8 38.912-27.136 53.76-23.04 23.04-56.32 33.28-89.088 26.624l-6.144-1.536-186.88 186.88c-8.704 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l186.88-186.88-1.536-6.144c-6.656-32.256 3.072-65.536 26.624-89.088 14.848-14.848 33.28-24.064 53.76-27.136 1.536-0.512 3.072-0.512 4.608-0.512 2.56 0 4.608 0.512 5.12 1.024-0.512 0.512-1.024 1.536-2.048 2.56l-21.504 21.504c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l21.504-21.504c1.024-1.024 2.048-1.536 2.56-2.048 0.512 1.536 1.024 4.608 0.512 9.728z" fill="#72B02D" ></path><path d="M560.64 870.912c-12.8 12.8-12.8 33.28 0 45.568 6.144 6.144 14.336 9.216 23.04 9.216s16.896-3.072 23.04-9.216c6.144-6.144 9.728-14.336 9.728-23.04 0-8.704-3.584-16.896-9.728-23.04-12.8-12.288-33.792-12.288-46.08 0.512z m28.672 28.672c-3.072 3.072-8.704 3.072-11.776 0-3.072-3.072-3.072-8.704 0-11.776 1.536-1.536 3.584-2.56 6.144-2.56 2.048 0 4.096 1.024 6.144 2.56 1.536 1.536 2.56 3.584 2.56 6.144-0.512 2.048-1.536 4.096-3.072 5.632z m225.28-107.008c-4.096-4.096-10.24-4.096-14.336 0l-43.52 43.52c-4.096 4.096-4.096 10.24 0 14.336l102.4 102.4c15.872 15.872 41.984 15.872 57.856 0 15.872-15.872 15.872-41.984 0-57.856l-102.4-102.4z m-237.056-150.528l70.656 70.656 28.672-28.672-70.656-70.656-15.872-30.208-50.688-36.352-28.672 28.672 36.352 50.688 30.208 15.872z" fill="#72B02D" ></path></symbol><symbol id="icon-mojupipei" viewBox="0 0 1024 1024"><path d="M880.64 117.248c32.768 0 58.88 23.04 64.512 54.784l1.024 7.68v663.04c0.512 31.744-22.528 58.368-53.76 62.464l-7.68 1.024H151.552c-34.816 0-66.048-22.528-72.192-53.248l-1.024-6.656V183.296c0-31.744 27.648-59.904 61.952-65.024l7.168-1.024h142.848c24.064 0 44.032 16.896 48.64 39.936l1.024 6.656V406.528c0 7.68 5.12 14.848 12.288 16.896l3.584 0.512H424.96c13.312 0 25.088 9.216 29.184 22.528 6.144 23.552 33.792 46.08 58.368 46.08 22.528 0 48.128-19.456 55.808-39.424l2.048-5.632c2.048-10.24 9.216-18.432 19.456-21.504l5.12-1.024 3.072-0.512h71.168c6.144 0 11.776-3.584 14.336-9.728l1.024-3.584V164.864c0-23.04 15.872-41.984 37.888-46.592l6.144-1.024H880.64zM273.92 184.32H151.552l-2.048 0.512-2.048 0.512-2.56 1.536-1.536 649.728 3.072 1.536 3.072 1.024h1.024l328.192 3.072 2.048-286.72-2.048-0.512-10.24-3.584c-24.576-10.24-45.568-27.136-60.928-49.152l-6.144-9.216 1.024-1.536H349.184c-37.888-4.096-68.608-33.792-74.24-71.68l-1.024-8.192v-4.096V184.32z m476.16-3.072V409.6l-0.512 8.704c-3.584 36.864-32.256 66.56-68.608 72.192l-8.192 1.024h-4.096l-45.568-1.536-6.144 9.728c-14.848 22.528-36.352 40.448-61.44 51.2l-10.752 4.096-3.072 284.16h337.408v-655.36l-129.024-2.56z" fill="#AAAAAA" ></path></symbol><symbol id="icon-buchangshezhi" viewBox="0 0 1024 1024"><path d="M792.576 75.264h-686.08c-17.408 0-31.232 13.824-31.232 31.232v686.08c0 17.408 13.824 31.232 31.232 31.232h436.736c17.408 0 31.232-13.824 31.232-31.232s-13.824-31.232-31.232-31.232H137.728V262.656h624.128v280.576c0 17.408 13.824 31.232 31.232 31.232s31.232-13.824 31.232-31.232V106.496c-0.512-17.408-14.336-31.232-31.744-31.232z" fill="#AAAAAA" ></path><path d="M792.576 948.736c-17.408 0-31.232-13.824-31.232-31.232v-93.696h-93.696c-17.408 0-31.232-13.824-31.232-31.232 0-17.408 13.824-31.232 31.232-31.232h93.696v-93.696c0-17.408 13.824-31.232 31.232-31.232 17.408 0 31.232 13.824 31.232 31.232v93.696h93.696c17.408 0 31.232 13.824 31.232 31.232 0 17.408-13.824 31.232-31.232 31.232h-93.696v93.696c0 17.408-13.824 31.232-31.232 31.232z" fill="#72B02D" ></path><path d="M372.224 518.144l-110.08 110.08c-20.992 20.992-20.992 55.296 0 76.288s55.296 20.992 76.288 0l110.08-110.08c-16.896-6.144-32.768-15.872-46.592-29.696-13.824-13.312-23.552-29.696-29.696-46.592z m-57.856 162.304c-7.68 7.68-20.48 7.68-28.672 0-7.68-7.68-7.68-20.48 0-28.672 7.68-7.68 20.48-7.68 28.672 0 7.68 8.192 7.68 20.992 0 28.672z m340.48-292.864L592.384 450.56c-20.992 20.992-55.296 20.992-76.288 0s-20.992-55.296 0-76.288l62.976-62.976c-51.712-8.704-116.224 14.848-151.552 50.176-49.152 49.152-49.152 128.512 0 177.664s129.024 49.152 177.664 0c35.328-35.328 58.368-99.84 49.664-151.552z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shuchujiagongchengxu" viewBox="0 0 1024 1024"><path d="M876.544 473.6v374.272c0 16.384-13.312 29.696-29.696 29.696h-522.24c-16.384 0-29.696-13.312-29.696-29.696V503.296c0-16.384 13.312-29.696 29.696-29.696h551.936m40.96-70.656H253.952c-16.384 0-29.696 13.312-29.696 29.696v486.4c0 16.384 13.312 29.696 29.696 29.696h663.552c16.384 0 29.696-13.312 29.696-29.696v-486.4c0-16.384-13.312-29.696-29.696-29.696z" fill="#AAAAAA" ></path><path d="M489.984 211.968H814.08l-41.984-41.984c-13.824-13.824-13.824-36.352 0-50.176 13.824-13.824 36.352-13.824 50.176 0L947.712 245.76l-0.512 0.512 0.512 0.512-125.952 125.952c-13.824 13.824-36.352 13.824-50.176 0-13.824-13.824-13.824-36.352 0-50.176l38.912-38.912H489.472c-19.456 0-35.328-15.872-35.328-35.328 0.512-20.48 16.384-36.352 35.84-36.352z" fill="#72B02D" ></path><path d="M531.456 717.824c0-11.776-7.68-22.016-18.944-25.6l-55.808-16.896-14.848-4.608 14.848-4.608 55.808-16.896c11.264-3.584 18.944-13.824 18.944-25.6v-2.048c0-18.432-17.92-31.232-35.328-25.088L363.52 641.024c-10.752 3.584-17.92 13.824-17.92 25.088v8.192c0 11.264 7.168 21.504 17.92 25.088l132.608 45.568c17.408 6.144 35.328-7.168 35.328-25.088v-2.048z m123.392-96.768v2.048c0 11.776 7.68 22.016 18.944 25.6l56.32 16.896 14.848 4.608-14.848 4.608-56.32 16.896c-11.264 3.584-18.944 13.824-18.944 25.6v2.56c0 18.432 17.92 31.232 35.328 25.088l132.608-45.568c10.752-3.584 17.92-13.824 17.92-25.088v-8.192c0-11.264-7.168-21.504-17.92-25.088l-132.608-45.568c-17.408-6.144-35.328 7.168-35.328 25.6z m-54.784-64l-70.144 248.32c-4.608 16.896 8.192 33.792 25.6 33.792 11.776 0 22.528-8.192 25.6-19.456l70.144-248.32c4.608-16.896-8.192-33.792-25.6-33.792-11.776 0-22.016 8.192-25.6 19.456zM147.456 814.08V173.056c0-14.848 11.776-26.624 26.624-26.624h463.872c19.456 0 35.328-15.872 35.328-35.328 0-19.456-15.872-35.328-35.328-35.328H107.008c-16.896 0-30.72 13.824-30.72 30.72v748.032c0 16.896 13.824 30.72 30.72 30.72h40.448c19.456 0 35.328-15.872 35.328-35.328 0.512-19.968-15.36-35.84-35.328-35.84z" fill="#AAAAAA" ></path></symbol><symbol id="icon-guanjiekongzhi" viewBox="0 0 1024 1024"><path d="M648.192 377.344h-71.68c-18.432 0-33.792-14.848-33.792-33.792H366.592c12.288-30.72 25.088-80.896 0-134.656H542.72c0-18.432 15.36-33.792 33.792-33.792h67.584c1.536 0 2.56 0 4.096 0.512L719.36 87.04c10.752-13.312 29.184-16.384 44.032-7.68l168.96 100.864c15.872 9.728 20.992 30.208 11.776 46.08-9.728 15.872-30.208 20.992-46.592 11.264l-143.872-85.504L677.888 245.76v61.44l75.776 93.696 143.872-85.504c15.872-9.728 36.864-4.608 46.592 11.776 9.728 15.872 4.608 36.352-11.264 46.08h-0.512l-168.96 100.864c-14.336 8.704-33.28 5.12-44.032-7.68l-71.168-89.088zM319.488 780.8L102.912 415.744c76.8 69.632 185.344 48.64 231.424-13.312l222.72 378.368H711.68c18.432 0 33.792 14.848 33.792 33.792v100.864c0 18.432-15.36 33.792-33.792 33.792H170.496c-18.432 0-33.792-14.848-33.792-33.792v-100.864c0-18.432 15.36-33.792 33.792-33.792h148.992z" fill="#AAAAAA" ></path><path d="M204.288 148.48C133.12 148.48 75.264 205.824 75.264 276.48S133.12 404.48 204.288 404.48c71.168 0 129.024-57.344 129.024-128S275.456 148.48 204.288 148.48z m0 202.752c-41.472 0-74.752-33.28-74.752-74.752 0-40.96 33.792-74.24 74.752-74.24C245.76 202.24 279.04 235.52 279.04 276.48c0 41.472-33.792 75.264-74.752 74.752z" fill="#72B02D" ></path></symbol><symbol id="icon-jiegoushu" viewBox="0 0 1024 1024"><path d="M233.984 472.064h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44v238.08h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V233.984h-39.936c-22.016 0-39.936-17.92-39.936-39.936V115.2c0-22.016 17.92-39.936 39.936-39.936h158.72c22.016 0 39.936 17.92 39.936 39.936V194.56c0 22.016-17.92 39.936-39.936 39.936h-39.936v237.568z" fill="#AAAAAA" ></path><path d="M551.936 75.264h317.44c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V154.624c-0.512-44.032 35.328-79.36 79.36-79.36z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaitui" viewBox="0 0 1024 1024"><path d="M512 148.992c199.68 0 361.984 162.304 361.984 361.984S711.68 872.448 512 872.448s-361.984-162.304-361.984-361.984S312.32 148.992 512 148.992m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M670.72 456.192v109.056l-75.264-54.784L670.72 456.192m25.6-102.912c-10.24 0-20.992 3.072-30.208 10.24l-144.896 105.472c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-52.224-52.224z" fill="#72B02D" ></path><path d="M499.712 456.192v109.056L424.96 510.976l74.752-54.784m26.112-102.912c-10.24 0-20.992 3.072-30.208 10.24L350.208 468.992c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-51.712-52.224z" fill="#72B02D" ></path><path d="M314.368 381.44c-21.504 0-38.912 17.408-38.912 38.912v181.248c0 21.504 17.408 38.912 38.912 38.912s38.912-17.408 38.912-38.912V420.352c0-21.504-17.408-38.912-38.912-38.912z" fill="#72B02D" ></path></symbol><symbol id="icon-bofang" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M491.008 445.952l115.712 66.048-115.712 66.048V445.952m-23.552-87.04c-24.576 0-46.592 19.456-46.592 46.592v212.48c0 27.136 22.528 46.592 46.592 46.592 7.68 0 15.36-2.048 23.04-6.144l185.856-106.496c31.232-17.92 31.232-62.976 0-80.896L490.496 365.056c-7.168-4.096-15.36-6.144-23.04-6.144z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaijin" viewBox="0 0 1024 1024"><path d="M515.584 151.04c199.168 0 360.96 161.792 360.96 360.96s-161.792 360.96-360.96 360.96-360.96-161.792-360.96-360.96 161.792-360.96 360.96-360.96m0-74.752c-240.64 0-435.712 195.072-435.712 435.712s195.072 435.712 435.712 435.712 435.712-195.072 435.712-435.712-195.072-435.712-435.712-435.712z" fill="#AAAAAA" ></path><path d="M358.912 458.24L433.152 512l-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432L363.52 366.592c-9.216-6.656-19.456-9.728-29.696-9.728z" fill="#72B02D" ></path><path d="M527.36 458.24l74.24 53.76-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432l-142.848-103.936c-9.216-7.168-19.968-10.24-29.696-10.24z" fill="#72B02D" ></path><path d="M710.144 384.512c-20.992 0-38.4 17.408-38.4 38.4v178.688c0 20.992 17.408 38.4 38.4 38.4s38.4-17.408 38.4-38.4V422.912c0-21.504-17.408-38.4-38.4-38.4z" fill="#72B02D" ></path></symbol><symbol id="icon-zanting" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M416.768 353.28c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c-0.512-21.504-17.92-39.424-39.936-39.424z m190.464 0c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c0-21.504-17.92-39.424-39.936-39.424z" fill="#72B02D" ></path></symbol><symbol id="icon-zhongzhi" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M580.096 421.376c12.288 0 22.528 10.24 22.528 22.528v136.192c0 12.288-10.24 22.528-22.528 22.528H443.904c-12.288 0-22.528-10.24-22.528-22.528V443.904c0-12.288 10.24-22.528 22.528-22.528h136.192m0-68.096H443.904C393.728 353.28 353.28 393.728 353.28 443.904v136.192c0 50.176 40.448 90.624 90.624 90.624h136.192c50.176 0 90.624-40.448 90.624-90.624V443.904c0-50.176-40.448-90.624-90.624-90.624z" fill="#72B02D" ></path></symbol><symbol id="icon-suoxiao" viewBox="0 0 1024 1024"><path d="M491.008 463.36c32.256 0 58.88-26.112 58.88-58.88s-26.112-58.88-58.88-58.88H285.696c-32.256 0-58.88 26.112-58.88 58.88s26.112 58.88 58.88 58.88h205.312z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848 13.312 0 26.112-5.12 36.352-14.848 19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangda" viewBox="0 0 1024 1024"><path d="M488.96 333.824h-47.104V286.72c0-34.816-28.16-62.976-62.976-62.976-34.816 0-62.976 28.16-62.976 62.976v47.104h-47.104c-34.816 0-62.976 28.16-62.976 62.976s28.16 62.976 62.976 62.976h47.104V506.88c0 34.816 28.16 62.976 62.976 62.976 34.816 0 62.976-28.16 62.976-62.976v-47.104h47.104c34.816 0 62.976-28.16 62.976-62.976 0-34.304-28.16-62.976-62.976-62.976z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangdazhichuangkou" viewBox="0 0 1024 1024"><path d="M949.248 858.624l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 142.848-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.616-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-96.768 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M216.576 919.04h109.056v-102.912H216.576c-29.696 0-53.76-24.064-53.76-53.76V233.984c0-29.696 24.064-53.76 53.76-53.76H798.72c29.696 0 53.76 24.064 53.76 53.76v81.92h102.912v-81.92c0-86.528-70.144-156.672-156.672-156.672H216.576c-86.528 0-156.672 70.144-156.672 156.672v528.384c0 86.528 70.144 156.672 156.672 156.672z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shiyingpingmu" viewBox="0 0 1024 1024"><path d="M876.032 75.264H147.968c-39.936 0-72.704 32.768-72.704 72.704v728.064c0 39.936 32.768 72.704 72.704 72.704h728.064c39.936 0 72.704-32.768 72.704-72.704V147.968c0-39.936-32.768-72.704-72.704-72.704z m0 764.416c0 22.016-14.336 36.352-36.352 36.352H184.32c-22.016 0-36.352-14.336-36.352-36.352V184.32c0-22.016 14.336-36.352 36.352-36.352h655.36c22.016 0 36.352 14.336 36.352 36.352v655.36z" fill="#AAAAAA" ></path><path d="M329.728 184.32H220.672c-3.584 0-10.752 0-14.336 3.584-7.168 3.584-14.336 10.752-18.432 18.432-3.584 3.584-3.584 10.752-3.584 14.336v109.056c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352v-22.016l47.104 47.104c7.168 7.168 14.336 10.752 25.6 10.752 10.752 0 18.432-3.584 25.6-10.752 14.336-14.336 14.336-36.352 0-51.2l-47.104-47.104h22.016c22.016 0 36.352-14.336 36.352-36.352 0-21.504-14.848-35.84-36.864-35.84zM329.728 766.976h-22.016l47.104-47.104c14.336-14.336 14.336-36.352 0-51.2-14.336-14.336-36.352-14.336-51.2 0l-47.104 47.104v-22.016c0-22.016-14.336-36.352-36.352-36.352s-36.352 14.336-36.352 36.352v109.056c0 3.584 0 10.752 3.584 14.336 3.584 7.168 10.752 14.336 18.432 18.432 3.584 3.584 10.752 3.584 14.336 3.584h109.056c22.016 0 36.352-14.336 36.352-36.352s-13.824-35.84-35.84-35.84zM817.664 187.904c-3.584-3.584-10.752-3.584-14.336-3.584h-109.056c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h22.016l-47.104 47.104c-14.336 14.336-14.336 36.352 0 51.2 7.168 7.168 14.336 10.752 25.6 10.752s18.432-3.584 25.6-10.752l47.104-47.104v22.016c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352V220.672c0-3.584 0-10.752-3.584-14.336-4.096-7.68-11.264-14.848-18.944-18.432zM803.328 657.408c-22.016 0-36.352 14.336-36.352 36.352v22.016l-47.104-47.104c-14.336-14.336-36.352-14.336-51.2 0-14.336 14.336-14.336 36.352 0 51.2l47.104 47.104h-22.016c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h109.056c3.584 0 10.752 0 14.336-3.584 7.168-3.584 14.336-10.752 18.432-18.432 3.584-3.584 3.584-10.752 3.584-14.336v-109.056c0.512-22.016-13.824-36.864-35.84-36.864z" fill="#72B02D" ></path></symbol><symbol id="icon-yangshitu-01" viewBox="0 0 1024 1024"><path d="M645.632 882.688H150.528l252.928-204.8 477.696 0.512z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512z m-542.72 23.552H880.64l-234.496 203.264-228.864 0.512V140.8z m0 247.296l217.088-0.512-1.024 247.296H417.28V388.096z m-43.008-223.744v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m532.48 493.568H150.528l252.928-204.288 477.696 0.512-235.52 203.776z m271.36-247.808h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-zuoshitu-01" viewBox="0 0 1024 1024"><path d="M374.272 644.096l-262.656 211.968L112.64 373.76l261.632-209.408z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM112.64 373.76l261.632-209.408v479.744l-263.168 211.968L112.64 373.76z m520.192 507.904l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-qianshitu-01" viewBox="0 0 1024 1024"><path d="M112.64 389.12h520.704v493.056H112.64z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m259.584 717.824H112.64V389.12h520.704v493.056z m12.288-537.6l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-youshitu-01" viewBox="0 0 1024 1024"><path d="M916.992 659.456l-239.616 196.096V375.808l239.616-208.896z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m270.848 314.88l-239.104 196.096V375.808l239.104-208.896v492.544z" fill="#AAAAAA" ></path></symbol><symbol id="icon-houshitu-01" viewBox="0 0 1024 1024"><path d="M960 118.784V117.76v-1.024-1.024-1.024-0.512-0.512c1.536 7.68-1.024 15.872-6.656 20.992L677.376 373.76v299.52h-43.008V389.12H374.272v254.976l-262.656 211.968L112.64 389.12l261.632-0.512v-42.496h269.824l280.064-243.2c3.072-2.56 6.656-4.096 10.752-5.12H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c-0.512 0.512-0.512 1.024-1.024 2.048 0 0.512 0 0.512-0.512 1.024 0 0.512 0 0.512-0.512 1.024 0 0.512 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V907.264c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024c0 0.512 0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024s0 0.512 0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-242.176 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V658.944v-2.048V118.272c1.536 1.024 1.536 1.024 1.536 0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m258.56 717.312l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m44.544-26.112v-177.664H880.64l-203.264 177.664z m281.6-741.376v-0.512-0.512 1.024z" fill="#AAAAAA" ></path><path d="M916.992 634.88h-239.616V375.808l239.616-211.456zM644.096 346.112H417.28V141.824h462.336zM417.28 389.12H634.88v245.76H417.28z" fill="#72B02D" ></path><path d="M958.976 114.176c0 0.512 0.512 0.512 0 0z m-20.48-16.384H945.152l0.512 0.512 0.512 0.512h1.024l0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512c0 0.512 0.512 0.512 0.512 1.024s0 0.512 0.512 0.512c0 0.512 0.512 1.024 0.512 1.536 0 0.512 0.512 1.024 0.512 1.024-3.072-10.24-13.312-16.896-24.064-14.848h4.608v1.024z" fill="#C1272D" ></path></symbol><symbol id="icon-dingshitu-01" viewBox="0 0 1024 1024"><path d="M880.64 140.8l-234.496 203.776-497.664 1.536 256-206.336z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-497.664 1.536 256-205.824 476.16 1.024-234.496 203.264z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-toushitu-01" viewBox="0 0 1024 1024"><path d="M965.632 114.176V112.64v-1.024-0.512-1.024-0.512s0-0.512-0.512-1.024v-0.512c-0.512-1.024-0.512-2.048-1.024-3.072v-0.512c0-0.512-0.512-0.512-0.512-1.024s0-0.512-0.512-0.512l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512s-0.512-1.024-1.024-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024s-0.512 0-0.512-0.512c0 0-0.512 0-0.512-0.512H950.784h-0.512H392.704c-5.12 0-9.728 1.536-13.312 4.608l-312.32 251.392-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536 0 0 0 0.512-0.512 0.512 0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024c0 0.512 0 0.512-0.512 1.024s0 0.512 0 1.024 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V912.896c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024l0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512 0 0.512 0.512 0.512 1.024 1.024l0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512h583.168c7.68 0 14.848-4.096 18.432-10.752L957.44 675.84l1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V661.504v-1.536V658.432l1.024-544.256zM372.736 343.04l-229.888 0.512L372.736 158.72v184.32z m43.008 43.008l220.672-0.512-0.512 251.392h-220.16v-250.88z m-43.008 0v260.096l-267.264 215.552 1.536-474.624 265.728-1.024z m-227.84 502.272l257.024-208.384h233.984l-0.512 206.848-490.496 1.536z m503.296-545.792l-172.544 0.512H415.232V135.68h471.04l-238.08 206.848z m31.232 337.408h207.36l-207.36 181.248v-181.248z m0-43.008V373.76l243.2-212.48v475.648h-243.2z" fill="#AAAAAA" ></path></symbol><symbol id="icon-a-jixiebi3" viewBox="0 0 1024 1024"><path d="M483.386004 821.695719H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M483.386004 776.399147H164.779715l29.075502 22.648286h260.455285l29.075502-22.648286z" fill="#7A807D" ></path><path d="M483.386004 776.399147H164.779715l29.075502-22.648285h260.455285l29.075502 22.648285z" fill="#3F3F3F" ></path><path d="M483.386004 730.796518H164.779715l29.075502 22.954344h260.455285l29.075502-22.954344zM483.386004 685.499947H164.779715l29.075502 22.648285h260.455285l29.075502-22.648285z" fill="#7A807D" ></path><path d="M483.386004 730.796518H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M150.701051 623.064132h339.418227v62.435815H150.701051z" fill="#F7A53F" ></path><path d="M150.701051 821.695719h339.418227v31.217907H150.701051z" fill="#FFFFFF" ></path><path d="M607.951575 339.654504a74.984189 74.984189 0 0 1-23.872517 103.447575 75.290247 75.290247 0 0 1-103.753633-23.872518L293.324039 120.823095A75.290247 75.290247 0 0 1 317.196557 17.069462a75.290247 75.290247 0 0 1 103.753633 23.872517zM441.762128 517.474152v105.58998H198.752144v-105.58998a122.423166 122.423166 0 1 1 244.846331 0z" fill="#FFC200" ></path><path d="M627.233224 377.605685a103.141517 103.141517 0 0 1-52.948019 82.635637l-165.88339 118.750471-2.448463 1.836347a112.93537 112.93537 0 1 1-112.017197-194.346775l195.571007-84.471985a132.523077 132.523077 0 0 1 48.357151-12.854432A89.062853 89.062853 0 0 1 627.233224 377.605685z" fill="#FFE610" ></path><path d="M401.056425 493.601635a71.005436 71.005436 0 1 1-71.005436-71.311494 71.005436 71.005436 0 0 1 71.005436 71.311494z" fill="#FFFFFF" ></path><path d="M375.34756 493.601635a45.296571 45.296571 0 1 1-45.296571-45.60263 45.296571 45.296571 0 0 1 45.296571 45.60263z" fill="#48B8BF" ></path><path d="M592.342622 376.381453a49.88744 49.88744 0 1 1-49.581382-49.88744 49.88744 49.88744 0 0 1 49.581382 49.88744z" fill="#FFFFFF" ></path><path d="M574.285205 376.381453a30.605791 30.605791 0 1 1-30.605792-30.605791 30.605791 30.605791 0 0 1 30.605792 30.605791z" fill="#48B8BF" ></path><path d="M731.048068 230.789704l165.975207-62.099151 18.883774 50.46895-165.975207 62.068545z" fill="#FFE610" ></path><path d="M734.047436 202.785404l145.836596-54.294674 9.426584 25.31099-145.867202 54.294674z" fill="#F7A53F" ></path><path d="M808.419509 259.161272l23.872517 63.353988 31.523966 35.808776-19.893765 18.057417-48.051092-38.257239-27.851271-63.660046 40.399645-15.302896zM854.940312 242.022029l23.56646 63.04793-0.306058 47.745035 26.627038 0.612116 11.324143-60.293409-20.811938-66.414568-40.399645 15.302896zM716.173654 94.379691l102.345766-38.257239 37.216643 99.468822-102.345767 38.257239z" fill="#7A807D" ></path><path d="M841.473764 83.790087a66.108509 66.108509 0 0 1-65.802452 66.10851l-407.669142 15.608953a67.944857 67.944857 0 0 1-11.324142 0 82.635637 82.635637 0 0 1 0-165.271273 67.944857 67.944857 0 0 1 11.324142 0l407.669142 17.445301A66.108509 66.108509 0 0 1 841.473764 83.790087z" fill="#FFE610" ></path><path d="M402.892773 83.790087a46.520803 46.520803 0 1 1-46.520803-46.214745A46.520803 46.520803 0 0 1 402.892773 83.790087z" fill="#FFFFFF" ></path><path d="M386.059587 83.790087a30.605791 30.605791 0 1 1-30.605791-30.605791 30.605791 30.605791 0 0 1 30.605791 30.605791z" fill="#48B8BF" ></path><path d="M810.867972 83.790087a38.257239 38.257239 0 1 1-39.787528-38.257239A38.257239 38.257239 0 0 1 810.867972 83.790087z" fill="#FFFFFF" ></path><path d="M795.565077 83.790087a24.484633 24.484633 0 1 1-24.484633-24.484633 24.484633 24.484633 0 0 1 24.484633 24.484633z" fill="#48B8BF" ></path><path d="M106.93477 852.913626h639.66104v171.086374H106.93477z" fill="#FFE610" ></path><path d="M383.305066 709.678522h337.275822v207.201208H383.305066z" fill="#4D4D4D" ></path><path d="M407.177584 732.02075h291.061076v161.904636H407.177584z" fill="#FFFFFF" ></path><path d="M429.825869 755.893267h159.150116v16.22107h-159.150116zM429.825869 784.356653h131.604903v16.22107h-131.604903zM429.825869 812.820039h199.855818v16.22107h-199.855818zM429.825869 841.283425h146.601741v16.22107h-146.601741z" fill="#92D5D2" ></path><path d="M507.564579 732.326808l-31.830023 161.904636H407.177584v-161.904636h100.386995z" fill="#F5F5F5" opacity=".5" ></path><path d="M474.816383 916.87973h155.783478v31.830023h-155.783478z" fill="#7A807D" ></path><path d="M106.93477 977.173139h639.66104v46.826861H106.93477z" fill="#F7A53F" ></path><path d="M252.006221 899.740487h66.414567v48.969266H252.006221z" fill="#7A807D" ></path><path d="M319.64502 817.716966l-3.672695 11.324143-21.730112 70.699378h-21.730112l23.872518-76.820537 3.366637-11.324143 19.893764 6.121159z" fill="#999999" ></path><path d="M341.069074 809.147344A28.463386 28.463386 0 1 1 321.17531 773.950684a28.463386 28.463386 0 0 1 19.893764 35.19666z" fill="#48B8BF" ></path><path d="M322.705599 793.538391a13.16049 13.16049 0 1 1-26.014923 0 13.16049 13.16049 0 0 1 26.014923 0z" fill="#FFFFFF" ></path><path d="M165.085773 899.740487h66.414568v49.275324H165.085773z" fill="#7A807D" ></path><path d="M163.861542 817.716966l3.366637 11.324143 22.03617 70.699378h21.730111l-23.872517-76.820537-3.672695-11.324143-19.587706 6.121159z" fill="#999999" ></path><path d="M142.437488 809.147344a28.157328 28.157328 0 1 0 18.669532-35.19666 28.157328 28.157328 0 0 0-18.669532 35.19666z" fill="#F7A53F" ></path><path d="M160.800963 793.538391a13.16049 13.16049 0 1 0 12.854432-12.854433 12.854432 12.854432 0 0 0-12.854432 12.854433z" fill="#FFFFFF" ></path></symbol><symbol id="icon-jixiebi2" viewBox="0 0 1164 1024"><path d="M848.55632 485.108049h233.370249v430.146938h-233.370249z" fill="#FFE610" ></path><path d="M974.217224 605.245396h154.314351v64.211341h-154.314351zM974.217224 689.82485h154.314351v64.211341h-154.314351zM974.217224 774.749527h154.314351v64.211341h-154.314351z" fill="#54D9D9" ></path><path d="M306.557369 245.869021l99.078789 31.760448 69.389675 22.094225 145.683794 46.259783 69.734897 22.094225 119.101681 37.974449 66.627896 21.058558 1.035667-2.761778 21.749003-69.044453 23.129891-72.151453-22.784669-7.249667-79.746343-25.201225-20.368113-6.559223-337.972595-107.364124-21.40378-6.904445-87.686455-27.617781-45.224116 142.576794-0.345222 1.035667z" fill="#FFE610" ></path><path d="M412.33347 357.755556l10.70189-33.555604 441.470229 140.401894-10.667368 33.555604z" fill="#A3A3A3" ></path><path d="M380.331366 357.686512l25.408359-79.953476 69.424197 22.094225-25.408359 79.918953zM595.508402 425.626253l25.408359-79.953476 69.389674 22.059703-25.373836 79.953476z" fill="#3F3F3F" ></path><path d="M809.200982 411.575707a144.302906 144.302906 0 0 0 4.833112 37.284004 138.088905 138.088905 0 0 0 18.987224 43.152783 144.302906 144.302906 0 0 0 15.535002 19.677669 146.719461 146.719461 0 0 0 256.154919-100.114456 144.648128 144.648128 0 0 0-34.522226-94.5909 180.206021 180.206021 0 0 0-15.880224-16.570668 146.719461 146.719461 0 0 0-96.317012-34.522227 148.445573 148.445573 0 0 0-58.687784 10.356668 146.719461 146.719461 0 0 0-89.757788 129.803571 34.522226 34.522226 0 0 0-0.345223 5.523556z" fill="#FFC200" ></path><path d="M876.174101 411.575707A80.091565 80.091565 0 1 0 956.265666 331.484142a80.091565 80.091565 0 0 0-80.091565 80.091565z" fill="#FFFFFF" ></path><path d="M904.827549 411.575707a51.438117 51.438117 0 1 0 51.438117-51.092895 51.438117 51.438117 0 0 0-51.438117 51.092895z" fill="#54D9D9" ></path><path d="M218.076903 216.594173l37.007826-117.202958 88.894733 28.06657L306.902591 244.660743zM86.512699 119.345062l92.450522-16.467102 19.401491 108.745013-92.450522 16.467102z" fill="#8A8A8A" ></path><path d="M0 65.317778l45.224116 254.083585 21.058558-3.797445 31.415226-5.523556 22.094225-4.142667-13.808891-77.675009-19.332446-109.090235-12.082779-67.318341-14.499335 2.761778-21.403781 3.797445-38.664893 6.904445z" fill="#292929" ></path><path d="M95.626567 436.43171l16.570668-3.107-14.499335-123.244348-31.415226 5.523556 29.343893 120.827792z" fill="#7A807D" ></path><path d="M138.088905 153.349455a80.782009 80.782009 0 0 0 31.070003 63.520896 79.40112 79.40112 0 0 0 49.021562 16.915891 75.258453 75.258453 0 0 0 32.10567-6.904445 80.091565 80.091565 0 0 0 48.331117-73.532342 78.710676 78.710676 0 0 0-13.808891-44.18845 76.984564 76.984564 0 0 0-31.760448-27.617781l-7.59489-3.452222a83.543787 83.543787 0 0 0-12.428001-3.452223H217.835247A80.091565 80.091565 0 0 0 138.088905 153.349455z" fill="#FFC200" ></path><path d="M167.087575 153.694677A51.092895 51.092895 0 1 0 217.835247 103.637449a50.747673 50.747673 0 0 0-50.747672 50.057228z" fill="#FFFFFF" ></path><path d="M185.384355 153.694677a32.450893 32.450893 0 1 0 32.450892-34.522226 32.450893 32.450893 0 0 0-32.450892 34.522226z" fill="#54D9D9" ></path><path d="M38.664893 58.413333l21.403781-3.797445C66.627897 19.74844 108.745013 11.117883 141.88635 14.915328a89.757788 89.757788 0 0 1 81.472454 58.687784h9.321001a83.543787 83.543787 0 0 1 12.428001 3.452223l7.59489 3.452223c53.854673-42.807561 165.016241-17.951558 187.110466 48.331116l21.40378 6.904446C439.813162 59.449 307.593036 24.581551 241.655583 69.115223a113.923346 113.923346 0 0 0-108.745012-69.044452C90.793455 0.070771 41.081449 10.772661 38.664893 58.413333zM799.189537 244.14291l20.368113 6.559223a345.222262 345.222262 0 0 0 89.412566-34.522226c48.331117-22.784669 133.601015-34.522226 144.99335 34.522226a114.613791 114.613791 0 0 1 0 48.676339 180.206021 180.206021 0 0 1 15.880224 16.570668c15.880224-50.057228 3.797445-107.364124-54.545117-124.280014-83.198565-22.439447-141.541127 45.569339-216.109136 52.473784z" fill="#3F3F3F" ></path><path d="M44.18845 731.251522a105.638012 105.638012 0 0 0 105.638012 105.638012h698.729858v-31.415226H149.826462a74.222786 74.222786 0 0 1 0-148.445573h698.729858v-31.415225H149.826462a105.638012 105.638012 0 0 0-105.638012 105.638012z" fill="#8A8A8A" ></path><path d="M75.603675 731.251522a74.222786 74.222786 0 0 0 74.222787 74.222786h698.729858V655.993069H149.826462a74.222786 74.222786 0 0 0-74.222787 75.258453z" fill="#FFE610" ></path><path d="M103.566679 731.251522a51.092895 51.092895 0 1 0 50.747672-50.747673A50.747673 50.747673 0 0 0 103.566679 731.251522z" fill="#FFFFFF" ></path><path d="M121.863459 731.251522a32.450893 32.450893 0 1 0 32.450892-32.450893 32.450893 32.450893 0 0 0-32.450892 32.450893zM290.331922 731.251522a34.522226 34.522226 0 0 0 34.522227 34.522226h414.266714a34.522226 34.522226 0 0 0 34.522226-34.522226 34.522226 34.522226 0 0 0-34.522226-34.522226h-414.266714a34.522226 34.522226 0 0 0-34.522227 34.522226z" fill="#54D9D9" ></path><path d="M827.15254 877.625761h276.523032v61.794785h-276.523032z" fill="#F7A53F" ></path><path d="M839.925764 939.765768h250.976584v31.070004h-250.976584z" fill="#707070" ></path><path d="M747.75142 657.028735v148.445573h43.152783v31.415226h57.652117v-211.276024h-57.652117v31.415225h-43.152783z" fill="#B3B3B3" opacity=".76" ></path><path d="M14.499335 970.490549h1149.590133v53.509451H14.499335z" fill="#B86805" ></path><path d="M154.314351 836.889534H272.725587v133.601015H154.314351zM614.150404 836.889534h118.411236v133.601015h-118.411236z" fill="#F7A53F" ></path><path d="M614.150404 836.889534h118.411236v78.365453h-118.411236zM154.314351 836.889534H272.725587v78.365453H154.314351z" fill="#B3B3B3" opacity=".76" ></path></symbol><symbol id="icon-jixiebi4" viewBox="0 0 1123 1024"><path d="M502.569098 505.335276h543.234824v85.15391H502.569098z" fill="#FFE610" ></path><path d="M483.047648 203.089382a81.451566 81.451566 0 0 1-41.06236 73.373725l-302.919047 173.33701a82.124719 82.124719 0 0 1-81.788143-143.045105l302.919047-173.33701a82.124719 82.124719 0 0 1 83.807603 0 79.768682 79.768682 0 0 1 27.935868 28.945597A77.412645 77.412645 0 0 1 483.047648 203.089382z" fill="#FFC200" ></path><path d="M39.776109 803.542249h1082.094151v220.121174H39.776109z" fill="#FFE610" ></path><path d="M39.776109 971.830609h1082.094151v52.169391H39.776109zM466.218812 723.43699v146.747449H219.844654v-146.747449a123.187079 123.187079 0 0 1 246.374158 0z" fill="#FFC200" ></path><path d="M396.210854 790.415757a100.973016 100.973016 0 0 1-141.698798-23.896947l-235.603704-331.864645a100.973016 100.973016 0 0 1 23.896947-141.362222 100.973016 100.973016 0 0 1 141.698799 23.896947l235.603703 331.528068a100.973016 100.973016 0 0 1-24.233523 141.698799z" fill="#FFE610" ></path><path d="M146.470929 451.146424a86.16364 86.16364 0 1 1 29.282174-118.138428 86.16364 86.16364 0 0 1-29.282174 118.138428z" fill="#B8B8B8" ></path><path d="M131.661553 424.556864a56.881466 56.881466 0 1 1 19.52145-78.085799 56.544889 56.544889 0 0 1-19.52145 78.085799z" fill="#B8B8B8" ></path><path d="M120.554522 405.035414a35.677132 35.677132 0 0 1-36.686863-60.920386A35.677132 35.677132 0 1 1 120.554522 405.035414z" fill="#FFFFFF" ></path><path d="M370.9676 757.767815a56.881466 56.881466 0 1 1 19.184873-78.085798 56.881466 56.881466 0 0 1-19.184873 78.085798z" fill="#B8B8B8" ></path><path d="M358.850839 739.592672a35.677132 35.677132 0 1 1 12.116761-48.803624 35.677132 35.677132 0 0 1-12.116761 48.803624z" fill="#FFFFFF" ></path><path d="M423.136992 384.167657l-112.416624 66.305614-32.984519-55.871735 112.753201-65.969037 9.760725 16.492259 13.463069 22.887217 9.424148 16.155682z" fill="#8A8A8A" ></path><path d="M400.18246 345.023785l70.512822-41.398937 13.463069 22.887217-70.512823 41.432594z" fill="#C4C4C4" ></path><path d="M489.442606 313.823123a21.877487 21.877487 0 0 1-11.780186 27.935868 21.54091 21.54091 0 0 1-27.935867-12.116762l-29.955328-73.373725a21.54091 21.54091 0 0 1 12.116762-27.935868 21.204333 21.204333 0 0 1 27.599291 11.780186z" fill="#F7A53F" ></path><path d="M482.037918 318.19862a12.453339 12.453339 0 0 1-9.424148 14.809376 12.789915 12.789915 0 0 1-14.809376-9.424148 12.789915 12.789915 0 0 1 9.424148-14.809376 12.453339 12.453339 0 0 1 14.809376 9.424148z" fill="#707070" ></path><path d="M303.652257 388.543155a24.5701 24.5701 0 0 0-7.404688 8.077841l-24.906677 45.10128 32.311365 44.764704 36.350285-65.63246a24.906677 24.906677 0 0 0-36.013709-33.657672z m12.453338 6.394957a14.472799 14.472799 0 0 1 16.155683 12.116762 14.136222 14.136222 0 0 1-12.116762 16.155683 13.799645 13.799645 0 0 1-16.155683-11.780185 14.136222 14.136222 0 0 1 13.463069-16.49226z" fill="#B86805" ></path><path d="M305.33514 411.430372a13.799645 13.799645 0 0 0 16.155683 11.780185 14.136222 14.136222 0 0 0 12.116762-16.155683 14.472799 14.472799 0 0 0-16.155683-12.116762 14.136222 14.136222 0 0 0-12.116762 16.49226z" fill="#5E5E5E" ></path><path d="M625.4196 163.709906l-19.858026 12.116762-37.360016 22.55064-19.858027 12.116762-20.867756-34.667402-40.389207-66.64219-19.184872-31.301635 9.424148-5.721804 58.227772-35.340556 9.424148-5.385227 80.441836 132.27465z" fill="#8A8A8A" ></path><path d="M568.066927 198.276335l37.124412-22.516982 36.484917 60.14626-37.15807 22.55064z" fill="#4D4D4D" ></path><path d="M931.031261 336.373763l-85.15391 217.765137h-128.572307l-46.447587-118.811581-30.965058-79.768683-7.404688-19.184873 46.111011-46.447587h205.648375l46.784164 46.447587z" fill="#AEBABD" ></path><path d="M744.668732 483.861681l105.954351-43.182793 2.423352 5.890093-105.988009 43.182793zM840.8287 361.953594l-120.157889-26.252984 1.682884-6.058381 119.821312 26.252984-1.346307 6.058381zM683.916634 363.838423l6.125696-1.851172 32.984518 109.252803-6.159353 1.851172z" fill="#6A5060" ></path><path d="M880.544753 403.015954a49.813354 49.813354 0 1 1-49.813354-49.813355 50.149931 50.149931 0 0 1 49.813354 49.813355zM746.923796 359.597557a33.657672 33.657672 0 1 1-33.657672-33.657672 33.657672 33.657672 0 0 1 33.657672 33.657672zM767.454975 465.282647a26.589561 26.589561 0 0 1-26.58956 26.252984A26.252984 26.252984 0 0 1 741.201991 438.693086a26.589561 26.589561 0 0 1 26.252984 26.589561z" fill="#FFFFFF" ></path><path d="M846.887081 403.015954a16.155683 16.155683 0 1 1-16.155682-16.155683 16.155683 16.155683 0 0 1 16.155682 16.155683zM724.709732 359.597557a10.097302 10.097302 0 0 1-10.097302 9.760725 9.760725 9.760725 0 1 1 0-19.52145 10.097302 10.097302 0 0 1 10.097302 9.760725zM748.943256 465.282647A7.741265 7.741265 0 0 1 741.201991 472.350758a8.077841 8.077841 0 0 1-8.077841-8.077842 8.077841 8.077841 0 0 1 8.077841-8.077841 8.077841 8.077841 0 0 1 7.741265 9.087572z" fill="#788B90" opacity=".37" ></path><path d="M698.456748 219.581642h166.268899v46.11101h-166.268899z" fill="#F7A53F" ></path><path d="M702.159092 223.620562h5.048651v38.03317h-5.048651zM711.246663 223.620562h5.048651v38.03317h-5.048651zM720.334235 223.620562h5.048651v38.03317h-5.048651zM729.421806 223.620562h5.048651v38.03317h-5.048651zM738.509378 223.620562h5.04865v38.03317h-5.04865zM747.596949 223.620562h5.048651v38.03317h-5.048651zM756.68452 223.620562h5.048651v38.03317h-5.048651zM765.772092 223.620562h5.048651v38.03317h-5.048651zM774.859663 223.620562h5.048651v38.03317H774.859663zM783.610658 223.620562h5.048651v38.03317h-5.048651zM792.698229 223.620562h5.048651v38.03317h-5.048651zM801.785801 223.620562h5.04865v38.03317h-5.04865zM810.873372 223.620562h5.048651v38.03317h-5.048651zM819.960944 223.620562h5.04865v38.03317h-5.04865zM829.048515 223.620562h5.048651v38.03317h-5.048651zM838.136086 223.620562h5.048651v38.03317h-5.048651zM847.223658 223.620562h5.048651v38.03317h-5.048651zM856.311229 223.620562h5.048651v38.03317h-5.048651z" fill="#788B90" opacity=".38" ></path><path d="M738.845954 265.692652h85.490487v23.896947h-85.490487z" fill="#707070" ></path><path d="M735.816764 288.916446h-1.682884L640.228976 355.558636l-39.0429 26.926138-4.712074 3.365767-16.492259-23.896947a25.916407 25.916407 0 0 1 6.731534-36.013709l97.270672-67.315344a25.916407 25.916407 0 0 1 36.013709 6.731534z" fill="#58BFD2" ></path><path d="M670.857457 435.327319h-33.657672a12.116762 12.116762 0 0 1-10.433878-8.414418l-24.906677-44.428127 39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M827.365631 288.916446h1.682884l94.241481 65.63246 39.0429 26.926138 4.712074 3.365767 16.492259-23.896947a25.916407 25.916407 0 0 0-6.731534-35.003979l-97.270672-67.315344a25.916407 25.916407 0 0 0-36.013709 6.731534z" fill="#58BFD2" ></path><path d="M892.324938 435.327319h33.657672a12.116762 12.116762 0 0 0 10.433878-8.414418l24.906677-44.428127-39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M738.845954 265.692652h85.490487v12.116762h-85.490487zM922.95342 355.558636l-31.301635 79.768683-46.447588 118.811581 49.140201-194.541343-70.007957-69.671381h4.038921l94.578058 65.63246z" fill="#848484" opacity=".25" ></path><path d="M661.433309 321.900964l-48.467048-67.988497 21.204334-12.789915 38.033169 74.383455-10.770455 6.394957z" fill="#7A807D" ></path><path d="M535.553616 36.820483l-58.227772 33.657672-11.780186-19.184873A33.657672 33.657672 0 0 1 502.905674 1.143351a33.657672 33.657672 0 0 1 21.204334 15.482529z" fill="#F7A53F" ></path><path d="M527.475775 175.826668L483.047648 203.089382A77.412645 77.412645 0 0 0 471.940616 164.046483a79.768682 79.768682 0 0 0-27.599291-28.272444l42.745243-25.916408zM527.475775 175.826668l-40.389207-66.64219 40.389207 66.64219z" fill="#C4C4C4" ></path><path d="M956.274515 854.028757H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M650.999431 304.062398l-70.007958 14.809376 69.671381 8.414418-4.712074 38.033169 25.243254-25.243254 22.887217 25.243254-3.702344-36.350286 35.003979-1.682883-31.974789-19.52145 14.809376-35.677132-33.657672 24.906677-26.252984-43.754973 2.692614 50.823084z" fill="#FFFFFF" ></path><path d="M956.274515 803.542249H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 803.542249H600.512923l32.311365-25.579831h290.802285l32.647942 25.579831z" fill="#999999" ></path><path d="M956.274515 752.719165H600.512923l32.311365 25.243253h290.802285l32.647942-25.243253zM956.274515 702.232657H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 752.719165H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M584.693817 632.561276h378.985386v69.671381H584.693817zM584.693817 854.028757h378.985386v34.667402H584.693817z" fill="#FFC200" ></path><path d="M502.569098 590.489186h543.234824v42.07209H502.569098z" fill="#F7A53F" ></path><path d="M273.696929 882.637778h80.441836v59.574079H273.696929z" fill="#7A807D" ></path><path d="M355.821648 783.011069l-4.375497 13.799646-26.589561 85.827063h-26.252984l28.945598-93.231751 4.375497-13.799646 23.896947 7.404688z" fill="#999999" ></path><path d="M381.738055 772.913768a33.657672 33.657672 0 1 1-22.55064-43.08182 33.657672 33.657672 0 0 1 22.55064 43.08182z" fill="#F7A53F" ></path><path d="M359.523992 753.728895a15.819106 15.819106 0 1 1-15.819106-15.819106 15.819106 15.819106 0 0 1 15.819106 15.819106z" fill="#FFFFFF" ></path><path d="M168.348416 882.637778h80.441835v59.574079H168.348416z" fill="#7A807D" ></path><path d="M166.665532 783.011069l4.375497 13.799646 26.589561 85.827063h26.252984l-28.945598-93.231751-4.03892-13.799646-24.233524 7.404688z" fill="#999999" ></path><path d="M140.749125 772.913768a33.657672 33.657672 0 1 0 67.315343-20.53118 33.657672 33.657672 0 0 0-43.08182-22.55064 33.657672 33.657672 0 0 0-24.233523 43.08182z" fill="#68FF4B" ></path><path d="M162.963188 753.728895a15.819106 15.819106 0 1 0 15.819106-15.819106 15.819106 15.819106 0 0 0-15.819106 15.819106z" fill="#FFFFFF" ></path></symbol></svg>',(r=>{var e=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var n,i,s,a,o,l=function(u,d){d.parentNode.insertBefore(u,d)};if(e&&!r.__iconfont__svg__cssinject__){r.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(u){console&&console.log(u)}}n=function(){var u,d=document.createElement("div");d.innerHTML=r._iconfont_svg_string_4634042,(d=d.getElementsByTagName("svg")[0])&&(d.setAttribute("aria-hidden","true"),d.style.position="absolute",d.style.width=0,d.style.height=0,d.style.overflow="hidden",d=d,(u=document.body).firstChild?l(d,u.firstChild):u.appendChild(d))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(s=n,a=r.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,s())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Qu=fe.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(r){this.selectArray=r},setSelectString(r){this.selectString=r}}}),X3={class:"calculator-content"},q3={class:"calculator-child"},j3={class:"calculator-child"},Y3=K.defineComponent({__name:"calculator",setup(r){const e=K.ref(),t=K.ref();return K.onMounted(()=>{e.value=[{type:"Upload",label:"输入",name:"input"}],t.value=[{type:"Upload",label:"输出",name:"output"}]}),(n,i)=>(K.openBlock(),K.createElementBlock("div",X3,[K.createElementVNode("div",q3,[K.createVNode(jn.ssForm,{rowContents:e.value,isRowFlex:!0},null,8,["rowContents"])]),K.createElementVNode("div",j3,[K.createVNode(jn.ssForm,{rowContents:t.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),$3=Sl._export_sfc(Y3,[["__scopeId","data-v-73db0fe7"]]),ed=fe.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(r){this.selectIndex=r},setSelectMenu(r){this.selectMenu=r},setSelectTitle(r){this.selectTitle=r}}}),td=(r,e)=>{let t=r,n=e;return Array.isArray(t)&&(t=t==null?void 0:t.map((i,s)=>{if(Array.isArray(i)){let a={};return i=i==null?void 0:i.forEach((o,l)=>{var c;(c=n==null?void 0:n[l])!=null&&c.prop?a[n[l].prop]=o:Array.isArray(o)&&(a.children=td(o,n))}),Object.assign(a,{id:s})}else return i})),t},nd=(r,e,t)=>{let n=r,i=e;return n=n==null?void 0:n.map((s,a)=>{var o,l;return!Array.isArray(s)||!((o=i==null?void 0:i[a])!=null&&o.label)&&!t||(s.unshift(((l=i==null?void 0:i[a])==null?void 0:l.label)??""),s.some(c=>Array.isArray(c))&&(s=s==null?void 0:s.map(c=>{var h;return Array.isArray(c)&&(c=nd(c,(h=i==null?void 0:i[a])==null?void 0:h.children,t)),c}))),s}),n},J3=(r,e,t)=>{if(e==="")return r==null?void 0:r.filter(n=>(n==null?void 0:n.id)!==t);{const n=e.split("-");return K3(r,n,t)}},K3=(r,e,t)=>{let n=r,i=e;return(i==null?void 0:i.length)===0?n=n==null?void 0:n.filter(s=>s.id!==t):n=n==null?void 0:n.map(s=>(s.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),s=id(s,i,t)),s)),n},id=(r,e,t)=>{var s,a;let n=r,i=e;return(i==null?void 0:i.length)===0?n.children=(s=n.children)==null?void 0:s.filter(o=>o.id!==t):n.children=(a=n.children)==null?void 0:a.map(o=>(o.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),o=id(o,i,t)),o)),n},Z3=(r,e,t)=>{if(e==="")return t;{const n=e.split("-");return Q3(r,n,t)}},Q3=(r,e,t)=>{let n=r,i=e;return(i==null?void 0:i.length)===0?n=t:n=n==null?void 0:n.map(s=>(s.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),s=rd(s,i,t)),s)),n},rd=(r,e,t)=>{var s;let n=r,i=e;return(i==null?void 0:i.length)===0?n.children=t:n.children=(s=n.children)==null?void 0:s.map(a=>(a.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),a=rd(a,i,t)),a)),n},Ma=(r,e)=>r==null?void 0:r.map(n=>{var i,s,a,o,l,c;if(Array.isArray(n)?n=n:n=[n],(i=n==null?void 0:n.filter(h=>!(h!=null&&h.id)||typeof(h==null?void 0:h.id)=="string"))!=null&&i.every(h=>typeof h!="object"||h===null))return n;if((s=n==null?void 0:n.filter(h=>!(h!=null&&h.id)||typeof(h==null?void 0:h.id)=="string"))!=null&&s.some(h=>Array.isArray(h)))return n;{let h=[];if(h.push(n==null?void 0:n.find(u=>(u==null?void 0:u.id)&&typeof(u==null?void 0:u.id)=="number")),Array.isArray(e==null?void 0:e[0])){const u=(a=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:a[0];(o=Ln.getColumnChild(fe.cloneDeep(e==null?void 0:e[0])))==null||o.forEach(d=>{h.push(u==null?void 0:u[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}else{const u=(l=n==null?void 0:n.filter(d=>!(d!=null&&d.id)||typeof(d==null?void 0:d.id)=="string"))==null?void 0:l[0];(c=Ln.getColumnChild(fe.cloneDeep(e)))==null||c.forEach(d=>{h.push(u==null?void 0:u[(d==null?void 0:d.prop)??(d==null?void 0:d.label)??d])})}return h}}),e_=r=>{try{return JSON.parse(r),!0}catch{return!1}},Qh=(r,e)=>su(r,e),Yi=r=>{let e=[];function t(i){Array.isArray(i)&&(i==null||i.forEach(s=>{Array.isArray(s)||(s=[s]),s==null||s.forEach(a=>{!(a!=null&&a.children)||a.children.length===0?e.push(a.label):n(a.children)})}))}function n(i){i==null||i.forEach(s=>{!(s!=null&&s.children)||s.children.length===0?e.push(s.label):n(s.children)})}return t(r),e},t_=(r,e,t)=>{var i;let n=(i=fe.cloneDeep(r))==null?void 0:i.map(s=>(s=s.filter(a=>!(a!=null&&a.id)),s));return n=n==null?void 0:n.map(s=>{var a;return s=(a=s.map((o,l)=>{let c={};if(t!=null&&t.find(h=>h===e[l]))return c[e[l]]=o,c}))==null?void 0:a.filter(o=>o),s}),n},n_=(r,e)=>{var a,o;const t=fe.cloneDeep(r),n=(a=t==null?void 0:t.find(l=>(l==null?void 0:l.key)==="header"))==null?void 0:a.contents,i=(o=t==null?void 0:t.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:o.contents;return t_(i,Yi(n).slice(0,Yi(n).length-1),e)},i_=r=>{let e={};return r==null||r.forEach(t=>{e[t.key]=t.value}),e},r_=r=>{var t;let e=[];return(t=fe.cloneDeep(r))==null||t.forEach(n=>{let i={};n==null||n.forEach(s=>{i[Object.keys(s)[0]]=Object.values(s)[0]}),e.push(i)}),e},s_=(r,e)=>{if(e!=null&&e[r])return e==null?void 0:e[r]},a_=async(r,e)=>{var o,l,c;if(!(r!=null&&r.extra))return;let t=(o=r==null?void 0:r.extra)==null?void 0:o.tableId,n=r==null?void 0:r.contents;const s=(c=(await fe.getInsofDataApi({key:{type:"data",pageKey:(l=r==null?void 0:r.extra)==null?void 0:l.pageKey,tableId:t,systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:c.map(h=>h==null?void 0:h.id);s&&(s==null?void 0:s.length)>0&&await fe.batchDeleteInsofDataApi({ids:s});let a=[];n==null||n.forEach(h=>{var d,f;let u={};(d=Object.keys(h))==null||d.forEach(m=>{e!=null&&e.find(_=>(_==null?void 0:_.label.toUpperCase())===m.toUpperCase())&&(u[e.find(_=>_.label.toUpperCase()===m.toUpperCase()).label]=h[m])}),a.push({key:{type:"data",pageKey:(f=r==null?void 0:r.extra)==null?void 0:f.pageKey,tableId:t,systemKey:sessionStorage.getItem("systemKey")},value:{tableData:u}})}),(a==null?void 0:a.length)>0&&await fe.batchAddInsofDataApi({dataList:a})},o_=(r,e)=>{var s;let t=fe.cloneDeep(r),n=!1,i=Object.keys(e);return(s=t.compData)==null||s.forEach(a=>{var o;Array.isArray(a==null?void 0:a.contents)&&((o=a==null?void 0:a.contents)==null||o.forEach(l=>{n=i.includes(l.key)}))}),n},l_=(r,e)=>{var i;let t=fe.cloneDeep(r);return o_(fe.cloneDeep(t),e)&&(t.compData=(i=t.compData)==null?void 0:i.map(s=>{var a;return(s==null?void 0:s.key)==="formContent"&&(s.contents=(a=s==null?void 0:s.contents)==null?void 0:a.map(o=>(Object.keys(e).includes(o.key)&&(o.value=e[o.key]),o))),s})),t},c_=r=>{let e=fe.cloneDeep(r);return e==null||e.forEach(t=>{let n={};for(let i in t)n[i.toUpperCase()]=t[i]}),e},h_=async r=>{var a,o,l,c,h;let e=(o=(a=r==null?void 0:r[0])==null?void 0:a.find(u=>u==null?void 0:u.id))==null?void 0:o.id;const t=await fe.getInsofDataApi({id:e});let n=await((h=(c=(l=t==null?void 0:t.data)==null?void 0:l.result)==null?void 0:c[0])==null?void 0:h.key),i=n==null?void 0:n.pageKey,s=n==null?void 0:n.tableId;return{pageKey:i,tableId:s}},u_=async r=>{let e={comp:r==null?void 0:r.comp,compData:r==null?void 0:r.compData,name:r==null?void 0:r.name};await fe.updateInsofDataApi({id:r==null?void 0:r.id,value:{pageData:e}})},d_=async r=>{let e=r==null?void 0:r.map(async t=>{var i,s,a;let n;return(t==null?void 0:t.comp)==="Form"?n=await u_(t):(t==null?void 0:t.comp)==="Table"&&(n=await a_((i=t==null?void 0:t.compData)==null?void 0:i.find(o=>(o==null?void 0:o.key)==="tableContents"),(a=(s=t==null?void 0:t.compData)==null?void 0:s.find(o=>(o==null?void 0:o.key)==="header"))==null?void 0:a.contents)),n});await Promise.all(e)},f_=r=>{var i,s,a,o;const e=r;let t=[];e.compData=(i=e.compData)==null?void 0:i.filter(l=>(l==null?void 0:l.key)!=="tableContents"&&(l==null?void 0:l.key)!=="tableIndex");const n=(a=(s=fe.cloneDeep(e.compData))==null?void 0:s.find(l=>(l==null?void 0:l.key)==="tableIndexColumn"))==null?void 0:a.contents;return(o=fe.cloneDeep(e.compData))==null||o.forEach(l=>{if((l==null?void 0:l.key)!=="tableIndexColumn"&&(l==null?void 0:l.key)!=="header")t.push(l);else if((l==null?void 0:l.key)==="header"){let c=l.contents;n&&(c!=null&&c.every(h=>Array.isArray(h))?c==null||c[0].unshift({label:n}):c.unshift({label:n})),t.push({key:"header",contents:c})}}),e.compData=t,e},p_=r=>{var s,a,o,l,c;const e=(s=r.compData)==null?void 0:s.filter(h=>(h==null?void 0:h.key)==="tableContents"||(h==null?void 0:h.key)==="tableIndex"),t=(o=(a=e==null?void 0:e.find(h=>(h==null?void 0:h.key)==="tableIndex"))==null?void 0:a.contents)==null?void 0:o.map(h=>h.label),n=(l=e==null?void 0:e.find(h=>(h==null?void 0:h.key)==="tableContents"))==null?void 0:l.contents;let i=[];return(t==null?void 0:t.length)>0&&(n!=null&&n.every(h=>Array.isArray(h)))?i=t==null?void 0:t.map((h,u)=>n[u]?[h,...n[u]]:[h]):Array.isArray(n==null?void 0:n[0])&&((c=n==null?void 0:n[0])!=null&&c.every(h=>Array.isArray(h)))?i=n==null?void 0:n[0]:Array.isArray(n==null?void 0:n[0])?i=n:i.push(n),i},m_=r=>{const e=[];function t(n){!n||n.length===0||(e.push(n==null?void 0:n.map(i=>({label:i.label}))),n==null||n.forEach(i=>{i!=null&&i.children&&(i==null?void 0:i.children.length)>0&&t(i==null?void 0:i.children)}))}return t(r),e},g_=r=>{const e=[];function t(n,i=[]){!n||n.length===0||(e.push({key:i==null?void 0:i.filter(s=>!Array.isArray(s)),value:n}),n==null||n.forEach(s=>{s!=null&&s.some(a=>Array.isArray(a))&&t(s.find(a=>Array.isArray(a)),s)}))}return t(r),e},__=r=>{const e=[];function t(n){!n||n.length===0||(e.push(n==null?void 0:n.map(i=>i==null?void 0:i.filter(s=>!Array.isArray(s)))),n==null||n.forEach(i=>{i!=null&&i.some(s=>Array.isArray(s))&&t(i.find(s=>Array.isArray(s)))}))}return t(r),e},v_=r=>{const e=[];function t(n){var i;!n||n.length===0||(n!=null&&n.every(s=>!Array.isArray(s))?e.push(n):(e.push((i=n==null?void 0:n.map(s=>s==null?void 0:s.filter(a=>!Array.isArray(a))))==null?void 0:i[0]),n==null||n.forEach(s=>{s!=null&&s.some(a=>Array.isArray(a))&&t(s.find(a=>Array.isArray(a)))})))}return t(r),e},y_=(r,e)=>{let t;function n(i,s,a=1){var l;if(!i||i.length===0)return;const o=(l=fe.cloneDeep(s))==null?void 0:l.map(c=>c==null?void 0:c.filter(h=>!Array.isArray(h)));return o!=null&&o.find(c=>Qh(c,i==null?void 0:i.key))?(s==null||s.forEach(c=>{!n(i,c.find(u=>Array.isArray(u)))&&Qh(c.filter(u=>!Array.isArray(u)),i==null?void 0:i.key)&&(t={type:a,contents:c.filter(u=>!Array.isArray(u))})}),!0):!1}return n(r,e,0),t},eu=(r,e)=>{function t(n,i){return!n||n.length===0||n==null?void 0:n.map((a,o)=>{var c,h;let l=a;return l.unshift((c=i==null?void 0:i[o])==null?void 0:c.label),l.some(u=>Array.isArray(u))&&(l[l.length-1]=t(l.find(u=>Array.isArray(u)),(h=i==null?void 0:i[o])==null?void 0:h.children)),l})}return t(r,e)},x_=r=>{var t,n,i,s,a,o,l,c,h,u,d,f,m,_,g,p,S,E,v,U,C,T,L,b,x;const e=r;if((r==null?void 0:r.comp)==="Table"){if((i=(n=(t=r.compData)==null?void 0:t.find(R=>(R==null?void 0:R.key)==="tableIndex"))==null?void 0:n.contents)!=null&&i.every(R=>!(R!=null&&R.children))||!((s=r.compData)!=null&&s.find(R=>(R==null?void 0:R.key)==="tableIndex")))return((l=(o=(a=e.compData)==null?void 0:a.find(R=>(R==null?void 0:R.key)==="tableContents"))==null?void 0:o.contents)==null?void 0:l.length)===1&&((d=(u=(h=(c=e.compData)==null?void 0:c.find(R=>(R==null?void 0:R.key)==="tableContents"))==null?void 0:h.contents)==null?void 0:u[0])!=null&&d.every(R=>Array.isArray(R)))?(e.compData=(f=e.compData)==null?void 0:f.map(R=>{var B;return(R==null?void 0:R.key)==="tableContents"&&(R.contents=(B=R.contents)==null?void 0:B[0]),R}),[e]):[e];{let R=[];const B=e.compData,V=(m=fe.cloneDeep(B))==null?void 0:m.find(le=>(le==null?void 0:le.key)==="tableIndexColumn"),W=(_=fe.cloneDeep(B))==null?void 0:_.find(le=>(le==null?void 0:le.key)==="extraButton"),ee=(g=fe.cloneDeep(B))==null?void 0:g.find(le=>(le==null?void 0:le.key)==="rowButton"),k=v_((S=(p=fe.cloneDeep(B))==null?void 0:p.find(le=>(le==null?void 0:le.key)==="header"))==null?void 0:S.contents),Q=(E=fe.cloneDeep(B))==null?void 0:E.find(le=>(le==null?void 0:le.key)==="tableIndex"),q=__((U=(v=fe.cloneDeep(B))==null?void 0:v.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:U.contents),ue=eu((T=(C=fe.cloneDeep(B))==null?void 0:C.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:T.contents,Q==null?void 0:Q.contents),ye=g_(eu((b=(L=fe.cloneDeep(B))==null?void 0:L.find(le=>(le==null?void 0:le.key)==="tableContents"))==null?void 0:b.contents,Q==null?void 0:Q.contents));if(Q)return(x=m_(Q.contents))==null||x.forEach((le,Pe)=>{var Y;let Te=[];Te.push({key:"tableIndex",contents:le}),Te.push(V),Te.push(W),Te.push(ee),Te.push({key:"tableContents",contents:q[Pe]}),Te.push({key:"header",contents:k!=null&&k[Pe]?[k==null?void 0:k[Pe]]:[k==null?void 0:k[0]]}),R.push({comp:"Table",compData:Te,name:"",parentTableContents:((Y=y_(ye[Pe],ue))==null?void 0:Y.contents)??""})}),R}}else return[e]},cs=(r,e)=>{let t={};return Array.isArray(r)?r==null||r.forEach((n,i)=>{e!=null&&e[i]&&(t[e[i]]=n)}):[r].forEach((n,i)=>{t[e[i]]=n}),t},M_=async r=>{const e=fe.cloneDeep(r);let t=[],n=[];e==null||e.forEach(i=>{!(n!=null&&n.find(s=>(s==null?void 0:s.parentKey)===(i==null?void 0:i.parentKey)))&&(i==null?void 0:i.parentKey)!==""&&n.push(i)}),n=n==null?void 0:n.map(i=>{var s;return i.content=(s=i.content)==null?void 0:s.map(a=>{var o;return a.key={pageKey:(i==null?void 0:i.parentKey)??"",systemKey:((o=a.key)==null?void 0:o.systemKey)??"",version:1,type:"subStructure"},a}),i.content}),(n==null?void 0:n.length)>0&&(t=n==null?void 0:n.map(async i=>{let s;return(i==null?void 0:i.length)>0&&(s=await fe.batchAddInsofDataApi({dataList:i})),s})),await Promise.all(t)},Ml=fe.useMenuState(fe.pinia),{activeMenuPath:b_}=fe.storeToRefs(Ml),S_=async(r,e)=>{var c,h,u,d,f,m,_,g,p,S,E,v,U,C,T,L;const t=(h=(c=r==null?void 0:r.find(b=>(b==null?void 0:b.key)==="header"))==null?void 0:c.contents)==null?void 0:h.find(b=>b==null?void 0:b.columnPath);let n=(d=(u=fe.cloneDeep(t==null?void 0:t.columnPath))==null?void 0:u.split("["))==null?void 0:d[0],i=(p=(g=(_=(m=(f=fe.cloneDeep(t==null?void 0:t.columnPath))==null?void 0:f.split("["))==null?void 0:m[1])==null?void 0:_.split("]"))==null?void 0:g[0])==null?void 0:p.replaceAll("'",""),s=[];const a=await fe.getInsofDataApi({key:{pageKey:n,systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),o=await fe.getInsofDataApi({key:{pageKey:b_.value,systemKey:sessionStorage.getItem("systemKey"),tableId:parseInt(e),type:"data"}}),l=[];if((E=(S=o==null?void 0:o.data)==null?void 0:S.result)==null||E.forEach(b=>{l.push([{id:b==null?void 0:b.id},b.value.tableData])}),Array.isArray((v=a==null?void 0:a.data)==null?void 0:v.result)&&((C=(U=a==null?void 0:a.data)==null?void 0:U.result)==null?void 0:C.length)>0){const b=await((L=(T=a==null?void 0:a.data)==null?void 0:T.result)==null?void 0:L.map(async x=>{var R,B,V,W,ee,k,Q,q,ue,ye,le,Pe,Te,Y,re;if(((B=(R=x==null?void 0:x.value)==null?void 0:R.pageData)==null?void 0:B.name)===i){s=fe.cloneDeep((W=(V=x==null?void 0:x.value)==null?void 0:V.pageData)==null?void 0:W.compData);const ae=await fe.getInsofDataApi({key:{pageKey:n,systemKey:sessionStorage.getItem("systemKey"),tableId:x==null?void 0:x.id,type:"data"}}),oe=(k=(ee=ae==null?void 0:ae.data)==null?void 0:ee.result)==null?void 0:k.map(ke=>{var Qe;let tt=[];return tt.push({id:ke==null?void 0:ke.id}),tt.push((Qe=ke==null?void 0:ke.value)==null?void 0:Qe.tableData),tt});let Ee=Ma(l,(ye=(ue=(q=(Q=x==null?void 0:x.value)==null?void 0:Q.pageData)==null?void 0:q.compData)==null?void 0:ue.find(ke=>(ke==null?void 0:ke.key)==="header"))==null?void 0:ye.contents),_e=!1;_e=((le=fe.cloneDeep(Ee))==null?void 0:le.map(ke=>ke.slice(1))).every(ke=>ke.every(tt=>tt===void 0)),_e?s.push({key:"tableContents",contents:Ma(oe,(re=(Y=(Te=(Pe=x==null?void 0:x.value)==null?void 0:Pe.pageData)==null?void 0:Te.compData)==null?void 0:Y.find(ke=>(ke==null?void 0:ke.key)==="header"))==null?void 0:re.contents)}):s.push({key:"tableContents",contents:Ee})}}));await Promise.all(b)}return s},bl=async(r,e,t="",n=!1,i)=>{var f,m,_,g,p,S,E;let s;s=await fe.getInsofDataApi({key:{pageKey:r,systemKey:e,parentTable:t}});const a=await fe.getInsofDataApi({key:{pageKey:r,systemKey:e,type:"structureMethod"}}),o=(m=(f=s==null?void 0:s.data)==null?void 0:f.result)==null?void 0:m.map(v=>v.id);if(!o)return;const l=o==null?void 0:o.map(v=>fe.getInsofDataApi({key:{pageKey:r,systemKey:e,type:"data",tableId:v}})),c=await Promise.all(l),h=[];c==null||c.forEach(v=>{var T,L,b,x;const U=(T=v.data.result)==null?void 0:T.map(R=>{const B=Array.isArray(R.value.tableData)?R.value.tableData:[R.value.tableData];return B.unshift({id:R.id}),B}),C=(x=(b=(L=v.data.result)==null?void 0:L[0])==null?void 0:b.key)==null?void 0:x.tableId;h.push({key:C,contents:U})});let u=[];const d=await((_=s.data.result)==null?void 0:_.map(async v=>{var L,b,x,R,B,V;const U=v.value.pageData,C=v==null?void 0:v.id;let T=(L=fe.cloneDeep(U.compData))==null?void 0:L.filter(W=>(W==null?void 0:W.key)!=="tableContents");if(T&&(T!=null&&T.find(W=>(W==null?void 0:W.key)==="header"))&&((x=(b=T==null?void 0:T.find(W=>(W==null?void 0:W.key)==="header"))==null?void 0:b.contents)!=null&&x.every(W=>!(W!=null&&W.columnPath)))?T.push({key:"tableContents",contents:Ma((R=h==null?void 0:h.find(W=>(W==null?void 0:W.key)===v.id))==null?void 0:R.contents,(B=T==null?void 0:T.find(W=>(W==null?void 0:W.key)==="header"))==null?void 0:B.contents)}):T&&(T!=null&&T.find(W=>(W==null?void 0:W.key)==="header"))&&(T=await S_(fe.cloneDeep(T),C)),U.compData=T,U.id=v.id,((V=v.key)==null?void 0:V.type)!=="method")u.push(U);else{let W;W={name:"",compData:[U],comp:"calculator"},u.push(W)}}));return await Promise.all(d),((p=(g=a.data.result)==null?void 0:g.map(v=>v.value.pageData))==null?void 0:p.filter(v=>Object.values(v).length>0).length)>0&&u.push({comp:"methodButton",name:"",compData:(E=(S=a.data.result)==null?void 0:S.map(v=>v.value.pageData))==null?void 0:E.filter(v=>Object.values(v).length>0)}),u=u.sort((v,U)=>v.id-U.id),u},E_=async r=>{await fe.deleteInsofDataApi({id:r})},A_=async(r,e,t,n,i,s,a)=>{var l,c,h,u,d,f,m,_,g,p,S,E,v;const o=((c=(l=a==null?void 0:a.content)==null?void 0:l[0])==null?void 0:c.id)??"";if(o!==""&&((h=a==null?void 0:a.content)==null?void 0:h.length)>1){const U=await fe.getInsofDataApi({id:o});let C=((m=(f=(d=(u=U==null?void 0:U.data)==null?void 0:u.result)==null?void 0:d[0])==null?void 0:f.key)==null?void 0:m.tableId)??"",T=((S=(p=(g=(_=U==null?void 0:U.data)==null?void 0:_.result)==null?void 0:g[0])==null?void 0:p.key)==null?void 0:S.pageKey)??"";await fe.createInsofDataApi({key:{type:r,pageKey:T,tableId:C,systemKey:n},value:{tableData:cs(i,(E=Yi(s))==null?void 0:E.filter(L=>L!=="操作"))}})}else await fe.createInsofDataApi({key:{type:r,pageKey:e,tableId:t,systemKey:n},value:{tableData:cs(i,(v=Yi(s))==null?void 0:v.filter(U=>U!=="操作"))}})},w_=async(r,e,t,n,i,s,a)=>{var h,u,d,f,m,_,g,p,S,E;const o=await fe.getInsofDataApi({id:n});let l=((f=(d=(u=(h=o==null?void 0:o.data)==null?void 0:h.result)==null?void 0:u[0])==null?void 0:d.key)==null?void 0:f.tableId)??"",c=((p=(g=(_=(m=o==null?void 0:o.data)==null?void 0:m.result)==null?void 0:_[0])==null?void 0:g.key)==null?void 0:p.pageKey)??"";l&&l!==""?await fe.updateInsofDataApi({key:{type:r,pageKey:c,tableId:l,systemKey:i},value:{tableData:cs(s,(S=Yi(a))==null?void 0:S.filter(v=>v!=="操作"))},id:n}):await fe.updateInsofDataApi({key:{type:r,pageKey:e,tableId:t,systemKey:i},value:{tableData:cs(s,(E=Yi(a))==null?void 0:E.filter(v=>v!=="操作"))},id:n})},T_=async(r,e)=>{await fe.updateInsofDataApi({value:{pageData:e},id:r})},C_=async(r,e)=>await fe.getInsofDataApi({key:r,valueLikes:e}),R_=async()=>{var r,e,t,n,i,s,a,o,l;try{const c=await fe.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),layer:"superAdmin"}});((r=c==null?void 0:c.data)==null?void 0:r.code)===200&&(Ml.setPlatform(((i=(n=(t=(e=c==null?void 0:c.data)==null?void 0:e.result)==null?void 0:t[0])==null?void 0:n.key)==null?void 0:i.systemType)==="制造系统"?"client":"browser"),Ml.setPlatName(((l=(o=(a=(s=c==null?void 0:c.data)==null?void 0:s.result)==null?void 0:a[0])==null?void 0:o.key)==null?void 0:l.name)??""))}catch(c){return Promise.reject(c)}},sd=fe.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(r){this.tableIndex=r},setTableShowThree(r){this.tableShowThree=r}}}),D_={class:"table-content"},P_={class:"menu-config-wrap"},L_=["onClick"],I_={class:"form-content"},U_={key:0,class:"dialog-footer"},N_={class:"dialog-footer"},F_={__name:"index",props:{compName:{type:String,default:"",required:!1},operatingForm:{type:Object,default:()=>{}},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0}},emits:["change","contentChange","onButtonClick","contentClick","pageChange","rowClick"],setup(r,{emit:e}){const t=r,n=e,i=K.ref([]),s=K.ref(!1),a=K.ref(),o=fe.useMenuState(),{activeMenuPath:l}=fe.storeToRefs(o),c=sd(fe.pinia),h=tu.useModelComp(fe.pinia),{extraContents:u}=fe.storeToRefs(h),d=K.ref([]);K.ref(!1);const f=K.ref("");K.ref();const m=K.ref(!0),_=K.ref(0),g=K.ref(!1),p=K.ref(""),S=K.ref(!1),E=K.ref({label:"查看三维模型"}),v=K.ref(!1),U=K.ref(),C=K.ref([]),T=K.ref([]),L=K.ref(!1),b=K.ref([]),x=K.ref([]),R=K.ref(),B=K.ref(),V=Qu(fe.pinia),W=K.ref(),ee=ed(fe.pinia),{selectIndex:k,selectMenu:Q,selectTitle:q}=fe.storeToRefs(ee),{selectString:ue}=fe.storeToRefs(V),ye=K.ref(720),le=()=>{S.value=!1},Pe=$=>{n("clickTrigger",$)},Te=($,pe)=>{if(Object.values(pe).length!==0)return Object.values(pe).find(te=>{var Se,he,ce;return((Se=te==null?void 0:te.toString())==null?void 0:Se.includes(".txt"))||((he=te==null?void 0:te.toString())==null?void 0:he.includes(".cpt"))||((ce=te==null?void 0:te.toString())==null?void 0:ce.includes(".obj"))})?[...$,E.value]:$},Y=$=>{var he;ue.value===""?$==null||$[0]:($==null?void 0:$.find(ce=>(ce==null?void 0:ce.selectLabel)==="("+ue.value+")"))??($==null||$.find(ce=>!(ce!=null&&ce.selectLabel)));let pe=$;(he=i.value)!=null&&he.find(ce=>ce.prop==="index");let te=R.value;const Se=[];return pe==null||pe.forEach((ce,Fe)=>{var A;let N={};if(Array.isArray(ce)){let G=[];ce==null||ce.filter(z=>!(z!=null&&z.id)).forEach((z,se)=>{var ne,Ce,Ae,Be,Ve;if((ne=te==null?void 0:te[se])!=null&&ne.prop&&!Array.isArray(z)){let me={};me[te[se].column]=z,u!=null&&u.value&&((Ce=u==null?void 0:u.value)==null?void 0:Ce.length)>0&&((Ae=u==null?void 0:u.value)!=null&&Ae.find(De=>JSON.stringify(De==null?void 0:De[0])===JSON.stringify(me)))&&(G=(Be=u==null?void 0:u.value)==null?void 0:Be.find(De=>JSON.stringify(De==null?void 0:De[0])===JSON.stringify(me))),G&&G.length>0?N[te[se].prop]=G!=null&&G.find(De=>{var Je;return((Je=Object.keys(De))==null?void 0:Je[0])===te[se].column})?(Ve=G==null?void 0:G.find(De=>{var Je;return((Je=Object.keys(De))==null?void 0:Je[0])===te[se].column}))==null?void 0:Ve[te[se].column]:z:N[te[se].prop]=z}})}else N=ce;Array.isArray(ce)&&ce.some(G=>G==null?void 0:G.id)?Se.push(Object.assign(N,{id:(A=ce==null?void 0:ce.find(G=>G.id))==null?void 0:A.id})):N.id?Se.push(N):Se.push(Object.assign(N,{id:Fe}))}),Se},re=async $=>{var he,ce,Fe,N,A;let pe={};for(let G in $)$[G]!==""&&(pe["tableData."+G]=$[G]);const te=await C_({type:"data",tableId:t==null?void 0:t.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:l.value},pe),Se=(Fe=(ce=(he=fe.cloneDeep(te))==null?void 0:he.data)==null?void 0:ce.result)==null?void 0:Fe.map(G=>{var se;let z=[];return z.push({id:G.id}),z.push((se=G==null?void 0:G.value)==null?void 0:se.tableData),z});d.value=Y(Ma(Se,(A=(N=fe.cloneDeep(i.value))==null?void 0:N.map(G=>G.label))==null?void 0:A.filter(G=>G!=="操作")))},ae=async $=>{var Se,he,ce,Fe,N,A,G,z,se,ne;const pe=(Se=fe.cloneDeep(i.value))==null?void 0:Se.filter(Ce=>Ce==null?void 0:Ce.isRoute);if((pe==null?void 0:pe.length)>0){let Ce=(he=pe==null?void 0:pe[0])==null?void 0:he.prop,Ae=l.value+"/"+($==null?void 0:$[Ce]),Be=l.value,Ve=await bl(Ae,sessionStorage.getItem("systemKey"),"");if((Ve==null?void 0:Ve.length)>0)h.setRouteToChildPath(Be),o.setActiveMenuPath(Ae);else{const me=await Ln.findFirstContent(t==null?void 0:t.index);me&&(Ae=l.value+"/"+(me==null?void 0:me[(ce=pe==null?void 0:pe[0])==null?void 0:ce.label]),await Ln.loadingConstruct(Ae,l.value+"/"+($==null?void 0:$[Ce])),h.setRouteToChildPath(Be),o.setActiveMenuPath(l.value+"/"+($==null?void 0:$[Ce])))}}let te=await bl(l.value,sessionStorage.getItem("systemKey"),$.id);if(te=te==null?void 0:te.filter(Ce=>Ce.comp!=="methodButton"),te&&te.length>0){const Ce=!Array.isArray(q.value)&&((Fe=q.value)==null?void 0:Fe.key)!=="main"?[]:q.value;Ce.push({key:Q.value===""?(N=$==null?void 0:$.id)==null?void 0:N.toString():Q.value+"-"+((A=$==null?void 0:$.id)==null?void 0:A.toString()),value:$[(G=Object.keys($))==null?void 0:G.filter(Ae=>Ae!=="index"&&Ae!=="id")[0]]}),ee.setSelectMenu(Q.value===""?(z=$==null?void 0:$.id)==null?void 0:z.toString():Q.value+"-"+((se=$==null?void 0:$.id)==null?void 0:se.toString())),ee.setSelectTitle(Ce),ee.setSelectIndex((ne=$==null?void 0:$.id)==null?void 0:ne.toString()),n("pageChange",te)}},oe=$=>{var pe;(pe=fe.cloneDeep(t.itemData))==null||pe.map(te=>((te==null?void 0:te.key)==="tableContents"&&(te.contents=$),te))},Ee=async($,pe,te,Se)=>{var he;if((Se==null?void 0:Se.data)==="查看"&&($!=null&&$.every(ce=>(ce==null?void 0:ce.url)&&(ce==null?void 0:ce.name)))){let ce=fe.cloneDeep($);ce=await((he=fe.cloneDeep(ce))==null?void 0:he.map(async N=>{var z,se,ne,Ce;const A=await jn.downloadAvatarApi({url:N==null?void 0:N.url});let G=URL.createObjectURL(A.data);return{name:(N==null?void 0:N.name)+"."+((Ce=(z=N==null?void 0:N.url)==null?void 0:z.split("."))==null?void 0:Ce[((ne=(se=N==null?void 0:N.url)==null?void 0:se.split("."))==null?void 0:ne.length)-1]),blobUrl:G}}));let Fe=await Promise.all(ce);a.value=Fe,s.value=!0}n("contentClick",$,pe,te,{id:t==null?void 0:t.index,type:"table"})},_e=()=>{s.value=!1},we=$=>{n("rowClick",$)};K.watch(()=>t.changedContent,()=>{var te,Se;if(!t.changedContent)return;let $=(te=d.value)==null?void 0:te.map(he=>{var ce;return he.id===((ce=t.changedContent)==null?void 0:ce.id)&&(he={...t.changedContent,id:t.changedContent.newId?t.changedContent.newId:t.changedContent.id},delete he.newId),he});const pe=(Se=t.itemData)==null?void 0:Se.map(he=>((he==null?void 0:he.key)==="tableContents"&&(he.contents=$),he));d.value=$,n("contentChange",{contents:pe,index:t.index}),n("change",{content:$,index:t==null?void 0:t.index,buttonName:"",id:t==null?void 0:t.index})},{deep:!0,immediate:!0});const ke=()=>{},tt=($,pe,te)=>{var Se,he,ce;if(f.value="",L.value=!0,m.value=!0,n("onButtonClick",$,pe),$==="删除"){d.value=(Se=fe.cloneDeep(d.value))==null?void 0:Se.filter(N=>(N==null?void 0:N.id)!==(pe==null?void 0:pe.id));const Fe=J3(W.value,Q.value,pe==null?void 0:pe.id);oe(Fe),n("change",{content:d.value,singleContent:pe,index:t==null?void 0:t.index,type:"delete",buttonName:$,column:i.value})}else if($==="新增")p.value="新增",Qe(""),S.value=!0;else if($==="编辑")p.value="编辑",Qe(pe),S.value=!0;else if($==="查看")p.value="查看",Qe(pe),L.value=!1,m.value=!1,S.value=!0;else if($==="查看三维模型"){const Fe={};for(let A in pe)A!=="id"&&(Fe[A]=pe[A]);let N=(he=Object.values(Fe))==null?void 0:he[1];c.setTableShowThree(N)}else((ce=te==null?void 0:te.extra)==null?void 0:ce.type)==="modelExample"&&(p.value=$,v.value=!0)},Qe=$=>{var he,ce,Fe,N,A,G;const pe=[];let te=[];for(let z in $)Array.isArray($==null?void 0:$[z])&&te.push(z);(ce=Ln.getColumnChild((he=fe.cloneDeep(i.value))==null?void 0:he.filter(z=>(z==null?void 0:z.label)!=="操作")))==null||ce.forEach((z,se)=>{var ne;te.find(Ce=>Ce===(z==null?void 0:z.prop))||(z!=null&&z.formType&&((ne=z==null?void 0:z.formType)==null?void 0:ne.toUpperCase())==="SELECT"?pe.push({label:(z==null?void 0:z.label)??"",name:(z==null?void 0:z.prop)??"t"+se,type:!(z!=null&&z.formType)||(z==null?void 0:z.formType)===""?"Input":z==null?void 0:z.formType,value:($==null?void 0:$[z==null?void 0:z.prop])??(z==null?void 0:z.value)??"",id:(z==null?void 0:z.id)??se,contents:(z==null?void 0:z.options)??[],width:1,isFormColHidden:z==null?void 0:z.isFormColHidden,optionUrl:{groupSelect:z==null?void 0:z.groupSelect,menuSelect:z==null?void 0:z.formMenuSelect,type:"Select",selectRelateType:z==null?void 0:z.selectRelateType}}):pe.push({label:(z==null?void 0:z.label)??"",name:(z==null?void 0:z.prop)??"t"+se,type:!(z!=null&&z.formType)||(z==null?void 0:z.formType)===""?"Input":z==null?void 0:z.formType,value:($==null?void 0:$[z==null?void 0:z.prop])??(z==null?void 0:z.value)??"",id:(z==null?void 0:z.id)??se,contents:(z==null?void 0:z.options)??[],width:1,isFormColHidden:z==null?void 0:z.isFormColHidden}))}),$===""||!$||(f.value=$==null?void 0:$.id);let Se=Ln.getColumnChild((Fe=fe.cloneDeep(i.value))==null?void 0:Fe.filter(z=>(z==null?void 0:z.label)!=="操作"));C.value&&((N=C.value)==null?void 0:N.length)>0&&(C.value=(A=fe.cloneDeep(C).value)==null?void 0:A.map(z=>{var ne;let se=(ne=Se==null?void 0:Se.find(Ce=>(Ce==null?void 0:Ce.label)===(z==null?void 0:z.label)))==null?void 0:ne.prop;return se&&(z.value=$[se]),z})),x.value=C.value&&((G=C.value)==null?void 0:G.length)>0?Ln.getTableFormToForm(C.value):pe};K.onMounted(()=>{U.value=window.innerWidth-240*2});const O=()=>{var he;let $=Ln.getColumnChild((he=fe.cloneDeep(i.value))==null?void 0:he.filter(ce=>(ce==null?void 0:ce.label)!=="操作")),pe,te=fe.cloneDeep(d.value);f.value===""?(_.value++,te.push(Object.assign(B.value,{id:_.value})),pe=Object.assign(B.value,{id:_.value})):te=te==null?void 0:te.map(ce=>{var Fe;if((ce==null?void 0:ce.id)===f.value){let N={};for(let A in ce){let G=(Fe=$==null?void 0:$.find(z=>(z==null?void 0:z.prop)===A))==null?void 0:Fe.label;G?N[A]=B.value[G]:N[A]=ce[A]}ce=Object.assign(N,B.value),pe=ce}return ce}),d.value=te;const Se=Z3(W.value,Q.value,te);oe(Se),S.value=!1,n("change",{content:Se,singleContent:pe,index:t==null?void 0:t.index,buttonName:p.value,column:i.value})},bt=$=>{B.value=$,n("onFormChange",$)};return K.watch(()=>[t.itemData,ue.value,k.value,Q.value,u==null?void 0:u.value],()=>{var A,G,z,se,ne,Ce,Ae,Be,Ve,me,De,Je,nt,Le,ct,H,Ne,ve,He,Me,ge,qe,ht,Dt,pt,en;const $=(A=fe.cloneDeep(t.itemData))==null?void 0:A.filter(je=>(je==null?void 0:je.key)==="header");(G=fe.cloneDeep(t.itemData))==null||G.filter(je=>(je==null?void 0:je.key)==="tableIndexColumn")[0];const pe=(z=fe.cloneDeep(t.itemData))==null?void 0:z.find(je=>(je==null?void 0:je.key)==="page"),te=(se=fe.cloneDeep(t.itemData))==null?void 0:se.find(je=>(je==null?void 0:je.key)==="rowButton"),Se=(ne=fe.cloneDeep(t.itemData))==null?void 0:ne.find(je=>(je==null?void 0:je.key)==="extraButton"),he=(Ce=fe.cloneDeep(t.itemData))==null?void 0:Ce.filter(je=>(je==null?void 0:je.key)==="tableContents"),ce=(Ae=fe.cloneDeep(t.itemData))==null?void 0:Ae.filter(je=>(je==null?void 0:je.key)==="tableIndex");C.value=(me=(Ve=(Be=fe.cloneDeep(t.itemData))==null?void 0:Be.filter(je=>(je==null?void 0:je.key)==="tableToForm"))==null?void 0:Ve[0])==null?void 0:me.contents,g.value=(pe==null?void 0:pe.contents)??!1;let Fe=[];ue.value===""?Fe=$==null?void 0:$[0]:Fe=($==null?void 0:$.find(je=>(je==null?void 0:je.selectLabel)==="("+ue.value+")"))??($==null?void 0:$.find(je=>!(je!=null&&je.selectLabel)));let N=[];if(ue.value===""?N=ce==null?void 0:ce[0]:N=(ce==null?void 0:ce.find(je=>(je==null?void 0:je.selectLabel)==="("+ue.value+")"))??(ce==null?void 0:ce.find(je=>!(je!=null&&je.selectLabel))),((De=Fe==null?void 0:Fe.contents)==null?void 0:De.length)>0){let je=[];if(Fe!=null&&Fe.contents.some(rt=>Array.isArray(rt)&&(rt==null?void 0:rt.find(Re=>Re.children))))Q.value===""?je=(nt=(Je=Ln.getGradeColumns(fe.cloneDeep(Fe==null?void 0:Fe.contents)))==null?void 0:Je[0])==null?void 0:nt.filter(rt=>!Array.isArray(rt)):(Q.value.split("-"),je=(Le=Ln.getGradeColumns(fe.cloneDeep(Fe==null?void 0:Fe.contents)))==null?void 0:Le[0]);else{const rt=Fe!=null&&Fe.contents.some(Re=>Array.isArray(Re))?(ct=Fe==null?void 0:Fe.contents)==null?void 0:ct[0]:Fe==null?void 0:Fe.contents;rt==null||rt.forEach((Re,Ht)=>{var nn;je.push({label:(Re==null?void 0:Re.label)??"",prop:(Re==null?void 0:Re.label)==="操作"?"operate":(Re==null?void 0:Re.prop)??"a"+Ht,width:Re!=null&&Re.width?parseInt(Re.width):"",fixed:(Re==null?void 0:Re.fixed)??void 0,sortable:(Re==null?void 0:Re.sortable)??!1,align:(Re==null?void 0:Re.align)??"center",showOverflowTooltip:(Re==null?void 0:Re.showOverflowTooltip)??!0,isNotDrag:(Re==null?void 0:Re.isNotDrag)??!1,isEditCol:(Re==null?void 0:Re.isEditCol)??!1,isOperate:(Re==null?void 0:Re.isOperate)??!1,id:(Re==null?void 0:Re.id)??Ht,type:(Re==null?void 0:Re.label)==="操作"?"operate":void 0,formType:(Re==null?void 0:Re.formType)??(Re!=null&&Re.groupSelect?"Select":""),isTableColHidden:Re==null?void 0:Re.isTableColHidden,isFormColHidden:Re==null?void 0:Re.isFormColHidden,options:(Re==null?void 0:Re.options)??[],value:(Re==null?void 0:Re.value)??"",formMenuSelect:(Re==null?void 0:Re.formMenuSelect)??[],isRoute:(Re==null?void 0:Re.isRoute)??!1,groupSelect:Re!=null&&Re.groupSelect?(nn=Re==null?void 0:Re.groupSelect)==null?void 0:nn.replaceAll('"',"").split(":"):[]})})}i.value=je;let Zt=(Ne=(H=Ln.getAllLeafNodes(fe.cloneDeep(i.value)))==null?void 0:H.filter(rt=>(rt==null?void 0:rt.type)!=="operate"))==null?void 0:Ne.map((rt,Re)=>({prop:(rt==null?void 0:rt.prop)??"a"+Re,column:rt.label}));R.value=Zt;let jt=[];ue.value===""?jt=he==null?void 0:he[0]:jt=(he==null?void 0:he.find(rt=>(rt==null?void 0:rt.selectLabel)==="("+ue.value+")"))??(he==null?void 0:he.find(rt=>!(rt!=null&&rt.selectLabel)));let tn=Array.isArray((ve=jt==null?void 0:jt.contents)==null?void 0:ve[0])&&((He=jt==null?void 0:jt.contents)!=null&&He[0].every(rt=>Array.isArray(rt)))?(Me=fe.cloneDeep(jt==null?void 0:jt.contents))==null?void 0:Me[0]:fe.cloneDeep(jt==null?void 0:jt.contents);N!=null&&N.contents&&((ge=N==null?void 0:N.contents)==null?void 0:ge.length)!==0&&(tn=(qe=fe.cloneDeep(tn))==null?void 0:qe.map((rt,Re)=>{if(!Array.isArray(rt)){let Ht={};for(let nn in rt)nn!=="id"&&nn!=="index"&&(Ht[nn]=rt[nn]);rt=Object.values(Ht)}return rt}));const Di=!!((ht=i.value)!=null&&ht.find(rt=>rt.prop==="index"));tn=nd(fe.cloneDeep(tn),N==null?void 0:N.contents,Di);const ti=[];tn==null||tn.forEach((rt,Re)=>{var nn;let Ht={};if(Array.isArray(rt)){let Wt=[];rt==null||rt.filter(hn=>!(hn!=null&&hn.id)).forEach((hn,En)=>{var Ji,Ki,Zi,Qi,er,D;if((Ji=Zt==null?void 0:Zt[En])!=null&&Ji.prop&&!Array.isArray(hn)){let X={};X[Zt[En].column]=hn,u!=null&&u.value&&((Ki=u==null?void 0:u.value)==null?void 0:Ki.length)>0&&((Zi=u==null?void 0:u.value)!=null&&Zi.find(J=>JSON.stringify(J==null?void 0:J[0])===JSON.stringify(X)))&&(Wt=(Qi=u==null?void 0:u.value)==null?void 0:Qi.find(J=>JSON.stringify(J==null?void 0:J[0])===JSON.stringify(X))),Wt&&Wt.length>0?Ht[Zt[En].prop]=Wt!=null&&Wt.find(J=>{var Z;return((Z=Object.keys(J))==null?void 0:Z[0])===Zt[En].column})?(er=Wt==null?void 0:Wt.find(J=>{var Z;return((Z=Object.keys(J))==null?void 0:Z[0])===Zt[En].column}))==null?void 0:er[Zt[En].column]:hn:Ht[Zt[En].prop]=hn}else Array.isArray(hn)&&((D=Zt[En])!=null&&D.prop?Ht[Zt[En].prop]=hn:Ht.children=td(hn,Zt))})}else Ht=rt;Array.isArray(rt)&&rt.some(Wt=>Wt==null?void 0:Wt.id)?ti.push(Object.assign(Ht,{id:(nn=rt==null?void 0:rt.find(Wt=>Wt.id))==null?void 0:nn.id})):Ht.id?ti.push(Ht):ti.push(Object.assign(Ht,{id:Re}))}),d.value=ti}else i.value=[],d.value=[];((Dt=te==null?void 0:te.contents)==null?void 0:Dt.length)>0?T.value=te==null?void 0:te.contents:T.value=[],((pt=Se==null?void 0:Se.contents)==null?void 0:pt.length)>0?b.value=Se==null?void 0:Se.contents:b.value=[],_.value=((en=d==null?void 0:d.value)==null?void 0:en.length)??0,W.value=d.value},{deep:!0,immediate:!0}),K.watch(()=>t==null?void 0:t.operatingForm,$=>{$!=null&&$.form&&(Qe($==null?void 0:$.form),p.value=$==null?void 0:$.dialogTitle,L.value=!0,S.value=!0)},{immediate:!0,deep:!0}),($,pe)=>{var ce;const te=K.resolveComponent("el-icon"),Se=K.resolveComponent("el-popover"),he=K.resolveComponent("el-button");return K.openBlock(),K.createElementBlock("div",D_,[(K.openBlock(),K.createBlock(jn.ssTable,{columns:i.value,key:i.value,tableData:d.value,isShowPagination:g.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:ae,extraButton:b.value,onContentClick:Ee,onRowClick:we},K.createSlots({headerButton:K.withCtx(Fe=>[r.showHeader?(K.openBlock(),K.createBlock(Gd,{key:0,compName:r.compName,buttons:Fe.buttons,onButtonClick:pe[0]||(pe[0]=N=>tt(N,"",{})),columns:i.value,onFilter:re},null,8,["compName","buttons","columns"])):K.createCommentVNode("",!0)]),_:2},[((ce=T.value)==null?void 0:ce.length)>0?{name:"actions",fn:K.withCtx(({item:Fe})=>[K.createVNode(Se,{class:"box-item",title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:K.withCtx(()=>[K.createVNode(te,null,{default:K.withCtx(()=>[K.createVNode(K.unref(fe.more_filled_default))]),_:1})]),default:K.withCtx(()=>[K.createElementVNode("div",P_,[(K.openBlock(!0),K.createElementBlock(K.Fragment,null,K.renderList(Te(T.value,Fe),(N,A)=>(K.openBlock(),K.createElementBlock("div",{class:"menu-config-item",key:A},[K.createElementVNode("div",{style:K.normalizeStyle({color:N==null?void 0:N.textColor}),class:"extra-button-label",onClick:G=>tt(N==null?void 0:N.label,Fe,{extra:N})},K.toDisplayString(N==null?void 0:N.label),13,L_)]))),128))])]),_:2},1024)]),key:"0"}:void 0]),1032,["columns","tableData","isShowPagination","extraButton"])),K.createVNode(jn.ssDialog,{title:p.value,visible:S.value,width:ye.value,onBeforeDestroy:le},{default:K.withCtx(()=>[K.createElementVNode("div",I_,[K.createVNode(jn.ssForm,{rowContents:x.value,isEnableWrap:!1,onChange:bt,onClickTrigger:Pe,isEdit:m.value},null,8,["rowContents","isEdit"])])]),footer:K.withCtx(()=>[L.value?(K.openBlock(),K.createElementBlock("div",U_,[K.createVNode(he,{onClick:pe[1]||(pe[1]=Fe=>S.value=!1),id:"themeBorderButton"},{default:K.withCtx(()=>pe[4]||(pe[4]=[K.createTextVNode(K.toDisplayString("取消"))])),_:1,__:[4]}),K.createVNode(he,{class:"ok-button",onClick:O,id:"themeButton"},{default:K.withCtx(()=>pe[5]||(pe[5]=[K.createTextVNode(K.toDisplayString("确认"))])),_:1,__:[5]})])):K.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),K.createVNode(jn.ssDialog,{title:p.value,visible:v.value,width:U.value,onBeforeDestroy:pe[3]||(pe[3]=Fe=>v.value=!1)},{default:K.withCtx(()=>[K.createVNode($3)]),footer:K.withCtx(()=>[K.createElementVNode("div",N_,[K.createVNode(he,{onClick:pe[2]||(pe[2]=Fe=>v.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:K.withCtx(()=>pe[6]||(pe[6]=[K.createTextVNode(K.toDisplayString("取消"))])),_:1,__:[6]}),K.createVNode(he,{class:"ok-button",onClick:ke,id:"themeButton"},{default:K.withCtx(()=>pe[7]||(pe[7]=[K.createTextVNode(K.toDisplayString("确认"))])),_:1,__:[7]})])]),_:1},8,["title","visible","width"]),s.value?(K.openBlock(),K.createBlock(jn.ssFilePreview,{key:0,fileDataList:a.value,onDestroy:_e},null,8,["fileDataList"])):K.createCommentVNode("",!0)])}}},O_=Sl._export_sfc(F_,[["__scopeId","data-v-c1156fac"]]);exports.ACESFilmicToneMapping=lu;exports.AmbientLight=Bu;exports.Box3=ei;exports.CatmullRomCurve3=Iu;exports.Color=ot;exports.Controls=x0;exports.DirectionalLight=zu;exports.DoubleSide=pn;exports.Euler=Sn;exports.GridHelper=y0;exports.HemisphereLight=c0;exports.IsJson=e_;exports.MOUSE=Wd;exports.MathUtils=Hi;exports.Matrix4=lt;exports.Mesh=Rt;exports.MeshPhongMaterial=Mn;exports.PCFSoftShadowMap=ou;exports.PerspectiveCamera=ln;exports.Plane=Ei;exports.PlaneGeometry=us;exports.PointLight=Ou;exports.Quaternion=Rn;exports.Ray=Ur;exports.SRGBColorSpace=Tt;exports.Scene=Ol;exports.SetCache=ns;exports.ShadowMaterial=jp;exports.Spherical=ku;exports.TOUCH=Xd;exports.TubeGeometry=Wl;exports.Vector2=Xe;exports.Vector3=F;exports.WebGLRenderer=i3;exports.Xe=R3;exports.addTableContents=A_;exports.baseIsEqual=El;exports.cacheHas=nu;exports.deleteTableContents=E_;exports.fixFormContents=T_;exports.fixTableContents=w_;exports.getColumnContents=Yi;exports.getFixExtraContent=h_;exports.getFormContents=i_;exports.getFormToContent=s_;exports.getFormToData=l_;exports.getItemData=bl;exports.getNewTableContents=c_;exports.getParentConstruct=M_;exports.getProjectContent=d_;exports.getTableToContent=r_;exports.getValueToObjectValue=cs;exports.isEqual=su;exports.loadingSystemType=R_;exports.methodTableToContent=n_;exports.setToArray=ru;exports.ssTable=O_;exports.tableEveryContents=x_;exports.tableToContents=p_;exports.tableToStruct=f_;exports.useFormToTableComp=Qu;exports.useModelLoader=W3;exports.useTableComp=sd;exports.useUnit=ed;