@epigraph/solutions 0.17.0 → 0.18.0
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.
- package/dist/epigraph-solutions.js +29 -29
- package/package.json +1 -1
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2010-2024 Three.js Authors
|
|
77
77
|
* SPDX-License-Identifier: MIT
|
|
78
|
-
*/const Bf="172",BI=0,j_=1,PI=2,x0=1,LI=2,Xs=3,hs=0,Fi=1,Ri=2,cs=0,sl=1,q_=2,W_=3,Y_=4,DI=5,Ia=100,NI=101,OI=102,kI=103,UI=104,FI=200,$I=201,zI=202,GI=203,Vg=204,Qg=205,HI=206,VI=207,QI=208,jI=209,qI=210,WI=211,YI=212,XI=213,KI=214,jg=0,qg=1,Wg=2,ml=3,Yg=4,Xg=5,Kg=6,Jg=7,oS=0,JI=1,ZI=2,Ss=0,lS=1,cS=2,uS=3,S0=4,eM=5,hS=6,yu=7,X_="attached",tM="detached",gl=300,ja=301,Al=302,bu=303,Zg=304,Pf=306,ds=1e3,ai=1001,qa=1002,gi=1003,Lu=1004,Nr=1005,wt=1006,Oa=1007,hn=1008,K_=1008,ui=1009,C0=1010,T0=1011,vu=1012,Lf=1013,qr=1014,oi=1015,hi=1016,I0=1017,M0=1018,_l=1020,dS=35902,fS=1021,pS=1022,Xt=1023,mS=1024,gS=1025,rl=1026,yl=1027,Or=1028,R0=1029,La=1030,B0=1031,P0=1033,bd=33776,su=33777,vd=33778,ru=33779,Hd=35840,eA=35841,Vd=35842,tA=35843,Qd=36196,jd=37492,qd=37496,wu=37808,iA=37809,nA=37810,sA=37811,Eu=37812,rA=37813,aA=37814,oA=37815,lA=37816,cA=37817,uA=37818,hA=37819,dA=37820,fA=37821,au=36492,pA=36494,Wd=36495,AS=36283,mA=36284,gA=36285,AA=36286,bl=2200,ka=2201,Yd=2202,vl=2300,wl=2301,op=2302,qo=2400,Wo=2401,Xd=2402,L0=2500,iM=2501,nM=0,_S=1,_A=2,sM=3200,rM=3201,yS=0,aM=1,Gn="",Ht="srgb",qt="srgb-linear",Kd="linear",Gt="srgb",ro=7680,J_=519,oM=512,lM=513,cM=514,bS=515,uM=516,hM=517,dM=518,fM=519,yA=35044,Z_="300 es",sr=2e3,Jd=2001;let fs=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const a=this._listeners[e];if(a!==void 0){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let l=0,u=a.length;l<u;l++)a[l].call(this,e);e.target=null}}};const Vi=["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 ey=1234567;const ou=Math.PI/180,El=180/Math.PI;function us(){const o=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(Vi[o&255]+Vi[o>>8&255]+Vi[o>>16&255]+Vi[o>>24&255]+"-"+Vi[e&255]+Vi[e>>8&255]+"-"+Vi[e>>16&15|64]+Vi[e>>24&255]+"-"+Vi[t&63|128]+Vi[t>>8&255]+"-"+Vi[t>>16&255]+Vi[t>>24&255]+Vi[i&255]+Vi[i>>8&255]+Vi[i>>16&255]+Vi[i>>24&255]).toLowerCase()}function ft(o,e,t){return Math.max(e,Math.min(t,o))}function D0(o,e){return(o%e+e)%e}function pM(o,e,t,i,a){return i+(o-e)*(a-i)/(t-e)}function mM(o,e,t){return o!==e?(t-o)/(e-o):0}function lu(o,e,t){return(1-t)*o+t*e}function gM(o,e,t,i){return lu(o,e,1-Math.exp(-t*i))}function AM(o,e=1){return e-Math.abs(D0(o,e*2)-e)}function _M(o,e,t){return o<=e?0:o>=t?1:(o=(o-e)/(t-e),o*o*(3-2*o))}function yM(o,e,t){return o<=e?0:o>=t?1:(o=(o-e)/(t-e),o*o*o*(o*(o*6-15)+10))}function bM(o,e){return o+Math.floor(Math.random()*(e-o+1))}function vM(o,e){return o+Math.random()*(e-o)}function wM(o){return o*(.5-Math.random())}function EM(o){o!==void 0&&(ey=o);let e=ey+=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 xM(o){return o*ou}function SM(o){return o*El}function CM(o){return(o&o-1)===0&&o!==0}function TM(o){return Math.pow(2,Math.ceil(Math.log(o)/Math.LN2))}function IM(o){return Math.pow(2,Math.floor(Math.log(o)/Math.LN2))}function MM(o,e,t,i,a){const l=Math.cos,u=Math.sin,d=l(t/2),p=u(t/2),m=l((e+i)/2),A=u((e+i)/2),_=l((e-i)/2),b=u((e-i)/2),w=l((i-e)/2),E=u((i-e)/2);switch(a){case"XYX":o.set(d*A,p*_,p*b,d*m);break;case"YZY":o.set(p*b,d*A,p*_,d*m);break;case"ZXZ":o.set(p*_,p*b,d*A,d*m);break;case"XZX":o.set(d*A,p*E,p*w,d*m);break;case"YXY":o.set(p*w,d*A,p*E,d*m);break;case"ZYZ":o.set(p*E,p*w,d*A,d*m);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}function as(o,e){switch(e.constructor){case Float32Array:return o;case Uint32Array:return o/4294967295;case Uint16Array:return o/65535;case Uint8Array:return o/255;case Int32Array:return Math.max(o/2147483647,-1);case Int16Array:return Math.max(o/32767,-1);case Int8Array:return Math.max(o/127,-1);default:throw new Error("Invalid component type.")}}function Ut(o,e){switch(e.constructor){case Float32Array:return o;case Uint32Array:return Math.round(o*4294967295);case Uint16Array:return Math.round(o*65535);case Uint8Array:return Math.round(o*255);case Int32Array:return Math.round(o*2147483647);case Int16Array:return Math.round(o*32767);case Int8Array:return Math.round(o*127);default:throw new Error("Invalid component type.")}}const xl={DEG2RAD:ou,RAD2DEG:El,generateUUID:us,clamp:ft,euclideanModulo:D0,mapLinear:pM,inverseLerp:mM,lerp:lu,damp:gM,pingpong:AM,smoothstep:_M,smootherstep:yM,randInt:bM,randFloat:vM,randFloatSpread:wM,seededRandom:EM,degToRad:xM,radToDeg:SM,isPowerOfTwo:CM,ceilPowerOfTwo:TM,floorPowerOfTwo:IM,setQuaternionFromProperEuler:MM,normalize:Ut,denormalize:as};class Ve{constructor(e=0,t=0){Ve.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,i=this.y,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6],this.y=a[1]*t+a[4]*i+a[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ft(i,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 i=this.dot(e)/t;return Math.acos(ft(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),a=Math.sin(t),l=this.x-e.x,u=this.y-e.y;return this.x=l*i-u*a+e.x,this.y=l*a+u*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ot{constructor(e,t,i,a,l,u,d,p,m){ot.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,a,l,u,d,p,m)}set(e,t,i,a,l,u,d,p,m){const A=this.elements;return A[0]=e,A[1]=a,A[2]=d,A[3]=t,A[4]=l,A[5]=p,A[6]=i,A[7]=u,A[8]=m,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){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 i=e.elements,a=t.elements,l=this.elements,u=i[0],d=i[3],p=i[6],m=i[1],A=i[4],_=i[7],b=i[2],w=i[5],E=i[8],C=a[0],T=a[3],x=a[6],P=a[1],M=a[4],B=a[7],D=a[2],G=a[5],U=a[8];return l[0]=u*C+d*P+p*D,l[3]=u*T+d*M+p*G,l[6]=u*x+d*B+p*U,l[1]=m*C+A*P+_*D,l[4]=m*T+A*M+_*G,l[7]=m*x+A*B+_*U,l[2]=b*C+w*P+E*D,l[5]=b*T+w*M+E*G,l[8]=b*x+w*B+E*U,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],i=e[1],a=e[2],l=e[3],u=e[4],d=e[5],p=e[6],m=e[7],A=e[8];return t*u*A-t*d*m-i*l*A+i*d*p+a*l*m-a*u*p}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],l=e[3],u=e[4],d=e[5],p=e[6],m=e[7],A=e[8],_=A*u-d*m,b=d*p-A*l,w=m*l-u*p,E=t*_+i*b+a*w;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const C=1/E;return e[0]=_*C,e[1]=(a*m-A*i)*C,e[2]=(d*i-a*u)*C,e[3]=b*C,e[4]=(A*t-a*p)*C,e[5]=(a*l-d*t)*C,e[6]=w*C,e[7]=(i*p-m*t)*C,e[8]=(u*t-i*l)*C,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,i,a,l,u,d){const p=Math.cos(l),m=Math.sin(l);return this.set(i*p,i*m,-i*(p*u+m*d)+u+e,-a*m,a*p,-a*(-m*u+p*d)+d+t,0,0,1),this}scale(e,t){return this.premultiply(lp.makeScale(e,t)),this}rotate(e){return this.premultiply(lp.makeRotation(-e)),this}translate(e,t){return this.premultiply(lp.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),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let a=0;a<9;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const lp=new ot;function vS(o){for(let e=o.length-1;e>=0;--e)if(o[e]>=65535)return!0;return!1}function xu(o){return document.createElementNS("http://www.w3.org/1999/xhtml",o)}function RM(){const o=xu("canvas");return o.style.display="block",o}const ty={};function Ho(o){o in ty||(ty[o]=!0,console.warn(o))}function BM(o,e,t){return new Promise(function(i,a){function l(){switch(o.clientWaitSync(e,o.SYNC_FLUSH_COMMANDS_BIT,0)){case o.WAIT_FAILED:a();break;case o.TIMEOUT_EXPIRED:setTimeout(l,t);break;default:i()}}setTimeout(l,t)})}function PM(o){const e=o.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 LM(o){const e=o.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const iy=new ot().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ny=new ot().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function DM(){const o={enabled:!0,workingColorSpace:qt,spaces:{},convert:function(a,l,u){return this.enabled===!1||l===u||!l||!u||(this.spaces[l].transfer===Gt&&(a.r=or(a.r),a.g=or(a.g),a.b=or(a.b)),this.spaces[l].primaries!==this.spaces[u].primaries&&(a.applyMatrix3(this.spaces[l].toXYZ),a.applyMatrix3(this.spaces[u].fromXYZ)),this.spaces[u].transfer===Gt&&(a.r=al(a.r),a.g=al(a.g),a.b=al(a.b))),a},fromWorkingColorSpace:function(a,l){return this.convert(a,this.workingColorSpace,l)},toWorkingColorSpace:function(a,l){return this.convert(a,l,this.workingColorSpace)},getPrimaries:function(a){return this.spaces[a].primaries},getTransfer:function(a){return a===Gn?Kd:this.spaces[a].transfer},getLuminanceCoefficients:function(a,l=this.workingColorSpace){return a.fromArray(this.spaces[l].luminanceCoefficients)},define:function(a){Object.assign(this.spaces,a)},_getMatrix:function(a,l,u){return a.copy(this.spaces[l].toXYZ).multiply(this.spaces[u].fromXYZ)},_getDrawingBufferColorSpace:function(a){return this.spaces[a].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(a=this.workingColorSpace){return this.spaces[a].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return o.define({[qt]:{primaries:e,whitePoint:i,transfer:Kd,toXYZ:iy,fromXYZ:ny,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Ht},outputColorSpaceConfig:{drawingBufferColorSpace:Ht}},[Ht]:{primaries:e,whitePoint:i,transfer:Gt,toXYZ:iy,fromXYZ:ny,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Ht}}}),o}const vt=DM();function or(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function al(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}let ao,NM=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ao===void 0&&(ao=xu("canvas")),ao.width=e.width,ao.height=e.height;const i=ao.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=ao}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=xu("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const a=i.getImageData(0,0,e.width,e.height),l=a.data;for(let u=0;u<l.length;u++)l[u]=or(l[u]/255)*255;return i.putImageData(a,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(or(t[i]/255)*255):t[i]=or(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},OM=0;class N0{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:OM++}),this.uuid=us(),this.data=e,this.dataReady=!0,this.version=0}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 i={uuid:this.uuid,url:""},a=this.data;if(a!==null){let l;if(Array.isArray(a)){l=[];for(let u=0,d=a.length;u<d;u++)a[u].isDataTexture?l.push(cp(a[u].image)):l.push(cp(a[u]))}else l=cp(a);i.url=l}return t||(e.images[this.uuid]=i),i}}function cp(o){return typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&o instanceof ImageBitmap?NM.getDataURL(o):o.data?{data:Array.from(o.data),width:o.width,height:o.height,type:o.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let kM=0,Kt=class wd extends fs{constructor(e=wd.DEFAULT_IMAGE,t=wd.DEFAULT_MAPPING,i=ai,a=ai,l=wt,u=hn,d=Xt,p=ui,m=wd.DEFAULT_ANISOTROPY,A=Gn){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:kM++}),this.uuid=us(),this.name="",this.source=new N0(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=a,this.magFilter=l,this.minFilter=u,this.anisotropy=m,this.format=d,this.internalFormat=null,this.type=p,this.offset=new Ve(0,0),this.repeat=new Ve(1,1),this.center=new Ve(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ot,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=A,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}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)}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.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.6,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&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==gl)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ds:e.x=e.x-Math.floor(e.x);break;case ai:e.x=e.x<0?0:1;break;case qa: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 ds:e.y=e.y-Math.floor(e.y);break;case ai:e.y=e.y<0?0:1;break;case qa: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++}};Kt.DEFAULT_IMAGE=null;Kt.DEFAULT_MAPPING=gl;Kt.DEFAULT_ANISOTROPY=1;class Rt{constructor(e=0,t=0,i=0,a=1){Rt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=a}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,a){return this.x=e,this.y=t,this.z=i,this.w=a,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,i=this.y,a=this.z,l=this.w,u=e.elements;return this.x=u[0]*t+u[4]*i+u[8]*a+u[12]*l,this.y=u[1]*t+u[5]*i+u[9]*a+u[13]*l,this.z=u[2]*t+u[6]*i+u[10]*a+u[14]*l,this.w=u[3]*t+u[7]*i+u[11]*a+u[15]*l,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,i,a,l;const p=e.elements,m=p[0],A=p[4],_=p[8],b=p[1],w=p[5],E=p[9],C=p[2],T=p[6],x=p[10];if(Math.abs(A-b)<.01&&Math.abs(_-C)<.01&&Math.abs(E-T)<.01){if(Math.abs(A+b)<.1&&Math.abs(_+C)<.1&&Math.abs(E+T)<.1&&Math.abs(m+w+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(m+1)/2,B=(w+1)/2,D=(x+1)/2,G=(A+b)/4,U=(_+C)/4,V=(E+T)/4;return M>B&&M>D?M<.01?(i=0,a=.707106781,l=.707106781):(i=Math.sqrt(M),a=G/i,l=U/i):B>D?B<.01?(i=.707106781,a=0,l=.707106781):(a=Math.sqrt(B),i=G/a,l=V/a):D<.01?(i=.707106781,a=.707106781,l=0):(l=Math.sqrt(D),i=U/l,a=V/l),this.set(i,a,l,t),this}let P=Math.sqrt((T-E)*(T-E)+(_-C)*(_-C)+(b-A)*(b-A));return Math.abs(P)<.001&&(P=1),this.x=(T-E)/P,this.y=(_-C)/P,this.z=(b-A)/P,this.w=Math.acos((m+w+x-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this.z=ft(this.z,e.z,t.z),this.w=ft(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this.z=ft(this.z,e,t),this.w=ft(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ft(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class UM extends fs{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Rt(0,0,e,t),this.scissorTest=!1,this.viewport=new Rt(0,0,e,t);const a={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const l=new Kt(a,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);l.flipY=!1,l.generateMipmaps=i.generateMipmaps,l.internalFormat=i.internalFormat,this.textures=[];const u=i.count;for(let d=0;d<u;d++)this.textures[d]=l.clone(),this.textures[d].isRenderTargetTexture=!0,this.textures[d].renderTarget=this;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples}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,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let a=0,l=this.textures.length;a<l;a++)this.textures[a].image.width=e,this.textures[a].image.height=t,this.textures[a].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,a=e.textures.length;i<a;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0,this.textures[i].renderTarget=this;const t=Object.assign({},e.texture.image);return this.texture.source=new N0(t),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 dn extends UM{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class wS extends Kt{constructor(e=null,t=1,i=1,a=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:a},this.magFilter=gi,this.minFilter=gi,this.wrapR=ai,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ES extends Kt{constructor(e=null,t=1,i=1,a=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:a},this.magFilter=gi,this.minFilter=gi,this.wrapR=ai,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yi{constructor(e=0,t=0,i=0,a=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=a}static slerpFlat(e,t,i,a,l,u,d){let p=i[a+0],m=i[a+1],A=i[a+2],_=i[a+3];const b=l[u+0],w=l[u+1],E=l[u+2],C=l[u+3];if(d===0){e[t+0]=p,e[t+1]=m,e[t+2]=A,e[t+3]=_;return}if(d===1){e[t+0]=b,e[t+1]=w,e[t+2]=E,e[t+3]=C;return}if(_!==C||p!==b||m!==w||A!==E){let T=1-d;const x=p*b+m*w+A*E+_*C,P=x>=0?1:-1,M=1-x*x;if(M>Number.EPSILON){const D=Math.sqrt(M),G=Math.atan2(D,x*P);T=Math.sin(T*G)/D,d=Math.sin(d*G)/D}const B=d*P;if(p=p*T+b*B,m=m*T+w*B,A=A*T+E*B,_=_*T+C*B,T===1-d){const D=1/Math.sqrt(p*p+m*m+A*A+_*_);p*=D,m*=D,A*=D,_*=D}}e[t]=p,e[t+1]=m,e[t+2]=A,e[t+3]=_}static multiplyQuaternionsFlat(e,t,i,a,l,u){const d=i[a],p=i[a+1],m=i[a+2],A=i[a+3],_=l[u],b=l[u+1],w=l[u+2],E=l[u+3];return e[t]=d*E+A*_+p*w-m*b,e[t+1]=p*E+A*b+m*_-d*w,e[t+2]=m*E+A*w+d*b-p*_,e[t+3]=A*E-d*_-p*b-m*w,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,a){return this._x=e,this._y=t,this._z=i,this._w=a,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 i=e._x,a=e._y,l=e._z,u=e._order,d=Math.cos,p=Math.sin,m=d(i/2),A=d(a/2),_=d(l/2),b=p(i/2),w=p(a/2),E=p(l/2);switch(u){case"XYZ":this._x=b*A*_+m*w*E,this._y=m*w*_-b*A*E,this._z=m*A*E+b*w*_,this._w=m*A*_-b*w*E;break;case"YXZ":this._x=b*A*_+m*w*E,this._y=m*w*_-b*A*E,this._z=m*A*E-b*w*_,this._w=m*A*_+b*w*E;break;case"ZXY":this._x=b*A*_-m*w*E,this._y=m*w*_+b*A*E,this._z=m*A*E+b*w*_,this._w=m*A*_-b*w*E;break;case"ZYX":this._x=b*A*_-m*w*E,this._y=m*w*_+b*A*E,this._z=m*A*E-b*w*_,this._w=m*A*_+b*w*E;break;case"YZX":this._x=b*A*_+m*w*E,this._y=m*w*_+b*A*E,this._z=m*A*E-b*w*_,this._w=m*A*_-b*w*E;break;case"XZY":this._x=b*A*_-m*w*E,this._y=m*w*_-b*A*E,this._z=m*A*E+b*w*_,this._w=m*A*_+b*w*E;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+u)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,a=Math.sin(i);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],a=t[4],l=t[8],u=t[1],d=t[5],p=t[9],m=t[2],A=t[6],_=t[10],b=i+d+_;if(b>0){const w=.5/Math.sqrt(b+1);this._w=.25/w,this._x=(A-p)*w,this._y=(l-m)*w,this._z=(u-a)*w}else if(i>d&&i>_){const w=2*Math.sqrt(1+i-d-_);this._w=(A-p)/w,this._x=.25*w,this._y=(a+u)/w,this._z=(l+m)/w}else if(d>_){const w=2*Math.sqrt(1+d-i-_);this._w=(l-m)/w,this._x=(a+u)/w,this._y=.25*w,this._z=(p+A)/w}else{const w=2*Math.sqrt(1+_-i-d);this._w=(u-a)/w,this._x=(l+m)/w,this._y=(p+A)/w,this._z=.25*w}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ft(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const a=Math.min(1,t/i);return this.slerp(e,a),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 i=e._x,a=e._y,l=e._z,u=e._w,d=t._x,p=t._y,m=t._z,A=t._w;return this._x=i*A+u*d+a*m-l*p,this._y=a*A+u*p+l*d-i*m,this._z=l*A+u*m+i*p-a*d,this._w=u*A-i*d-a*p-l*m,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,a=this._y,l=this._z,u=this._w;let d=u*e._w+i*e._x+a*e._y+l*e._z;if(d<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,d=-d):this.copy(e),d>=1)return this._w=u,this._x=i,this._y=a,this._z=l,this;const p=1-d*d;if(p<=Number.EPSILON){const w=1-t;return this._w=w*u+t*this._w,this._x=w*i+t*this._x,this._y=w*a+t*this._y,this._z=w*l+t*this._z,this.normalize(),this}const m=Math.sqrt(p),A=Math.atan2(m,d),_=Math.sin((1-t)*A)/m,b=Math.sin(t*A)/m;return this._w=u*_+this._w*b,this._x=i*_+this._x*b,this._y=a*_+this._y*b,this._z=l*_+this._z*b,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),a=Math.sqrt(1-i),l=Math.sqrt(i);return this.set(a*Math.sin(e),a*Math.cos(e),l*Math.sin(t),l*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 se{constructor(e=0,t=0,i=0){se.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(sy.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(sy.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,a=this.z,l=e.elements;return this.x=l[0]*t+l[3]*i+l[6]*a,this.y=l[1]*t+l[4]*i+l[7]*a,this.z=l[2]*t+l[5]*i+l[8]*a,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,a=this.z,l=e.elements,u=1/(l[3]*t+l[7]*i+l[11]*a+l[15]);return this.x=(l[0]*t+l[4]*i+l[8]*a+l[12])*u,this.y=(l[1]*t+l[5]*i+l[9]*a+l[13])*u,this.z=(l[2]*t+l[6]*i+l[10]*a+l[14])*u,this}applyQuaternion(e){const t=this.x,i=this.y,a=this.z,l=e.x,u=e.y,d=e.z,p=e.w,m=2*(u*a-d*i),A=2*(d*t-l*a),_=2*(l*i-u*t);return this.x=t+p*m+u*_-d*A,this.y=i+p*A+d*m-l*_,this.z=a+p*_+l*A-u*m,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,i=this.y,a=this.z,l=e.elements;return this.x=l[0]*t+l[4]*i+l[8]*a,this.y=l[1]*t+l[5]*i+l[9]*a,this.z=l[2]*t+l[6]*i+l[10]*a,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this.z=ft(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this.z=ft(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ft(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,a=e.y,l=e.z,u=t.x,d=t.y,p=t.z;return this.x=a*p-l*d,this.y=l*u-i*p,this.z=i*d-a*u,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return up.copy(this).projectOnVector(e),this.sub(up)}reflect(e){return this.sub(up.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 i=this.dot(e)/t;return Math.acos(ft(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,a=this.z-e.z;return t*t+i*i+a*a}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const a=Math.sin(t)*e;return this.x=a*Math.sin(i),this.y=Math.cos(t)*e,this.z=a*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){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(),i=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=a,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,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const up=new se,sy=new Yi;class yi{constructor(e=new se(1/0,1/0,1/0),t=new se(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(es.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(es.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=es.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const l=i.getAttribute("position");if(t===!0&&l!==void 0&&e.isInstancedMesh!==!0)for(let u=0,d=l.count;u<d;u++)e.isMesh===!0?e.getVertexPosition(u,es):es.fromBufferAttribute(l,u),es.applyMatrix4(e.matrixWorld),this.expandByPoint(es);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),th.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),th.copy(i.boundingBox)),th.applyMatrix4(e.matrixWorld),this.union(th)}const a=e.children;for(let l=0,u=a.length;l<u;l++)this.expandByObject(a[l],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,es),es.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(oc),ih.subVectors(this.max,oc),oo.subVectors(e.a,oc),lo.subVectors(e.b,oc),co.subVectors(e.c,oc),pr.subVectors(lo,oo),mr.subVectors(co,lo),sa.subVectors(oo,co);let t=[0,-pr.z,pr.y,0,-mr.z,mr.y,0,-sa.z,sa.y,pr.z,0,-pr.x,mr.z,0,-mr.x,sa.z,0,-sa.x,-pr.y,pr.x,0,-mr.y,mr.x,0,-sa.y,sa.x,0];return!hp(t,oo,lo,co,ih)||(t=[1,0,0,0,1,0,0,0,1],!hp(t,oo,lo,co,ih))?!1:(nh.crossVectors(pr,mr),t=[nh.x,nh.y,nh.z],hp(t,oo,lo,co,ih))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,es).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(es).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:(ks[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ks[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ks[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ks[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ks[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ks[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ks[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ks[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ks),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ks=[new se,new se,new se,new se,new se,new se,new se,new se],es=new se,th=new yi,oo=new se,lo=new se,co=new se,pr=new se,mr=new se,sa=new se,oc=new se,ih=new se,nh=new se,ra=new se;function hp(o,e,t,i,a){for(let l=0,u=o.length-3;l<=u;l+=3){ra.fromArray(o,l);const d=a.x*Math.abs(ra.x)+a.y*Math.abs(ra.y)+a.z*Math.abs(ra.z),p=e.dot(ra),m=t.dot(ra),A=i.dot(ra);if(Math.max(-Math.max(p,m,A),Math.min(p,m,A))>d)return!1}return!0}const FM=new yi,lc=new se,dp=new se;class bn{constructor(e=new se,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 i=this.center;t!==void 0?i.copy(t):FM.setFromPoints(e).getCenter(i);let a=0;for(let l=0,u=e.length;l<u;l++)a=Math.max(a,i.distanceToSquared(e[l]));return this.radius=Math.sqrt(a),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 i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;lc.subVectors(e,this.center);const t=lc.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),a=(i-this.radius)*.5;this.center.addScaledVector(lc,a/i),this.radius+=a}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(dp.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(lc.copy(e.center).add(dp)),this.expandByPoint(lc.copy(e.center).sub(dp))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Us=new se,fp=new se,sh=new se,gr=new se,pp=new se,rh=new se,mp=new se;class Du{constructor(e=new se,t=new se(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,Us)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Us.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Us.copy(this.origin).addScaledVector(this.direction,t),Us.distanceToSquared(e))}distanceSqToSegment(e,t,i,a){fp.copy(e).add(t).multiplyScalar(.5),sh.copy(t).sub(e).normalize(),gr.copy(this.origin).sub(fp);const l=e.distanceTo(t)*.5,u=-this.direction.dot(sh),d=gr.dot(this.direction),p=-gr.dot(sh),m=gr.lengthSq(),A=Math.abs(1-u*u);let _,b,w,E;if(A>0)if(_=u*p-d,b=u*d-p,E=l*A,_>=0)if(b>=-E)if(b<=E){const C=1/A;_*=C,b*=C,w=_*(_+u*b+2*d)+b*(u*_+b+2*p)+m}else b=l,_=Math.max(0,-(u*b+d)),w=-_*_+b*(b+2*p)+m;else b=-l,_=Math.max(0,-(u*b+d)),w=-_*_+b*(b+2*p)+m;else b<=-E?(_=Math.max(0,-(-u*l+d)),b=_>0?-l:Math.min(Math.max(-l,-p),l),w=-_*_+b*(b+2*p)+m):b<=E?(_=0,b=Math.min(Math.max(-l,-p),l),w=b*(b+2*p)+m):(_=Math.max(0,-(u*l+d)),b=_>0?l:Math.min(Math.max(-l,-p),l),w=-_*_+b*(b+2*p)+m);else b=u>0?-l:l,_=Math.max(0,-(u*b+d)),w=-_*_+b*(b+2*p)+m;return i&&i.copy(this.origin).addScaledVector(this.direction,_),a&&a.copy(fp).addScaledVector(sh,b),w}intersectSphere(e,t){Us.subVectors(e.center,this.origin);const i=Us.dot(this.direction),a=Us.dot(Us)-i*i,l=e.radius*e.radius;if(a>l)return null;const u=Math.sqrt(l-a),d=i-u,p=i+u;return p<0?null:d<0?this.at(p,t):this.at(d,t)}intersectsSphere(e){return 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 i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,a,l,u,d,p;const m=1/this.direction.x,A=1/this.direction.y,_=1/this.direction.z,b=this.origin;return m>=0?(i=(e.min.x-b.x)*m,a=(e.max.x-b.x)*m):(i=(e.max.x-b.x)*m,a=(e.min.x-b.x)*m),A>=0?(l=(e.min.y-b.y)*A,u=(e.max.y-b.y)*A):(l=(e.max.y-b.y)*A,u=(e.min.y-b.y)*A),i>u||l>a||((l>i||isNaN(i))&&(i=l),(u<a||isNaN(a))&&(a=u),_>=0?(d=(e.min.z-b.z)*_,p=(e.max.z-b.z)*_):(d=(e.max.z-b.z)*_,p=(e.min.z-b.z)*_),i>p||d>a)||((d>i||i!==i)&&(i=d),(p<a||a!==a)&&(a=p),a<0)?null:this.at(i>=0?i:a,t)}intersectsBox(e){return this.intersectBox(e,Us)!==null}intersectTriangle(e,t,i,a,l){pp.subVectors(t,e),rh.subVectors(i,e),mp.crossVectors(pp,rh);let u=this.direction.dot(mp),d;if(u>0){if(a)return null;d=1}else if(u<0)d=-1,u=-u;else return null;gr.subVectors(this.origin,e);const p=d*this.direction.dot(rh.crossVectors(gr,rh));if(p<0)return null;const m=d*this.direction.dot(pp.cross(gr));if(m<0||p+m>u)return null;const A=-d*gr.dot(mp);return A<0?null:this.at(A/u,l)}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 tt{constructor(e,t,i,a,l,u,d,p,m,A,_,b,w,E,C,T){tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,a,l,u,d,p,m,A,_,b,w,E,C,T)}set(e,t,i,a,l,u,d,p,m,A,_,b,w,E,C,T){const x=this.elements;return x[0]=e,x[4]=t,x[8]=i,x[12]=a,x[1]=l,x[5]=u,x[9]=d,x[13]=p,x[2]=m,x[6]=A,x[10]=_,x[14]=b,x[3]=w,x[7]=E,x[11]=C,x[15]=T,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 tt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[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,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,a=1/uo.setFromMatrixColumn(e,0).length(),l=1/uo.setFromMatrixColumn(e,1).length(),u=1/uo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*a,t[1]=i[1]*a,t[2]=i[2]*a,t[3]=0,t[4]=i[4]*l,t[5]=i[5]*l,t[6]=i[6]*l,t[7]=0,t[8]=i[8]*u,t[9]=i[9]*u,t[10]=i[10]*u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,a=e.y,l=e.z,u=Math.cos(i),d=Math.sin(i),p=Math.cos(a),m=Math.sin(a),A=Math.cos(l),_=Math.sin(l);if(e.order==="XYZ"){const b=u*A,w=u*_,E=d*A,C=d*_;t[0]=p*A,t[4]=-p*_,t[8]=m,t[1]=w+E*m,t[5]=b-C*m,t[9]=-d*p,t[2]=C-b*m,t[6]=E+w*m,t[10]=u*p}else if(e.order==="YXZ"){const b=p*A,w=p*_,E=m*A,C=m*_;t[0]=b+C*d,t[4]=E*d-w,t[8]=u*m,t[1]=u*_,t[5]=u*A,t[9]=-d,t[2]=w*d-E,t[6]=C+b*d,t[10]=u*p}else if(e.order==="ZXY"){const b=p*A,w=p*_,E=m*A,C=m*_;t[0]=b-C*d,t[4]=-u*_,t[8]=E+w*d,t[1]=w+E*d,t[5]=u*A,t[9]=C-b*d,t[2]=-u*m,t[6]=d,t[10]=u*p}else if(e.order==="ZYX"){const b=u*A,w=u*_,E=d*A,C=d*_;t[0]=p*A,t[4]=E*m-w,t[8]=b*m+C,t[1]=p*_,t[5]=C*m+b,t[9]=w*m-E,t[2]=-m,t[6]=d*p,t[10]=u*p}else if(e.order==="YZX"){const b=u*p,w=u*m,E=d*p,C=d*m;t[0]=p*A,t[4]=C-b*_,t[8]=E*_+w,t[1]=_,t[5]=u*A,t[9]=-d*A,t[2]=-m*A,t[6]=w*_+E,t[10]=b-C*_}else if(e.order==="XZY"){const b=u*p,w=u*m,E=d*p,C=d*m;t[0]=p*A,t[4]=-_,t[8]=m*A,t[1]=b*_+C,t[5]=u*A,t[9]=w*_-E,t[2]=E*_-w,t[6]=d*A,t[10]=C*_+b}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($M,e,zM)}lookAt(e,t,i){const a=this.elements;return En.subVectors(e,t),En.lengthSq()===0&&(En.z=1),En.normalize(),Ar.crossVectors(i,En),Ar.lengthSq()===0&&(Math.abs(i.z)===1?En.x+=1e-4:En.z+=1e-4,En.normalize(),Ar.crossVectors(i,En)),Ar.normalize(),ah.crossVectors(En,Ar),a[0]=Ar.x,a[4]=ah.x,a[8]=En.x,a[1]=Ar.y,a[5]=ah.y,a[9]=En.y,a[2]=Ar.z,a[6]=ah.z,a[10]=En.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,a=t.elements,l=this.elements,u=i[0],d=i[4],p=i[8],m=i[12],A=i[1],_=i[5],b=i[9],w=i[13],E=i[2],C=i[6],T=i[10],x=i[14],P=i[3],M=i[7],B=i[11],D=i[15],G=a[0],U=a[4],V=a[8],k=a[12],z=a[1],Q=a[5],Z=a[9],K=a[13],s=a[2],H=a[6],y=a[10],ee=a[14],I=a[3],re=a[7],Ae=a[11],N=a[15];return l[0]=u*G+d*z+p*s+m*I,l[4]=u*U+d*Q+p*H+m*re,l[8]=u*V+d*Z+p*y+m*Ae,l[12]=u*k+d*K+p*ee+m*N,l[1]=A*G+_*z+b*s+w*I,l[5]=A*U+_*Q+b*H+w*re,l[9]=A*V+_*Z+b*y+w*Ae,l[13]=A*k+_*K+b*ee+w*N,l[2]=E*G+C*z+T*s+x*I,l[6]=E*U+C*Q+T*H+x*re,l[10]=E*V+C*Z+T*y+x*Ae,l[14]=E*k+C*K+T*ee+x*N,l[3]=P*G+M*z+B*s+D*I,l[7]=P*U+M*Q+B*H+D*re,l[11]=P*V+M*Z+B*y+D*Ae,l[15]=P*k+M*K+B*ee+D*N,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],i=e[4],a=e[8],l=e[12],u=e[1],d=e[5],p=e[9],m=e[13],A=e[2],_=e[6],b=e[10],w=e[14],E=e[3],C=e[7],T=e[11],x=e[15];return E*(+l*p*_-a*m*_-l*d*b+i*m*b+a*d*w-i*p*w)+C*(+t*p*w-t*m*b+l*u*b-a*u*w+a*m*A-l*p*A)+T*(+t*m*_-t*d*w-l*u*_+i*u*w+l*d*A-i*m*A)+x*(-a*d*A-t*p*_+t*d*b+a*u*_-i*u*b+i*p*A)}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,i){const a=this.elements;return e.isVector3?(a[12]=e.x,a[13]=e.y,a[14]=e.z):(a[12]=e,a[13]=t,a[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],l=e[3],u=e[4],d=e[5],p=e[6],m=e[7],A=e[8],_=e[9],b=e[10],w=e[11],E=e[12],C=e[13],T=e[14],x=e[15],P=_*T*m-C*b*m+C*p*w-d*T*w-_*p*x+d*b*x,M=E*b*m-A*T*m-E*p*w+u*T*w+A*p*x-u*b*x,B=A*C*m-E*_*m+E*d*w-u*C*w-A*d*x+u*_*x,D=E*_*p-A*C*p-E*d*b+u*C*b+A*d*T-u*_*T,G=t*P+i*M+a*B+l*D;if(G===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const U=1/G;return e[0]=P*U,e[1]=(C*b*l-_*T*l-C*a*w+i*T*w+_*a*x-i*b*x)*U,e[2]=(d*T*l-C*p*l+C*a*m-i*T*m-d*a*x+i*p*x)*U,e[3]=(_*p*l-d*b*l-_*a*m+i*b*m+d*a*w-i*p*w)*U,e[4]=M*U,e[5]=(A*T*l-E*b*l+E*a*w-t*T*w-A*a*x+t*b*x)*U,e[6]=(E*p*l-u*T*l-E*a*m+t*T*m+u*a*x-t*p*x)*U,e[7]=(u*b*l-A*p*l+A*a*m-t*b*m-u*a*w+t*p*w)*U,e[8]=B*U,e[9]=(E*_*l-A*C*l-E*i*w+t*C*w+A*i*x-t*_*x)*U,e[10]=(u*C*l-E*d*l+E*i*m-t*C*m-u*i*x+t*d*x)*U,e[11]=(A*d*l-u*_*l-A*i*m+t*_*m+u*i*w-t*d*w)*U,e[12]=D*U,e[13]=(A*C*a-E*_*a+E*i*b-t*C*b-A*i*T+t*_*T)*U,e[14]=(E*d*a-u*C*a-E*i*p+t*C*p+u*i*T-t*d*T)*U,e[15]=(u*_*a-A*d*a+A*i*p-t*_*p-u*i*b+t*d*b)*U,this}scale(e){const t=this.elements,i=e.x,a=e.y,l=e.z;return t[0]*=i,t[4]*=a,t[8]*=l,t[1]*=i,t[5]*=a,t[9]*=l,t[2]*=i,t[6]*=a,t[10]*=l,t[3]*=i,t[7]*=a,t[11]*=l,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],a=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,a))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),a=Math.sin(t),l=1-i,u=e.x,d=e.y,p=e.z,m=l*u,A=l*d;return this.set(m*u+i,m*d-a*p,m*p+a*d,0,m*d+a*p,A*d+i,A*p-a*u,0,m*p-a*d,A*p+a*u,l*p*p+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,a,l,u){return this.set(1,i,l,0,e,1,u,0,t,a,1,0,0,0,0,1),this}compose(e,t,i){const a=this.elements,l=t._x,u=t._y,d=t._z,p=t._w,m=l+l,A=u+u,_=d+d,b=l*m,w=l*A,E=l*_,C=u*A,T=u*_,x=d*_,P=p*m,M=p*A,B=p*_,D=i.x,G=i.y,U=i.z;return a[0]=(1-(C+x))*D,a[1]=(w+B)*D,a[2]=(E-M)*D,a[3]=0,a[4]=(w-B)*G,a[5]=(1-(b+x))*G,a[6]=(T+P)*G,a[7]=0,a[8]=(E+M)*U,a[9]=(T-P)*U,a[10]=(1-(b+C))*U,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,this}decompose(e,t,i){const a=this.elements;let l=uo.set(a[0],a[1],a[2]).length();const u=uo.set(a[4],a[5],a[6]).length(),d=uo.set(a[8],a[9],a[10]).length();this.determinant()<0&&(l=-l),e.x=a[12],e.y=a[13],e.z=a[14],ts.copy(this);const m=1/l,A=1/u,_=1/d;return ts.elements[0]*=m,ts.elements[1]*=m,ts.elements[2]*=m,ts.elements[4]*=A,ts.elements[5]*=A,ts.elements[6]*=A,ts.elements[8]*=_,ts.elements[9]*=_,ts.elements[10]*=_,t.setFromRotationMatrix(ts),i.x=l,i.y=u,i.z=d,this}makePerspective(e,t,i,a,l,u,d=sr){const p=this.elements,m=2*l/(t-e),A=2*l/(i-a),_=(t+e)/(t-e),b=(i+a)/(i-a);let w,E;if(d===sr)w=-(u+l)/(u-l),E=-2*u*l/(u-l);else if(d===Jd)w=-u/(u-l),E=-u*l/(u-l);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+d);return p[0]=m,p[4]=0,p[8]=_,p[12]=0,p[1]=0,p[5]=A,p[9]=b,p[13]=0,p[2]=0,p[6]=0,p[10]=w,p[14]=E,p[3]=0,p[7]=0,p[11]=-1,p[15]=0,this}makeOrthographic(e,t,i,a,l,u,d=sr){const p=this.elements,m=1/(t-e),A=1/(i-a),_=1/(u-l),b=(t+e)*m,w=(i+a)*A;let E,C;if(d===sr)E=(u+l)*_,C=-2*_;else if(d===Jd)E=l*_,C=-1*_;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+d);return p[0]=2*m,p[4]=0,p[8]=0,p[12]=-b,p[1]=0,p[5]=2*A,p[9]=0,p[13]=-w,p[2]=0,p[6]=0,p[10]=C,p[14]=-E,p[3]=0,p[7]=0,p[11]=0,p[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let a=0;a<16;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const uo=new se,ts=new tt,$M=new se(0,0,0),zM=new se(1,1,1),Ar=new se,ah=new se,En=new se,ry=new tt,ay=new Yi;class qn{constructor(e=0,t=0,i=0,a=qn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=a}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,i,a=this._order){return this._x=e,this._y=t,this._z=i,this._order=a,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,i=!0){const a=e.elements,l=a[0],u=a[4],d=a[8],p=a[1],m=a[5],A=a[9],_=a[2],b=a[6],w=a[10];switch(t){case"XYZ":this._y=Math.asin(ft(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-A,w),this._z=Math.atan2(-u,l)):(this._x=Math.atan2(b,m),this._z=0);break;case"YXZ":this._x=Math.asin(-ft(A,-1,1)),Math.abs(A)<.9999999?(this._y=Math.atan2(d,w),this._z=Math.atan2(p,m)):(this._y=Math.atan2(-_,l),this._z=0);break;case"ZXY":this._x=Math.asin(ft(b,-1,1)),Math.abs(b)<.9999999?(this._y=Math.atan2(-_,w),this._z=Math.atan2(-u,m)):(this._y=0,this._z=Math.atan2(p,l));break;case"ZYX":this._y=Math.asin(-ft(_,-1,1)),Math.abs(_)<.9999999?(this._x=Math.atan2(b,w),this._z=Math.atan2(p,l)):(this._x=0,this._z=Math.atan2(-u,m));break;case"YZX":this._z=Math.asin(ft(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(-A,m),this._y=Math.atan2(-_,l)):(this._x=0,this._y=Math.atan2(d,w));break;case"XZY":this._z=Math.asin(-ft(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(b,m),this._y=Math.atan2(d,l)):(this._x=Math.atan2(-A,w),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ay.setFromEuler(this),this.setFromQuaternion(ay,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}}qn.DEFAULT_ORDER="XYZ";class O0{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 GM=0;const oy=new se,ho=new Yi,Fs=new tt,oh=new se,cc=new se,HM=new se,VM=new Yi,ly=new se(1,0,0),cy=new se(0,1,0),uy=new se(0,0,1),hy={type:"added"},QM={type:"removed"},fo={type:"childadded",child:null},gp={type:"childremoved",child:null};class Qt extends fs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:GM++}),this.uuid=us(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Qt.DEFAULT_UP.clone();const e=new se,t=new qn,i=new Yi,a=new se(1,1,1);function l(){i.setFromEuler(t,!1)}function u(){t.setFromQuaternion(i,void 0,!1)}t._onChange(l),i._onChange(u),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new tt},normalMatrix:{value:new ot}}),this.matrix=new tt,this.matrixWorld=new tt,this.matrixAutoUpdate=Qt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Qt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new O0,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],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 ho.setFromAxisAngle(e,t),this.quaternion.multiply(ho),this}rotateOnWorldAxis(e,t){return ho.setFromAxisAngle(e,t),this.quaternion.premultiply(ho),this}rotateX(e){return this.rotateOnAxis(ly,e)}rotateY(e){return this.rotateOnAxis(cy,e)}rotateZ(e){return this.rotateOnAxis(uy,e)}translateOnAxis(e,t){return oy.copy(e).applyQuaternion(this.quaternion),this.position.add(oy.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ly,e)}translateY(e){return this.translateOnAxis(cy,e)}translateZ(e){return this.translateOnAxis(uy,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Fs.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?oh.copy(e):oh.set(e,t,i);const a=this.parent;this.updateWorldMatrix(!0,!1),cc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Fs.lookAt(cc,oh,this.up):Fs.lookAt(oh,cc,this.up),this.quaternion.setFromRotationMatrix(Fs),a&&(Fs.extractRotation(a.matrixWorld),ho.setFromRotationMatrix(Fs),this.quaternion.premultiply(ho.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(hy),fo.child=e,this.dispatchEvent(fo),fo.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(QM),gp.child=e,this.dispatchEvent(gp),gp.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),Fs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Fs.multiply(e.parent.matrixWorld)),e.applyMatrix4(Fs),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(hy),fo.child=e,this.dispatchEvent(fo),fo.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 i=0,a=this.children.length;i<a;i++){const u=this.children[i].getObjectByProperty(e,t);if(u!==void 0)return u}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const a=this.children;for(let l=0,u=a.length;l<u;l++)a[l].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cc,e,HM),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cc,VM,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 i=0,a=t.length;i<a;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,a=t.length;i<a;i++)t[i].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 i=0,a=t.length;i<a;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.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 a=this.children;for(let l=0,u=a.length;l<u;l++)a[l].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const a={};a.uuid=this.uuid,a.type=this.type,this.name!==""&&(a.name=this.name),this.castShadow===!0&&(a.castShadow=!0),this.receiveShadow===!0&&(a.receiveShadow=!0),this.visible===!1&&(a.visible=!1),this.frustumCulled===!1&&(a.frustumCulled=!1),this.renderOrder!==0&&(a.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.visibility=this._visibility,a.active=this._active,a.bounds=this._bounds.map(d=>({boxInitialized:d.boxInitialized,boxMin:d.box.min.toArray(),boxMax:d.box.max.toArray(),sphereInitialized:d.sphereInitialized,sphereRadius:d.sphere.radius,sphereCenter:d.sphere.center.toArray()})),a.maxInstanceCount=this._maxInstanceCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.geometryCount=this._geometryCount,a.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(a.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(a.boundingSphere={center:a.boundingSphere.center.toArray(),radius:a.boundingSphere.radius}),this.boundingBox!==null&&(a.boundingBox={min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}));function l(d,p){return d[p.uuid]===void 0&&(d[p.uuid]=p.toJSON(e)),p.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=l(e.geometries,this.geometry);const d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){const p=d.shapes;if(Array.isArray(p))for(let m=0,A=p.length;m<A;m++){const _=p[m];l(e.shapes,_)}else l(e.shapes,p)}}if(this.isSkinnedMesh&&(a.bindMode=this.bindMode,a.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(l(e.skeletons,this.skeleton),a.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const d=[];for(let p=0,m=this.material.length;p<m;p++)d.push(l(e.materials,this.material[p]));a.material=d}else a.material=l(e.materials,this.material);if(this.children.length>0){a.children=[];for(let d=0;d<this.children.length;d++)a.children.push(this.children[d].toJSON(e).object)}if(this.animations.length>0){a.animations=[];for(let d=0;d<this.animations.length;d++){const p=this.animations[d];a.animations.push(l(e.animations,p))}}if(t){const d=u(e.geometries),p=u(e.materials),m=u(e.textures),A=u(e.images),_=u(e.shapes),b=u(e.skeletons),w=u(e.animations),E=u(e.nodes);d.length>0&&(i.geometries=d),p.length>0&&(i.materials=p),m.length>0&&(i.textures=m),A.length>0&&(i.images=A),_.length>0&&(i.shapes=_),b.length>0&&(i.skeletons=b),w.length>0&&(i.animations=w),E.length>0&&(i.nodes=E)}return i.object=a,i;function u(d){const p=[];for(const m in d){const A=d[m];delete A.metadata,p.push(A)}return p}}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 i=0;i<e.children.length;i++){const a=e.children[i];this.add(a.clone())}return this}}Qt.DEFAULT_UP=new se(0,1,0);Qt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Qt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const is=new se,$s=new se,Ap=new se,zs=new se,po=new se,mo=new se,dy=new se,_p=new se,yp=new se,bp=new se,vp=new Rt,wp=new Rt,Ep=new Rt;class Mn{constructor(e=new se,t=new se,i=new se){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,a){a.subVectors(i,t),is.subVectors(e,t),a.cross(is);const l=a.lengthSq();return l>0?a.multiplyScalar(1/Math.sqrt(l)):a.set(0,0,0)}static getBarycoord(e,t,i,a,l){is.subVectors(a,t),$s.subVectors(i,t),Ap.subVectors(e,t);const u=is.dot(is),d=is.dot($s),p=is.dot(Ap),m=$s.dot($s),A=$s.dot(Ap),_=u*m-d*d;if(_===0)return l.set(0,0,0),null;const b=1/_,w=(m*p-d*A)*b,E=(u*A-d*p)*b;return l.set(1-w-E,E,w)}static containsPoint(e,t,i,a){return this.getBarycoord(e,t,i,a,zs)===null?!1:zs.x>=0&&zs.y>=0&&zs.x+zs.y<=1}static getInterpolation(e,t,i,a,l,u,d,p){return this.getBarycoord(e,t,i,a,zs)===null?(p.x=0,p.y=0,"z"in p&&(p.z=0),"w"in p&&(p.w=0),null):(p.setScalar(0),p.addScaledVector(l,zs.x),p.addScaledVector(u,zs.y),p.addScaledVector(d,zs.z),p)}static getInterpolatedAttribute(e,t,i,a,l,u){return vp.setScalar(0),wp.setScalar(0),Ep.setScalar(0),vp.fromBufferAttribute(e,t),wp.fromBufferAttribute(e,i),Ep.fromBufferAttribute(e,a),u.setScalar(0),u.addScaledVector(vp,l.x),u.addScaledVector(wp,l.y),u.addScaledVector(Ep,l.z),u}static isFrontFacing(e,t,i,a){return is.subVectors(i,t),$s.subVectors(e,t),is.cross($s).dot(a)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,a){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[a]),this}setFromAttributeAndIndices(e,t,i,a){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,a),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 is.subVectors(this.c,this.b),$s.subVectors(this.a,this.b),is.cross($s).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Mn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Mn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,a,l){return Mn.getInterpolation(e,this.a,this.b,this.c,t,i,a,l)}containsPoint(e){return Mn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Mn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,a=this.b,l=this.c;let u,d;po.subVectors(a,i),mo.subVectors(l,i),_p.subVectors(e,i);const p=po.dot(_p),m=mo.dot(_p);if(p<=0&&m<=0)return t.copy(i);yp.subVectors(e,a);const A=po.dot(yp),_=mo.dot(yp);if(A>=0&&_<=A)return t.copy(a);const b=p*_-A*m;if(b<=0&&p>=0&&A<=0)return u=p/(p-A),t.copy(i).addScaledVector(po,u);bp.subVectors(e,l);const w=po.dot(bp),E=mo.dot(bp);if(E>=0&&w<=E)return t.copy(l);const C=w*m-p*E;if(C<=0&&m>=0&&E<=0)return d=m/(m-E),t.copy(i).addScaledVector(mo,d);const T=A*E-w*_;if(T<=0&&_-A>=0&&w-E>=0)return dy.subVectors(l,a),d=(_-A)/(_-A+(w-E)),t.copy(a).addScaledVector(dy,d);const x=1/(T+C+b);return u=C*x,d=b*x,t.copy(i).addScaledVector(po,u).addScaledVector(mo,d)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const xS={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},_r={h:0,s:0,l:0},lh={h:0,s:0,l:0};function xp(o,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?o+(e-o)*6*t:t<1/2?e:t<2/3?o+(e-o)*6*(2/3-t):o}class Ye{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const a=e;a&&a.isColor?this.copy(a):typeof a=="number"?this.setHex(a):typeof a=="string"&&this.setStyle(a)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ht){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,vt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,a=vt.workingColorSpace){return this.r=e,this.g=t,this.b=i,vt.toWorkingColorSpace(this,a),this}setHSL(e,t,i,a=vt.workingColorSpace){if(e=D0(e,1),t=ft(t,0,1),i=ft(i,0,1),t===0)this.r=this.g=this.b=i;else{const l=i<=.5?i*(1+t):i+t-i*t,u=2*i-l;this.r=xp(u,l,e+1/3),this.g=xp(u,l,e),this.b=xp(u,l,e-1/3)}return vt.toWorkingColorSpace(this,a),this}setStyle(e,t=Ht){function i(l){l!==void 0&&parseFloat(l)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let a;if(a=/^(\w+)\(([^\)]*)\)/.exec(e)){let l;const u=a[1],d=a[2];switch(u){case"rgb":case"rgba":if(l=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(l[4]),this.setRGB(Math.min(255,parseInt(l[1],10))/255,Math.min(255,parseInt(l[2],10))/255,Math.min(255,parseInt(l[3],10))/255,t);if(l=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(l[4]),this.setRGB(Math.min(100,parseInt(l[1],10))/100,Math.min(100,parseInt(l[2],10))/100,Math.min(100,parseInt(l[3],10))/100,t);break;case"hsl":case"hsla":if(l=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(l[4]),this.setHSL(parseFloat(l[1])/360,parseFloat(l[2])/100,parseFloat(l[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(a=/^\#([A-Fa-f\d]+)$/.exec(e)){const l=a[1],u=l.length;if(u===3)return this.setRGB(parseInt(l.charAt(0),16)/15,parseInt(l.charAt(1),16)/15,parseInt(l.charAt(2),16)/15,t);if(u===6)return this.setHex(parseInt(l,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=Ht){const i=xS[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=or(e.r),this.g=or(e.g),this.b=or(e.b),this}copyLinearToSRGB(e){return this.r=al(e.r),this.g=al(e.g),this.b=al(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ht){return vt.fromWorkingColorSpace(Qi.copy(this),e),Math.round(ft(Qi.r*255,0,255))*65536+Math.round(ft(Qi.g*255,0,255))*256+Math.round(ft(Qi.b*255,0,255))}getHexString(e=Ht){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=vt.workingColorSpace){vt.fromWorkingColorSpace(Qi.copy(this),t);const i=Qi.r,a=Qi.g,l=Qi.b,u=Math.max(i,a,l),d=Math.min(i,a,l);let p,m;const A=(d+u)/2;if(d===u)p=0,m=0;else{const _=u-d;switch(m=A<=.5?_/(u+d):_/(2-u-d),u){case i:p=(a-l)/_+(a<l?6:0);break;case a:p=(l-i)/_+2;break;case l:p=(i-a)/_+4;break}p/=6}return e.h=p,e.s=m,e.l=A,e}getRGB(e,t=vt.workingColorSpace){return vt.fromWorkingColorSpace(Qi.copy(this),t),e.r=Qi.r,e.g=Qi.g,e.b=Qi.b,e}getStyle(e=Ht){vt.fromWorkingColorSpace(Qi.copy(this),e);const t=Qi.r,i=Qi.g,a=Qi.b;return e!==Ht?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${a.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(a*255)})`}offsetHSL(e,t,i){return this.getHSL(_r),this.setHSL(_r.h+e,_r.s+t,_r.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(_r),e.getHSL(lh);const i=lu(_r.h,lh.h,t),a=lu(_r.s,lh.s,t),l=lu(_r.l,lh.l,t);return this.setHSL(i,a,l),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,a=this.b,l=e.elements;return this.r=l[0]*t+l[3]*i+l[6]*a,this.g=l[1]*t+l[4]*i+l[7]*a,this.b=l[2]*t+l[5]*i+l[8]*a,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 Qi=new Ye;Ye.NAMES=xS;let jM=0,jn=class extends fs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:jM++}),this.uuid=us(),this.name="",this.type="Material",this.blending=sl,this.side=hs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Vg,this.blendDst=Qg,this.blendEquation=Ia,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ye(0,0,0),this.blendAlpha=0,this.depthFunc=ml,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=J_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ro,this.stencilZFail=ro,this.stencilZPass=ro,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const a=this[t];if(a===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}a&&a.isColor?a.set(i):a&&a.isVector3&&i&&i.isVector3?a.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==sl&&(i.blending=this.blending),this.side!==hs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Vg&&(i.blendSrc=this.blendSrc),this.blendDst!==Qg&&(i.blendDst=this.blendDst),this.blendEquation!==Ia&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==ml&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==J_&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ro&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ro&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ro&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function a(l){const u=[];for(const d in l){const p=l[d];delete p.metadata,u.push(p)}return u}if(t){const l=a(e.textures),u=a(e.images);l.length>0&&(i.textures=l),u.length>0&&(i.images=u)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const a=t.length;i=new Array(a);for(let l=0;l!==a;++l)i[l]=t[l].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}};class Pi extends jn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ye(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 qn,this.combine=oS,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 ir=qM();function qM(){const o=new ArrayBuffer(4),e=new Float32Array(o),t=new Uint32Array(o),i=new Uint32Array(512),a=new Uint32Array(512);for(let p=0;p<256;++p){const m=p-127;m<-27?(i[p]=0,i[p|256]=32768,a[p]=24,a[p|256]=24):m<-14?(i[p]=1024>>-m-14,i[p|256]=1024>>-m-14|32768,a[p]=-m-1,a[p|256]=-m-1):m<=15?(i[p]=m+15<<10,i[p|256]=m+15<<10|32768,a[p]=13,a[p|256]=13):m<128?(i[p]=31744,i[p|256]=64512,a[p]=24,a[p|256]=24):(i[p]=31744,i[p|256]=64512,a[p]=13,a[p|256]=13)}const l=new Uint32Array(2048),u=new Uint32Array(64),d=new Uint32Array(64);for(let p=1;p<1024;++p){let m=p<<13,A=0;for(;(m&8388608)===0;)m<<=1,A-=8388608;m&=-8388609,A+=947912704,l[p]=m|A}for(let p=1024;p<2048;++p)l[p]=939524096+(p-1024<<13);for(let p=1;p<31;++p)u[p]=p<<23;u[31]=1199570944,u[32]=2147483648;for(let p=33;p<63;++p)u[p]=2147483648+(p-32<<23);u[63]=3347054592;for(let p=1;p<64;++p)p!==32&&(d[p]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:a,mantissaTable:l,exponentTable:u,offsetTable:d}}function WM(o){Math.abs(o)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),o=ft(o,-65504,65504),ir.floatView[0]=o;const e=ir.uint32View[0],t=e>>23&511;return ir.baseTable[t]+((e&8388607)>>ir.shiftTable[t])}function YM(o){const e=o>>10;return ir.uint32View[0]=ir.mantissaTable[ir.offsetTable[e]+(o&1023)]+ir.exponentTable[e],ir.floatView[0]}const ch={toHalfFloat:WM,fromHalfFloat:YM},fi=new se,uh=new Ve;class Vt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=yA,this.updateRanges=[],this.gpuType=oi,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,i){e*=this.itemSize,i*=t.itemSize;for(let a=0,l=this.itemSize;a<l;a++)this.array[e+a]=t.array[i+a];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)uh.fromBufferAttribute(this,t),uh.applyMatrix3(e),this.setXY(t,uh.x,uh.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyMatrix3(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyMatrix4(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyNormalMatrix(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.transformDirection(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=as(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ut(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=as(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=as(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ut(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=as(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ut(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=as(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,a){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array),a=Ut(a,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=a,this}setXYZW(e,t,i,a,l){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array),a=Ut(a,this.array),l=Ut(l,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=a,this.array[e+3]=l,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!==yA&&(e.usage=this.usage),e}}class SS extends Vt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class CS extends Vt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class $i extends Vt{constructor(e,t,i){super(new Float32Array(e),t,i)}}let XM=0;const Un=new tt,Sp=new Qt,go=new se,xn=new yi,uc=new yi,xi=new se;class Di extends fs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:XM++}),this.uuid=us(),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(vS(e)?CS:SS)(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,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const l=new ot().getNormalMatrix(e);i.applyNormalMatrix(l),i.needsUpdate=!0}const a=this.attributes.tangent;return a!==void 0&&(a.transformDirection(e),a.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Un.makeRotationFromQuaternion(e),this.applyMatrix4(Un),this}rotateX(e){return Un.makeRotationX(e),this.applyMatrix4(Un),this}rotateY(e){return Un.makeRotationY(e),this.applyMatrix4(Un),this}rotateZ(e){return Un.makeRotationZ(e),this.applyMatrix4(Un),this}translate(e,t,i){return Un.makeTranslation(e,t,i),this.applyMatrix4(Un),this}scale(e,t,i){return Un.makeScale(e,t,i),this.applyMatrix4(Un),this}lookAt(e){return Sp.lookAt(e),Sp.updateMatrix(),this.applyMatrix4(Sp.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(go).negate(),this.translate(go.x,go.y,go.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let a=0,l=e.length;a<l;a++){const u=e[a];i.push(u.x,u.y,u.z||0)}this.setAttribute("position",new $i(i,3))}else{const i=Math.min(e.length,t.count);for(let a=0;a<i;a++){const l=e[a];t.setXYZ(a,l.x,l.y,l.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 yi);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 se(-1/0,-1/0,-1/0),new se(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,a=t.length;i<a;i++){const l=t[i];xn.setFromBufferAttribute(l),this.morphTargetsRelative?(xi.addVectors(this.boundingBox.min,xn.min),this.boundingBox.expandByPoint(xi),xi.addVectors(this.boundingBox.max,xn.max),this.boundingBox.expandByPoint(xi)):(this.boundingBox.expandByPoint(xn.min),this.boundingBox.expandByPoint(xn.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 bn);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 se,1/0);return}if(e){const i=this.boundingSphere.center;if(xn.setFromBufferAttribute(e),t)for(let l=0,u=t.length;l<u;l++){const d=t[l];uc.setFromBufferAttribute(d),this.morphTargetsRelative?(xi.addVectors(xn.min,uc.min),xn.expandByPoint(xi),xi.addVectors(xn.max,uc.max),xn.expandByPoint(xi)):(xn.expandByPoint(uc.min),xn.expandByPoint(uc.max))}xn.getCenter(i);let a=0;for(let l=0,u=e.count;l<u;l++)xi.fromBufferAttribute(e,l),a=Math.max(a,i.distanceToSquared(xi));if(t)for(let l=0,u=t.length;l<u;l++){const d=t[l],p=this.morphTargetsRelative;for(let m=0,A=d.count;m<A;m++)xi.fromBufferAttribute(d,m),p&&(go.fromBufferAttribute(e,m),xi.add(go)),a=Math.max(a,i.distanceToSquared(xi))}this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}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 i=t.position,a=t.normal,l=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Vt(new Float32Array(4*i.count),4));const u=this.getAttribute("tangent"),d=[],p=[];for(let V=0;V<i.count;V++)d[V]=new se,p[V]=new se;const m=new se,A=new se,_=new se,b=new Ve,w=new Ve,E=new Ve,C=new se,T=new se;function x(V,k,z){m.fromBufferAttribute(i,V),A.fromBufferAttribute(i,k),_.fromBufferAttribute(i,z),b.fromBufferAttribute(l,V),w.fromBufferAttribute(l,k),E.fromBufferAttribute(l,z),A.sub(m),_.sub(m),w.sub(b),E.sub(b);const Q=1/(w.x*E.y-E.x*w.y);isFinite(Q)&&(C.copy(A).multiplyScalar(E.y).addScaledVector(_,-w.y).multiplyScalar(Q),T.copy(_).multiplyScalar(w.x).addScaledVector(A,-E.x).multiplyScalar(Q),d[V].add(C),d[k].add(C),d[z].add(C),p[V].add(T),p[k].add(T),p[z].add(T))}let P=this.groups;P.length===0&&(P=[{start:0,count:e.count}]);for(let V=0,k=P.length;V<k;++V){const z=P[V],Q=z.start,Z=z.count;for(let K=Q,s=Q+Z;K<s;K+=3)x(e.getX(K+0),e.getX(K+1),e.getX(K+2))}const M=new se,B=new se,D=new se,G=new se;function U(V){D.fromBufferAttribute(a,V),G.copy(D);const k=d[V];M.copy(k),M.sub(D.multiplyScalar(D.dot(k))).normalize(),B.crossVectors(G,k);const Q=B.dot(p[V])<0?-1:1;u.setXYZW(V,M.x,M.y,M.z,Q)}for(let V=0,k=P.length;V<k;++V){const z=P[V],Q=z.start,Z=z.count;for(let K=Q,s=Q+Z;K<s;K+=3)U(e.getX(K+0)),U(e.getX(K+1)),U(e.getX(K+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Vt(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let b=0,w=i.count;b<w;b++)i.setXYZ(b,0,0,0);const a=new se,l=new se,u=new se,d=new se,p=new se,m=new se,A=new se,_=new se;if(e)for(let b=0,w=e.count;b<w;b+=3){const E=e.getX(b+0),C=e.getX(b+1),T=e.getX(b+2);a.fromBufferAttribute(t,E),l.fromBufferAttribute(t,C),u.fromBufferAttribute(t,T),A.subVectors(u,l),_.subVectors(a,l),A.cross(_),d.fromBufferAttribute(i,E),p.fromBufferAttribute(i,C),m.fromBufferAttribute(i,T),d.add(A),p.add(A),m.add(A),i.setXYZ(E,d.x,d.y,d.z),i.setXYZ(C,p.x,p.y,p.z),i.setXYZ(T,m.x,m.y,m.z)}else for(let b=0,w=t.count;b<w;b+=3)a.fromBufferAttribute(t,b+0),l.fromBufferAttribute(t,b+1),u.fromBufferAttribute(t,b+2),A.subVectors(u,l),_.subVectors(a,l),A.cross(_),i.setXYZ(b+0,A.x,A.y,A.z),i.setXYZ(b+1,A.x,A.y,A.z),i.setXYZ(b+2,A.x,A.y,A.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)xi.fromBufferAttribute(e,t),xi.normalize(),e.setXYZ(t,xi.x,xi.y,xi.z)}toNonIndexed(){function e(d,p){const m=d.array,A=d.itemSize,_=d.normalized,b=new m.constructor(p.length*A);let w=0,E=0;for(let C=0,T=p.length;C<T;C++){d.isInterleavedBufferAttribute?w=p[C]*d.data.stride+d.offset:w=p[C]*A;for(let x=0;x<A;x++)b[E++]=m[w++]}return new Vt(b,A,_)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Di,i=this.index.array,a=this.attributes;for(const d in a){const p=a[d],m=e(p,i);t.setAttribute(d,m)}const l=this.morphAttributes;for(const d in l){const p=[],m=l[d];for(let A=0,_=m.length;A<_;A++){const b=m[A],w=e(b,i);p.push(w)}t.morphAttributes[d]=p}t.morphTargetsRelative=this.morphTargetsRelative;const u=this.groups;for(let d=0,p=u.length;d<p;d++){const m=u[d];t.addGroup(m.start,m.count,m.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const p=this.parameters;for(const m in p)p[m]!==void 0&&(e[m]=p[m]);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 i=this.attributes;for(const p in i){const m=i[p];e.data.attributes[p]=m.toJSON(e.data)}const a={};let l=!1;for(const p in this.morphAttributes){const m=this.morphAttributes[p],A=[];for(let _=0,b=m.length;_<b;_++){const w=m[_];A.push(w.toJSON(e.data))}A.length>0&&(a[p]=A,l=!0)}l&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);const u=this.groups;u.length>0&&(e.data.groups=JSON.parse(JSON.stringify(u)));const d=this.boundingSphere;return d!==null&&(e.data.boundingSphere={center:d.center.toArray(),radius:d.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const a=e.attributes;for(const m in a){const A=a[m];this.setAttribute(m,A.clone(t))}const l=e.morphAttributes;for(const m in l){const A=[],_=l[m];for(let b=0,w=_.length;b<w;b++)A.push(_[b].clone(t));this.morphAttributes[m]=A}this.morphTargetsRelative=e.morphTargetsRelative;const u=e.groups;for(let m=0,A=u.length;m<A;m++){const _=u[m];this.addGroup(_.start,_.count,_.materialIndex)}const d=e.boundingBox;d!==null&&(this.boundingBox=d.clone());const p=e.boundingSphere;return p!==null&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const fy=new tt,aa=new Du,hh=new bn,py=new se,dh=new se,fh=new se,ph=new se,Cp=new se,mh=new se,my=new se,gh=new se;let lt=class extends Qt{constructor(e=new Di,t=new Pi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let l=0,u=a.length;l<u;l++){const d=a[l].name||String(l);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=l}}}}getVertexPosition(e,t){const i=this.geometry,a=i.attributes.position,l=i.morphAttributes.position,u=i.morphTargetsRelative;t.fromBufferAttribute(a,e);const d=this.morphTargetInfluences;if(l&&d){mh.set(0,0,0);for(let p=0,m=l.length;p<m;p++){const A=d[p],_=l[p];A!==0&&(Cp.fromBufferAttribute(_,e),u?mh.addScaledVector(Cp,A):mh.addScaledVector(Cp.sub(t),A))}t.add(mh)}return t}raycast(e,t){const i=this.geometry,a=this.material,l=this.matrixWorld;a!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),hh.copy(i.boundingSphere),hh.applyMatrix4(l),aa.copy(e.ray).recast(e.near),!(hh.containsPoint(aa.origin)===!1&&(aa.intersectSphere(hh,py)===null||aa.origin.distanceToSquared(py)>(e.far-e.near)**2))&&(fy.copy(l).invert(),aa.copy(e.ray).applyMatrix4(fy),!(i.boundingBox!==null&&aa.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,aa)))}_computeIntersections(e,t,i){let a;const l=this.geometry,u=this.material,d=l.index,p=l.attributes.position,m=l.attributes.uv,A=l.attributes.uv1,_=l.attributes.normal,b=l.groups,w=l.drawRange;if(d!==null)if(Array.isArray(u))for(let E=0,C=b.length;E<C;E++){const T=b[E],x=u[T.materialIndex],P=Math.max(T.start,w.start),M=Math.min(d.count,Math.min(T.start+T.count,w.start+w.count));for(let B=P,D=M;B<D;B+=3){const G=d.getX(B),U=d.getX(B+1),V=d.getX(B+2);a=Ah(this,x,e,i,m,A,_,G,U,V),a&&(a.faceIndex=Math.floor(B/3),a.face.materialIndex=T.materialIndex,t.push(a))}}else{const E=Math.max(0,w.start),C=Math.min(d.count,w.start+w.count);for(let T=E,x=C;T<x;T+=3){const P=d.getX(T),M=d.getX(T+1),B=d.getX(T+2);a=Ah(this,u,e,i,m,A,_,P,M,B),a&&(a.faceIndex=Math.floor(T/3),t.push(a))}}else if(p!==void 0)if(Array.isArray(u))for(let E=0,C=b.length;E<C;E++){const T=b[E],x=u[T.materialIndex],P=Math.max(T.start,w.start),M=Math.min(p.count,Math.min(T.start+T.count,w.start+w.count));for(let B=P,D=M;B<D;B+=3){const G=B,U=B+1,V=B+2;a=Ah(this,x,e,i,m,A,_,G,U,V),a&&(a.faceIndex=Math.floor(B/3),a.face.materialIndex=T.materialIndex,t.push(a))}}else{const E=Math.max(0,w.start),C=Math.min(p.count,w.start+w.count);for(let T=E,x=C;T<x;T+=3){const P=T,M=T+1,B=T+2;a=Ah(this,u,e,i,m,A,_,P,M,B),a&&(a.faceIndex=Math.floor(T/3),t.push(a))}}}};function KM(o,e,t,i,a,l,u,d){let p;if(e.side===Fi?p=i.intersectTriangle(u,l,a,!0,d):p=i.intersectTriangle(a,l,u,e.side===hs,d),p===null)return null;gh.copy(d),gh.applyMatrix4(o.matrixWorld);const m=t.ray.origin.distanceTo(gh);return m<t.near||m>t.far?null:{distance:m,point:gh.clone(),object:o}}function Ah(o,e,t,i,a,l,u,d,p,m){o.getVertexPosition(d,dh),o.getVertexPosition(p,fh),o.getVertexPosition(m,ph);const A=KM(o,e,t,i,dh,fh,ph,my);if(A){const _=new se;Mn.getBarycoord(my,dh,fh,ph,_),a&&(A.uv=Mn.getInterpolatedAttribute(a,d,p,m,_,new Ve)),l&&(A.uv1=Mn.getInterpolatedAttribute(l,d,p,m,_,new Ve)),u&&(A.normal=Mn.getInterpolatedAttribute(u,d,p,m,_,new se),A.normal.dot(i.direction)>0&&A.normal.multiplyScalar(-1));const b={a:d,b:p,c:m,normal:new se,materialIndex:0};Mn.getNormal(dh,fh,ph,b.normal),A.face=b,A.barycoord=_}return A}class Wn extends Di{constructor(e=1,t=1,i=1,a=1,l=1,u=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:a,heightSegments:l,depthSegments:u};const d=this;a=Math.floor(a),l=Math.floor(l),u=Math.floor(u);const p=[],m=[],A=[],_=[];let b=0,w=0;E("z","y","x",-1,-1,i,t,e,u,l,0),E("z","y","x",1,-1,i,t,-e,u,l,1),E("x","z","y",1,1,e,i,t,a,u,2),E("x","z","y",1,-1,e,i,-t,a,u,3),E("x","y","z",1,-1,e,t,i,a,l,4),E("x","y","z",-1,-1,e,t,-i,a,l,5),this.setIndex(p),this.setAttribute("position",new $i(m,3)),this.setAttribute("normal",new $i(A,3)),this.setAttribute("uv",new $i(_,2));function E(C,T,x,P,M,B,D,G,U,V,k){const z=B/U,Q=D/V,Z=B/2,K=D/2,s=G/2,H=U+1,y=V+1;let ee=0,I=0;const re=new se;for(let Ae=0;Ae<y;Ae++){const N=Ae*Q-K;for(let n=0;n<H;n++){const r=n*z-Z;re[C]=r*P,re[T]=N*M,re[x]=s,m.push(re.x,re.y,re.z),re[C]=0,re[T]=0,re[x]=G>0?1:-1,A.push(re.x,re.y,re.z),_.push(n/U),_.push(1-Ae/V),ee+=1}}for(let Ae=0;Ae<V;Ae++)for(let N=0;N<U;N++){const n=b+N+H*Ae,r=b+N+H*(Ae+1),c=b+(N+1)+H*(Ae+1),h=b+(N+1)+H*Ae;p.push(n,r,h),p.push(r,c,h),I+=6}d.addGroup(w,I,k),w+=I,b+=ee}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wn(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Sl(o){const e={};for(const t in o){e[t]={};for(const i in o[t]){const a=o[t][i];a&&(a.isColor||a.isMatrix3||a.isMatrix4||a.isVector2||a.isVector3||a.isVector4||a.isTexture||a.isQuaternion)?a.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=a.clone():Array.isArray(a)?e[t][i]=a.slice():e[t][i]=a}}return e}function rn(o){const e={};for(let t=0;t<o.length;t++){const i=Sl(o[t]);for(const a in i)e[a]=i[a]}return e}function JM(o){const e=[];for(let t=0;t<o.length;t++)e.push(o[t].clone());return e}function TS(o){const e=o.getRenderTarget();return e===null?o.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:vt.workingColorSpace}const IS={clone:Sl,merge:rn};var ZM=`void main() {
|
|
78
|
+
*/const Bf="172",BI=0,j_=1,PI=2,x0=1,LI=2,Xs=3,hs=0,Fi=1,Ri=2,cs=0,sl=1,q_=2,W_=3,Y_=4,DI=5,Ia=100,NI=101,OI=102,kI=103,UI=104,FI=200,$I=201,zI=202,GI=203,Vg=204,Qg=205,HI=206,VI=207,QI=208,jI=209,qI=210,WI=211,YI=212,XI=213,KI=214,jg=0,qg=1,Wg=2,ml=3,Yg=4,Xg=5,Kg=6,Jg=7,oS=0,JI=1,ZI=2,Ss=0,lS=1,cS=2,uS=3,S0=4,eM=5,hS=6,yu=7,X_="attached",tM="detached",gl=300,ja=301,Al=302,bu=303,Zg=304,Pf=306,ds=1e3,ai=1001,qa=1002,gi=1003,Lu=1004,Nr=1005,Et=1006,Oa=1007,hn=1008,K_=1008,ui=1009,C0=1010,T0=1011,vu=1012,Lf=1013,qr=1014,oi=1015,hi=1016,I0=1017,M0=1018,_l=1020,dS=35902,fS=1021,pS=1022,Xt=1023,mS=1024,gS=1025,rl=1026,yl=1027,Or=1028,R0=1029,La=1030,B0=1031,P0=1033,bd=33776,su=33777,vd=33778,ru=33779,Hd=35840,eA=35841,Vd=35842,tA=35843,Qd=36196,jd=37492,qd=37496,wu=37808,iA=37809,nA=37810,sA=37811,Eu=37812,rA=37813,aA=37814,oA=37815,lA=37816,cA=37817,uA=37818,hA=37819,dA=37820,fA=37821,au=36492,pA=36494,Wd=36495,AS=36283,mA=36284,gA=36285,AA=36286,bl=2200,ka=2201,Yd=2202,vl=2300,wl=2301,op=2302,qo=2400,Wo=2401,Xd=2402,L0=2500,iM=2501,nM=0,_S=1,_A=2,sM=3200,rM=3201,yS=0,aM=1,Gn="",Ht="srgb",qt="srgb-linear",Kd="linear",Gt="srgb",ro=7680,J_=519,oM=512,lM=513,cM=514,bS=515,uM=516,hM=517,dM=518,fM=519,yA=35044,Z_="300 es",sr=2e3,Jd=2001;let fs=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const a=this._listeners[e];if(a!==void 0){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let l=0,u=a.length;l<u;l++)a[l].call(this,e);e.target=null}}};const Vi=["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 ey=1234567;const ou=Math.PI/180,El=180/Math.PI;function us(){const o=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(Vi[o&255]+Vi[o>>8&255]+Vi[o>>16&255]+Vi[o>>24&255]+"-"+Vi[e&255]+Vi[e>>8&255]+"-"+Vi[e>>16&15|64]+Vi[e>>24&255]+"-"+Vi[t&63|128]+Vi[t>>8&255]+"-"+Vi[t>>16&255]+Vi[t>>24&255]+Vi[i&255]+Vi[i>>8&255]+Vi[i>>16&255]+Vi[i>>24&255]).toLowerCase()}function ft(o,e,t){return Math.max(e,Math.min(t,o))}function D0(o,e){return(o%e+e)%e}function pM(o,e,t,i,a){return i+(o-e)*(a-i)/(t-e)}function mM(o,e,t){return o!==e?(t-o)/(e-o):0}function lu(o,e,t){return(1-t)*o+t*e}function gM(o,e,t,i){return lu(o,e,1-Math.exp(-t*i))}function AM(o,e=1){return e-Math.abs(D0(o,e*2)-e)}function _M(o,e,t){return o<=e?0:o>=t?1:(o=(o-e)/(t-e),o*o*(3-2*o))}function yM(o,e,t){return o<=e?0:o>=t?1:(o=(o-e)/(t-e),o*o*o*(o*(o*6-15)+10))}function bM(o,e){return o+Math.floor(Math.random()*(e-o+1))}function vM(o,e){return o+Math.random()*(e-o)}function wM(o){return o*(.5-Math.random())}function EM(o){o!==void 0&&(ey=o);let e=ey+=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 xM(o){return o*ou}function SM(o){return o*El}function CM(o){return(o&o-1)===0&&o!==0}function TM(o){return Math.pow(2,Math.ceil(Math.log(o)/Math.LN2))}function IM(o){return Math.pow(2,Math.floor(Math.log(o)/Math.LN2))}function MM(o,e,t,i,a){const l=Math.cos,u=Math.sin,d=l(t/2),p=u(t/2),m=l((e+i)/2),A=u((e+i)/2),_=l((e-i)/2),b=u((e-i)/2),w=l((i-e)/2),E=u((i-e)/2);switch(a){case"XYX":o.set(d*A,p*_,p*b,d*m);break;case"YZY":o.set(p*b,d*A,p*_,d*m);break;case"ZXZ":o.set(p*_,p*b,d*A,d*m);break;case"XZX":o.set(d*A,p*E,p*w,d*m);break;case"YXY":o.set(p*w,d*A,p*E,d*m);break;case"ZYZ":o.set(p*E,p*w,d*A,d*m);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}function as(o,e){switch(e.constructor){case Float32Array:return o;case Uint32Array:return o/4294967295;case Uint16Array:return o/65535;case Uint8Array:return o/255;case Int32Array:return Math.max(o/2147483647,-1);case Int16Array:return Math.max(o/32767,-1);case Int8Array:return Math.max(o/127,-1);default:throw new Error("Invalid component type.")}}function Ut(o,e){switch(e.constructor){case Float32Array:return o;case Uint32Array:return Math.round(o*4294967295);case Uint16Array:return Math.round(o*65535);case Uint8Array:return Math.round(o*255);case Int32Array:return Math.round(o*2147483647);case Int16Array:return Math.round(o*32767);case Int8Array:return Math.round(o*127);default:throw new Error("Invalid component type.")}}const xl={DEG2RAD:ou,RAD2DEG:El,generateUUID:us,clamp:ft,euclideanModulo:D0,mapLinear:pM,inverseLerp:mM,lerp:lu,damp:gM,pingpong:AM,smoothstep:_M,smootherstep:yM,randInt:bM,randFloat:vM,randFloatSpread:wM,seededRandom:EM,degToRad:xM,radToDeg:SM,isPowerOfTwo:CM,ceilPowerOfTwo:TM,floorPowerOfTwo:IM,setQuaternionFromProperEuler:MM,normalize:Ut,denormalize:as};class Ve{constructor(e=0,t=0){Ve.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,i=this.y,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6],this.y=a[1]*t+a[4]*i+a[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ft(i,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 i=this.dot(e)/t;return Math.acos(ft(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),a=Math.sin(t),l=this.x-e.x,u=this.y-e.y;return this.x=l*i-u*a+e.x,this.y=l*a+u*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ot{constructor(e,t,i,a,l,u,d,p,m){ot.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,a,l,u,d,p,m)}set(e,t,i,a,l,u,d,p,m){const A=this.elements;return A[0]=e,A[1]=a,A[2]=d,A[3]=t,A[4]=l,A[5]=p,A[6]=i,A[7]=u,A[8]=m,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){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 i=e.elements,a=t.elements,l=this.elements,u=i[0],d=i[3],p=i[6],m=i[1],A=i[4],_=i[7],b=i[2],w=i[5],E=i[8],C=a[0],T=a[3],x=a[6],P=a[1],M=a[4],B=a[7],D=a[2],G=a[5],U=a[8];return l[0]=u*C+d*P+p*D,l[3]=u*T+d*M+p*G,l[6]=u*x+d*B+p*U,l[1]=m*C+A*P+_*D,l[4]=m*T+A*M+_*G,l[7]=m*x+A*B+_*U,l[2]=b*C+w*P+E*D,l[5]=b*T+w*M+E*G,l[8]=b*x+w*B+E*U,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],i=e[1],a=e[2],l=e[3],u=e[4],d=e[5],p=e[6],m=e[7],A=e[8];return t*u*A-t*d*m-i*l*A+i*d*p+a*l*m-a*u*p}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],l=e[3],u=e[4],d=e[5],p=e[6],m=e[7],A=e[8],_=A*u-d*m,b=d*p-A*l,w=m*l-u*p,E=t*_+i*b+a*w;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const C=1/E;return e[0]=_*C,e[1]=(a*m-A*i)*C,e[2]=(d*i-a*u)*C,e[3]=b*C,e[4]=(A*t-a*p)*C,e[5]=(a*l-d*t)*C,e[6]=w*C,e[7]=(i*p-m*t)*C,e[8]=(u*t-i*l)*C,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,i,a,l,u,d){const p=Math.cos(l),m=Math.sin(l);return this.set(i*p,i*m,-i*(p*u+m*d)+u+e,-a*m,a*p,-a*(-m*u+p*d)+d+t,0,0,1),this}scale(e,t){return this.premultiply(lp.makeScale(e,t)),this}rotate(e){return this.premultiply(lp.makeRotation(-e)),this}translate(e,t){return this.premultiply(lp.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),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let a=0;a<9;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const lp=new ot;function vS(o){for(let e=o.length-1;e>=0;--e)if(o[e]>=65535)return!0;return!1}function xu(o){return document.createElementNS("http://www.w3.org/1999/xhtml",o)}function RM(){const o=xu("canvas");return o.style.display="block",o}const ty={};function Ho(o){o in ty||(ty[o]=!0,console.warn(o))}function BM(o,e,t){return new Promise(function(i,a){function l(){switch(o.clientWaitSync(e,o.SYNC_FLUSH_COMMANDS_BIT,0)){case o.WAIT_FAILED:a();break;case o.TIMEOUT_EXPIRED:setTimeout(l,t);break;default:i()}}setTimeout(l,t)})}function PM(o){const e=o.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 LM(o){const e=o.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const iy=new ot().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ny=new ot().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function DM(){const o={enabled:!0,workingColorSpace:qt,spaces:{},convert:function(a,l,u){return this.enabled===!1||l===u||!l||!u||(this.spaces[l].transfer===Gt&&(a.r=or(a.r),a.g=or(a.g),a.b=or(a.b)),this.spaces[l].primaries!==this.spaces[u].primaries&&(a.applyMatrix3(this.spaces[l].toXYZ),a.applyMatrix3(this.spaces[u].fromXYZ)),this.spaces[u].transfer===Gt&&(a.r=al(a.r),a.g=al(a.g),a.b=al(a.b))),a},fromWorkingColorSpace:function(a,l){return this.convert(a,this.workingColorSpace,l)},toWorkingColorSpace:function(a,l){return this.convert(a,l,this.workingColorSpace)},getPrimaries:function(a){return this.spaces[a].primaries},getTransfer:function(a){return a===Gn?Kd:this.spaces[a].transfer},getLuminanceCoefficients:function(a,l=this.workingColorSpace){return a.fromArray(this.spaces[l].luminanceCoefficients)},define:function(a){Object.assign(this.spaces,a)},_getMatrix:function(a,l,u){return a.copy(this.spaces[l].toXYZ).multiply(this.spaces[u].fromXYZ)},_getDrawingBufferColorSpace:function(a){return this.spaces[a].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(a=this.workingColorSpace){return this.spaces[a].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return o.define({[qt]:{primaries:e,whitePoint:i,transfer:Kd,toXYZ:iy,fromXYZ:ny,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Ht},outputColorSpaceConfig:{drawingBufferColorSpace:Ht}},[Ht]:{primaries:e,whitePoint:i,transfer:Gt,toXYZ:iy,fromXYZ:ny,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Ht}}}),o}const wt=DM();function or(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function al(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}let ao,NM=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ao===void 0&&(ao=xu("canvas")),ao.width=e.width,ao.height=e.height;const i=ao.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=ao}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=xu("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const a=i.getImageData(0,0,e.width,e.height),l=a.data;for(let u=0;u<l.length;u++)l[u]=or(l[u]/255)*255;return i.putImageData(a,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(or(t[i]/255)*255):t[i]=or(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},OM=0;class N0{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:OM++}),this.uuid=us(),this.data=e,this.dataReady=!0,this.version=0}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 i={uuid:this.uuid,url:""},a=this.data;if(a!==null){let l;if(Array.isArray(a)){l=[];for(let u=0,d=a.length;u<d;u++)a[u].isDataTexture?l.push(cp(a[u].image)):l.push(cp(a[u]))}else l=cp(a);i.url=l}return t||(e.images[this.uuid]=i),i}}function cp(o){return typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&o instanceof ImageBitmap?NM.getDataURL(o):o.data?{data:Array.from(o.data),width:o.width,height:o.height,type:o.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let kM=0,Kt=class wd extends fs{constructor(e=wd.DEFAULT_IMAGE,t=wd.DEFAULT_MAPPING,i=ai,a=ai,l=Et,u=hn,d=Xt,p=ui,m=wd.DEFAULT_ANISOTROPY,A=Gn){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:kM++}),this.uuid=us(),this.name="",this.source=new N0(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=a,this.magFilter=l,this.minFilter=u,this.anisotropy=m,this.format=d,this.internalFormat=null,this.type=p,this.offset=new Ve(0,0),this.repeat=new Ve(1,1),this.center=new Ve(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ot,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=A,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}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)}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.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.6,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&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==gl)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ds:e.x=e.x-Math.floor(e.x);break;case ai:e.x=e.x<0?0:1;break;case qa: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 ds:e.y=e.y-Math.floor(e.y);break;case ai:e.y=e.y<0?0:1;break;case qa: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++}};Kt.DEFAULT_IMAGE=null;Kt.DEFAULT_MAPPING=gl;Kt.DEFAULT_ANISOTROPY=1;class Rt{constructor(e=0,t=0,i=0,a=1){Rt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=a}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,a){return this.x=e,this.y=t,this.z=i,this.w=a,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,i=this.y,a=this.z,l=this.w,u=e.elements;return this.x=u[0]*t+u[4]*i+u[8]*a+u[12]*l,this.y=u[1]*t+u[5]*i+u[9]*a+u[13]*l,this.z=u[2]*t+u[6]*i+u[10]*a+u[14]*l,this.w=u[3]*t+u[7]*i+u[11]*a+u[15]*l,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,i,a,l;const p=e.elements,m=p[0],A=p[4],_=p[8],b=p[1],w=p[5],E=p[9],C=p[2],T=p[6],x=p[10];if(Math.abs(A-b)<.01&&Math.abs(_-C)<.01&&Math.abs(E-T)<.01){if(Math.abs(A+b)<.1&&Math.abs(_+C)<.1&&Math.abs(E+T)<.1&&Math.abs(m+w+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(m+1)/2,B=(w+1)/2,D=(x+1)/2,G=(A+b)/4,U=(_+C)/4,V=(E+T)/4;return M>B&&M>D?M<.01?(i=0,a=.707106781,l=.707106781):(i=Math.sqrt(M),a=G/i,l=U/i):B>D?B<.01?(i=.707106781,a=0,l=.707106781):(a=Math.sqrt(B),i=G/a,l=V/a):D<.01?(i=.707106781,a=.707106781,l=0):(l=Math.sqrt(D),i=U/l,a=V/l),this.set(i,a,l,t),this}let P=Math.sqrt((T-E)*(T-E)+(_-C)*(_-C)+(b-A)*(b-A));return Math.abs(P)<.001&&(P=1),this.x=(T-E)/P,this.y=(_-C)/P,this.z=(b-A)/P,this.w=Math.acos((m+w+x-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this.z=ft(this.z,e.z,t.z),this.w=ft(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this.z=ft(this.z,e,t),this.w=ft(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ft(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class UM extends fs{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Rt(0,0,e,t),this.scissorTest=!1,this.viewport=new Rt(0,0,e,t);const a={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Et,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const l=new Kt(a,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);l.flipY=!1,l.generateMipmaps=i.generateMipmaps,l.internalFormat=i.internalFormat,this.textures=[];const u=i.count;for(let d=0;d<u;d++)this.textures[d]=l.clone(),this.textures[d].isRenderTargetTexture=!0,this.textures[d].renderTarget=this;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples}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,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let a=0,l=this.textures.length;a<l;a++)this.textures[a].image.width=e,this.textures[a].image.height=t,this.textures[a].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,a=e.textures.length;i<a;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0,this.textures[i].renderTarget=this;const t=Object.assign({},e.texture.image);return this.texture.source=new N0(t),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 dn extends UM{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class wS extends Kt{constructor(e=null,t=1,i=1,a=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:a},this.magFilter=gi,this.minFilter=gi,this.wrapR=ai,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ES extends Kt{constructor(e=null,t=1,i=1,a=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:a},this.magFilter=gi,this.minFilter=gi,this.wrapR=ai,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yi{constructor(e=0,t=0,i=0,a=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=a}static slerpFlat(e,t,i,a,l,u,d){let p=i[a+0],m=i[a+1],A=i[a+2],_=i[a+3];const b=l[u+0],w=l[u+1],E=l[u+2],C=l[u+3];if(d===0){e[t+0]=p,e[t+1]=m,e[t+2]=A,e[t+3]=_;return}if(d===1){e[t+0]=b,e[t+1]=w,e[t+2]=E,e[t+3]=C;return}if(_!==C||p!==b||m!==w||A!==E){let T=1-d;const x=p*b+m*w+A*E+_*C,P=x>=0?1:-1,M=1-x*x;if(M>Number.EPSILON){const D=Math.sqrt(M),G=Math.atan2(D,x*P);T=Math.sin(T*G)/D,d=Math.sin(d*G)/D}const B=d*P;if(p=p*T+b*B,m=m*T+w*B,A=A*T+E*B,_=_*T+C*B,T===1-d){const D=1/Math.sqrt(p*p+m*m+A*A+_*_);p*=D,m*=D,A*=D,_*=D}}e[t]=p,e[t+1]=m,e[t+2]=A,e[t+3]=_}static multiplyQuaternionsFlat(e,t,i,a,l,u){const d=i[a],p=i[a+1],m=i[a+2],A=i[a+3],_=l[u],b=l[u+1],w=l[u+2],E=l[u+3];return e[t]=d*E+A*_+p*w-m*b,e[t+1]=p*E+A*b+m*_-d*w,e[t+2]=m*E+A*w+d*b-p*_,e[t+3]=A*E-d*_-p*b-m*w,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,a){return this._x=e,this._y=t,this._z=i,this._w=a,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 i=e._x,a=e._y,l=e._z,u=e._order,d=Math.cos,p=Math.sin,m=d(i/2),A=d(a/2),_=d(l/2),b=p(i/2),w=p(a/2),E=p(l/2);switch(u){case"XYZ":this._x=b*A*_+m*w*E,this._y=m*w*_-b*A*E,this._z=m*A*E+b*w*_,this._w=m*A*_-b*w*E;break;case"YXZ":this._x=b*A*_+m*w*E,this._y=m*w*_-b*A*E,this._z=m*A*E-b*w*_,this._w=m*A*_+b*w*E;break;case"ZXY":this._x=b*A*_-m*w*E,this._y=m*w*_+b*A*E,this._z=m*A*E+b*w*_,this._w=m*A*_-b*w*E;break;case"ZYX":this._x=b*A*_-m*w*E,this._y=m*w*_+b*A*E,this._z=m*A*E-b*w*_,this._w=m*A*_+b*w*E;break;case"YZX":this._x=b*A*_+m*w*E,this._y=m*w*_+b*A*E,this._z=m*A*E-b*w*_,this._w=m*A*_-b*w*E;break;case"XZY":this._x=b*A*_-m*w*E,this._y=m*w*_-b*A*E,this._z=m*A*E+b*w*_,this._w=m*A*_+b*w*E;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+u)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,a=Math.sin(i);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],a=t[4],l=t[8],u=t[1],d=t[5],p=t[9],m=t[2],A=t[6],_=t[10],b=i+d+_;if(b>0){const w=.5/Math.sqrt(b+1);this._w=.25/w,this._x=(A-p)*w,this._y=(l-m)*w,this._z=(u-a)*w}else if(i>d&&i>_){const w=2*Math.sqrt(1+i-d-_);this._w=(A-p)/w,this._x=.25*w,this._y=(a+u)/w,this._z=(l+m)/w}else if(d>_){const w=2*Math.sqrt(1+d-i-_);this._w=(l-m)/w,this._x=(a+u)/w,this._y=.25*w,this._z=(p+A)/w}else{const w=2*Math.sqrt(1+_-i-d);this._w=(u-a)/w,this._x=(l+m)/w,this._y=(p+A)/w,this._z=.25*w}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ft(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const a=Math.min(1,t/i);return this.slerp(e,a),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 i=e._x,a=e._y,l=e._z,u=e._w,d=t._x,p=t._y,m=t._z,A=t._w;return this._x=i*A+u*d+a*m-l*p,this._y=a*A+u*p+l*d-i*m,this._z=l*A+u*m+i*p-a*d,this._w=u*A-i*d-a*p-l*m,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,a=this._y,l=this._z,u=this._w;let d=u*e._w+i*e._x+a*e._y+l*e._z;if(d<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,d=-d):this.copy(e),d>=1)return this._w=u,this._x=i,this._y=a,this._z=l,this;const p=1-d*d;if(p<=Number.EPSILON){const w=1-t;return this._w=w*u+t*this._w,this._x=w*i+t*this._x,this._y=w*a+t*this._y,this._z=w*l+t*this._z,this.normalize(),this}const m=Math.sqrt(p),A=Math.atan2(m,d),_=Math.sin((1-t)*A)/m,b=Math.sin(t*A)/m;return this._w=u*_+this._w*b,this._x=i*_+this._x*b,this._y=a*_+this._y*b,this._z=l*_+this._z*b,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),a=Math.sqrt(1-i),l=Math.sqrt(i);return this.set(a*Math.sin(e),a*Math.cos(e),l*Math.sin(t),l*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 se{constructor(e=0,t=0,i=0){se.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(sy.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(sy.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,a=this.z,l=e.elements;return this.x=l[0]*t+l[3]*i+l[6]*a,this.y=l[1]*t+l[4]*i+l[7]*a,this.z=l[2]*t+l[5]*i+l[8]*a,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,a=this.z,l=e.elements,u=1/(l[3]*t+l[7]*i+l[11]*a+l[15]);return this.x=(l[0]*t+l[4]*i+l[8]*a+l[12])*u,this.y=(l[1]*t+l[5]*i+l[9]*a+l[13])*u,this.z=(l[2]*t+l[6]*i+l[10]*a+l[14])*u,this}applyQuaternion(e){const t=this.x,i=this.y,a=this.z,l=e.x,u=e.y,d=e.z,p=e.w,m=2*(u*a-d*i),A=2*(d*t-l*a),_=2*(l*i-u*t);return this.x=t+p*m+u*_-d*A,this.y=i+p*A+d*m-l*_,this.z=a+p*_+l*A-u*m,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,i=this.y,a=this.z,l=e.elements;return this.x=l[0]*t+l[4]*i+l[8]*a,this.y=l[1]*t+l[5]*i+l[9]*a,this.z=l[2]*t+l[6]*i+l[10]*a,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=ft(this.x,e.x,t.x),this.y=ft(this.y,e.y,t.y),this.z=ft(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ft(this.x,e,t),this.y=ft(this.y,e,t),this.z=ft(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ft(i,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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,a=e.y,l=e.z,u=t.x,d=t.y,p=t.z;return this.x=a*p-l*d,this.y=l*u-i*p,this.z=i*d-a*u,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return up.copy(this).projectOnVector(e),this.sub(up)}reflect(e){return this.sub(up.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 i=this.dot(e)/t;return Math.acos(ft(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,a=this.z-e.z;return t*t+i*i+a*a}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const a=Math.sin(t)*e;return this.x=a*Math.sin(i),this.y=Math.cos(t)*e,this.z=a*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){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(),i=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=a,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,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const up=new se,sy=new Yi;class yi{constructor(e=new se(1/0,1/0,1/0),t=new se(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(es.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(es.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=es.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const l=i.getAttribute("position");if(t===!0&&l!==void 0&&e.isInstancedMesh!==!0)for(let u=0,d=l.count;u<d;u++)e.isMesh===!0?e.getVertexPosition(u,es):es.fromBufferAttribute(l,u),es.applyMatrix4(e.matrixWorld),this.expandByPoint(es);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),th.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),th.copy(i.boundingBox)),th.applyMatrix4(e.matrixWorld),this.union(th)}const a=e.children;for(let l=0,u=a.length;l<u;l++)this.expandByObject(a[l],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,es),es.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(oc),ih.subVectors(this.max,oc),oo.subVectors(e.a,oc),lo.subVectors(e.b,oc),co.subVectors(e.c,oc),pr.subVectors(lo,oo),mr.subVectors(co,lo),sa.subVectors(oo,co);let t=[0,-pr.z,pr.y,0,-mr.z,mr.y,0,-sa.z,sa.y,pr.z,0,-pr.x,mr.z,0,-mr.x,sa.z,0,-sa.x,-pr.y,pr.x,0,-mr.y,mr.x,0,-sa.y,sa.x,0];return!hp(t,oo,lo,co,ih)||(t=[1,0,0,0,1,0,0,0,1],!hp(t,oo,lo,co,ih))?!1:(nh.crossVectors(pr,mr),t=[nh.x,nh.y,nh.z],hp(t,oo,lo,co,ih))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,es).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(es).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:(ks[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ks[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ks[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ks[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ks[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ks[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ks[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ks[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ks),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ks=[new se,new se,new se,new se,new se,new se,new se,new se],es=new se,th=new yi,oo=new se,lo=new se,co=new se,pr=new se,mr=new se,sa=new se,oc=new se,ih=new se,nh=new se,ra=new se;function hp(o,e,t,i,a){for(let l=0,u=o.length-3;l<=u;l+=3){ra.fromArray(o,l);const d=a.x*Math.abs(ra.x)+a.y*Math.abs(ra.y)+a.z*Math.abs(ra.z),p=e.dot(ra),m=t.dot(ra),A=i.dot(ra);if(Math.max(-Math.max(p,m,A),Math.min(p,m,A))>d)return!1}return!0}const FM=new yi,lc=new se,dp=new se;class bn{constructor(e=new se,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 i=this.center;t!==void 0?i.copy(t):FM.setFromPoints(e).getCenter(i);let a=0;for(let l=0,u=e.length;l<u;l++)a=Math.max(a,i.distanceToSquared(e[l]));return this.radius=Math.sqrt(a),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 i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;lc.subVectors(e,this.center);const t=lc.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),a=(i-this.radius)*.5;this.center.addScaledVector(lc,a/i),this.radius+=a}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(dp.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(lc.copy(e.center).add(dp)),this.expandByPoint(lc.copy(e.center).sub(dp))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Us=new se,fp=new se,sh=new se,gr=new se,pp=new se,rh=new se,mp=new se;class Du{constructor(e=new se,t=new se(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,Us)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Us.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Us.copy(this.origin).addScaledVector(this.direction,t),Us.distanceToSquared(e))}distanceSqToSegment(e,t,i,a){fp.copy(e).add(t).multiplyScalar(.5),sh.copy(t).sub(e).normalize(),gr.copy(this.origin).sub(fp);const l=e.distanceTo(t)*.5,u=-this.direction.dot(sh),d=gr.dot(this.direction),p=-gr.dot(sh),m=gr.lengthSq(),A=Math.abs(1-u*u);let _,b,w,E;if(A>0)if(_=u*p-d,b=u*d-p,E=l*A,_>=0)if(b>=-E)if(b<=E){const C=1/A;_*=C,b*=C,w=_*(_+u*b+2*d)+b*(u*_+b+2*p)+m}else b=l,_=Math.max(0,-(u*b+d)),w=-_*_+b*(b+2*p)+m;else b=-l,_=Math.max(0,-(u*b+d)),w=-_*_+b*(b+2*p)+m;else b<=-E?(_=Math.max(0,-(-u*l+d)),b=_>0?-l:Math.min(Math.max(-l,-p),l),w=-_*_+b*(b+2*p)+m):b<=E?(_=0,b=Math.min(Math.max(-l,-p),l),w=b*(b+2*p)+m):(_=Math.max(0,-(u*l+d)),b=_>0?l:Math.min(Math.max(-l,-p),l),w=-_*_+b*(b+2*p)+m);else b=u>0?-l:l,_=Math.max(0,-(u*b+d)),w=-_*_+b*(b+2*p)+m;return i&&i.copy(this.origin).addScaledVector(this.direction,_),a&&a.copy(fp).addScaledVector(sh,b),w}intersectSphere(e,t){Us.subVectors(e.center,this.origin);const i=Us.dot(this.direction),a=Us.dot(Us)-i*i,l=e.radius*e.radius;if(a>l)return null;const u=Math.sqrt(l-a),d=i-u,p=i+u;return p<0?null:d<0?this.at(p,t):this.at(d,t)}intersectsSphere(e){return 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 i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,a,l,u,d,p;const m=1/this.direction.x,A=1/this.direction.y,_=1/this.direction.z,b=this.origin;return m>=0?(i=(e.min.x-b.x)*m,a=(e.max.x-b.x)*m):(i=(e.max.x-b.x)*m,a=(e.min.x-b.x)*m),A>=0?(l=(e.min.y-b.y)*A,u=(e.max.y-b.y)*A):(l=(e.max.y-b.y)*A,u=(e.min.y-b.y)*A),i>u||l>a||((l>i||isNaN(i))&&(i=l),(u<a||isNaN(a))&&(a=u),_>=0?(d=(e.min.z-b.z)*_,p=(e.max.z-b.z)*_):(d=(e.max.z-b.z)*_,p=(e.min.z-b.z)*_),i>p||d>a)||((d>i||i!==i)&&(i=d),(p<a||a!==a)&&(a=p),a<0)?null:this.at(i>=0?i:a,t)}intersectsBox(e){return this.intersectBox(e,Us)!==null}intersectTriangle(e,t,i,a,l){pp.subVectors(t,e),rh.subVectors(i,e),mp.crossVectors(pp,rh);let u=this.direction.dot(mp),d;if(u>0){if(a)return null;d=1}else if(u<0)d=-1,u=-u;else return null;gr.subVectors(this.origin,e);const p=d*this.direction.dot(rh.crossVectors(gr,rh));if(p<0)return null;const m=d*this.direction.dot(pp.cross(gr));if(m<0||p+m>u)return null;const A=-d*gr.dot(mp);return A<0?null:this.at(A/u,l)}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 tt{constructor(e,t,i,a,l,u,d,p,m,A,_,b,w,E,C,T){tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,a,l,u,d,p,m,A,_,b,w,E,C,T)}set(e,t,i,a,l,u,d,p,m,A,_,b,w,E,C,T){const x=this.elements;return x[0]=e,x[4]=t,x[8]=i,x[12]=a,x[1]=l,x[5]=u,x[9]=d,x[13]=p,x[2]=m,x[6]=A,x[10]=_,x[14]=b,x[3]=w,x[7]=E,x[11]=C,x[15]=T,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 tt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[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,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,a=1/uo.setFromMatrixColumn(e,0).length(),l=1/uo.setFromMatrixColumn(e,1).length(),u=1/uo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*a,t[1]=i[1]*a,t[2]=i[2]*a,t[3]=0,t[4]=i[4]*l,t[5]=i[5]*l,t[6]=i[6]*l,t[7]=0,t[8]=i[8]*u,t[9]=i[9]*u,t[10]=i[10]*u,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,a=e.y,l=e.z,u=Math.cos(i),d=Math.sin(i),p=Math.cos(a),m=Math.sin(a),A=Math.cos(l),_=Math.sin(l);if(e.order==="XYZ"){const b=u*A,w=u*_,E=d*A,C=d*_;t[0]=p*A,t[4]=-p*_,t[8]=m,t[1]=w+E*m,t[5]=b-C*m,t[9]=-d*p,t[2]=C-b*m,t[6]=E+w*m,t[10]=u*p}else if(e.order==="YXZ"){const b=p*A,w=p*_,E=m*A,C=m*_;t[0]=b+C*d,t[4]=E*d-w,t[8]=u*m,t[1]=u*_,t[5]=u*A,t[9]=-d,t[2]=w*d-E,t[6]=C+b*d,t[10]=u*p}else if(e.order==="ZXY"){const b=p*A,w=p*_,E=m*A,C=m*_;t[0]=b-C*d,t[4]=-u*_,t[8]=E+w*d,t[1]=w+E*d,t[5]=u*A,t[9]=C-b*d,t[2]=-u*m,t[6]=d,t[10]=u*p}else if(e.order==="ZYX"){const b=u*A,w=u*_,E=d*A,C=d*_;t[0]=p*A,t[4]=E*m-w,t[8]=b*m+C,t[1]=p*_,t[5]=C*m+b,t[9]=w*m-E,t[2]=-m,t[6]=d*p,t[10]=u*p}else if(e.order==="YZX"){const b=u*p,w=u*m,E=d*p,C=d*m;t[0]=p*A,t[4]=C-b*_,t[8]=E*_+w,t[1]=_,t[5]=u*A,t[9]=-d*A,t[2]=-m*A,t[6]=w*_+E,t[10]=b-C*_}else if(e.order==="XZY"){const b=u*p,w=u*m,E=d*p,C=d*m;t[0]=p*A,t[4]=-_,t[8]=m*A,t[1]=b*_+C,t[5]=u*A,t[9]=w*_-E,t[2]=E*_-w,t[6]=d*A,t[10]=C*_+b}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($M,e,zM)}lookAt(e,t,i){const a=this.elements;return En.subVectors(e,t),En.lengthSq()===0&&(En.z=1),En.normalize(),Ar.crossVectors(i,En),Ar.lengthSq()===0&&(Math.abs(i.z)===1?En.x+=1e-4:En.z+=1e-4,En.normalize(),Ar.crossVectors(i,En)),Ar.normalize(),ah.crossVectors(En,Ar),a[0]=Ar.x,a[4]=ah.x,a[8]=En.x,a[1]=Ar.y,a[5]=ah.y,a[9]=En.y,a[2]=Ar.z,a[6]=ah.z,a[10]=En.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,a=t.elements,l=this.elements,u=i[0],d=i[4],p=i[8],m=i[12],A=i[1],_=i[5],b=i[9],w=i[13],E=i[2],C=i[6],T=i[10],x=i[14],P=i[3],M=i[7],B=i[11],D=i[15],G=a[0],U=a[4],V=a[8],k=a[12],z=a[1],Q=a[5],Z=a[9],K=a[13],s=a[2],H=a[6],y=a[10],ee=a[14],I=a[3],re=a[7],Ae=a[11],N=a[15];return l[0]=u*G+d*z+p*s+m*I,l[4]=u*U+d*Q+p*H+m*re,l[8]=u*V+d*Z+p*y+m*Ae,l[12]=u*k+d*K+p*ee+m*N,l[1]=A*G+_*z+b*s+w*I,l[5]=A*U+_*Q+b*H+w*re,l[9]=A*V+_*Z+b*y+w*Ae,l[13]=A*k+_*K+b*ee+w*N,l[2]=E*G+C*z+T*s+x*I,l[6]=E*U+C*Q+T*H+x*re,l[10]=E*V+C*Z+T*y+x*Ae,l[14]=E*k+C*K+T*ee+x*N,l[3]=P*G+M*z+B*s+D*I,l[7]=P*U+M*Q+B*H+D*re,l[11]=P*V+M*Z+B*y+D*Ae,l[15]=P*k+M*K+B*ee+D*N,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],i=e[4],a=e[8],l=e[12],u=e[1],d=e[5],p=e[9],m=e[13],A=e[2],_=e[6],b=e[10],w=e[14],E=e[3],C=e[7],T=e[11],x=e[15];return E*(+l*p*_-a*m*_-l*d*b+i*m*b+a*d*w-i*p*w)+C*(+t*p*w-t*m*b+l*u*b-a*u*w+a*m*A-l*p*A)+T*(+t*m*_-t*d*w-l*u*_+i*u*w+l*d*A-i*m*A)+x*(-a*d*A-t*p*_+t*d*b+a*u*_-i*u*b+i*p*A)}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,i){const a=this.elements;return e.isVector3?(a[12]=e.x,a[13]=e.y,a[14]=e.z):(a[12]=e,a[13]=t,a[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],a=e[2],l=e[3],u=e[4],d=e[5],p=e[6],m=e[7],A=e[8],_=e[9],b=e[10],w=e[11],E=e[12],C=e[13],T=e[14],x=e[15],P=_*T*m-C*b*m+C*p*w-d*T*w-_*p*x+d*b*x,M=E*b*m-A*T*m-E*p*w+u*T*w+A*p*x-u*b*x,B=A*C*m-E*_*m+E*d*w-u*C*w-A*d*x+u*_*x,D=E*_*p-A*C*p-E*d*b+u*C*b+A*d*T-u*_*T,G=t*P+i*M+a*B+l*D;if(G===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const U=1/G;return e[0]=P*U,e[1]=(C*b*l-_*T*l-C*a*w+i*T*w+_*a*x-i*b*x)*U,e[2]=(d*T*l-C*p*l+C*a*m-i*T*m-d*a*x+i*p*x)*U,e[3]=(_*p*l-d*b*l-_*a*m+i*b*m+d*a*w-i*p*w)*U,e[4]=M*U,e[5]=(A*T*l-E*b*l+E*a*w-t*T*w-A*a*x+t*b*x)*U,e[6]=(E*p*l-u*T*l-E*a*m+t*T*m+u*a*x-t*p*x)*U,e[7]=(u*b*l-A*p*l+A*a*m-t*b*m-u*a*w+t*p*w)*U,e[8]=B*U,e[9]=(E*_*l-A*C*l-E*i*w+t*C*w+A*i*x-t*_*x)*U,e[10]=(u*C*l-E*d*l+E*i*m-t*C*m-u*i*x+t*d*x)*U,e[11]=(A*d*l-u*_*l-A*i*m+t*_*m+u*i*w-t*d*w)*U,e[12]=D*U,e[13]=(A*C*a-E*_*a+E*i*b-t*C*b-A*i*T+t*_*T)*U,e[14]=(E*d*a-u*C*a-E*i*p+t*C*p+u*i*T-t*d*T)*U,e[15]=(u*_*a-A*d*a+A*i*p-t*_*p-u*i*b+t*d*b)*U,this}scale(e){const t=this.elements,i=e.x,a=e.y,l=e.z;return t[0]*=i,t[4]*=a,t[8]*=l,t[1]*=i,t[5]*=a,t[9]*=l,t[2]*=i,t[6]*=a,t[10]*=l,t[3]*=i,t[7]*=a,t[11]*=l,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],a=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,a))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),a=Math.sin(t),l=1-i,u=e.x,d=e.y,p=e.z,m=l*u,A=l*d;return this.set(m*u+i,m*d-a*p,m*p+a*d,0,m*d+a*p,A*d+i,A*p-a*u,0,m*p-a*d,A*p+a*u,l*p*p+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,a,l,u){return this.set(1,i,l,0,e,1,u,0,t,a,1,0,0,0,0,1),this}compose(e,t,i){const a=this.elements,l=t._x,u=t._y,d=t._z,p=t._w,m=l+l,A=u+u,_=d+d,b=l*m,w=l*A,E=l*_,C=u*A,T=u*_,x=d*_,P=p*m,M=p*A,B=p*_,D=i.x,G=i.y,U=i.z;return a[0]=(1-(C+x))*D,a[1]=(w+B)*D,a[2]=(E-M)*D,a[3]=0,a[4]=(w-B)*G,a[5]=(1-(b+x))*G,a[6]=(T+P)*G,a[7]=0,a[8]=(E+M)*U,a[9]=(T-P)*U,a[10]=(1-(b+C))*U,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,this}decompose(e,t,i){const a=this.elements;let l=uo.set(a[0],a[1],a[2]).length();const u=uo.set(a[4],a[5],a[6]).length(),d=uo.set(a[8],a[9],a[10]).length();this.determinant()<0&&(l=-l),e.x=a[12],e.y=a[13],e.z=a[14],ts.copy(this);const m=1/l,A=1/u,_=1/d;return ts.elements[0]*=m,ts.elements[1]*=m,ts.elements[2]*=m,ts.elements[4]*=A,ts.elements[5]*=A,ts.elements[6]*=A,ts.elements[8]*=_,ts.elements[9]*=_,ts.elements[10]*=_,t.setFromRotationMatrix(ts),i.x=l,i.y=u,i.z=d,this}makePerspective(e,t,i,a,l,u,d=sr){const p=this.elements,m=2*l/(t-e),A=2*l/(i-a),_=(t+e)/(t-e),b=(i+a)/(i-a);let w,E;if(d===sr)w=-(u+l)/(u-l),E=-2*u*l/(u-l);else if(d===Jd)w=-u/(u-l),E=-u*l/(u-l);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+d);return p[0]=m,p[4]=0,p[8]=_,p[12]=0,p[1]=0,p[5]=A,p[9]=b,p[13]=0,p[2]=0,p[6]=0,p[10]=w,p[14]=E,p[3]=0,p[7]=0,p[11]=-1,p[15]=0,this}makeOrthographic(e,t,i,a,l,u,d=sr){const p=this.elements,m=1/(t-e),A=1/(i-a),_=1/(u-l),b=(t+e)*m,w=(i+a)*A;let E,C;if(d===sr)E=(u+l)*_,C=-2*_;else if(d===Jd)E=l*_,C=-1*_;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+d);return p[0]=2*m,p[4]=0,p[8]=0,p[12]=-b,p[1]=0,p[5]=2*A,p[9]=0,p[13]=-w,p[2]=0,p[6]=0,p[10]=C,p[14]=-E,p[3]=0,p[7]=0,p[11]=0,p[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let a=0;a<16;a++)if(t[a]!==i[a])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const uo=new se,ts=new tt,$M=new se(0,0,0),zM=new se(1,1,1),Ar=new se,ah=new se,En=new se,ry=new tt,ay=new Yi;class qn{constructor(e=0,t=0,i=0,a=qn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=a}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,i,a=this._order){return this._x=e,this._y=t,this._z=i,this._order=a,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,i=!0){const a=e.elements,l=a[0],u=a[4],d=a[8],p=a[1],m=a[5],A=a[9],_=a[2],b=a[6],w=a[10];switch(t){case"XYZ":this._y=Math.asin(ft(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-A,w),this._z=Math.atan2(-u,l)):(this._x=Math.atan2(b,m),this._z=0);break;case"YXZ":this._x=Math.asin(-ft(A,-1,1)),Math.abs(A)<.9999999?(this._y=Math.atan2(d,w),this._z=Math.atan2(p,m)):(this._y=Math.atan2(-_,l),this._z=0);break;case"ZXY":this._x=Math.asin(ft(b,-1,1)),Math.abs(b)<.9999999?(this._y=Math.atan2(-_,w),this._z=Math.atan2(-u,m)):(this._y=0,this._z=Math.atan2(p,l));break;case"ZYX":this._y=Math.asin(-ft(_,-1,1)),Math.abs(_)<.9999999?(this._x=Math.atan2(b,w),this._z=Math.atan2(p,l)):(this._x=0,this._z=Math.atan2(-u,m));break;case"YZX":this._z=Math.asin(ft(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(-A,m),this._y=Math.atan2(-_,l)):(this._x=0,this._y=Math.atan2(d,w));break;case"XZY":this._z=Math.asin(-ft(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(b,m),this._y=Math.atan2(d,l)):(this._x=Math.atan2(-A,w),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return ry.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ry,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ay.setFromEuler(this),this.setFromQuaternion(ay,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}}qn.DEFAULT_ORDER="XYZ";class O0{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 GM=0;const oy=new se,ho=new Yi,Fs=new tt,oh=new se,cc=new se,HM=new se,VM=new Yi,ly=new se(1,0,0),cy=new se(0,1,0),uy=new se(0,0,1),hy={type:"added"},QM={type:"removed"},fo={type:"childadded",child:null},gp={type:"childremoved",child:null};class Qt extends fs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:GM++}),this.uuid=us(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Qt.DEFAULT_UP.clone();const e=new se,t=new qn,i=new Yi,a=new se(1,1,1);function l(){i.setFromEuler(t,!1)}function u(){t.setFromQuaternion(i,void 0,!1)}t._onChange(l),i._onChange(u),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new tt},normalMatrix:{value:new ot}}),this.matrix=new tt,this.matrixWorld=new tt,this.matrixAutoUpdate=Qt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Qt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new O0,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],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 ho.setFromAxisAngle(e,t),this.quaternion.multiply(ho),this}rotateOnWorldAxis(e,t){return ho.setFromAxisAngle(e,t),this.quaternion.premultiply(ho),this}rotateX(e){return this.rotateOnAxis(ly,e)}rotateY(e){return this.rotateOnAxis(cy,e)}rotateZ(e){return this.rotateOnAxis(uy,e)}translateOnAxis(e,t){return oy.copy(e).applyQuaternion(this.quaternion),this.position.add(oy.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(ly,e)}translateY(e){return this.translateOnAxis(cy,e)}translateZ(e){return this.translateOnAxis(uy,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Fs.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?oh.copy(e):oh.set(e,t,i);const a=this.parent;this.updateWorldMatrix(!0,!1),cc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Fs.lookAt(cc,oh,this.up):Fs.lookAt(oh,cc,this.up),this.quaternion.setFromRotationMatrix(Fs),a&&(Fs.extractRotation(a.matrixWorld),ho.setFromRotationMatrix(Fs),this.quaternion.premultiply(ho.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(hy),fo.child=e,this.dispatchEvent(fo),fo.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(QM),gp.child=e,this.dispatchEvent(gp),gp.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),Fs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Fs.multiply(e.parent.matrixWorld)),e.applyMatrix4(Fs),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(hy),fo.child=e,this.dispatchEvent(fo),fo.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 i=0,a=this.children.length;i<a;i++){const u=this.children[i].getObjectByProperty(e,t);if(u!==void 0)return u}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const a=this.children;for(let l=0,u=a.length;l<u;l++)a[l].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cc,e,HM),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cc,VM,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 i=0,a=t.length;i<a;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,a=t.length;i<a;i++)t[i].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 i=0,a=t.length;i<a;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.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 a=this.children;for(let l=0,u=a.length;l<u;l++)a[l].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const a={};a.uuid=this.uuid,a.type=this.type,this.name!==""&&(a.name=this.name),this.castShadow===!0&&(a.castShadow=!0),this.receiveShadow===!0&&(a.receiveShadow=!0),this.visible===!1&&(a.visible=!1),this.frustumCulled===!1&&(a.frustumCulled=!1),this.renderOrder!==0&&(a.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.visibility=this._visibility,a.active=this._active,a.bounds=this._bounds.map(d=>({boxInitialized:d.boxInitialized,boxMin:d.box.min.toArray(),boxMax:d.box.max.toArray(),sphereInitialized:d.sphereInitialized,sphereRadius:d.sphere.radius,sphereCenter:d.sphere.center.toArray()})),a.maxInstanceCount=this._maxInstanceCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.geometryCount=this._geometryCount,a.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(a.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(a.boundingSphere={center:a.boundingSphere.center.toArray(),radius:a.boundingSphere.radius}),this.boundingBox!==null&&(a.boundingBox={min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}));function l(d,p){return d[p.uuid]===void 0&&(d[p.uuid]=p.toJSON(e)),p.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=l(e.geometries,this.geometry);const d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){const p=d.shapes;if(Array.isArray(p))for(let m=0,A=p.length;m<A;m++){const _=p[m];l(e.shapes,_)}else l(e.shapes,p)}}if(this.isSkinnedMesh&&(a.bindMode=this.bindMode,a.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(l(e.skeletons,this.skeleton),a.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const d=[];for(let p=0,m=this.material.length;p<m;p++)d.push(l(e.materials,this.material[p]));a.material=d}else a.material=l(e.materials,this.material);if(this.children.length>0){a.children=[];for(let d=0;d<this.children.length;d++)a.children.push(this.children[d].toJSON(e).object)}if(this.animations.length>0){a.animations=[];for(let d=0;d<this.animations.length;d++){const p=this.animations[d];a.animations.push(l(e.animations,p))}}if(t){const d=u(e.geometries),p=u(e.materials),m=u(e.textures),A=u(e.images),_=u(e.shapes),b=u(e.skeletons),w=u(e.animations),E=u(e.nodes);d.length>0&&(i.geometries=d),p.length>0&&(i.materials=p),m.length>0&&(i.textures=m),A.length>0&&(i.images=A),_.length>0&&(i.shapes=_),b.length>0&&(i.skeletons=b),w.length>0&&(i.animations=w),E.length>0&&(i.nodes=E)}return i.object=a,i;function u(d){const p=[];for(const m in d){const A=d[m];delete A.metadata,p.push(A)}return p}}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 i=0;i<e.children.length;i++){const a=e.children[i];this.add(a.clone())}return this}}Qt.DEFAULT_UP=new se(0,1,0);Qt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Qt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const is=new se,$s=new se,Ap=new se,zs=new se,po=new se,mo=new se,dy=new se,_p=new se,yp=new se,bp=new se,vp=new Rt,wp=new Rt,Ep=new Rt;class Mn{constructor(e=new se,t=new se,i=new se){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,a){a.subVectors(i,t),is.subVectors(e,t),a.cross(is);const l=a.lengthSq();return l>0?a.multiplyScalar(1/Math.sqrt(l)):a.set(0,0,0)}static getBarycoord(e,t,i,a,l){is.subVectors(a,t),$s.subVectors(i,t),Ap.subVectors(e,t);const u=is.dot(is),d=is.dot($s),p=is.dot(Ap),m=$s.dot($s),A=$s.dot(Ap),_=u*m-d*d;if(_===0)return l.set(0,0,0),null;const b=1/_,w=(m*p-d*A)*b,E=(u*A-d*p)*b;return l.set(1-w-E,E,w)}static containsPoint(e,t,i,a){return this.getBarycoord(e,t,i,a,zs)===null?!1:zs.x>=0&&zs.y>=0&&zs.x+zs.y<=1}static getInterpolation(e,t,i,a,l,u,d,p){return this.getBarycoord(e,t,i,a,zs)===null?(p.x=0,p.y=0,"z"in p&&(p.z=0),"w"in p&&(p.w=0),null):(p.setScalar(0),p.addScaledVector(l,zs.x),p.addScaledVector(u,zs.y),p.addScaledVector(d,zs.z),p)}static getInterpolatedAttribute(e,t,i,a,l,u){return vp.setScalar(0),wp.setScalar(0),Ep.setScalar(0),vp.fromBufferAttribute(e,t),wp.fromBufferAttribute(e,i),Ep.fromBufferAttribute(e,a),u.setScalar(0),u.addScaledVector(vp,l.x),u.addScaledVector(wp,l.y),u.addScaledVector(Ep,l.z),u}static isFrontFacing(e,t,i,a){return is.subVectors(i,t),$s.subVectors(e,t),is.cross($s).dot(a)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,a){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[a]),this}setFromAttributeAndIndices(e,t,i,a){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,a),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 is.subVectors(this.c,this.b),$s.subVectors(this.a,this.b),is.cross($s).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Mn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Mn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,a,l){return Mn.getInterpolation(e,this.a,this.b,this.c,t,i,a,l)}containsPoint(e){return Mn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Mn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,a=this.b,l=this.c;let u,d;po.subVectors(a,i),mo.subVectors(l,i),_p.subVectors(e,i);const p=po.dot(_p),m=mo.dot(_p);if(p<=0&&m<=0)return t.copy(i);yp.subVectors(e,a);const A=po.dot(yp),_=mo.dot(yp);if(A>=0&&_<=A)return t.copy(a);const b=p*_-A*m;if(b<=0&&p>=0&&A<=0)return u=p/(p-A),t.copy(i).addScaledVector(po,u);bp.subVectors(e,l);const w=po.dot(bp),E=mo.dot(bp);if(E>=0&&w<=E)return t.copy(l);const C=w*m-p*E;if(C<=0&&m>=0&&E<=0)return d=m/(m-E),t.copy(i).addScaledVector(mo,d);const T=A*E-w*_;if(T<=0&&_-A>=0&&w-E>=0)return dy.subVectors(l,a),d=(_-A)/(_-A+(w-E)),t.copy(a).addScaledVector(dy,d);const x=1/(T+C+b);return u=C*x,d=b*x,t.copy(i).addScaledVector(po,u).addScaledVector(mo,d)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const xS={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},_r={h:0,s:0,l:0},lh={h:0,s:0,l:0};function xp(o,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?o+(e-o)*6*t:t<1/2?e:t<2/3?o+(e-o)*6*(2/3-t):o}class Ye{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const a=e;a&&a.isColor?this.copy(a):typeof a=="number"?this.setHex(a):typeof a=="string"&&this.setStyle(a)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ht){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,wt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,a=wt.workingColorSpace){return this.r=e,this.g=t,this.b=i,wt.toWorkingColorSpace(this,a),this}setHSL(e,t,i,a=wt.workingColorSpace){if(e=D0(e,1),t=ft(t,0,1),i=ft(i,0,1),t===0)this.r=this.g=this.b=i;else{const l=i<=.5?i*(1+t):i+t-i*t,u=2*i-l;this.r=xp(u,l,e+1/3),this.g=xp(u,l,e),this.b=xp(u,l,e-1/3)}return wt.toWorkingColorSpace(this,a),this}setStyle(e,t=Ht){function i(l){l!==void 0&&parseFloat(l)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let a;if(a=/^(\w+)\(([^\)]*)\)/.exec(e)){let l;const u=a[1],d=a[2];switch(u){case"rgb":case"rgba":if(l=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(l[4]),this.setRGB(Math.min(255,parseInt(l[1],10))/255,Math.min(255,parseInt(l[2],10))/255,Math.min(255,parseInt(l[3],10))/255,t);if(l=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(l[4]),this.setRGB(Math.min(100,parseInt(l[1],10))/100,Math.min(100,parseInt(l[2],10))/100,Math.min(100,parseInt(l[3],10))/100,t);break;case"hsl":case"hsla":if(l=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return i(l[4]),this.setHSL(parseFloat(l[1])/360,parseFloat(l[2])/100,parseFloat(l[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(a=/^\#([A-Fa-f\d]+)$/.exec(e)){const l=a[1],u=l.length;if(u===3)return this.setRGB(parseInt(l.charAt(0),16)/15,parseInt(l.charAt(1),16)/15,parseInt(l.charAt(2),16)/15,t);if(u===6)return this.setHex(parseInt(l,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=Ht){const i=xS[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=or(e.r),this.g=or(e.g),this.b=or(e.b),this}copyLinearToSRGB(e){return this.r=al(e.r),this.g=al(e.g),this.b=al(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ht){return wt.fromWorkingColorSpace(Qi.copy(this),e),Math.round(ft(Qi.r*255,0,255))*65536+Math.round(ft(Qi.g*255,0,255))*256+Math.round(ft(Qi.b*255,0,255))}getHexString(e=Ht){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=wt.workingColorSpace){wt.fromWorkingColorSpace(Qi.copy(this),t);const i=Qi.r,a=Qi.g,l=Qi.b,u=Math.max(i,a,l),d=Math.min(i,a,l);let p,m;const A=(d+u)/2;if(d===u)p=0,m=0;else{const _=u-d;switch(m=A<=.5?_/(u+d):_/(2-u-d),u){case i:p=(a-l)/_+(a<l?6:0);break;case a:p=(l-i)/_+2;break;case l:p=(i-a)/_+4;break}p/=6}return e.h=p,e.s=m,e.l=A,e}getRGB(e,t=wt.workingColorSpace){return wt.fromWorkingColorSpace(Qi.copy(this),t),e.r=Qi.r,e.g=Qi.g,e.b=Qi.b,e}getStyle(e=Ht){wt.fromWorkingColorSpace(Qi.copy(this),e);const t=Qi.r,i=Qi.g,a=Qi.b;return e!==Ht?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${a.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(a*255)})`}offsetHSL(e,t,i){return this.getHSL(_r),this.setHSL(_r.h+e,_r.s+t,_r.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(_r),e.getHSL(lh);const i=lu(_r.h,lh.h,t),a=lu(_r.s,lh.s,t),l=lu(_r.l,lh.l,t);return this.setHSL(i,a,l),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,a=this.b,l=e.elements;return this.r=l[0]*t+l[3]*i+l[6]*a,this.g=l[1]*t+l[4]*i+l[7]*a,this.b=l[2]*t+l[5]*i+l[8]*a,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 Qi=new Ye;Ye.NAMES=xS;let jM=0,jn=class extends fs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:jM++}),this.uuid=us(),this.name="",this.type="Material",this.blending=sl,this.side=hs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Vg,this.blendDst=Qg,this.blendEquation=Ia,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ye(0,0,0),this.blendAlpha=0,this.depthFunc=ml,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=J_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ro,this.stencilZFail=ro,this.stencilZPass=ro,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const a=this[t];if(a===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}a&&a.isColor?a.set(i):a&&a.isVector3&&i&&i.isVector3?a.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==sl&&(i.blending=this.blending),this.side!==hs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Vg&&(i.blendSrc=this.blendSrc),this.blendDst!==Qg&&(i.blendDst=this.blendDst),this.blendEquation!==Ia&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==ml&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==J_&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ro&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ro&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ro&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function a(l){const u=[];for(const d in l){const p=l[d];delete p.metadata,u.push(p)}return u}if(t){const l=a(e.textures),u=a(e.images);l.length>0&&(i.textures=l),u.length>0&&(i.images=u)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const a=t.length;i=new Array(a);for(let l=0;l!==a;++l)i[l]=t[l].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}};class Pi extends jn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ye(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 qn,this.combine=oS,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 ir=qM();function qM(){const o=new ArrayBuffer(4),e=new Float32Array(o),t=new Uint32Array(o),i=new Uint32Array(512),a=new Uint32Array(512);for(let p=0;p<256;++p){const m=p-127;m<-27?(i[p]=0,i[p|256]=32768,a[p]=24,a[p|256]=24):m<-14?(i[p]=1024>>-m-14,i[p|256]=1024>>-m-14|32768,a[p]=-m-1,a[p|256]=-m-1):m<=15?(i[p]=m+15<<10,i[p|256]=m+15<<10|32768,a[p]=13,a[p|256]=13):m<128?(i[p]=31744,i[p|256]=64512,a[p]=24,a[p|256]=24):(i[p]=31744,i[p|256]=64512,a[p]=13,a[p|256]=13)}const l=new Uint32Array(2048),u=new Uint32Array(64),d=new Uint32Array(64);for(let p=1;p<1024;++p){let m=p<<13,A=0;for(;(m&8388608)===0;)m<<=1,A-=8388608;m&=-8388609,A+=947912704,l[p]=m|A}for(let p=1024;p<2048;++p)l[p]=939524096+(p-1024<<13);for(let p=1;p<31;++p)u[p]=p<<23;u[31]=1199570944,u[32]=2147483648;for(let p=33;p<63;++p)u[p]=2147483648+(p-32<<23);u[63]=3347054592;for(let p=1;p<64;++p)p!==32&&(d[p]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:a,mantissaTable:l,exponentTable:u,offsetTable:d}}function WM(o){Math.abs(o)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),o=ft(o,-65504,65504),ir.floatView[0]=o;const e=ir.uint32View[0],t=e>>23&511;return ir.baseTable[t]+((e&8388607)>>ir.shiftTable[t])}function YM(o){const e=o>>10;return ir.uint32View[0]=ir.mantissaTable[ir.offsetTable[e]+(o&1023)]+ir.exponentTable[e],ir.floatView[0]}const ch={toHalfFloat:WM,fromHalfFloat:YM},fi=new se,uh=new Ve;class Vt{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=yA,this.updateRanges=[],this.gpuType=oi,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,i){e*=this.itemSize,i*=t.itemSize;for(let a=0,l=this.itemSize;a<l;a++)this.array[e+a]=t.array[i+a];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)uh.fromBufferAttribute(this,t),uh.applyMatrix3(e),this.setXY(t,uh.x,uh.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyMatrix3(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyMatrix4(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyNormalMatrix(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.transformDirection(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=as(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ut(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=as(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=as(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ut(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=as(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ut(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=as(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,a){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array),a=Ut(a,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=a,this}setXYZW(e,t,i,a,l){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array),a=Ut(a,this.array),l=Ut(l,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=a,this.array[e+3]=l,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!==yA&&(e.usage=this.usage),e}}class SS extends Vt{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class CS extends Vt{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class $i extends Vt{constructor(e,t,i){super(new Float32Array(e),t,i)}}let XM=0;const Un=new tt,Sp=new Qt,go=new se,xn=new yi,uc=new yi,xi=new se;class Di extends fs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:XM++}),this.uuid=us(),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(vS(e)?CS:SS)(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,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const l=new ot().getNormalMatrix(e);i.applyNormalMatrix(l),i.needsUpdate=!0}const a=this.attributes.tangent;return a!==void 0&&(a.transformDirection(e),a.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Un.makeRotationFromQuaternion(e),this.applyMatrix4(Un),this}rotateX(e){return Un.makeRotationX(e),this.applyMatrix4(Un),this}rotateY(e){return Un.makeRotationY(e),this.applyMatrix4(Un),this}rotateZ(e){return Un.makeRotationZ(e),this.applyMatrix4(Un),this}translate(e,t,i){return Un.makeTranslation(e,t,i),this.applyMatrix4(Un),this}scale(e,t,i){return Un.makeScale(e,t,i),this.applyMatrix4(Un),this}lookAt(e){return Sp.lookAt(e),Sp.updateMatrix(),this.applyMatrix4(Sp.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(go).negate(),this.translate(go.x,go.y,go.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let a=0,l=e.length;a<l;a++){const u=e[a];i.push(u.x,u.y,u.z||0)}this.setAttribute("position",new $i(i,3))}else{const i=Math.min(e.length,t.count);for(let a=0;a<i;a++){const l=e[a];t.setXYZ(a,l.x,l.y,l.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 yi);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 se(-1/0,-1/0,-1/0),new se(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,a=t.length;i<a;i++){const l=t[i];xn.setFromBufferAttribute(l),this.morphTargetsRelative?(xi.addVectors(this.boundingBox.min,xn.min),this.boundingBox.expandByPoint(xi),xi.addVectors(this.boundingBox.max,xn.max),this.boundingBox.expandByPoint(xi)):(this.boundingBox.expandByPoint(xn.min),this.boundingBox.expandByPoint(xn.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 bn);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 se,1/0);return}if(e){const i=this.boundingSphere.center;if(xn.setFromBufferAttribute(e),t)for(let l=0,u=t.length;l<u;l++){const d=t[l];uc.setFromBufferAttribute(d),this.morphTargetsRelative?(xi.addVectors(xn.min,uc.min),xn.expandByPoint(xi),xi.addVectors(xn.max,uc.max),xn.expandByPoint(xi)):(xn.expandByPoint(uc.min),xn.expandByPoint(uc.max))}xn.getCenter(i);let a=0;for(let l=0,u=e.count;l<u;l++)xi.fromBufferAttribute(e,l),a=Math.max(a,i.distanceToSquared(xi));if(t)for(let l=0,u=t.length;l<u;l++){const d=t[l],p=this.morphTargetsRelative;for(let m=0,A=d.count;m<A;m++)xi.fromBufferAttribute(d,m),p&&(go.fromBufferAttribute(e,m),xi.add(go)),a=Math.max(a,i.distanceToSquared(xi))}this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}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 i=t.position,a=t.normal,l=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Vt(new Float32Array(4*i.count),4));const u=this.getAttribute("tangent"),d=[],p=[];for(let V=0;V<i.count;V++)d[V]=new se,p[V]=new se;const m=new se,A=new se,_=new se,b=new Ve,w=new Ve,E=new Ve,C=new se,T=new se;function x(V,k,z){m.fromBufferAttribute(i,V),A.fromBufferAttribute(i,k),_.fromBufferAttribute(i,z),b.fromBufferAttribute(l,V),w.fromBufferAttribute(l,k),E.fromBufferAttribute(l,z),A.sub(m),_.sub(m),w.sub(b),E.sub(b);const Q=1/(w.x*E.y-E.x*w.y);isFinite(Q)&&(C.copy(A).multiplyScalar(E.y).addScaledVector(_,-w.y).multiplyScalar(Q),T.copy(_).multiplyScalar(w.x).addScaledVector(A,-E.x).multiplyScalar(Q),d[V].add(C),d[k].add(C),d[z].add(C),p[V].add(T),p[k].add(T),p[z].add(T))}let P=this.groups;P.length===0&&(P=[{start:0,count:e.count}]);for(let V=0,k=P.length;V<k;++V){const z=P[V],Q=z.start,Z=z.count;for(let K=Q,s=Q+Z;K<s;K+=3)x(e.getX(K+0),e.getX(K+1),e.getX(K+2))}const M=new se,B=new se,D=new se,G=new se;function U(V){D.fromBufferAttribute(a,V),G.copy(D);const k=d[V];M.copy(k),M.sub(D.multiplyScalar(D.dot(k))).normalize(),B.crossVectors(G,k);const Q=B.dot(p[V])<0?-1:1;u.setXYZW(V,M.x,M.y,M.z,Q)}for(let V=0,k=P.length;V<k;++V){const z=P[V],Q=z.start,Z=z.count;for(let K=Q,s=Q+Z;K<s;K+=3)U(e.getX(K+0)),U(e.getX(K+1)),U(e.getX(K+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Vt(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let b=0,w=i.count;b<w;b++)i.setXYZ(b,0,0,0);const a=new se,l=new se,u=new se,d=new se,p=new se,m=new se,A=new se,_=new se;if(e)for(let b=0,w=e.count;b<w;b+=3){const E=e.getX(b+0),C=e.getX(b+1),T=e.getX(b+2);a.fromBufferAttribute(t,E),l.fromBufferAttribute(t,C),u.fromBufferAttribute(t,T),A.subVectors(u,l),_.subVectors(a,l),A.cross(_),d.fromBufferAttribute(i,E),p.fromBufferAttribute(i,C),m.fromBufferAttribute(i,T),d.add(A),p.add(A),m.add(A),i.setXYZ(E,d.x,d.y,d.z),i.setXYZ(C,p.x,p.y,p.z),i.setXYZ(T,m.x,m.y,m.z)}else for(let b=0,w=t.count;b<w;b+=3)a.fromBufferAttribute(t,b+0),l.fromBufferAttribute(t,b+1),u.fromBufferAttribute(t,b+2),A.subVectors(u,l),_.subVectors(a,l),A.cross(_),i.setXYZ(b+0,A.x,A.y,A.z),i.setXYZ(b+1,A.x,A.y,A.z),i.setXYZ(b+2,A.x,A.y,A.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)xi.fromBufferAttribute(e,t),xi.normalize(),e.setXYZ(t,xi.x,xi.y,xi.z)}toNonIndexed(){function e(d,p){const m=d.array,A=d.itemSize,_=d.normalized,b=new m.constructor(p.length*A);let w=0,E=0;for(let C=0,T=p.length;C<T;C++){d.isInterleavedBufferAttribute?w=p[C]*d.data.stride+d.offset:w=p[C]*A;for(let x=0;x<A;x++)b[E++]=m[w++]}return new Vt(b,A,_)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Di,i=this.index.array,a=this.attributes;for(const d in a){const p=a[d],m=e(p,i);t.setAttribute(d,m)}const l=this.morphAttributes;for(const d in l){const p=[],m=l[d];for(let A=0,_=m.length;A<_;A++){const b=m[A],w=e(b,i);p.push(w)}t.morphAttributes[d]=p}t.morphTargetsRelative=this.morphTargetsRelative;const u=this.groups;for(let d=0,p=u.length;d<p;d++){const m=u[d];t.addGroup(m.start,m.count,m.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const p=this.parameters;for(const m in p)p[m]!==void 0&&(e[m]=p[m]);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 i=this.attributes;for(const p in i){const m=i[p];e.data.attributes[p]=m.toJSON(e.data)}const a={};let l=!1;for(const p in this.morphAttributes){const m=this.morphAttributes[p],A=[];for(let _=0,b=m.length;_<b;_++){const w=m[_];A.push(w.toJSON(e.data))}A.length>0&&(a[p]=A,l=!0)}l&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);const u=this.groups;u.length>0&&(e.data.groups=JSON.parse(JSON.stringify(u)));const d=this.boundingSphere;return d!==null&&(e.data.boundingSphere={center:d.center.toArray(),radius:d.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const a=e.attributes;for(const m in a){const A=a[m];this.setAttribute(m,A.clone(t))}const l=e.morphAttributes;for(const m in l){const A=[],_=l[m];for(let b=0,w=_.length;b<w;b++)A.push(_[b].clone(t));this.morphAttributes[m]=A}this.morphTargetsRelative=e.morphTargetsRelative;const u=e.groups;for(let m=0,A=u.length;m<A;m++){const _=u[m];this.addGroup(_.start,_.count,_.materialIndex)}const d=e.boundingBox;d!==null&&(this.boundingBox=d.clone());const p=e.boundingSphere;return p!==null&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const fy=new tt,aa=new Du,hh=new bn,py=new se,dh=new se,fh=new se,ph=new se,Cp=new se,mh=new se,my=new se,gh=new se;let lt=class extends Qt{constructor(e=new Di,t=new Pi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let l=0,u=a.length;l<u;l++){const d=a[l].name||String(l);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=l}}}}getVertexPosition(e,t){const i=this.geometry,a=i.attributes.position,l=i.morphAttributes.position,u=i.morphTargetsRelative;t.fromBufferAttribute(a,e);const d=this.morphTargetInfluences;if(l&&d){mh.set(0,0,0);for(let p=0,m=l.length;p<m;p++){const A=d[p],_=l[p];A!==0&&(Cp.fromBufferAttribute(_,e),u?mh.addScaledVector(Cp,A):mh.addScaledVector(Cp.sub(t),A))}t.add(mh)}return t}raycast(e,t){const i=this.geometry,a=this.material,l=this.matrixWorld;a!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),hh.copy(i.boundingSphere),hh.applyMatrix4(l),aa.copy(e.ray).recast(e.near),!(hh.containsPoint(aa.origin)===!1&&(aa.intersectSphere(hh,py)===null||aa.origin.distanceToSquared(py)>(e.far-e.near)**2))&&(fy.copy(l).invert(),aa.copy(e.ray).applyMatrix4(fy),!(i.boundingBox!==null&&aa.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,aa)))}_computeIntersections(e,t,i){let a;const l=this.geometry,u=this.material,d=l.index,p=l.attributes.position,m=l.attributes.uv,A=l.attributes.uv1,_=l.attributes.normal,b=l.groups,w=l.drawRange;if(d!==null)if(Array.isArray(u))for(let E=0,C=b.length;E<C;E++){const T=b[E],x=u[T.materialIndex],P=Math.max(T.start,w.start),M=Math.min(d.count,Math.min(T.start+T.count,w.start+w.count));for(let B=P,D=M;B<D;B+=3){const G=d.getX(B),U=d.getX(B+1),V=d.getX(B+2);a=Ah(this,x,e,i,m,A,_,G,U,V),a&&(a.faceIndex=Math.floor(B/3),a.face.materialIndex=T.materialIndex,t.push(a))}}else{const E=Math.max(0,w.start),C=Math.min(d.count,w.start+w.count);for(let T=E,x=C;T<x;T+=3){const P=d.getX(T),M=d.getX(T+1),B=d.getX(T+2);a=Ah(this,u,e,i,m,A,_,P,M,B),a&&(a.faceIndex=Math.floor(T/3),t.push(a))}}else if(p!==void 0)if(Array.isArray(u))for(let E=0,C=b.length;E<C;E++){const T=b[E],x=u[T.materialIndex],P=Math.max(T.start,w.start),M=Math.min(p.count,Math.min(T.start+T.count,w.start+w.count));for(let B=P,D=M;B<D;B+=3){const G=B,U=B+1,V=B+2;a=Ah(this,x,e,i,m,A,_,G,U,V),a&&(a.faceIndex=Math.floor(B/3),a.face.materialIndex=T.materialIndex,t.push(a))}}else{const E=Math.max(0,w.start),C=Math.min(p.count,w.start+w.count);for(let T=E,x=C;T<x;T+=3){const P=T,M=T+1,B=T+2;a=Ah(this,u,e,i,m,A,_,P,M,B),a&&(a.faceIndex=Math.floor(T/3),t.push(a))}}}};function KM(o,e,t,i,a,l,u,d){let p;if(e.side===Fi?p=i.intersectTriangle(u,l,a,!0,d):p=i.intersectTriangle(a,l,u,e.side===hs,d),p===null)return null;gh.copy(d),gh.applyMatrix4(o.matrixWorld);const m=t.ray.origin.distanceTo(gh);return m<t.near||m>t.far?null:{distance:m,point:gh.clone(),object:o}}function Ah(o,e,t,i,a,l,u,d,p,m){o.getVertexPosition(d,dh),o.getVertexPosition(p,fh),o.getVertexPosition(m,ph);const A=KM(o,e,t,i,dh,fh,ph,my);if(A){const _=new se;Mn.getBarycoord(my,dh,fh,ph,_),a&&(A.uv=Mn.getInterpolatedAttribute(a,d,p,m,_,new Ve)),l&&(A.uv1=Mn.getInterpolatedAttribute(l,d,p,m,_,new Ve)),u&&(A.normal=Mn.getInterpolatedAttribute(u,d,p,m,_,new se),A.normal.dot(i.direction)>0&&A.normal.multiplyScalar(-1));const b={a:d,b:p,c:m,normal:new se,materialIndex:0};Mn.getNormal(dh,fh,ph,b.normal),A.face=b,A.barycoord=_}return A}class Wn extends Di{constructor(e=1,t=1,i=1,a=1,l=1,u=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:a,heightSegments:l,depthSegments:u};const d=this;a=Math.floor(a),l=Math.floor(l),u=Math.floor(u);const p=[],m=[],A=[],_=[];let b=0,w=0;E("z","y","x",-1,-1,i,t,e,u,l,0),E("z","y","x",1,-1,i,t,-e,u,l,1),E("x","z","y",1,1,e,i,t,a,u,2),E("x","z","y",1,-1,e,i,-t,a,u,3),E("x","y","z",1,-1,e,t,i,a,l,4),E("x","y","z",-1,-1,e,t,-i,a,l,5),this.setIndex(p),this.setAttribute("position",new $i(m,3)),this.setAttribute("normal",new $i(A,3)),this.setAttribute("uv",new $i(_,2));function E(C,T,x,P,M,B,D,G,U,V,k){const z=B/U,Q=D/V,Z=B/2,K=D/2,s=G/2,H=U+1,y=V+1;let ee=0,I=0;const re=new se;for(let Ae=0;Ae<y;Ae++){const N=Ae*Q-K;for(let n=0;n<H;n++){const r=n*z-Z;re[C]=r*P,re[T]=N*M,re[x]=s,m.push(re.x,re.y,re.z),re[C]=0,re[T]=0,re[x]=G>0?1:-1,A.push(re.x,re.y,re.z),_.push(n/U),_.push(1-Ae/V),ee+=1}}for(let Ae=0;Ae<V;Ae++)for(let N=0;N<U;N++){const n=b+N+H*Ae,r=b+N+H*(Ae+1),c=b+(N+1)+H*(Ae+1),h=b+(N+1)+H*Ae;p.push(n,r,h),p.push(r,c,h),I+=6}d.addGroup(w,I,k),w+=I,b+=ee}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wn(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Sl(o){const e={};for(const t in o){e[t]={};for(const i in o[t]){const a=o[t][i];a&&(a.isColor||a.isMatrix3||a.isMatrix4||a.isVector2||a.isVector3||a.isVector4||a.isTexture||a.isQuaternion)?a.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=a.clone():Array.isArray(a)?e[t][i]=a.slice():e[t][i]=a}}return e}function rn(o){const e={};for(let t=0;t<o.length;t++){const i=Sl(o[t]);for(const a in i)e[a]=i[a]}return e}function JM(o){const e=[];for(let t=0;t<o.length;t++)e.push(o[t].clone());return e}function TS(o){const e=o.getRenderTarget();return e===null?o.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:wt.workingColorSpace}const IS={clone:Sl,merge:rn};var ZM=`void main() {
|
|
79
79
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
80
80
|
}`,eR=`void main() {
|
|
81
81
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
82
|
-
}`;class zi extends jn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=ZM,this.fragmentShader=eR,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Sl(e.uniforms),this.uniformsGroups=JM(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const a in this.uniforms){const u=this.uniforms[a].value;u&&u.isTexture?t.uniforms[a]={type:"t",value:u.toJSON(e).uuid}:u&&u.isColor?t.uniforms[a]={type:"c",value:u.getHex()}:u&&u.isVector2?t.uniforms[a]={type:"v2",value:u.toArray()}:u&&u.isVector3?t.uniforms[a]={type:"v3",value:u.toArray()}:u&&u.isVector4?t.uniforms[a]={type:"v4",value:u.toArray()}:u&&u.isMatrix3?t.uniforms[a]={type:"m3",value:u.toArray()}:u&&u.isMatrix4?t.uniforms[a]={type:"m4",value:u.toArray()}:t.uniforms[a]={value:u}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}let MS=class extends Qt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tt,this.projectionMatrix=new tt,this.projectionMatrixInverse=new tt,this.coordinateSystem=sr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};const yr=new se,gy=new Ve,Ay=new Ve;class _i extends MS{constructor(e=50,t=1,i=.1,a=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=a,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=El*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ou*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return El*2*Math.atan(Math.tan(ou*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){yr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(yr.x,yr.y).multiplyScalar(-e/yr.z),yr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(yr.x,yr.y).multiplyScalar(-e/yr.z)}getViewSize(e,t){return this.getViewBounds(e,gy,Ay),t.subVectors(Ay,gy)}setViewOffset(e,t,i,a,l,u){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=a,this.view.width=l,this.view.height=u,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ou*.5*this.fov)/this.zoom,i=2*t,a=this.aspect*i,l=-.5*a;const u=this.view;if(this.view!==null&&this.view.enabled){const p=u.fullWidth,m=u.fullHeight;l+=u.offsetX*a/p,t-=u.offsetY*i/m,a*=u.width/p,i*=u.height/m}const d=this.filmOffset;d!==0&&(l+=e*d/this.getFilmWidth()),this.projectionMatrix.makePerspective(l,l+a,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ao=-90,_o=1;class bA extends Qt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const a=new _i(Ao,_o,e,t);a.layers=this.layers,this.add(a);const l=new _i(Ao,_o,e,t);l.layers=this.layers,this.add(l);const u=new _i(Ao,_o,e,t);u.layers=this.layers,this.add(u);const d=new _i(Ao,_o,e,t);d.layers=this.layers,this.add(d);const p=new _i(Ao,_o,e,t);p.layers=this.layers,this.add(p);const m=new _i(Ao,_o,e,t);m.layers=this.layers,this.add(m)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,a,l,u,d,p]=t;for(const m of t)this.remove(m);if(e===sr)i.up.set(0,1,0),i.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),l.up.set(0,0,-1),l.lookAt(0,1,0),u.up.set(0,0,1),u.lookAt(0,-1,0),d.up.set(0,1,0),d.lookAt(0,0,1),p.up.set(0,1,0),p.lookAt(0,0,-1);else if(e===Jd)i.up.set(0,-1,0),i.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),l.up.set(0,0,1),l.lookAt(0,1,0),u.up.set(0,0,-1),u.lookAt(0,-1,0),d.up.set(0,-1,0),d.lookAt(0,0,1),p.up.set(0,-1,0),p.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const m of t)this.add(m),m.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:a}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[l,u,d,p,m,A]=this.children,_=e.getRenderTarget(),b=e.getActiveCubeFace(),w=e.getActiveMipmapLevel(),E=e.xr.enabled;e.xr.enabled=!1;const C=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,a),e.render(t,l),e.setRenderTarget(i,1,a),e.render(t,u),e.setRenderTarget(i,2,a),e.render(t,d),e.setRenderTarget(i,3,a),e.render(t,p),e.setRenderTarget(i,4,a),e.render(t,m),i.texture.generateMipmaps=C,e.setRenderTarget(i,5,a),e.render(t,A),e.setRenderTarget(_,b,w),e.xr.enabled=E,i.texture.needsPMREMUpdate=!0}}class RS extends Kt{constructor(e,t,i,a,l,u,d,p,m,A){e=e!==void 0?e:[],t=t!==void 0?t:ja,super(e,t,i,a,l,u,d,p,m,A),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class k0 extends dn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},a=[i,i,i,i,i,i];this.texture=new RS(a,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:
|
|
82
|
+
}`;class zi extends jn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=ZM,this.fragmentShader=eR,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Sl(e.uniforms),this.uniformsGroups=JM(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const a in this.uniforms){const u=this.uniforms[a].value;u&&u.isTexture?t.uniforms[a]={type:"t",value:u.toJSON(e).uuid}:u&&u.isColor?t.uniforms[a]={type:"c",value:u.getHex()}:u&&u.isVector2?t.uniforms[a]={type:"v2",value:u.toArray()}:u&&u.isVector3?t.uniforms[a]={type:"v3",value:u.toArray()}:u&&u.isVector4?t.uniforms[a]={type:"v4",value:u.toArray()}:u&&u.isMatrix3?t.uniforms[a]={type:"m3",value:u.toArray()}:u&&u.isMatrix4?t.uniforms[a]={type:"m4",value:u.toArray()}:t.uniforms[a]={value:u}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}let MS=class extends Qt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new tt,this.projectionMatrix=new tt,this.projectionMatrixInverse=new tt,this.coordinateSystem=sr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};const yr=new se,gy=new Ve,Ay=new Ve;class _i extends MS{constructor(e=50,t=1,i=.1,a=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=a,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=El*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ou*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return El*2*Math.atan(Math.tan(ou*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){yr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(yr.x,yr.y).multiplyScalar(-e/yr.z),yr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(yr.x,yr.y).multiplyScalar(-e/yr.z)}getViewSize(e,t){return this.getViewBounds(e,gy,Ay),t.subVectors(Ay,gy)}setViewOffset(e,t,i,a,l,u){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=a,this.view.width=l,this.view.height=u,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ou*.5*this.fov)/this.zoom,i=2*t,a=this.aspect*i,l=-.5*a;const u=this.view;if(this.view!==null&&this.view.enabled){const p=u.fullWidth,m=u.fullHeight;l+=u.offsetX*a/p,t-=u.offsetY*i/m,a*=u.width/p,i*=u.height/m}const d=this.filmOffset;d!==0&&(l+=e*d/this.getFilmWidth()),this.projectionMatrix.makePerspective(l,l+a,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ao=-90,_o=1;class bA extends Qt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const a=new _i(Ao,_o,e,t);a.layers=this.layers,this.add(a);const l=new _i(Ao,_o,e,t);l.layers=this.layers,this.add(l);const u=new _i(Ao,_o,e,t);u.layers=this.layers,this.add(u);const d=new _i(Ao,_o,e,t);d.layers=this.layers,this.add(d);const p=new _i(Ao,_o,e,t);p.layers=this.layers,this.add(p);const m=new _i(Ao,_o,e,t);m.layers=this.layers,this.add(m)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,a,l,u,d,p]=t;for(const m of t)this.remove(m);if(e===sr)i.up.set(0,1,0),i.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),l.up.set(0,0,-1),l.lookAt(0,1,0),u.up.set(0,0,1),u.lookAt(0,-1,0),d.up.set(0,1,0),d.lookAt(0,0,1),p.up.set(0,1,0),p.lookAt(0,0,-1);else if(e===Jd)i.up.set(0,-1,0),i.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),l.up.set(0,0,1),l.lookAt(0,1,0),u.up.set(0,0,-1),u.lookAt(0,-1,0),d.up.set(0,-1,0),d.lookAt(0,0,1),p.up.set(0,-1,0),p.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const m of t)this.add(m),m.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:a}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[l,u,d,p,m,A]=this.children,_=e.getRenderTarget(),b=e.getActiveCubeFace(),w=e.getActiveMipmapLevel(),E=e.xr.enabled;e.xr.enabled=!1;const C=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,a),e.render(t,l),e.setRenderTarget(i,1,a),e.render(t,u),e.setRenderTarget(i,2,a),e.render(t,d),e.setRenderTarget(i,3,a),e.render(t,p),e.setRenderTarget(i,4,a),e.render(t,m),i.texture.generateMipmaps=C,e.setRenderTarget(i,5,a),e.render(t,A),e.setRenderTarget(_,b,w),e.xr.enabled=E,i.texture.needsPMREMUpdate=!0}}class RS extends Kt{constructor(e,t,i,a,l,u,d,p,m,A){e=e!==void 0?e:[],t=t!==void 0?t:ja,super(e,t,i,a,l,u,d,p,m,A),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class k0 extends dn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},a=[i,i,i,i,i,i];this.texture=new RS(a,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Et}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
83
83
|
|
|
84
84
|
varying vec3 vWorldDirection;
|
|
85
85
|
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
115
115
|
|
|
116
116
|
}
|
|
117
|
-
`},a=new Wn(5,5,5),l=new zi({name:"CubemapFromEquirect",uniforms:Sl(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Fi,blending:cs});l.uniforms.tEquirect.value=t;const u=new lt(a,l),d=t.minFilter;return t.minFilter===hn&&(t.minFilter=wt),new bA(1,10,this).update(e,u),t.minFilter=d,u.geometry.dispose(),u.material.dispose(),this}clear(e,t,i,a){const l=e.getRenderTarget();for(let u=0;u<6;u++)e.setRenderTarget(this,u),e.clear(t,i,a);e.setRenderTarget(l)}}let Wr=class extends Qt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new qn,this.environmentIntensity=1,this.environmentRotation=new qn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}};class tR{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=yA,this.updateRanges=[],this.version=0,this.uuid=us()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let a=0,l=this.stride;a<l;a++)this.array[e+a]=t.array[i+a];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=us()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=us()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const tn=new se;class U0{constructor(e,t,i,a=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=a}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)tn.fromBufferAttribute(this,t),tn.applyMatrix4(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)tn.fromBufferAttribute(this,t),tn.applyNormalMatrix(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)tn.fromBufferAttribute(this,t),tn.transformDirection(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=as(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ut(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=as(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=as(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=as(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=as(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,a){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array),a=Ut(a,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=a,this}setXYZW(e,t,i,a,l){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array),a=Ut(a,this.array),l=Ut(l,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=a,this.data.array[e+3]=l,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const a=i*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)t.push(this.data.array[a+l])}return new Vt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new U0(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const a=i*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)t.push(this.data.array[a+l])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const _y=new se,yy=new Rt,by=new Rt,iR=new se,vy=new tt,_h=new se,Tp=new bn,wy=new tt,Ip=new Du;class nR extends lt{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=X_,this.bindMatrix=new tt,this.bindMatrixInverse=new tt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new yi),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,_h),this.boundingBox.expandByPoint(_h)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new bn),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,_h),this.boundingSphere.expandByPoint(_h)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const i=this.material,a=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Tp.copy(this.boundingSphere),Tp.applyMatrix4(a),e.ray.intersectsSphere(Tp)!==!1&&(wy.copy(a).invert(),Ip.copy(e.ray).applyMatrix4(wy),!(this.boundingBox!==null&&Ip.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Ip)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Rt,t=this.geometry.attributes.skinWeight;for(let i=0,a=t.count;i<a;i++){e.fromBufferAttribute(t,i);const l=1/e.manhattanLength();l!==1/0?e.multiplyScalar(l):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===X_?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===tM?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,a=this.geometry;yy.fromBufferAttribute(a.attributes.skinIndex,e),by.fromBufferAttribute(a.attributes.skinWeight,e),_y.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let l=0;l<4;l++){const u=by.getComponent(l);if(u!==0){const d=yy.getComponent(l);vy.multiplyMatrices(i.bones[d].matrixWorld,i.boneInverses[d]),t.addScaledVector(iR.copy(_y).applyMatrix4(vy),u)}}return t.applyMatrix4(this.bindMatrixInverse)}}class BS extends Qt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Nu extends Kt{constructor(e=null,t=1,i=1,a,l,u,d,p,m=gi,A=gi,_,b){super(null,u,d,p,m,A,a,l,_,b),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ey=new tt,sR=new tt;class F0{constructor(e=[],t=[]){this.uuid=us(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,a=this.bones.length;i<a;i++)this.boneInverses.push(new tt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new tt;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,a=this.boneTexture;for(let l=0,u=e.length;l<u;l++){const d=e[l]?e[l].matrixWorld:sR;Ey.multiplyMatrices(d,t[l]),Ey.toArray(i,l*16)}a!==null&&(a.needsUpdate=!0)}clone(){return new F0(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Nu(t,e,e,Xt,oi);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const a=this.bones[t];if(a.name===e)return a}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,a=e.bones.length;i<a;i++){const l=e.bones[i];let u=t[l];u===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",l),u=new BS),this.bones.push(u),this.boneInverses.push(new tt().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let a=0,l=t.length;a<l;a++){const u=t[a];e.bones.push(u.uuid);const d=i[a];e.boneInverses.push(d.toArray())}return e}}class vA extends Vt{constructor(e,t,i,a=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=a}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const yo=new tt,xy=new tt,yh=[],Sy=new yi,rR=new tt,hc=new lt,dc=new bn;class aR extends lt{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new vA(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let a=0;a<i;a++)this.setMatrixAt(a,rR)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new yi),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,yo),Sy.copy(e.boundingBox).applyMatrix4(yo),this.boundingBox.union(Sy)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new bn),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,yo),dc.copy(e.boundingSphere).applyMatrix4(yo),this.boundingSphere.union(dc)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const i=t.morphTargetInfluences,a=this.morphTexture.source.data.data,l=i.length+1,u=e*l+1;for(let d=0;d<i.length;d++)i[d]=a[u+d]}raycast(e,t){const i=this.matrixWorld,a=this.count;if(hc.geometry=this.geometry,hc.material=this.material,hc.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),dc.copy(this.boundingSphere),dc.applyMatrix4(i),e.ray.intersectsSphere(dc)!==!1))for(let l=0;l<a;l++){this.getMatrixAt(l,yo),xy.multiplyMatrices(i,yo),hc.matrixWorld=xy,hc.raycast(e,yh);for(let u=0,d=yh.length;u<d;u++){const p=yh[u];p.instanceId=l,p.object=this,t.push(p)}yh.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new vA(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const i=t.morphTargetInfluences,a=i.length+1;this.morphTexture===null&&(this.morphTexture=new Nu(new Float32Array(a*this.count),a,this.count,Or,oi));const l=this.morphTexture.source.data.data;let u=0;for(let m=0;m<i.length;m++)u+=i[m];const d=this.geometry.morphTargetsRelative?1:1-u,p=a*e;l[p]=d,l.set(i,p+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}const Mp=new se,oR=new se,lR=new ot;class _a{constructor(e=new se(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,a){return this.normal.set(e,t,i),this.constant=a,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const a=Mp.subVectors(i,t).cross(oR.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(a,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Mp),a=this.normal.dot(i);if(a===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const l=-(e.start.dot(this.normal)+this.constant)/a;return l<0||l>1?null:t.copy(e.start).addScaledVector(i,l)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||lR.getNormalMatrix(e),a=this.coplanarPoint(Mp).applyMatrix4(e),l=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(l),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const oa=new bn,bh=new se;class $0{constructor(e=new _a,t=new _a,i=new _a,a=new _a,l=new _a,u=new _a){this.planes=[e,t,i,a,l,u]}set(e,t,i,a,l,u){const d=this.planes;return d[0].copy(e),d[1].copy(t),d[2].copy(i),d[3].copy(a),d[4].copy(l),d[5].copy(u),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=sr){const i=this.planes,a=e.elements,l=a[0],u=a[1],d=a[2],p=a[3],m=a[4],A=a[5],_=a[6],b=a[7],w=a[8],E=a[9],C=a[10],T=a[11],x=a[12],P=a[13],M=a[14],B=a[15];if(i[0].setComponents(p-l,b-m,T-w,B-x).normalize(),i[1].setComponents(p+l,b+m,T+w,B+x).normalize(),i[2].setComponents(p+u,b+A,T+E,B+P).normalize(),i[3].setComponents(p-u,b-A,T-E,B-P).normalize(),i[4].setComponents(p-d,b-_,T-C,B-M).normalize(),t===sr)i[5].setComponents(p+d,b+_,T+C,B+M).normalize();else if(t===Jd)i[5].setComponents(d,_,C,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),oa.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),oa.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(oa)}intersectsSprite(e){return oa.center.set(0,0,0),oa.radius=.7071067811865476,oa.applyMatrix4(e.matrixWorld),this.intersectsSphere(oa)}intersectsSphere(e){const t=this.planes,i=e.center,a=-e.radius;for(let l=0;l<6;l++)if(t[l].distanceToPoint(i)<a)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const a=t[i];if(bh.x=a.normal.x>0?e.max.x:e.min.x,bh.y=a.normal.y>0?e.max.y:e.min.y,bh.z=a.normal.z>0?e.max.z:e.min.z,a.distanceToPoint(bh)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Ou extends jn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ye(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Zd=new se,ef=new se,Cy=new tt,fc=new Du,vh=new bn,Rp=new se,Ty=new se;class Cl extends Qt{constructor(e=new Di,t=new Ou){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let a=1,l=t.count;a<l;a++)Zd.fromBufferAttribute(t,a-1),ef.fromBufferAttribute(t,a),i[a]=i[a-1],i[a]+=Zd.distanceTo(ef);e.setAttribute("lineDistance",new $i(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,a=this.matrixWorld,l=e.params.Line.threshold,u=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),vh.copy(i.boundingSphere),vh.applyMatrix4(a),vh.radius+=l,e.ray.intersectsSphere(vh)===!1)return;Cy.copy(a).invert(),fc.copy(e.ray).applyMatrix4(Cy);const d=l/((this.scale.x+this.scale.y+this.scale.z)/3),p=d*d,m=this.isLineSegments?2:1,A=i.index,b=i.attributes.position;if(A!==null){const w=Math.max(0,u.start),E=Math.min(A.count,u.start+u.count);for(let C=w,T=E-1;C<T;C+=m){const x=A.getX(C),P=A.getX(C+1),M=wh(this,e,fc,p,x,P);M&&t.push(M)}if(this.isLineLoop){const C=A.getX(E-1),T=A.getX(w),x=wh(this,e,fc,p,C,T);x&&t.push(x)}}else{const w=Math.max(0,u.start),E=Math.min(b.count,u.start+u.count);for(let C=w,T=E-1;C<T;C+=m){const x=wh(this,e,fc,p,C,C+1);x&&t.push(x)}if(this.isLineLoop){const C=wh(this,e,fc,p,E-1,w);C&&t.push(C)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let l=0,u=a.length;l<u;l++){const d=a[l].name||String(l);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=l}}}}}function wh(o,e,t,i,a,l){const u=o.geometry.attributes.position;if(Zd.fromBufferAttribute(u,a),ef.fromBufferAttribute(u,l),t.distanceSqToSegment(Zd,ef,Rp,Ty)>i)return;Rp.applyMatrix4(o.matrixWorld);const p=e.ray.origin.distanceTo(Rp);if(!(p<e.near||p>e.far))return{distance:p,point:Ty.clone().applyMatrix4(o.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:o}}const Iy=new se,My=new se;class z0 extends Cl{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let a=0,l=t.count;a<l;a+=2)Iy.fromBufferAttribute(t,a),My.fromBufferAttribute(t,a+1),i[a]=a===0?0:i[a-1],i[a+1]=i[a]+Iy.distanceTo(My);e.setAttribute("lineDistance",new $i(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class cR extends Cl{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class PS extends jn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ye(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Ry=new tt,wA=new Du,Eh=new bn,xh=new se;class uR extends Qt{constructor(e=new Di,t=new PS){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,a=this.matrixWorld,l=e.params.Points.threshold,u=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Eh.copy(i.boundingSphere),Eh.applyMatrix4(a),Eh.radius+=l,e.ray.intersectsSphere(Eh)===!1)return;Ry.copy(a).invert(),wA.copy(e.ray).applyMatrix4(Ry);const d=l/((this.scale.x+this.scale.y+this.scale.z)/3),p=d*d,m=i.index,_=i.attributes.position;if(m!==null){const b=Math.max(0,u.start),w=Math.min(m.count,u.start+u.count);for(let E=b,C=w;E<C;E++){const T=m.getX(E);xh.fromBufferAttribute(_,T),By(xh,T,p,a,e,t,this)}}else{const b=Math.max(0,u.start),w=Math.min(_.count,u.start+u.count);for(let E=b,C=w;E<C;E++)xh.fromBufferAttribute(_,E),By(xh,E,p,a,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let l=0,u=a.length;l<u;l++){const d=a[l].name||String(l);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=l}}}}}function By(o,e,t,i,a,l,u){const d=wA.distanceSqToPoint(o);if(d<t){const p=new se;wA.closestPointToPoint(o,p),p.applyMatrix4(i);const m=a.ray.origin.distanceTo(p);if(m<a.near||m>a.far)return;l.push({distance:m,distanceToRay:Math.sqrt(d),point:p,index:e,face:null,faceIndex:null,barycoord:null,object:u})}}let mi=class extends Qt{constructor(){super(),this.isGroup=!0,this.type="Group"}};class hR extends Kt{constructor(e,t,i,a,l,u,d,p,m){super(e,t,i,a,l,u,d,p,m),this.isVideoTexture=!0,this.minFilter=u!==void 0?u:wt,this.magFilter=l!==void 0?l:wt,this.generateMipmaps=!1;const A=this;function _(){A.needsUpdate=!0,e.requestVideoFrameCallback(_)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(_)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Ua extends Kt{constructor(e,t,i,a,l,u,d,p,m,A,_,b){super(null,u,d,p,m,A,a,l,_,b),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class dR extends Ua{constructor(e,t,i,a,l,u){super(e,t,i,l,u),this.isCompressedArrayTexture=!0,this.image.depth=a,this.wrapR=ai,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class fR extends Ua{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,ja),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class pR extends Kt{constructor(e,t,i,a,l,u,d,p,m){super(e,t,i,a,l,u,d,p,m),this.isCanvasTexture=!0,this.needsUpdate=!0}}class LS extends Kt{constructor(e,t,i,a,l,u,d,p,m,A=rl){if(A!==rl&&A!==yl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&A===rl&&(i=qr),i===void 0&&A===yl&&(i=_l),super(null,a,l,u,d,p,A,i,m),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=d!==void 0?d:gi,this.minFilter=p!==void 0?p:gi,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Ms extends Di{constructor(e=1,t=1,i=1,a=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:a};const l=e/2,u=t/2,d=Math.floor(i),p=Math.floor(a),m=d+1,A=p+1,_=e/d,b=t/p,w=[],E=[],C=[],T=[];for(let x=0;x<A;x++){const P=x*b-u;for(let M=0;M<m;M++){const B=M*_-l;E.push(B,-P,0),C.push(0,0,1),T.push(M/d),T.push(1-x/p)}}for(let x=0;x<p;x++)for(let P=0;P<d;P++){const M=P+m*x,B=P+m*(x+1),D=P+1+m*(x+1),G=P+1+m*x;w.push(M,B,G),w.push(B,D,G)}this.setIndex(w),this.setAttribute("position",new $i(E,3)),this.setAttribute("normal",new $i(C,3)),this.setAttribute("uv",new $i(T,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ms(e.width,e.height,e.widthSegments,e.heightSegments)}}class Df extends Di{constructor(e=1,t=32,i=16,a=0,l=Math.PI*2,u=0,d=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:a,phiLength:l,thetaStart:u,thetaLength:d},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const p=Math.min(u+d,Math.PI);let m=0;const A=[],_=new se,b=new se,w=[],E=[],C=[],T=[];for(let x=0;x<=i;x++){const P=[],M=x/i;let B=0;x===0&&u===0?B=.5/t:x===i&&p===Math.PI&&(B=-.5/t);for(let D=0;D<=t;D++){const G=D/t;_.x=-e*Math.cos(a+G*l)*Math.sin(u+M*d),_.y=e*Math.cos(u+M*d),_.z=e*Math.sin(a+G*l)*Math.sin(u+M*d),E.push(_.x,_.y,_.z),b.copy(_).normalize(),C.push(b.x,b.y,b.z),T.push(G+B,1-M),P.push(m++)}A.push(P)}for(let x=0;x<i;x++)for(let P=0;P<t;P++){const M=A[x][P+1],B=A[x][P],D=A[x+1][P],G=A[x+1][P+1];(x!==0||u>0)&&w.push(M,B,G),(x!==i-1||p<Math.PI)&&w.push(B,D,G)}this.setIndex(w),this.setAttribute("position",new $i(E,3)),this.setAttribute("normal",new $i(C,3)),this.setAttribute("uv",new $i(T,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Df(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Su extends jn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ye(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ye(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yS,this.normalScale=new Ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new qn,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Rs extends Su{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ve(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ft(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ye(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ye(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ye(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class G0 extends jn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=sM,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class mR extends jn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class Bp extends Ou{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Sh(o,e,t){return!o||!t&&o.constructor===e?o:typeof e.BYTES_PER_ELEMENT=="number"?new e(o):Array.prototype.slice.call(o)}function gR(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function AR(o){function e(a,l){return o[a]-o[l]}const t=o.length,i=new Array(t);for(let a=0;a!==t;++a)i[a]=a;return i.sort(e),i}function Py(o,e,t){const i=o.length,a=new o.constructor(i);for(let l=0,u=0;u!==i;++l){const d=t[l]*e;for(let p=0;p!==e;++p)a[u++]=o[d+p]}return a}function DS(o,e,t,i){let a=1,l=o[0];for(;l!==void 0&&l[i]===void 0;)l=o[a++];if(l===void 0)return;let u=l[i];if(u!==void 0)if(Array.isArray(u))do u=l[i],u!==void 0&&(e.push(l.time),t.push.apply(t,u)),l=o[a++];while(l!==void 0);else if(u.toArray!==void 0)do u=l[i],u!==void 0&&(e.push(l.time),u.toArray(t,t.length)),l=o[a++];while(l!==void 0);else do u=l[i],u!==void 0&&(e.push(l.time),t.push(u)),l=o[a++];while(l!==void 0)}class ku{constructor(e,t,i,a){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=a!==void 0?a:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,a=t[i],l=t[i-1];e:{t:{let u;i:{n:if(!(e<a)){for(let d=i+2;;){if(a===void 0){if(e<l)break n;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===d)break;if(l=a,a=t[++i],e<a)break t}u=t.length;break i}if(!(e>=l)){const d=t[1];e<d&&(i=2,l=d);for(let p=i-2;;){if(l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===p)break;if(a=l,l=t[--i-1],e>=l)break t}u=i,i=0;break i}break e}for(;i<u;){const d=i+u>>>1;e<t[d]?u=d:i=d+1}if(a=t[i],l=t[i-1],l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(a===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,l,a)}return this.interpolate_(i,l,e,a)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,a=this.valueSize,l=e*a;for(let u=0;u!==a;++u)t[u]=i[l+u];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class _R extends ku{constructor(e,t,i,a){super(e,t,i,a),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:qo,endingEnd:qo}}intervalChanged_(e,t,i){const a=this.parameterPositions;let l=e-2,u=e+1,d=a[l],p=a[u];if(d===void 0)switch(this.getSettings_().endingStart){case Wo:l=e,d=2*t-i;break;case Xd:l=a.length-2,d=t+a[l]-a[l+1];break;default:l=e,d=i}if(p===void 0)switch(this.getSettings_().endingEnd){case Wo:u=e,p=2*i-t;break;case Xd:u=1,p=i+a[1]-a[0];break;default:u=e-1,p=t}const m=(i-t)*.5,A=this.valueSize;this._weightPrev=m/(t-d),this._weightNext=m/(p-i),this._offsetPrev=l*A,this._offsetNext=u*A}interpolate_(e,t,i,a){const l=this.resultBuffer,u=this.sampleValues,d=this.valueSize,p=e*d,m=p-d,A=this._offsetPrev,_=this._offsetNext,b=this._weightPrev,w=this._weightNext,E=(i-t)/(a-t),C=E*E,T=C*E,x=-b*T+2*b*C-b*E,P=(1+b)*T+(-1.5-2*b)*C+(-.5+b)*E+1,M=(-1-w)*T+(1.5+w)*C+.5*E,B=w*T-w*C;for(let D=0;D!==d;++D)l[D]=x*u[A+D]+P*u[m+D]+M*u[p+D]+B*u[_+D];return l}}class NS extends ku{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e,t,i,a){const l=this.resultBuffer,u=this.sampleValues,d=this.valueSize,p=e*d,m=p-d,A=(i-t)/(a-t),_=1-A;for(let b=0;b!==d;++b)l[b]=u[m+b]*_+u[p+b]*A;return l}}class yR extends ku{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e){return this.copySampleValue_(e-1)}}class Bs{constructor(e,t,i,a){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Sh(t,this.TimeBufferType),this.values=Sh(i,this.ValueBufferType),this.setInterpolation(a||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:Sh(e.times,Array),values:Sh(e.values,Array)};const a=e.getInterpolation();a!==e.DefaultInterpolation&&(i.interpolation=a)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new yR(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new NS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new _R(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case vl:t=this.InterpolantFactoryMethodDiscrete;break;case wl:t=this.InterpolantFactoryMethodLinear;break;case op:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return vl;case this.InterpolantFactoryMethodLinear:return wl;case this.InterpolantFactoryMethodSmooth:return op}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,a=t.length;i!==a;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,a=t.length;i!==a;++i)t[i]*=e}return this}trim(e,t){const i=this.times,a=i.length;let l=0,u=a-1;for(;l!==a&&i[l]<e;)++l;for(;u!==-1&&i[u]>t;)--u;if(++u,l!==0||u!==a){l>=u&&(u=Math.max(u,1),l=u-1);const d=this.getValueSize();this.times=i.slice(l,u),this.values=this.values.slice(l*d,u*d)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,a=this.values,l=i.length;l===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let u=null;for(let d=0;d!==l;d++){const p=i[d];if(typeof p=="number"&&isNaN(p)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,d,p),e=!1;break}if(u!==null&&u>p){console.error("THREE.KeyframeTrack: Out of order keys.",this,d,p,u),e=!1;break}u=p}if(a!==void 0&&gR(a))for(let d=0,p=a.length;d!==p;++d){const m=a[d];if(isNaN(m)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,d,m),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),a=this.getInterpolation()===op,l=e.length-1;let u=1;for(let d=1;d<l;++d){let p=!1;const m=e[d],A=e[d+1];if(m!==A&&(d!==1||m!==e[0]))if(a)p=!0;else{const _=d*i,b=_-i,w=_+i;for(let E=0;E!==i;++E){const C=t[_+E];if(C!==t[b+E]||C!==t[w+E]){p=!0;break}}}if(p){if(d!==u){e[u]=e[d];const _=d*i,b=u*i;for(let w=0;w!==i;++w)t[b+w]=t[_+w]}++u}}if(l>0){e[u]=e[l];for(let d=l*i,p=u*i,m=0;m!==i;++m)t[p+m]=t[d+m];++u}return u!==e.length?(this.times=e.slice(0,u),this.values=t.slice(0,u*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,a=new i(this.name,e,t);return a.createInterpolant=this.createInterpolant,a}}Bs.prototype.TimeBufferType=Float32Array;Bs.prototype.ValueBufferType=Float32Array;Bs.prototype.DefaultInterpolation=wl;class $l extends Bs{constructor(e,t,i){super(e,t,i)}}$l.prototype.ValueTypeName="bool";$l.prototype.ValueBufferType=Array;$l.prototype.DefaultInterpolation=vl;$l.prototype.InterpolantFactoryMethodLinear=void 0;$l.prototype.InterpolantFactoryMethodSmooth=void 0;class OS extends Bs{}OS.prototype.ValueTypeName="color";class Tl extends Bs{}Tl.prototype.ValueTypeName="number";class bR extends ku{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e,t,i,a){const l=this.resultBuffer,u=this.sampleValues,d=this.valueSize,p=(i-t)/(a-t);let m=e*d;for(let A=m+d;m!==A;m+=4)Yi.slerpFlat(l,0,u,m-d,u,m,p);return l}}class Il extends Bs{InterpolantFactoryMethodLinear(e){return new bR(this.times,this.values,this.getValueSize(),e)}}Il.prototype.ValueTypeName="quaternion";Il.prototype.InterpolantFactoryMethodSmooth=void 0;class zl extends Bs{constructor(e,t,i){super(e,t,i)}}zl.prototype.ValueTypeName="string";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=vl;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;class Ml extends Bs{}Ml.prototype.ValueTypeName="vector";class EA{constructor(e="",t=-1,i=[],a=L0){this.name=e,this.tracks=i,this.duration=t,this.blendMode=a,this.uuid=us(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,a=1/(e.fps||1);for(let u=0,d=i.length;u!==d;++u)t.push(wR(i[u]).scale(a));const l=new this(e.name,e.duration,t,e.blendMode);return l.uuid=e.uuid,l}static toJSON(e){const t=[],i=e.tracks,a={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let l=0,u=i.length;l!==u;++l)t.push(Bs.toJSON(i[l]));return a}static CreateFromMorphTargetSequence(e,t,i,a){const l=t.length,u=[];for(let d=0;d<l;d++){let p=[],m=[];p.push((d+l-1)%l,d,(d+1)%l),m.push(0,1,0);const A=AR(p);p=Py(p,1,A),m=Py(m,1,A),!a&&p[0]===0&&(p.push(l),m.push(m[0])),u.push(new Tl(".morphTargetInfluences["+t[d].name+"]",p,m).scale(1/i))}return new this(e,-1,u)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const a=e;i=a.geometry&&a.geometry.animations||a.animations}for(let a=0;a<i.length;a++)if(i[a].name===t)return i[a];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const a={},l=/^([\w-]*?)([\d]+)$/;for(let d=0,p=e.length;d<p;d++){const m=e[d],A=m.name.match(l);if(A&&A.length>1){const _=A[1];let b=a[_];b||(a[_]=b=[]),b.push(m)}}const u=[];for(const d in a)u.push(this.CreateFromMorphTargetSequence(d,a[d],t,i));return u}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(_,b,w,E,C){if(w.length!==0){const T=[],x=[];DS(w,T,x,E),T.length!==0&&C.push(new _(b,T,x))}},a=[],l=e.name||"default",u=e.fps||30,d=e.blendMode;let p=e.length||-1;const m=e.hierarchy||[];for(let _=0;_<m.length;_++){const b=m[_].keys;if(!(!b||b.length===0))if(b[0].morphTargets){const w={};let E;for(E=0;E<b.length;E++)if(b[E].morphTargets)for(let C=0;C<b[E].morphTargets.length;C++)w[b[E].morphTargets[C]]=-1;for(const C in w){const T=[],x=[];for(let P=0;P!==b[E].morphTargets.length;++P){const M=b[E];T.push(M.time),x.push(M.morphTarget===C?1:0)}a.push(new Tl(".morphTargetInfluence["+C+"]",T,x))}p=w.length*u}else{const w=".bones["+t[_].name+"]";i(Ml,w+".position",b,"pos",a),i(Il,w+".quaternion",b,"rot",a),i(Ml,w+".scale",b,"scl",a)}}return a.length===0?null:new this(l,p,a,d)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,a=e.length;i!==a;++i){const l=this.tracks[i];t=Math.max(t,l.times[l.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function vR(o){switch(o.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Tl;case"vector":case"vector2":case"vector3":case"vector4":return Ml;case"color":return OS;case"quaternion":return Il;case"bool":case"boolean":return $l;case"string":return zl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+o)}function wR(o){if(o.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=vR(o.type);if(o.times===void 0){const t=[],i=[];DS(o.keys,t,i,"value"),o.times=t,o.values=i}return e.parse!==void 0?e.parse(o):new e(o.name,o.times,o.values,o.interpolation)}const kr={enabled:!1,files:{},add:function(o,e){this.enabled!==!1&&(this.files[o]=e)},get:function(o){if(this.enabled!==!1)return this.files[o]},remove:function(o){delete this.files[o]},clear:function(){this.files={}}};class kS{constructor(e,t,i){const a=this;let l=!1,u=0,d=0,p;const m=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(A){d++,l===!1&&a.onStart!==void 0&&a.onStart(A,u,d),l=!0},this.itemEnd=function(A){u++,a.onProgress!==void 0&&a.onProgress(A,u,d),u===d&&(l=!1,a.onLoad!==void 0&&a.onLoad())},this.itemError=function(A){a.onError!==void 0&&a.onError(A)},this.resolveURL=function(A){return p?p(A):A},this.setURLModifier=function(A){return p=A,this},this.addHandler=function(A,_){return m.push(A,_),this},this.removeHandler=function(A){const _=m.indexOf(A);return _!==-1&&m.splice(_,2),this},this.getHandler=function(A){for(let _=0,b=m.length;_<b;_+=2){const w=m[_],E=m[_+1];if(w.global&&(w.lastIndex=0),w.test(A))return E}return null}}}const ER=new kS;class Ps{constructor(e){this.manager=e!==void 0?e:ER,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(a,l){i.load(e,a,t,l)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Ps.DEFAULT_MATERIAL_NAME="__DEFAULT";const Gs={};class xR extends Error{constructor(e,t){super(e),this.response=t}}class lr extends Ps{constructor(e){super(e)}load(e,t,i,a){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const l=kr.get(e);if(l!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(l),this.manager.itemEnd(e)},0),l;if(Gs[e]!==void 0){Gs[e].push({onLoad:t,onProgress:i,onError:a});return}Gs[e]=[],Gs[e].push({onLoad:t,onProgress:i,onError:a});const u=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),d=this.mimeType,p=this.responseType;fetch(u).then(m=>{if(m.status===200||m.status===0){if(m.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||m.body===void 0||m.body.getReader===void 0)return m;const A=Gs[e],_=m.body.getReader(),b=m.headers.get("X-File-Size")||m.headers.get("Content-Length"),w=b?parseInt(b):0,E=w!==0;let C=0;const T=new ReadableStream({start(x){P();function P(){_.read().then(({done:M,value:B})=>{if(M)x.close();else{C+=B.byteLength;const D=new ProgressEvent("progress",{lengthComputable:E,loaded:C,total:w});for(let G=0,U=A.length;G<U;G++){const V=A[G];V.onProgress&&V.onProgress(D)}x.enqueue(B),P()}},M=>{x.error(M)})}}});return new Response(T)}else throw new xR(`fetch for "${m.url}" responded with ${m.status}: ${m.statusText}`,m)}).then(m=>{switch(p){case"arraybuffer":return m.arrayBuffer();case"blob":return m.blob();case"document":return m.text().then(A=>new DOMParser().parseFromString(A,d));case"json":return m.json();default:if(d===void 0)return m.text();{const _=/charset="?([^;"\s]*)"?/i.exec(d),b=_&&_[1]?_[1].toLowerCase():void 0,w=new TextDecoder(b);return m.arrayBuffer().then(E=>w.decode(E))}}}).then(m=>{kr.add(e,m);const A=Gs[e];delete Gs[e];for(let _=0,b=A.length;_<b;_++){const w=A[_];w.onLoad&&w.onLoad(m)}}).catch(m=>{const A=Gs[e];if(A===void 0)throw this.manager.itemError(e),m;delete Gs[e];for(let _=0,b=A.length;_<b;_++){const w=A[_];w.onError&&w.onError(m)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class SR extends Ps{constructor(e){super(e)}load(e,t,i,a){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const l=this,u=kr.get(e);if(u!==void 0)return l.manager.itemStart(e),setTimeout(function(){t&&t(u),l.manager.itemEnd(e)},0),u;const d=xu("img");function p(){A(),kr.add(e,this),t&&t(this),l.manager.itemEnd(e)}function m(_){A(),a&&a(_),l.manager.itemError(e),l.manager.itemEnd(e)}function A(){d.removeEventListener("load",p,!1),d.removeEventListener("error",m,!1)}return d.addEventListener("load",p,!1),d.addEventListener("error",m,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(d.crossOrigin=this.crossOrigin),l.manager.itemStart(e),d.src=e,d}}class CR extends Ps{constructor(e){super(e)}load(e,t,i,a){const l=this,u=new Nu,d=new lr(this.manager);return d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setPath(this.path),d.setWithCredentials(l.withCredentials),d.load(e,function(p){let m;try{m=l.parse(p)}catch(A){if(a!==void 0)a(A);else{console.error(A);return}}m.image!==void 0?u.image=m.image:m.data!==void 0&&(u.image.width=m.width,u.image.height=m.height,u.image.data=m.data),u.wrapS=m.wrapS!==void 0?m.wrapS:ai,u.wrapT=m.wrapT!==void 0?m.wrapT:ai,u.magFilter=m.magFilter!==void 0?m.magFilter:wt,u.minFilter=m.minFilter!==void 0?m.minFilter:wt,u.anisotropy=m.anisotropy!==void 0?m.anisotropy:1,m.colorSpace!==void 0&&(u.colorSpace=m.colorSpace),m.flipY!==void 0&&(u.flipY=m.flipY),m.format!==void 0&&(u.format=m.format),m.type!==void 0&&(u.type=m.type),m.mipmaps!==void 0&&(u.mipmaps=m.mipmaps,u.minFilter=hn),m.mipmapCount===1&&(u.minFilter=wt),m.generateMipmaps!==void 0&&(u.generateMipmaps=m.generateMipmaps),u.needsUpdate=!0,t&&t(u,m)},i,a),u}}class H0 extends Ps{constructor(e){super(e)}load(e,t,i,a){const l=new Kt,u=new SR(this.manager);return u.setCrossOrigin(this.crossOrigin),u.setPath(this.path),u.load(e,function(d){l.image=d,l.needsUpdate=!0,t!==void 0&&t(l)},i,a),l}}class Nf extends Qt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ye(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const Pp=new tt,Ly=new se,Dy=new se;class V0{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ve(512,512),this.map=null,this.mapPass=null,this.matrix=new tt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new $0,this._frameExtents=new Ve(1,1),this._viewportCount=1,this._viewports=[new Rt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;Ly.setFromMatrixPosition(e.matrixWorld),t.position.copy(Ly),Dy.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Dy),t.updateMatrixWorld(),Pp.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Pp),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Pp)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class TR extends V0{constructor(){super(new _i(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=El*2*e.angle*this.focus,a=this.mapSize.width/this.mapSize.height,l=e.distance||t.far;(i!==t.fov||a!==t.aspect||l!==t.far)&&(t.fov=i,t.aspect=a,t.far=l,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class IR extends Nf{constructor(e,t,i=0,a=Math.PI/3,l=0,u=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Qt.DEFAULT_UP),this.updateMatrix(),this.target=new Qt,this.distance=i,this.angle=a,this.penumbra=l,this.decay=u,this.map=null,this.shadow=new TR}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Ny=new tt,pc=new se,Lp=new se;class MR extends V0{constructor(){super(new _i(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ve(4,2),this._viewportCount=6,this._viewports=[new Rt(2,1,1,1),new Rt(0,1,1,1),new Rt(3,1,1,1),new Rt(1,1,1,1),new Rt(3,0,1,1),new Rt(1,0,1,1)],this._cubeDirections=[new se(1,0,0),new se(-1,0,0),new se(0,0,1),new se(0,0,-1),new se(0,1,0),new se(0,-1,0)],this._cubeUps=[new se(0,1,0),new se(0,1,0),new se(0,1,0),new se(0,1,0),new se(0,0,1),new se(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,a=this.matrix,l=e.distance||i.far;l!==i.far&&(i.far=l,i.updateProjectionMatrix()),pc.setFromMatrixPosition(e.matrixWorld),i.position.copy(pc),Lp.copy(i.position),Lp.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Lp),i.updateMatrixWorld(),a.makeTranslation(-pc.x,-pc.y,-pc.z),Ny.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ny)}}class US extends Nf{constructor(e,t,i=0,a=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=a,this.shadow=new MR}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Kr extends MS{constructor(e=-1,t=1,i=1,a=-1,l=.1,u=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=a,this.near=l,this.far=u,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,a,l,u){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=a,this.view.width=l,this.view.height=u,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,a=(this.top+this.bottom)/2;let l=i-e,u=i+e,d=a+t,p=a-t;if(this.view!==null&&this.view.enabled){const m=(this.right-this.left)/this.view.fullWidth/this.zoom,A=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l+=m*this.view.offsetX,u=l+m*this.view.width,d-=A*this.view.offsetY,p=d-A*this.view.height}this.projectionMatrix.makeOrthographic(l,u,d,p,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class RR extends V0{constructor(){super(new Kr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class FS extends Nf{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Qt.DEFAULT_UP),this.updateMatrix(),this.target=new Qt,this.shadow=new RR}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class BR{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new se)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,a=e.y,l=e.z,u=this.coefficients;return t.copy(u[0]).multiplyScalar(.282095),t.addScaledVector(u[1],.488603*a),t.addScaledVector(u[2],.488603*l),t.addScaledVector(u[3],.488603*i),t.addScaledVector(u[4],1.092548*(i*a)),t.addScaledVector(u[5],1.092548*(a*l)),t.addScaledVector(u[6],.315392*(3*l*l-1)),t.addScaledVector(u[7],1.092548*(i*l)),t.addScaledVector(u[8],.546274*(i*i-a*a)),t}getIrradianceAt(e,t){const i=e.x,a=e.y,l=e.z,u=this.coefficients;return t.copy(u[0]).multiplyScalar(.886227),t.addScaledVector(u[1],2*.511664*a),t.addScaledVector(u[2],2*.511664*l),t.addScaledVector(u[3],2*.511664*i),t.addScaledVector(u[4],2*.429043*i*a),t.addScaledVector(u[5],2*.429043*a*l),t.addScaledVector(u[6],.743125*l*l-.247708),t.addScaledVector(u[7],2*.429043*i*l),t.addScaledVector(u[8],.429043*(i*i-a*a)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let a=0;a<9;a++)i[a].fromArray(e,t+a*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let a=0;a<9;a++)i[a].toArray(e,t+a*3);return e}static getBasisAt(e,t){const i=e.x,a=e.y,l=e.z;t[0]=.282095,t[1]=.488603*a,t[2]=.488603*l,t[3]=.488603*i,t[4]=1.092548*i*a,t[5]=1.092548*a*l,t[6]=.315392*(3*l*l-1),t[7]=1.092548*i*l,t[8]=.546274*(i*i-a*a)}}class PR extends Nf{constructor(e=new BR,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class cu{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,a=e.length;i<a;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class LR extends Ps{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,a){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const l=this,u=kr.get(e);if(u!==void 0){if(l.manager.itemStart(e),u.then){u.then(m=>{t&&t(m),l.manager.itemEnd(e)}).catch(m=>{a&&a(m)});return}return setTimeout(function(){t&&t(u),l.manager.itemEnd(e)},0),u}const d={};d.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",d.headers=this.requestHeader;const p=fetch(e,d).then(function(m){return m.blob()}).then(function(m){return createImageBitmap(m,Object.assign(l.options,{colorSpaceConversion:"none"}))}).then(function(m){return kr.add(e,m),t&&t(m),l.manager.itemEnd(e),m}).catch(function(m){a&&a(m),kr.remove(e),l.manager.itemError(e),l.manager.itemEnd(e)});kr.add(e,p),l.manager.itemStart(e)}}class DR extends _i{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class $S{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Oy(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Oy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Oy(){return performance.now()}class NR{constructor(e,t,i){this.binding=e,this.valueSize=i;let a,l,u;switch(t){case"quaternion":a=this._slerp,l=this._slerpAdditive,u=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":a=this._select,l=this._select,u=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:a=this._lerp,l=this._lerpAdditive,u=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=a,this._mixBufferRegionAdditive=l,this._setIdentity=u,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,a=this.valueSize,l=e*a+a;let u=this.cumulativeWeight;if(u===0){for(let d=0;d!==a;++d)i[l+d]=i[d];u=t}else{u+=t;const d=t/u;this._mixBufferRegion(i,l,0,d,a)}this.cumulativeWeight=u}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,a=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,a,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,a=e*t+t,l=this.cumulativeWeight,u=this.cumulativeWeightAdditive,d=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,l<1){const p=t*this._origIndex;this._mixBufferRegion(i,a,p,1-l,t)}u>0&&this._mixBufferRegionAdditive(i,a,this._addIndex*t,1,t);for(let p=t,m=t+t;p!==m;++p)if(i[p]!==i[p+t]){d.setValue(i,a);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,a=i*this._origIndex;e.getValue(t,a);for(let l=i,u=a;l!==u;++l)t[l]=t[a+l%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,a,l){if(a>=.5)for(let u=0;u!==l;++u)e[t+u]=e[i+u]}_slerp(e,t,i,a){Yi.slerpFlat(e,t,e,t,e,i,a)}_slerpAdditive(e,t,i,a,l){const u=this._workIndex*l;Yi.multiplyQuaternionsFlat(e,u,e,t,e,i),Yi.slerpFlat(e,t,e,t,e,u,a)}_lerp(e,t,i,a,l){const u=1-a;for(let d=0;d!==l;++d){const p=t+d;e[p]=e[p]*u+e[i+d]*a}}_lerpAdditive(e,t,i,a,l){for(let u=0;u!==l;++u){const d=t+u;e[d]=e[d]+e[i+u]*a}}}const Q0="\\[\\]\\.:\\/",OR=new RegExp("["+Q0+"]","g"),j0="[^"+Q0+"]",kR="[^"+Q0.replace("\\.","")+"]",UR=/((?:WC+[\/:])*)/.source.replace("WC",j0),FR=/(WCOD+)?/.source.replace("WCOD",kR),$R=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",j0),zR=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",j0),GR=new RegExp("^"+UR+FR+$R+zR+"$"),HR=["material","materials","bones","map"];class VR{constructor(e,t,i){const a=i||xt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,a)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,a=this._bindings[i];a!==void 0&&a.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let a=this._targetGroup.nCachedObjects_,l=i.length;a!==l;++a)i[a].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class xt{constructor(e,t,i){this.path=t,this.parsedPath=i||xt.parseTrackName(t),this.node=xt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new xt.Composite(e,t,i):new xt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(OR,"")}static parseTrackName(e){const t=GR.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},a=i.nodeName&&i.nodeName.lastIndexOf(".");if(a!==void 0&&a!==-1){const l=i.nodeName.substring(a+1);HR.indexOf(l)!==-1&&(i.nodeName=i.nodeName.substring(0,a),i.objectName=l)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(l){for(let u=0;u<l.length;u++){const d=l[u];if(d.name===t||d.uuid===t)return d;const p=i(d.children);if(p)return p}return null},a=i(e.children);if(a)return a}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let a=0,l=i.length;a!==l;++a)e[t++]=i[a]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let a=0,l=i.length;a!==l;++a)i[a]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let a=0,l=i.length;a!==l;++a)i[a]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let a=0,l=i.length;a!==l;++a)i[a]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,a=t.propertyName;let l=t.propertyIndex;if(e||(e=xt.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let m=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let A=0;A<e.length;A++)if(e[A].name===m){m=A;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(m!==void 0){if(e[m]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[m]}}const u=e[a];if(u===void 0){const m=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+m+"."+a+" but it wasn't found.",e);return}let d=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?d=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(d=this.Versioning.MatrixWorldNeedsUpdate);let p=this.BindingType.Direct;if(l!==void 0){if(a==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[l]!==void 0&&(l=e.morphTargetDictionary[l])}p=this.BindingType.ArrayElement,this.resolvedProperty=u,this.propertyIndex=l}else u.fromArray!==void 0&&u.toArray!==void 0?(p=this.BindingType.HasFromToArray,this.resolvedProperty=u):Array.isArray(u)?(p=this.BindingType.EntireArray,this.resolvedProperty=u):this.propertyName=a;this.getValue=this.GetterByBindingType[p],this.setValue=this.SetterByBindingTypeAndVersioning[p][d]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}xt.Composite=VR;xt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};xt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};xt.prototype.GetterByBindingType=[xt.prototype._getValue_direct,xt.prototype._getValue_array,xt.prototype._getValue_arrayElement,xt.prototype._getValue_toArray];xt.prototype.SetterByBindingTypeAndVersioning=[[xt.prototype._setValue_direct,xt.prototype._setValue_direct_setNeedsUpdate,xt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[xt.prototype._setValue_array,xt.prototype._setValue_array_setNeedsUpdate,xt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[xt.prototype._setValue_arrayElement,xt.prototype._setValue_arrayElement_setNeedsUpdate,xt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[xt.prototype._setValue_fromArray,xt.prototype._setValue_fromArray_setNeedsUpdate,xt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class QR{constructor(e,t,i=null,a=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=a;const l=t.tracks,u=l.length,d=new Array(u),p={endingStart:qo,endingEnd:qo};for(let m=0;m!==u;++m){const A=l[m].createInterpolant(null);d[m]=A,A.settings=p}this._interpolantSettings=p,this._interpolants=d,this._propertyBindings=new Array(u),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ka,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const a=this._clip.duration,l=e._clip.duration,u=l/a,d=a/l;e.warp(1,u,t),this.warp(d,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const a=this._mixer,l=a.time,u=this.timeScale;let d=this._timeScaleInterpolant;d===null&&(d=a._lendControlInterpolant(),this._timeScaleInterpolant=d);const p=d.parameterPositions,m=d.sampleValues;return p[0]=l,p[1]=l+i,m[0]=e/u,m[1]=t/u,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,a){if(!this.enabled){this._updateWeight(e);return}const l=this._startTime;if(l!==null){const p=(e-l)*i;p<0||i===0?t=0:(this._startTime=null,t=i*p)}t*=this._updateTimeScale(e);const u=this._updateTime(t),d=this._updateWeight(e);if(d>0){const p=this._interpolants,m=this._propertyBindings;switch(this.blendMode){case iM:for(let A=0,_=p.length;A!==_;++A)p[A].evaluate(u),m[A].accumulateAdditive(d);break;case L0:default:for(let A=0,_=p.length;A!==_;++A)p[A].evaluate(u),m[A].accumulate(a,d)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const a=i.evaluate(e)[0];t*=a,e>i.parameterPositions[1]&&(this.stopFading(),a===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const a=i.evaluate(e)[0];t*=a,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let a=this.time+e,l=this._loopCount;const u=i===Yd;if(e===0)return l===-1?a:u&&(l&1)===1?t-a:a;if(i===bl){l===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(a>=t)a=t;else if(a<0)a=0;else{this.time=a;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(l===-1&&(e>=0?(l=0,this._setEndings(!0,this.repetitions===0,u)):this._setEndings(this.repetitions===0,!0,u)),a>=t||a<0){const d=Math.floor(a/t);a-=t*d,l+=Math.abs(d);const p=this.repetitions-l;if(p<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,a=e>0?t:0,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(p===1){const m=e<0;this._setEndings(m,!m,u)}else this._setEndings(!1,!1,u);this._loopCount=l,this.time=a,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d})}}else this.time=a;if(u&&(l&1)===1)return t-a}return a}_setEndings(e,t,i){const a=this._interpolantSettings;i?(a.endingStart=Wo,a.endingEnd=Wo):(e?a.endingStart=this.zeroSlopeAtStart?Wo:qo:a.endingStart=Xd,t?a.endingEnd=this.zeroSlopeAtEnd?Wo:qo:a.endingEnd=Xd)}_scheduleFading(e,t,i){const a=this._mixer,l=a.time;let u=this._weightInterpolant;u===null&&(u=a._lendControlInterpolant(),this._weightInterpolant=u);const d=u.parameterPositions,p=u.sampleValues;return d[0]=l,p[0]=t,d[1]=l+e,p[1]=i,this}}const jR=new Float32Array(1);class zS extends fs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,a=e._clip.tracks,l=a.length,u=e._propertyBindings,d=e._interpolants,p=i.uuid,m=this._bindingsByRootAndName;let A=m[p];A===void 0&&(A={},m[p]=A);for(let _=0;_!==l;++_){const b=a[_],w=b.name;let E=A[w];if(E!==void 0)++E.referenceCount,u[_]=E;else{if(E=u[_],E!==void 0){E._cacheIndex===null&&(++E.referenceCount,this._addInactiveBinding(E,p,w));continue}const C=t&&t._propertyBindings[_].binding.parsedPath;E=new NR(xt.create(i,w,C),b.ValueTypeName,b.getValueSize()),++E.referenceCount,this._addInactiveBinding(E,p,w),u[_]=E}d[_].resultBuffer=E.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,a=e._clip.uuid,l=this._actionsByClip[a];this._bindAction(e,l&&l.knownActions[0]),this._addInactiveAction(e,a,i)}const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const l=t[i];l.useCount++===0&&(this._lendBinding(l),l.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const l=t[i];--l.useCount===0&&(l.restoreOriginalState(),this._takeBackBinding(l))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const a=this._actions,l=this._actionsByClip;let u=l[t];if(u===void 0)u={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,l[t]=u;else{const d=u.knownActions;e._byClipCacheIndex=d.length,d.push(e)}e._cacheIndex=a.length,a.push(e),u.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],a=e._cacheIndex;i._cacheIndex=a,t[a]=i,t.pop(),e._cacheIndex=null;const l=e._clip.uuid,u=this._actionsByClip,d=u[l],p=d.knownActions,m=p[p.length-1],A=e._byClipCacheIndex;m._byClipCacheIndex=A,p[A]=m,p.pop(),e._byClipCacheIndex=null;const _=d.actionByRoot,b=(e._localRoot||this._root).uuid;delete _[b],p.length===0&&delete u[l],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const l=t[i];--l.referenceCount===0&&this._removeInactiveBinding(l)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,a=this._nActiveActions++,l=t[a];e._cacheIndex=a,t[a]=e,l._cacheIndex=i,t[i]=l}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,a=--this._nActiveActions,l=t[a];e._cacheIndex=a,t[a]=e,l._cacheIndex=i,t[i]=l}_addInactiveBinding(e,t,i){const a=this._bindingsByRootAndName,l=this._bindings;let u=a[t];u===void 0&&(u={},a[t]=u),u[i]=e,e._cacheIndex=l.length,l.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,a=i.rootNode.uuid,l=i.path,u=this._bindingsByRootAndName,d=u[a],p=t[t.length-1],m=e._cacheIndex;p._cacheIndex=m,t[m]=p,t.pop(),delete d[l],Object.keys(d).length===0&&delete u[a]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,a=this._nActiveBindings++,l=t[a];e._cacheIndex=a,t[a]=e,l._cacheIndex=i,t[i]=l}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,a=--this._nActiveBindings,l=t[a];e._cacheIndex=a,t[a]=e,l._cacheIndex=i,t[i]=l}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new NS(new Float32Array(2),new Float32Array(2),1,jR),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,a=--this._nActiveControlInterpolants,l=t[a];e.__cacheIndex=a,t[a]=e,l.__cacheIndex=i,t[i]=l}clipAction(e,t,i){const a=t||this._root,l=a.uuid;let u=typeof e=="string"?EA.findByName(a,e):e;const d=u!==null?u.uuid:e,p=this._actionsByClip[d];let m=null;if(i===void 0&&(u!==null?i=u.blendMode:i=L0),p!==void 0){const _=p.actionByRoot[l];if(_!==void 0&&_.blendMode===i)return _;m=p.knownActions[0],u===null&&(u=m._clip)}if(u===null)return null;const A=new QR(this,u,t,i);return this._bindAction(A,m),this._addInactiveAction(A,d,l),A}existingAction(e,t){const i=t||this._root,a=i.uuid,l=typeof e=="string"?EA.findByName(i,e):e,u=l?l.uuid:e,d=this._actionsByClip[u];return d!==void 0&&d.actionByRoot[a]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,a=this.time+=e,l=Math.sign(e),u=this._accuIndex^=1;for(let m=0;m!==i;++m)t[m]._update(a,e,l,u);const d=this._bindings,p=this._nActiveBindings;for(let m=0;m!==p;++m)d[m].apply(u);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,a=this._actionsByClip,l=a[i];if(l!==void 0){const u=l.knownActions;for(let d=0,p=u.length;d!==p;++d){const m=u[d];this._deactivateAction(m);const A=m._cacheIndex,_=t[t.length-1];m._cacheIndex=null,m._byClipCacheIndex=null,_._cacheIndex=A,t[A]=_,t.pop(),this._removeInactiveBindingsForAction(m)}delete a[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const u in i){const d=i[u].actionByRoot,p=d[t];p!==void 0&&(this._deactivateAction(p),this._removeInactiveAction(p))}const a=this._bindingsByRootAndName,l=a[t];if(l!==void 0)for(const u in l){const d=l[u];d.restoreOriginalState(),this._removeInactiveBinding(d)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}const ky=new tt;class q0{constructor(e,t,i=0,a=1/0){this.ray=new Du(e,t),this.near=i,this.far=a,this.camera=null,this.layers=new O0,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return ky.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(ky),this}intersectObject(e,t=!0,i=[]){return xA(e,this,i,t),i.sort(Uy),i}intersectObjects(e,t=!0,i=[]){for(let a=0,l=e.length;a<l;a++)xA(e[a],this,i,t);return i.sort(Uy),i}}function Uy(o,e){return o.distance-e.distance}function xA(o,e,t,i){let a=!0;if(o.layers.test(e.layers)&&o.raycast(e,t)===!1&&(a=!1),a===!0&&i===!0){const l=o.children;for(let u=0,d=l.length;u<d;u++)xA(l[u],e,t,!0)}}class ol{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=ft(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(ft(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class qR extends z0{constructor(e=10,t=10,i=4473924,a=8947848){i=new Ye(i),a=new Ye(a);const l=t/2,u=e/t,d=e/2,p=[],m=[];for(let b=0,w=0,E=-d;b<=t;b++,E+=u){p.push(-d,0,E,d,0,E),p.push(E,0,-d,E,0,d);const C=b===l?i:a;C.toArray(m,w),w+=3,C.toArray(m,w),w+=3,C.toArray(m,w),w+=3,C.toArray(m,w),w+=3}const A=new Di;A.setAttribute("position",new $i(p,3)),A.setAttribute("color",new $i(m,3));const _=new Ou({vertexColors:!0,toneMapped:!1});super(A,_),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Ch=new yi;class WR extends z0{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),a=new Float32Array(24),l=new Di;l.setIndex(new Vt(i,1)),l.setAttribute("position",new Vt(a,3)),super(l,new Ou({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Ch.setFromObject(this.object),Ch.isEmpty())return;const t=Ch.min,i=Ch.max,a=this.geometry.attributes.position,l=a.array;l[0]=i.x,l[1]=i.y,l[2]=i.z,l[3]=t.x,l[4]=i.y,l[5]=i.z,l[6]=t.x,l[7]=t.y,l[8]=i.z,l[9]=i.x,l[10]=t.y,l[11]=i.z,l[12]=i.x,l[13]=i.y,l[14]=t.z,l[15]=t.x,l[16]=i.y,l[17]=t.z,l[18]=t.x,l[19]=t.y,l[20]=t.z,l[21]=i.x,l[22]=t.y,l[23]=t.z,a.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function Fy(o,e,t,i){const a=YR(i);switch(t){case fS:return o*e;case mS:return o*e;case gS:return o*e*2;case Or:return o*e/a.components*a.byteLength;case R0:return o*e/a.components*a.byteLength;case La:return o*e*2/a.components*a.byteLength;case B0:return o*e*2/a.components*a.byteLength;case pS:return o*e*3/a.components*a.byteLength;case Xt:return o*e*4/a.components*a.byteLength;case P0:return o*e*4/a.components*a.byteLength;case bd:case su:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*8;case vd:case ru:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case eA:case tA:return Math.max(o,16)*Math.max(e,8)/4;case Hd:case Vd:return Math.max(o,8)*Math.max(e,8)/2;case Qd:case jd:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*8;case qd:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case wu:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case iA:return Math.floor((o+4)/5)*Math.floor((e+3)/4)*16;case nA:return Math.floor((o+4)/5)*Math.floor((e+4)/5)*16;case sA:return Math.floor((o+5)/6)*Math.floor((e+4)/5)*16;case Eu:return Math.floor((o+5)/6)*Math.floor((e+5)/6)*16;case rA:return Math.floor((o+7)/8)*Math.floor((e+4)/5)*16;case aA:return Math.floor((o+7)/8)*Math.floor((e+5)/6)*16;case oA:return Math.floor((o+7)/8)*Math.floor((e+7)/8)*16;case lA:return Math.floor((o+9)/10)*Math.floor((e+4)/5)*16;case cA:return Math.floor((o+9)/10)*Math.floor((e+5)/6)*16;case uA:return Math.floor((o+9)/10)*Math.floor((e+7)/8)*16;case hA:return Math.floor((o+9)/10)*Math.floor((e+9)/10)*16;case dA:return Math.floor((o+11)/12)*Math.floor((e+9)/10)*16;case fA:return Math.floor((o+11)/12)*Math.floor((e+11)/12)*16;case au:case pA:case Wd:return Math.ceil(o/4)*Math.ceil(e/4)*16;case AS:case mA:return Math.ceil(o/4)*Math.ceil(e/4)*8;case gA:case AA:return Math.ceil(o/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function YR(o){switch(o){case ui:case C0:return{byteLength:1,components:1};case vu:case T0:case hi:return{byteLength:2,components:1};case I0:case M0:return{byteLength:2,components:4};case qr:case Lf:case oi:return{byteLength:4,components:1};case dS:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${o}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Bf}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Bf);/**
|
|
117
|
+
`},a=new Wn(5,5,5),l=new zi({name:"CubemapFromEquirect",uniforms:Sl(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Fi,blending:cs});l.uniforms.tEquirect.value=t;const u=new lt(a,l),d=t.minFilter;return t.minFilter===hn&&(t.minFilter=Et),new bA(1,10,this).update(e,u),t.minFilter=d,u.geometry.dispose(),u.material.dispose(),this}clear(e,t,i,a){const l=e.getRenderTarget();for(let u=0;u<6;u++)e.setRenderTarget(this,u),e.clear(t,i,a);e.setRenderTarget(l)}}let Wr=class extends Qt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new qn,this.environmentIntensity=1,this.environmentRotation=new qn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}};class tR{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=yA,this.updateRanges=[],this.version=0,this.uuid=us()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let a=0,l=this.stride;a<l;a++)this.array[e+a]=t.array[i+a];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=us()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=us()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const tn=new se;class U0{constructor(e,t,i,a=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=a}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)tn.fromBufferAttribute(this,t),tn.applyMatrix4(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)tn.fromBufferAttribute(this,t),tn.applyNormalMatrix(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)tn.fromBufferAttribute(this,t),tn.transformDirection(e),this.setXYZ(t,tn.x,tn.y,tn.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=as(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ut(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=as(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=as(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=as(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=as(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,a){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array),a=Ut(a,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=a,this}setXYZW(e,t,i,a,l){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),i=Ut(i,this.array),a=Ut(a,this.array),l=Ut(l,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=a,this.data.array[e+3]=l,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const a=i*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)t.push(this.data.array[a+l])}return new Vt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new U0(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const a=i*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)t.push(this.data.array[a+l])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const _y=new se,yy=new Rt,by=new Rt,iR=new se,vy=new tt,_h=new se,Tp=new bn,wy=new tt,Ip=new Du;class nR extends lt{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=X_,this.bindMatrix=new tt,this.bindMatrixInverse=new tt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new yi),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,_h),this.boundingBox.expandByPoint(_h)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new bn),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,_h),this.boundingSphere.expandByPoint(_h)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const i=this.material,a=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Tp.copy(this.boundingSphere),Tp.applyMatrix4(a),e.ray.intersectsSphere(Tp)!==!1&&(wy.copy(a).invert(),Ip.copy(e.ray).applyMatrix4(wy),!(this.boundingBox!==null&&Ip.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Ip)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Rt,t=this.geometry.attributes.skinWeight;for(let i=0,a=t.count;i<a;i++){e.fromBufferAttribute(t,i);const l=1/e.manhattanLength();l!==1/0?e.multiplyScalar(l):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===X_?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===tM?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const i=this.skeleton,a=this.geometry;yy.fromBufferAttribute(a.attributes.skinIndex,e),by.fromBufferAttribute(a.attributes.skinWeight,e),_y.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let l=0;l<4;l++){const u=by.getComponent(l);if(u!==0){const d=yy.getComponent(l);vy.multiplyMatrices(i.bones[d].matrixWorld,i.boneInverses[d]),t.addScaledVector(iR.copy(_y).applyMatrix4(vy),u)}}return t.applyMatrix4(this.bindMatrixInverse)}}class BS extends Qt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Nu extends Kt{constructor(e=null,t=1,i=1,a,l,u,d,p,m=gi,A=gi,_,b){super(null,u,d,p,m,A,a,l,_,b),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ey=new tt,sR=new tt;class F0{constructor(e=[],t=[]){this.uuid=us(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,a=this.bones.length;i<a;i++)this.boneInverses.push(new tt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new tt;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,a=this.boneTexture;for(let l=0,u=e.length;l<u;l++){const d=e[l]?e[l].matrixWorld:sR;Ey.multiplyMatrices(d,t[l]),Ey.toArray(i,l*16)}a!==null&&(a.needsUpdate=!0)}clone(){return new F0(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Nu(t,e,e,Xt,oi);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const a=this.bones[t];if(a.name===e)return a}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,a=e.bones.length;i<a;i++){const l=e.bones[i];let u=t[l];u===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",l),u=new BS),this.bones.push(u),this.boneInverses.push(new tt().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let a=0,l=t.length;a<l;a++){const u=t[a];e.bones.push(u.uuid);const d=i[a];e.boneInverses.push(d.toArray())}return e}}class vA extends Vt{constructor(e,t,i,a=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=a}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const yo=new tt,xy=new tt,yh=[],Sy=new yi,rR=new tt,hc=new lt,dc=new bn;class aR extends lt{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new vA(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let a=0;a<i;a++)this.setMatrixAt(a,rR)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new yi),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,yo),Sy.copy(e.boundingBox).applyMatrix4(yo),this.boundingBox.union(Sy)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new bn),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,yo),dc.copy(e.boundingSphere).applyMatrix4(yo),this.boundingSphere.union(dc)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const i=t.morphTargetInfluences,a=this.morphTexture.source.data.data,l=i.length+1,u=e*l+1;for(let d=0;d<i.length;d++)i[d]=a[u+d]}raycast(e,t){const i=this.matrixWorld,a=this.count;if(hc.geometry=this.geometry,hc.material=this.material,hc.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),dc.copy(this.boundingSphere),dc.applyMatrix4(i),e.ray.intersectsSphere(dc)!==!1))for(let l=0;l<a;l++){this.getMatrixAt(l,yo),xy.multiplyMatrices(i,yo),hc.matrixWorld=xy,hc.raycast(e,yh);for(let u=0,d=yh.length;u<d;u++){const p=yh[u];p.instanceId=l,p.object=this,t.push(p)}yh.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new vA(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const i=t.morphTargetInfluences,a=i.length+1;this.morphTexture===null&&(this.morphTexture=new Nu(new Float32Array(a*this.count),a,this.count,Or,oi));const l=this.morphTexture.source.data.data;let u=0;for(let m=0;m<i.length;m++)u+=i[m];const d=this.geometry.morphTargetsRelative?1:1-u,p=a*e;l[p]=d,l.set(i,p+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}const Mp=new se,oR=new se,lR=new ot;class _a{constructor(e=new se(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,a){return this.normal.set(e,t,i),this.constant=a,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const a=Mp.subVectors(i,t).cross(oR.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(a,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Mp),a=this.normal.dot(i);if(a===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const l=-(e.start.dot(this.normal)+this.constant)/a;return l<0||l>1?null:t.copy(e.start).addScaledVector(i,l)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||lR.getNormalMatrix(e),a=this.coplanarPoint(Mp).applyMatrix4(e),l=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(l),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const oa=new bn,bh=new se;class $0{constructor(e=new _a,t=new _a,i=new _a,a=new _a,l=new _a,u=new _a){this.planes=[e,t,i,a,l,u]}set(e,t,i,a,l,u){const d=this.planes;return d[0].copy(e),d[1].copy(t),d[2].copy(i),d[3].copy(a),d[4].copy(l),d[5].copy(u),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=sr){const i=this.planes,a=e.elements,l=a[0],u=a[1],d=a[2],p=a[3],m=a[4],A=a[5],_=a[6],b=a[7],w=a[8],E=a[9],C=a[10],T=a[11],x=a[12],P=a[13],M=a[14],B=a[15];if(i[0].setComponents(p-l,b-m,T-w,B-x).normalize(),i[1].setComponents(p+l,b+m,T+w,B+x).normalize(),i[2].setComponents(p+u,b+A,T+E,B+P).normalize(),i[3].setComponents(p-u,b-A,T-E,B-P).normalize(),i[4].setComponents(p-d,b-_,T-C,B-M).normalize(),t===sr)i[5].setComponents(p+d,b+_,T+C,B+M).normalize();else if(t===Jd)i[5].setComponents(d,_,C,M).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),oa.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),oa.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(oa)}intersectsSprite(e){return oa.center.set(0,0,0),oa.radius=.7071067811865476,oa.applyMatrix4(e.matrixWorld),this.intersectsSphere(oa)}intersectsSphere(e){const t=this.planes,i=e.center,a=-e.radius;for(let l=0;l<6;l++)if(t[l].distanceToPoint(i)<a)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const a=t[i];if(bh.x=a.normal.x>0?e.max.x:e.min.x,bh.y=a.normal.y>0?e.max.y:e.min.y,bh.z=a.normal.z>0?e.max.z:e.min.z,a.distanceToPoint(bh)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Ou extends jn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ye(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Zd=new se,ef=new se,Cy=new tt,fc=new Du,vh=new bn,Rp=new se,Ty=new se;class Cl extends Qt{constructor(e=new Di,t=new Ou){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let a=1,l=t.count;a<l;a++)Zd.fromBufferAttribute(t,a-1),ef.fromBufferAttribute(t,a),i[a]=i[a-1],i[a]+=Zd.distanceTo(ef);e.setAttribute("lineDistance",new $i(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,a=this.matrixWorld,l=e.params.Line.threshold,u=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),vh.copy(i.boundingSphere),vh.applyMatrix4(a),vh.radius+=l,e.ray.intersectsSphere(vh)===!1)return;Cy.copy(a).invert(),fc.copy(e.ray).applyMatrix4(Cy);const d=l/((this.scale.x+this.scale.y+this.scale.z)/3),p=d*d,m=this.isLineSegments?2:1,A=i.index,b=i.attributes.position;if(A!==null){const w=Math.max(0,u.start),E=Math.min(A.count,u.start+u.count);for(let C=w,T=E-1;C<T;C+=m){const x=A.getX(C),P=A.getX(C+1),M=wh(this,e,fc,p,x,P);M&&t.push(M)}if(this.isLineLoop){const C=A.getX(E-1),T=A.getX(w),x=wh(this,e,fc,p,C,T);x&&t.push(x)}}else{const w=Math.max(0,u.start),E=Math.min(b.count,u.start+u.count);for(let C=w,T=E-1;C<T;C+=m){const x=wh(this,e,fc,p,C,C+1);x&&t.push(x)}if(this.isLineLoop){const C=wh(this,e,fc,p,E-1,w);C&&t.push(C)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let l=0,u=a.length;l<u;l++){const d=a[l].name||String(l);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=l}}}}}function wh(o,e,t,i,a,l){const u=o.geometry.attributes.position;if(Zd.fromBufferAttribute(u,a),ef.fromBufferAttribute(u,l),t.distanceSqToSegment(Zd,ef,Rp,Ty)>i)return;Rp.applyMatrix4(o.matrixWorld);const p=e.ray.origin.distanceTo(Rp);if(!(p<e.near||p>e.far))return{distance:p,point:Ty.clone().applyMatrix4(o.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:o}}const Iy=new se,My=new se;class z0 extends Cl{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let a=0,l=t.count;a<l;a+=2)Iy.fromBufferAttribute(t,a),My.fromBufferAttribute(t,a+1),i[a]=a===0?0:i[a-1],i[a+1]=i[a]+Iy.distanceTo(My);e.setAttribute("lineDistance",new $i(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class cR extends Cl{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class PS extends jn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ye(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Ry=new tt,wA=new Du,Eh=new bn,xh=new se;class uR extends Qt{constructor(e=new Di,t=new PS){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,a=this.matrixWorld,l=e.params.Points.threshold,u=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Eh.copy(i.boundingSphere),Eh.applyMatrix4(a),Eh.radius+=l,e.ray.intersectsSphere(Eh)===!1)return;Ry.copy(a).invert(),wA.copy(e.ray).applyMatrix4(Ry);const d=l/((this.scale.x+this.scale.y+this.scale.z)/3),p=d*d,m=i.index,_=i.attributes.position;if(m!==null){const b=Math.max(0,u.start),w=Math.min(m.count,u.start+u.count);for(let E=b,C=w;E<C;E++){const T=m.getX(E);xh.fromBufferAttribute(_,T),By(xh,T,p,a,e,t,this)}}else{const b=Math.max(0,u.start),w=Math.min(_.count,u.start+u.count);for(let E=b,C=w;E<C;E++)xh.fromBufferAttribute(_,E),By(xh,E,p,a,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const a=t[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let l=0,u=a.length;l<u;l++){const d=a[l].name||String(l);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=l}}}}}function By(o,e,t,i,a,l,u){const d=wA.distanceSqToPoint(o);if(d<t){const p=new se;wA.closestPointToPoint(o,p),p.applyMatrix4(i);const m=a.ray.origin.distanceTo(p);if(m<a.near||m>a.far)return;l.push({distance:m,distanceToRay:Math.sqrt(d),point:p,index:e,face:null,faceIndex:null,barycoord:null,object:u})}}let mi=class extends Qt{constructor(){super(),this.isGroup=!0,this.type="Group"}};class hR extends Kt{constructor(e,t,i,a,l,u,d,p,m){super(e,t,i,a,l,u,d,p,m),this.isVideoTexture=!0,this.minFilter=u!==void 0?u:Et,this.magFilter=l!==void 0?l:Et,this.generateMipmaps=!1;const A=this;function _(){A.needsUpdate=!0,e.requestVideoFrameCallback(_)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(_)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Ua extends Kt{constructor(e,t,i,a,l,u,d,p,m,A,_,b){super(null,u,d,p,m,A,a,l,_,b),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class dR extends Ua{constructor(e,t,i,a,l,u){super(e,t,i,l,u),this.isCompressedArrayTexture=!0,this.image.depth=a,this.wrapR=ai,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class fR extends Ua{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,ja),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class pR extends Kt{constructor(e,t,i,a,l,u,d,p,m){super(e,t,i,a,l,u,d,p,m),this.isCanvasTexture=!0,this.needsUpdate=!0}}class LS extends Kt{constructor(e,t,i,a,l,u,d,p,m,A=rl){if(A!==rl&&A!==yl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&A===rl&&(i=qr),i===void 0&&A===yl&&(i=_l),super(null,a,l,u,d,p,A,i,m),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=d!==void 0?d:gi,this.minFilter=p!==void 0?p:gi,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Ms extends Di{constructor(e=1,t=1,i=1,a=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:a};const l=e/2,u=t/2,d=Math.floor(i),p=Math.floor(a),m=d+1,A=p+1,_=e/d,b=t/p,w=[],E=[],C=[],T=[];for(let x=0;x<A;x++){const P=x*b-u;for(let M=0;M<m;M++){const B=M*_-l;E.push(B,-P,0),C.push(0,0,1),T.push(M/d),T.push(1-x/p)}}for(let x=0;x<p;x++)for(let P=0;P<d;P++){const M=P+m*x,B=P+m*(x+1),D=P+1+m*(x+1),G=P+1+m*x;w.push(M,B,G),w.push(B,D,G)}this.setIndex(w),this.setAttribute("position",new $i(E,3)),this.setAttribute("normal",new $i(C,3)),this.setAttribute("uv",new $i(T,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ms(e.width,e.height,e.widthSegments,e.heightSegments)}}class Df extends Di{constructor(e=1,t=32,i=16,a=0,l=Math.PI*2,u=0,d=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:a,phiLength:l,thetaStart:u,thetaLength:d},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const p=Math.min(u+d,Math.PI);let m=0;const A=[],_=new se,b=new se,w=[],E=[],C=[],T=[];for(let x=0;x<=i;x++){const P=[],M=x/i;let B=0;x===0&&u===0?B=.5/t:x===i&&p===Math.PI&&(B=-.5/t);for(let D=0;D<=t;D++){const G=D/t;_.x=-e*Math.cos(a+G*l)*Math.sin(u+M*d),_.y=e*Math.cos(u+M*d),_.z=e*Math.sin(a+G*l)*Math.sin(u+M*d),E.push(_.x,_.y,_.z),b.copy(_).normalize(),C.push(b.x,b.y,b.z),T.push(G+B,1-M),P.push(m++)}A.push(P)}for(let x=0;x<i;x++)for(let P=0;P<t;P++){const M=A[x][P+1],B=A[x][P],D=A[x+1][P],G=A[x+1][P+1];(x!==0||u>0)&&w.push(M,B,G),(x!==i-1||p<Math.PI)&&w.push(B,D,G)}this.setIndex(w),this.setAttribute("position",new $i(E,3)),this.setAttribute("normal",new $i(C,3)),this.setAttribute("uv",new $i(T,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Df(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Su extends jn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ye(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ye(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yS,this.normalScale=new Ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new qn,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Rs extends Su{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ve(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ft(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ye(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ye(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ye(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class G0 extends jn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=sM,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class mR extends jn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class Bp extends Ou{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Sh(o,e,t){return!o||!t&&o.constructor===e?o:typeof e.BYTES_PER_ELEMENT=="number"?new e(o):Array.prototype.slice.call(o)}function gR(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function AR(o){function e(a,l){return o[a]-o[l]}const t=o.length,i=new Array(t);for(let a=0;a!==t;++a)i[a]=a;return i.sort(e),i}function Py(o,e,t){const i=o.length,a=new o.constructor(i);for(let l=0,u=0;u!==i;++l){const d=t[l]*e;for(let p=0;p!==e;++p)a[u++]=o[d+p]}return a}function DS(o,e,t,i){let a=1,l=o[0];for(;l!==void 0&&l[i]===void 0;)l=o[a++];if(l===void 0)return;let u=l[i];if(u!==void 0)if(Array.isArray(u))do u=l[i],u!==void 0&&(e.push(l.time),t.push.apply(t,u)),l=o[a++];while(l!==void 0);else if(u.toArray!==void 0)do u=l[i],u!==void 0&&(e.push(l.time),u.toArray(t,t.length)),l=o[a++];while(l!==void 0);else do u=l[i],u!==void 0&&(e.push(l.time),t.push(u)),l=o[a++];while(l!==void 0)}class ku{constructor(e,t,i,a){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=a!==void 0?a:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,a=t[i],l=t[i-1];e:{t:{let u;i:{n:if(!(e<a)){for(let d=i+2;;){if(a===void 0){if(e<l)break n;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===d)break;if(l=a,a=t[++i],e<a)break t}u=t.length;break i}if(!(e>=l)){const d=t[1];e<d&&(i=2,l=d);for(let p=i-2;;){if(l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===p)break;if(a=l,l=t[--i-1],e>=l)break t}u=i,i=0;break i}break e}for(;i<u;){const d=i+u>>>1;e<t[d]?u=d:i=d+1}if(a=t[i],l=t[i-1],l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(a===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,l,a)}return this.interpolate_(i,l,e,a)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,a=this.valueSize,l=e*a;for(let u=0;u!==a;++u)t[u]=i[l+u];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class _R extends ku{constructor(e,t,i,a){super(e,t,i,a),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:qo,endingEnd:qo}}intervalChanged_(e,t,i){const a=this.parameterPositions;let l=e-2,u=e+1,d=a[l],p=a[u];if(d===void 0)switch(this.getSettings_().endingStart){case Wo:l=e,d=2*t-i;break;case Xd:l=a.length-2,d=t+a[l]-a[l+1];break;default:l=e,d=i}if(p===void 0)switch(this.getSettings_().endingEnd){case Wo:u=e,p=2*i-t;break;case Xd:u=1,p=i+a[1]-a[0];break;default:u=e-1,p=t}const m=(i-t)*.5,A=this.valueSize;this._weightPrev=m/(t-d),this._weightNext=m/(p-i),this._offsetPrev=l*A,this._offsetNext=u*A}interpolate_(e,t,i,a){const l=this.resultBuffer,u=this.sampleValues,d=this.valueSize,p=e*d,m=p-d,A=this._offsetPrev,_=this._offsetNext,b=this._weightPrev,w=this._weightNext,E=(i-t)/(a-t),C=E*E,T=C*E,x=-b*T+2*b*C-b*E,P=(1+b)*T+(-1.5-2*b)*C+(-.5+b)*E+1,M=(-1-w)*T+(1.5+w)*C+.5*E,B=w*T-w*C;for(let D=0;D!==d;++D)l[D]=x*u[A+D]+P*u[m+D]+M*u[p+D]+B*u[_+D];return l}}class NS extends ku{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e,t,i,a){const l=this.resultBuffer,u=this.sampleValues,d=this.valueSize,p=e*d,m=p-d,A=(i-t)/(a-t),_=1-A;for(let b=0;b!==d;++b)l[b]=u[m+b]*_+u[p+b]*A;return l}}class yR extends ku{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e){return this.copySampleValue_(e-1)}}class Bs{constructor(e,t,i,a){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Sh(t,this.TimeBufferType),this.values=Sh(i,this.ValueBufferType),this.setInterpolation(a||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:Sh(e.times,Array),values:Sh(e.values,Array)};const a=e.getInterpolation();a!==e.DefaultInterpolation&&(i.interpolation=a)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new yR(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new NS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new _R(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case vl:t=this.InterpolantFactoryMethodDiscrete;break;case wl:t=this.InterpolantFactoryMethodLinear;break;case op:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return vl;case this.InterpolantFactoryMethodLinear:return wl;case this.InterpolantFactoryMethodSmooth:return op}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,a=t.length;i!==a;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,a=t.length;i!==a;++i)t[i]*=e}return this}trim(e,t){const i=this.times,a=i.length;let l=0,u=a-1;for(;l!==a&&i[l]<e;)++l;for(;u!==-1&&i[u]>t;)--u;if(++u,l!==0||u!==a){l>=u&&(u=Math.max(u,1),l=u-1);const d=this.getValueSize();this.times=i.slice(l,u),this.values=this.values.slice(l*d,u*d)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,a=this.values,l=i.length;l===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let u=null;for(let d=0;d!==l;d++){const p=i[d];if(typeof p=="number"&&isNaN(p)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,d,p),e=!1;break}if(u!==null&&u>p){console.error("THREE.KeyframeTrack: Out of order keys.",this,d,p,u),e=!1;break}u=p}if(a!==void 0&&gR(a))for(let d=0,p=a.length;d!==p;++d){const m=a[d];if(isNaN(m)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,d,m),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),a=this.getInterpolation()===op,l=e.length-1;let u=1;for(let d=1;d<l;++d){let p=!1;const m=e[d],A=e[d+1];if(m!==A&&(d!==1||m!==e[0]))if(a)p=!0;else{const _=d*i,b=_-i,w=_+i;for(let E=0;E!==i;++E){const C=t[_+E];if(C!==t[b+E]||C!==t[w+E]){p=!0;break}}}if(p){if(d!==u){e[u]=e[d];const _=d*i,b=u*i;for(let w=0;w!==i;++w)t[b+w]=t[_+w]}++u}}if(l>0){e[u]=e[l];for(let d=l*i,p=u*i,m=0;m!==i;++m)t[p+m]=t[d+m];++u}return u!==e.length?(this.times=e.slice(0,u),this.values=t.slice(0,u*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,a=new i(this.name,e,t);return a.createInterpolant=this.createInterpolant,a}}Bs.prototype.TimeBufferType=Float32Array;Bs.prototype.ValueBufferType=Float32Array;Bs.prototype.DefaultInterpolation=wl;class $l extends Bs{constructor(e,t,i){super(e,t,i)}}$l.prototype.ValueTypeName="bool";$l.prototype.ValueBufferType=Array;$l.prototype.DefaultInterpolation=vl;$l.prototype.InterpolantFactoryMethodLinear=void 0;$l.prototype.InterpolantFactoryMethodSmooth=void 0;class OS extends Bs{}OS.prototype.ValueTypeName="color";class Tl extends Bs{}Tl.prototype.ValueTypeName="number";class bR extends ku{constructor(e,t,i,a){super(e,t,i,a)}interpolate_(e,t,i,a){const l=this.resultBuffer,u=this.sampleValues,d=this.valueSize,p=(i-t)/(a-t);let m=e*d;for(let A=m+d;m!==A;m+=4)Yi.slerpFlat(l,0,u,m-d,u,m,p);return l}}class Il extends Bs{InterpolantFactoryMethodLinear(e){return new bR(this.times,this.values,this.getValueSize(),e)}}Il.prototype.ValueTypeName="quaternion";Il.prototype.InterpolantFactoryMethodSmooth=void 0;class zl extends Bs{constructor(e,t,i){super(e,t,i)}}zl.prototype.ValueTypeName="string";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=vl;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;class Ml extends Bs{}Ml.prototype.ValueTypeName="vector";class EA{constructor(e="",t=-1,i=[],a=L0){this.name=e,this.tracks=i,this.duration=t,this.blendMode=a,this.uuid=us(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,a=1/(e.fps||1);for(let u=0,d=i.length;u!==d;++u)t.push(wR(i[u]).scale(a));const l=new this(e.name,e.duration,t,e.blendMode);return l.uuid=e.uuid,l}static toJSON(e){const t=[],i=e.tracks,a={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let l=0,u=i.length;l!==u;++l)t.push(Bs.toJSON(i[l]));return a}static CreateFromMorphTargetSequence(e,t,i,a){const l=t.length,u=[];for(let d=0;d<l;d++){let p=[],m=[];p.push((d+l-1)%l,d,(d+1)%l),m.push(0,1,0);const A=AR(p);p=Py(p,1,A),m=Py(m,1,A),!a&&p[0]===0&&(p.push(l),m.push(m[0])),u.push(new Tl(".morphTargetInfluences["+t[d].name+"]",p,m).scale(1/i))}return new this(e,-1,u)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const a=e;i=a.geometry&&a.geometry.animations||a.animations}for(let a=0;a<i.length;a++)if(i[a].name===t)return i[a];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const a={},l=/^([\w-]*?)([\d]+)$/;for(let d=0,p=e.length;d<p;d++){const m=e[d],A=m.name.match(l);if(A&&A.length>1){const _=A[1];let b=a[_];b||(a[_]=b=[]),b.push(m)}}const u=[];for(const d in a)u.push(this.CreateFromMorphTargetSequence(d,a[d],t,i));return u}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(_,b,w,E,C){if(w.length!==0){const T=[],x=[];DS(w,T,x,E),T.length!==0&&C.push(new _(b,T,x))}},a=[],l=e.name||"default",u=e.fps||30,d=e.blendMode;let p=e.length||-1;const m=e.hierarchy||[];for(let _=0;_<m.length;_++){const b=m[_].keys;if(!(!b||b.length===0))if(b[0].morphTargets){const w={};let E;for(E=0;E<b.length;E++)if(b[E].morphTargets)for(let C=0;C<b[E].morphTargets.length;C++)w[b[E].morphTargets[C]]=-1;for(const C in w){const T=[],x=[];for(let P=0;P!==b[E].morphTargets.length;++P){const M=b[E];T.push(M.time),x.push(M.morphTarget===C?1:0)}a.push(new Tl(".morphTargetInfluence["+C+"]",T,x))}p=w.length*u}else{const w=".bones["+t[_].name+"]";i(Ml,w+".position",b,"pos",a),i(Il,w+".quaternion",b,"rot",a),i(Ml,w+".scale",b,"scl",a)}}return a.length===0?null:new this(l,p,a,d)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,a=e.length;i!==a;++i){const l=this.tracks[i];t=Math.max(t,l.times[l.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function vR(o){switch(o.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Tl;case"vector":case"vector2":case"vector3":case"vector4":return Ml;case"color":return OS;case"quaternion":return Il;case"bool":case"boolean":return $l;case"string":return zl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+o)}function wR(o){if(o.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=vR(o.type);if(o.times===void 0){const t=[],i=[];DS(o.keys,t,i,"value"),o.times=t,o.values=i}return e.parse!==void 0?e.parse(o):new e(o.name,o.times,o.values,o.interpolation)}const kr={enabled:!1,files:{},add:function(o,e){this.enabled!==!1&&(this.files[o]=e)},get:function(o){if(this.enabled!==!1)return this.files[o]},remove:function(o){delete this.files[o]},clear:function(){this.files={}}};class kS{constructor(e,t,i){const a=this;let l=!1,u=0,d=0,p;const m=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(A){d++,l===!1&&a.onStart!==void 0&&a.onStart(A,u,d),l=!0},this.itemEnd=function(A){u++,a.onProgress!==void 0&&a.onProgress(A,u,d),u===d&&(l=!1,a.onLoad!==void 0&&a.onLoad())},this.itemError=function(A){a.onError!==void 0&&a.onError(A)},this.resolveURL=function(A){return p?p(A):A},this.setURLModifier=function(A){return p=A,this},this.addHandler=function(A,_){return m.push(A,_),this},this.removeHandler=function(A){const _=m.indexOf(A);return _!==-1&&m.splice(_,2),this},this.getHandler=function(A){for(let _=0,b=m.length;_<b;_+=2){const w=m[_],E=m[_+1];if(w.global&&(w.lastIndex=0),w.test(A))return E}return null}}}const ER=new kS;class Ps{constructor(e){this.manager=e!==void 0?e:ER,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(a,l){i.load(e,a,t,l)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Ps.DEFAULT_MATERIAL_NAME="__DEFAULT";const Gs={};class xR extends Error{constructor(e,t){super(e),this.response=t}}class lr extends Ps{constructor(e){super(e)}load(e,t,i,a){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const l=kr.get(e);if(l!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(l),this.manager.itemEnd(e)},0),l;if(Gs[e]!==void 0){Gs[e].push({onLoad:t,onProgress:i,onError:a});return}Gs[e]=[],Gs[e].push({onLoad:t,onProgress:i,onError:a});const u=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),d=this.mimeType,p=this.responseType;fetch(u).then(m=>{if(m.status===200||m.status===0){if(m.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||m.body===void 0||m.body.getReader===void 0)return m;const A=Gs[e],_=m.body.getReader(),b=m.headers.get("X-File-Size")||m.headers.get("Content-Length"),w=b?parseInt(b):0,E=w!==0;let C=0;const T=new ReadableStream({start(x){P();function P(){_.read().then(({done:M,value:B})=>{if(M)x.close();else{C+=B.byteLength;const D=new ProgressEvent("progress",{lengthComputable:E,loaded:C,total:w});for(let G=0,U=A.length;G<U;G++){const V=A[G];V.onProgress&&V.onProgress(D)}x.enqueue(B),P()}},M=>{x.error(M)})}}});return new Response(T)}else throw new xR(`fetch for "${m.url}" responded with ${m.status}: ${m.statusText}`,m)}).then(m=>{switch(p){case"arraybuffer":return m.arrayBuffer();case"blob":return m.blob();case"document":return m.text().then(A=>new DOMParser().parseFromString(A,d));case"json":return m.json();default:if(d===void 0)return m.text();{const _=/charset="?([^;"\s]*)"?/i.exec(d),b=_&&_[1]?_[1].toLowerCase():void 0,w=new TextDecoder(b);return m.arrayBuffer().then(E=>w.decode(E))}}}).then(m=>{kr.add(e,m);const A=Gs[e];delete Gs[e];for(let _=0,b=A.length;_<b;_++){const w=A[_];w.onLoad&&w.onLoad(m)}}).catch(m=>{const A=Gs[e];if(A===void 0)throw this.manager.itemError(e),m;delete Gs[e];for(let _=0,b=A.length;_<b;_++){const w=A[_];w.onError&&w.onError(m)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class SR extends Ps{constructor(e){super(e)}load(e,t,i,a){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const l=this,u=kr.get(e);if(u!==void 0)return l.manager.itemStart(e),setTimeout(function(){t&&t(u),l.manager.itemEnd(e)},0),u;const d=xu("img");function p(){A(),kr.add(e,this),t&&t(this),l.manager.itemEnd(e)}function m(_){A(),a&&a(_),l.manager.itemError(e),l.manager.itemEnd(e)}function A(){d.removeEventListener("load",p,!1),d.removeEventListener("error",m,!1)}return d.addEventListener("load",p,!1),d.addEventListener("error",m,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(d.crossOrigin=this.crossOrigin),l.manager.itemStart(e),d.src=e,d}}class CR extends Ps{constructor(e){super(e)}load(e,t,i,a){const l=this,u=new Nu,d=new lr(this.manager);return d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setPath(this.path),d.setWithCredentials(l.withCredentials),d.load(e,function(p){let m;try{m=l.parse(p)}catch(A){if(a!==void 0)a(A);else{console.error(A);return}}m.image!==void 0?u.image=m.image:m.data!==void 0&&(u.image.width=m.width,u.image.height=m.height,u.image.data=m.data),u.wrapS=m.wrapS!==void 0?m.wrapS:ai,u.wrapT=m.wrapT!==void 0?m.wrapT:ai,u.magFilter=m.magFilter!==void 0?m.magFilter:Et,u.minFilter=m.minFilter!==void 0?m.minFilter:Et,u.anisotropy=m.anisotropy!==void 0?m.anisotropy:1,m.colorSpace!==void 0&&(u.colorSpace=m.colorSpace),m.flipY!==void 0&&(u.flipY=m.flipY),m.format!==void 0&&(u.format=m.format),m.type!==void 0&&(u.type=m.type),m.mipmaps!==void 0&&(u.mipmaps=m.mipmaps,u.minFilter=hn),m.mipmapCount===1&&(u.minFilter=Et),m.generateMipmaps!==void 0&&(u.generateMipmaps=m.generateMipmaps),u.needsUpdate=!0,t&&t(u,m)},i,a),u}}class H0 extends Ps{constructor(e){super(e)}load(e,t,i,a){const l=new Kt,u=new SR(this.manager);return u.setCrossOrigin(this.crossOrigin),u.setPath(this.path),u.load(e,function(d){l.image=d,l.needsUpdate=!0,t!==void 0&&t(l)},i,a),l}}class Nf extends Qt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ye(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const Pp=new tt,Ly=new se,Dy=new se;class V0{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ve(512,512),this.map=null,this.mapPass=null,this.matrix=new tt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new $0,this._frameExtents=new Ve(1,1),this._viewportCount=1,this._viewports=[new Rt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;Ly.setFromMatrixPosition(e.matrixWorld),t.position.copy(Ly),Dy.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Dy),t.updateMatrixWorld(),Pp.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Pp),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Pp)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class TR extends V0{constructor(){super(new _i(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=El*2*e.angle*this.focus,a=this.mapSize.width/this.mapSize.height,l=e.distance||t.far;(i!==t.fov||a!==t.aspect||l!==t.far)&&(t.fov=i,t.aspect=a,t.far=l,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class IR extends Nf{constructor(e,t,i=0,a=Math.PI/3,l=0,u=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Qt.DEFAULT_UP),this.updateMatrix(),this.target=new Qt,this.distance=i,this.angle=a,this.penumbra=l,this.decay=u,this.map=null,this.shadow=new TR}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Ny=new tt,pc=new se,Lp=new se;class MR extends V0{constructor(){super(new _i(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ve(4,2),this._viewportCount=6,this._viewports=[new Rt(2,1,1,1),new Rt(0,1,1,1),new Rt(3,1,1,1),new Rt(1,1,1,1),new Rt(3,0,1,1),new Rt(1,0,1,1)],this._cubeDirections=[new se(1,0,0),new se(-1,0,0),new se(0,0,1),new se(0,0,-1),new se(0,1,0),new se(0,-1,0)],this._cubeUps=[new se(0,1,0),new se(0,1,0),new se(0,1,0),new se(0,1,0),new se(0,0,1),new se(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,a=this.matrix,l=e.distance||i.far;l!==i.far&&(i.far=l,i.updateProjectionMatrix()),pc.setFromMatrixPosition(e.matrixWorld),i.position.copy(pc),Lp.copy(i.position),Lp.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Lp),i.updateMatrixWorld(),a.makeTranslation(-pc.x,-pc.y,-pc.z),Ny.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ny)}}class US extends Nf{constructor(e,t,i=0,a=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=a,this.shadow=new MR}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Kr extends MS{constructor(e=-1,t=1,i=1,a=-1,l=.1,u=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=a,this.near=l,this.far=u,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,a,l,u){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=a,this.view.width=l,this.view.height=u,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,a=(this.top+this.bottom)/2;let l=i-e,u=i+e,d=a+t,p=a-t;if(this.view!==null&&this.view.enabled){const m=(this.right-this.left)/this.view.fullWidth/this.zoom,A=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l+=m*this.view.offsetX,u=l+m*this.view.width,d-=A*this.view.offsetY,p=d-A*this.view.height}this.projectionMatrix.makeOrthographic(l,u,d,p,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class RR extends V0{constructor(){super(new Kr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class FS extends Nf{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Qt.DEFAULT_UP),this.updateMatrix(),this.target=new Qt,this.shadow=new RR}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class BR{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new se)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,a=e.y,l=e.z,u=this.coefficients;return t.copy(u[0]).multiplyScalar(.282095),t.addScaledVector(u[1],.488603*a),t.addScaledVector(u[2],.488603*l),t.addScaledVector(u[3],.488603*i),t.addScaledVector(u[4],1.092548*(i*a)),t.addScaledVector(u[5],1.092548*(a*l)),t.addScaledVector(u[6],.315392*(3*l*l-1)),t.addScaledVector(u[7],1.092548*(i*l)),t.addScaledVector(u[8],.546274*(i*i-a*a)),t}getIrradianceAt(e,t){const i=e.x,a=e.y,l=e.z,u=this.coefficients;return t.copy(u[0]).multiplyScalar(.886227),t.addScaledVector(u[1],2*.511664*a),t.addScaledVector(u[2],2*.511664*l),t.addScaledVector(u[3],2*.511664*i),t.addScaledVector(u[4],2*.429043*i*a),t.addScaledVector(u[5],2*.429043*a*l),t.addScaledVector(u[6],.743125*l*l-.247708),t.addScaledVector(u[7],2*.429043*i*l),t.addScaledVector(u[8],.429043*(i*i-a*a)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let a=0;a<9;a++)i[a].fromArray(e,t+a*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let a=0;a<9;a++)i[a].toArray(e,t+a*3);return e}static getBasisAt(e,t){const i=e.x,a=e.y,l=e.z;t[0]=.282095,t[1]=.488603*a,t[2]=.488603*l,t[3]=.488603*i,t[4]=1.092548*i*a,t[5]=1.092548*a*l,t[6]=.315392*(3*l*l-1),t[7]=1.092548*i*l,t[8]=.546274*(i*i-a*a)}}class PR extends Nf{constructor(e=new BR,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class cu{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,a=e.length;i<a;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class LR extends Ps{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,a){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const l=this,u=kr.get(e);if(u!==void 0){if(l.manager.itemStart(e),u.then){u.then(m=>{t&&t(m),l.manager.itemEnd(e)}).catch(m=>{a&&a(m)});return}return setTimeout(function(){t&&t(u),l.manager.itemEnd(e)},0),u}const d={};d.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",d.headers=this.requestHeader;const p=fetch(e,d).then(function(m){return m.blob()}).then(function(m){return createImageBitmap(m,Object.assign(l.options,{colorSpaceConversion:"none"}))}).then(function(m){return kr.add(e,m),t&&t(m),l.manager.itemEnd(e),m}).catch(function(m){a&&a(m),kr.remove(e),l.manager.itemError(e),l.manager.itemEnd(e)});kr.add(e,p),l.manager.itemStart(e)}}class DR extends _i{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class $S{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Oy(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Oy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Oy(){return performance.now()}class NR{constructor(e,t,i){this.binding=e,this.valueSize=i;let a,l,u;switch(t){case"quaternion":a=this._slerp,l=this._slerpAdditive,u=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":a=this._select,l=this._select,u=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:a=this._lerp,l=this._lerpAdditive,u=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=a,this._mixBufferRegionAdditive=l,this._setIdentity=u,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,a=this.valueSize,l=e*a+a;let u=this.cumulativeWeight;if(u===0){for(let d=0;d!==a;++d)i[l+d]=i[d];u=t}else{u+=t;const d=t/u;this._mixBufferRegion(i,l,0,d,a)}this.cumulativeWeight=u}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,a=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,a,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,a=e*t+t,l=this.cumulativeWeight,u=this.cumulativeWeightAdditive,d=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,l<1){const p=t*this._origIndex;this._mixBufferRegion(i,a,p,1-l,t)}u>0&&this._mixBufferRegionAdditive(i,a,this._addIndex*t,1,t);for(let p=t,m=t+t;p!==m;++p)if(i[p]!==i[p+t]){d.setValue(i,a);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,a=i*this._origIndex;e.getValue(t,a);for(let l=i,u=a;l!==u;++l)t[l]=t[a+l%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,a,l){if(a>=.5)for(let u=0;u!==l;++u)e[t+u]=e[i+u]}_slerp(e,t,i,a){Yi.slerpFlat(e,t,e,t,e,i,a)}_slerpAdditive(e,t,i,a,l){const u=this._workIndex*l;Yi.multiplyQuaternionsFlat(e,u,e,t,e,i),Yi.slerpFlat(e,t,e,t,e,u,a)}_lerp(e,t,i,a,l){const u=1-a;for(let d=0;d!==l;++d){const p=t+d;e[p]=e[p]*u+e[i+d]*a}}_lerpAdditive(e,t,i,a,l){for(let u=0;u!==l;++u){const d=t+u;e[d]=e[d]+e[i+u]*a}}}const Q0="\\[\\]\\.:\\/",OR=new RegExp("["+Q0+"]","g"),j0="[^"+Q0+"]",kR="[^"+Q0.replace("\\.","")+"]",UR=/((?:WC+[\/:])*)/.source.replace("WC",j0),FR=/(WCOD+)?/.source.replace("WCOD",kR),$R=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",j0),zR=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",j0),GR=new RegExp("^"+UR+FR+$R+zR+"$"),HR=["material","materials","bones","map"];class VR{constructor(e,t,i){const a=i||xt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,a)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,a=this._bindings[i];a!==void 0&&a.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let a=this._targetGroup.nCachedObjects_,l=i.length;a!==l;++a)i[a].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class xt{constructor(e,t,i){this.path=t,this.parsedPath=i||xt.parseTrackName(t),this.node=xt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new xt.Composite(e,t,i):new xt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(OR,"")}static parseTrackName(e){const t=GR.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},a=i.nodeName&&i.nodeName.lastIndexOf(".");if(a!==void 0&&a!==-1){const l=i.nodeName.substring(a+1);HR.indexOf(l)!==-1&&(i.nodeName=i.nodeName.substring(0,a),i.objectName=l)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(l){for(let u=0;u<l.length;u++){const d=l[u];if(d.name===t||d.uuid===t)return d;const p=i(d.children);if(p)return p}return null},a=i(e.children);if(a)return a}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let a=0,l=i.length;a!==l;++a)e[t++]=i[a]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let a=0,l=i.length;a!==l;++a)i[a]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let a=0,l=i.length;a!==l;++a)i[a]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let a=0,l=i.length;a!==l;++a)i[a]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,a=t.propertyName;let l=t.propertyIndex;if(e||(e=xt.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let m=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let A=0;A<e.length;A++)if(e[A].name===m){m=A;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(m!==void 0){if(e[m]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[m]}}const u=e[a];if(u===void 0){const m=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+m+"."+a+" but it wasn't found.",e);return}let d=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?d=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(d=this.Versioning.MatrixWorldNeedsUpdate);let p=this.BindingType.Direct;if(l!==void 0){if(a==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[l]!==void 0&&(l=e.morphTargetDictionary[l])}p=this.BindingType.ArrayElement,this.resolvedProperty=u,this.propertyIndex=l}else u.fromArray!==void 0&&u.toArray!==void 0?(p=this.BindingType.HasFromToArray,this.resolvedProperty=u):Array.isArray(u)?(p=this.BindingType.EntireArray,this.resolvedProperty=u):this.propertyName=a;this.getValue=this.GetterByBindingType[p],this.setValue=this.SetterByBindingTypeAndVersioning[p][d]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}xt.Composite=VR;xt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};xt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};xt.prototype.GetterByBindingType=[xt.prototype._getValue_direct,xt.prototype._getValue_array,xt.prototype._getValue_arrayElement,xt.prototype._getValue_toArray];xt.prototype.SetterByBindingTypeAndVersioning=[[xt.prototype._setValue_direct,xt.prototype._setValue_direct_setNeedsUpdate,xt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[xt.prototype._setValue_array,xt.prototype._setValue_array_setNeedsUpdate,xt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[xt.prototype._setValue_arrayElement,xt.prototype._setValue_arrayElement_setNeedsUpdate,xt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[xt.prototype._setValue_fromArray,xt.prototype._setValue_fromArray_setNeedsUpdate,xt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class QR{constructor(e,t,i=null,a=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=a;const l=t.tracks,u=l.length,d=new Array(u),p={endingStart:qo,endingEnd:qo};for(let m=0;m!==u;++m){const A=l[m].createInterpolant(null);d[m]=A,A.settings=p}this._interpolantSettings=p,this._interpolants=d,this._propertyBindings=new Array(u),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ka,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const a=this._clip.duration,l=e._clip.duration,u=l/a,d=a/l;e.warp(1,u,t),this.warp(d,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const a=this._mixer,l=a.time,u=this.timeScale;let d=this._timeScaleInterpolant;d===null&&(d=a._lendControlInterpolant(),this._timeScaleInterpolant=d);const p=d.parameterPositions,m=d.sampleValues;return p[0]=l,p[1]=l+i,m[0]=e/u,m[1]=t/u,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,a){if(!this.enabled){this._updateWeight(e);return}const l=this._startTime;if(l!==null){const p=(e-l)*i;p<0||i===0?t=0:(this._startTime=null,t=i*p)}t*=this._updateTimeScale(e);const u=this._updateTime(t),d=this._updateWeight(e);if(d>0){const p=this._interpolants,m=this._propertyBindings;switch(this.blendMode){case iM:for(let A=0,_=p.length;A!==_;++A)p[A].evaluate(u),m[A].accumulateAdditive(d);break;case L0:default:for(let A=0,_=p.length;A!==_;++A)p[A].evaluate(u),m[A].accumulate(a,d)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const a=i.evaluate(e)[0];t*=a,e>i.parameterPositions[1]&&(this.stopFading(),a===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const a=i.evaluate(e)[0];t*=a,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let a=this.time+e,l=this._loopCount;const u=i===Yd;if(e===0)return l===-1?a:u&&(l&1)===1?t-a:a;if(i===bl){l===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(a>=t)a=t;else if(a<0)a=0;else{this.time=a;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(l===-1&&(e>=0?(l=0,this._setEndings(!0,this.repetitions===0,u)):this._setEndings(this.repetitions===0,!0,u)),a>=t||a<0){const d=Math.floor(a/t);a-=t*d,l+=Math.abs(d);const p=this.repetitions-l;if(p<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,a=e>0?t:0,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(p===1){const m=e<0;this._setEndings(m,!m,u)}else this._setEndings(!1,!1,u);this._loopCount=l,this.time=a,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d})}}else this.time=a;if(u&&(l&1)===1)return t-a}return a}_setEndings(e,t,i){const a=this._interpolantSettings;i?(a.endingStart=Wo,a.endingEnd=Wo):(e?a.endingStart=this.zeroSlopeAtStart?Wo:qo:a.endingStart=Xd,t?a.endingEnd=this.zeroSlopeAtEnd?Wo:qo:a.endingEnd=Xd)}_scheduleFading(e,t,i){const a=this._mixer,l=a.time;let u=this._weightInterpolant;u===null&&(u=a._lendControlInterpolant(),this._weightInterpolant=u);const d=u.parameterPositions,p=u.sampleValues;return d[0]=l,p[0]=t,d[1]=l+e,p[1]=i,this}}const jR=new Float32Array(1);class zS extends fs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,a=e._clip.tracks,l=a.length,u=e._propertyBindings,d=e._interpolants,p=i.uuid,m=this._bindingsByRootAndName;let A=m[p];A===void 0&&(A={},m[p]=A);for(let _=0;_!==l;++_){const b=a[_],w=b.name;let E=A[w];if(E!==void 0)++E.referenceCount,u[_]=E;else{if(E=u[_],E!==void 0){E._cacheIndex===null&&(++E.referenceCount,this._addInactiveBinding(E,p,w));continue}const C=t&&t._propertyBindings[_].binding.parsedPath;E=new NR(xt.create(i,w,C),b.ValueTypeName,b.getValueSize()),++E.referenceCount,this._addInactiveBinding(E,p,w),u[_]=E}d[_].resultBuffer=E.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,a=e._clip.uuid,l=this._actionsByClip[a];this._bindAction(e,l&&l.knownActions[0]),this._addInactiveAction(e,a,i)}const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const l=t[i];l.useCount++===0&&(this._lendBinding(l),l.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const l=t[i];--l.useCount===0&&(l.restoreOriginalState(),this._takeBackBinding(l))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){const a=this._actions,l=this._actionsByClip;let u=l[t];if(u===void 0)u={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,l[t]=u;else{const d=u.knownActions;e._byClipCacheIndex=d.length,d.push(e)}e._cacheIndex=a.length,a.push(e),u.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],a=e._cacheIndex;i._cacheIndex=a,t[a]=i,t.pop(),e._cacheIndex=null;const l=e._clip.uuid,u=this._actionsByClip,d=u[l],p=d.knownActions,m=p[p.length-1],A=e._byClipCacheIndex;m._byClipCacheIndex=A,p[A]=m,p.pop(),e._byClipCacheIndex=null;const _=d.actionByRoot,b=(e._localRoot||this._root).uuid;delete _[b],p.length===0&&delete u[l],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,a=t.length;i!==a;++i){const l=t[i];--l.referenceCount===0&&this._removeInactiveBinding(l)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,a=this._nActiveActions++,l=t[a];e._cacheIndex=a,t[a]=e,l._cacheIndex=i,t[i]=l}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,a=--this._nActiveActions,l=t[a];e._cacheIndex=a,t[a]=e,l._cacheIndex=i,t[i]=l}_addInactiveBinding(e,t,i){const a=this._bindingsByRootAndName,l=this._bindings;let u=a[t];u===void 0&&(u={},a[t]=u),u[i]=e,e._cacheIndex=l.length,l.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,a=i.rootNode.uuid,l=i.path,u=this._bindingsByRootAndName,d=u[a],p=t[t.length-1],m=e._cacheIndex;p._cacheIndex=m,t[m]=p,t.pop(),delete d[l],Object.keys(d).length===0&&delete u[a]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,a=this._nActiveBindings++,l=t[a];e._cacheIndex=a,t[a]=e,l._cacheIndex=i,t[i]=l}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,a=--this._nActiveBindings,l=t[a];e._cacheIndex=a,t[a]=e,l._cacheIndex=i,t[i]=l}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new NS(new Float32Array(2),new Float32Array(2),1,jR),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,a=--this._nActiveControlInterpolants,l=t[a];e.__cacheIndex=a,t[a]=e,l.__cacheIndex=i,t[i]=l}clipAction(e,t,i){const a=t||this._root,l=a.uuid;let u=typeof e=="string"?EA.findByName(a,e):e;const d=u!==null?u.uuid:e,p=this._actionsByClip[d];let m=null;if(i===void 0&&(u!==null?i=u.blendMode:i=L0),p!==void 0){const _=p.actionByRoot[l];if(_!==void 0&&_.blendMode===i)return _;m=p.knownActions[0],u===null&&(u=m._clip)}if(u===null)return null;const A=new QR(this,u,t,i);return this._bindAction(A,m),this._addInactiveAction(A,d,l),A}existingAction(e,t){const i=t||this._root,a=i.uuid,l=typeof e=="string"?EA.findByName(i,e):e,u=l?l.uuid:e,d=this._actionsByClip[u];return d!==void 0&&d.actionByRoot[a]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,a=this.time+=e,l=Math.sign(e),u=this._accuIndex^=1;for(let m=0;m!==i;++m)t[m]._update(a,e,l,u);const d=this._bindings,p=this._nActiveBindings;for(let m=0;m!==p;++m)d[m].apply(u);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,a=this._actionsByClip,l=a[i];if(l!==void 0){const u=l.knownActions;for(let d=0,p=u.length;d!==p;++d){const m=u[d];this._deactivateAction(m);const A=m._cacheIndex,_=t[t.length-1];m._cacheIndex=null,m._byClipCacheIndex=null,_._cacheIndex=A,t[A]=_,t.pop(),this._removeInactiveBindingsForAction(m)}delete a[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const u in i){const d=i[u].actionByRoot,p=d[t];p!==void 0&&(this._deactivateAction(p),this._removeInactiveAction(p))}const a=this._bindingsByRootAndName,l=a[t];if(l!==void 0)for(const u in l){const d=l[u];d.restoreOriginalState(),this._removeInactiveBinding(d)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}const ky=new tt;class q0{constructor(e,t,i=0,a=1/0){this.ray=new Du(e,t),this.near=i,this.far=a,this.camera=null,this.layers=new O0,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return ky.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(ky),this}intersectObject(e,t=!0,i=[]){return xA(e,this,i,t),i.sort(Uy),i}intersectObjects(e,t=!0,i=[]){for(let a=0,l=e.length;a<l;a++)xA(e[a],this,i,t);return i.sort(Uy),i}}function Uy(o,e){return o.distance-e.distance}function xA(o,e,t,i){let a=!0;if(o.layers.test(e.layers)&&o.raycast(e,t)===!1&&(a=!1),a===!0&&i===!0){const l=o.children;for(let u=0,d=l.length;u<d;u++)xA(l[u],e,t,!0)}}class ol{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=ft(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(ft(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class qR extends z0{constructor(e=10,t=10,i=4473924,a=8947848){i=new Ye(i),a=new Ye(a);const l=t/2,u=e/t,d=e/2,p=[],m=[];for(let b=0,w=0,E=-d;b<=t;b++,E+=u){p.push(-d,0,E,d,0,E),p.push(E,0,-d,E,0,d);const C=b===l?i:a;C.toArray(m,w),w+=3,C.toArray(m,w),w+=3,C.toArray(m,w),w+=3,C.toArray(m,w),w+=3}const A=new Di;A.setAttribute("position",new $i(p,3)),A.setAttribute("color",new $i(m,3));const _=new Ou({vertexColors:!0,toneMapped:!1});super(A,_),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Ch=new yi;class WR extends z0{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),a=new Float32Array(24),l=new Di;l.setIndex(new Vt(i,1)),l.setAttribute("position",new Vt(a,3)),super(l,new Ou({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Ch.setFromObject(this.object),Ch.isEmpty())return;const t=Ch.min,i=Ch.max,a=this.geometry.attributes.position,l=a.array;l[0]=i.x,l[1]=i.y,l[2]=i.z,l[3]=t.x,l[4]=i.y,l[5]=i.z,l[6]=t.x,l[7]=t.y,l[8]=i.z,l[9]=i.x,l[10]=t.y,l[11]=i.z,l[12]=i.x,l[13]=i.y,l[14]=t.z,l[15]=t.x,l[16]=i.y,l[17]=t.z,l[18]=t.x,l[19]=t.y,l[20]=t.z,l[21]=i.x,l[22]=t.y,l[23]=t.z,a.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function Fy(o,e,t,i){const a=YR(i);switch(t){case fS:return o*e;case mS:return o*e;case gS:return o*e*2;case Or:return o*e/a.components*a.byteLength;case R0:return o*e/a.components*a.byteLength;case La:return o*e*2/a.components*a.byteLength;case B0:return o*e*2/a.components*a.byteLength;case pS:return o*e*3/a.components*a.byteLength;case Xt:return o*e*4/a.components*a.byteLength;case P0:return o*e*4/a.components*a.byteLength;case bd:case su:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*8;case vd:case ru:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case eA:case tA:return Math.max(o,16)*Math.max(e,8)/4;case Hd:case Vd:return Math.max(o,8)*Math.max(e,8)/2;case Qd:case jd:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*8;case qd:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case wu:return Math.floor((o+3)/4)*Math.floor((e+3)/4)*16;case iA:return Math.floor((o+4)/5)*Math.floor((e+3)/4)*16;case nA:return Math.floor((o+4)/5)*Math.floor((e+4)/5)*16;case sA:return Math.floor((o+5)/6)*Math.floor((e+4)/5)*16;case Eu:return Math.floor((o+5)/6)*Math.floor((e+5)/6)*16;case rA:return Math.floor((o+7)/8)*Math.floor((e+4)/5)*16;case aA:return Math.floor((o+7)/8)*Math.floor((e+5)/6)*16;case oA:return Math.floor((o+7)/8)*Math.floor((e+7)/8)*16;case lA:return Math.floor((o+9)/10)*Math.floor((e+4)/5)*16;case cA:return Math.floor((o+9)/10)*Math.floor((e+5)/6)*16;case uA:return Math.floor((o+9)/10)*Math.floor((e+7)/8)*16;case hA:return Math.floor((o+9)/10)*Math.floor((e+9)/10)*16;case dA:return Math.floor((o+11)/12)*Math.floor((e+9)/10)*16;case fA:return Math.floor((o+11)/12)*Math.floor((e+11)/12)*16;case au:case pA:case Wd:return Math.ceil(o/4)*Math.ceil(e/4)*16;case AS:case mA:return Math.ceil(o/4)*Math.ceil(e/4)*8;case gA:case AA:return Math.ceil(o/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function YR(o){switch(o){case ui:case C0:return{byteLength:1,components:1};case vu:case T0:case hi:return{byteLength:2,components:1};case I0:case M0:return{byteLength:2,components:4};case qr:case Lf:case oi:return{byteLength:4,components:1};case dS:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${o}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Bf}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Bf);/**
|
|
118
118
|
* @license
|
|
119
119
|
* Copyright 2010-2024 Three.js Authors
|
|
120
120
|
* SPDX-License-Identifier: MIT
|
|
@@ -3644,7 +3644,7 @@ void main() {
|
|
|
3644
3644
|
#include <tonemapping_fragment>
|
|
3645
3645
|
#include <colorspace_fragment>
|
|
3646
3646
|
#include <fog_fragment>
|
|
3647
|
-
}`,ht={alphahash_fragment:KR,alphahash_pars_fragment:JR,alphamap_fragment:ZR,alphamap_pars_fragment:e2,alphatest_fragment:t2,alphatest_pars_fragment:i2,aomap_fragment:n2,aomap_pars_fragment:s2,batching_pars_vertex:r2,batching_vertex:a2,begin_vertex:o2,beginnormal_vertex:l2,bsdfs:c2,iridescence_fragment:u2,bumpmap_pars_fragment:h2,clipping_planes_fragment:d2,clipping_planes_pars_fragment:f2,clipping_planes_pars_vertex:p2,clipping_planes_vertex:m2,color_fragment:g2,color_pars_fragment:A2,color_pars_vertex:_2,color_vertex:y2,common:b2,cube_uv_reflection_fragment:v2,defaultnormal_vertex:w2,displacementmap_pars_vertex:E2,displacementmap_vertex:x2,emissivemap_fragment:S2,emissivemap_pars_fragment:C2,colorspace_fragment:T2,colorspace_pars_fragment:I2,envmap_fragment:M2,envmap_common_pars_fragment:R2,envmap_pars_fragment:B2,envmap_pars_vertex:P2,envmap_physical_pars_fragment:H2,envmap_vertex:L2,fog_vertex:D2,fog_pars_vertex:N2,fog_fragment:O2,fog_pars_fragment:k2,gradientmap_pars_fragment:U2,lightmap_pars_fragment:F2,lights_lambert_fragment:$2,lights_lambert_pars_fragment:z2,lights_pars_begin:G2,lights_toon_fragment:V2,lights_toon_pars_fragment:Q2,lights_phong_fragment:j2,lights_phong_pars_fragment:q2,lights_physical_fragment:W2,lights_physical_pars_fragment:Y2,lights_fragment_begin:X2,lights_fragment_maps:K2,lights_fragment_end:J2,logdepthbuf_fragment:Z2,logdepthbuf_pars_fragment:eB,logdepthbuf_pars_vertex:tB,logdepthbuf_vertex:iB,map_fragment:nB,map_pars_fragment:sB,map_particle_fragment:rB,map_particle_pars_fragment:aB,metalnessmap_fragment:oB,metalnessmap_pars_fragment:lB,morphinstance_vertex:cB,morphcolor_vertex:uB,morphnormal_vertex:hB,morphtarget_pars_vertex:dB,morphtarget_vertex:fB,normal_fragment_begin:pB,normal_fragment_maps:mB,normal_pars_fragment:gB,normal_pars_vertex:AB,normal_vertex:_B,normalmap_pars_fragment:yB,clearcoat_normal_fragment_begin:bB,clearcoat_normal_fragment_maps:vB,clearcoat_pars_fragment:wB,iridescence_pars_fragment:EB,opaque_fragment:xB,packing:SB,premultiplied_alpha_fragment:CB,project_vertex:TB,dithering_fragment:IB,dithering_pars_fragment:MB,roughnessmap_fragment:RB,roughnessmap_pars_fragment:BB,shadowmap_pars_fragment:PB,shadowmap_pars_vertex:LB,shadowmap_vertex:DB,shadowmask_pars_fragment:NB,skinbase_vertex:OB,skinning_pars_vertex:kB,skinning_vertex:UB,skinnormal_vertex:FB,specularmap_fragment:$B,specularmap_pars_fragment:zB,tonemapping_fragment:GB,tonemapping_pars_fragment:HB,transmission_fragment:VB,transmission_pars_fragment:QB,uv_pars_fragment:jB,uv_pars_vertex:qB,uv_vertex:WB,worldpos_vertex:YB,background_vert:XB,background_frag:KB,backgroundCube_vert:JB,backgroundCube_frag:ZB,cube_vert:eP,cube_frag:tP,depth_vert:iP,depth_frag:nP,distanceRGBA_vert:sP,distanceRGBA_frag:rP,equirect_vert:aP,equirect_frag:oP,linedashed_vert:lP,linedashed_frag:cP,meshbasic_vert:uP,meshbasic_frag:hP,meshlambert_vert:dP,meshlambert_frag:fP,meshmatcap_vert:pP,meshmatcap_frag:mP,meshnormal_vert:gP,meshnormal_frag:AP,meshphong_vert:_P,meshphong_frag:yP,meshphysical_vert:bP,meshphysical_frag:vP,meshtoon_vert:wP,meshtoon_frag:EP,points_vert:xP,points_frag:SP,shadow_vert:CP,shadow_frag:TP,sprite_vert:IP,sprite_frag:MP},Fe={common:{diffuse:{value:new Ye(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ot},alphaMap:{value:null},alphaMapTransform:{value:new ot},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ot}},envmap:{envMap:{value:null},envMapRotation:{value:new ot},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ot}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ot}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ot},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ot},normalScale:{value:new Ve(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ot},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ot}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ot}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ot}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ye(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 Ye(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ot},alphaTest:{value:0},uvTransform:{value:new ot}},sprite:{diffuse:{value:new Ye(16777215)},opacity:{value:1},center:{value:new Ve(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ot},alphaMap:{value:null},alphaMapTransform:{value:new ot},alphaTest:{value:0}}},ys={basic:{uniforms:rn([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:ht.meshbasic_vert,fragmentShader:ht.meshbasic_frag},lambert:{uniforms:rn([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new Ye(0)}}]),vertexShader:ht.meshlambert_vert,fragmentShader:ht.meshlambert_frag},phong:{uniforms:rn([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new Ye(0)},specular:{value:new Ye(1118481)},shininess:{value:30}}]),vertexShader:ht.meshphong_vert,fragmentShader:ht.meshphong_frag},standard:{uniforms:rn([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new Ye(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag},toon:{uniforms:rn([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new Ye(0)}}]),vertexShader:ht.meshtoon_vert,fragmentShader:ht.meshtoon_frag},matcap:{uniforms:rn([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:ht.meshmatcap_vert,fragmentShader:ht.meshmatcap_frag},points:{uniforms:rn([Fe.points,Fe.fog]),vertexShader:ht.points_vert,fragmentShader:ht.points_frag},dashed:{uniforms:rn([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ht.linedashed_vert,fragmentShader:ht.linedashed_frag},depth:{uniforms:rn([Fe.common,Fe.displacementmap]),vertexShader:ht.depth_vert,fragmentShader:ht.depth_frag},normal:{uniforms:rn([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:ht.meshnormal_vert,fragmentShader:ht.meshnormal_frag},sprite:{uniforms:rn([Fe.sprite,Fe.fog]),vertexShader:ht.sprite_vert,fragmentShader:ht.sprite_frag},background:{uniforms:{uvTransform:{value:new ot},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ht.background_vert,fragmentShader:ht.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ot}},vertexShader:ht.backgroundCube_vert,fragmentShader:ht.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ht.cube_vert,fragmentShader:ht.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ht.equirect_vert,fragmentShader:ht.equirect_frag},distanceRGBA:{uniforms:rn([Fe.common,Fe.displacementmap,{referencePosition:{value:new se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ht.distanceRGBA_vert,fragmentShader:ht.distanceRGBA_frag},shadow:{uniforms:rn([Fe.lights,Fe.fog,{color:{value:new Ye(0)},opacity:{value:1}}]),vertexShader:ht.shadow_vert,fragmentShader:ht.shadow_frag}};ys.physical={uniforms:rn([ys.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ot},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ot},clearcoatNormalScale:{value:new Ve(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ot},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ot},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ot},sheen:{value:0},sheenColor:{value:new Ye(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ot},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ot},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ot},transmissionSamplerSize:{value:new Ve},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ot},attenuationDistance:{value:0},attenuationColor:{value:new Ye(0)},specularColor:{value:new Ye(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ot},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ot},anisotropyVector:{value:new Ve},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ot}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag};const Th={r:0,b:0,g:0},la=new qn,RP=new tt;function BP(o,e,t,i,a,l,u){const d=new Ye(0);let p=l===!0?0:1,m,A,_=null,b=0,w=null;function E(M){let B=M.isScene===!0?M.background:null;return B&&B.isTexture&&(B=(M.backgroundBlurriness>0?t:e).get(B)),B}function C(M){let B=!1;const D=E(M);D===null?x(d,p):D&&D.isColor&&(x(D,1),B=!0);const G=o.xr.getEnvironmentBlendMode();G==="additive"?i.buffers.color.setClear(0,0,0,1,u):G==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,u),(o.autoClear||B)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil))}function T(M,B){const D=E(B);D&&(D.isCubeTexture||D.mapping===Pf)?(A===void 0&&(A=new lt(new Wn(1,1,1),new zi({name:"BackgroundCubeMaterial",uniforms:Sl(ys.backgroundCube.uniforms),vertexShader:ys.backgroundCube.vertexShader,fragmentShader:ys.backgroundCube.fragmentShader,side:Fi,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),A.geometry.deleteAttribute("uv"),A.onBeforeRender=function(G,U,V){this.matrixWorld.copyPosition(V.matrixWorld)},Object.defineProperty(A.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(A)),la.copy(B.backgroundRotation),la.x*=-1,la.y*=-1,la.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(la.y*=-1,la.z*=-1),A.material.uniforms.envMap.value=D,A.material.uniforms.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,A.material.uniforms.backgroundBlurriness.value=B.backgroundBlurriness,A.material.uniforms.backgroundIntensity.value=B.backgroundIntensity,A.material.uniforms.backgroundRotation.value.setFromMatrix4(RP.makeRotationFromEuler(la)),A.material.toneMapped=vt.getTransfer(D.colorSpace)!==Gt,(_!==D||b!==D.version||w!==o.toneMapping)&&(A.material.needsUpdate=!0,_=D,b=D.version,w=o.toneMapping),A.layers.enableAll(),M.unshift(A,A.geometry,A.material,0,0,null)):D&&D.isTexture&&(m===void 0&&(m=new lt(new Ms(2,2),new zi({name:"BackgroundMaterial",uniforms:Sl(ys.background.uniforms),vertexShader:ys.background.vertexShader,fragmentShader:ys.background.fragmentShader,side:hs,depthTest:!1,depthWrite:!1,fog:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(m)),m.material.uniforms.t2D.value=D,m.material.uniforms.backgroundIntensity.value=B.backgroundIntensity,m.material.toneMapped=vt.getTransfer(D.colorSpace)!==Gt,D.matrixAutoUpdate===!0&&D.updateMatrix(),m.material.uniforms.uvTransform.value.copy(D.matrix),(_!==D||b!==D.version||w!==o.toneMapping)&&(m.material.needsUpdate=!0,_=D,b=D.version,w=o.toneMapping),m.layers.enableAll(),M.unshift(m,m.geometry,m.material,0,0,null))}function x(M,B){M.getRGB(Th,TS(o)),i.buffers.color.setClear(Th.r,Th.g,Th.b,B,u)}function P(){A!==void 0&&(A.geometry.dispose(),A.material.dispose()),m!==void 0&&(m.geometry.dispose(),m.material.dispose())}return{getClearColor:function(){return d},setClearColor:function(M,B=1){d.set(M),p=B,x(d,p)},getClearAlpha:function(){return p},setClearAlpha:function(M){p=M,x(d,p)},render:C,addToRenderList:T,dispose:P}}function PP(o,e){const t=o.getParameter(o.MAX_VERTEX_ATTRIBS),i={},a=b(null);let l=a,u=!1;function d(z,Q,Z,K,s){let H=!1;const y=_(K,Z,Q);l!==y&&(l=y,m(l.object)),H=w(z,K,Z,s),H&&E(z,K,Z,s),s!==null&&e.update(s,o.ELEMENT_ARRAY_BUFFER),(H||u)&&(u=!1,B(z,Q,Z,K),s!==null&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,e.get(s).buffer))}function p(){return o.createVertexArray()}function m(z){return o.bindVertexArray(z)}function A(z){return o.deleteVertexArray(z)}function _(z,Q,Z){const K=Z.wireframe===!0;let s=i[z.id];s===void 0&&(s={},i[z.id]=s);let H=s[Q.id];H===void 0&&(H={},s[Q.id]=H);let y=H[K];return y===void 0&&(y=b(p()),H[K]=y),y}function b(z){const Q=[],Z=[],K=[];for(let s=0;s<t;s++)Q[s]=0,Z[s]=0,K[s]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:Q,enabledAttributes:Z,attributeDivisors:K,object:z,attributes:{},index:null}}function w(z,Q,Z,K){const s=l.attributes,H=Q.attributes;let y=0;const ee=Z.getAttributes();for(const I in ee)if(ee[I].location>=0){const Ae=s[I];let N=H[I];if(N===void 0&&(I==="instanceMatrix"&&z.instanceMatrix&&(N=z.instanceMatrix),I==="instanceColor"&&z.instanceColor&&(N=z.instanceColor)),Ae===void 0||Ae.attribute!==N||N&&Ae.data!==N.data)return!0;y++}return l.attributesNum!==y||l.index!==K}function E(z,Q,Z,K){const s={},H=Q.attributes;let y=0;const ee=Z.getAttributes();for(const I in ee)if(ee[I].location>=0){let Ae=H[I];Ae===void 0&&(I==="instanceMatrix"&&z.instanceMatrix&&(Ae=z.instanceMatrix),I==="instanceColor"&&z.instanceColor&&(Ae=z.instanceColor));const N={};N.attribute=Ae,Ae&&Ae.data&&(N.data=Ae.data),s[I]=N,y++}l.attributes=s,l.attributesNum=y,l.index=K}function C(){const z=l.newAttributes;for(let Q=0,Z=z.length;Q<Z;Q++)z[Q]=0}function T(z){x(z,0)}function x(z,Q){const Z=l.newAttributes,K=l.enabledAttributes,s=l.attributeDivisors;Z[z]=1,K[z]===0&&(o.enableVertexAttribArray(z),K[z]=1),s[z]!==Q&&(o.vertexAttribDivisor(z,Q),s[z]=Q)}function P(){const z=l.newAttributes,Q=l.enabledAttributes;for(let Z=0,K=Q.length;Z<K;Z++)Q[Z]!==z[Z]&&(o.disableVertexAttribArray(Z),Q[Z]=0)}function M(z,Q,Z,K,s,H,y){y===!0?o.vertexAttribIPointer(z,Q,Z,s,H):o.vertexAttribPointer(z,Q,Z,K,s,H)}function B(z,Q,Z,K){C();const s=K.attributes,H=Z.getAttributes(),y=Q.defaultAttributeValues;for(const ee in H){const I=H[ee];if(I.location>=0){let re=s[ee];if(re===void 0&&(ee==="instanceMatrix"&&z.instanceMatrix&&(re=z.instanceMatrix),ee==="instanceColor"&&z.instanceColor&&(re=z.instanceColor)),re!==void 0){const Ae=re.normalized,N=re.itemSize,n=e.get(re);if(n===void 0)continue;const r=n.buffer,c=n.type,h=n.bytesPerElement,f=c===o.INT||c===o.UNSIGNED_INT||re.gpuType===Lf;if(re.isInterleavedBufferAttribute){const g=re.data,v=g.stride,S=re.offset;if(g.isInstancedInterleavedBuffer){for(let R=0;R<I.locationSize;R++)x(I.location+R,g.meshPerAttribute);z.isInstancedMesh!==!0&&K._maxInstanceCount===void 0&&(K._maxInstanceCount=g.meshPerAttribute*g.count)}else for(let R=0;R<I.locationSize;R++)T(I.location+R);o.bindBuffer(o.ARRAY_BUFFER,r);for(let R=0;R<I.locationSize;R++)M(I.location+R,N/I.locationSize,c,Ae,v*h,(S+N/I.locationSize*R)*h,f)}else{if(re.isInstancedBufferAttribute){for(let g=0;g<I.locationSize;g++)x(I.location+g,re.meshPerAttribute);z.isInstancedMesh!==!0&&K._maxInstanceCount===void 0&&(K._maxInstanceCount=re.meshPerAttribute*re.count)}else for(let g=0;g<I.locationSize;g++)T(I.location+g);o.bindBuffer(o.ARRAY_BUFFER,r);for(let g=0;g<I.locationSize;g++)M(I.location+g,N/I.locationSize,c,Ae,N*h,N/I.locationSize*g*h,f)}}else if(y!==void 0){const Ae=y[ee];if(Ae!==void 0)switch(Ae.length){case 2:o.vertexAttrib2fv(I.location,Ae);break;case 3:o.vertexAttrib3fv(I.location,Ae);break;case 4:o.vertexAttrib4fv(I.location,Ae);break;default:o.vertexAttrib1fv(I.location,Ae)}}}}P()}function D(){V();for(const z in i){const Q=i[z];for(const Z in Q){const K=Q[Z];for(const s in K)A(K[s].object),delete K[s];delete Q[Z]}delete i[z]}}function G(z){if(i[z.id]===void 0)return;const Q=i[z.id];for(const Z in Q){const K=Q[Z];for(const s in K)A(K[s].object),delete K[s];delete Q[Z]}delete i[z.id]}function U(z){for(const Q in i){const Z=i[Q];if(Z[z.id]===void 0)continue;const K=Z[z.id];for(const s in K)A(K[s].object),delete K[s];delete Z[z.id]}}function V(){k(),u=!0,l!==a&&(l=a,m(l.object))}function k(){a.geometry=null,a.program=null,a.wireframe=!1}return{setup:d,reset:V,resetDefaultState:k,dispose:D,releaseStatesOfGeometry:G,releaseStatesOfProgram:U,initAttributes:C,enableAttribute:T,disableUnusedAttributes:P}}function LP(o,e,t){let i;function a(m){i=m}function l(m,A){o.drawArrays(i,m,A),t.update(A,i,1)}function u(m,A,_){_!==0&&(o.drawArraysInstanced(i,m,A,_),t.update(A,i,_))}function d(m,A,_){if(_===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,m,0,A,0,_);let w=0;for(let E=0;E<_;E++)w+=A[E];t.update(w,i,1)}function p(m,A,_,b){if(_===0)return;const w=e.get("WEBGL_multi_draw");if(w===null)for(let E=0;E<m.length;E++)u(m[E],A[E],b[E]);else{w.multiDrawArraysInstancedWEBGL(i,m,0,A,0,b,0,_);let E=0;for(let C=0;C<_;C++)E+=A[C]*b[C];t.update(E,i,1)}}this.setMode=a,this.render=l,this.renderInstances=u,this.renderMultiDraw=d,this.renderMultiDrawInstances=p}function DP(o,e,t,i){let a;function l(){if(a!==void 0)return a;if(e.has("EXT_texture_filter_anisotropic")===!0){const U=e.get("EXT_texture_filter_anisotropic");a=o.getParameter(U.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else a=0;return a}function u(U){return!(U!==Xt&&i.convert(U)!==o.getParameter(o.IMPLEMENTATION_COLOR_READ_FORMAT))}function d(U){const V=U===hi&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(U!==ui&&i.convert(U)!==o.getParameter(o.IMPLEMENTATION_COLOR_READ_TYPE)&&U!==oi&&!V)}function p(U){if(U==="highp"){if(o.getShaderPrecisionFormat(o.VERTEX_SHADER,o.HIGH_FLOAT).precision>0&&o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision>0)return"highp";U="mediump"}return U==="mediump"&&o.getShaderPrecisionFormat(o.VERTEX_SHADER,o.MEDIUM_FLOAT).precision>0&&o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let m=t.precision!==void 0?t.precision:"highp";const A=p(m);A!==m&&(console.warn("THREE.WebGLRenderer:",m,"not supported, using",A,"instead."),m=A);const _=t.logarithmicDepthBuffer===!0,b=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),w=o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS),E=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS),C=o.getParameter(o.MAX_TEXTURE_SIZE),T=o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE),x=o.getParameter(o.MAX_VERTEX_ATTRIBS),P=o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS),M=o.getParameter(o.MAX_VARYING_VECTORS),B=o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS),D=E>0,G=o.getParameter(o.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:l,getMaxPrecision:p,textureFormatReadable:u,textureTypeReadable:d,precision:m,logarithmicDepthBuffer:_,reverseDepthBuffer:b,maxTextures:w,maxVertexTextures:E,maxTextureSize:C,maxCubemapSize:T,maxAttributes:x,maxVertexUniforms:P,maxVaryings:M,maxFragmentUniforms:B,vertexTextures:D,maxSamples:G}}function NP(o){const e=this;let t=null,i=0,a=!1,l=!1;const u=new _a,d=new ot,p={value:null,needsUpdate:!1};this.uniform=p,this.numPlanes=0,this.numIntersection=0,this.init=function(_,b){const w=_.length!==0||b||i!==0||a;return a=b,i=_.length,w},this.beginShadows=function(){l=!0,A(null)},this.endShadows=function(){l=!1},this.setGlobalState=function(_,b){t=A(_,b,0)},this.setState=function(_,b,w){const E=_.clippingPlanes,C=_.clipIntersection,T=_.clipShadows,x=o.get(_);if(!a||E===null||E.length===0||l&&!T)l?A(null):m();else{const P=l?0:i,M=P*4;let B=x.clippingState||null;p.value=B,B=A(E,b,M,w);for(let D=0;D!==M;++D)B[D]=t[D];x.clippingState=B,this.numIntersection=C?this.numPlanes:0,this.numPlanes+=P}};function m(){p.value!==t&&(p.value=t,p.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function A(_,b,w,E){const C=_!==null?_.length:0;let T=null;if(C!==0){if(T=p.value,E!==!0||T===null){const x=w+C*4,P=b.matrixWorldInverse;d.getNormalMatrix(P),(T===null||T.length<x)&&(T=new Float32Array(x));for(let M=0,B=w;M!==C;++M,B+=4)u.copy(_[M]).applyMatrix4(P,d),u.normal.toArray(T,B),T[B+3]=u.constant}p.value=T,p.needsUpdate=!0}return e.numPlanes=C,e.numIntersection=0,T}}function OP(o){let e=new WeakMap;function t(u,d){return d===bu?u.mapping=ja:d===Zg&&(u.mapping=Al),u}function i(u){if(u&&u.isTexture){const d=u.mapping;if(d===bu||d===Zg)if(e.has(u)){const p=e.get(u).texture;return t(p,u.mapping)}else{const p=u.image;if(p&&p.height>0){const m=new k0(p.height);return m.fromEquirectangularTexture(o,u),e.set(u,m),u.addEventListener("dispose",a),t(m.texture,u.mapping)}else return null}}return u}function a(u){const d=u.target;d.removeEventListener("dispose",a);const p=e.get(d);p!==void 0&&(e.delete(d),p.dispose())}function l(){e=new WeakMap}return{get:i,dispose:l}}const Yo=4,$y=[.125,.215,.35,.446,.526,.582],Ma=20,Dp=new Kr,zy=new Ye;let Np=null,Op=0,kp=0,Up=!1;const ya=(1+Math.sqrt(5))/2,bo=1/ya,Gy=[new se(-ya,bo,0),new se(ya,bo,0),new se(-bo,0,ya),new se(bo,0,ya),new se(0,ya,-bo),new se(0,ya,bo),new se(-1,1,-1),new se(1,1,-1),new se(-1,1,1),new se(1,1,1)];class Hy{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,a=100){Np=this._renderer.getRenderTarget(),Op=this._renderer.getActiveCubeFace(),kp=this._renderer.getActiveMipmapLevel(),Up=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,a,l),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=jy(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Qy(),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(Np,Op,kp),this._renderer.xr.enabled=Up,e.scissorTest=!1,Ih(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ja||e.mapping===Al?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Np=this._renderer.getRenderTarget(),Op=this._renderer.getActiveCubeFace(),kp=this._renderer.getActiveMipmapLevel(),Up=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:wt,minFilter:wt,generateMipmaps:!1,type:hi,format:Xt,colorSpace:qt,depthBuffer:!1},a=Vy(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Vy(e,t,i);const{_lodMax:l}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=kP(l)),this._blurMaterial=UP(l,e,t)}return a}_compileMaterial(e){const t=new lt(this._lodPlanes[0],e);this._renderer.compile(t,Dp)}_sceneToCubeUV(e,t,i,a){const d=new _i(90,1,t,i),p=[1,-1,1,1,1,1],m=[1,1,1,-1,-1,-1],A=this._renderer,_=A.autoClear,b=A.toneMapping;A.getClearColor(zy),A.toneMapping=Ss,A.autoClear=!1;const w=new Pi({name:"PMREM.Background",side:Fi,depthWrite:!1,depthTest:!1}),E=new lt(new Wn,w);let C=!1;const T=e.background;T?T.isColor&&(w.color.copy(T),e.background=null,C=!0):(w.color.copy(zy),C=!0);for(let x=0;x<6;x++){const P=x%3;P===0?(d.up.set(0,p[x],0),d.lookAt(m[x],0,0)):P===1?(d.up.set(0,0,p[x]),d.lookAt(0,m[x],0)):(d.up.set(0,p[x],0),d.lookAt(0,0,m[x]));const M=this._cubeSize;Ih(a,P*M,x>2?M:0,M,M),A.setRenderTarget(a),C&&A.render(E,d),A.render(e,d)}E.geometry.dispose(),E.material.dispose(),A.toneMapping=b,A.autoClear=_,e.background=T}_textureToCubeUV(e,t){const i=this._renderer,a=e.mapping===ja||e.mapping===Al;a?(this._cubemapMaterial===null&&(this._cubemapMaterial=jy()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Qy());const l=a?this._cubemapMaterial:this._equirectMaterial,u=new lt(this._lodPlanes[0],l),d=l.uniforms;d.envMap.value=e;const p=this._cubeSize;Ih(t,0,0,3*p,2*p),i.setRenderTarget(t),i.render(u,Dp)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const a=this._lodPlanes.length;for(let l=1;l<a;l++){const u=Math.sqrt(this._sigmas[l]*this._sigmas[l]-this._sigmas[l-1]*this._sigmas[l-1]),d=Gy[(a-l-1)%Gy.length];this._blur(e,l-1,l,u,d)}t.autoClear=i}_blur(e,t,i,a,l){const u=this._pingPongRenderTarget;this._halfBlur(e,u,t,i,a,"latitudinal",l),this._halfBlur(u,e,i,i,a,"longitudinal",l)}_halfBlur(e,t,i,a,l,u,d){const p=this._renderer,m=this._blurMaterial;u!=="latitudinal"&&u!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const A=3,_=new lt(this._lodPlanes[a],m),b=m.uniforms,w=this._sizeLods[i]-1,E=isFinite(l)?Math.PI/(2*w):2*Math.PI/(2*Ma-1),C=l/E,T=isFinite(l)?1+Math.floor(A*C):Ma;T>Ma&&console.warn(`sigmaRadians, ${l}, is too large and will clip, as it requested ${T} samples when the maximum is set to ${Ma}`);const x=[];let P=0;for(let U=0;U<Ma;++U){const V=U/C,k=Math.exp(-V*V/2);x.push(k),U===0?P+=k:U<T&&(P+=2*k)}for(let U=0;U<x.length;U++)x[U]=x[U]/P;b.envMap.value=e.texture,b.samples.value=T,b.weights.value=x,b.latitudinal.value=u==="latitudinal",d&&(b.poleAxis.value=d);const{_lodMax:M}=this;b.dTheta.value=E,b.mipInt.value=M-i;const B=this._sizeLods[a],D=3*B*(a>M-Yo?a-M+Yo:0),G=4*(this._cubeSize-B);Ih(t,D,G,3*B,2*B),p.setRenderTarget(t),p.render(_,Dp)}}function kP(o){const e=[],t=[],i=[];let a=o;const l=o-Yo+1+$y.length;for(let u=0;u<l;u++){const d=Math.pow(2,a);t.push(d);let p=1/d;u>o-Yo?p=$y[u-o+Yo-1]:u===0&&(p=0),i.push(p);const m=1/(d-2),A=-m,_=1+m,b=[A,A,_,A,_,_,A,A,_,_,A,_],w=6,E=6,C=3,T=2,x=1,P=new Float32Array(C*E*w),M=new Float32Array(T*E*w),B=new Float32Array(x*E*w);for(let G=0;G<w;G++){const U=G%3*2/3-1,V=G>2?0:-1,k=[U,V,0,U+2/3,V,0,U+2/3,V+1,0,U,V,0,U+2/3,V+1,0,U,V+1,0];P.set(k,C*E*G),M.set(b,T*E*G);const z=[G,G,G,G,G,G];B.set(z,x*E*G)}const D=new Di;D.setAttribute("position",new Vt(P,C)),D.setAttribute("uv",new Vt(M,T)),D.setAttribute("faceIndex",new Vt(B,x)),e.push(D),a>Yo&&a--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function Vy(o,e,t){const i=new dn(o,e,t);return i.texture.mapping=Pf,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Ih(o,e,t,i,a){o.viewport.set(e,t,i,a),o.scissor.set(e,t,i,a)}function UP(o,e,t){const i=new Float32Array(Ma),a=new se(0,1,0);return new zi({name:"SphericalGaussianBlur",defines:{n:Ma,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${o}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:W0(),fragmentShader:`
|
|
3647
|
+
}`,ht={alphahash_fragment:KR,alphahash_pars_fragment:JR,alphamap_fragment:ZR,alphamap_pars_fragment:e2,alphatest_fragment:t2,alphatest_pars_fragment:i2,aomap_fragment:n2,aomap_pars_fragment:s2,batching_pars_vertex:r2,batching_vertex:a2,begin_vertex:o2,beginnormal_vertex:l2,bsdfs:c2,iridescence_fragment:u2,bumpmap_pars_fragment:h2,clipping_planes_fragment:d2,clipping_planes_pars_fragment:f2,clipping_planes_pars_vertex:p2,clipping_planes_vertex:m2,color_fragment:g2,color_pars_fragment:A2,color_pars_vertex:_2,color_vertex:y2,common:b2,cube_uv_reflection_fragment:v2,defaultnormal_vertex:w2,displacementmap_pars_vertex:E2,displacementmap_vertex:x2,emissivemap_fragment:S2,emissivemap_pars_fragment:C2,colorspace_fragment:T2,colorspace_pars_fragment:I2,envmap_fragment:M2,envmap_common_pars_fragment:R2,envmap_pars_fragment:B2,envmap_pars_vertex:P2,envmap_physical_pars_fragment:H2,envmap_vertex:L2,fog_vertex:D2,fog_pars_vertex:N2,fog_fragment:O2,fog_pars_fragment:k2,gradientmap_pars_fragment:U2,lightmap_pars_fragment:F2,lights_lambert_fragment:$2,lights_lambert_pars_fragment:z2,lights_pars_begin:G2,lights_toon_fragment:V2,lights_toon_pars_fragment:Q2,lights_phong_fragment:j2,lights_phong_pars_fragment:q2,lights_physical_fragment:W2,lights_physical_pars_fragment:Y2,lights_fragment_begin:X2,lights_fragment_maps:K2,lights_fragment_end:J2,logdepthbuf_fragment:Z2,logdepthbuf_pars_fragment:eB,logdepthbuf_pars_vertex:tB,logdepthbuf_vertex:iB,map_fragment:nB,map_pars_fragment:sB,map_particle_fragment:rB,map_particle_pars_fragment:aB,metalnessmap_fragment:oB,metalnessmap_pars_fragment:lB,morphinstance_vertex:cB,morphcolor_vertex:uB,morphnormal_vertex:hB,morphtarget_pars_vertex:dB,morphtarget_vertex:fB,normal_fragment_begin:pB,normal_fragment_maps:mB,normal_pars_fragment:gB,normal_pars_vertex:AB,normal_vertex:_B,normalmap_pars_fragment:yB,clearcoat_normal_fragment_begin:bB,clearcoat_normal_fragment_maps:vB,clearcoat_pars_fragment:wB,iridescence_pars_fragment:EB,opaque_fragment:xB,packing:SB,premultiplied_alpha_fragment:CB,project_vertex:TB,dithering_fragment:IB,dithering_pars_fragment:MB,roughnessmap_fragment:RB,roughnessmap_pars_fragment:BB,shadowmap_pars_fragment:PB,shadowmap_pars_vertex:LB,shadowmap_vertex:DB,shadowmask_pars_fragment:NB,skinbase_vertex:OB,skinning_pars_vertex:kB,skinning_vertex:UB,skinnormal_vertex:FB,specularmap_fragment:$B,specularmap_pars_fragment:zB,tonemapping_fragment:GB,tonemapping_pars_fragment:HB,transmission_fragment:VB,transmission_pars_fragment:QB,uv_pars_fragment:jB,uv_pars_vertex:qB,uv_vertex:WB,worldpos_vertex:YB,background_vert:XB,background_frag:KB,backgroundCube_vert:JB,backgroundCube_frag:ZB,cube_vert:eP,cube_frag:tP,depth_vert:iP,depth_frag:nP,distanceRGBA_vert:sP,distanceRGBA_frag:rP,equirect_vert:aP,equirect_frag:oP,linedashed_vert:lP,linedashed_frag:cP,meshbasic_vert:uP,meshbasic_frag:hP,meshlambert_vert:dP,meshlambert_frag:fP,meshmatcap_vert:pP,meshmatcap_frag:mP,meshnormal_vert:gP,meshnormal_frag:AP,meshphong_vert:_P,meshphong_frag:yP,meshphysical_vert:bP,meshphysical_frag:vP,meshtoon_vert:wP,meshtoon_frag:EP,points_vert:xP,points_frag:SP,shadow_vert:CP,shadow_frag:TP,sprite_vert:IP,sprite_frag:MP},Fe={common:{diffuse:{value:new Ye(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ot},alphaMap:{value:null},alphaMapTransform:{value:new ot},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ot}},envmap:{envMap:{value:null},envMapRotation:{value:new ot},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ot}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ot}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ot},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ot},normalScale:{value:new Ve(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ot},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ot}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ot}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ot}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ye(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 Ye(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ot},alphaTest:{value:0},uvTransform:{value:new ot}},sprite:{diffuse:{value:new Ye(16777215)},opacity:{value:1},center:{value:new Ve(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ot},alphaMap:{value:null},alphaMapTransform:{value:new ot},alphaTest:{value:0}}},ys={basic:{uniforms:rn([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:ht.meshbasic_vert,fragmentShader:ht.meshbasic_frag},lambert:{uniforms:rn([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new Ye(0)}}]),vertexShader:ht.meshlambert_vert,fragmentShader:ht.meshlambert_frag},phong:{uniforms:rn([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new Ye(0)},specular:{value:new Ye(1118481)},shininess:{value:30}}]),vertexShader:ht.meshphong_vert,fragmentShader:ht.meshphong_frag},standard:{uniforms:rn([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new Ye(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag},toon:{uniforms:rn([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new Ye(0)}}]),vertexShader:ht.meshtoon_vert,fragmentShader:ht.meshtoon_frag},matcap:{uniforms:rn([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:ht.meshmatcap_vert,fragmentShader:ht.meshmatcap_frag},points:{uniforms:rn([Fe.points,Fe.fog]),vertexShader:ht.points_vert,fragmentShader:ht.points_frag},dashed:{uniforms:rn([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ht.linedashed_vert,fragmentShader:ht.linedashed_frag},depth:{uniforms:rn([Fe.common,Fe.displacementmap]),vertexShader:ht.depth_vert,fragmentShader:ht.depth_frag},normal:{uniforms:rn([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:ht.meshnormal_vert,fragmentShader:ht.meshnormal_frag},sprite:{uniforms:rn([Fe.sprite,Fe.fog]),vertexShader:ht.sprite_vert,fragmentShader:ht.sprite_frag},background:{uniforms:{uvTransform:{value:new ot},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ht.background_vert,fragmentShader:ht.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ot}},vertexShader:ht.backgroundCube_vert,fragmentShader:ht.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ht.cube_vert,fragmentShader:ht.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ht.equirect_vert,fragmentShader:ht.equirect_frag},distanceRGBA:{uniforms:rn([Fe.common,Fe.displacementmap,{referencePosition:{value:new se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ht.distanceRGBA_vert,fragmentShader:ht.distanceRGBA_frag},shadow:{uniforms:rn([Fe.lights,Fe.fog,{color:{value:new Ye(0)},opacity:{value:1}}]),vertexShader:ht.shadow_vert,fragmentShader:ht.shadow_frag}};ys.physical={uniforms:rn([ys.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ot},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ot},clearcoatNormalScale:{value:new Ve(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ot},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ot},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ot},sheen:{value:0},sheenColor:{value:new Ye(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ot},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ot},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ot},transmissionSamplerSize:{value:new Ve},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ot},attenuationDistance:{value:0},attenuationColor:{value:new Ye(0)},specularColor:{value:new Ye(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ot},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ot},anisotropyVector:{value:new Ve},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ot}}]),vertexShader:ht.meshphysical_vert,fragmentShader:ht.meshphysical_frag};const Th={r:0,b:0,g:0},la=new qn,RP=new tt;function BP(o,e,t,i,a,l,u){const d=new Ye(0);let p=l===!0?0:1,m,A,_=null,b=0,w=null;function E(M){let B=M.isScene===!0?M.background:null;return B&&B.isTexture&&(B=(M.backgroundBlurriness>0?t:e).get(B)),B}function C(M){let B=!1;const D=E(M);D===null?x(d,p):D&&D.isColor&&(x(D,1),B=!0);const G=o.xr.getEnvironmentBlendMode();G==="additive"?i.buffers.color.setClear(0,0,0,1,u):G==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,u),(o.autoClear||B)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil))}function T(M,B){const D=E(B);D&&(D.isCubeTexture||D.mapping===Pf)?(A===void 0&&(A=new lt(new Wn(1,1,1),new zi({name:"BackgroundCubeMaterial",uniforms:Sl(ys.backgroundCube.uniforms),vertexShader:ys.backgroundCube.vertexShader,fragmentShader:ys.backgroundCube.fragmentShader,side:Fi,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),A.geometry.deleteAttribute("uv"),A.onBeforeRender=function(G,U,V){this.matrixWorld.copyPosition(V.matrixWorld)},Object.defineProperty(A.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(A)),la.copy(B.backgroundRotation),la.x*=-1,la.y*=-1,la.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(la.y*=-1,la.z*=-1),A.material.uniforms.envMap.value=D,A.material.uniforms.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,A.material.uniforms.backgroundBlurriness.value=B.backgroundBlurriness,A.material.uniforms.backgroundIntensity.value=B.backgroundIntensity,A.material.uniforms.backgroundRotation.value.setFromMatrix4(RP.makeRotationFromEuler(la)),A.material.toneMapped=wt.getTransfer(D.colorSpace)!==Gt,(_!==D||b!==D.version||w!==o.toneMapping)&&(A.material.needsUpdate=!0,_=D,b=D.version,w=o.toneMapping),A.layers.enableAll(),M.unshift(A,A.geometry,A.material,0,0,null)):D&&D.isTexture&&(m===void 0&&(m=new lt(new Ms(2,2),new zi({name:"BackgroundMaterial",uniforms:Sl(ys.background.uniforms),vertexShader:ys.background.vertexShader,fragmentShader:ys.background.fragmentShader,side:hs,depthTest:!1,depthWrite:!1,fog:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(m)),m.material.uniforms.t2D.value=D,m.material.uniforms.backgroundIntensity.value=B.backgroundIntensity,m.material.toneMapped=wt.getTransfer(D.colorSpace)!==Gt,D.matrixAutoUpdate===!0&&D.updateMatrix(),m.material.uniforms.uvTransform.value.copy(D.matrix),(_!==D||b!==D.version||w!==o.toneMapping)&&(m.material.needsUpdate=!0,_=D,b=D.version,w=o.toneMapping),m.layers.enableAll(),M.unshift(m,m.geometry,m.material,0,0,null))}function x(M,B){M.getRGB(Th,TS(o)),i.buffers.color.setClear(Th.r,Th.g,Th.b,B,u)}function P(){A!==void 0&&(A.geometry.dispose(),A.material.dispose()),m!==void 0&&(m.geometry.dispose(),m.material.dispose())}return{getClearColor:function(){return d},setClearColor:function(M,B=1){d.set(M),p=B,x(d,p)},getClearAlpha:function(){return p},setClearAlpha:function(M){p=M,x(d,p)},render:C,addToRenderList:T,dispose:P}}function PP(o,e){const t=o.getParameter(o.MAX_VERTEX_ATTRIBS),i={},a=b(null);let l=a,u=!1;function d(z,Q,Z,K,s){let H=!1;const y=_(K,Z,Q);l!==y&&(l=y,m(l.object)),H=w(z,K,Z,s),H&&E(z,K,Z,s),s!==null&&e.update(s,o.ELEMENT_ARRAY_BUFFER),(H||u)&&(u=!1,B(z,Q,Z,K),s!==null&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,e.get(s).buffer))}function p(){return o.createVertexArray()}function m(z){return o.bindVertexArray(z)}function A(z){return o.deleteVertexArray(z)}function _(z,Q,Z){const K=Z.wireframe===!0;let s=i[z.id];s===void 0&&(s={},i[z.id]=s);let H=s[Q.id];H===void 0&&(H={},s[Q.id]=H);let y=H[K];return y===void 0&&(y=b(p()),H[K]=y),y}function b(z){const Q=[],Z=[],K=[];for(let s=0;s<t;s++)Q[s]=0,Z[s]=0,K[s]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:Q,enabledAttributes:Z,attributeDivisors:K,object:z,attributes:{},index:null}}function w(z,Q,Z,K){const s=l.attributes,H=Q.attributes;let y=0;const ee=Z.getAttributes();for(const I in ee)if(ee[I].location>=0){const Ae=s[I];let N=H[I];if(N===void 0&&(I==="instanceMatrix"&&z.instanceMatrix&&(N=z.instanceMatrix),I==="instanceColor"&&z.instanceColor&&(N=z.instanceColor)),Ae===void 0||Ae.attribute!==N||N&&Ae.data!==N.data)return!0;y++}return l.attributesNum!==y||l.index!==K}function E(z,Q,Z,K){const s={},H=Q.attributes;let y=0;const ee=Z.getAttributes();for(const I in ee)if(ee[I].location>=0){let Ae=H[I];Ae===void 0&&(I==="instanceMatrix"&&z.instanceMatrix&&(Ae=z.instanceMatrix),I==="instanceColor"&&z.instanceColor&&(Ae=z.instanceColor));const N={};N.attribute=Ae,Ae&&Ae.data&&(N.data=Ae.data),s[I]=N,y++}l.attributes=s,l.attributesNum=y,l.index=K}function C(){const z=l.newAttributes;for(let Q=0,Z=z.length;Q<Z;Q++)z[Q]=0}function T(z){x(z,0)}function x(z,Q){const Z=l.newAttributes,K=l.enabledAttributes,s=l.attributeDivisors;Z[z]=1,K[z]===0&&(o.enableVertexAttribArray(z),K[z]=1),s[z]!==Q&&(o.vertexAttribDivisor(z,Q),s[z]=Q)}function P(){const z=l.newAttributes,Q=l.enabledAttributes;for(let Z=0,K=Q.length;Z<K;Z++)Q[Z]!==z[Z]&&(o.disableVertexAttribArray(Z),Q[Z]=0)}function M(z,Q,Z,K,s,H,y){y===!0?o.vertexAttribIPointer(z,Q,Z,s,H):o.vertexAttribPointer(z,Q,Z,K,s,H)}function B(z,Q,Z,K){C();const s=K.attributes,H=Z.getAttributes(),y=Q.defaultAttributeValues;for(const ee in H){const I=H[ee];if(I.location>=0){let re=s[ee];if(re===void 0&&(ee==="instanceMatrix"&&z.instanceMatrix&&(re=z.instanceMatrix),ee==="instanceColor"&&z.instanceColor&&(re=z.instanceColor)),re!==void 0){const Ae=re.normalized,N=re.itemSize,n=e.get(re);if(n===void 0)continue;const r=n.buffer,c=n.type,h=n.bytesPerElement,f=c===o.INT||c===o.UNSIGNED_INT||re.gpuType===Lf;if(re.isInterleavedBufferAttribute){const g=re.data,v=g.stride,S=re.offset;if(g.isInstancedInterleavedBuffer){for(let R=0;R<I.locationSize;R++)x(I.location+R,g.meshPerAttribute);z.isInstancedMesh!==!0&&K._maxInstanceCount===void 0&&(K._maxInstanceCount=g.meshPerAttribute*g.count)}else for(let R=0;R<I.locationSize;R++)T(I.location+R);o.bindBuffer(o.ARRAY_BUFFER,r);for(let R=0;R<I.locationSize;R++)M(I.location+R,N/I.locationSize,c,Ae,v*h,(S+N/I.locationSize*R)*h,f)}else{if(re.isInstancedBufferAttribute){for(let g=0;g<I.locationSize;g++)x(I.location+g,re.meshPerAttribute);z.isInstancedMesh!==!0&&K._maxInstanceCount===void 0&&(K._maxInstanceCount=re.meshPerAttribute*re.count)}else for(let g=0;g<I.locationSize;g++)T(I.location+g);o.bindBuffer(o.ARRAY_BUFFER,r);for(let g=0;g<I.locationSize;g++)M(I.location+g,N/I.locationSize,c,Ae,N*h,N/I.locationSize*g*h,f)}}else if(y!==void 0){const Ae=y[ee];if(Ae!==void 0)switch(Ae.length){case 2:o.vertexAttrib2fv(I.location,Ae);break;case 3:o.vertexAttrib3fv(I.location,Ae);break;case 4:o.vertexAttrib4fv(I.location,Ae);break;default:o.vertexAttrib1fv(I.location,Ae)}}}}P()}function D(){V();for(const z in i){const Q=i[z];for(const Z in Q){const K=Q[Z];for(const s in K)A(K[s].object),delete K[s];delete Q[Z]}delete i[z]}}function G(z){if(i[z.id]===void 0)return;const Q=i[z.id];for(const Z in Q){const K=Q[Z];for(const s in K)A(K[s].object),delete K[s];delete Q[Z]}delete i[z.id]}function U(z){for(const Q in i){const Z=i[Q];if(Z[z.id]===void 0)continue;const K=Z[z.id];for(const s in K)A(K[s].object),delete K[s];delete Z[z.id]}}function V(){k(),u=!0,l!==a&&(l=a,m(l.object))}function k(){a.geometry=null,a.program=null,a.wireframe=!1}return{setup:d,reset:V,resetDefaultState:k,dispose:D,releaseStatesOfGeometry:G,releaseStatesOfProgram:U,initAttributes:C,enableAttribute:T,disableUnusedAttributes:P}}function LP(o,e,t){let i;function a(m){i=m}function l(m,A){o.drawArrays(i,m,A),t.update(A,i,1)}function u(m,A,_){_!==0&&(o.drawArraysInstanced(i,m,A,_),t.update(A,i,_))}function d(m,A,_){if(_===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,m,0,A,0,_);let w=0;for(let E=0;E<_;E++)w+=A[E];t.update(w,i,1)}function p(m,A,_,b){if(_===0)return;const w=e.get("WEBGL_multi_draw");if(w===null)for(let E=0;E<m.length;E++)u(m[E],A[E],b[E]);else{w.multiDrawArraysInstancedWEBGL(i,m,0,A,0,b,0,_);let E=0;for(let C=0;C<_;C++)E+=A[C]*b[C];t.update(E,i,1)}}this.setMode=a,this.render=l,this.renderInstances=u,this.renderMultiDraw=d,this.renderMultiDrawInstances=p}function DP(o,e,t,i){let a;function l(){if(a!==void 0)return a;if(e.has("EXT_texture_filter_anisotropic")===!0){const U=e.get("EXT_texture_filter_anisotropic");a=o.getParameter(U.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else a=0;return a}function u(U){return!(U!==Xt&&i.convert(U)!==o.getParameter(o.IMPLEMENTATION_COLOR_READ_FORMAT))}function d(U){const V=U===hi&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(U!==ui&&i.convert(U)!==o.getParameter(o.IMPLEMENTATION_COLOR_READ_TYPE)&&U!==oi&&!V)}function p(U){if(U==="highp"){if(o.getShaderPrecisionFormat(o.VERTEX_SHADER,o.HIGH_FLOAT).precision>0&&o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision>0)return"highp";U="mediump"}return U==="mediump"&&o.getShaderPrecisionFormat(o.VERTEX_SHADER,o.MEDIUM_FLOAT).precision>0&&o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let m=t.precision!==void 0?t.precision:"highp";const A=p(m);A!==m&&(console.warn("THREE.WebGLRenderer:",m,"not supported, using",A,"instead."),m=A);const _=t.logarithmicDepthBuffer===!0,b=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),w=o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS),E=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS),C=o.getParameter(o.MAX_TEXTURE_SIZE),T=o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE),x=o.getParameter(o.MAX_VERTEX_ATTRIBS),P=o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS),M=o.getParameter(o.MAX_VARYING_VECTORS),B=o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS),D=E>0,G=o.getParameter(o.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:l,getMaxPrecision:p,textureFormatReadable:u,textureTypeReadable:d,precision:m,logarithmicDepthBuffer:_,reverseDepthBuffer:b,maxTextures:w,maxVertexTextures:E,maxTextureSize:C,maxCubemapSize:T,maxAttributes:x,maxVertexUniforms:P,maxVaryings:M,maxFragmentUniforms:B,vertexTextures:D,maxSamples:G}}function NP(o){const e=this;let t=null,i=0,a=!1,l=!1;const u=new _a,d=new ot,p={value:null,needsUpdate:!1};this.uniform=p,this.numPlanes=0,this.numIntersection=0,this.init=function(_,b){const w=_.length!==0||b||i!==0||a;return a=b,i=_.length,w},this.beginShadows=function(){l=!0,A(null)},this.endShadows=function(){l=!1},this.setGlobalState=function(_,b){t=A(_,b,0)},this.setState=function(_,b,w){const E=_.clippingPlanes,C=_.clipIntersection,T=_.clipShadows,x=o.get(_);if(!a||E===null||E.length===0||l&&!T)l?A(null):m();else{const P=l?0:i,M=P*4;let B=x.clippingState||null;p.value=B,B=A(E,b,M,w);for(let D=0;D!==M;++D)B[D]=t[D];x.clippingState=B,this.numIntersection=C?this.numPlanes:0,this.numPlanes+=P}};function m(){p.value!==t&&(p.value=t,p.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function A(_,b,w,E){const C=_!==null?_.length:0;let T=null;if(C!==0){if(T=p.value,E!==!0||T===null){const x=w+C*4,P=b.matrixWorldInverse;d.getNormalMatrix(P),(T===null||T.length<x)&&(T=new Float32Array(x));for(let M=0,B=w;M!==C;++M,B+=4)u.copy(_[M]).applyMatrix4(P,d),u.normal.toArray(T,B),T[B+3]=u.constant}p.value=T,p.needsUpdate=!0}return e.numPlanes=C,e.numIntersection=0,T}}function OP(o){let e=new WeakMap;function t(u,d){return d===bu?u.mapping=ja:d===Zg&&(u.mapping=Al),u}function i(u){if(u&&u.isTexture){const d=u.mapping;if(d===bu||d===Zg)if(e.has(u)){const p=e.get(u).texture;return t(p,u.mapping)}else{const p=u.image;if(p&&p.height>0){const m=new k0(p.height);return m.fromEquirectangularTexture(o,u),e.set(u,m),u.addEventListener("dispose",a),t(m.texture,u.mapping)}else return null}}return u}function a(u){const d=u.target;d.removeEventListener("dispose",a);const p=e.get(d);p!==void 0&&(e.delete(d),p.dispose())}function l(){e=new WeakMap}return{get:i,dispose:l}}const Yo=4,$y=[.125,.215,.35,.446,.526,.582],Ma=20,Dp=new Kr,zy=new Ye;let Np=null,Op=0,kp=0,Up=!1;const ya=(1+Math.sqrt(5))/2,bo=1/ya,Gy=[new se(-ya,bo,0),new se(ya,bo,0),new se(-bo,0,ya),new se(bo,0,ya),new se(0,ya,-bo),new se(0,ya,bo),new se(-1,1,-1),new se(1,1,-1),new se(-1,1,1),new se(1,1,1)];class Hy{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,a=100){Np=this._renderer.getRenderTarget(),Op=this._renderer.getActiveCubeFace(),kp=this._renderer.getActiveMipmapLevel(),Up=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,a,l),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=jy(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Qy(),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(Np,Op,kp),this._renderer.xr.enabled=Up,e.scissorTest=!1,Ih(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ja||e.mapping===Al?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Np=this._renderer.getRenderTarget(),Op=this._renderer.getActiveCubeFace(),kp=this._renderer.getActiveMipmapLevel(),Up=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:Et,minFilter:Et,generateMipmaps:!1,type:hi,format:Xt,colorSpace:qt,depthBuffer:!1},a=Vy(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Vy(e,t,i);const{_lodMax:l}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=kP(l)),this._blurMaterial=UP(l,e,t)}return a}_compileMaterial(e){const t=new lt(this._lodPlanes[0],e);this._renderer.compile(t,Dp)}_sceneToCubeUV(e,t,i,a){const d=new _i(90,1,t,i),p=[1,-1,1,1,1,1],m=[1,1,1,-1,-1,-1],A=this._renderer,_=A.autoClear,b=A.toneMapping;A.getClearColor(zy),A.toneMapping=Ss,A.autoClear=!1;const w=new Pi({name:"PMREM.Background",side:Fi,depthWrite:!1,depthTest:!1}),E=new lt(new Wn,w);let C=!1;const T=e.background;T?T.isColor&&(w.color.copy(T),e.background=null,C=!0):(w.color.copy(zy),C=!0);for(let x=0;x<6;x++){const P=x%3;P===0?(d.up.set(0,p[x],0),d.lookAt(m[x],0,0)):P===1?(d.up.set(0,0,p[x]),d.lookAt(0,m[x],0)):(d.up.set(0,p[x],0),d.lookAt(0,0,m[x]));const M=this._cubeSize;Ih(a,P*M,x>2?M:0,M,M),A.setRenderTarget(a),C&&A.render(E,d),A.render(e,d)}E.geometry.dispose(),E.material.dispose(),A.toneMapping=b,A.autoClear=_,e.background=T}_textureToCubeUV(e,t){const i=this._renderer,a=e.mapping===ja||e.mapping===Al;a?(this._cubemapMaterial===null&&(this._cubemapMaterial=jy()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Qy());const l=a?this._cubemapMaterial:this._equirectMaterial,u=new lt(this._lodPlanes[0],l),d=l.uniforms;d.envMap.value=e;const p=this._cubeSize;Ih(t,0,0,3*p,2*p),i.setRenderTarget(t),i.render(u,Dp)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const a=this._lodPlanes.length;for(let l=1;l<a;l++){const u=Math.sqrt(this._sigmas[l]*this._sigmas[l]-this._sigmas[l-1]*this._sigmas[l-1]),d=Gy[(a-l-1)%Gy.length];this._blur(e,l-1,l,u,d)}t.autoClear=i}_blur(e,t,i,a,l){const u=this._pingPongRenderTarget;this._halfBlur(e,u,t,i,a,"latitudinal",l),this._halfBlur(u,e,i,i,a,"longitudinal",l)}_halfBlur(e,t,i,a,l,u,d){const p=this._renderer,m=this._blurMaterial;u!=="latitudinal"&&u!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const A=3,_=new lt(this._lodPlanes[a],m),b=m.uniforms,w=this._sizeLods[i]-1,E=isFinite(l)?Math.PI/(2*w):2*Math.PI/(2*Ma-1),C=l/E,T=isFinite(l)?1+Math.floor(A*C):Ma;T>Ma&&console.warn(`sigmaRadians, ${l}, is too large and will clip, as it requested ${T} samples when the maximum is set to ${Ma}`);const x=[];let P=0;for(let U=0;U<Ma;++U){const V=U/C,k=Math.exp(-V*V/2);x.push(k),U===0?P+=k:U<T&&(P+=2*k)}for(let U=0;U<x.length;U++)x[U]=x[U]/P;b.envMap.value=e.texture,b.samples.value=T,b.weights.value=x,b.latitudinal.value=u==="latitudinal",d&&(b.poleAxis.value=d);const{_lodMax:M}=this;b.dTheta.value=E,b.mipInt.value=M-i;const B=this._sizeLods[a],D=3*B*(a>M-Yo?a-M+Yo:0),G=4*(this._cubeSize-B);Ih(t,D,G,3*B,2*B),p.setRenderTarget(t),p.render(_,Dp)}}function kP(o){const e=[],t=[],i=[];let a=o;const l=o-Yo+1+$y.length;for(let u=0;u<l;u++){const d=Math.pow(2,a);t.push(d);let p=1/d;u>o-Yo?p=$y[u-o+Yo-1]:u===0&&(p=0),i.push(p);const m=1/(d-2),A=-m,_=1+m,b=[A,A,_,A,_,_,A,A,_,_,A,_],w=6,E=6,C=3,T=2,x=1,P=new Float32Array(C*E*w),M=new Float32Array(T*E*w),B=new Float32Array(x*E*w);for(let G=0;G<w;G++){const U=G%3*2/3-1,V=G>2?0:-1,k=[U,V,0,U+2/3,V,0,U+2/3,V+1,0,U,V,0,U+2/3,V+1,0,U,V+1,0];P.set(k,C*E*G),M.set(b,T*E*G);const z=[G,G,G,G,G,G];B.set(z,x*E*G)}const D=new Di;D.setAttribute("position",new Vt(P,C)),D.setAttribute("uv",new Vt(M,T)),D.setAttribute("faceIndex",new Vt(B,x)),e.push(D),a>Yo&&a--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function Vy(o,e,t){const i=new dn(o,e,t);return i.texture.mapping=Pf,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Ih(o,e,t,i,a){o.viewport.set(e,t,i,a),o.scissor.set(e,t,i,a)}function UP(o,e,t){const i=new Float32Array(Ma),a=new se(0,1,0);return new zi({name:"SphericalGaussianBlur",defines:{n:Ma,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${o}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:W0(),fragmentShader:`
|
|
3648
3648
|
|
|
3649
3649
|
precision mediump float;
|
|
3650
3650
|
precision mediump int;
|
|
@@ -3796,12 +3796,12 @@ void main() {
|
|
|
3796
3796
|
}
|
|
3797
3797
|
`}function FP(o){let e=new WeakMap,t=null;function i(d){if(d&&d.isTexture){const p=d.mapping,m=p===bu||p===Zg,A=p===ja||p===Al;if(m||A){let _=e.get(d);const b=_!==void 0?_.texture.pmremVersion:0;if(d.isRenderTargetTexture&&d.pmremVersion!==b)return t===null&&(t=new Hy(o)),_=m?t.fromEquirectangular(d,_):t.fromCubemap(d,_),_.texture.pmremVersion=d.pmremVersion,e.set(d,_),_.texture;if(_!==void 0)return _.texture;{const w=d.image;return m&&w&&w.height>0||A&&w&&a(w)?(t===null&&(t=new Hy(o)),_=m?t.fromEquirectangular(d):t.fromCubemap(d),_.texture.pmremVersion=d.pmremVersion,e.set(d,_),d.addEventListener("dispose",l),_.texture):null}}}return d}function a(d){let p=0;const m=6;for(let A=0;A<m;A++)d[A]!==void 0&&p++;return p===m}function l(d){const p=d.target;p.removeEventListener("dispose",l);const m=e.get(p);m!==void 0&&(e.delete(p),m.dispose())}function u(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:i,dispose:u}}function $P(o){const e={};function t(i){if(e[i]!==void 0)return e[i];let a;switch(i){case"WEBGL_depth_texture":a=o.getExtension("WEBGL_depth_texture")||o.getExtension("MOZ_WEBGL_depth_texture")||o.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":a=o.getExtension("EXT_texture_filter_anisotropic")||o.getExtension("MOZ_EXT_texture_filter_anisotropic")||o.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":a=o.getExtension("WEBGL_compressed_texture_s3tc")||o.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||o.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":a=o.getExtension("WEBGL_compressed_texture_pvrtc")||o.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:a=o.getExtension(i)}return e[i]=a,a}return{has:function(i){return t(i)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(i){const a=t(i);return a===null&&Ho("THREE.WebGLRenderer: "+i+" extension not supported."),a}}}function zP(o,e,t,i){const a={},l=new WeakMap;function u(_){const b=_.target;b.index!==null&&e.remove(b.index);for(const E in b.attributes)e.remove(b.attributes[E]);b.removeEventListener("dispose",u),delete a[b.id];const w=l.get(b);w&&(e.remove(w),l.delete(b)),i.releaseStatesOfGeometry(b),b.isInstancedBufferGeometry===!0&&delete b._maxInstanceCount,t.memory.geometries--}function d(_,b){return a[b.id]===!0||(b.addEventListener("dispose",u),a[b.id]=!0,t.memory.geometries++),b}function p(_){const b=_.attributes;for(const w in b)e.update(b[w],o.ARRAY_BUFFER)}function m(_){const b=[],w=_.index,E=_.attributes.position;let C=0;if(w!==null){const P=w.array;C=w.version;for(let M=0,B=P.length;M<B;M+=3){const D=P[M+0],G=P[M+1],U=P[M+2];b.push(D,G,G,U,U,D)}}else if(E!==void 0){const P=E.array;C=E.version;for(let M=0,B=P.length/3-1;M<B;M+=3){const D=M+0,G=M+1,U=M+2;b.push(D,G,G,U,U,D)}}else return;const T=new(vS(b)?CS:SS)(b,1);T.version=C;const x=l.get(_);x&&e.remove(x),l.set(_,T)}function A(_){const b=l.get(_);if(b){const w=_.index;w!==null&&b.version<w.version&&m(_)}else m(_);return l.get(_)}return{get:d,update:p,getWireframeAttribute:A}}function GP(o,e,t){let i;function a(b){i=b}let l,u;function d(b){l=b.type,u=b.bytesPerElement}function p(b,w){o.drawElements(i,w,l,b*u),t.update(w,i,1)}function m(b,w,E){E!==0&&(o.drawElementsInstanced(i,w,l,b*u,E),t.update(w,i,E))}function A(b,w,E){if(E===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,w,0,l,b,0,E);let T=0;for(let x=0;x<E;x++)T+=w[x];t.update(T,i,1)}function _(b,w,E,C){if(E===0)return;const T=e.get("WEBGL_multi_draw");if(T===null)for(let x=0;x<b.length;x++)m(b[x]/u,w[x],C[x]);else{T.multiDrawElementsInstancedWEBGL(i,w,0,l,b,0,C,0,E);let x=0;for(let P=0;P<E;P++)x+=w[P]*C[P];t.update(x,i,1)}}this.setMode=a,this.setIndex=d,this.render=p,this.renderInstances=m,this.renderMultiDraw=A,this.renderMultiDrawInstances=_}function HP(o){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(l,u,d){switch(t.calls++,u){case o.TRIANGLES:t.triangles+=d*(l/3);break;case o.LINES:t.lines+=d*(l/2);break;case o.LINE_STRIP:t.lines+=d*(l-1);break;case o.LINE_LOOP:t.lines+=d*l;break;case o.POINTS:t.points+=d*l;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",u);break}}function a(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:a,update:i}}function VP(o,e,t){const i=new WeakMap,a=new Rt;function l(u,d,p){const m=u.morphTargetInfluences,A=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,_=A!==void 0?A.length:0;let b=i.get(d);if(b===void 0||b.count!==_){let z=function(){V.dispose(),i.delete(d),d.removeEventListener("dispose",z)};var w=z;b!==void 0&&b.texture.dispose();const E=d.morphAttributes.position!==void 0,C=d.morphAttributes.normal!==void 0,T=d.morphAttributes.color!==void 0,x=d.morphAttributes.position||[],P=d.morphAttributes.normal||[],M=d.morphAttributes.color||[];let B=0;E===!0&&(B=1),C===!0&&(B=2),T===!0&&(B=3);let D=d.attributes.position.count*B,G=1;D>e.maxTextureSize&&(G=Math.ceil(D/e.maxTextureSize),D=e.maxTextureSize);const U=new Float32Array(D*G*4*_),V=new wS(U,D,G,_);V.type=oi,V.needsUpdate=!0;const k=B*4;for(let Q=0;Q<_;Q++){const Z=x[Q],K=P[Q],s=M[Q],H=D*G*4*Q;for(let y=0;y<Z.count;y++){const ee=y*k;E===!0&&(a.fromBufferAttribute(Z,y),U[H+ee+0]=a.x,U[H+ee+1]=a.y,U[H+ee+2]=a.z,U[H+ee+3]=0),C===!0&&(a.fromBufferAttribute(K,y),U[H+ee+4]=a.x,U[H+ee+5]=a.y,U[H+ee+6]=a.z,U[H+ee+7]=0),T===!0&&(a.fromBufferAttribute(s,y),U[H+ee+8]=a.x,U[H+ee+9]=a.y,U[H+ee+10]=a.z,U[H+ee+11]=s.itemSize===4?a.w:1)}}b={count:_,texture:V,size:new Ve(D,G)},i.set(d,b),d.addEventListener("dispose",z)}if(u.isInstancedMesh===!0&&u.morphTexture!==null)p.getUniforms().setValue(o,"morphTexture",u.morphTexture,t);else{let E=0;for(let T=0;T<m.length;T++)E+=m[T];const C=d.morphTargetsRelative?1:1-E;p.getUniforms().setValue(o,"morphTargetBaseInfluence",C),p.getUniforms().setValue(o,"morphTargetInfluences",m)}p.getUniforms().setValue(o,"morphTargetsTexture",b.texture,t),p.getUniforms().setValue(o,"morphTargetsTextureSize",b.size)}return{update:l}}function QP(o,e,t,i){let a=new WeakMap;function l(p){const m=i.render.frame,A=p.geometry,_=e.get(p,A);if(a.get(_)!==m&&(e.update(_),a.set(_,m)),p.isInstancedMesh&&(p.hasEventListener("dispose",d)===!1&&p.addEventListener("dispose",d),a.get(p)!==m&&(t.update(p.instanceMatrix,o.ARRAY_BUFFER),p.instanceColor!==null&&t.update(p.instanceColor,o.ARRAY_BUFFER),a.set(p,m))),p.isSkinnedMesh){const b=p.skeleton;a.get(b)!==m&&(b.update(),a.set(b,m))}return _}function u(){a=new WeakMap}function d(p){const m=p.target;m.removeEventListener("dispose",d),t.remove(m.instanceMatrix),m.instanceColor!==null&&t.remove(m.instanceColor)}return{update:l,dispose:u}}const HS=new Kt,qy=new LS(1,1),VS=new wS,QS=new ES,jS=new RS,Wy=[],Yy=[],Xy=new Float32Array(16),Ky=new Float32Array(9),Jy=new Float32Array(4);function Gl(o,e,t){const i=o[0];if(i<=0||i>0)return o;const a=e*t;let l=Wy[a];if(l===void 0&&(l=new Float32Array(a),Wy[a]=l),e!==0){i.toArray(l,0);for(let u=1,d=0;u!==e;++u)d+=t,o[u].toArray(l,d)}return l}function bi(o,e){if(o.length!==e.length)return!1;for(let t=0,i=o.length;t<i;t++)if(o[t]!==e[t])return!1;return!0}function vi(o,e){for(let t=0,i=e.length;t<i;t++)o[t]=e[t]}function Of(o,e){let t=Yy[e];t===void 0&&(t=new Int32Array(e),Yy[e]=t);for(let i=0;i!==e;++i)t[i]=o.allocateTextureUnit();return t}function jP(o,e){const t=this.cache;t[0]!==e&&(o.uniform1f(this.addr,e),t[0]=e)}function qP(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(o.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(bi(t,e))return;o.uniform2fv(this.addr,e),vi(t,e)}}function WP(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(o.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(o.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(bi(t,e))return;o.uniform3fv(this.addr,e),vi(t,e)}}function YP(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(o.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(bi(t,e))return;o.uniform4fv(this.addr,e),vi(t,e)}}function XP(o,e){const t=this.cache,i=e.elements;if(i===void 0){if(bi(t,e))return;o.uniformMatrix2fv(this.addr,!1,e),vi(t,e)}else{if(bi(t,i))return;Jy.set(i),o.uniformMatrix2fv(this.addr,!1,Jy),vi(t,i)}}function KP(o,e){const t=this.cache,i=e.elements;if(i===void 0){if(bi(t,e))return;o.uniformMatrix3fv(this.addr,!1,e),vi(t,e)}else{if(bi(t,i))return;Ky.set(i),o.uniformMatrix3fv(this.addr,!1,Ky),vi(t,i)}}function JP(o,e){const t=this.cache,i=e.elements;if(i===void 0){if(bi(t,e))return;o.uniformMatrix4fv(this.addr,!1,e),vi(t,e)}else{if(bi(t,i))return;Xy.set(i),o.uniformMatrix4fv(this.addr,!1,Xy),vi(t,i)}}function ZP(o,e){const t=this.cache;t[0]!==e&&(o.uniform1i(this.addr,e),t[0]=e)}function eL(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(o.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(bi(t,e))return;o.uniform2iv(this.addr,e),vi(t,e)}}function tL(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(o.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(bi(t,e))return;o.uniform3iv(this.addr,e),vi(t,e)}}function iL(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(o.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(bi(t,e))return;o.uniform4iv(this.addr,e),vi(t,e)}}function nL(o,e){const t=this.cache;t[0]!==e&&(o.uniform1ui(this.addr,e),t[0]=e)}function sL(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(o.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(bi(t,e))return;o.uniform2uiv(this.addr,e),vi(t,e)}}function rL(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(o.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(bi(t,e))return;o.uniform3uiv(this.addr,e),vi(t,e)}}function aL(o,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(o.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(bi(t,e))return;o.uniform4uiv(this.addr,e),vi(t,e)}}function oL(o,e,t){const i=this.cache,a=t.allocateTextureUnit();i[0]!==a&&(o.uniform1i(this.addr,a),i[0]=a);let l;this.type===o.SAMPLER_2D_SHADOW?(qy.compareFunction=bS,l=qy):l=HS,t.setTexture2D(e||l,a)}function lL(o,e,t){const i=this.cache,a=t.allocateTextureUnit();i[0]!==a&&(o.uniform1i(this.addr,a),i[0]=a),t.setTexture3D(e||QS,a)}function cL(o,e,t){const i=this.cache,a=t.allocateTextureUnit();i[0]!==a&&(o.uniform1i(this.addr,a),i[0]=a),t.setTextureCube(e||jS,a)}function uL(o,e,t){const i=this.cache,a=t.allocateTextureUnit();i[0]!==a&&(o.uniform1i(this.addr,a),i[0]=a),t.setTexture2DArray(e||VS,a)}function hL(o){switch(o){case 5126:return jP;case 35664:return qP;case 35665:return WP;case 35666:return YP;case 35674:return XP;case 35675:return KP;case 35676:return JP;case 5124:case 35670:return ZP;case 35667:case 35671:return eL;case 35668:case 35672:return tL;case 35669:case 35673:return iL;case 5125:return nL;case 36294:return sL;case 36295:return rL;case 36296:return aL;case 35678:case 36198:case 36298:case 36306:case 35682:return oL;case 35679:case 36299:case 36307:return lL;case 35680:case 36300:case 36308:case 36293:return cL;case 36289:case 36303:case 36311:case 36292:return uL}}function dL(o,e){o.uniform1fv(this.addr,e)}function fL(o,e){const t=Gl(e,this.size,2);o.uniform2fv(this.addr,t)}function pL(o,e){const t=Gl(e,this.size,3);o.uniform3fv(this.addr,t)}function mL(o,e){const t=Gl(e,this.size,4);o.uniform4fv(this.addr,t)}function gL(o,e){const t=Gl(e,this.size,4);o.uniformMatrix2fv(this.addr,!1,t)}function AL(o,e){const t=Gl(e,this.size,9);o.uniformMatrix3fv(this.addr,!1,t)}function _L(o,e){const t=Gl(e,this.size,16);o.uniformMatrix4fv(this.addr,!1,t)}function yL(o,e){o.uniform1iv(this.addr,e)}function bL(o,e){o.uniform2iv(this.addr,e)}function vL(o,e){o.uniform3iv(this.addr,e)}function wL(o,e){o.uniform4iv(this.addr,e)}function EL(o,e){o.uniform1uiv(this.addr,e)}function xL(o,e){o.uniform2uiv(this.addr,e)}function SL(o,e){o.uniform3uiv(this.addr,e)}function CL(o,e){o.uniform4uiv(this.addr,e)}function TL(o,e,t){const i=this.cache,a=e.length,l=Of(t,a);bi(i,l)||(o.uniform1iv(this.addr,l),vi(i,l));for(let u=0;u!==a;++u)t.setTexture2D(e[u]||HS,l[u])}function IL(o,e,t){const i=this.cache,a=e.length,l=Of(t,a);bi(i,l)||(o.uniform1iv(this.addr,l),vi(i,l));for(let u=0;u!==a;++u)t.setTexture3D(e[u]||QS,l[u])}function ML(o,e,t){const i=this.cache,a=e.length,l=Of(t,a);bi(i,l)||(o.uniform1iv(this.addr,l),vi(i,l));for(let u=0;u!==a;++u)t.setTextureCube(e[u]||jS,l[u])}function RL(o,e,t){const i=this.cache,a=e.length,l=Of(t,a);bi(i,l)||(o.uniform1iv(this.addr,l),vi(i,l));for(let u=0;u!==a;++u)t.setTexture2DArray(e[u]||VS,l[u])}function BL(o){switch(o){case 5126:return dL;case 35664:return fL;case 35665:return pL;case 35666:return mL;case 35674:return gL;case 35675:return AL;case 35676:return _L;case 5124:case 35670:return yL;case 35667:case 35671:return bL;case 35668:case 35672:return vL;case 35669:case 35673:return wL;case 5125:return EL;case 36294:return xL;case 36295:return SL;case 36296:return CL;case 35678:case 36198:case 36298:case 36306:case 35682:return TL;case 35679:case 36299:case 36307:return IL;case 35680:case 36300:case 36308:case 36293:return ML;case 36289:case 36303:case 36311:case 36292:return RL}}class PL{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=hL(t.type)}}class LL{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=BL(t.type)}}class DL{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){const a=this.seq;for(let l=0,u=a.length;l!==u;++l){const d=a[l];d.setValue(e,t[d.id],i)}}}const Fp=/(\w+)(\])?(\[|\.)?/g;function Zy(o,e){o.seq.push(e),o.map[e.id]=e}function NL(o,e,t){const i=o.name,a=i.length;for(Fp.lastIndex=0;;){const l=Fp.exec(i),u=Fp.lastIndex;let d=l[1];const p=l[2]==="]",m=l[3];if(p&&(d=d|0),m===void 0||m==="["&&u+2===a){Zy(t,m===void 0?new PL(d,o,e):new LL(d,o,e));break}else{let _=t.map[d];_===void 0&&(_=new DL(d),Zy(t,_)),t=_}}}class Ed{constructor(e,t){this.seq=[],this.map={};const i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<i;++a){const l=e.getActiveUniform(t,a),u=e.getUniformLocation(t,l.name);NL(l,u,this)}}setValue(e,t,i,a){const l=this.map[t];l!==void 0&&l.setValue(e,i,a)}setOptional(e,t,i){const a=t[i];a!==void 0&&this.setValue(e,i,a)}static upload(e,t,i,a){for(let l=0,u=t.length;l!==u;++l){const d=t[l],p=i[d.id];p.needsUpdate!==!1&&d.setValue(e,p.value,a)}}static seqWithValue(e,t){const i=[];for(let a=0,l=e.length;a!==l;++a){const u=e[a];u.id in t&&i.push(u)}return i}}function eb(o,e,t){const i=o.createShader(e);return o.shaderSource(i,t),o.compileShader(i),i}const OL=37297;let kL=0;function UL(o,e){const t=o.split(`
|
|
3798
3798
|
`),i=[],a=Math.max(e-6,0),l=Math.min(e+6,t.length);for(let u=a;u<l;u++){const d=u+1;i.push(`${d===e?">":" "} ${d}: ${t[u]}`)}return i.join(`
|
|
3799
|
-
`)}const tb=new ot;function FL(o){
|
|
3799
|
+
`)}const tb=new ot;function FL(o){wt._getMatrix(tb,wt.workingColorSpace,o);const e=`mat3( ${tb.elements.map(t=>t.toFixed(4))} )`;switch(wt.getTransfer(o)){case Kd:return[e,"LinearTransferOETF"];case Gt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",o),[e,"LinearTransferOETF"]}}function ib(o,e,t){const i=o.getShaderParameter(e,o.COMPILE_STATUS),a=o.getShaderInfoLog(e).trim();if(i&&a==="")return"";const l=/ERROR: 0:(\d+)/.exec(a);if(l){const u=parseInt(l[1]);return t.toUpperCase()+`
|
|
3800
3800
|
|
|
3801
3801
|
`+a+`
|
|
3802
3802
|
|
|
3803
3803
|
`+UL(o.getShaderSource(e),u)}else return a}function $L(o,e){const t=FL(e);return[`vec4 ${o}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
|
|
3804
|
-
`)}function zL(o,e){let t;switch(e){case lS:t="Linear";break;case cS:t="Reinhard";break;case uS:t="Cineon";break;case S0:t="ACESFilmic";break;case hS:t="AgX";break;case yu:t="Neutral";break;case eM:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+o+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Mh=new se;function GL(){
|
|
3804
|
+
`)}function zL(o,e){let t;switch(e){case lS:t="Linear";break;case cS:t="Reinhard";break;case uS:t="Cineon";break;case S0:t="ACESFilmic";break;case hS:t="AgX";break;case yu:t="Neutral";break;case eM:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+o+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Mh=new se;function GL(){wt.getLuminanceCoefficients(Mh);const o=Mh.x.toFixed(4),e=Mh.y.toFixed(4),t=Mh.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${o}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(`
|
|
3805
3805
|
`)}function HL(o){return[o.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",o.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Vc).join(`
|
|
3806
3806
|
`)}function VL(o){const e=[];for(const t in o){const i=o[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(`
|
|
3807
3807
|
`)}function QL(o,e){const t={},i=o.getProgramParameter(e,o.ACTIVE_ATTRIBUTES);for(let a=0;a<i;a++){const l=o.getActiveAttrib(e,a),u=l.name;let d=1;l.type===o.FLOAT_MAT2&&(d=2),l.type===o.FLOAT_MAT3&&(d=3),l.type===o.FLOAT_MAT4&&(d=4),t[u]={type:l.type,location:o.getAttribLocation(e,u),locationSize:d}}return t}function Vc(o){return o!==""}function nb(o,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return o.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function sb(o,e){return o.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const jL=/^[ \t]*#include +<([\w\d./]+)>/gm;function SA(o){return o.replace(jL,WL)}const qL=new Map;function WL(o,e){let t=ht[e];if(t===void 0){const i=qL.get(e);if(i!==void 0)t=ht[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return SA(t)}const YL=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function rb(o){return o.replace(YL,XL)}function XL(o,e,t,i){let a="";for(let l=parseInt(e);l<parseInt(t);l++)a+=i.replace(/\[\s*i\s*\]/g,"[ "+l+" ]").replace(/UNROLLED_LOOP_INDEX/g,l);return a}function ab(o){let e=`precision ${o.precision} float;
|
|
@@ -3845,7 +3845,7 @@ Material Type: `+Q.type+`
|
|
|
3845
3845
|
|
|
3846
3846
|
Program Info Log: `+Z+`
|
|
3847
3847
|
`+ee+`
|
|
3848
|
-
`+I)}else Z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Z):(K===""||s==="")&&(y=!1);y&&(Q.diagnostics={runnable:H,programLog:Z,vertexShader:{log:K,prefix:T},fragmentShader:{log:s,prefix:x}})}a.deleteShader(D),a.deleteShader(G),V=new Ed(a,C),k=QL(a,C)}let V;this.getUniforms=function(){return V===void 0&&U(this),V};let k;this.getAttributes=function(){return k===void 0&&U(this),k};let z=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return z===!1&&(z=a.getProgramParameter(C,OL)),z},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(C),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=kL++,this.cacheKey=e,this.usedTimes=1,this.program=C,this.vertexShader=D,this.fragmentShader=G,this}let nD=0;class sD{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(t),l=this._getShaderStage(i),u=this._getShaderCacheForMaterial(e);return u.has(a)===!1&&(u.add(a),a.usedTimes++),u.has(l)===!1&&(u.add(l),l.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new rD(e),t.set(e,i)),i}}class rD{constructor(e){this.id=nD++,this.code=e,this.usedTimes=0}}function aD(o,e,t,i,a,l,u){const d=new O0,p=new sD,m=new Set,A=[],_=a.logarithmicDepthBuffer,b=a.vertexTextures;let w=a.precision;const E={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 C(k){return m.add(k),k===0?"uv":`uv${k}`}function T(k,z,Q,Z,K){const s=Z.fog,H=K.geometry,y=k.isMeshStandardMaterial?Z.environment:null,ee=(k.isMeshStandardMaterial?t:e).get(k.envMap||y),I=ee&&ee.mapping===Pf?ee.image.height:null,re=E[k.type];k.precision!==null&&(w=a.getMaxPrecision(k.precision),w!==k.precision&&console.warn("THREE.WebGLProgram.getParameters:",k.precision,"not supported, using",w,"instead."));const Ae=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,N=Ae!==void 0?Ae.length:0;let n=0;H.morphAttributes.position!==void 0&&(n=1),H.morphAttributes.normal!==void 0&&(n=2),H.morphAttributes.color!==void 0&&(n=3);let r,c,h,f;if(re){const Ct=ys[re];r=Ct.vertexShader,c=Ct.fragmentShader}else r=k.vertexShader,c=k.fragmentShader,p.update(k),h=p.getVertexShaderID(k),f=p.getFragmentShaderID(k);const g=o.getRenderTarget(),v=o.state.buffers.depth.getReversed(),S=K.isInstancedMesh===!0,R=K.isBatchedMesh===!0,L=!!k.map,F=!!k.matcap,$=!!ee,O=!!k.aoMap,W=!!k.lightMap,Y=!!k.bumpMap,te=!!k.normalMap,X=!!k.displacementMap,ie=!!k.emissiveMap,de=!!k.metalnessMap,q=!!k.roughnessMap,j=k.anisotropy>0,ae=k.clearcoat>0,ge=k.dispersion>0,fe=k.iridescence>0,ue=k.sheen>0,ve=k.transmission>0,Re=j&&!!k.anisotropyMap,Le=ae&&!!k.clearcoatMap,Xe=ae&&!!k.clearcoatNormalMap,xe=ae&&!!k.clearcoatRoughnessMap,Pe=fe&&!!k.iridescenceMap,Ie=fe&&!!k.iridescenceThicknessMap,Ue=ue&&!!k.sheenColorMap,Ne=ue&&!!k.sheenRoughnessMap,et=!!k.specularMap,Ke=!!k.specularColorMap,pt=!!k.specularIntensityMap,ne=ve&&!!k.transmissionMap,Oe=ve&&!!k.thicknessMap,ye=!!k.gradientMap,we=!!k.alphaMap,ze=k.alphaTest>0,$e=!!k.alphaHash,qe=!!k.extensions;let Ot=Ss;k.toneMapped&&(g===null||g.isXRRenderTarget===!0)&&(Ot=o.toneMapping);const wi={shaderID:re,shaderType:k.type,shaderName:k.name,vertexShader:r,fragmentShader:c,defines:k.defines,customVertexShaderID:h,customFragmentShaderID:f,isRawShaderMaterial:k.isRawShaderMaterial===!0,glslVersion:k.glslVersion,precision:w,batching:R,batchingColor:R&&K._colorsTexture!==null,instancing:S,instancingColor:S&&K.instanceColor!==null,instancingMorph:S&&K.morphTexture!==null,supportsVertexTextures:b,outputColorSpace:g===null?o.outputColorSpace:g.isXRRenderTarget===!0?g.texture.colorSpace:qt,alphaToCoverage:!!k.alphaToCoverage,map:L,matcap:F,envMap:$,envMapMode:$&&ee.mapping,envMapCubeUVHeight:I,aoMap:O,lightMap:W,bumpMap:Y,normalMap:te,displacementMap:b&&X,emissiveMap:ie,normalMapObjectSpace:te&&k.normalMapType===aM,normalMapTangentSpace:te&&k.normalMapType===yS,metalnessMap:de,roughnessMap:q,anisotropy:j,anisotropyMap:Re,clearcoat:ae,clearcoatMap:Le,clearcoatNormalMap:Xe,clearcoatRoughnessMap:xe,dispersion:ge,iridescence:fe,iridescenceMap:Pe,iridescenceThicknessMap:Ie,sheen:ue,sheenColorMap:Ue,sheenRoughnessMap:Ne,specularMap:et,specularColorMap:Ke,specularIntensityMap:pt,transmission:ve,transmissionMap:ne,thicknessMap:Oe,gradientMap:ye,opaque:k.transparent===!1&&k.blending===sl&&k.alphaToCoverage===!1,alphaMap:we,alphaTest:ze,alphaHash:$e,combine:k.combine,mapUv:L&&C(k.map.channel),aoMapUv:O&&C(k.aoMap.channel),lightMapUv:W&&C(k.lightMap.channel),bumpMapUv:Y&&C(k.bumpMap.channel),normalMapUv:te&&C(k.normalMap.channel),displacementMapUv:X&&C(k.displacementMap.channel),emissiveMapUv:ie&&C(k.emissiveMap.channel),metalnessMapUv:de&&C(k.metalnessMap.channel),roughnessMapUv:q&&C(k.roughnessMap.channel),anisotropyMapUv:Re&&C(k.anisotropyMap.channel),clearcoatMapUv:Le&&C(k.clearcoatMap.channel),clearcoatNormalMapUv:Xe&&C(k.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:xe&&C(k.clearcoatRoughnessMap.channel),iridescenceMapUv:Pe&&C(k.iridescenceMap.channel),iridescenceThicknessMapUv:Ie&&C(k.iridescenceThicknessMap.channel),sheenColorMapUv:Ue&&C(k.sheenColorMap.channel),sheenRoughnessMapUv:Ne&&C(k.sheenRoughnessMap.channel),specularMapUv:et&&C(k.specularMap.channel),specularColorMapUv:Ke&&C(k.specularColorMap.channel),specularIntensityMapUv:pt&&C(k.specularIntensityMap.channel),transmissionMapUv:ne&&C(k.transmissionMap.channel),thicknessMapUv:Oe&&C(k.thicknessMap.channel),alphaMapUv:we&&C(k.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(te||j),vertexColors:k.vertexColors,vertexAlphas:k.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,pointsUvs:K.isPoints===!0&&!!H.attributes.uv&&(L||we),fog:!!s,useFog:k.fog===!0,fogExp2:!!s&&s.isFogExp2,flatShading:k.flatShading===!0,sizeAttenuation:k.sizeAttenuation===!0,logarithmicDepthBuffer:_,reverseDepthBuffer:v,skinning:K.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:N,morphTextureStride:n,numDirLights:z.directional.length,numPointLights:z.point.length,numSpotLights:z.spot.length,numSpotLightMaps:z.spotLightMap.length,numRectAreaLights:z.rectArea.length,numHemiLights:z.hemi.length,numDirLightShadows:z.directionalShadowMap.length,numPointLightShadows:z.pointShadowMap.length,numSpotLightShadows:z.spotShadowMap.length,numSpotLightShadowsWithMaps:z.numSpotLightShadowsWithMaps,numLightProbes:z.numLightProbes,numClippingPlanes:u.numPlanes,numClipIntersection:u.numIntersection,dithering:k.dithering,shadowMapEnabled:o.shadowMap.enabled&&Q.length>0,shadowMapType:o.shadowMap.type,toneMapping:Ot,decodeVideoTexture:L&&k.map.isVideoTexture===!0&&vt.getTransfer(k.map.colorSpace)===Gt,decodeVideoTextureEmissive:ie&&k.emissiveMap.isVideoTexture===!0&&vt.getTransfer(k.emissiveMap.colorSpace)===Gt,premultipliedAlpha:k.premultipliedAlpha,doubleSided:k.side===Ri,flipSided:k.side===Fi,useDepthPacking:k.depthPacking>=0,depthPacking:k.depthPacking||0,index0AttributeName:k.index0AttributeName,extensionClipCullDistance:qe&&k.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(qe&&k.extensions.multiDraw===!0||R)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:k.customProgramCacheKey()};return wi.vertexUv1s=m.has(1),wi.vertexUv2s=m.has(2),wi.vertexUv3s=m.has(3),m.clear(),wi}function x(k){const z=[];if(k.shaderID?z.push(k.shaderID):(z.push(k.customVertexShaderID),z.push(k.customFragmentShaderID)),k.defines!==void 0)for(const Q in k.defines)z.push(Q),z.push(k.defines[Q]);return k.isRawShaderMaterial===!1&&(P(z,k),M(z,k),z.push(o.outputColorSpace)),z.push(k.customProgramCacheKey),z.join()}function P(k,z){k.push(z.precision),k.push(z.outputColorSpace),k.push(z.envMapMode),k.push(z.envMapCubeUVHeight),k.push(z.mapUv),k.push(z.alphaMapUv),k.push(z.lightMapUv),k.push(z.aoMapUv),k.push(z.bumpMapUv),k.push(z.normalMapUv),k.push(z.displacementMapUv),k.push(z.emissiveMapUv),k.push(z.metalnessMapUv),k.push(z.roughnessMapUv),k.push(z.anisotropyMapUv),k.push(z.clearcoatMapUv),k.push(z.clearcoatNormalMapUv),k.push(z.clearcoatRoughnessMapUv),k.push(z.iridescenceMapUv),k.push(z.iridescenceThicknessMapUv),k.push(z.sheenColorMapUv),k.push(z.sheenRoughnessMapUv),k.push(z.specularMapUv),k.push(z.specularColorMapUv),k.push(z.specularIntensityMapUv),k.push(z.transmissionMapUv),k.push(z.thicknessMapUv),k.push(z.combine),k.push(z.fogExp2),k.push(z.sizeAttenuation),k.push(z.morphTargetsCount),k.push(z.morphAttributeCount),k.push(z.numDirLights),k.push(z.numPointLights),k.push(z.numSpotLights),k.push(z.numSpotLightMaps),k.push(z.numHemiLights),k.push(z.numRectAreaLights),k.push(z.numDirLightShadows),k.push(z.numPointLightShadows),k.push(z.numSpotLightShadows),k.push(z.numSpotLightShadowsWithMaps),k.push(z.numLightProbes),k.push(z.shadowMapType),k.push(z.toneMapping),k.push(z.numClippingPlanes),k.push(z.numClipIntersection),k.push(z.depthPacking)}function M(k,z){d.disableAll(),z.supportsVertexTextures&&d.enable(0),z.instancing&&d.enable(1),z.instancingColor&&d.enable(2),z.instancingMorph&&d.enable(3),z.matcap&&d.enable(4),z.envMap&&d.enable(5),z.normalMapObjectSpace&&d.enable(6),z.normalMapTangentSpace&&d.enable(7),z.clearcoat&&d.enable(8),z.iridescence&&d.enable(9),z.alphaTest&&d.enable(10),z.vertexColors&&d.enable(11),z.vertexAlphas&&d.enable(12),z.vertexUv1s&&d.enable(13),z.vertexUv2s&&d.enable(14),z.vertexUv3s&&d.enable(15),z.vertexTangents&&d.enable(16),z.anisotropy&&d.enable(17),z.alphaHash&&d.enable(18),z.batching&&d.enable(19),z.dispersion&&d.enable(20),z.batchingColor&&d.enable(21),k.push(d.mask),d.disableAll(),z.fog&&d.enable(0),z.useFog&&d.enable(1),z.flatShading&&d.enable(2),z.logarithmicDepthBuffer&&d.enable(3),z.reverseDepthBuffer&&d.enable(4),z.skinning&&d.enable(5),z.morphTargets&&d.enable(6),z.morphNormals&&d.enable(7),z.morphColors&&d.enable(8),z.premultipliedAlpha&&d.enable(9),z.shadowMapEnabled&&d.enable(10),z.doubleSided&&d.enable(11),z.flipSided&&d.enable(12),z.useDepthPacking&&d.enable(13),z.dithering&&d.enable(14),z.transmission&&d.enable(15),z.sheen&&d.enable(16),z.opaque&&d.enable(17),z.pointsUvs&&d.enable(18),z.decodeVideoTexture&&d.enable(19),z.decodeVideoTextureEmissive&&d.enable(20),z.alphaToCoverage&&d.enable(21),k.push(d.mask)}function B(k){const z=E[k.type];let Q;if(z){const Z=ys[z];Q=IS.clone(Z.uniforms)}else Q=k.uniforms;return Q}function D(k,z){let Q;for(let Z=0,K=A.length;Z<K;Z++){const s=A[Z];if(s.cacheKey===z){Q=s,++Q.usedTimes;break}}return Q===void 0&&(Q=new iD(o,z,k,l),A.push(Q)),Q}function G(k){if(--k.usedTimes===0){const z=A.indexOf(k);A[z]=A[A.length-1],A.pop(),k.destroy()}}function U(k){p.remove(k)}function V(){p.dispose()}return{getParameters:T,getProgramCacheKey:x,getUniforms:B,acquireProgram:D,releaseProgram:G,releaseShaderCache:U,programs:A,dispose:V}}function oD(){let o=new WeakMap;function e(u){return o.has(u)}function t(u){let d=o.get(u);return d===void 0&&(d={},o.set(u,d)),d}function i(u){o.delete(u)}function a(u,d,p){o.get(u)[d]=p}function l(){o=new WeakMap}return{has:e,get:t,remove:i,update:a,dispose:l}}function lD(o,e){return o.groupOrder!==e.groupOrder?o.groupOrder-e.groupOrder:o.renderOrder!==e.renderOrder?o.renderOrder-e.renderOrder:o.material.id!==e.material.id?o.material.id-e.material.id:o.z!==e.z?o.z-e.z:o.id-e.id}function ob(o,e){return o.groupOrder!==e.groupOrder?o.groupOrder-e.groupOrder:o.renderOrder!==e.renderOrder?o.renderOrder-e.renderOrder:o.z!==e.z?e.z-o.z:o.id-e.id}function lb(){const o=[];let e=0;const t=[],i=[],a=[];function l(){e=0,t.length=0,i.length=0,a.length=0}function u(_,b,w,E,C,T){let x=o[e];return x===void 0?(x={id:_.id,object:_,geometry:b,material:w,groupOrder:E,renderOrder:_.renderOrder,z:C,group:T},o[e]=x):(x.id=_.id,x.object=_,x.geometry=b,x.material=w,x.groupOrder=E,x.renderOrder=_.renderOrder,x.z=C,x.group=T),e++,x}function d(_,b,w,E,C,T){const x=u(_,b,w,E,C,T);w.transmission>0?i.push(x):w.transparent===!0?a.push(x):t.push(x)}function p(_,b,w,E,C,T){const x=u(_,b,w,E,C,T);w.transmission>0?i.unshift(x):w.transparent===!0?a.unshift(x):t.unshift(x)}function m(_,b){t.length>1&&t.sort(_||lD),i.length>1&&i.sort(b||ob),a.length>1&&a.sort(b||ob)}function A(){for(let _=e,b=o.length;_<b;_++){const w=o[_];if(w.id===null)break;w.id=null,w.object=null,w.geometry=null,w.material=null,w.group=null}}return{opaque:t,transmissive:i,transparent:a,init:l,push:d,unshift:p,finish:A,sort:m}}function cD(){let o=new WeakMap;function e(i,a){const l=o.get(i);let u;return l===void 0?(u=new lb,o.set(i,[u])):a>=l.length?(u=new lb,l.push(u)):u=l[a],u}function t(){o=new WeakMap}return{get:e,dispose:t}}function uD(){const o={};return{get:function(e){if(o[e.id]!==void 0)return o[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new se,color:new Ye};break;case"SpotLight":t={position:new se,direction:new se,color:new Ye,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new se,color:new Ye,distance:0,decay:0};break;case"HemisphereLight":t={direction:new se,skyColor:new Ye,groundColor:new Ye};break;case"RectAreaLight":t={color:new Ye,position:new se,halfWidth:new se,halfHeight:new se};break}return o[e.id]=t,t}}}function hD(){const o={};return{get:function(e){if(o[e.id]!==void 0)return o[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve,shadowCameraNear:1,shadowCameraFar:1e3};break}return o[e.id]=t,t}}}let dD=0;function fD(o,e){return(e.castShadow?2:0)-(o.castShadow?2:0)+(e.map?1:0)-(o.map?1:0)}function pD(o){const e=new uD,t=hD(),i={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 m=0;m<9;m++)i.probe.push(new se);const a=new se,l=new tt,u=new tt;function d(m){let A=0,_=0,b=0;for(let k=0;k<9;k++)i.probe[k].set(0,0,0);let w=0,E=0,C=0,T=0,x=0,P=0,M=0,B=0,D=0,G=0,U=0;m.sort(fD);for(let k=0,z=m.length;k<z;k++){const Q=m[k],Z=Q.color,K=Q.intensity,s=Q.distance,H=Q.shadow&&Q.shadow.map?Q.shadow.map.texture:null;if(Q.isAmbientLight)A+=Z.r*K,_+=Z.g*K,b+=Z.b*K;else if(Q.isLightProbe){for(let y=0;y<9;y++)i.probe[y].addScaledVector(Q.sh.coefficients[y],K);U++}else if(Q.isDirectionalLight){const y=e.get(Q);if(y.color.copy(Q.color).multiplyScalar(Q.intensity),Q.castShadow){const ee=Q.shadow,I=t.get(Q);I.shadowIntensity=ee.intensity,I.shadowBias=ee.bias,I.shadowNormalBias=ee.normalBias,I.shadowRadius=ee.radius,I.shadowMapSize=ee.mapSize,i.directionalShadow[w]=I,i.directionalShadowMap[w]=H,i.directionalShadowMatrix[w]=Q.shadow.matrix,P++}i.directional[w]=y,w++}else if(Q.isSpotLight){const y=e.get(Q);y.position.setFromMatrixPosition(Q.matrixWorld),y.color.copy(Z).multiplyScalar(K),y.distance=s,y.coneCos=Math.cos(Q.angle),y.penumbraCos=Math.cos(Q.angle*(1-Q.penumbra)),y.decay=Q.decay,i.spot[C]=y;const ee=Q.shadow;if(Q.map&&(i.spotLightMap[D]=Q.map,D++,ee.updateMatrices(Q),Q.castShadow&&G++),i.spotLightMatrix[C]=ee.matrix,Q.castShadow){const I=t.get(Q);I.shadowIntensity=ee.intensity,I.shadowBias=ee.bias,I.shadowNormalBias=ee.normalBias,I.shadowRadius=ee.radius,I.shadowMapSize=ee.mapSize,i.spotShadow[C]=I,i.spotShadowMap[C]=H,B++}C++}else if(Q.isRectAreaLight){const y=e.get(Q);y.color.copy(Z).multiplyScalar(K),y.halfWidth.set(Q.width*.5,0,0),y.halfHeight.set(0,Q.height*.5,0),i.rectArea[T]=y,T++}else if(Q.isPointLight){const y=e.get(Q);if(y.color.copy(Q.color).multiplyScalar(Q.intensity),y.distance=Q.distance,y.decay=Q.decay,Q.castShadow){const ee=Q.shadow,I=t.get(Q);I.shadowIntensity=ee.intensity,I.shadowBias=ee.bias,I.shadowNormalBias=ee.normalBias,I.shadowRadius=ee.radius,I.shadowMapSize=ee.mapSize,I.shadowCameraNear=ee.camera.near,I.shadowCameraFar=ee.camera.far,i.pointShadow[E]=I,i.pointShadowMap[E]=H,i.pointShadowMatrix[E]=Q.shadow.matrix,M++}i.point[E]=y,E++}else if(Q.isHemisphereLight){const y=e.get(Q);y.skyColor.copy(Q.color).multiplyScalar(K),y.groundColor.copy(Q.groundColor).multiplyScalar(K),i.hemi[x]=y,x++}}T>0&&(o.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Fe.LTC_FLOAT_1,i.rectAreaLTC2=Fe.LTC_FLOAT_2):(i.rectAreaLTC1=Fe.LTC_HALF_1,i.rectAreaLTC2=Fe.LTC_HALF_2)),i.ambient[0]=A,i.ambient[1]=_,i.ambient[2]=b;const V=i.hash;(V.directionalLength!==w||V.pointLength!==E||V.spotLength!==C||V.rectAreaLength!==T||V.hemiLength!==x||V.numDirectionalShadows!==P||V.numPointShadows!==M||V.numSpotShadows!==B||V.numSpotMaps!==D||V.numLightProbes!==U)&&(i.directional.length=w,i.spot.length=C,i.rectArea.length=T,i.point.length=E,i.hemi.length=x,i.directionalShadow.length=P,i.directionalShadowMap.length=P,i.pointShadow.length=M,i.pointShadowMap.length=M,i.spotShadow.length=B,i.spotShadowMap.length=B,i.directionalShadowMatrix.length=P,i.pointShadowMatrix.length=M,i.spotLightMatrix.length=B+D-G,i.spotLightMap.length=D,i.numSpotLightShadowsWithMaps=G,i.numLightProbes=U,V.directionalLength=w,V.pointLength=E,V.spotLength=C,V.rectAreaLength=T,V.hemiLength=x,V.numDirectionalShadows=P,V.numPointShadows=M,V.numSpotShadows=B,V.numSpotMaps=D,V.numLightProbes=U,i.version=dD++)}function p(m,A){let _=0,b=0,w=0,E=0,C=0;const T=A.matrixWorldInverse;for(let x=0,P=m.length;x<P;x++){const M=m[x];if(M.isDirectionalLight){const B=i.directional[_];B.direction.setFromMatrixPosition(M.matrixWorld),a.setFromMatrixPosition(M.target.matrixWorld),B.direction.sub(a),B.direction.transformDirection(T),_++}else if(M.isSpotLight){const B=i.spot[w];B.position.setFromMatrixPosition(M.matrixWorld),B.position.applyMatrix4(T),B.direction.setFromMatrixPosition(M.matrixWorld),a.setFromMatrixPosition(M.target.matrixWorld),B.direction.sub(a),B.direction.transformDirection(T),w++}else if(M.isRectAreaLight){const B=i.rectArea[E];B.position.setFromMatrixPosition(M.matrixWorld),B.position.applyMatrix4(T),u.identity(),l.copy(M.matrixWorld),l.premultiply(T),u.extractRotation(l),B.halfWidth.set(M.width*.5,0,0),B.halfHeight.set(0,M.height*.5,0),B.halfWidth.applyMatrix4(u),B.halfHeight.applyMatrix4(u),E++}else if(M.isPointLight){const B=i.point[b];B.position.setFromMatrixPosition(M.matrixWorld),B.position.applyMatrix4(T),b++}else if(M.isHemisphereLight){const B=i.hemi[C];B.direction.setFromMatrixPosition(M.matrixWorld),B.direction.transformDirection(T),C++}}}return{setup:d,setupView:p,state:i}}function cb(o){const e=new pD(o),t=[],i=[];function a(A){m.camera=A,t.length=0,i.length=0}function l(A){t.push(A)}function u(A){i.push(A)}function d(){e.setup(t)}function p(A){e.setupView(t,A)}const m={lightsArray:t,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:a,state:m,setupLights:d,setupLightsView:p,pushLight:l,pushShadow:u}}function mD(o){let e=new WeakMap;function t(a,l=0){const u=e.get(a);let d;return u===void 0?(d=new cb(o),e.set(a,[d])):l>=u.length?(d=new cb(o),u.push(d)):d=u[l],d}function i(){e=new WeakMap}return{get:t,dispose:i}}const gD=`void main() {
|
|
3848
|
+
`+I)}else Z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Z):(K===""||s==="")&&(y=!1);y&&(Q.diagnostics={runnable:H,programLog:Z,vertexShader:{log:K,prefix:T},fragmentShader:{log:s,prefix:x}})}a.deleteShader(D),a.deleteShader(G),V=new Ed(a,C),k=QL(a,C)}let V;this.getUniforms=function(){return V===void 0&&U(this),V};let k;this.getAttributes=function(){return k===void 0&&U(this),k};let z=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return z===!1&&(z=a.getProgramParameter(C,OL)),z},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(C),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=kL++,this.cacheKey=e,this.usedTimes=1,this.program=C,this.vertexShader=D,this.fragmentShader=G,this}let nD=0;class sD{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(t),l=this._getShaderStage(i),u=this._getShaderCacheForMaterial(e);return u.has(a)===!1&&(u.add(a),a.usedTimes++),u.has(l)===!1&&(u.add(l),l.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new rD(e),t.set(e,i)),i}}class rD{constructor(e){this.id=nD++,this.code=e,this.usedTimes=0}}function aD(o,e,t,i,a,l,u){const d=new O0,p=new sD,m=new Set,A=[],_=a.logarithmicDepthBuffer,b=a.vertexTextures;let w=a.precision;const E={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 C(k){return m.add(k),k===0?"uv":`uv${k}`}function T(k,z,Q,Z,K){const s=Z.fog,H=K.geometry,y=k.isMeshStandardMaterial?Z.environment:null,ee=(k.isMeshStandardMaterial?t:e).get(k.envMap||y),I=ee&&ee.mapping===Pf?ee.image.height:null,re=E[k.type];k.precision!==null&&(w=a.getMaxPrecision(k.precision),w!==k.precision&&console.warn("THREE.WebGLProgram.getParameters:",k.precision,"not supported, using",w,"instead."));const Ae=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,N=Ae!==void 0?Ae.length:0;let n=0;H.morphAttributes.position!==void 0&&(n=1),H.morphAttributes.normal!==void 0&&(n=2),H.morphAttributes.color!==void 0&&(n=3);let r,c,h,f;if(re){const Ct=ys[re];r=Ct.vertexShader,c=Ct.fragmentShader}else r=k.vertexShader,c=k.fragmentShader,p.update(k),h=p.getVertexShaderID(k),f=p.getFragmentShaderID(k);const g=o.getRenderTarget(),v=o.state.buffers.depth.getReversed(),S=K.isInstancedMesh===!0,R=K.isBatchedMesh===!0,L=!!k.map,F=!!k.matcap,$=!!ee,O=!!k.aoMap,W=!!k.lightMap,Y=!!k.bumpMap,te=!!k.normalMap,X=!!k.displacementMap,ie=!!k.emissiveMap,de=!!k.metalnessMap,q=!!k.roughnessMap,j=k.anisotropy>0,ae=k.clearcoat>0,ge=k.dispersion>0,fe=k.iridescence>0,ue=k.sheen>0,ve=k.transmission>0,Re=j&&!!k.anisotropyMap,Le=ae&&!!k.clearcoatMap,Xe=ae&&!!k.clearcoatNormalMap,xe=ae&&!!k.clearcoatRoughnessMap,Pe=fe&&!!k.iridescenceMap,Ie=fe&&!!k.iridescenceThicknessMap,Ue=ue&&!!k.sheenColorMap,Ne=ue&&!!k.sheenRoughnessMap,et=!!k.specularMap,Ke=!!k.specularColorMap,pt=!!k.specularIntensityMap,ne=ve&&!!k.transmissionMap,Oe=ve&&!!k.thicknessMap,ye=!!k.gradientMap,we=!!k.alphaMap,ze=k.alphaTest>0,$e=!!k.alphaHash,qe=!!k.extensions;let Ot=Ss;k.toneMapped&&(g===null||g.isXRRenderTarget===!0)&&(Ot=o.toneMapping);const wi={shaderID:re,shaderType:k.type,shaderName:k.name,vertexShader:r,fragmentShader:c,defines:k.defines,customVertexShaderID:h,customFragmentShaderID:f,isRawShaderMaterial:k.isRawShaderMaterial===!0,glslVersion:k.glslVersion,precision:w,batching:R,batchingColor:R&&K._colorsTexture!==null,instancing:S,instancingColor:S&&K.instanceColor!==null,instancingMorph:S&&K.morphTexture!==null,supportsVertexTextures:b,outputColorSpace:g===null?o.outputColorSpace:g.isXRRenderTarget===!0?g.texture.colorSpace:qt,alphaToCoverage:!!k.alphaToCoverage,map:L,matcap:F,envMap:$,envMapMode:$&&ee.mapping,envMapCubeUVHeight:I,aoMap:O,lightMap:W,bumpMap:Y,normalMap:te,displacementMap:b&&X,emissiveMap:ie,normalMapObjectSpace:te&&k.normalMapType===aM,normalMapTangentSpace:te&&k.normalMapType===yS,metalnessMap:de,roughnessMap:q,anisotropy:j,anisotropyMap:Re,clearcoat:ae,clearcoatMap:Le,clearcoatNormalMap:Xe,clearcoatRoughnessMap:xe,dispersion:ge,iridescence:fe,iridescenceMap:Pe,iridescenceThicknessMap:Ie,sheen:ue,sheenColorMap:Ue,sheenRoughnessMap:Ne,specularMap:et,specularColorMap:Ke,specularIntensityMap:pt,transmission:ve,transmissionMap:ne,thicknessMap:Oe,gradientMap:ye,opaque:k.transparent===!1&&k.blending===sl&&k.alphaToCoverage===!1,alphaMap:we,alphaTest:ze,alphaHash:$e,combine:k.combine,mapUv:L&&C(k.map.channel),aoMapUv:O&&C(k.aoMap.channel),lightMapUv:W&&C(k.lightMap.channel),bumpMapUv:Y&&C(k.bumpMap.channel),normalMapUv:te&&C(k.normalMap.channel),displacementMapUv:X&&C(k.displacementMap.channel),emissiveMapUv:ie&&C(k.emissiveMap.channel),metalnessMapUv:de&&C(k.metalnessMap.channel),roughnessMapUv:q&&C(k.roughnessMap.channel),anisotropyMapUv:Re&&C(k.anisotropyMap.channel),clearcoatMapUv:Le&&C(k.clearcoatMap.channel),clearcoatNormalMapUv:Xe&&C(k.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:xe&&C(k.clearcoatRoughnessMap.channel),iridescenceMapUv:Pe&&C(k.iridescenceMap.channel),iridescenceThicknessMapUv:Ie&&C(k.iridescenceThicknessMap.channel),sheenColorMapUv:Ue&&C(k.sheenColorMap.channel),sheenRoughnessMapUv:Ne&&C(k.sheenRoughnessMap.channel),specularMapUv:et&&C(k.specularMap.channel),specularColorMapUv:Ke&&C(k.specularColorMap.channel),specularIntensityMapUv:pt&&C(k.specularIntensityMap.channel),transmissionMapUv:ne&&C(k.transmissionMap.channel),thicknessMapUv:Oe&&C(k.thicknessMap.channel),alphaMapUv:we&&C(k.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(te||j),vertexColors:k.vertexColors,vertexAlphas:k.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,pointsUvs:K.isPoints===!0&&!!H.attributes.uv&&(L||we),fog:!!s,useFog:k.fog===!0,fogExp2:!!s&&s.isFogExp2,flatShading:k.flatShading===!0,sizeAttenuation:k.sizeAttenuation===!0,logarithmicDepthBuffer:_,reverseDepthBuffer:v,skinning:K.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:N,morphTextureStride:n,numDirLights:z.directional.length,numPointLights:z.point.length,numSpotLights:z.spot.length,numSpotLightMaps:z.spotLightMap.length,numRectAreaLights:z.rectArea.length,numHemiLights:z.hemi.length,numDirLightShadows:z.directionalShadowMap.length,numPointLightShadows:z.pointShadowMap.length,numSpotLightShadows:z.spotShadowMap.length,numSpotLightShadowsWithMaps:z.numSpotLightShadowsWithMaps,numLightProbes:z.numLightProbes,numClippingPlanes:u.numPlanes,numClipIntersection:u.numIntersection,dithering:k.dithering,shadowMapEnabled:o.shadowMap.enabled&&Q.length>0,shadowMapType:o.shadowMap.type,toneMapping:Ot,decodeVideoTexture:L&&k.map.isVideoTexture===!0&&wt.getTransfer(k.map.colorSpace)===Gt,decodeVideoTextureEmissive:ie&&k.emissiveMap.isVideoTexture===!0&&wt.getTransfer(k.emissiveMap.colorSpace)===Gt,premultipliedAlpha:k.premultipliedAlpha,doubleSided:k.side===Ri,flipSided:k.side===Fi,useDepthPacking:k.depthPacking>=0,depthPacking:k.depthPacking||0,index0AttributeName:k.index0AttributeName,extensionClipCullDistance:qe&&k.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(qe&&k.extensions.multiDraw===!0||R)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:k.customProgramCacheKey()};return wi.vertexUv1s=m.has(1),wi.vertexUv2s=m.has(2),wi.vertexUv3s=m.has(3),m.clear(),wi}function x(k){const z=[];if(k.shaderID?z.push(k.shaderID):(z.push(k.customVertexShaderID),z.push(k.customFragmentShaderID)),k.defines!==void 0)for(const Q in k.defines)z.push(Q),z.push(k.defines[Q]);return k.isRawShaderMaterial===!1&&(P(z,k),M(z,k),z.push(o.outputColorSpace)),z.push(k.customProgramCacheKey),z.join()}function P(k,z){k.push(z.precision),k.push(z.outputColorSpace),k.push(z.envMapMode),k.push(z.envMapCubeUVHeight),k.push(z.mapUv),k.push(z.alphaMapUv),k.push(z.lightMapUv),k.push(z.aoMapUv),k.push(z.bumpMapUv),k.push(z.normalMapUv),k.push(z.displacementMapUv),k.push(z.emissiveMapUv),k.push(z.metalnessMapUv),k.push(z.roughnessMapUv),k.push(z.anisotropyMapUv),k.push(z.clearcoatMapUv),k.push(z.clearcoatNormalMapUv),k.push(z.clearcoatRoughnessMapUv),k.push(z.iridescenceMapUv),k.push(z.iridescenceThicknessMapUv),k.push(z.sheenColorMapUv),k.push(z.sheenRoughnessMapUv),k.push(z.specularMapUv),k.push(z.specularColorMapUv),k.push(z.specularIntensityMapUv),k.push(z.transmissionMapUv),k.push(z.thicknessMapUv),k.push(z.combine),k.push(z.fogExp2),k.push(z.sizeAttenuation),k.push(z.morphTargetsCount),k.push(z.morphAttributeCount),k.push(z.numDirLights),k.push(z.numPointLights),k.push(z.numSpotLights),k.push(z.numSpotLightMaps),k.push(z.numHemiLights),k.push(z.numRectAreaLights),k.push(z.numDirLightShadows),k.push(z.numPointLightShadows),k.push(z.numSpotLightShadows),k.push(z.numSpotLightShadowsWithMaps),k.push(z.numLightProbes),k.push(z.shadowMapType),k.push(z.toneMapping),k.push(z.numClippingPlanes),k.push(z.numClipIntersection),k.push(z.depthPacking)}function M(k,z){d.disableAll(),z.supportsVertexTextures&&d.enable(0),z.instancing&&d.enable(1),z.instancingColor&&d.enable(2),z.instancingMorph&&d.enable(3),z.matcap&&d.enable(4),z.envMap&&d.enable(5),z.normalMapObjectSpace&&d.enable(6),z.normalMapTangentSpace&&d.enable(7),z.clearcoat&&d.enable(8),z.iridescence&&d.enable(9),z.alphaTest&&d.enable(10),z.vertexColors&&d.enable(11),z.vertexAlphas&&d.enable(12),z.vertexUv1s&&d.enable(13),z.vertexUv2s&&d.enable(14),z.vertexUv3s&&d.enable(15),z.vertexTangents&&d.enable(16),z.anisotropy&&d.enable(17),z.alphaHash&&d.enable(18),z.batching&&d.enable(19),z.dispersion&&d.enable(20),z.batchingColor&&d.enable(21),k.push(d.mask),d.disableAll(),z.fog&&d.enable(0),z.useFog&&d.enable(1),z.flatShading&&d.enable(2),z.logarithmicDepthBuffer&&d.enable(3),z.reverseDepthBuffer&&d.enable(4),z.skinning&&d.enable(5),z.morphTargets&&d.enable(6),z.morphNormals&&d.enable(7),z.morphColors&&d.enable(8),z.premultipliedAlpha&&d.enable(9),z.shadowMapEnabled&&d.enable(10),z.doubleSided&&d.enable(11),z.flipSided&&d.enable(12),z.useDepthPacking&&d.enable(13),z.dithering&&d.enable(14),z.transmission&&d.enable(15),z.sheen&&d.enable(16),z.opaque&&d.enable(17),z.pointsUvs&&d.enable(18),z.decodeVideoTexture&&d.enable(19),z.decodeVideoTextureEmissive&&d.enable(20),z.alphaToCoverage&&d.enable(21),k.push(d.mask)}function B(k){const z=E[k.type];let Q;if(z){const Z=ys[z];Q=IS.clone(Z.uniforms)}else Q=k.uniforms;return Q}function D(k,z){let Q;for(let Z=0,K=A.length;Z<K;Z++){const s=A[Z];if(s.cacheKey===z){Q=s,++Q.usedTimes;break}}return Q===void 0&&(Q=new iD(o,z,k,l),A.push(Q)),Q}function G(k){if(--k.usedTimes===0){const z=A.indexOf(k);A[z]=A[A.length-1],A.pop(),k.destroy()}}function U(k){p.remove(k)}function V(){p.dispose()}return{getParameters:T,getProgramCacheKey:x,getUniforms:B,acquireProgram:D,releaseProgram:G,releaseShaderCache:U,programs:A,dispose:V}}function oD(){let o=new WeakMap;function e(u){return o.has(u)}function t(u){let d=o.get(u);return d===void 0&&(d={},o.set(u,d)),d}function i(u){o.delete(u)}function a(u,d,p){o.get(u)[d]=p}function l(){o=new WeakMap}return{has:e,get:t,remove:i,update:a,dispose:l}}function lD(o,e){return o.groupOrder!==e.groupOrder?o.groupOrder-e.groupOrder:o.renderOrder!==e.renderOrder?o.renderOrder-e.renderOrder:o.material.id!==e.material.id?o.material.id-e.material.id:o.z!==e.z?o.z-e.z:o.id-e.id}function ob(o,e){return o.groupOrder!==e.groupOrder?o.groupOrder-e.groupOrder:o.renderOrder!==e.renderOrder?o.renderOrder-e.renderOrder:o.z!==e.z?e.z-o.z:o.id-e.id}function lb(){const o=[];let e=0;const t=[],i=[],a=[];function l(){e=0,t.length=0,i.length=0,a.length=0}function u(_,b,w,E,C,T){let x=o[e];return x===void 0?(x={id:_.id,object:_,geometry:b,material:w,groupOrder:E,renderOrder:_.renderOrder,z:C,group:T},o[e]=x):(x.id=_.id,x.object=_,x.geometry=b,x.material=w,x.groupOrder=E,x.renderOrder=_.renderOrder,x.z=C,x.group=T),e++,x}function d(_,b,w,E,C,T){const x=u(_,b,w,E,C,T);w.transmission>0?i.push(x):w.transparent===!0?a.push(x):t.push(x)}function p(_,b,w,E,C,T){const x=u(_,b,w,E,C,T);w.transmission>0?i.unshift(x):w.transparent===!0?a.unshift(x):t.unshift(x)}function m(_,b){t.length>1&&t.sort(_||lD),i.length>1&&i.sort(b||ob),a.length>1&&a.sort(b||ob)}function A(){for(let _=e,b=o.length;_<b;_++){const w=o[_];if(w.id===null)break;w.id=null,w.object=null,w.geometry=null,w.material=null,w.group=null}}return{opaque:t,transmissive:i,transparent:a,init:l,push:d,unshift:p,finish:A,sort:m}}function cD(){let o=new WeakMap;function e(i,a){const l=o.get(i);let u;return l===void 0?(u=new lb,o.set(i,[u])):a>=l.length?(u=new lb,l.push(u)):u=l[a],u}function t(){o=new WeakMap}return{get:e,dispose:t}}function uD(){const o={};return{get:function(e){if(o[e.id]!==void 0)return o[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new se,color:new Ye};break;case"SpotLight":t={position:new se,direction:new se,color:new Ye,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new se,color:new Ye,distance:0,decay:0};break;case"HemisphereLight":t={direction:new se,skyColor:new Ye,groundColor:new Ye};break;case"RectAreaLight":t={color:new Ye,position:new se,halfWidth:new se,halfHeight:new se};break}return o[e.id]=t,t}}}function hD(){const o={};return{get:function(e){if(o[e.id]!==void 0)return o[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ve,shadowCameraNear:1,shadowCameraFar:1e3};break}return o[e.id]=t,t}}}let dD=0;function fD(o,e){return(e.castShadow?2:0)-(o.castShadow?2:0)+(e.map?1:0)-(o.map?1:0)}function pD(o){const e=new uD,t=hD(),i={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 m=0;m<9;m++)i.probe.push(new se);const a=new se,l=new tt,u=new tt;function d(m){let A=0,_=0,b=0;for(let k=0;k<9;k++)i.probe[k].set(0,0,0);let w=0,E=0,C=0,T=0,x=0,P=0,M=0,B=0,D=0,G=0,U=0;m.sort(fD);for(let k=0,z=m.length;k<z;k++){const Q=m[k],Z=Q.color,K=Q.intensity,s=Q.distance,H=Q.shadow&&Q.shadow.map?Q.shadow.map.texture:null;if(Q.isAmbientLight)A+=Z.r*K,_+=Z.g*K,b+=Z.b*K;else if(Q.isLightProbe){for(let y=0;y<9;y++)i.probe[y].addScaledVector(Q.sh.coefficients[y],K);U++}else if(Q.isDirectionalLight){const y=e.get(Q);if(y.color.copy(Q.color).multiplyScalar(Q.intensity),Q.castShadow){const ee=Q.shadow,I=t.get(Q);I.shadowIntensity=ee.intensity,I.shadowBias=ee.bias,I.shadowNormalBias=ee.normalBias,I.shadowRadius=ee.radius,I.shadowMapSize=ee.mapSize,i.directionalShadow[w]=I,i.directionalShadowMap[w]=H,i.directionalShadowMatrix[w]=Q.shadow.matrix,P++}i.directional[w]=y,w++}else if(Q.isSpotLight){const y=e.get(Q);y.position.setFromMatrixPosition(Q.matrixWorld),y.color.copy(Z).multiplyScalar(K),y.distance=s,y.coneCos=Math.cos(Q.angle),y.penumbraCos=Math.cos(Q.angle*(1-Q.penumbra)),y.decay=Q.decay,i.spot[C]=y;const ee=Q.shadow;if(Q.map&&(i.spotLightMap[D]=Q.map,D++,ee.updateMatrices(Q),Q.castShadow&&G++),i.spotLightMatrix[C]=ee.matrix,Q.castShadow){const I=t.get(Q);I.shadowIntensity=ee.intensity,I.shadowBias=ee.bias,I.shadowNormalBias=ee.normalBias,I.shadowRadius=ee.radius,I.shadowMapSize=ee.mapSize,i.spotShadow[C]=I,i.spotShadowMap[C]=H,B++}C++}else if(Q.isRectAreaLight){const y=e.get(Q);y.color.copy(Z).multiplyScalar(K),y.halfWidth.set(Q.width*.5,0,0),y.halfHeight.set(0,Q.height*.5,0),i.rectArea[T]=y,T++}else if(Q.isPointLight){const y=e.get(Q);if(y.color.copy(Q.color).multiplyScalar(Q.intensity),y.distance=Q.distance,y.decay=Q.decay,Q.castShadow){const ee=Q.shadow,I=t.get(Q);I.shadowIntensity=ee.intensity,I.shadowBias=ee.bias,I.shadowNormalBias=ee.normalBias,I.shadowRadius=ee.radius,I.shadowMapSize=ee.mapSize,I.shadowCameraNear=ee.camera.near,I.shadowCameraFar=ee.camera.far,i.pointShadow[E]=I,i.pointShadowMap[E]=H,i.pointShadowMatrix[E]=Q.shadow.matrix,M++}i.point[E]=y,E++}else if(Q.isHemisphereLight){const y=e.get(Q);y.skyColor.copy(Q.color).multiplyScalar(K),y.groundColor.copy(Q.groundColor).multiplyScalar(K),i.hemi[x]=y,x++}}T>0&&(o.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Fe.LTC_FLOAT_1,i.rectAreaLTC2=Fe.LTC_FLOAT_2):(i.rectAreaLTC1=Fe.LTC_HALF_1,i.rectAreaLTC2=Fe.LTC_HALF_2)),i.ambient[0]=A,i.ambient[1]=_,i.ambient[2]=b;const V=i.hash;(V.directionalLength!==w||V.pointLength!==E||V.spotLength!==C||V.rectAreaLength!==T||V.hemiLength!==x||V.numDirectionalShadows!==P||V.numPointShadows!==M||V.numSpotShadows!==B||V.numSpotMaps!==D||V.numLightProbes!==U)&&(i.directional.length=w,i.spot.length=C,i.rectArea.length=T,i.point.length=E,i.hemi.length=x,i.directionalShadow.length=P,i.directionalShadowMap.length=P,i.pointShadow.length=M,i.pointShadowMap.length=M,i.spotShadow.length=B,i.spotShadowMap.length=B,i.directionalShadowMatrix.length=P,i.pointShadowMatrix.length=M,i.spotLightMatrix.length=B+D-G,i.spotLightMap.length=D,i.numSpotLightShadowsWithMaps=G,i.numLightProbes=U,V.directionalLength=w,V.pointLength=E,V.spotLength=C,V.rectAreaLength=T,V.hemiLength=x,V.numDirectionalShadows=P,V.numPointShadows=M,V.numSpotShadows=B,V.numSpotMaps=D,V.numLightProbes=U,i.version=dD++)}function p(m,A){let _=0,b=0,w=0,E=0,C=0;const T=A.matrixWorldInverse;for(let x=0,P=m.length;x<P;x++){const M=m[x];if(M.isDirectionalLight){const B=i.directional[_];B.direction.setFromMatrixPosition(M.matrixWorld),a.setFromMatrixPosition(M.target.matrixWorld),B.direction.sub(a),B.direction.transformDirection(T),_++}else if(M.isSpotLight){const B=i.spot[w];B.position.setFromMatrixPosition(M.matrixWorld),B.position.applyMatrix4(T),B.direction.setFromMatrixPosition(M.matrixWorld),a.setFromMatrixPosition(M.target.matrixWorld),B.direction.sub(a),B.direction.transformDirection(T),w++}else if(M.isRectAreaLight){const B=i.rectArea[E];B.position.setFromMatrixPosition(M.matrixWorld),B.position.applyMatrix4(T),u.identity(),l.copy(M.matrixWorld),l.premultiply(T),u.extractRotation(l),B.halfWidth.set(M.width*.5,0,0),B.halfHeight.set(0,M.height*.5,0),B.halfWidth.applyMatrix4(u),B.halfHeight.applyMatrix4(u),E++}else if(M.isPointLight){const B=i.point[b];B.position.setFromMatrixPosition(M.matrixWorld),B.position.applyMatrix4(T),b++}else if(M.isHemisphereLight){const B=i.hemi[C];B.direction.setFromMatrixPosition(M.matrixWorld),B.direction.transformDirection(T),C++}}}return{setup:d,setupView:p,state:i}}function cb(o){const e=new pD(o),t=[],i=[];function a(A){m.camera=A,t.length=0,i.length=0}function l(A){t.push(A)}function u(A){i.push(A)}function d(){e.setup(t)}function p(A){e.setupView(t,A)}const m={lightsArray:t,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:a,state:m,setupLights:d,setupLightsView:p,pushLight:l,pushShadow:u}}function mD(o){let e=new WeakMap;function t(a,l=0){const u=e.get(a);let d;return u===void 0?(d=new cb(o),e.set(a,[d])):l>=u.length?(d=new cb(o),u.push(d)):d=u[l],d}function i(){e=new WeakMap}return{get:t,dispose:i}}const gD=`void main() {
|
|
3849
3849
|
gl_Position = vec4( position, 1.0 );
|
|
3850
3850
|
}`,AD=`uniform sampler2D shadow_pass;
|
|
3851
3851
|
uniform vec2 resolution;
|
|
@@ -3873,7 +3873,7 @@ void main() {
|
|
|
3873
3873
|
squared_mean = squared_mean / samples;
|
|
3874
3874
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
3875
3875
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
3876
|
-
}`;function _D(o,e,t){let i=new $0;const a=new Ve,l=new Ve,u=new Rt,d=new G0({depthPacking:rM}),p=new mR,m={},A=t.maxTextureSize,_={[hs]:Fi,[Fi]:hs,[Ri]:Ri},b=new zi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ve},radius:{value:4}},vertexShader:gD,fragmentShader:AD}),w=b.clone();w.defines.HORIZONTAL_PASS=1;const E=new Di;E.setAttribute("position",new Vt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const C=new lt(E,b),T=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=x0;let x=this.type;this.render=function(G,U,V){if(T.enabled===!1||T.autoUpdate===!1&&T.needsUpdate===!1||G.length===0)return;const k=o.getRenderTarget(),z=o.getActiveCubeFace(),Q=o.getActiveMipmapLevel(),Z=o.state;Z.setBlending(cs),Z.buffers.color.setClear(1,1,1,1),Z.buffers.depth.setTest(!0),Z.setScissorTest(!1);const K=x!==Xs&&this.type===Xs,s=x===Xs&&this.type!==Xs;for(let H=0,y=G.length;H<y;H++){const ee=G[H],I=ee.shadow;if(I===void 0){console.warn("THREE.WebGLShadowMap:",ee,"has no shadow.");continue}if(I.autoUpdate===!1&&I.needsUpdate===!1)continue;a.copy(I.mapSize);const re=I.getFrameExtents();if(a.multiply(re),l.copy(I.mapSize),(a.x>A||a.y>A)&&(a.x>A&&(l.x=Math.floor(A/re.x),a.x=l.x*re.x,I.mapSize.x=l.x),a.y>A&&(l.y=Math.floor(A/re.y),a.y=l.y*re.y,I.mapSize.y=l.y)),I.map===null||K===!0||s===!0){const N=this.type!==Xs?{minFilter:gi,magFilter:gi}:{};I.map!==null&&I.map.dispose(),I.map=new dn(a.x,a.y,N),I.map.texture.name=ee.name+".shadowMap",I.camera.updateProjectionMatrix()}o.setRenderTarget(I.map),o.clear();const Ae=I.getViewportCount();for(let N=0;N<Ae;N++){const n=I.getViewport(N);u.set(l.x*n.x,l.y*n.y,l.x*n.z,l.y*n.w),Z.viewport(u),I.updateMatrices(ee,N),i=I.getFrustum(),B(U,V,I.camera,ee,this.type)}I.isPointLightShadow!==!0&&this.type===Xs&&P(I,V),I.needsUpdate=!1}x=this.type,T.needsUpdate=!1,o.setRenderTarget(k,z,Q)};function P(G,U){const V=e.update(C);b.defines.VSM_SAMPLES!==G.blurSamples&&(b.defines.VSM_SAMPLES=G.blurSamples,w.defines.VSM_SAMPLES=G.blurSamples,b.needsUpdate=!0,w.needsUpdate=!0),G.mapPass===null&&(G.mapPass=new dn(a.x,a.y)),b.uniforms.shadow_pass.value=G.map.texture,b.uniforms.resolution.value=G.mapSize,b.uniforms.radius.value=G.radius,o.setRenderTarget(G.mapPass),o.clear(),o.renderBufferDirect(U,null,V,b,C,null),w.uniforms.shadow_pass.value=G.mapPass.texture,w.uniforms.resolution.value=G.mapSize,w.uniforms.radius.value=G.radius,o.setRenderTarget(G.map),o.clear(),o.renderBufferDirect(U,null,V,w,C,null)}function M(G,U,V,k){let z=null;const Q=V.isPointLight===!0?G.customDistanceMaterial:G.customDepthMaterial;if(Q!==void 0)z=Q;else if(z=V.isPointLight===!0?p:d,o.localClippingEnabled&&U.clipShadows===!0&&Array.isArray(U.clippingPlanes)&&U.clippingPlanes.length!==0||U.displacementMap&&U.displacementScale!==0||U.alphaMap&&U.alphaTest>0||U.map&&U.alphaTest>0){const Z=z.uuid,K=U.uuid;let s=m[Z];s===void 0&&(s={},m[Z]=s);let H=s[K];H===void 0&&(H=z.clone(),s[K]=H,U.addEventListener("dispose",D)),z=H}if(z.visible=U.visible,z.wireframe=U.wireframe,k===Xs?z.side=U.shadowSide!==null?U.shadowSide:U.side:z.side=U.shadowSide!==null?U.shadowSide:_[U.side],z.alphaMap=U.alphaMap,z.alphaTest=U.alphaTest,z.map=U.map,z.clipShadows=U.clipShadows,z.clippingPlanes=U.clippingPlanes,z.clipIntersection=U.clipIntersection,z.displacementMap=U.displacementMap,z.displacementScale=U.displacementScale,z.displacementBias=U.displacementBias,z.wireframeLinewidth=U.wireframeLinewidth,z.linewidth=U.linewidth,V.isPointLight===!0&&z.isMeshDistanceMaterial===!0){const Z=o.properties.get(z);Z.light=V}return z}function B(G,U,V,k,z){if(G.visible===!1)return;if(G.layers.test(U.layers)&&(G.isMesh||G.isLine||G.isPoints)&&(G.castShadow||G.receiveShadow&&z===Xs)&&(!G.frustumCulled||i.intersectsObject(G))){G.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,G.matrixWorld);const K=e.update(G),s=G.material;if(Array.isArray(s)){const H=K.groups;for(let y=0,ee=H.length;y<ee;y++){const I=H[y],re=s[I.materialIndex];if(re&&re.visible){const Ae=M(G,re,k,z);G.onBeforeShadow(o,G,U,V,K,Ae,I),o.renderBufferDirect(V,null,K,Ae,G,I),G.onAfterShadow(o,G,U,V,K,Ae,I)}}}else if(s.visible){const H=M(G,s,k,z);G.onBeforeShadow(o,G,U,V,K,H,null),o.renderBufferDirect(V,null,K,H,G,null),G.onAfterShadow(o,G,U,V,K,H,null)}}const Z=G.children;for(let K=0,s=Z.length;K<s;K++)B(Z[K],U,V,k,z)}function D(G){G.target.removeEventListener("dispose",D);for(const V in m){const k=m[V],z=G.target.uuid;z in k&&(k[z].dispose(),delete k[z])}}}const yD={[jg]:qg,[Wg]:Kg,[Yg]:Jg,[ml]:Xg,[qg]:jg,[Kg]:Wg,[Jg]:Yg,[Xg]:ml};function bD(o,e){function t(){let ne=!1;const Oe=new Rt;let ye=null;const we=new Rt(0,0,0,0);return{setMask:function(ze){ye!==ze&&!ne&&(o.colorMask(ze,ze,ze,ze),ye=ze)},setLocked:function(ze){ne=ze},setClear:function(ze,$e,qe,Ot,wi){wi===!0&&(ze*=Ot,$e*=Ot,qe*=Ot),Oe.set(ze,$e,qe,Ot),we.equals(Oe)===!1&&(o.clearColor(ze,$e,qe,Ot),we.copy(Oe))},reset:function(){ne=!1,ye=null,we.set(-1,0,0,0)}}}function i(){let ne=!1,Oe=!1,ye=null,we=null,ze=null;return{setReversed:function($e){if(Oe!==$e){const qe=e.get("EXT_clip_control");Oe?qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.ZERO_TO_ONE_EXT):qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.NEGATIVE_ONE_TO_ONE_EXT);const Ot=ze;ze=null,this.setClear(Ot)}Oe=$e},getReversed:function(){return Oe},setTest:function($e){$e?g(o.DEPTH_TEST):v(o.DEPTH_TEST)},setMask:function($e){ye!==$e&&!ne&&(o.depthMask($e),ye=$e)},setFunc:function($e){if(Oe&&($e=yD[$e]),we!==$e){switch($e){case jg:o.depthFunc(o.NEVER);break;case qg:o.depthFunc(o.ALWAYS);break;case Wg:o.depthFunc(o.LESS);break;case ml:o.depthFunc(o.LEQUAL);break;case Yg:o.depthFunc(o.EQUAL);break;case Xg:o.depthFunc(o.GEQUAL);break;case Kg:o.depthFunc(o.GREATER);break;case Jg:o.depthFunc(o.NOTEQUAL);break;default:o.depthFunc(o.LEQUAL)}we=$e}},setLocked:function($e){ne=$e},setClear:function($e){ze!==$e&&(Oe&&($e=1-$e),o.clearDepth($e),ze=$e)},reset:function(){ne=!1,ye=null,we=null,ze=null,Oe=!1}}}function a(){let ne=!1,Oe=null,ye=null,we=null,ze=null,$e=null,qe=null,Ot=null,wi=null;return{setTest:function(Ct){ne||(Ct?g(o.STENCIL_TEST):v(o.STENCIL_TEST))},setMask:function(Ct){Oe!==Ct&&!ne&&(o.stencilMask(Ct),Oe=Ct)},setFunc:function(Ct,Zi,Nn){(ye!==Ct||we!==Zi||ze!==Nn)&&(o.stencilFunc(Ct,Zi,Nn),ye=Ct,we=Zi,ze=Nn)},setOp:function(Ct,Zi,Nn){($e!==Ct||qe!==Zi||Ot!==Nn)&&(o.stencilOp(Ct,Zi,Nn),$e=Ct,qe=Zi,Ot=Nn)},setLocked:function(Ct){ne=Ct},setClear:function(Ct){wi!==Ct&&(o.clearStencil(Ct),wi=Ct)},reset:function(){ne=!1,Oe=null,ye=null,we=null,ze=null,$e=null,qe=null,Ot=null,wi=null}}}const l=new t,u=new i,d=new a,p=new WeakMap,m=new WeakMap;let A={},_={},b=new WeakMap,w=[],E=null,C=!1,T=null,x=null,P=null,M=null,B=null,D=null,G=null,U=new Ye(0,0,0),V=0,k=!1,z=null,Q=null,Z=null,K=null,s=null;const H=o.getParameter(o.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let y=!1,ee=0;const I=o.getParameter(o.VERSION);I.indexOf("WebGL")!==-1?(ee=parseFloat(/^WebGL (\d)/.exec(I)[1]),y=ee>=1):I.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),y=ee>=2);let re=null,Ae={};const N=o.getParameter(o.SCISSOR_BOX),n=o.getParameter(o.VIEWPORT),r=new Rt().fromArray(N),c=new Rt().fromArray(n);function h(ne,Oe,ye,we){const ze=new Uint8Array(4),$e=o.createTexture();o.bindTexture(ne,$e),o.texParameteri(ne,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(ne,o.TEXTURE_MAG_FILTER,o.NEAREST);for(let qe=0;qe<ye;qe++)ne===o.TEXTURE_3D||ne===o.TEXTURE_2D_ARRAY?o.texImage3D(Oe,0,o.RGBA,1,1,we,0,o.RGBA,o.UNSIGNED_BYTE,ze):o.texImage2D(Oe+qe,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,ze);return $e}const f={};f[o.TEXTURE_2D]=h(o.TEXTURE_2D,o.TEXTURE_2D,1),f[o.TEXTURE_CUBE_MAP]=h(o.TEXTURE_CUBE_MAP,o.TEXTURE_CUBE_MAP_POSITIVE_X,6),f[o.TEXTURE_2D_ARRAY]=h(o.TEXTURE_2D_ARRAY,o.TEXTURE_2D_ARRAY,1,1),f[o.TEXTURE_3D]=h(o.TEXTURE_3D,o.TEXTURE_3D,1,1),l.setClear(0,0,0,1),u.setClear(1),d.setClear(0),g(o.DEPTH_TEST),u.setFunc(ml),Y(!1),te(j_),g(o.CULL_FACE),O(cs);function g(ne){A[ne]!==!0&&(o.enable(ne),A[ne]=!0)}function v(ne){A[ne]!==!1&&(o.disable(ne),A[ne]=!1)}function S(ne,Oe){return _[ne]!==Oe?(o.bindFramebuffer(ne,Oe),_[ne]=Oe,ne===o.DRAW_FRAMEBUFFER&&(_[o.FRAMEBUFFER]=Oe),ne===o.FRAMEBUFFER&&(_[o.DRAW_FRAMEBUFFER]=Oe),!0):!1}function R(ne,Oe){let ye=w,we=!1;if(ne){ye=b.get(Oe),ye===void 0&&(ye=[],b.set(Oe,ye));const ze=ne.textures;if(ye.length!==ze.length||ye[0]!==o.COLOR_ATTACHMENT0){for(let $e=0,qe=ze.length;$e<qe;$e++)ye[$e]=o.COLOR_ATTACHMENT0+$e;ye.length=ze.length,we=!0}}else ye[0]!==o.BACK&&(ye[0]=o.BACK,we=!0);we&&o.drawBuffers(ye)}function L(ne){return E!==ne?(o.useProgram(ne),E=ne,!0):!1}const F={[Ia]:o.FUNC_ADD,[NI]:o.FUNC_SUBTRACT,[OI]:o.FUNC_REVERSE_SUBTRACT};F[kI]=o.MIN,F[UI]=o.MAX;const $={[FI]:o.ZERO,[$I]:o.ONE,[zI]:o.SRC_COLOR,[Vg]:o.SRC_ALPHA,[qI]:o.SRC_ALPHA_SATURATE,[QI]:o.DST_COLOR,[HI]:o.DST_ALPHA,[GI]:o.ONE_MINUS_SRC_COLOR,[Qg]:o.ONE_MINUS_SRC_ALPHA,[jI]:o.ONE_MINUS_DST_COLOR,[VI]:o.ONE_MINUS_DST_ALPHA,[WI]:o.CONSTANT_COLOR,[YI]:o.ONE_MINUS_CONSTANT_COLOR,[XI]:o.CONSTANT_ALPHA,[KI]:o.ONE_MINUS_CONSTANT_ALPHA};function O(ne,Oe,ye,we,ze,$e,qe,Ot,wi,Ct){if(ne===cs){C===!0&&(v(o.BLEND),C=!1);return}if(C===!1&&(g(o.BLEND),C=!0),ne!==DI){if(ne!==T||Ct!==k){if((x!==Ia||B!==Ia)&&(o.blendEquation(o.FUNC_ADD),x=Ia,B=Ia),Ct)switch(ne){case sl:o.blendFuncSeparate(o.ONE,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA);break;case q_:o.blendFunc(o.ONE,o.ONE);break;case W_:o.blendFuncSeparate(o.ZERO,o.ONE_MINUS_SRC_COLOR,o.ZERO,o.ONE);break;case Y_:o.blendFuncSeparate(o.ZERO,o.SRC_COLOR,o.ZERO,o.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",ne);break}else switch(ne){case sl:o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA);break;case q_:o.blendFunc(o.SRC_ALPHA,o.ONE);break;case W_:o.blendFuncSeparate(o.ZERO,o.ONE_MINUS_SRC_COLOR,o.ZERO,o.ONE);break;case Y_:o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",ne);break}P=null,M=null,D=null,G=null,U.set(0,0,0),V=0,T=ne,k=Ct}return}ze=ze||Oe,$e=$e||ye,qe=qe||we,(Oe!==x||ze!==B)&&(o.blendEquationSeparate(F[Oe],F[ze]),x=Oe,B=ze),(ye!==P||we!==M||$e!==D||qe!==G)&&(o.blendFuncSeparate($[ye],$[we],$[$e],$[qe]),P=ye,M=we,D=$e,G=qe),(Ot.equals(U)===!1||wi!==V)&&(o.blendColor(Ot.r,Ot.g,Ot.b,wi),U.copy(Ot),V=wi),T=ne,k=!1}function W(ne,Oe){ne.side===Ri?v(o.CULL_FACE):g(o.CULL_FACE);let ye=ne.side===Fi;Oe&&(ye=!ye),Y(ye),ne.blending===sl&&ne.transparent===!1?O(cs):O(ne.blending,ne.blendEquation,ne.blendSrc,ne.blendDst,ne.blendEquationAlpha,ne.blendSrcAlpha,ne.blendDstAlpha,ne.blendColor,ne.blendAlpha,ne.premultipliedAlpha),u.setFunc(ne.depthFunc),u.setTest(ne.depthTest),u.setMask(ne.depthWrite),l.setMask(ne.colorWrite);const we=ne.stencilWrite;d.setTest(we),we&&(d.setMask(ne.stencilWriteMask),d.setFunc(ne.stencilFunc,ne.stencilRef,ne.stencilFuncMask),d.setOp(ne.stencilFail,ne.stencilZFail,ne.stencilZPass)),ie(ne.polygonOffset,ne.polygonOffsetFactor,ne.polygonOffsetUnits),ne.alphaToCoverage===!0?g(o.SAMPLE_ALPHA_TO_COVERAGE):v(o.SAMPLE_ALPHA_TO_COVERAGE)}function Y(ne){z!==ne&&(ne?o.frontFace(o.CW):o.frontFace(o.CCW),z=ne)}function te(ne){ne!==BI?(g(o.CULL_FACE),ne!==Q&&(ne===j_?o.cullFace(o.BACK):ne===PI?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK))):v(o.CULL_FACE),Q=ne}function X(ne){ne!==Z&&(y&&o.lineWidth(ne),Z=ne)}function ie(ne,Oe,ye){ne?(g(o.POLYGON_OFFSET_FILL),(K!==Oe||s!==ye)&&(o.polygonOffset(Oe,ye),K=Oe,s=ye)):v(o.POLYGON_OFFSET_FILL)}function de(ne){ne?g(o.SCISSOR_TEST):v(o.SCISSOR_TEST)}function q(ne){ne===void 0&&(ne=o.TEXTURE0+H-1),re!==ne&&(o.activeTexture(ne),re=ne)}function j(ne,Oe,ye){ye===void 0&&(re===null?ye=o.TEXTURE0+H-1:ye=re);let we=Ae[ye];we===void 0&&(we={type:void 0,texture:void 0},Ae[ye]=we),(we.type!==ne||we.texture!==Oe)&&(re!==ye&&(o.activeTexture(ye),re=ye),o.bindTexture(ne,Oe||f[ne]),we.type=ne,we.texture=Oe)}function ae(){const ne=Ae[re];ne!==void 0&&ne.type!==void 0&&(o.bindTexture(ne.type,null),ne.type=void 0,ne.texture=void 0)}function ge(){try{o.compressedTexImage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function fe(){try{o.compressedTexImage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ue(){try{o.texSubImage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ve(){try{o.texSubImage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Re(){try{o.compressedTexSubImage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Le(){try{o.compressedTexSubImage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Xe(){try{o.texStorage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function xe(){try{o.texStorage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Pe(){try{o.texImage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Ie(){try{o.texImage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Ue(ne){r.equals(ne)===!1&&(o.scissor(ne.x,ne.y,ne.z,ne.w),r.copy(ne))}function Ne(ne){c.equals(ne)===!1&&(o.viewport(ne.x,ne.y,ne.z,ne.w),c.copy(ne))}function et(ne,Oe){let ye=m.get(Oe);ye===void 0&&(ye=new WeakMap,m.set(Oe,ye));let we=ye.get(ne);we===void 0&&(we=o.getUniformBlockIndex(Oe,ne.name),ye.set(ne,we))}function Ke(ne,Oe){const we=m.get(Oe).get(ne);p.get(Oe)!==we&&(o.uniformBlockBinding(Oe,we,ne.__bindingPointIndex),p.set(Oe,we))}function pt(){o.disable(o.BLEND),o.disable(o.CULL_FACE),o.disable(o.DEPTH_TEST),o.disable(o.POLYGON_OFFSET_FILL),o.disable(o.SCISSOR_TEST),o.disable(o.STENCIL_TEST),o.disable(o.SAMPLE_ALPHA_TO_COVERAGE),o.blendEquation(o.FUNC_ADD),o.blendFunc(o.ONE,o.ZERO),o.blendFuncSeparate(o.ONE,o.ZERO,o.ONE,o.ZERO),o.blendColor(0,0,0,0),o.colorMask(!0,!0,!0,!0),o.clearColor(0,0,0,0),o.depthMask(!0),o.depthFunc(o.LESS),u.setReversed(!1),o.clearDepth(1),o.stencilMask(4294967295),o.stencilFunc(o.ALWAYS,0,4294967295),o.stencilOp(o.KEEP,o.KEEP,o.KEEP),o.clearStencil(0),o.cullFace(o.BACK),o.frontFace(o.CCW),o.polygonOffset(0,0),o.activeTexture(o.TEXTURE0),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.bindFramebuffer(o.READ_FRAMEBUFFER,null),o.useProgram(null),o.lineWidth(1),o.scissor(0,0,o.canvas.width,o.canvas.height),o.viewport(0,0,o.canvas.width,o.canvas.height),A={},re=null,Ae={},_={},b=new WeakMap,w=[],E=null,C=!1,T=null,x=null,P=null,M=null,B=null,D=null,G=null,U=new Ye(0,0,0),V=0,k=!1,z=null,Q=null,Z=null,K=null,s=null,r.set(0,0,o.canvas.width,o.canvas.height),c.set(0,0,o.canvas.width,o.canvas.height),l.reset(),u.reset(),d.reset()}return{buffers:{color:l,depth:u,stencil:d},enable:g,disable:v,bindFramebuffer:S,drawBuffers:R,useProgram:L,setBlending:O,setMaterial:W,setFlipSided:Y,setCullFace:te,setLineWidth:X,setPolygonOffset:ie,setScissorTest:de,activeTexture:q,bindTexture:j,unbindTexture:ae,compressedTexImage2D:ge,compressedTexImage3D:fe,texImage2D:Pe,texImage3D:Ie,updateUBOMapping:et,uniformBlockBinding:Ke,texStorage2D:Xe,texStorage3D:xe,texSubImage2D:ue,texSubImage3D:ve,compressedTexSubImage2D:Re,compressedTexSubImage3D:Le,scissor:Ue,viewport:Ne,reset:pt}}function vD(o,e,t,i,a,l,u){const d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,p=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new Ve,A=new WeakMap;let _;const b=new WeakMap;let w=!1;try{w=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(q,j){return w?new OffscreenCanvas(q,j):xu("canvas")}function C(q,j,ae){let ge=1;const fe=de(q);if((fe.width>ae||fe.height>ae)&&(ge=ae/Math.max(fe.width,fe.height)),ge<1)if(typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&q instanceof ImageBitmap||typeof VideoFrame<"u"&&q instanceof VideoFrame){const ue=Math.floor(ge*fe.width),ve=Math.floor(ge*fe.height);_===void 0&&(_=E(ue,ve));const Re=j?E(ue,ve):_;return Re.width=ue,Re.height=ve,Re.getContext("2d").drawImage(q,0,0,ue,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+fe.width+"x"+fe.height+") to ("+ue+"x"+ve+")."),Re}else return"data"in q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+fe.width+"x"+fe.height+")."),q;return q}function T(q){return q.generateMipmaps}function x(q){o.generateMipmap(q)}function P(q){return q.isWebGLCubeRenderTarget?o.TEXTURE_CUBE_MAP:q.isWebGL3DRenderTarget?o.TEXTURE_3D:q.isWebGLArrayRenderTarget||q.isCompressedArrayTexture?o.TEXTURE_2D_ARRAY:o.TEXTURE_2D}function M(q,j,ae,ge,fe=!1){if(q!==null){if(o[q]!==void 0)return o[q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+q+"'")}let ue=j;if(j===o.RED&&(ae===o.FLOAT&&(ue=o.R32F),ae===o.HALF_FLOAT&&(ue=o.R16F),ae===o.UNSIGNED_BYTE&&(ue=o.R8)),j===o.RED_INTEGER&&(ae===o.UNSIGNED_BYTE&&(ue=o.R8UI),ae===o.UNSIGNED_SHORT&&(ue=o.R16UI),ae===o.UNSIGNED_INT&&(ue=o.R32UI),ae===o.BYTE&&(ue=o.R8I),ae===o.SHORT&&(ue=o.R16I),ae===o.INT&&(ue=o.R32I)),j===o.RG&&(ae===o.FLOAT&&(ue=o.RG32F),ae===o.HALF_FLOAT&&(ue=o.RG16F),ae===o.UNSIGNED_BYTE&&(ue=o.RG8)),j===o.RG_INTEGER&&(ae===o.UNSIGNED_BYTE&&(ue=o.RG8UI),ae===o.UNSIGNED_SHORT&&(ue=o.RG16UI),ae===o.UNSIGNED_INT&&(ue=o.RG32UI),ae===o.BYTE&&(ue=o.RG8I),ae===o.SHORT&&(ue=o.RG16I),ae===o.INT&&(ue=o.RG32I)),j===o.RGB_INTEGER&&(ae===o.UNSIGNED_BYTE&&(ue=o.RGB8UI),ae===o.UNSIGNED_SHORT&&(ue=o.RGB16UI),ae===o.UNSIGNED_INT&&(ue=o.RGB32UI),ae===o.BYTE&&(ue=o.RGB8I),ae===o.SHORT&&(ue=o.RGB16I),ae===o.INT&&(ue=o.RGB32I)),j===o.RGBA_INTEGER&&(ae===o.UNSIGNED_BYTE&&(ue=o.RGBA8UI),ae===o.UNSIGNED_SHORT&&(ue=o.RGBA16UI),ae===o.UNSIGNED_INT&&(ue=o.RGBA32UI),ae===o.BYTE&&(ue=o.RGBA8I),ae===o.SHORT&&(ue=o.RGBA16I),ae===o.INT&&(ue=o.RGBA32I)),j===o.RGB&&ae===o.UNSIGNED_INT_5_9_9_9_REV&&(ue=o.RGB9_E5),j===o.RGBA){const ve=fe?Kd:vt.getTransfer(ge);ae===o.FLOAT&&(ue=o.RGBA32F),ae===o.HALF_FLOAT&&(ue=o.RGBA16F),ae===o.UNSIGNED_BYTE&&(ue=ve===Gt?o.SRGB8_ALPHA8:o.RGBA8),ae===o.UNSIGNED_SHORT_4_4_4_4&&(ue=o.RGBA4),ae===o.UNSIGNED_SHORT_5_5_5_1&&(ue=o.RGB5_A1)}return(ue===o.R16F||ue===o.R32F||ue===o.RG16F||ue===o.RG32F||ue===o.RGBA16F||ue===o.RGBA32F)&&e.get("EXT_color_buffer_float"),ue}function B(q,j){let ae;return q?j===null||j===qr||j===_l?ae=o.DEPTH24_STENCIL8:j===oi?ae=o.DEPTH32F_STENCIL8:j===vu&&(ae=o.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):j===null||j===qr||j===_l?ae=o.DEPTH_COMPONENT24:j===oi?ae=o.DEPTH_COMPONENT32F:j===vu&&(ae=o.DEPTH_COMPONENT16),ae}function D(q,j){return T(q)===!0||q.isFramebufferTexture&&q.minFilter!==gi&&q.minFilter!==wt?Math.log2(Math.max(j.width,j.height))+1:q.mipmaps!==void 0&&q.mipmaps.length>0?q.mipmaps.length:q.isCompressedTexture&&Array.isArray(q.image)?j.mipmaps.length:1}function G(q){const j=q.target;j.removeEventListener("dispose",G),V(j),j.isVideoTexture&&A.delete(j)}function U(q){const j=q.target;j.removeEventListener("dispose",U),z(j)}function V(q){const j=i.get(q);if(j.__webglInit===void 0)return;const ae=q.source,ge=b.get(ae);if(ge){const fe=ge[j.__cacheKey];fe.usedTimes--,fe.usedTimes===0&&k(q),Object.keys(ge).length===0&&b.delete(ae)}i.remove(q)}function k(q){const j=i.get(q);o.deleteTexture(j.__webglTexture);const ae=q.source,ge=b.get(ae);delete ge[j.__cacheKey],u.memory.textures--}function z(q){const j=i.get(q);if(q.depthTexture&&(q.depthTexture.dispose(),i.remove(q.depthTexture)),q.isWebGLCubeRenderTarget)for(let ge=0;ge<6;ge++){if(Array.isArray(j.__webglFramebuffer[ge]))for(let fe=0;fe<j.__webglFramebuffer[ge].length;fe++)o.deleteFramebuffer(j.__webglFramebuffer[ge][fe]);else o.deleteFramebuffer(j.__webglFramebuffer[ge]);j.__webglDepthbuffer&&o.deleteRenderbuffer(j.__webglDepthbuffer[ge])}else{if(Array.isArray(j.__webglFramebuffer))for(let ge=0;ge<j.__webglFramebuffer.length;ge++)o.deleteFramebuffer(j.__webglFramebuffer[ge]);else o.deleteFramebuffer(j.__webglFramebuffer);if(j.__webglDepthbuffer&&o.deleteRenderbuffer(j.__webglDepthbuffer),j.__webglMultisampledFramebuffer&&o.deleteFramebuffer(j.__webglMultisampledFramebuffer),j.__webglColorRenderbuffer)for(let ge=0;ge<j.__webglColorRenderbuffer.length;ge++)j.__webglColorRenderbuffer[ge]&&o.deleteRenderbuffer(j.__webglColorRenderbuffer[ge]);j.__webglDepthRenderbuffer&&o.deleteRenderbuffer(j.__webglDepthRenderbuffer)}const ae=q.textures;for(let ge=0,fe=ae.length;ge<fe;ge++){const ue=i.get(ae[ge]);ue.__webglTexture&&(o.deleteTexture(ue.__webglTexture),u.memory.textures--),i.remove(ae[ge])}i.remove(q)}let Q=0;function Z(){Q=0}function K(){const q=Q;return q>=a.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+q+" texture units while this GPU supports only "+a.maxTextures),Q+=1,q}function s(q){const j=[];return j.push(q.wrapS),j.push(q.wrapT),j.push(q.wrapR||0),j.push(q.magFilter),j.push(q.minFilter),j.push(q.anisotropy),j.push(q.internalFormat),j.push(q.format),j.push(q.type),j.push(q.generateMipmaps),j.push(q.premultiplyAlpha),j.push(q.flipY),j.push(q.unpackAlignment),j.push(q.colorSpace),j.join()}function H(q,j){const ae=i.get(q);if(q.isVideoTexture&&X(q),q.isRenderTargetTexture===!1&&q.version>0&&ae.__version!==q.version){const ge=q.image;if(ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{c(ae,q,j);return}}t.bindTexture(o.TEXTURE_2D,ae.__webglTexture,o.TEXTURE0+j)}function y(q,j){const ae=i.get(q);if(q.version>0&&ae.__version!==q.version){c(ae,q,j);return}t.bindTexture(o.TEXTURE_2D_ARRAY,ae.__webglTexture,o.TEXTURE0+j)}function ee(q,j){const ae=i.get(q);if(q.version>0&&ae.__version!==q.version){c(ae,q,j);return}t.bindTexture(o.TEXTURE_3D,ae.__webglTexture,o.TEXTURE0+j)}function I(q,j){const ae=i.get(q);if(q.version>0&&ae.__version!==q.version){h(ae,q,j);return}t.bindTexture(o.TEXTURE_CUBE_MAP,ae.__webglTexture,o.TEXTURE0+j)}const re={[ds]:o.REPEAT,[ai]:o.CLAMP_TO_EDGE,[qa]:o.MIRRORED_REPEAT},Ae={[gi]:o.NEAREST,[Lu]:o.NEAREST_MIPMAP_NEAREST,[Nr]:o.NEAREST_MIPMAP_LINEAR,[wt]:o.LINEAR,[Oa]:o.LINEAR_MIPMAP_NEAREST,[hn]:o.LINEAR_MIPMAP_LINEAR},N={[oM]:o.NEVER,[fM]:o.ALWAYS,[lM]:o.LESS,[bS]:o.LEQUAL,[cM]:o.EQUAL,[dM]:o.GEQUAL,[uM]:o.GREATER,[hM]:o.NOTEQUAL};function n(q,j){if(j.type===oi&&e.has("OES_texture_float_linear")===!1&&(j.magFilter===wt||j.magFilter===Oa||j.magFilter===Nr||j.magFilter===hn||j.minFilter===wt||j.minFilter===Oa||j.minFilter===Nr||j.minFilter===hn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o.texParameteri(q,o.TEXTURE_WRAP_S,re[j.wrapS]),o.texParameteri(q,o.TEXTURE_WRAP_T,re[j.wrapT]),(q===o.TEXTURE_3D||q===o.TEXTURE_2D_ARRAY)&&o.texParameteri(q,o.TEXTURE_WRAP_R,re[j.wrapR]),o.texParameteri(q,o.TEXTURE_MAG_FILTER,Ae[j.magFilter]),o.texParameteri(q,o.TEXTURE_MIN_FILTER,Ae[j.minFilter]),j.compareFunction&&(o.texParameteri(q,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(q,o.TEXTURE_COMPARE_FUNC,N[j.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(j.magFilter===gi||j.minFilter!==Nr&&j.minFilter!==hn||j.type===oi&&e.has("OES_texture_float_linear")===!1)return;if(j.anisotropy>1||i.get(j).__currentAnisotropy){const ae=e.get("EXT_texture_filter_anisotropic");o.texParameterf(q,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(j.anisotropy,a.getMaxAnisotropy())),i.get(j).__currentAnisotropy=j.anisotropy}}}function r(q,j){let ae=!1;q.__webglInit===void 0&&(q.__webglInit=!0,j.addEventListener("dispose",G));const ge=j.source;let fe=b.get(ge);fe===void 0&&(fe={},b.set(ge,fe));const ue=s(j);if(ue!==q.__cacheKey){fe[ue]===void 0&&(fe[ue]={texture:o.createTexture(),usedTimes:0},u.memory.textures++,ae=!0),fe[ue].usedTimes++;const ve=fe[q.__cacheKey];ve!==void 0&&(fe[q.__cacheKey].usedTimes--,ve.usedTimes===0&&k(j)),q.__cacheKey=ue,q.__webglTexture=fe[ue].texture}return ae}function c(q,j,ae){let ge=o.TEXTURE_2D;(j.isDataArrayTexture||j.isCompressedArrayTexture)&&(ge=o.TEXTURE_2D_ARRAY),j.isData3DTexture&&(ge=o.TEXTURE_3D);const fe=r(q,j),ue=j.source;t.bindTexture(ge,q.__webglTexture,o.TEXTURE0+ae);const ve=i.get(ue);if(ue.version!==ve.__version||fe===!0){t.activeTexture(o.TEXTURE0+ae);const Re=vt.getPrimaries(vt.workingColorSpace),Le=j.colorSpace===Gn?null:vt.getPrimaries(j.colorSpace),Xe=j.colorSpace===Gn||Re===Le?o.NONE:o.BROWSER_DEFAULT_WEBGL;o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,j.flipY),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),o.pixelStorei(o.UNPACK_ALIGNMENT,j.unpackAlignment),o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xe);let xe=C(j.image,!1,a.maxTextureSize);xe=ie(j,xe);const Pe=l.convert(j.format,j.colorSpace),Ie=l.convert(j.type);let Ue=M(j.internalFormat,Pe,Ie,j.colorSpace,j.isVideoTexture);n(ge,j);let Ne;const et=j.mipmaps,Ke=j.isVideoTexture!==!0,pt=ve.__version===void 0||fe===!0,ne=ue.dataReady,Oe=D(j,xe);if(j.isDepthTexture)Ue=B(j.format===yl,j.type),pt&&(Ke?t.texStorage2D(o.TEXTURE_2D,1,Ue,xe.width,xe.height):t.texImage2D(o.TEXTURE_2D,0,Ue,xe.width,xe.height,0,Pe,Ie,null));else if(j.isDataTexture)if(et.length>0){Ke&&pt&&t.texStorage2D(o.TEXTURE_2D,Oe,Ue,et[0].width,et[0].height);for(let ye=0,we=et.length;ye<we;ye++)Ne=et[ye],Ke?ne&&t.texSubImage2D(o.TEXTURE_2D,ye,0,0,Ne.width,Ne.height,Pe,Ie,Ne.data):t.texImage2D(o.TEXTURE_2D,ye,Ue,Ne.width,Ne.height,0,Pe,Ie,Ne.data);j.generateMipmaps=!1}else Ke?(pt&&t.texStorage2D(o.TEXTURE_2D,Oe,Ue,xe.width,xe.height),ne&&t.texSubImage2D(o.TEXTURE_2D,0,0,0,xe.width,xe.height,Pe,Ie,xe.data)):t.texImage2D(o.TEXTURE_2D,0,Ue,xe.width,xe.height,0,Pe,Ie,xe.data);else if(j.isCompressedTexture)if(j.isCompressedArrayTexture){Ke&&pt&&t.texStorage3D(o.TEXTURE_2D_ARRAY,Oe,Ue,et[0].width,et[0].height,xe.depth);for(let ye=0,we=et.length;ye<we;ye++)if(Ne=et[ye],j.format!==Xt)if(Pe!==null)if(Ke){if(ne)if(j.layerUpdates.size>0){const ze=Fy(Ne.width,Ne.height,j.format,j.type);for(const $e of j.layerUpdates){const qe=Ne.data.subarray($e*ze/Ne.data.BYTES_PER_ELEMENT,($e+1)*ze/Ne.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY,ye,0,0,$e,Ne.width,Ne.height,1,Pe,qe)}j.clearLayerUpdates()}else t.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY,ye,0,0,0,Ne.width,Ne.height,xe.depth,Pe,Ne.data)}else t.compressedTexImage3D(o.TEXTURE_2D_ARRAY,ye,Ue,Ne.width,Ne.height,xe.depth,0,Ne.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Ke?ne&&t.texSubImage3D(o.TEXTURE_2D_ARRAY,ye,0,0,0,Ne.width,Ne.height,xe.depth,Pe,Ie,Ne.data):t.texImage3D(o.TEXTURE_2D_ARRAY,ye,Ue,Ne.width,Ne.height,xe.depth,0,Pe,Ie,Ne.data)}else{Ke&&pt&&t.texStorage2D(o.TEXTURE_2D,Oe,Ue,et[0].width,et[0].height);for(let ye=0,we=et.length;ye<we;ye++)Ne=et[ye],j.format!==Xt?Pe!==null?Ke?ne&&t.compressedTexSubImage2D(o.TEXTURE_2D,ye,0,0,Ne.width,Ne.height,Pe,Ne.data):t.compressedTexImage2D(o.TEXTURE_2D,ye,Ue,Ne.width,Ne.height,0,Ne.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ke?ne&&t.texSubImage2D(o.TEXTURE_2D,ye,0,0,Ne.width,Ne.height,Pe,Ie,Ne.data):t.texImage2D(o.TEXTURE_2D,ye,Ue,Ne.width,Ne.height,0,Pe,Ie,Ne.data)}else if(j.isDataArrayTexture)if(Ke){if(pt&&t.texStorage3D(o.TEXTURE_2D_ARRAY,Oe,Ue,xe.width,xe.height,xe.depth),ne)if(j.layerUpdates.size>0){const ye=Fy(xe.width,xe.height,j.format,j.type);for(const we of j.layerUpdates){const ze=xe.data.subarray(we*ye/xe.data.BYTES_PER_ELEMENT,(we+1)*ye/xe.data.BYTES_PER_ELEMENT);t.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,we,xe.width,xe.height,1,Pe,Ie,ze)}j.clearLayerUpdates()}else t.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,0,xe.width,xe.height,xe.depth,Pe,Ie,xe.data)}else t.texImage3D(o.TEXTURE_2D_ARRAY,0,Ue,xe.width,xe.height,xe.depth,0,Pe,Ie,xe.data);else if(j.isData3DTexture)Ke?(pt&&t.texStorage3D(o.TEXTURE_3D,Oe,Ue,xe.width,xe.height,xe.depth),ne&&t.texSubImage3D(o.TEXTURE_3D,0,0,0,0,xe.width,xe.height,xe.depth,Pe,Ie,xe.data)):t.texImage3D(o.TEXTURE_3D,0,Ue,xe.width,xe.height,xe.depth,0,Pe,Ie,xe.data);else if(j.isFramebufferTexture){if(pt)if(Ke)t.texStorage2D(o.TEXTURE_2D,Oe,Ue,xe.width,xe.height);else{let ye=xe.width,we=xe.height;for(let ze=0;ze<Oe;ze++)t.texImage2D(o.TEXTURE_2D,ze,Ue,ye,we,0,Pe,Ie,null),ye>>=1,we>>=1}}else if(et.length>0){if(Ke&&pt){const ye=de(et[0]);t.texStorage2D(o.TEXTURE_2D,Oe,Ue,ye.width,ye.height)}for(let ye=0,we=et.length;ye<we;ye++)Ne=et[ye],Ke?ne&&t.texSubImage2D(o.TEXTURE_2D,ye,0,0,Pe,Ie,Ne):t.texImage2D(o.TEXTURE_2D,ye,Ue,Pe,Ie,Ne);j.generateMipmaps=!1}else if(Ke){if(pt){const ye=de(xe);t.texStorage2D(o.TEXTURE_2D,Oe,Ue,ye.width,ye.height)}ne&&t.texSubImage2D(o.TEXTURE_2D,0,0,0,Pe,Ie,xe)}else t.texImage2D(o.TEXTURE_2D,0,Ue,Pe,Ie,xe);T(j)&&x(ge),ve.__version=ue.version,j.onUpdate&&j.onUpdate(j)}q.__version=j.version}function h(q,j,ae){if(j.image.length!==6)return;const ge=r(q,j),fe=j.source;t.bindTexture(o.TEXTURE_CUBE_MAP,q.__webglTexture,o.TEXTURE0+ae);const ue=i.get(fe);if(fe.version!==ue.__version||ge===!0){t.activeTexture(o.TEXTURE0+ae);const ve=vt.getPrimaries(vt.workingColorSpace),Re=j.colorSpace===Gn?null:vt.getPrimaries(j.colorSpace),Le=j.colorSpace===Gn||ve===Re?o.NONE:o.BROWSER_DEFAULT_WEBGL;o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,j.flipY),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),o.pixelStorei(o.UNPACK_ALIGNMENT,j.unpackAlignment),o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,Le);const Xe=j.isCompressedTexture||j.image[0].isCompressedTexture,xe=j.image[0]&&j.image[0].isDataTexture,Pe=[];for(let we=0;we<6;we++)!Xe&&!xe?Pe[we]=C(j.image[we],!0,a.maxCubemapSize):Pe[we]=xe?j.image[we].image:j.image[we],Pe[we]=ie(j,Pe[we]);const Ie=Pe[0],Ue=l.convert(j.format,j.colorSpace),Ne=l.convert(j.type),et=M(j.internalFormat,Ue,Ne,j.colorSpace),Ke=j.isVideoTexture!==!0,pt=ue.__version===void 0||ge===!0,ne=fe.dataReady;let Oe=D(j,Ie);n(o.TEXTURE_CUBE_MAP,j);let ye;if(Xe){Ke&&pt&&t.texStorage2D(o.TEXTURE_CUBE_MAP,Oe,et,Ie.width,Ie.height);for(let we=0;we<6;we++){ye=Pe[we].mipmaps;for(let ze=0;ze<ye.length;ze++){const $e=ye[ze];j.format!==Xt?Ue!==null?Ke?ne&&t.compressedTexSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze,0,0,$e.width,$e.height,Ue,$e.data):t.compressedTexImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze,et,$e.width,$e.height,0,$e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze,0,0,$e.width,$e.height,Ue,Ne,$e.data):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze,et,$e.width,$e.height,0,Ue,Ne,$e.data)}}}else{if(ye=j.mipmaps,Ke&&pt){ye.length>0&&Oe++;const we=de(Pe[0]);t.texStorage2D(o.TEXTURE_CUBE_MAP,Oe,et,we.width,we.height)}for(let we=0;we<6;we++)if(xe){Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,0,0,Pe[we].width,Pe[we].height,Ue,Ne,Pe[we].data):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,et,Pe[we].width,Pe[we].height,0,Ue,Ne,Pe[we].data);for(let ze=0;ze<ye.length;ze++){const qe=ye[ze].image[we].image;Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze+1,0,0,qe.width,qe.height,Ue,Ne,qe.data):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze+1,et,qe.width,qe.height,0,Ue,Ne,qe.data)}}else{Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,0,0,Ue,Ne,Pe[we]):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,et,Ue,Ne,Pe[we]);for(let ze=0;ze<ye.length;ze++){const $e=ye[ze];Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze+1,0,0,Ue,Ne,$e.image[we]):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze+1,et,Ue,Ne,$e.image[we])}}}T(j)&&x(o.TEXTURE_CUBE_MAP),ue.__version=fe.version,j.onUpdate&&j.onUpdate(j)}q.__version=j.version}function f(q,j,ae,ge,fe,ue){const ve=l.convert(ae.format,ae.colorSpace),Re=l.convert(ae.type),Le=M(ae.internalFormat,ve,Re,ae.colorSpace),Xe=i.get(j),xe=i.get(ae);if(xe.__renderTarget=j,!Xe.__hasExternalTextures){const Pe=Math.max(1,j.width>>ue),Ie=Math.max(1,j.height>>ue);fe===o.TEXTURE_3D||fe===o.TEXTURE_2D_ARRAY?t.texImage3D(fe,ue,Le,Pe,Ie,j.depth,0,ve,Re,null):t.texImage2D(fe,ue,Le,Pe,Ie,0,ve,Re,null)}t.bindFramebuffer(o.FRAMEBUFFER,q),te(j)?d.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,ge,fe,xe.__webglTexture,0,Y(j)):(fe===o.TEXTURE_2D||fe>=o.TEXTURE_CUBE_MAP_POSITIVE_X&&fe<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&o.framebufferTexture2D(o.FRAMEBUFFER,ge,fe,xe.__webglTexture,ue),t.bindFramebuffer(o.FRAMEBUFFER,null)}function g(q,j,ae){if(o.bindRenderbuffer(o.RENDERBUFFER,q),j.depthBuffer){const ge=j.depthTexture,fe=ge&&ge.isDepthTexture?ge.type:null,ue=B(j.stencilBuffer,fe),ve=j.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,Re=Y(j);te(j)?d.renderbufferStorageMultisampleEXT(o.RENDERBUFFER,Re,ue,j.width,j.height):ae?o.renderbufferStorageMultisample(o.RENDERBUFFER,Re,ue,j.width,j.height):o.renderbufferStorage(o.RENDERBUFFER,ue,j.width,j.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,ve,o.RENDERBUFFER,q)}else{const ge=j.textures;for(let fe=0;fe<ge.length;fe++){const ue=ge[fe],ve=l.convert(ue.format,ue.colorSpace),Re=l.convert(ue.type),Le=M(ue.internalFormat,ve,Re,ue.colorSpace),Xe=Y(j);ae&&te(j)===!1?o.renderbufferStorageMultisample(o.RENDERBUFFER,Xe,Le,j.width,j.height):te(j)?d.renderbufferStorageMultisampleEXT(o.RENDERBUFFER,Xe,Le,j.width,j.height):o.renderbufferStorage(o.RENDERBUFFER,Le,j.width,j.height)}}o.bindRenderbuffer(o.RENDERBUFFER,null)}function v(q,j){if(j&&j.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(o.FRAMEBUFFER,q),!(j.depthTexture&&j.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const ge=i.get(j.depthTexture);ge.__renderTarget=j,(!ge.__webglTexture||j.depthTexture.image.width!==j.width||j.depthTexture.image.height!==j.height)&&(j.depthTexture.image.width=j.width,j.depthTexture.image.height=j.height,j.depthTexture.needsUpdate=!0),H(j.depthTexture,0);const fe=ge.__webglTexture,ue=Y(j);if(j.depthTexture.format===rl)te(j)?d.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,fe,0,ue):o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,fe,0);else if(j.depthTexture.format===yl)te(j)?d.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.TEXTURE_2D,fe,0,ue):o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.TEXTURE_2D,fe,0);else throw new Error("Unknown depthTexture format")}function S(q){const j=i.get(q),ae=q.isWebGLCubeRenderTarget===!0;if(j.__boundDepthTexture!==q.depthTexture){const ge=q.depthTexture;if(j.__depthDisposeCallback&&j.__depthDisposeCallback(),ge){const fe=()=>{delete j.__boundDepthTexture,delete j.__depthDisposeCallback,ge.removeEventListener("dispose",fe)};ge.addEventListener("dispose",fe),j.__depthDisposeCallback=fe}j.__boundDepthTexture=ge}if(q.depthTexture&&!j.__autoAllocateDepthBuffer){if(ae)throw new Error("target.depthTexture not supported in Cube render targets");v(j.__webglFramebuffer,q)}else if(ae){j.__webglDepthbuffer=[];for(let ge=0;ge<6;ge++)if(t.bindFramebuffer(o.FRAMEBUFFER,j.__webglFramebuffer[ge]),j.__webglDepthbuffer[ge]===void 0)j.__webglDepthbuffer[ge]=o.createRenderbuffer(),g(j.__webglDepthbuffer[ge],q,!1);else{const fe=q.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,ue=j.__webglDepthbuffer[ge];o.bindRenderbuffer(o.RENDERBUFFER,ue),o.framebufferRenderbuffer(o.FRAMEBUFFER,fe,o.RENDERBUFFER,ue)}}else if(t.bindFramebuffer(o.FRAMEBUFFER,j.__webglFramebuffer),j.__webglDepthbuffer===void 0)j.__webglDepthbuffer=o.createRenderbuffer(),g(j.__webglDepthbuffer,q,!1);else{const ge=q.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,fe=j.__webglDepthbuffer;o.bindRenderbuffer(o.RENDERBUFFER,fe),o.framebufferRenderbuffer(o.FRAMEBUFFER,ge,o.RENDERBUFFER,fe)}t.bindFramebuffer(o.FRAMEBUFFER,null)}function R(q,j,ae){const ge=i.get(q);j!==void 0&&f(ge.__webglFramebuffer,q,q.texture,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,0),ae!==void 0&&S(q)}function L(q){const j=q.texture,ae=i.get(q),ge=i.get(j);q.addEventListener("dispose",U);const fe=q.textures,ue=q.isWebGLCubeRenderTarget===!0,ve=fe.length>1;if(ve||(ge.__webglTexture===void 0&&(ge.__webglTexture=o.createTexture()),ge.__version=j.version,u.memory.textures++),ue){ae.__webglFramebuffer=[];for(let Re=0;Re<6;Re++)if(j.mipmaps&&j.mipmaps.length>0){ae.__webglFramebuffer[Re]=[];for(let Le=0;Le<j.mipmaps.length;Le++)ae.__webglFramebuffer[Re][Le]=o.createFramebuffer()}else ae.__webglFramebuffer[Re]=o.createFramebuffer()}else{if(j.mipmaps&&j.mipmaps.length>0){ae.__webglFramebuffer=[];for(let Re=0;Re<j.mipmaps.length;Re++)ae.__webglFramebuffer[Re]=o.createFramebuffer()}else ae.__webglFramebuffer=o.createFramebuffer();if(ve)for(let Re=0,Le=fe.length;Re<Le;Re++){const Xe=i.get(fe[Re]);Xe.__webglTexture===void 0&&(Xe.__webglTexture=o.createTexture(),u.memory.textures++)}if(q.samples>0&&te(q)===!1){ae.__webglMultisampledFramebuffer=o.createFramebuffer(),ae.__webglColorRenderbuffer=[],t.bindFramebuffer(o.FRAMEBUFFER,ae.__webglMultisampledFramebuffer);for(let Re=0;Re<fe.length;Re++){const Le=fe[Re];ae.__webglColorRenderbuffer[Re]=o.createRenderbuffer(),o.bindRenderbuffer(o.RENDERBUFFER,ae.__webglColorRenderbuffer[Re]);const Xe=l.convert(Le.format,Le.colorSpace),xe=l.convert(Le.type),Pe=M(Le.internalFormat,Xe,xe,Le.colorSpace,q.isXRRenderTarget===!0),Ie=Y(q);o.renderbufferStorageMultisample(o.RENDERBUFFER,Ie,Pe,q.width,q.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+Re,o.RENDERBUFFER,ae.__webglColorRenderbuffer[Re])}o.bindRenderbuffer(o.RENDERBUFFER,null),q.depthBuffer&&(ae.__webglDepthRenderbuffer=o.createRenderbuffer(),g(ae.__webglDepthRenderbuffer,q,!0)),t.bindFramebuffer(o.FRAMEBUFFER,null)}}if(ue){t.bindTexture(o.TEXTURE_CUBE_MAP,ge.__webglTexture),n(o.TEXTURE_CUBE_MAP,j);for(let Re=0;Re<6;Re++)if(j.mipmaps&&j.mipmaps.length>0)for(let Le=0;Le<j.mipmaps.length;Le++)f(ae.__webglFramebuffer[Re][Le],q,j,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+Re,Le);else f(ae.__webglFramebuffer[Re],q,j,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0);T(j)&&x(o.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ve){for(let Re=0,Le=fe.length;Re<Le;Re++){const Xe=fe[Re],xe=i.get(Xe);t.bindTexture(o.TEXTURE_2D,xe.__webglTexture),n(o.TEXTURE_2D,Xe),f(ae.__webglFramebuffer,q,Xe,o.COLOR_ATTACHMENT0+Re,o.TEXTURE_2D,0),T(Xe)&&x(o.TEXTURE_2D)}t.unbindTexture()}else{let Re=o.TEXTURE_2D;if((q.isWebGL3DRenderTarget||q.isWebGLArrayRenderTarget)&&(Re=q.isWebGL3DRenderTarget?o.TEXTURE_3D:o.TEXTURE_2D_ARRAY),t.bindTexture(Re,ge.__webglTexture),n(Re,j),j.mipmaps&&j.mipmaps.length>0)for(let Le=0;Le<j.mipmaps.length;Le++)f(ae.__webglFramebuffer[Le],q,j,o.COLOR_ATTACHMENT0,Re,Le);else f(ae.__webglFramebuffer,q,j,o.COLOR_ATTACHMENT0,Re,0);T(j)&&x(Re),t.unbindTexture()}q.depthBuffer&&S(q)}function F(q){const j=q.textures;for(let ae=0,ge=j.length;ae<ge;ae++){const fe=j[ae];if(T(fe)){const ue=P(q),ve=i.get(fe).__webglTexture;t.bindTexture(ue,ve),x(ue),t.unbindTexture()}}}const $=[],O=[];function W(q){if(q.samples>0){if(te(q)===!1){const j=q.textures,ae=q.width,ge=q.height;let fe=o.COLOR_BUFFER_BIT;const ue=q.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,ve=i.get(q),Re=j.length>1;if(Re)for(let Le=0;Le<j.length;Le++)t.bindFramebuffer(o.FRAMEBUFFER,ve.__webglMultisampledFramebuffer),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+Le,o.RENDERBUFFER,null),t.bindFramebuffer(o.FRAMEBUFFER,ve.__webglFramebuffer),o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0+Le,o.TEXTURE_2D,null,0);t.bindFramebuffer(o.READ_FRAMEBUFFER,ve.__webglMultisampledFramebuffer),t.bindFramebuffer(o.DRAW_FRAMEBUFFER,ve.__webglFramebuffer);for(let Le=0;Le<j.length;Le++){if(q.resolveDepthBuffer&&(q.depthBuffer&&(fe|=o.DEPTH_BUFFER_BIT),q.stencilBuffer&&q.resolveStencilBuffer&&(fe|=o.STENCIL_BUFFER_BIT)),Re){o.framebufferRenderbuffer(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.RENDERBUFFER,ve.__webglColorRenderbuffer[Le]);const Xe=i.get(j[Le]).__webglTexture;o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,Xe,0)}o.blitFramebuffer(0,0,ae,ge,0,0,ae,ge,fe,o.NEAREST),p===!0&&($.length=0,O.length=0,$.push(o.COLOR_ATTACHMENT0+Le),q.depthBuffer&&q.resolveDepthBuffer===!1&&($.push(ue),O.push(ue),o.invalidateFramebuffer(o.DRAW_FRAMEBUFFER,O)),o.invalidateFramebuffer(o.READ_FRAMEBUFFER,$))}if(t.bindFramebuffer(o.READ_FRAMEBUFFER,null),t.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),Re)for(let Le=0;Le<j.length;Le++){t.bindFramebuffer(o.FRAMEBUFFER,ve.__webglMultisampledFramebuffer),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+Le,o.RENDERBUFFER,ve.__webglColorRenderbuffer[Le]);const Xe=i.get(j[Le]).__webglTexture;t.bindFramebuffer(o.FRAMEBUFFER,ve.__webglFramebuffer),o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0+Le,o.TEXTURE_2D,Xe,0)}t.bindFramebuffer(o.DRAW_FRAMEBUFFER,ve.__webglMultisampledFramebuffer)}else if(q.depthBuffer&&q.resolveDepthBuffer===!1&&p){const j=q.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT;o.invalidateFramebuffer(o.DRAW_FRAMEBUFFER,[j])}}}function Y(q){return Math.min(a.maxSamples,q.samples)}function te(q){const j=i.get(q);return q.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&j.__useRenderToTexture!==!1}function X(q){const j=u.render.frame;A.get(q)!==j&&(A.set(q,j),q.update())}function ie(q,j){const ae=q.colorSpace,ge=q.format,fe=q.type;return q.isCompressedTexture===!0||q.isVideoTexture===!0||ae!==qt&&ae!==Gn&&(vt.getTransfer(ae)===Gt?(ge!==Xt||fe!==ui)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ae)),j}function de(q){return typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement?(m.width=q.naturalWidth||q.width,m.height=q.naturalHeight||q.height):typeof VideoFrame<"u"&&q instanceof VideoFrame?(m.width=q.displayWidth,m.height=q.displayHeight):(m.width=q.width,m.height=q.height),m}this.allocateTextureUnit=K,this.resetTextureUnits=Z,this.setTexture2D=H,this.setTexture2DArray=y,this.setTexture3D=ee,this.setTextureCube=I,this.rebindTextures=R,this.setupRenderTarget=L,this.updateRenderTargetMipmap=F,this.updateMultisampleRenderTarget=W,this.setupDepthRenderbuffer=S,this.setupFrameBufferTexture=f,this.useMultisampledRTT=te}function wD(o,e){function t(i,a=Gn){let l;const u=vt.getTransfer(a);if(i===ui)return o.UNSIGNED_BYTE;if(i===I0)return o.UNSIGNED_SHORT_4_4_4_4;if(i===M0)return o.UNSIGNED_SHORT_5_5_5_1;if(i===dS)return o.UNSIGNED_INT_5_9_9_9_REV;if(i===C0)return o.BYTE;if(i===T0)return o.SHORT;if(i===vu)return o.UNSIGNED_SHORT;if(i===Lf)return o.INT;if(i===qr)return o.UNSIGNED_INT;if(i===oi)return o.FLOAT;if(i===hi)return o.HALF_FLOAT;if(i===fS)return o.ALPHA;if(i===pS)return o.RGB;if(i===Xt)return o.RGBA;if(i===mS)return o.LUMINANCE;if(i===gS)return o.LUMINANCE_ALPHA;if(i===rl)return o.DEPTH_COMPONENT;if(i===yl)return o.DEPTH_STENCIL;if(i===Or)return o.RED;if(i===R0)return o.RED_INTEGER;if(i===La)return o.RG;if(i===B0)return o.RG_INTEGER;if(i===P0)return o.RGBA_INTEGER;if(i===bd||i===su||i===vd||i===ru)if(u===Gt)if(l=e.get("WEBGL_compressed_texture_s3tc_srgb"),l!==null){if(i===bd)return l.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===su)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===vd)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===ru)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(l=e.get("WEBGL_compressed_texture_s3tc"),l!==null){if(i===bd)return l.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===su)return l.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===vd)return l.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===ru)return l.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Hd||i===eA||i===Vd||i===tA)if(l=e.get("WEBGL_compressed_texture_pvrtc"),l!==null){if(i===Hd)return l.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===eA)return l.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Vd)return l.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===tA)return l.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Qd||i===jd||i===qd)if(l=e.get("WEBGL_compressed_texture_etc"),l!==null){if(i===Qd||i===jd)return u===Gt?l.COMPRESSED_SRGB8_ETC2:l.COMPRESSED_RGB8_ETC2;if(i===qd)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:l.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===wu||i===iA||i===nA||i===sA||i===Eu||i===rA||i===aA||i===oA||i===lA||i===cA||i===uA||i===hA||i===dA||i===fA)if(l=e.get("WEBGL_compressed_texture_astc"),l!==null){if(i===wu)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:l.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===iA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:l.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===nA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:l.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===sA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:l.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Eu)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:l.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===rA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:l.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===aA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:l.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===oA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:l.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===lA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:l.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===cA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:l.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===uA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:l.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===hA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:l.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===dA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:l.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===fA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:l.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===au||i===pA||i===Wd)if(l=e.get("EXT_texture_compression_bptc"),l!==null){if(i===au)return u===Gt?l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:l.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===pA)return l.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Wd)return l.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===AS||i===mA||i===gA||i===AA)if(l=e.get("EXT_texture_compression_rgtc"),l!==null){if(i===au)return l.COMPRESSED_RED_RGTC1_EXT;if(i===mA)return l.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===gA)return l.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===AA)return l.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===_l?o.UNSIGNED_INT_24_8:o[i]!==void 0?o[i]:null}return{convert:t}}const ED={type:"move"};class $p{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new mi,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new mi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new mi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new se),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let a=null,l=null,u=null;const d=this._targetRay,p=this._grip,m=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(m&&e.hand){u=!0;for(const C of e.hand.values()){const T=t.getJointPose(C,i),x=this._getHandJoint(m,C);T!==null&&(x.matrix.fromArray(T.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=T.radius),x.visible=T!==null}const A=m.joints["index-finger-tip"],_=m.joints["thumb-tip"],b=A.position.distanceTo(_.position),w=.02,E=.005;m.inputState.pinching&&b>w+E?(m.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!m.inputState.pinching&&b<=w-E&&(m.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else p!==null&&e.gripSpace&&(l=t.getPose(e.gripSpace,i),l!==null&&(p.matrix.fromArray(l.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,l.linearVelocity?(p.hasLinearVelocity=!0,p.linearVelocity.copy(l.linearVelocity)):p.hasLinearVelocity=!1,l.angularVelocity?(p.hasAngularVelocity=!0,p.angularVelocity.copy(l.angularVelocity)):p.hasAngularVelocity=!1));d!==null&&(a=t.getPose(e.targetRaySpace,i),a===null&&l!==null&&(a=l),a!==null&&(d.matrix.fromArray(a.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,a.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(a.linearVelocity)):d.hasLinearVelocity=!1,a.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(a.angularVelocity)):d.hasAngularVelocity=!1,this.dispatchEvent(ED)))}return d!==null&&(d.visible=a!==null),p!==null&&(p.visible=l!==null),m!==null&&(m.visible=u!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new mi;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const xD=`
|
|
3876
|
+
}`;function _D(o,e,t){let i=new $0;const a=new Ve,l=new Ve,u=new Rt,d=new G0({depthPacking:rM}),p=new mR,m={},A=t.maxTextureSize,_={[hs]:Fi,[Fi]:hs,[Ri]:Ri},b=new zi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ve},radius:{value:4}},vertexShader:gD,fragmentShader:AD}),w=b.clone();w.defines.HORIZONTAL_PASS=1;const E=new Di;E.setAttribute("position",new Vt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const C=new lt(E,b),T=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=x0;let x=this.type;this.render=function(G,U,V){if(T.enabled===!1||T.autoUpdate===!1&&T.needsUpdate===!1||G.length===0)return;const k=o.getRenderTarget(),z=o.getActiveCubeFace(),Q=o.getActiveMipmapLevel(),Z=o.state;Z.setBlending(cs),Z.buffers.color.setClear(1,1,1,1),Z.buffers.depth.setTest(!0),Z.setScissorTest(!1);const K=x!==Xs&&this.type===Xs,s=x===Xs&&this.type!==Xs;for(let H=0,y=G.length;H<y;H++){const ee=G[H],I=ee.shadow;if(I===void 0){console.warn("THREE.WebGLShadowMap:",ee,"has no shadow.");continue}if(I.autoUpdate===!1&&I.needsUpdate===!1)continue;a.copy(I.mapSize);const re=I.getFrameExtents();if(a.multiply(re),l.copy(I.mapSize),(a.x>A||a.y>A)&&(a.x>A&&(l.x=Math.floor(A/re.x),a.x=l.x*re.x,I.mapSize.x=l.x),a.y>A&&(l.y=Math.floor(A/re.y),a.y=l.y*re.y,I.mapSize.y=l.y)),I.map===null||K===!0||s===!0){const N=this.type!==Xs?{minFilter:gi,magFilter:gi}:{};I.map!==null&&I.map.dispose(),I.map=new dn(a.x,a.y,N),I.map.texture.name=ee.name+".shadowMap",I.camera.updateProjectionMatrix()}o.setRenderTarget(I.map),o.clear();const Ae=I.getViewportCount();for(let N=0;N<Ae;N++){const n=I.getViewport(N);u.set(l.x*n.x,l.y*n.y,l.x*n.z,l.y*n.w),Z.viewport(u),I.updateMatrices(ee,N),i=I.getFrustum(),B(U,V,I.camera,ee,this.type)}I.isPointLightShadow!==!0&&this.type===Xs&&P(I,V),I.needsUpdate=!1}x=this.type,T.needsUpdate=!1,o.setRenderTarget(k,z,Q)};function P(G,U){const V=e.update(C);b.defines.VSM_SAMPLES!==G.blurSamples&&(b.defines.VSM_SAMPLES=G.blurSamples,w.defines.VSM_SAMPLES=G.blurSamples,b.needsUpdate=!0,w.needsUpdate=!0),G.mapPass===null&&(G.mapPass=new dn(a.x,a.y)),b.uniforms.shadow_pass.value=G.map.texture,b.uniforms.resolution.value=G.mapSize,b.uniforms.radius.value=G.radius,o.setRenderTarget(G.mapPass),o.clear(),o.renderBufferDirect(U,null,V,b,C,null),w.uniforms.shadow_pass.value=G.mapPass.texture,w.uniforms.resolution.value=G.mapSize,w.uniforms.radius.value=G.radius,o.setRenderTarget(G.map),o.clear(),o.renderBufferDirect(U,null,V,w,C,null)}function M(G,U,V,k){let z=null;const Q=V.isPointLight===!0?G.customDistanceMaterial:G.customDepthMaterial;if(Q!==void 0)z=Q;else if(z=V.isPointLight===!0?p:d,o.localClippingEnabled&&U.clipShadows===!0&&Array.isArray(U.clippingPlanes)&&U.clippingPlanes.length!==0||U.displacementMap&&U.displacementScale!==0||U.alphaMap&&U.alphaTest>0||U.map&&U.alphaTest>0){const Z=z.uuid,K=U.uuid;let s=m[Z];s===void 0&&(s={},m[Z]=s);let H=s[K];H===void 0&&(H=z.clone(),s[K]=H,U.addEventListener("dispose",D)),z=H}if(z.visible=U.visible,z.wireframe=U.wireframe,k===Xs?z.side=U.shadowSide!==null?U.shadowSide:U.side:z.side=U.shadowSide!==null?U.shadowSide:_[U.side],z.alphaMap=U.alphaMap,z.alphaTest=U.alphaTest,z.map=U.map,z.clipShadows=U.clipShadows,z.clippingPlanes=U.clippingPlanes,z.clipIntersection=U.clipIntersection,z.displacementMap=U.displacementMap,z.displacementScale=U.displacementScale,z.displacementBias=U.displacementBias,z.wireframeLinewidth=U.wireframeLinewidth,z.linewidth=U.linewidth,V.isPointLight===!0&&z.isMeshDistanceMaterial===!0){const Z=o.properties.get(z);Z.light=V}return z}function B(G,U,V,k,z){if(G.visible===!1)return;if(G.layers.test(U.layers)&&(G.isMesh||G.isLine||G.isPoints)&&(G.castShadow||G.receiveShadow&&z===Xs)&&(!G.frustumCulled||i.intersectsObject(G))){G.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,G.matrixWorld);const K=e.update(G),s=G.material;if(Array.isArray(s)){const H=K.groups;for(let y=0,ee=H.length;y<ee;y++){const I=H[y],re=s[I.materialIndex];if(re&&re.visible){const Ae=M(G,re,k,z);G.onBeforeShadow(o,G,U,V,K,Ae,I),o.renderBufferDirect(V,null,K,Ae,G,I),G.onAfterShadow(o,G,U,V,K,Ae,I)}}}else if(s.visible){const H=M(G,s,k,z);G.onBeforeShadow(o,G,U,V,K,H,null),o.renderBufferDirect(V,null,K,H,G,null),G.onAfterShadow(o,G,U,V,K,H,null)}}const Z=G.children;for(let K=0,s=Z.length;K<s;K++)B(Z[K],U,V,k,z)}function D(G){G.target.removeEventListener("dispose",D);for(const V in m){const k=m[V],z=G.target.uuid;z in k&&(k[z].dispose(),delete k[z])}}}const yD={[jg]:qg,[Wg]:Kg,[Yg]:Jg,[ml]:Xg,[qg]:jg,[Kg]:Wg,[Jg]:Yg,[Xg]:ml};function bD(o,e){function t(){let ne=!1;const Oe=new Rt;let ye=null;const we=new Rt(0,0,0,0);return{setMask:function(ze){ye!==ze&&!ne&&(o.colorMask(ze,ze,ze,ze),ye=ze)},setLocked:function(ze){ne=ze},setClear:function(ze,$e,qe,Ot,wi){wi===!0&&(ze*=Ot,$e*=Ot,qe*=Ot),Oe.set(ze,$e,qe,Ot),we.equals(Oe)===!1&&(o.clearColor(ze,$e,qe,Ot),we.copy(Oe))},reset:function(){ne=!1,ye=null,we.set(-1,0,0,0)}}}function i(){let ne=!1,Oe=!1,ye=null,we=null,ze=null;return{setReversed:function($e){if(Oe!==$e){const qe=e.get("EXT_clip_control");Oe?qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.ZERO_TO_ONE_EXT):qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.NEGATIVE_ONE_TO_ONE_EXT);const Ot=ze;ze=null,this.setClear(Ot)}Oe=$e},getReversed:function(){return Oe},setTest:function($e){$e?g(o.DEPTH_TEST):v(o.DEPTH_TEST)},setMask:function($e){ye!==$e&&!ne&&(o.depthMask($e),ye=$e)},setFunc:function($e){if(Oe&&($e=yD[$e]),we!==$e){switch($e){case jg:o.depthFunc(o.NEVER);break;case qg:o.depthFunc(o.ALWAYS);break;case Wg:o.depthFunc(o.LESS);break;case ml:o.depthFunc(o.LEQUAL);break;case Yg:o.depthFunc(o.EQUAL);break;case Xg:o.depthFunc(o.GEQUAL);break;case Kg:o.depthFunc(o.GREATER);break;case Jg:o.depthFunc(o.NOTEQUAL);break;default:o.depthFunc(o.LEQUAL)}we=$e}},setLocked:function($e){ne=$e},setClear:function($e){ze!==$e&&(Oe&&($e=1-$e),o.clearDepth($e),ze=$e)},reset:function(){ne=!1,ye=null,we=null,ze=null,Oe=!1}}}function a(){let ne=!1,Oe=null,ye=null,we=null,ze=null,$e=null,qe=null,Ot=null,wi=null;return{setTest:function(Ct){ne||(Ct?g(o.STENCIL_TEST):v(o.STENCIL_TEST))},setMask:function(Ct){Oe!==Ct&&!ne&&(o.stencilMask(Ct),Oe=Ct)},setFunc:function(Ct,Zi,Nn){(ye!==Ct||we!==Zi||ze!==Nn)&&(o.stencilFunc(Ct,Zi,Nn),ye=Ct,we=Zi,ze=Nn)},setOp:function(Ct,Zi,Nn){($e!==Ct||qe!==Zi||Ot!==Nn)&&(o.stencilOp(Ct,Zi,Nn),$e=Ct,qe=Zi,Ot=Nn)},setLocked:function(Ct){ne=Ct},setClear:function(Ct){wi!==Ct&&(o.clearStencil(Ct),wi=Ct)},reset:function(){ne=!1,Oe=null,ye=null,we=null,ze=null,$e=null,qe=null,Ot=null,wi=null}}}const l=new t,u=new i,d=new a,p=new WeakMap,m=new WeakMap;let A={},_={},b=new WeakMap,w=[],E=null,C=!1,T=null,x=null,P=null,M=null,B=null,D=null,G=null,U=new Ye(0,0,0),V=0,k=!1,z=null,Q=null,Z=null,K=null,s=null;const H=o.getParameter(o.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let y=!1,ee=0;const I=o.getParameter(o.VERSION);I.indexOf("WebGL")!==-1?(ee=parseFloat(/^WebGL (\d)/.exec(I)[1]),y=ee>=1):I.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),y=ee>=2);let re=null,Ae={};const N=o.getParameter(o.SCISSOR_BOX),n=o.getParameter(o.VIEWPORT),r=new Rt().fromArray(N),c=new Rt().fromArray(n);function h(ne,Oe,ye,we){const ze=new Uint8Array(4),$e=o.createTexture();o.bindTexture(ne,$e),o.texParameteri(ne,o.TEXTURE_MIN_FILTER,o.NEAREST),o.texParameteri(ne,o.TEXTURE_MAG_FILTER,o.NEAREST);for(let qe=0;qe<ye;qe++)ne===o.TEXTURE_3D||ne===o.TEXTURE_2D_ARRAY?o.texImage3D(Oe,0,o.RGBA,1,1,we,0,o.RGBA,o.UNSIGNED_BYTE,ze):o.texImage2D(Oe+qe,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,ze);return $e}const f={};f[o.TEXTURE_2D]=h(o.TEXTURE_2D,o.TEXTURE_2D,1),f[o.TEXTURE_CUBE_MAP]=h(o.TEXTURE_CUBE_MAP,o.TEXTURE_CUBE_MAP_POSITIVE_X,6),f[o.TEXTURE_2D_ARRAY]=h(o.TEXTURE_2D_ARRAY,o.TEXTURE_2D_ARRAY,1,1),f[o.TEXTURE_3D]=h(o.TEXTURE_3D,o.TEXTURE_3D,1,1),l.setClear(0,0,0,1),u.setClear(1),d.setClear(0),g(o.DEPTH_TEST),u.setFunc(ml),Y(!1),te(j_),g(o.CULL_FACE),O(cs);function g(ne){A[ne]!==!0&&(o.enable(ne),A[ne]=!0)}function v(ne){A[ne]!==!1&&(o.disable(ne),A[ne]=!1)}function S(ne,Oe){return _[ne]!==Oe?(o.bindFramebuffer(ne,Oe),_[ne]=Oe,ne===o.DRAW_FRAMEBUFFER&&(_[o.FRAMEBUFFER]=Oe),ne===o.FRAMEBUFFER&&(_[o.DRAW_FRAMEBUFFER]=Oe),!0):!1}function R(ne,Oe){let ye=w,we=!1;if(ne){ye=b.get(Oe),ye===void 0&&(ye=[],b.set(Oe,ye));const ze=ne.textures;if(ye.length!==ze.length||ye[0]!==o.COLOR_ATTACHMENT0){for(let $e=0,qe=ze.length;$e<qe;$e++)ye[$e]=o.COLOR_ATTACHMENT0+$e;ye.length=ze.length,we=!0}}else ye[0]!==o.BACK&&(ye[0]=o.BACK,we=!0);we&&o.drawBuffers(ye)}function L(ne){return E!==ne?(o.useProgram(ne),E=ne,!0):!1}const F={[Ia]:o.FUNC_ADD,[NI]:o.FUNC_SUBTRACT,[OI]:o.FUNC_REVERSE_SUBTRACT};F[kI]=o.MIN,F[UI]=o.MAX;const $={[FI]:o.ZERO,[$I]:o.ONE,[zI]:o.SRC_COLOR,[Vg]:o.SRC_ALPHA,[qI]:o.SRC_ALPHA_SATURATE,[QI]:o.DST_COLOR,[HI]:o.DST_ALPHA,[GI]:o.ONE_MINUS_SRC_COLOR,[Qg]:o.ONE_MINUS_SRC_ALPHA,[jI]:o.ONE_MINUS_DST_COLOR,[VI]:o.ONE_MINUS_DST_ALPHA,[WI]:o.CONSTANT_COLOR,[YI]:o.ONE_MINUS_CONSTANT_COLOR,[XI]:o.CONSTANT_ALPHA,[KI]:o.ONE_MINUS_CONSTANT_ALPHA};function O(ne,Oe,ye,we,ze,$e,qe,Ot,wi,Ct){if(ne===cs){C===!0&&(v(o.BLEND),C=!1);return}if(C===!1&&(g(o.BLEND),C=!0),ne!==DI){if(ne!==T||Ct!==k){if((x!==Ia||B!==Ia)&&(o.blendEquation(o.FUNC_ADD),x=Ia,B=Ia),Ct)switch(ne){case sl:o.blendFuncSeparate(o.ONE,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA);break;case q_:o.blendFunc(o.ONE,o.ONE);break;case W_:o.blendFuncSeparate(o.ZERO,o.ONE_MINUS_SRC_COLOR,o.ZERO,o.ONE);break;case Y_:o.blendFuncSeparate(o.ZERO,o.SRC_COLOR,o.ZERO,o.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",ne);break}else switch(ne){case sl:o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA);break;case q_:o.blendFunc(o.SRC_ALPHA,o.ONE);break;case W_:o.blendFuncSeparate(o.ZERO,o.ONE_MINUS_SRC_COLOR,o.ZERO,o.ONE);break;case Y_:o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",ne);break}P=null,M=null,D=null,G=null,U.set(0,0,0),V=0,T=ne,k=Ct}return}ze=ze||Oe,$e=$e||ye,qe=qe||we,(Oe!==x||ze!==B)&&(o.blendEquationSeparate(F[Oe],F[ze]),x=Oe,B=ze),(ye!==P||we!==M||$e!==D||qe!==G)&&(o.blendFuncSeparate($[ye],$[we],$[$e],$[qe]),P=ye,M=we,D=$e,G=qe),(Ot.equals(U)===!1||wi!==V)&&(o.blendColor(Ot.r,Ot.g,Ot.b,wi),U.copy(Ot),V=wi),T=ne,k=!1}function W(ne,Oe){ne.side===Ri?v(o.CULL_FACE):g(o.CULL_FACE);let ye=ne.side===Fi;Oe&&(ye=!ye),Y(ye),ne.blending===sl&&ne.transparent===!1?O(cs):O(ne.blending,ne.blendEquation,ne.blendSrc,ne.blendDst,ne.blendEquationAlpha,ne.blendSrcAlpha,ne.blendDstAlpha,ne.blendColor,ne.blendAlpha,ne.premultipliedAlpha),u.setFunc(ne.depthFunc),u.setTest(ne.depthTest),u.setMask(ne.depthWrite),l.setMask(ne.colorWrite);const we=ne.stencilWrite;d.setTest(we),we&&(d.setMask(ne.stencilWriteMask),d.setFunc(ne.stencilFunc,ne.stencilRef,ne.stencilFuncMask),d.setOp(ne.stencilFail,ne.stencilZFail,ne.stencilZPass)),ie(ne.polygonOffset,ne.polygonOffsetFactor,ne.polygonOffsetUnits),ne.alphaToCoverage===!0?g(o.SAMPLE_ALPHA_TO_COVERAGE):v(o.SAMPLE_ALPHA_TO_COVERAGE)}function Y(ne){z!==ne&&(ne?o.frontFace(o.CW):o.frontFace(o.CCW),z=ne)}function te(ne){ne!==BI?(g(o.CULL_FACE),ne!==Q&&(ne===j_?o.cullFace(o.BACK):ne===PI?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK))):v(o.CULL_FACE),Q=ne}function X(ne){ne!==Z&&(y&&o.lineWidth(ne),Z=ne)}function ie(ne,Oe,ye){ne?(g(o.POLYGON_OFFSET_FILL),(K!==Oe||s!==ye)&&(o.polygonOffset(Oe,ye),K=Oe,s=ye)):v(o.POLYGON_OFFSET_FILL)}function de(ne){ne?g(o.SCISSOR_TEST):v(o.SCISSOR_TEST)}function q(ne){ne===void 0&&(ne=o.TEXTURE0+H-1),re!==ne&&(o.activeTexture(ne),re=ne)}function j(ne,Oe,ye){ye===void 0&&(re===null?ye=o.TEXTURE0+H-1:ye=re);let we=Ae[ye];we===void 0&&(we={type:void 0,texture:void 0},Ae[ye]=we),(we.type!==ne||we.texture!==Oe)&&(re!==ye&&(o.activeTexture(ye),re=ye),o.bindTexture(ne,Oe||f[ne]),we.type=ne,we.texture=Oe)}function ae(){const ne=Ae[re];ne!==void 0&&ne.type!==void 0&&(o.bindTexture(ne.type,null),ne.type=void 0,ne.texture=void 0)}function ge(){try{o.compressedTexImage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function fe(){try{o.compressedTexImage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ue(){try{o.texSubImage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function ve(){try{o.texSubImage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Re(){try{o.compressedTexSubImage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Le(){try{o.compressedTexSubImage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Xe(){try{o.texStorage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function xe(){try{o.texStorage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Pe(){try{o.texImage2D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Ie(){try{o.texImage3D.apply(o,arguments)}catch(ne){console.error("THREE.WebGLState:",ne)}}function Ue(ne){r.equals(ne)===!1&&(o.scissor(ne.x,ne.y,ne.z,ne.w),r.copy(ne))}function Ne(ne){c.equals(ne)===!1&&(o.viewport(ne.x,ne.y,ne.z,ne.w),c.copy(ne))}function et(ne,Oe){let ye=m.get(Oe);ye===void 0&&(ye=new WeakMap,m.set(Oe,ye));let we=ye.get(ne);we===void 0&&(we=o.getUniformBlockIndex(Oe,ne.name),ye.set(ne,we))}function Ke(ne,Oe){const we=m.get(Oe).get(ne);p.get(Oe)!==we&&(o.uniformBlockBinding(Oe,we,ne.__bindingPointIndex),p.set(Oe,we))}function pt(){o.disable(o.BLEND),o.disable(o.CULL_FACE),o.disable(o.DEPTH_TEST),o.disable(o.POLYGON_OFFSET_FILL),o.disable(o.SCISSOR_TEST),o.disable(o.STENCIL_TEST),o.disable(o.SAMPLE_ALPHA_TO_COVERAGE),o.blendEquation(o.FUNC_ADD),o.blendFunc(o.ONE,o.ZERO),o.blendFuncSeparate(o.ONE,o.ZERO,o.ONE,o.ZERO),o.blendColor(0,0,0,0),o.colorMask(!0,!0,!0,!0),o.clearColor(0,0,0,0),o.depthMask(!0),o.depthFunc(o.LESS),u.setReversed(!1),o.clearDepth(1),o.stencilMask(4294967295),o.stencilFunc(o.ALWAYS,0,4294967295),o.stencilOp(o.KEEP,o.KEEP,o.KEEP),o.clearStencil(0),o.cullFace(o.BACK),o.frontFace(o.CCW),o.polygonOffset(0,0),o.activeTexture(o.TEXTURE0),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.bindFramebuffer(o.READ_FRAMEBUFFER,null),o.useProgram(null),o.lineWidth(1),o.scissor(0,0,o.canvas.width,o.canvas.height),o.viewport(0,0,o.canvas.width,o.canvas.height),A={},re=null,Ae={},_={},b=new WeakMap,w=[],E=null,C=!1,T=null,x=null,P=null,M=null,B=null,D=null,G=null,U=new Ye(0,0,0),V=0,k=!1,z=null,Q=null,Z=null,K=null,s=null,r.set(0,0,o.canvas.width,o.canvas.height),c.set(0,0,o.canvas.width,o.canvas.height),l.reset(),u.reset(),d.reset()}return{buffers:{color:l,depth:u,stencil:d},enable:g,disable:v,bindFramebuffer:S,drawBuffers:R,useProgram:L,setBlending:O,setMaterial:W,setFlipSided:Y,setCullFace:te,setLineWidth:X,setPolygonOffset:ie,setScissorTest:de,activeTexture:q,bindTexture:j,unbindTexture:ae,compressedTexImage2D:ge,compressedTexImage3D:fe,texImage2D:Pe,texImage3D:Ie,updateUBOMapping:et,uniformBlockBinding:Ke,texStorage2D:Xe,texStorage3D:xe,texSubImage2D:ue,texSubImage3D:ve,compressedTexSubImage2D:Re,compressedTexSubImage3D:Le,scissor:Ue,viewport:Ne,reset:pt}}function vD(o,e,t,i,a,l,u){const d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,p=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new Ve,A=new WeakMap;let _;const b=new WeakMap;let w=!1;try{w=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(q,j){return w?new OffscreenCanvas(q,j):xu("canvas")}function C(q,j,ae){let ge=1;const fe=de(q);if((fe.width>ae||fe.height>ae)&&(ge=ae/Math.max(fe.width,fe.height)),ge<1)if(typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&q instanceof ImageBitmap||typeof VideoFrame<"u"&&q instanceof VideoFrame){const ue=Math.floor(ge*fe.width),ve=Math.floor(ge*fe.height);_===void 0&&(_=E(ue,ve));const Re=j?E(ue,ve):_;return Re.width=ue,Re.height=ve,Re.getContext("2d").drawImage(q,0,0,ue,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+fe.width+"x"+fe.height+") to ("+ue+"x"+ve+")."),Re}else return"data"in q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+fe.width+"x"+fe.height+")."),q;return q}function T(q){return q.generateMipmaps}function x(q){o.generateMipmap(q)}function P(q){return q.isWebGLCubeRenderTarget?o.TEXTURE_CUBE_MAP:q.isWebGL3DRenderTarget?o.TEXTURE_3D:q.isWebGLArrayRenderTarget||q.isCompressedArrayTexture?o.TEXTURE_2D_ARRAY:o.TEXTURE_2D}function M(q,j,ae,ge,fe=!1){if(q!==null){if(o[q]!==void 0)return o[q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+q+"'")}let ue=j;if(j===o.RED&&(ae===o.FLOAT&&(ue=o.R32F),ae===o.HALF_FLOAT&&(ue=o.R16F),ae===o.UNSIGNED_BYTE&&(ue=o.R8)),j===o.RED_INTEGER&&(ae===o.UNSIGNED_BYTE&&(ue=o.R8UI),ae===o.UNSIGNED_SHORT&&(ue=o.R16UI),ae===o.UNSIGNED_INT&&(ue=o.R32UI),ae===o.BYTE&&(ue=o.R8I),ae===o.SHORT&&(ue=o.R16I),ae===o.INT&&(ue=o.R32I)),j===o.RG&&(ae===o.FLOAT&&(ue=o.RG32F),ae===o.HALF_FLOAT&&(ue=o.RG16F),ae===o.UNSIGNED_BYTE&&(ue=o.RG8)),j===o.RG_INTEGER&&(ae===o.UNSIGNED_BYTE&&(ue=o.RG8UI),ae===o.UNSIGNED_SHORT&&(ue=o.RG16UI),ae===o.UNSIGNED_INT&&(ue=o.RG32UI),ae===o.BYTE&&(ue=o.RG8I),ae===o.SHORT&&(ue=o.RG16I),ae===o.INT&&(ue=o.RG32I)),j===o.RGB_INTEGER&&(ae===o.UNSIGNED_BYTE&&(ue=o.RGB8UI),ae===o.UNSIGNED_SHORT&&(ue=o.RGB16UI),ae===o.UNSIGNED_INT&&(ue=o.RGB32UI),ae===o.BYTE&&(ue=o.RGB8I),ae===o.SHORT&&(ue=o.RGB16I),ae===o.INT&&(ue=o.RGB32I)),j===o.RGBA_INTEGER&&(ae===o.UNSIGNED_BYTE&&(ue=o.RGBA8UI),ae===o.UNSIGNED_SHORT&&(ue=o.RGBA16UI),ae===o.UNSIGNED_INT&&(ue=o.RGBA32UI),ae===o.BYTE&&(ue=o.RGBA8I),ae===o.SHORT&&(ue=o.RGBA16I),ae===o.INT&&(ue=o.RGBA32I)),j===o.RGB&&ae===o.UNSIGNED_INT_5_9_9_9_REV&&(ue=o.RGB9_E5),j===o.RGBA){const ve=fe?Kd:wt.getTransfer(ge);ae===o.FLOAT&&(ue=o.RGBA32F),ae===o.HALF_FLOAT&&(ue=o.RGBA16F),ae===o.UNSIGNED_BYTE&&(ue=ve===Gt?o.SRGB8_ALPHA8:o.RGBA8),ae===o.UNSIGNED_SHORT_4_4_4_4&&(ue=o.RGBA4),ae===o.UNSIGNED_SHORT_5_5_5_1&&(ue=o.RGB5_A1)}return(ue===o.R16F||ue===o.R32F||ue===o.RG16F||ue===o.RG32F||ue===o.RGBA16F||ue===o.RGBA32F)&&e.get("EXT_color_buffer_float"),ue}function B(q,j){let ae;return q?j===null||j===qr||j===_l?ae=o.DEPTH24_STENCIL8:j===oi?ae=o.DEPTH32F_STENCIL8:j===vu&&(ae=o.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):j===null||j===qr||j===_l?ae=o.DEPTH_COMPONENT24:j===oi?ae=o.DEPTH_COMPONENT32F:j===vu&&(ae=o.DEPTH_COMPONENT16),ae}function D(q,j){return T(q)===!0||q.isFramebufferTexture&&q.minFilter!==gi&&q.minFilter!==Et?Math.log2(Math.max(j.width,j.height))+1:q.mipmaps!==void 0&&q.mipmaps.length>0?q.mipmaps.length:q.isCompressedTexture&&Array.isArray(q.image)?j.mipmaps.length:1}function G(q){const j=q.target;j.removeEventListener("dispose",G),V(j),j.isVideoTexture&&A.delete(j)}function U(q){const j=q.target;j.removeEventListener("dispose",U),z(j)}function V(q){const j=i.get(q);if(j.__webglInit===void 0)return;const ae=q.source,ge=b.get(ae);if(ge){const fe=ge[j.__cacheKey];fe.usedTimes--,fe.usedTimes===0&&k(q),Object.keys(ge).length===0&&b.delete(ae)}i.remove(q)}function k(q){const j=i.get(q);o.deleteTexture(j.__webglTexture);const ae=q.source,ge=b.get(ae);delete ge[j.__cacheKey],u.memory.textures--}function z(q){const j=i.get(q);if(q.depthTexture&&(q.depthTexture.dispose(),i.remove(q.depthTexture)),q.isWebGLCubeRenderTarget)for(let ge=0;ge<6;ge++){if(Array.isArray(j.__webglFramebuffer[ge]))for(let fe=0;fe<j.__webglFramebuffer[ge].length;fe++)o.deleteFramebuffer(j.__webglFramebuffer[ge][fe]);else o.deleteFramebuffer(j.__webglFramebuffer[ge]);j.__webglDepthbuffer&&o.deleteRenderbuffer(j.__webglDepthbuffer[ge])}else{if(Array.isArray(j.__webglFramebuffer))for(let ge=0;ge<j.__webglFramebuffer.length;ge++)o.deleteFramebuffer(j.__webglFramebuffer[ge]);else o.deleteFramebuffer(j.__webglFramebuffer);if(j.__webglDepthbuffer&&o.deleteRenderbuffer(j.__webglDepthbuffer),j.__webglMultisampledFramebuffer&&o.deleteFramebuffer(j.__webglMultisampledFramebuffer),j.__webglColorRenderbuffer)for(let ge=0;ge<j.__webglColorRenderbuffer.length;ge++)j.__webglColorRenderbuffer[ge]&&o.deleteRenderbuffer(j.__webglColorRenderbuffer[ge]);j.__webglDepthRenderbuffer&&o.deleteRenderbuffer(j.__webglDepthRenderbuffer)}const ae=q.textures;for(let ge=0,fe=ae.length;ge<fe;ge++){const ue=i.get(ae[ge]);ue.__webglTexture&&(o.deleteTexture(ue.__webglTexture),u.memory.textures--),i.remove(ae[ge])}i.remove(q)}let Q=0;function Z(){Q=0}function K(){const q=Q;return q>=a.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+q+" texture units while this GPU supports only "+a.maxTextures),Q+=1,q}function s(q){const j=[];return j.push(q.wrapS),j.push(q.wrapT),j.push(q.wrapR||0),j.push(q.magFilter),j.push(q.minFilter),j.push(q.anisotropy),j.push(q.internalFormat),j.push(q.format),j.push(q.type),j.push(q.generateMipmaps),j.push(q.premultiplyAlpha),j.push(q.flipY),j.push(q.unpackAlignment),j.push(q.colorSpace),j.join()}function H(q,j){const ae=i.get(q);if(q.isVideoTexture&&X(q),q.isRenderTargetTexture===!1&&q.version>0&&ae.__version!==q.version){const ge=q.image;if(ge===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ge.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{c(ae,q,j);return}}t.bindTexture(o.TEXTURE_2D,ae.__webglTexture,o.TEXTURE0+j)}function y(q,j){const ae=i.get(q);if(q.version>0&&ae.__version!==q.version){c(ae,q,j);return}t.bindTexture(o.TEXTURE_2D_ARRAY,ae.__webglTexture,o.TEXTURE0+j)}function ee(q,j){const ae=i.get(q);if(q.version>0&&ae.__version!==q.version){c(ae,q,j);return}t.bindTexture(o.TEXTURE_3D,ae.__webglTexture,o.TEXTURE0+j)}function I(q,j){const ae=i.get(q);if(q.version>0&&ae.__version!==q.version){h(ae,q,j);return}t.bindTexture(o.TEXTURE_CUBE_MAP,ae.__webglTexture,o.TEXTURE0+j)}const re={[ds]:o.REPEAT,[ai]:o.CLAMP_TO_EDGE,[qa]:o.MIRRORED_REPEAT},Ae={[gi]:o.NEAREST,[Lu]:o.NEAREST_MIPMAP_NEAREST,[Nr]:o.NEAREST_MIPMAP_LINEAR,[Et]:o.LINEAR,[Oa]:o.LINEAR_MIPMAP_NEAREST,[hn]:o.LINEAR_MIPMAP_LINEAR},N={[oM]:o.NEVER,[fM]:o.ALWAYS,[lM]:o.LESS,[bS]:o.LEQUAL,[cM]:o.EQUAL,[dM]:o.GEQUAL,[uM]:o.GREATER,[hM]:o.NOTEQUAL};function n(q,j){if(j.type===oi&&e.has("OES_texture_float_linear")===!1&&(j.magFilter===Et||j.magFilter===Oa||j.magFilter===Nr||j.magFilter===hn||j.minFilter===Et||j.minFilter===Oa||j.minFilter===Nr||j.minFilter===hn)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o.texParameteri(q,o.TEXTURE_WRAP_S,re[j.wrapS]),o.texParameteri(q,o.TEXTURE_WRAP_T,re[j.wrapT]),(q===o.TEXTURE_3D||q===o.TEXTURE_2D_ARRAY)&&o.texParameteri(q,o.TEXTURE_WRAP_R,re[j.wrapR]),o.texParameteri(q,o.TEXTURE_MAG_FILTER,Ae[j.magFilter]),o.texParameteri(q,o.TEXTURE_MIN_FILTER,Ae[j.minFilter]),j.compareFunction&&(o.texParameteri(q,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(q,o.TEXTURE_COMPARE_FUNC,N[j.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(j.magFilter===gi||j.minFilter!==Nr&&j.minFilter!==hn||j.type===oi&&e.has("OES_texture_float_linear")===!1)return;if(j.anisotropy>1||i.get(j).__currentAnisotropy){const ae=e.get("EXT_texture_filter_anisotropic");o.texParameterf(q,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(j.anisotropy,a.getMaxAnisotropy())),i.get(j).__currentAnisotropy=j.anisotropy}}}function r(q,j){let ae=!1;q.__webglInit===void 0&&(q.__webglInit=!0,j.addEventListener("dispose",G));const ge=j.source;let fe=b.get(ge);fe===void 0&&(fe={},b.set(ge,fe));const ue=s(j);if(ue!==q.__cacheKey){fe[ue]===void 0&&(fe[ue]={texture:o.createTexture(),usedTimes:0},u.memory.textures++,ae=!0),fe[ue].usedTimes++;const ve=fe[q.__cacheKey];ve!==void 0&&(fe[q.__cacheKey].usedTimes--,ve.usedTimes===0&&k(j)),q.__cacheKey=ue,q.__webglTexture=fe[ue].texture}return ae}function c(q,j,ae){let ge=o.TEXTURE_2D;(j.isDataArrayTexture||j.isCompressedArrayTexture)&&(ge=o.TEXTURE_2D_ARRAY),j.isData3DTexture&&(ge=o.TEXTURE_3D);const fe=r(q,j),ue=j.source;t.bindTexture(ge,q.__webglTexture,o.TEXTURE0+ae);const ve=i.get(ue);if(ue.version!==ve.__version||fe===!0){t.activeTexture(o.TEXTURE0+ae);const Re=wt.getPrimaries(wt.workingColorSpace),Le=j.colorSpace===Gn?null:wt.getPrimaries(j.colorSpace),Xe=j.colorSpace===Gn||Re===Le?o.NONE:o.BROWSER_DEFAULT_WEBGL;o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,j.flipY),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),o.pixelStorei(o.UNPACK_ALIGNMENT,j.unpackAlignment),o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xe);let xe=C(j.image,!1,a.maxTextureSize);xe=ie(j,xe);const Pe=l.convert(j.format,j.colorSpace),Ie=l.convert(j.type);let Ue=M(j.internalFormat,Pe,Ie,j.colorSpace,j.isVideoTexture);n(ge,j);let Ne;const et=j.mipmaps,Ke=j.isVideoTexture!==!0,pt=ve.__version===void 0||fe===!0,ne=ue.dataReady,Oe=D(j,xe);if(j.isDepthTexture)Ue=B(j.format===yl,j.type),pt&&(Ke?t.texStorage2D(o.TEXTURE_2D,1,Ue,xe.width,xe.height):t.texImage2D(o.TEXTURE_2D,0,Ue,xe.width,xe.height,0,Pe,Ie,null));else if(j.isDataTexture)if(et.length>0){Ke&&pt&&t.texStorage2D(o.TEXTURE_2D,Oe,Ue,et[0].width,et[0].height);for(let ye=0,we=et.length;ye<we;ye++)Ne=et[ye],Ke?ne&&t.texSubImage2D(o.TEXTURE_2D,ye,0,0,Ne.width,Ne.height,Pe,Ie,Ne.data):t.texImage2D(o.TEXTURE_2D,ye,Ue,Ne.width,Ne.height,0,Pe,Ie,Ne.data);j.generateMipmaps=!1}else Ke?(pt&&t.texStorage2D(o.TEXTURE_2D,Oe,Ue,xe.width,xe.height),ne&&t.texSubImage2D(o.TEXTURE_2D,0,0,0,xe.width,xe.height,Pe,Ie,xe.data)):t.texImage2D(o.TEXTURE_2D,0,Ue,xe.width,xe.height,0,Pe,Ie,xe.data);else if(j.isCompressedTexture)if(j.isCompressedArrayTexture){Ke&&pt&&t.texStorage3D(o.TEXTURE_2D_ARRAY,Oe,Ue,et[0].width,et[0].height,xe.depth);for(let ye=0,we=et.length;ye<we;ye++)if(Ne=et[ye],j.format!==Xt)if(Pe!==null)if(Ke){if(ne)if(j.layerUpdates.size>0){const ze=Fy(Ne.width,Ne.height,j.format,j.type);for(const $e of j.layerUpdates){const qe=Ne.data.subarray($e*ze/Ne.data.BYTES_PER_ELEMENT,($e+1)*ze/Ne.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY,ye,0,0,$e,Ne.width,Ne.height,1,Pe,qe)}j.clearLayerUpdates()}else t.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY,ye,0,0,0,Ne.width,Ne.height,xe.depth,Pe,Ne.data)}else t.compressedTexImage3D(o.TEXTURE_2D_ARRAY,ye,Ue,Ne.width,Ne.height,xe.depth,0,Ne.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Ke?ne&&t.texSubImage3D(o.TEXTURE_2D_ARRAY,ye,0,0,0,Ne.width,Ne.height,xe.depth,Pe,Ie,Ne.data):t.texImage3D(o.TEXTURE_2D_ARRAY,ye,Ue,Ne.width,Ne.height,xe.depth,0,Pe,Ie,Ne.data)}else{Ke&&pt&&t.texStorage2D(o.TEXTURE_2D,Oe,Ue,et[0].width,et[0].height);for(let ye=0,we=et.length;ye<we;ye++)Ne=et[ye],j.format!==Xt?Pe!==null?Ke?ne&&t.compressedTexSubImage2D(o.TEXTURE_2D,ye,0,0,Ne.width,Ne.height,Pe,Ne.data):t.compressedTexImage2D(o.TEXTURE_2D,ye,Ue,Ne.width,Ne.height,0,Ne.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ke?ne&&t.texSubImage2D(o.TEXTURE_2D,ye,0,0,Ne.width,Ne.height,Pe,Ie,Ne.data):t.texImage2D(o.TEXTURE_2D,ye,Ue,Ne.width,Ne.height,0,Pe,Ie,Ne.data)}else if(j.isDataArrayTexture)if(Ke){if(pt&&t.texStorage3D(o.TEXTURE_2D_ARRAY,Oe,Ue,xe.width,xe.height,xe.depth),ne)if(j.layerUpdates.size>0){const ye=Fy(xe.width,xe.height,j.format,j.type);for(const we of j.layerUpdates){const ze=xe.data.subarray(we*ye/xe.data.BYTES_PER_ELEMENT,(we+1)*ye/xe.data.BYTES_PER_ELEMENT);t.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,we,xe.width,xe.height,1,Pe,Ie,ze)}j.clearLayerUpdates()}else t.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,0,xe.width,xe.height,xe.depth,Pe,Ie,xe.data)}else t.texImage3D(o.TEXTURE_2D_ARRAY,0,Ue,xe.width,xe.height,xe.depth,0,Pe,Ie,xe.data);else if(j.isData3DTexture)Ke?(pt&&t.texStorage3D(o.TEXTURE_3D,Oe,Ue,xe.width,xe.height,xe.depth),ne&&t.texSubImage3D(o.TEXTURE_3D,0,0,0,0,xe.width,xe.height,xe.depth,Pe,Ie,xe.data)):t.texImage3D(o.TEXTURE_3D,0,Ue,xe.width,xe.height,xe.depth,0,Pe,Ie,xe.data);else if(j.isFramebufferTexture){if(pt)if(Ke)t.texStorage2D(o.TEXTURE_2D,Oe,Ue,xe.width,xe.height);else{let ye=xe.width,we=xe.height;for(let ze=0;ze<Oe;ze++)t.texImage2D(o.TEXTURE_2D,ze,Ue,ye,we,0,Pe,Ie,null),ye>>=1,we>>=1}}else if(et.length>0){if(Ke&&pt){const ye=de(et[0]);t.texStorage2D(o.TEXTURE_2D,Oe,Ue,ye.width,ye.height)}for(let ye=0,we=et.length;ye<we;ye++)Ne=et[ye],Ke?ne&&t.texSubImage2D(o.TEXTURE_2D,ye,0,0,Pe,Ie,Ne):t.texImage2D(o.TEXTURE_2D,ye,Ue,Pe,Ie,Ne);j.generateMipmaps=!1}else if(Ke){if(pt){const ye=de(xe);t.texStorage2D(o.TEXTURE_2D,Oe,Ue,ye.width,ye.height)}ne&&t.texSubImage2D(o.TEXTURE_2D,0,0,0,Pe,Ie,xe)}else t.texImage2D(o.TEXTURE_2D,0,Ue,Pe,Ie,xe);T(j)&&x(ge),ve.__version=ue.version,j.onUpdate&&j.onUpdate(j)}q.__version=j.version}function h(q,j,ae){if(j.image.length!==6)return;const ge=r(q,j),fe=j.source;t.bindTexture(o.TEXTURE_CUBE_MAP,q.__webglTexture,o.TEXTURE0+ae);const ue=i.get(fe);if(fe.version!==ue.__version||ge===!0){t.activeTexture(o.TEXTURE0+ae);const ve=wt.getPrimaries(wt.workingColorSpace),Re=j.colorSpace===Gn?null:wt.getPrimaries(j.colorSpace),Le=j.colorSpace===Gn||ve===Re?o.NONE:o.BROWSER_DEFAULT_WEBGL;o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,j.flipY),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),o.pixelStorei(o.UNPACK_ALIGNMENT,j.unpackAlignment),o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,Le);const Xe=j.isCompressedTexture||j.image[0].isCompressedTexture,xe=j.image[0]&&j.image[0].isDataTexture,Pe=[];for(let we=0;we<6;we++)!Xe&&!xe?Pe[we]=C(j.image[we],!0,a.maxCubemapSize):Pe[we]=xe?j.image[we].image:j.image[we],Pe[we]=ie(j,Pe[we]);const Ie=Pe[0],Ue=l.convert(j.format,j.colorSpace),Ne=l.convert(j.type),et=M(j.internalFormat,Ue,Ne,j.colorSpace),Ke=j.isVideoTexture!==!0,pt=ue.__version===void 0||ge===!0,ne=fe.dataReady;let Oe=D(j,Ie);n(o.TEXTURE_CUBE_MAP,j);let ye;if(Xe){Ke&&pt&&t.texStorage2D(o.TEXTURE_CUBE_MAP,Oe,et,Ie.width,Ie.height);for(let we=0;we<6;we++){ye=Pe[we].mipmaps;for(let ze=0;ze<ye.length;ze++){const $e=ye[ze];j.format!==Xt?Ue!==null?Ke?ne&&t.compressedTexSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze,0,0,$e.width,$e.height,Ue,$e.data):t.compressedTexImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze,et,$e.width,$e.height,0,$e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze,0,0,$e.width,$e.height,Ue,Ne,$e.data):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze,et,$e.width,$e.height,0,Ue,Ne,$e.data)}}}else{if(ye=j.mipmaps,Ke&&pt){ye.length>0&&Oe++;const we=de(Pe[0]);t.texStorage2D(o.TEXTURE_CUBE_MAP,Oe,et,we.width,we.height)}for(let we=0;we<6;we++)if(xe){Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,0,0,Pe[we].width,Pe[we].height,Ue,Ne,Pe[we].data):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,et,Pe[we].width,Pe[we].height,0,Ue,Ne,Pe[we].data);for(let ze=0;ze<ye.length;ze++){const qe=ye[ze].image[we].image;Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze+1,0,0,qe.width,qe.height,Ue,Ne,qe.data):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze+1,et,qe.width,qe.height,0,Ue,Ne,qe.data)}}else{Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,0,0,Ue,Ne,Pe[we]):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,0,et,Ue,Ne,Pe[we]);for(let ze=0;ze<ye.length;ze++){const $e=ye[ze];Ke?ne&&t.texSubImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze+1,0,0,Ue,Ne,$e.image[we]):t.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+we,ze+1,et,Ue,Ne,$e.image[we])}}}T(j)&&x(o.TEXTURE_CUBE_MAP),ue.__version=fe.version,j.onUpdate&&j.onUpdate(j)}q.__version=j.version}function f(q,j,ae,ge,fe,ue){const ve=l.convert(ae.format,ae.colorSpace),Re=l.convert(ae.type),Le=M(ae.internalFormat,ve,Re,ae.colorSpace),Xe=i.get(j),xe=i.get(ae);if(xe.__renderTarget=j,!Xe.__hasExternalTextures){const Pe=Math.max(1,j.width>>ue),Ie=Math.max(1,j.height>>ue);fe===o.TEXTURE_3D||fe===o.TEXTURE_2D_ARRAY?t.texImage3D(fe,ue,Le,Pe,Ie,j.depth,0,ve,Re,null):t.texImage2D(fe,ue,Le,Pe,Ie,0,ve,Re,null)}t.bindFramebuffer(o.FRAMEBUFFER,q),te(j)?d.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,ge,fe,xe.__webglTexture,0,Y(j)):(fe===o.TEXTURE_2D||fe>=o.TEXTURE_CUBE_MAP_POSITIVE_X&&fe<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&o.framebufferTexture2D(o.FRAMEBUFFER,ge,fe,xe.__webglTexture,ue),t.bindFramebuffer(o.FRAMEBUFFER,null)}function g(q,j,ae){if(o.bindRenderbuffer(o.RENDERBUFFER,q),j.depthBuffer){const ge=j.depthTexture,fe=ge&&ge.isDepthTexture?ge.type:null,ue=B(j.stencilBuffer,fe),ve=j.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,Re=Y(j);te(j)?d.renderbufferStorageMultisampleEXT(o.RENDERBUFFER,Re,ue,j.width,j.height):ae?o.renderbufferStorageMultisample(o.RENDERBUFFER,Re,ue,j.width,j.height):o.renderbufferStorage(o.RENDERBUFFER,ue,j.width,j.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,ve,o.RENDERBUFFER,q)}else{const ge=j.textures;for(let fe=0;fe<ge.length;fe++){const ue=ge[fe],ve=l.convert(ue.format,ue.colorSpace),Re=l.convert(ue.type),Le=M(ue.internalFormat,ve,Re,ue.colorSpace),Xe=Y(j);ae&&te(j)===!1?o.renderbufferStorageMultisample(o.RENDERBUFFER,Xe,Le,j.width,j.height):te(j)?d.renderbufferStorageMultisampleEXT(o.RENDERBUFFER,Xe,Le,j.width,j.height):o.renderbufferStorage(o.RENDERBUFFER,Le,j.width,j.height)}}o.bindRenderbuffer(o.RENDERBUFFER,null)}function v(q,j){if(j&&j.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(o.FRAMEBUFFER,q),!(j.depthTexture&&j.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const ge=i.get(j.depthTexture);ge.__renderTarget=j,(!ge.__webglTexture||j.depthTexture.image.width!==j.width||j.depthTexture.image.height!==j.height)&&(j.depthTexture.image.width=j.width,j.depthTexture.image.height=j.height,j.depthTexture.needsUpdate=!0),H(j.depthTexture,0);const fe=ge.__webglTexture,ue=Y(j);if(j.depthTexture.format===rl)te(j)?d.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,fe,0,ue):o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,fe,0);else if(j.depthTexture.format===yl)te(j)?d.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.TEXTURE_2D,fe,0,ue):o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.TEXTURE_2D,fe,0);else throw new Error("Unknown depthTexture format")}function S(q){const j=i.get(q),ae=q.isWebGLCubeRenderTarget===!0;if(j.__boundDepthTexture!==q.depthTexture){const ge=q.depthTexture;if(j.__depthDisposeCallback&&j.__depthDisposeCallback(),ge){const fe=()=>{delete j.__boundDepthTexture,delete j.__depthDisposeCallback,ge.removeEventListener("dispose",fe)};ge.addEventListener("dispose",fe),j.__depthDisposeCallback=fe}j.__boundDepthTexture=ge}if(q.depthTexture&&!j.__autoAllocateDepthBuffer){if(ae)throw new Error("target.depthTexture not supported in Cube render targets");v(j.__webglFramebuffer,q)}else if(ae){j.__webglDepthbuffer=[];for(let ge=0;ge<6;ge++)if(t.bindFramebuffer(o.FRAMEBUFFER,j.__webglFramebuffer[ge]),j.__webglDepthbuffer[ge]===void 0)j.__webglDepthbuffer[ge]=o.createRenderbuffer(),g(j.__webglDepthbuffer[ge],q,!1);else{const fe=q.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,ue=j.__webglDepthbuffer[ge];o.bindRenderbuffer(o.RENDERBUFFER,ue),o.framebufferRenderbuffer(o.FRAMEBUFFER,fe,o.RENDERBUFFER,ue)}}else if(t.bindFramebuffer(o.FRAMEBUFFER,j.__webglFramebuffer),j.__webglDepthbuffer===void 0)j.__webglDepthbuffer=o.createRenderbuffer(),g(j.__webglDepthbuffer,q,!1);else{const ge=q.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,fe=j.__webglDepthbuffer;o.bindRenderbuffer(o.RENDERBUFFER,fe),o.framebufferRenderbuffer(o.FRAMEBUFFER,ge,o.RENDERBUFFER,fe)}t.bindFramebuffer(o.FRAMEBUFFER,null)}function R(q,j,ae){const ge=i.get(q);j!==void 0&&f(ge.__webglFramebuffer,q,q.texture,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,0),ae!==void 0&&S(q)}function L(q){const j=q.texture,ae=i.get(q),ge=i.get(j);q.addEventListener("dispose",U);const fe=q.textures,ue=q.isWebGLCubeRenderTarget===!0,ve=fe.length>1;if(ve||(ge.__webglTexture===void 0&&(ge.__webglTexture=o.createTexture()),ge.__version=j.version,u.memory.textures++),ue){ae.__webglFramebuffer=[];for(let Re=0;Re<6;Re++)if(j.mipmaps&&j.mipmaps.length>0){ae.__webglFramebuffer[Re]=[];for(let Le=0;Le<j.mipmaps.length;Le++)ae.__webglFramebuffer[Re][Le]=o.createFramebuffer()}else ae.__webglFramebuffer[Re]=o.createFramebuffer()}else{if(j.mipmaps&&j.mipmaps.length>0){ae.__webglFramebuffer=[];for(let Re=0;Re<j.mipmaps.length;Re++)ae.__webglFramebuffer[Re]=o.createFramebuffer()}else ae.__webglFramebuffer=o.createFramebuffer();if(ve)for(let Re=0,Le=fe.length;Re<Le;Re++){const Xe=i.get(fe[Re]);Xe.__webglTexture===void 0&&(Xe.__webglTexture=o.createTexture(),u.memory.textures++)}if(q.samples>0&&te(q)===!1){ae.__webglMultisampledFramebuffer=o.createFramebuffer(),ae.__webglColorRenderbuffer=[],t.bindFramebuffer(o.FRAMEBUFFER,ae.__webglMultisampledFramebuffer);for(let Re=0;Re<fe.length;Re++){const Le=fe[Re];ae.__webglColorRenderbuffer[Re]=o.createRenderbuffer(),o.bindRenderbuffer(o.RENDERBUFFER,ae.__webglColorRenderbuffer[Re]);const Xe=l.convert(Le.format,Le.colorSpace),xe=l.convert(Le.type),Pe=M(Le.internalFormat,Xe,xe,Le.colorSpace,q.isXRRenderTarget===!0),Ie=Y(q);o.renderbufferStorageMultisample(o.RENDERBUFFER,Ie,Pe,q.width,q.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+Re,o.RENDERBUFFER,ae.__webglColorRenderbuffer[Re])}o.bindRenderbuffer(o.RENDERBUFFER,null),q.depthBuffer&&(ae.__webglDepthRenderbuffer=o.createRenderbuffer(),g(ae.__webglDepthRenderbuffer,q,!0)),t.bindFramebuffer(o.FRAMEBUFFER,null)}}if(ue){t.bindTexture(o.TEXTURE_CUBE_MAP,ge.__webglTexture),n(o.TEXTURE_CUBE_MAP,j);for(let Re=0;Re<6;Re++)if(j.mipmaps&&j.mipmaps.length>0)for(let Le=0;Le<j.mipmaps.length;Le++)f(ae.__webglFramebuffer[Re][Le],q,j,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+Re,Le);else f(ae.__webglFramebuffer[Re],q,j,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0);T(j)&&x(o.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ve){for(let Re=0,Le=fe.length;Re<Le;Re++){const Xe=fe[Re],xe=i.get(Xe);t.bindTexture(o.TEXTURE_2D,xe.__webglTexture),n(o.TEXTURE_2D,Xe),f(ae.__webglFramebuffer,q,Xe,o.COLOR_ATTACHMENT0+Re,o.TEXTURE_2D,0),T(Xe)&&x(o.TEXTURE_2D)}t.unbindTexture()}else{let Re=o.TEXTURE_2D;if((q.isWebGL3DRenderTarget||q.isWebGLArrayRenderTarget)&&(Re=q.isWebGL3DRenderTarget?o.TEXTURE_3D:o.TEXTURE_2D_ARRAY),t.bindTexture(Re,ge.__webglTexture),n(Re,j),j.mipmaps&&j.mipmaps.length>0)for(let Le=0;Le<j.mipmaps.length;Le++)f(ae.__webglFramebuffer[Le],q,j,o.COLOR_ATTACHMENT0,Re,Le);else f(ae.__webglFramebuffer,q,j,o.COLOR_ATTACHMENT0,Re,0);T(j)&&x(Re),t.unbindTexture()}q.depthBuffer&&S(q)}function F(q){const j=q.textures;for(let ae=0,ge=j.length;ae<ge;ae++){const fe=j[ae];if(T(fe)){const ue=P(q),ve=i.get(fe).__webglTexture;t.bindTexture(ue,ve),x(ue),t.unbindTexture()}}}const $=[],O=[];function W(q){if(q.samples>0){if(te(q)===!1){const j=q.textures,ae=q.width,ge=q.height;let fe=o.COLOR_BUFFER_BIT;const ue=q.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT,ve=i.get(q),Re=j.length>1;if(Re)for(let Le=0;Le<j.length;Le++)t.bindFramebuffer(o.FRAMEBUFFER,ve.__webglMultisampledFramebuffer),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+Le,o.RENDERBUFFER,null),t.bindFramebuffer(o.FRAMEBUFFER,ve.__webglFramebuffer),o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0+Le,o.TEXTURE_2D,null,0);t.bindFramebuffer(o.READ_FRAMEBUFFER,ve.__webglMultisampledFramebuffer),t.bindFramebuffer(o.DRAW_FRAMEBUFFER,ve.__webglFramebuffer);for(let Le=0;Le<j.length;Le++){if(q.resolveDepthBuffer&&(q.depthBuffer&&(fe|=o.DEPTH_BUFFER_BIT),q.stencilBuffer&&q.resolveStencilBuffer&&(fe|=o.STENCIL_BUFFER_BIT)),Re){o.framebufferRenderbuffer(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.RENDERBUFFER,ve.__webglColorRenderbuffer[Le]);const Xe=i.get(j[Le]).__webglTexture;o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,Xe,0)}o.blitFramebuffer(0,0,ae,ge,0,0,ae,ge,fe,o.NEAREST),p===!0&&($.length=0,O.length=0,$.push(o.COLOR_ATTACHMENT0+Le),q.depthBuffer&&q.resolveDepthBuffer===!1&&($.push(ue),O.push(ue),o.invalidateFramebuffer(o.DRAW_FRAMEBUFFER,O)),o.invalidateFramebuffer(o.READ_FRAMEBUFFER,$))}if(t.bindFramebuffer(o.READ_FRAMEBUFFER,null),t.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),Re)for(let Le=0;Le<j.length;Le++){t.bindFramebuffer(o.FRAMEBUFFER,ve.__webglMultisampledFramebuffer),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0+Le,o.RENDERBUFFER,ve.__webglColorRenderbuffer[Le]);const Xe=i.get(j[Le]).__webglTexture;t.bindFramebuffer(o.FRAMEBUFFER,ve.__webglFramebuffer),o.framebufferTexture2D(o.DRAW_FRAMEBUFFER,o.COLOR_ATTACHMENT0+Le,o.TEXTURE_2D,Xe,0)}t.bindFramebuffer(o.DRAW_FRAMEBUFFER,ve.__webglMultisampledFramebuffer)}else if(q.depthBuffer&&q.resolveDepthBuffer===!1&&p){const j=q.stencilBuffer?o.DEPTH_STENCIL_ATTACHMENT:o.DEPTH_ATTACHMENT;o.invalidateFramebuffer(o.DRAW_FRAMEBUFFER,[j])}}}function Y(q){return Math.min(a.maxSamples,q.samples)}function te(q){const j=i.get(q);return q.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&j.__useRenderToTexture!==!1}function X(q){const j=u.render.frame;A.get(q)!==j&&(A.set(q,j),q.update())}function ie(q,j){const ae=q.colorSpace,ge=q.format,fe=q.type;return q.isCompressedTexture===!0||q.isVideoTexture===!0||ae!==qt&&ae!==Gn&&(wt.getTransfer(ae)===Gt?(ge!==Xt||fe!==ui)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ae)),j}function de(q){return typeof HTMLImageElement<"u"&&q instanceof HTMLImageElement?(m.width=q.naturalWidth||q.width,m.height=q.naturalHeight||q.height):typeof VideoFrame<"u"&&q instanceof VideoFrame?(m.width=q.displayWidth,m.height=q.displayHeight):(m.width=q.width,m.height=q.height),m}this.allocateTextureUnit=K,this.resetTextureUnits=Z,this.setTexture2D=H,this.setTexture2DArray=y,this.setTexture3D=ee,this.setTextureCube=I,this.rebindTextures=R,this.setupRenderTarget=L,this.updateRenderTargetMipmap=F,this.updateMultisampleRenderTarget=W,this.setupDepthRenderbuffer=S,this.setupFrameBufferTexture=f,this.useMultisampledRTT=te}function wD(o,e){function t(i,a=Gn){let l;const u=wt.getTransfer(a);if(i===ui)return o.UNSIGNED_BYTE;if(i===I0)return o.UNSIGNED_SHORT_4_4_4_4;if(i===M0)return o.UNSIGNED_SHORT_5_5_5_1;if(i===dS)return o.UNSIGNED_INT_5_9_9_9_REV;if(i===C0)return o.BYTE;if(i===T0)return o.SHORT;if(i===vu)return o.UNSIGNED_SHORT;if(i===Lf)return o.INT;if(i===qr)return o.UNSIGNED_INT;if(i===oi)return o.FLOAT;if(i===hi)return o.HALF_FLOAT;if(i===fS)return o.ALPHA;if(i===pS)return o.RGB;if(i===Xt)return o.RGBA;if(i===mS)return o.LUMINANCE;if(i===gS)return o.LUMINANCE_ALPHA;if(i===rl)return o.DEPTH_COMPONENT;if(i===yl)return o.DEPTH_STENCIL;if(i===Or)return o.RED;if(i===R0)return o.RED_INTEGER;if(i===La)return o.RG;if(i===B0)return o.RG_INTEGER;if(i===P0)return o.RGBA_INTEGER;if(i===bd||i===su||i===vd||i===ru)if(u===Gt)if(l=e.get("WEBGL_compressed_texture_s3tc_srgb"),l!==null){if(i===bd)return l.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===su)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===vd)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===ru)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(l=e.get("WEBGL_compressed_texture_s3tc"),l!==null){if(i===bd)return l.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===su)return l.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===vd)return l.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===ru)return l.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Hd||i===eA||i===Vd||i===tA)if(l=e.get("WEBGL_compressed_texture_pvrtc"),l!==null){if(i===Hd)return l.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===eA)return l.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Vd)return l.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===tA)return l.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Qd||i===jd||i===qd)if(l=e.get("WEBGL_compressed_texture_etc"),l!==null){if(i===Qd||i===jd)return u===Gt?l.COMPRESSED_SRGB8_ETC2:l.COMPRESSED_RGB8_ETC2;if(i===qd)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:l.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===wu||i===iA||i===nA||i===sA||i===Eu||i===rA||i===aA||i===oA||i===lA||i===cA||i===uA||i===hA||i===dA||i===fA)if(l=e.get("WEBGL_compressed_texture_astc"),l!==null){if(i===wu)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:l.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===iA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:l.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===nA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:l.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===sA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:l.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Eu)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:l.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===rA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:l.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===aA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:l.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===oA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:l.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===lA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:l.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===cA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:l.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===uA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:l.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===hA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:l.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===dA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:l.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===fA)return u===Gt?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:l.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===au||i===pA||i===Wd)if(l=e.get("EXT_texture_compression_bptc"),l!==null){if(i===au)return u===Gt?l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:l.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===pA)return l.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===Wd)return l.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===AS||i===mA||i===gA||i===AA)if(l=e.get("EXT_texture_compression_rgtc"),l!==null){if(i===au)return l.COMPRESSED_RED_RGTC1_EXT;if(i===mA)return l.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===gA)return l.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===AA)return l.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===_l?o.UNSIGNED_INT_24_8:o[i]!==void 0?o[i]:null}return{convert:t}}const ED={type:"move"};class $p{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new mi,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new mi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new mi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new se),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let a=null,l=null,u=null;const d=this._targetRay,p=this._grip,m=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(m&&e.hand){u=!0;for(const C of e.hand.values()){const T=t.getJointPose(C,i),x=this._getHandJoint(m,C);T!==null&&(x.matrix.fromArray(T.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=T.radius),x.visible=T!==null}const A=m.joints["index-finger-tip"],_=m.joints["thumb-tip"],b=A.position.distanceTo(_.position),w=.02,E=.005;m.inputState.pinching&&b>w+E?(m.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!m.inputState.pinching&&b<=w-E&&(m.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else p!==null&&e.gripSpace&&(l=t.getPose(e.gripSpace,i),l!==null&&(p.matrix.fromArray(l.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,l.linearVelocity?(p.hasLinearVelocity=!0,p.linearVelocity.copy(l.linearVelocity)):p.hasLinearVelocity=!1,l.angularVelocity?(p.hasAngularVelocity=!0,p.angularVelocity.copy(l.angularVelocity)):p.hasAngularVelocity=!1));d!==null&&(a=t.getPose(e.targetRaySpace,i),a===null&&l!==null&&(a=l),a!==null&&(d.matrix.fromArray(a.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,a.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(a.linearVelocity)):d.hasLinearVelocity=!1,a.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(a.angularVelocity)):d.hasAngularVelocity=!1,this.dispatchEvent(ED)))}return d!==null&&(d.visible=a!==null),p!==null&&(p.visible=l!==null),m!==null&&(m.visible=u!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new mi;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const xD=`
|
|
3877
3877
|
void main() {
|
|
3878
3878
|
|
|
3879
3879
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -3897,12 +3897,12 @@ void main() {
|
|
|
3897
3897
|
|
|
3898
3898
|
}
|
|
3899
3899
|
|
|
3900
|
-
}`;class CD{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const a=new Kt,l=e.properties.get(a);l.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=a}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new zi({vertexShader:xD,fragmentShader:SD,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new lt(new Ms(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class TD extends fs{constructor(e,t){super();const i=this;let a=null,l=1,u=null,d="local-floor",p=1,m=null,A=null,_=null,b=null,w=null,E=null;const C=new CD,T=t.getContextAttributes();let x=null,P=null;const M=[],B=[],D=new Ve;let G=null;const U=new _i;U.viewport=new Rt;const V=new _i;V.viewport=new Rt;const k=[U,V],z=new DR;let Q=null,Z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(c){let h=M[c];return h===void 0&&(h=new $p,M[c]=h),h.getTargetRaySpace()},this.getControllerGrip=function(c){let h=M[c];return h===void 0&&(h=new $p,M[c]=h),h.getGripSpace()},this.getHand=function(c){let h=M[c];return h===void 0&&(h=new $p,M[c]=h),h.getHandSpace()};function K(c){const h=B.indexOf(c.inputSource);if(h===-1)return;const f=M[h];f!==void 0&&(f.update(c.inputSource,c.frame,m||u),f.dispatchEvent({type:c.type,data:c.inputSource}))}function s(){a.removeEventListener("select",K),a.removeEventListener("selectstart",K),a.removeEventListener("selectend",K),a.removeEventListener("squeeze",K),a.removeEventListener("squeezestart",K),a.removeEventListener("squeezeend",K),a.removeEventListener("end",s),a.removeEventListener("inputsourceschange",H);for(let c=0;c<M.length;c++){const h=B[c];h!==null&&(B[c]=null,M[c].disconnect(h))}Q=null,Z=null,C.reset(),e.setRenderTarget(x),w=null,b=null,_=null,a=null,P=null,r.stop(),i.isPresenting=!1,e.setPixelRatio(G),e.setSize(D.width,D.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(c){l=c,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(c){d=c,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||u},this.setReferenceSpace=function(c){m=c},this.getBaseLayer=function(){return b!==null?b:w},this.getBinding=function(){return _},this.getFrame=function(){return E},this.getSession=function(){return a},this.setSession=async function(c){if(a=c,a!==null){if(x=e.getRenderTarget(),a.addEventListener("select",K),a.addEventListener("selectstart",K),a.addEventListener("selectend",K),a.addEventListener("squeeze",K),a.addEventListener("squeezestart",K),a.addEventListener("squeezeend",K),a.addEventListener("end",s),a.addEventListener("inputsourceschange",H),T.xrCompatible!==!0&&await t.makeXRCompatible(),G=e.getPixelRatio(),e.getSize(D),a.enabledFeatures!==void 0&&a.enabledFeatures.includes("layers")){let f=null,g=null,v=null;T.depth&&(v=T.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,f=T.stencil?yl:rl,g=T.stencil?_l:qr);const S={colorFormat:t.RGBA8,depthFormat:v,scaleFactor:l};_=new XRWebGLBinding(a,t),b=_.createProjectionLayer(S),a.updateRenderState({layers:[b]}),e.setPixelRatio(1),e.setSize(b.textureWidth,b.textureHeight,!1),P=new dn(b.textureWidth,b.textureHeight,{format:Xt,type:ui,depthTexture:new LS(b.textureWidth,b.textureHeight,g,void 0,void 0,void 0,void 0,void 0,void 0,f),stencilBuffer:T.stencil,colorSpace:e.outputColorSpace,samples:T.antialias?4:0,resolveDepthBuffer:b.ignoreDepthValues===!1})}else{const f={antialias:T.antialias,alpha:!0,depth:T.depth,stencil:T.stencil,framebufferScaleFactor:l};w=new XRWebGLLayer(a,t,f),a.updateRenderState({baseLayer:w}),e.setPixelRatio(1),e.setSize(w.framebufferWidth,w.framebufferHeight,!1),P=new dn(w.framebufferWidth,w.framebufferHeight,{format:Xt,type:ui,colorSpace:e.outputColorSpace,stencilBuffer:T.stencil})}P.isXRRenderTarget=!0,this.setFoveation(p),m=null,u=await a.requestReferenceSpace(d),r.setContext(a),r.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(a!==null)return a.environmentBlendMode},this.getDepthTexture=function(){return C.getDepthTexture()};function H(c){for(let h=0;h<c.removed.length;h++){const f=c.removed[h],g=B.indexOf(f);g>=0&&(B[g]=null,M[g].disconnect(f))}for(let h=0;h<c.added.length;h++){const f=c.added[h];let g=B.indexOf(f);if(g===-1){for(let S=0;S<M.length;S++)if(S>=B.length){B.push(f),g=S;break}else if(B[S]===null){B[S]=f,g=S;break}if(g===-1)break}const v=M[g];v&&v.connect(f)}}const y=new se,ee=new se;function I(c,h,f){y.setFromMatrixPosition(h.matrixWorld),ee.setFromMatrixPosition(f.matrixWorld);const g=y.distanceTo(ee),v=h.projectionMatrix.elements,S=f.projectionMatrix.elements,R=v[14]/(v[10]-1),L=v[14]/(v[10]+1),F=(v[9]+1)/v[5],$=(v[9]-1)/v[5],O=(v[8]-1)/v[0],W=(S[8]+1)/S[0],Y=R*O,te=R*W,X=g/(-O+W),ie=X*-O;if(h.matrixWorld.decompose(c.position,c.quaternion,c.scale),c.translateX(ie),c.translateZ(X),c.matrixWorld.compose(c.position,c.quaternion,c.scale),c.matrixWorldInverse.copy(c.matrixWorld).invert(),v[10]===-1)c.projectionMatrix.copy(h.projectionMatrix),c.projectionMatrixInverse.copy(h.projectionMatrixInverse);else{const de=R+X,q=L+X,j=Y-ie,ae=te+(g-ie),ge=F*L/q*de,fe=$*L/q*de;c.projectionMatrix.makePerspective(j,ae,ge,fe,de,q),c.projectionMatrixInverse.copy(c.projectionMatrix).invert()}}function re(c,h){h===null?c.matrixWorld.copy(c.matrix):c.matrixWorld.multiplyMatrices(h.matrixWorld,c.matrix),c.matrixWorldInverse.copy(c.matrixWorld).invert()}this.updateCamera=function(c){if(a===null)return;let h=c.near,f=c.far;C.texture!==null&&(C.depthNear>0&&(h=C.depthNear),C.depthFar>0&&(f=C.depthFar)),z.near=V.near=U.near=h,z.far=V.far=U.far=f,(Q!==z.near||Z!==z.far)&&(a.updateRenderState({depthNear:z.near,depthFar:z.far}),Q=z.near,Z=z.far),U.layers.mask=c.layers.mask|2,V.layers.mask=c.layers.mask|4,z.layers.mask=U.layers.mask|V.layers.mask;const g=c.parent,v=z.cameras;re(z,g);for(let S=0;S<v.length;S++)re(v[S],g);v.length===2?I(z,U,V):z.projectionMatrix.copy(U.projectionMatrix),Ae(c,z,g)};function Ae(c,h,f){f===null?c.matrix.copy(h.matrixWorld):(c.matrix.copy(f.matrixWorld),c.matrix.invert(),c.matrix.multiply(h.matrixWorld)),c.matrix.decompose(c.position,c.quaternion,c.scale),c.updateMatrixWorld(!0),c.projectionMatrix.copy(h.projectionMatrix),c.projectionMatrixInverse.copy(h.projectionMatrixInverse),c.isPerspectiveCamera&&(c.fov=El*2*Math.atan(1/c.projectionMatrix.elements[5]),c.zoom=1)}this.getCamera=function(){return z},this.getFoveation=function(){if(!(b===null&&w===null))return p},this.setFoveation=function(c){p=c,b!==null&&(b.fixedFoveation=c),w!==null&&w.fixedFoveation!==void 0&&(w.fixedFoveation=c)},this.hasDepthSensing=function(){return C.texture!==null},this.getDepthSensingMesh=function(){return C.getMesh(z)};let N=null;function n(c,h){if(A=h.getViewerPose(m||u),E=h,A!==null){const f=A.views;w!==null&&(e.setRenderTargetFramebuffer(P,w.framebuffer),e.setRenderTarget(P));let g=!1;f.length!==z.cameras.length&&(z.cameras.length=0,g=!0);for(let S=0;S<f.length;S++){const R=f[S];let L=null;if(w!==null)L=w.getViewport(R);else{const $=_.getViewSubImage(b,R);L=$.viewport,S===0&&(e.setRenderTargetTextures(P,$.colorTexture,b.ignoreDepthValues?void 0:$.depthStencilTexture),e.setRenderTarget(P))}let F=k[S];F===void 0&&(F=new _i,F.layers.enable(S),F.viewport=new Rt,k[S]=F),F.matrix.fromArray(R.transform.matrix),F.matrix.decompose(F.position,F.quaternion,F.scale),F.projectionMatrix.fromArray(R.projectionMatrix),F.projectionMatrixInverse.copy(F.projectionMatrix).invert(),F.viewport.set(L.x,L.y,L.width,L.height),S===0&&(z.matrix.copy(F.matrix),z.matrix.decompose(z.position,z.quaternion,z.scale)),g===!0&&z.cameras.push(F)}const v=a.enabledFeatures;if(v&&v.includes("depth-sensing")){const S=_.getDepthInformation(f[0]);S&&S.isValid&&S.texture&&C.init(e,S,a.renderState)}}for(let f=0;f<M.length;f++){const g=B[f],v=M[f];g!==null&&v!==void 0&&v.update(g,h,m||u)}N&&N(c,h),h.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:h}),E=null}const r=new GS;r.setAnimationLoop(n),this.setAnimationLoop=function(c){N=c},this.dispose=function(){}}}const ca=new qn,ID=new tt;function MD(o,e){function t(T,x){T.matrixAutoUpdate===!0&&T.updateMatrix(),x.value.copy(T.matrix)}function i(T,x){x.color.getRGB(T.fogColor.value,TS(o)),x.isFog?(T.fogNear.value=x.near,T.fogFar.value=x.far):x.isFogExp2&&(T.fogDensity.value=x.density)}function a(T,x,P,M,B){x.isMeshBasicMaterial||x.isMeshLambertMaterial?l(T,x):x.isMeshToonMaterial?(l(T,x),_(T,x)):x.isMeshPhongMaterial?(l(T,x),A(T,x)):x.isMeshStandardMaterial?(l(T,x),b(T,x),x.isMeshPhysicalMaterial&&w(T,x,B)):x.isMeshMatcapMaterial?(l(T,x),E(T,x)):x.isMeshDepthMaterial?l(T,x):x.isMeshDistanceMaterial?(l(T,x),C(T,x)):x.isMeshNormalMaterial?l(T,x):x.isLineBasicMaterial?(u(T,x),x.isLineDashedMaterial&&d(T,x)):x.isPointsMaterial?p(T,x,P,M):x.isSpriteMaterial?m(T,x):x.isShadowMaterial?(T.color.value.copy(x.color),T.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function l(T,x){T.opacity.value=x.opacity,x.color&&T.diffuse.value.copy(x.color),x.emissive&&T.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(T.map.value=x.map,t(x.map,T.mapTransform)),x.alphaMap&&(T.alphaMap.value=x.alphaMap,t(x.alphaMap,T.alphaMapTransform)),x.bumpMap&&(T.bumpMap.value=x.bumpMap,t(x.bumpMap,T.bumpMapTransform),T.bumpScale.value=x.bumpScale,x.side===Fi&&(T.bumpScale.value*=-1)),x.normalMap&&(T.normalMap.value=x.normalMap,t(x.normalMap,T.normalMapTransform),T.normalScale.value.copy(x.normalScale),x.side===Fi&&T.normalScale.value.negate()),x.displacementMap&&(T.displacementMap.value=x.displacementMap,t(x.displacementMap,T.displacementMapTransform),T.displacementScale.value=x.displacementScale,T.displacementBias.value=x.displacementBias),x.emissiveMap&&(T.emissiveMap.value=x.emissiveMap,t(x.emissiveMap,T.emissiveMapTransform)),x.specularMap&&(T.specularMap.value=x.specularMap,t(x.specularMap,T.specularMapTransform)),x.alphaTest>0&&(T.alphaTest.value=x.alphaTest);const P=e.get(x),M=P.envMap,B=P.envMapRotation;M&&(T.envMap.value=M,ca.copy(B),ca.x*=-1,ca.y*=-1,ca.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(ca.y*=-1,ca.z*=-1),T.envMapRotation.value.setFromMatrix4(ID.makeRotationFromEuler(ca)),T.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,T.reflectivity.value=x.reflectivity,T.ior.value=x.ior,T.refractionRatio.value=x.refractionRatio),x.lightMap&&(T.lightMap.value=x.lightMap,T.lightMapIntensity.value=x.lightMapIntensity,t(x.lightMap,T.lightMapTransform)),x.aoMap&&(T.aoMap.value=x.aoMap,T.aoMapIntensity.value=x.aoMapIntensity,t(x.aoMap,T.aoMapTransform))}function u(T,x){T.diffuse.value.copy(x.color),T.opacity.value=x.opacity,x.map&&(T.map.value=x.map,t(x.map,T.mapTransform))}function d(T,x){T.dashSize.value=x.dashSize,T.totalSize.value=x.dashSize+x.gapSize,T.scale.value=x.scale}function p(T,x,P,M){T.diffuse.value.copy(x.color),T.opacity.value=x.opacity,T.size.value=x.size*P,T.scale.value=M*.5,x.map&&(T.map.value=x.map,t(x.map,T.uvTransform)),x.alphaMap&&(T.alphaMap.value=x.alphaMap,t(x.alphaMap,T.alphaMapTransform)),x.alphaTest>0&&(T.alphaTest.value=x.alphaTest)}function m(T,x){T.diffuse.value.copy(x.color),T.opacity.value=x.opacity,T.rotation.value=x.rotation,x.map&&(T.map.value=x.map,t(x.map,T.mapTransform)),x.alphaMap&&(T.alphaMap.value=x.alphaMap,t(x.alphaMap,T.alphaMapTransform)),x.alphaTest>0&&(T.alphaTest.value=x.alphaTest)}function A(T,x){T.specular.value.copy(x.specular),T.shininess.value=Math.max(x.shininess,1e-4)}function _(T,x){x.gradientMap&&(T.gradientMap.value=x.gradientMap)}function b(T,x){T.metalness.value=x.metalness,x.metalnessMap&&(T.metalnessMap.value=x.metalnessMap,t(x.metalnessMap,T.metalnessMapTransform)),T.roughness.value=x.roughness,x.roughnessMap&&(T.roughnessMap.value=x.roughnessMap,t(x.roughnessMap,T.roughnessMapTransform)),x.envMap&&(T.envMapIntensity.value=x.envMapIntensity)}function w(T,x,P){T.ior.value=x.ior,x.sheen>0&&(T.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),T.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(T.sheenColorMap.value=x.sheenColorMap,t(x.sheenColorMap,T.sheenColorMapTransform)),x.sheenRoughnessMap&&(T.sheenRoughnessMap.value=x.sheenRoughnessMap,t(x.sheenRoughnessMap,T.sheenRoughnessMapTransform))),x.clearcoat>0&&(T.clearcoat.value=x.clearcoat,T.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(T.clearcoatMap.value=x.clearcoatMap,t(x.clearcoatMap,T.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(T.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,t(x.clearcoatRoughnessMap,T.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(T.clearcoatNormalMap.value=x.clearcoatNormalMap,t(x.clearcoatNormalMap,T.clearcoatNormalMapTransform),T.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Fi&&T.clearcoatNormalScale.value.negate())),x.dispersion>0&&(T.dispersion.value=x.dispersion),x.iridescence>0&&(T.iridescence.value=x.iridescence,T.iridescenceIOR.value=x.iridescenceIOR,T.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],T.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(T.iridescenceMap.value=x.iridescenceMap,t(x.iridescenceMap,T.iridescenceMapTransform)),x.iridescenceThicknessMap&&(T.iridescenceThicknessMap.value=x.iridescenceThicknessMap,t(x.iridescenceThicknessMap,T.iridescenceThicknessMapTransform))),x.transmission>0&&(T.transmission.value=x.transmission,T.transmissionSamplerMap.value=P.texture,T.transmissionSamplerSize.value.set(P.width,P.height),x.transmissionMap&&(T.transmissionMap.value=x.transmissionMap,t(x.transmissionMap,T.transmissionMapTransform)),T.thickness.value=x.thickness,x.thicknessMap&&(T.thicknessMap.value=x.thicknessMap,t(x.thicknessMap,T.thicknessMapTransform)),T.attenuationDistance.value=x.attenuationDistance,T.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(T.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(T.anisotropyMap.value=x.anisotropyMap,t(x.anisotropyMap,T.anisotropyMapTransform))),T.specularIntensity.value=x.specularIntensity,T.specularColor.value.copy(x.specularColor),x.specularColorMap&&(T.specularColorMap.value=x.specularColorMap,t(x.specularColorMap,T.specularColorMapTransform)),x.specularIntensityMap&&(T.specularIntensityMap.value=x.specularIntensityMap,t(x.specularIntensityMap,T.specularIntensityMapTransform))}function E(T,x){x.matcap&&(T.matcap.value=x.matcap)}function C(T,x){const P=e.get(x).light;T.referencePosition.value.setFromMatrixPosition(P.matrixWorld),T.nearDistance.value=P.shadow.camera.near,T.farDistance.value=P.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:a}}function RD(o,e,t,i){let a={},l={},u=[];const d=o.getParameter(o.MAX_UNIFORM_BUFFER_BINDINGS);function p(P,M){const B=M.program;i.uniformBlockBinding(P,B)}function m(P,M){let B=a[P.id];B===void 0&&(E(P),B=A(P),a[P.id]=B,P.addEventListener("dispose",T));const D=M.program;i.updateUBOMapping(P,D);const G=e.render.frame;l[P.id]!==G&&(b(P),l[P.id]=G)}function A(P){const M=_();P.__bindingPointIndex=M;const B=o.createBuffer(),D=P.__size,G=P.usage;return o.bindBuffer(o.UNIFORM_BUFFER,B),o.bufferData(o.UNIFORM_BUFFER,D,G),o.bindBuffer(o.UNIFORM_BUFFER,null),o.bindBufferBase(o.UNIFORM_BUFFER,M,B),B}function _(){for(let P=0;P<d;P++)if(u.indexOf(P)===-1)return u.push(P),P;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function b(P){const M=a[P.id],B=P.uniforms,D=P.__cache;o.bindBuffer(o.UNIFORM_BUFFER,M);for(let G=0,U=B.length;G<U;G++){const V=Array.isArray(B[G])?B[G]:[B[G]];for(let k=0,z=V.length;k<z;k++){const Q=V[k];if(w(Q,G,k,D)===!0){const Z=Q.__offset,K=Array.isArray(Q.value)?Q.value:[Q.value];let s=0;for(let H=0;H<K.length;H++){const y=K[H],ee=C(y);typeof y=="number"||typeof y=="boolean"?(Q.__data[0]=y,o.bufferSubData(o.UNIFORM_BUFFER,Z+s,Q.__data)):y.isMatrix3?(Q.__data[0]=y.elements[0],Q.__data[1]=y.elements[1],Q.__data[2]=y.elements[2],Q.__data[3]=0,Q.__data[4]=y.elements[3],Q.__data[5]=y.elements[4],Q.__data[6]=y.elements[5],Q.__data[7]=0,Q.__data[8]=y.elements[6],Q.__data[9]=y.elements[7],Q.__data[10]=y.elements[8],Q.__data[11]=0):(y.toArray(Q.__data,s),s+=ee.storage/Float32Array.BYTES_PER_ELEMENT)}o.bufferSubData(o.UNIFORM_BUFFER,Z,Q.__data)}}}o.bindBuffer(o.UNIFORM_BUFFER,null)}function w(P,M,B,D){const G=P.value,U=M+"_"+B;if(D[U]===void 0)return typeof G=="number"||typeof G=="boolean"?D[U]=G:D[U]=G.clone(),!0;{const V=D[U];if(typeof G=="number"||typeof G=="boolean"){if(V!==G)return D[U]=G,!0}else if(V.equals(G)===!1)return V.copy(G),!0}return!1}function E(P){const M=P.uniforms;let B=0;const D=16;for(let U=0,V=M.length;U<V;U++){const k=Array.isArray(M[U])?M[U]:[M[U]];for(let z=0,Q=k.length;z<Q;z++){const Z=k[z],K=Array.isArray(Z.value)?Z.value:[Z.value];for(let s=0,H=K.length;s<H;s++){const y=K[s],ee=C(y),I=B%D,re=I%ee.boundary,Ae=I+re;B+=re,Ae!==0&&D-Ae<ee.storage&&(B+=D-Ae),Z.__data=new Float32Array(ee.storage/Float32Array.BYTES_PER_ELEMENT),Z.__offset=B,B+=ee.storage}}}const G=B%D;return G>0&&(B+=D-G),P.__size=B,P.__cache={},this}function C(P){const M={boundary:0,storage:0};return typeof P=="number"||typeof P=="boolean"?(M.boundary=4,M.storage=4):P.isVector2?(M.boundary=8,M.storage=8):P.isVector3||P.isColor?(M.boundary=16,M.storage=12):P.isVector4?(M.boundary=16,M.storage=16):P.isMatrix3?(M.boundary=48,M.storage=48):P.isMatrix4?(M.boundary=64,M.storage=64):P.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",P),M}function T(P){const M=P.target;M.removeEventListener("dispose",T);const B=u.indexOf(M.__bindingPointIndex);u.splice(B,1),o.deleteBuffer(a[M.id]),delete a[M.id],delete l[M.id]}function x(){for(const P in a)o.deleteBuffer(a[P]);u=[],a={},l={}}return{bind:p,update:m,dispose:x}}class tf{constructor(e={}){const{canvas:t=RM(),context:i=null,depth:a=!0,stencil:l=!1,alpha:u=!1,antialias:d=!1,premultipliedAlpha:p=!0,preserveDrawingBuffer:m=!1,powerPreference:A="default",failIfMajorPerformanceCaveat:_=!1,reverseDepthBuffer:b=!1}=e;this.isWebGLRenderer=!0;let w;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");w=i.getContextAttributes().alpha}else w=u;const E=new Uint32Array(4),C=new Int32Array(4);let T=null,x=null;const P=[],M=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ht,this.toneMapping=Ss,this.toneMappingExposure=1;const B=this;let D=!1,G=0,U=0,V=null,k=-1,z=null;const Q=new Rt,Z=new Rt;let K=null;const s=new Ye(0);let H=0,y=t.width,ee=t.height,I=1,re=null,Ae=null;const N=new Rt(0,0,y,ee),n=new Rt(0,0,y,ee);let r=!1;const c=new $0;let h=!1,f=!1;this.transmissionResolutionScale=1;const g=new tt,v=new tt,S=new se,R=new Rt,L={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let F=!1;function $(){return V===null?I:1}let O=i;function W(J,oe){return t.getContext(J,oe)}try{const J={alpha:!0,depth:a,stencil:l,antialias:d,premultipliedAlpha:p,preserveDrawingBuffer:m,powerPreference:A,failIfMajorPerformanceCaveat:_};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Bf}`),t.addEventListener("webglcontextlost",we,!1),t.addEventListener("webglcontextrestored",ze,!1),t.addEventListener("webglcontextcreationerror",$e,!1),O===null){const oe="webgl2";if(O=W(oe,J),O===null)throw W(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(J){throw console.error("THREE.WebGLRenderer: "+J.message),J}let Y,te,X,ie,de,q,j,ae,ge,fe,ue,ve,Re,Le,Xe,xe,Pe,Ie,Ue,Ne,et,Ke,pt,ne;function Oe(){Y=new $P(O),Y.init(),Ke=new wD(O,Y),te=new DP(O,Y,e,Ke),X=new bD(O,Y),te.reverseDepthBuffer&&b&&X.buffers.depth.setReversed(!0),ie=new HP(O),de=new oD,q=new vD(O,Y,X,de,te,Ke,ie),j=new OP(B),ae=new FP(B),ge=new XR(O),pt=new PP(O,ge),fe=new zP(O,ge,ie,pt),ue=new QP(O,fe,ge,ie),Ue=new VP(O,te,q),xe=new NP(de),ve=new aD(B,j,ae,Y,te,pt,xe),Re=new MD(B,de),Le=new cD,Xe=new mD(Y),Ie=new BP(B,j,ae,X,ue,w,p),Pe=new _D(B,ue,te),ne=new RD(O,ie,te,X),Ne=new LP(O,Y,ie),et=new GP(O,Y,ie),ie.programs=ve.programs,B.capabilities=te,B.extensions=Y,B.properties=de,B.renderLists=Le,B.shadowMap=Pe,B.state=X,B.info=ie}Oe();const ye=new TD(B,O);this.xr=ye,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){const J=Y.get("WEBGL_lose_context");J&&J.loseContext()},this.forceContextRestore=function(){const J=Y.get("WEBGL_lose_context");J&&J.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(J){J!==void 0&&(I=J,this.setSize(y,ee,!1))},this.getSize=function(J){return J.set(y,ee)},this.setSize=function(J,oe,pe=!0){if(ye.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}y=J,ee=oe,t.width=Math.floor(J*I),t.height=Math.floor(oe*I),pe===!0&&(t.style.width=J+"px",t.style.height=oe+"px"),this.setViewport(0,0,J,oe)},this.getDrawingBufferSize=function(J){return J.set(y*I,ee*I).floor()},this.setDrawingBufferSize=function(J,oe,pe){y=J,ee=oe,I=pe,t.width=Math.floor(J*pe),t.height=Math.floor(oe*pe),this.setViewport(0,0,J,oe)},this.getCurrentViewport=function(J){return J.copy(Q)},this.getViewport=function(J){return J.copy(N)},this.setViewport=function(J,oe,pe,me){J.isVector4?N.set(J.x,J.y,J.z,J.w):N.set(J,oe,pe,me),X.viewport(Q.copy(N).multiplyScalar(I).round())},this.getScissor=function(J){return J.copy(n)},this.setScissor=function(J,oe,pe,me){J.isVector4?n.set(J.x,J.y,J.z,J.w):n.set(J,oe,pe,me),X.scissor(Z.copy(n).multiplyScalar(I).round())},this.getScissorTest=function(){return r},this.setScissorTest=function(J){X.setScissorTest(r=J)},this.setOpaqueSort=function(J){re=J},this.setTransparentSort=function(J){Ae=J},this.getClearColor=function(J){return J.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor.apply(Ie,arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha.apply(Ie,arguments)},this.clear=function(J=!0,oe=!0,pe=!0){let me=0;if(J){let ce=!1;if(V!==null){const Ce=V.texture.format;ce=Ce===P0||Ce===B0||Ce===R0}if(ce){const Ce=V.texture.type,ke=Ce===ui||Ce===qr||Ce===vu||Ce===_l||Ce===I0||Ce===M0,He=Ie.getClearColor(),De=Ie.getClearAlpha(),it=He.r,st=He.g,Je=He.b;ke?(E[0]=it,E[1]=st,E[2]=Je,E[3]=De,O.clearBufferuiv(O.COLOR,0,E)):(C[0]=it,C[1]=st,C[2]=Je,C[3]=De,O.clearBufferiv(O.COLOR,0,C))}else me|=O.COLOR_BUFFER_BIT}oe&&(me|=O.DEPTH_BUFFER_BIT),pe&&(me|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(me)},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",we,!1),t.removeEventListener("webglcontextrestored",ze,!1),t.removeEventListener("webglcontextcreationerror",$e,!1),Ie.dispose(),Le.dispose(),Xe.dispose(),de.dispose(),j.dispose(),ae.dispose(),ue.dispose(),pt.dispose(),ne.dispose(),ve.dispose(),ye.dispose(),ye.removeEventListener("sessionstart",Kl),ye.removeEventListener("sessionend",Ku),Ei.stop()};function we(J){J.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),D=!0}function ze(){console.log("THREE.WebGLRenderer: Context Restored."),D=!1;const J=ie.autoReset,oe=Pe.enabled,pe=Pe.autoUpdate,me=Pe.needsUpdate,ce=Pe.type;Oe(),ie.autoReset=J,Pe.enabled=oe,Pe.autoUpdate=pe,Pe.needsUpdate=me,Pe.type=ce}function $e(J){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",J.statusMessage)}function qe(J){const oe=J.target;oe.removeEventListener("dispose",qe),Ot(oe)}function Ot(J){wi(J),de.remove(J)}function wi(J){const oe=de.get(J).programs;oe!==void 0&&(oe.forEach(function(pe){ve.releaseProgram(pe)}),J.isShaderMaterial&&ve.releaseShaderCache(J))}this.renderBufferDirect=function(J,oe,pe,me,ce,Ce){oe===null&&(oe=L);const ke=ce.isMesh&&ce.matrixWorld.determinant()<0,He=Ju(J,oe,pe,me,ce);X.setMaterial(me,ke);let De=pe.index,it=1;if(me.wireframe===!0){if(De=fe.getWireframeAttribute(pe),De===void 0)return;it=2}const st=pe.drawRange,Je=pe.attributes.position;let St=st.start*it,Pt=(st.start+st.count)*it;Ce!==null&&(St=Math.max(St,Ce.start*it),Pt=Math.min(Pt,(Ce.start+Ce.count)*it)),De!==null?(St=Math.max(St,0),Pt=Math.min(Pt,De.count)):Je!=null&&(St=Math.max(St,0),Pt=Math.min(Pt,Je.count));const di=Pt-St;if(di<0||di===1/0)return;pt.setup(ce,me,He,pe,De);let ri,Tt=Ne;if(De!==null&&(ri=ge.get(De),Tt=et,Tt.setIndex(ri)),ce.isMesh)me.wireframe===!0?(X.setLineWidth(me.wireframeLinewidth*$()),Tt.setMode(O.LINES)):Tt.setMode(O.TRIANGLES);else if(ce.isLine){let Ze=me.linewidth;Ze===void 0&&(Ze=1),X.setLineWidth(Ze*$()),ce.isLineSegments?Tt.setMode(O.LINES):ce.isLineLoop?Tt.setMode(O.LINE_LOOP):Tt.setMode(O.LINE_STRIP)}else ce.isPoints?Tt.setMode(O.POINTS):ce.isSprite&&Tt.setMode(O.TRIANGLES);if(ce.isBatchedMesh)if(ce._multiDrawInstances!==null)Tt.renderMultiDrawInstances(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount,ce._multiDrawInstances);else if(Y.get("WEBGL_multi_draw"))Tt.renderMultiDraw(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount);else{const Ze=ce._multiDrawStarts,Ni=ce._multiDrawCounts,Lt=ce._multiDrawCount,Zn=De?ge.get(De).bytesPerElement:1,so=de.get(me).currentProgram.getUniforms();for(let wn=0;wn<Lt;wn++)so.setValue(O,"_gl_DrawID",wn),Tt.render(Ze[wn]/Zn,Ni[wn])}else if(ce.isInstancedMesh)Tt.renderInstances(St,di,ce.count);else if(pe.isInstancedBufferGeometry){const Ze=pe._maxInstanceCount!==void 0?pe._maxInstanceCount:1/0,Ni=Math.min(pe.instanceCount,Ze);Tt.renderInstances(St,di,Ni)}else Tt.render(St,di)};function Ct(J,oe,pe){J.transparent===!0&&J.side===Ri&&J.forceSinglePass===!1?(J.side=Fi,J.needsUpdate=!0,gn(J,oe,pe),J.side=hs,J.needsUpdate=!0,gn(J,oe,pe),J.side=Ri):gn(J,oe,pe)}this.compile=function(J,oe,pe=null){pe===null&&(pe=J),x=Xe.get(pe),x.init(oe),M.push(x),pe.traverseVisible(function(ce){ce.isLight&&ce.layers.test(oe.layers)&&(x.pushLight(ce),ce.castShadow&&x.pushShadow(ce))}),J!==pe&&J.traverseVisible(function(ce){ce.isLight&&ce.layers.test(oe.layers)&&(x.pushLight(ce),ce.castShadow&&x.pushShadow(ce))}),x.setupLights();const me=new Set;return J.traverse(function(ce){if(!(ce.isMesh||ce.isPoints||ce.isLine||ce.isSprite))return;const Ce=ce.material;if(Ce)if(Array.isArray(Ce))for(let ke=0;ke<Ce.length;ke++){const He=Ce[ke];Ct(He,pe,ce),me.add(He)}else Ct(Ce,pe,ce),me.add(Ce)}),M.pop(),x=null,me},this.compileAsync=function(J,oe,pe=null){const me=this.compile(J,oe,pe);return new Promise(ce=>{function Ce(){if(me.forEach(function(ke){de.get(ke).currentProgram.isReady()&&me.delete(ke)}),me.size===0){ce(J);return}setTimeout(Ce,10)}Y.get("KHR_parallel_shader_compile")!==null?Ce():setTimeout(Ce,10)})};let Zi=null;function Nn(J){Zi&&Zi(J)}function Kl(){Ei.stop()}function Ku(){Ei.start()}const Ei=new GS;Ei.setAnimationLoop(Nn),typeof self<"u"&&Ei.setContext(self),this.setAnimationLoop=function(J){Zi=J,ye.setAnimationLoop(J),J===null?Ei.stop():Ei.start()},ye.addEventListener("sessionstart",Kl),ye.addEventListener("sessionend",Ku),this.render=function(J,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(D===!0)return;if(J.matrixWorldAutoUpdate===!0&&J.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),ye.enabled===!0&&ye.isPresenting===!0&&(ye.cameraAutoUpdate===!0&&ye.updateCamera(oe),oe=ye.getCamera()),J.isScene===!0&&J.onBeforeRender(B,J,oe,V),x=Xe.get(J,M.length),x.init(oe),M.push(x),v.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),c.setFromProjectionMatrix(v),f=this.localClippingEnabled,h=xe.init(this.clippingPlanes,f),T=Le.get(J,P.length),T.init(),P.push(T),ye.enabled===!0&&ye.isPresenting===!0){const Ce=B.xr.getDepthSensingMesh();Ce!==null&&Jn(Ce,oe,-1/0,B.sortObjects)}Jn(J,oe,0,B.sortObjects),T.finish(),B.sortObjects===!0&&T.sort(re,Ae),F=ye.enabled===!1||ye.isPresenting===!1||ye.hasDepthSensing()===!1,F&&Ie.addToRenderList(T,J),this.info.render.frame++,h===!0&&xe.beginShadows();const pe=x.state.shadowsArray;Pe.render(pe,J,oe),h===!0&&xe.endShadows(),this.info.autoReset===!0&&this.info.reset();const me=T.opaque,ce=T.transmissive;if(x.setupLights(),oe.isArrayCamera){const Ce=oe.cameras;if(ce.length>0)for(let ke=0,He=Ce.length;ke<He;ke++){const De=Ce[ke];Zl(me,ce,J,De)}F&&Ie.render(J);for(let ke=0,He=Ce.length;ke<He;ke++){const De=Ce[ke];Jl(T,J,De,De.viewport)}}else ce.length>0&&Zl(me,ce,J,oe),F&&Ie.render(J),Jl(T,J,oe);V!==null&&U===0&&(q.updateMultisampleRenderTarget(V),q.updateRenderTargetMipmap(V)),J.isScene===!0&&J.onAfterRender(B,J,oe),pt.resetDefaultState(),k=-1,z=null,M.pop(),M.length>0?(x=M[M.length-1],h===!0&&xe.setGlobalState(B.clippingPlanes,x.state.camera)):x=null,P.pop(),P.length>0?T=P[P.length-1]:T=null};function Jn(J,oe,pe,me){if(J.visible===!1)return;if(J.layers.test(oe.layers)){if(J.isGroup)pe=J.renderOrder;else if(J.isLOD)J.autoUpdate===!0&&J.update(oe);else if(J.isLight)x.pushLight(J),J.castShadow&&x.pushShadow(J);else if(J.isSprite){if(!J.frustumCulled||c.intersectsSprite(J)){me&&R.setFromMatrixPosition(J.matrixWorld).applyMatrix4(v);const ke=ue.update(J),He=J.material;He.visible&&T.push(J,ke,He,pe,R.z,null)}}else if((J.isMesh||J.isLine||J.isPoints)&&(!J.frustumCulled||c.intersectsObject(J))){const ke=ue.update(J),He=J.material;if(me&&(J.boundingSphere!==void 0?(J.boundingSphere===null&&J.computeBoundingSphere(),R.copy(J.boundingSphere.center)):(ke.boundingSphere===null&&ke.computeBoundingSphere(),R.copy(ke.boundingSphere.center)),R.applyMatrix4(J.matrixWorld).applyMatrix4(v)),Array.isArray(He)){const De=ke.groups;for(let it=0,st=De.length;it<st;it++){const Je=De[it],St=He[Je.materialIndex];St&&St.visible&&T.push(J,ke,St,pe,R.z,Je)}}else He.visible&&T.push(J,ke,He,pe,R.z,null)}}const Ce=J.children;for(let ke=0,He=Ce.length;ke<He;ke++)Jn(Ce[ke],oe,pe,me)}function Jl(J,oe,pe,me){const ce=J.opaque,Ce=J.transmissive,ke=J.transparent;x.setupLightsView(pe),h===!0&&xe.setGlobalState(B.clippingPlanes,pe),me&&X.viewport(Q.copy(me)),ce.length>0&&dr(ce,oe,pe),Ce.length>0&&dr(Ce,oe,pe),ke.length>0&&dr(ke,oe,pe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1)}function Zl(J,oe,pe,me){if((pe.isScene===!0?pe.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[me.id]===void 0&&(x.state.transmissionRenderTarget[me.id]=new dn(1,1,{generateMipmaps:!0,type:Y.has("EXT_color_buffer_half_float")||Y.has("EXT_color_buffer_float")?hi:ui,minFilter:hn,samples:4,stencilBuffer:l,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:vt.workingColorSpace}));const Ce=x.state.transmissionRenderTarget[me.id],ke=me.viewport||Q;Ce.setSize(ke.z*B.transmissionResolutionScale,ke.w*B.transmissionResolutionScale);const He=B.getRenderTarget();B.setRenderTarget(Ce),B.getClearColor(s),H=B.getClearAlpha(),H<1&&B.setClearColor(16777215,.5),B.clear(),F&&Ie.render(pe);const De=B.toneMapping;B.toneMapping=Ss;const it=me.viewport;if(me.viewport!==void 0&&(me.viewport=void 0),x.setupLightsView(me),h===!0&&xe.setGlobalState(B.clippingPlanes,me),dr(J,pe,me),q.updateMultisampleRenderTarget(Ce),q.updateRenderTargetMipmap(Ce),Y.has("WEBGL_multisampled_render_to_texture")===!1){let st=!1;for(let Je=0,St=oe.length;Je<St;Je++){const Pt=oe[Je],di=Pt.object,ri=Pt.geometry,Tt=Pt.material,Ze=Pt.group;if(Tt.side===Ri&&di.layers.test(me.layers)){const Ni=Tt.side;Tt.side=Fi,Tt.needsUpdate=!0,ec(di,pe,me,ri,Tt,Ze),Tt.side=Ni,Tt.needsUpdate=!0,st=!0}}st===!0&&(q.updateMultisampleRenderTarget(Ce),q.updateRenderTargetMipmap(Ce))}B.setRenderTarget(He),B.setClearColor(s,H),it!==void 0&&(me.viewport=it),B.toneMapping=De}function dr(J,oe,pe){const me=oe.isScene===!0?oe.overrideMaterial:null;for(let ce=0,Ce=J.length;ce<Ce;ce++){const ke=J[ce],He=ke.object,De=ke.geometry,it=me===null?ke.material:me,st=ke.group;He.layers.test(pe.layers)&&ec(He,oe,pe,De,it,st)}}function ec(J,oe,pe,me,ce,Ce){J.onBeforeRender(B,oe,pe,me,ce,Ce),J.modelViewMatrix.multiplyMatrices(pe.matrixWorldInverse,J.matrixWorld),J.normalMatrix.getNormalMatrix(J.modelViewMatrix),ce.onBeforeRender(B,oe,pe,me,J,Ce),ce.transparent===!0&&ce.side===Ri&&ce.forceSinglePass===!1?(ce.side=Fi,ce.needsUpdate=!0,B.renderBufferDirect(pe,oe,me,ce,J,Ce),ce.side=hs,ce.needsUpdate=!0,B.renderBufferDirect(pe,oe,me,ce,J,Ce),ce.side=Ri):B.renderBufferDirect(pe,oe,me,ce,J,Ce),J.onAfterRender(B,oe,pe,me,ce,Ce)}function gn(J,oe,pe){oe.isScene!==!0&&(oe=L);const me=de.get(J),ce=x.state.lights,Ce=x.state.shadowsArray,ke=ce.state.version,He=ve.getParameters(J,ce.state,Ce,oe,pe),De=ve.getProgramCacheKey(He);let it=me.programs;me.environment=J.isMeshStandardMaterial?oe.environment:null,me.fog=oe.fog,me.envMap=(J.isMeshStandardMaterial?ae:j).get(J.envMap||me.environment),me.envMapRotation=me.environment!==null&&J.envMap===null?oe.environmentRotation:J.envMapRotation,it===void 0&&(J.addEventListener("dispose",qe),it=new Map,me.programs=it);let st=it.get(De);if(st!==void 0){if(me.currentProgram===st&&me.lightsStateVersion===ke)return ic(J,He),st}else He.uniforms=ve.getUniforms(J),J.onBeforeCompile(He,B),st=ve.acquireProgram(He,De),it.set(De,st),me.uniforms=He.uniforms;const Je=me.uniforms;return(!J.isShaderMaterial&&!J.isRawShaderMaterial||J.clipping===!0)&&(Je.clippingPlanes=xe.uniform),ic(J,He),me.needsLights=ep(J),me.lightsStateVersion=ke,me.needsLights&&(Je.ambientLightColor.value=ce.state.ambient,Je.lightProbe.value=ce.state.probe,Je.directionalLights.value=ce.state.directional,Je.directionalLightShadows.value=ce.state.directionalShadow,Je.spotLights.value=ce.state.spot,Je.spotLightShadows.value=ce.state.spotShadow,Je.rectAreaLights.value=ce.state.rectArea,Je.ltc_1.value=ce.state.rectAreaLTC1,Je.ltc_2.value=ce.state.rectAreaLTC2,Je.pointLights.value=ce.state.point,Je.pointLightShadows.value=ce.state.pointShadow,Je.hemisphereLights.value=ce.state.hemi,Je.directionalShadowMap.value=ce.state.directionalShadowMap,Je.directionalShadowMatrix.value=ce.state.directionalShadowMatrix,Je.spotShadowMap.value=ce.state.spotShadowMap,Je.spotLightMatrix.value=ce.state.spotLightMatrix,Je.spotLightMap.value=ce.state.spotLightMap,Je.pointShadowMap.value=ce.state.pointShadowMap,Je.pointShadowMatrix.value=ce.state.pointShadowMatrix),me.currentProgram=st,me.uniformsList=null,st}function tc(J){if(J.uniformsList===null){const oe=J.currentProgram.getUniforms();J.uniformsList=Ed.seqWithValue(oe.seq,J.uniforms)}return J.uniformsList}function ic(J,oe){const pe=de.get(J);pe.outputColorSpace=oe.outputColorSpace,pe.batching=oe.batching,pe.batchingColor=oe.batchingColor,pe.instancing=oe.instancing,pe.instancingColor=oe.instancingColor,pe.instancingMorph=oe.instancingMorph,pe.skinning=oe.skinning,pe.morphTargets=oe.morphTargets,pe.morphNormals=oe.morphNormals,pe.morphColors=oe.morphColors,pe.morphTargetsCount=oe.morphTargetsCount,pe.numClippingPlanes=oe.numClippingPlanes,pe.numIntersection=oe.numClipIntersection,pe.vertexAlphas=oe.vertexAlphas,pe.vertexTangents=oe.vertexTangents,pe.toneMapping=oe.toneMapping}function Ju(J,oe,pe,me,ce){oe.isScene!==!0&&(oe=L),q.resetTextureUnits();const Ce=oe.fog,ke=me.isMeshStandardMaterial?oe.environment:null,He=V===null?B.outputColorSpace:V.isXRRenderTarget===!0?V.texture.colorSpace:qt,De=(me.isMeshStandardMaterial?ae:j).get(me.envMap||ke),it=me.vertexColors===!0&&!!pe.attributes.color&&pe.attributes.color.itemSize===4,st=!!pe.attributes.tangent&&(!!me.normalMap||me.anisotropy>0),Je=!!pe.morphAttributes.position,St=!!pe.morphAttributes.normal,Pt=!!pe.morphAttributes.color;let di=Ss;me.toneMapped&&(V===null||V.isXRRenderTarget===!0)&&(di=B.toneMapping);const ri=pe.morphAttributes.position||pe.morphAttributes.normal||pe.morphAttributes.color,Tt=ri!==void 0?ri.length:0,Ze=de.get(me),Ni=x.state.lights;if(h===!0&&(f===!0||J!==z)){const en=J===z&&me.id===k;xe.setState(me,J,en)}let Lt=!1;me.version===Ze.__version?(Ze.needsLights&&Ze.lightsStateVersion!==Ni.state.version||Ze.outputColorSpace!==He||ce.isBatchedMesh&&Ze.batching===!1||!ce.isBatchedMesh&&Ze.batching===!0||ce.isBatchedMesh&&Ze.batchingColor===!0&&ce.colorTexture===null||ce.isBatchedMesh&&Ze.batchingColor===!1&&ce.colorTexture!==null||ce.isInstancedMesh&&Ze.instancing===!1||!ce.isInstancedMesh&&Ze.instancing===!0||ce.isSkinnedMesh&&Ze.skinning===!1||!ce.isSkinnedMesh&&Ze.skinning===!0||ce.isInstancedMesh&&Ze.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&Ze.instancingColor===!1&&ce.instanceColor!==null||ce.isInstancedMesh&&Ze.instancingMorph===!0&&ce.morphTexture===null||ce.isInstancedMesh&&Ze.instancingMorph===!1&&ce.morphTexture!==null||Ze.envMap!==De||me.fog===!0&&Ze.fog!==Ce||Ze.numClippingPlanes!==void 0&&(Ze.numClippingPlanes!==xe.numPlanes||Ze.numIntersection!==xe.numIntersection)||Ze.vertexAlphas!==it||Ze.vertexTangents!==st||Ze.morphTargets!==Je||Ze.morphNormals!==St||Ze.morphColors!==Pt||Ze.toneMapping!==di||Ze.morphTargetsCount!==Tt)&&(Lt=!0):(Lt=!0,Ze.__version=me.version);let Zn=Ze.currentProgram;Lt===!0&&(Zn=gn(me,oe,ce));let so=!1,wn=!1,nc=!1;const Jt=Zn.getUniforms(),On=Ze.uniforms;if(X.useProgram(Zn.program)&&(so=!0,wn=!0,nc=!0),me.id!==k&&(k=me.id,wn=!0),so||z!==J){X.buffers.depth.getReversed()?(g.copy(J.projectionMatrix),PM(g),LM(g),Jt.setValue(O,"projectionMatrix",g)):Jt.setValue(O,"projectionMatrix",J.projectionMatrix),Jt.setValue(O,"viewMatrix",J.matrixWorldInverse);const An=Jt.map.cameraPosition;An!==void 0&&An.setValue(O,S.setFromMatrixPosition(J.matrixWorld)),te.logarithmicDepthBuffer&&Jt.setValue(O,"logDepthBufFC",2/(Math.log(J.far+1)/Math.LN2)),(me.isMeshPhongMaterial||me.isMeshToonMaterial||me.isMeshLambertMaterial||me.isMeshBasicMaterial||me.isMeshStandardMaterial||me.isShaderMaterial)&&Jt.setValue(O,"isOrthographic",J.isOrthographicCamera===!0),z!==J&&(z=J,wn=!0,nc=!0)}if(ce.isSkinnedMesh){Jt.setOptional(O,ce,"bindMatrix"),Jt.setOptional(O,ce,"bindMatrixInverse");const en=ce.skeleton;en&&(en.boneTexture===null&&en.computeBoneTexture(),Jt.setValue(O,"boneTexture",en.boneTexture,q))}ce.isBatchedMesh&&(Jt.setOptional(O,ce,"batchingTexture"),Jt.setValue(O,"batchingTexture",ce._matricesTexture,q),Jt.setOptional(O,ce,"batchingIdTexture"),Jt.setValue(O,"batchingIdTexture",ce._indirectTexture,q),Jt.setOptional(O,ce,"batchingColorTexture"),ce._colorsTexture!==null&&Jt.setValue(O,"batchingColorTexture",ce._colorsTexture,q));const kn=pe.morphAttributes;if((kn.position!==void 0||kn.normal!==void 0||kn.color!==void 0)&&Ue.update(ce,pe,Zn),(wn||Ze.receiveShadow!==ce.receiveShadow)&&(Ze.receiveShadow=ce.receiveShadow,Jt.setValue(O,"receiveShadow",ce.receiveShadow)),me.isMeshGouraudMaterial&&me.envMap!==null&&(On.envMap.value=De,On.flipEnvMap.value=De.isCubeTexture&&De.isRenderTargetTexture===!1?-1:1),me.isMeshStandardMaterial&&me.envMap===null&&oe.environment!==null&&(On.envMapIntensity.value=oe.environmentIntensity),wn&&(Jt.setValue(O,"toneMappingExposure",B.toneMappingExposure),Ze.needsLights&&Zu(On,nc),Ce&&me.fog===!0&&Re.refreshFogUniforms(On,Ce),Re.refreshMaterialUniforms(On,me,I,ee,x.state.transmissionRenderTarget[J.id]),Ed.upload(O,tc(Ze),On,q)),me.isShaderMaterial&&me.uniformsNeedUpdate===!0&&(Ed.upload(O,tc(Ze),On,q),me.uniformsNeedUpdate=!1),me.isSpriteMaterial&&Jt.setValue(O,"center",ce.center),Jt.setValue(O,"modelViewMatrix",ce.modelViewMatrix),Jt.setValue(O,"normalMatrix",ce.normalMatrix),Jt.setValue(O,"modelMatrix",ce.matrixWorld),me.isShaderMaterial||me.isRawShaderMaterial){const en=me.uniformsGroups;for(let An=0,tp=en.length;An<tp;An++){const ta=en[An];ne.update(ta,Zn),ne.bind(ta,Zn)}}return Zn}function Zu(J,oe){J.ambientLightColor.needsUpdate=oe,J.lightProbe.needsUpdate=oe,J.directionalLights.needsUpdate=oe,J.directionalLightShadows.needsUpdate=oe,J.pointLights.needsUpdate=oe,J.pointLightShadows.needsUpdate=oe,J.spotLights.needsUpdate=oe,J.spotLightShadows.needsUpdate=oe,J.rectAreaLights.needsUpdate=oe,J.hemisphereLights.needsUpdate=oe}function ep(J){return J.isMeshLambertMaterial||J.isMeshToonMaterial||J.isMeshPhongMaterial||J.isMeshStandardMaterial||J.isShadowMaterial||J.isShaderMaterial&&J.lights===!0}this.getActiveCubeFace=function(){return G},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return V},this.setRenderTargetTextures=function(J,oe,pe){de.get(J.texture).__webglTexture=oe,de.get(J.depthTexture).__webglTexture=pe;const me=de.get(J);me.__hasExternalTextures=!0,me.__autoAllocateDepthBuffer=pe===void 0,me.__autoAllocateDepthBuffer||Y.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),me.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(J,oe){const pe=de.get(J);pe.__webglFramebuffer=oe,pe.__useDefaultFramebuffer=oe===void 0};const We=O.createFramebuffer();this.setRenderTarget=function(J,oe=0,pe=0){V=J,G=oe,U=pe;let me=!0,ce=null,Ce=!1,ke=!1;if(J){const De=de.get(J);if(De.__useDefaultFramebuffer!==void 0)X.bindFramebuffer(O.FRAMEBUFFER,null),me=!1;else if(De.__webglFramebuffer===void 0)q.setupRenderTarget(J);else if(De.__hasExternalTextures)q.rebindTextures(J,de.get(J.texture).__webglTexture,de.get(J.depthTexture).__webglTexture);else if(J.depthBuffer){const Je=J.depthTexture;if(De.__boundDepthTexture!==Je){if(Je!==null&&de.has(Je)&&(J.width!==Je.image.width||J.height!==Je.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");q.setupDepthRenderbuffer(J)}}const it=J.texture;(it.isData3DTexture||it.isDataArrayTexture||it.isCompressedArrayTexture)&&(ke=!0);const st=de.get(J).__webglFramebuffer;J.isWebGLCubeRenderTarget?(Array.isArray(st[oe])?ce=st[oe][pe]:ce=st[oe],Ce=!0):J.samples>0&&q.useMultisampledRTT(J)===!1?ce=de.get(J).__webglMultisampledFramebuffer:Array.isArray(st)?ce=st[pe]:ce=st,Q.copy(J.viewport),Z.copy(J.scissor),K=J.scissorTest}else Q.copy(N).multiplyScalar(I).floor(),Z.copy(n).multiplyScalar(I).floor(),K=r;if(pe!==0&&(ce=We),X.bindFramebuffer(O.FRAMEBUFFER,ce)&&me&&X.drawBuffers(J,ce),X.viewport(Q),X.scissor(Z),X.setScissorTest(K),Ce){const De=de.get(J.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+oe,De.__webglTexture,pe)}else if(ke){const De=de.get(J.texture),it=oe;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,De.__webglTexture,pe,it)}else if(J!==null&&pe!==0){const De=de.get(J.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,De.__webglTexture,pe)}k=-1},this.readRenderTargetPixels=function(J,oe,pe,me,ce,Ce,ke){if(!(J&&J.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let He=de.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&ke!==void 0&&(He=He[ke]),He){X.bindFramebuffer(O.FRAMEBUFFER,He);try{const De=J.texture,it=De.format,st=De.type;if(!te.textureFormatReadable(it)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!te.textureTypeReadable(st)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=J.width-me&&pe>=0&&pe<=J.height-ce&&O.readPixels(oe,pe,me,ce,Ke.convert(it),Ke.convert(st),Ce)}finally{const De=V!==null?de.get(V).__webglFramebuffer:null;X.bindFramebuffer(O.FRAMEBUFFER,De)}}},this.readRenderTargetPixelsAsync=async function(J,oe,pe,me,ce,Ce,ke){if(!(J&&J.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let He=de.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&ke!==void 0&&(He=He[ke]),He){const De=J.texture,it=De.format,st=De.type;if(!te.textureFormatReadable(it))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!te.textureTypeReadable(st))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(oe>=0&&oe<=J.width-me&&pe>=0&&pe<=J.height-ce){X.bindFramebuffer(O.FRAMEBUFFER,He);const Je=O.createBuffer();O.bindBuffer(O.PIXEL_PACK_BUFFER,Je),O.bufferData(O.PIXEL_PACK_BUFFER,Ce.byteLength,O.STREAM_READ),O.readPixels(oe,pe,me,ce,Ke.convert(it),Ke.convert(st),0);const St=V!==null?de.get(V).__webglFramebuffer:null;X.bindFramebuffer(O.FRAMEBUFFER,St);const Pt=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0);return O.flush(),await BM(O,Pt,4),O.bindBuffer(O.PIXEL_PACK_BUFFER,Je),O.getBufferSubData(O.PIXEL_PACK_BUFFER,0,Ce),O.deleteBuffer(Je),O.deleteSync(Pt),Ce}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(J,oe=null,pe=0){J.isTexture!==!0&&(Ho("WebGLRenderer: copyFramebufferToTexture function signature has changed."),oe=arguments[0]||null,J=arguments[1]);const me=Math.pow(2,-pe),ce=Math.floor(J.image.width*me),Ce=Math.floor(J.image.height*me),ke=oe!==null?oe.x:0,He=oe!==null?oe.y:0;q.setTexture2D(J,0),O.copyTexSubImage2D(O.TEXTURE_2D,pe,0,0,ke,He,ce,Ce),X.unbindTexture()};const le=O.createFramebuffer(),Be=O.createFramebuffer();this.copyTextureToTexture=function(J,oe,pe=null,me=null,ce=0,Ce=null){J.isTexture!==!0&&(Ho("WebGLRenderer: copyTextureToTexture function signature has changed."),me=arguments[0]||null,J=arguments[1],oe=arguments[2],Ce=arguments[3]||0,pe=null),Ce===null&&(ce!==0?(Ho("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Ce=ce,ce=0):Ce=0);let ke,He,De,it,st,Je,St,Pt,di;const ri=J.isCompressedTexture?J.mipmaps[Ce]:J.image;if(pe!==null)ke=pe.max.x-pe.min.x,He=pe.max.y-pe.min.y,De=pe.isBox3?pe.max.z-pe.min.z:1,it=pe.min.x,st=pe.min.y,Je=pe.isBox3?pe.min.z:0;else{const kn=Math.pow(2,-ce);ke=Math.floor(ri.width*kn),He=Math.floor(ri.height*kn),J.isDataArrayTexture?De=ri.depth:J.isData3DTexture?De=Math.floor(ri.depth*kn):De=1,it=0,st=0,Je=0}me!==null?(St=me.x,Pt=me.y,di=me.z):(St=0,Pt=0,di=0);const Tt=Ke.convert(oe.format),Ze=Ke.convert(oe.type);let Ni;oe.isData3DTexture?(q.setTexture3D(oe,0),Ni=O.TEXTURE_3D):oe.isDataArrayTexture||oe.isCompressedArrayTexture?(q.setTexture2DArray(oe,0),Ni=O.TEXTURE_2D_ARRAY):(q.setTexture2D(oe,0),Ni=O.TEXTURE_2D),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,oe.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,oe.unpackAlignment);const Lt=O.getParameter(O.UNPACK_ROW_LENGTH),Zn=O.getParameter(O.UNPACK_IMAGE_HEIGHT),so=O.getParameter(O.UNPACK_SKIP_PIXELS),wn=O.getParameter(O.UNPACK_SKIP_ROWS),nc=O.getParameter(O.UNPACK_SKIP_IMAGES);O.pixelStorei(O.UNPACK_ROW_LENGTH,ri.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,ri.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,it),O.pixelStorei(O.UNPACK_SKIP_ROWS,st),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Je);const Jt=J.isDataArrayTexture||J.isData3DTexture,On=oe.isDataArrayTexture||oe.isData3DTexture;if(J.isDepthTexture){const kn=de.get(J),en=de.get(oe),An=de.get(kn.__renderTarget),tp=de.get(en.__renderTarget);X.bindFramebuffer(O.READ_FRAMEBUFFER,An.__webglFramebuffer),X.bindFramebuffer(O.DRAW_FRAMEBUFFER,tp.__webglFramebuffer);for(let ta=0;ta<De;ta++)Jt&&(O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,de.get(J).__webglTexture,ce,Je+ta),O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,de.get(oe).__webglTexture,Ce,di+ta)),O.blitFramebuffer(it,st,ke,He,St,Pt,ke,He,O.DEPTH_BUFFER_BIT,O.NEAREST);X.bindFramebuffer(O.READ_FRAMEBUFFER,null),X.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else if(ce!==0||J.isRenderTargetTexture||de.has(J)){const kn=de.get(J),en=de.get(oe);X.bindFramebuffer(O.READ_FRAMEBUFFER,le),X.bindFramebuffer(O.DRAW_FRAMEBUFFER,Be);for(let An=0;An<De;An++)Jt?O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,kn.__webglTexture,ce,Je+An):O.framebufferTexture2D(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,kn.__webglTexture,ce),On?O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,en.__webglTexture,Ce,di+An):O.framebufferTexture2D(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,en.__webglTexture,Ce),ce!==0?O.blitFramebuffer(it,st,ke,He,St,Pt,ke,He,O.COLOR_BUFFER_BIT,O.NEAREST):On?O.copyTexSubImage3D(Ni,Ce,St,Pt,di+An,it,st,ke,He):O.copyTexSubImage2D(Ni,Ce,St,Pt,it,st,ke,He);X.bindFramebuffer(O.READ_FRAMEBUFFER,null),X.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else On?J.isDataTexture||J.isData3DTexture?O.texSubImage3D(Ni,Ce,St,Pt,di,ke,He,De,Tt,Ze,ri.data):oe.isCompressedArrayTexture?O.compressedTexSubImage3D(Ni,Ce,St,Pt,di,ke,He,De,Tt,ri.data):O.texSubImage3D(Ni,Ce,St,Pt,di,ke,He,De,Tt,Ze,ri):J.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,Ce,St,Pt,ke,He,Tt,Ze,ri.data):J.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,Ce,St,Pt,ri.width,ri.height,Tt,ri.data):O.texSubImage2D(O.TEXTURE_2D,Ce,St,Pt,ke,He,Tt,Ze,ri);O.pixelStorei(O.UNPACK_ROW_LENGTH,Lt),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,Zn),O.pixelStorei(O.UNPACK_SKIP_PIXELS,so),O.pixelStorei(O.UNPACK_SKIP_ROWS,wn),O.pixelStorei(O.UNPACK_SKIP_IMAGES,nc),Ce===0&&oe.generateMipmaps&&O.generateMipmap(Ni),X.unbindTexture()},this.copyTextureToTexture3D=function(J,oe,pe=null,me=null,ce=0){return J.isTexture!==!0&&(Ho("WebGLRenderer: copyTextureToTexture3D function signature has changed."),pe=arguments[0]||null,me=arguments[1]||null,J=arguments[2],oe=arguments[3],ce=arguments[4]||0),Ho('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(J,oe,pe,me,ce)},this.initRenderTarget=function(J){de.get(J).__webglFramebuffer===void 0&&q.setupRenderTarget(J)},this.initTexture=function(J){J.isCubeTexture?q.setTextureCube(J,0):J.isData3DTexture?q.setTexture3D(J,0):J.isDataArrayTexture||J.isCompressedArrayTexture?q.setTexture2DArray(J,0):q.setTexture2D(J,0),X.unbindTexture()},this.resetState=function(){G=0,U=0,V=null,X.reset(),pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return sr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorspace=vt._getDrawingBufferColorSpace(e),t.unpackColorSpace=vt._getUnpackColorSpace()}}class Y0{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const BD=new Kr(-1,1,1,-1,0,1);class PD extends Di{constructor(){super(),this.setAttribute("position",new $i([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new $i([0,2,0,0,2,0],2))}}const LD=new PD;class DD{constructor(e){this._mesh=new lt(LD,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,BD)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}/*!
|
|
3900
|
+
}`;class CD{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const a=new Kt,l=e.properties.get(a);l.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=a}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new zi({vertexShader:xD,fragmentShader:SD,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new lt(new Ms(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class TD extends fs{constructor(e,t){super();const i=this;let a=null,l=1,u=null,d="local-floor",p=1,m=null,A=null,_=null,b=null,w=null,E=null;const C=new CD,T=t.getContextAttributes();let x=null,P=null;const M=[],B=[],D=new Ve;let G=null;const U=new _i;U.viewport=new Rt;const V=new _i;V.viewport=new Rt;const k=[U,V],z=new DR;let Q=null,Z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(c){let h=M[c];return h===void 0&&(h=new $p,M[c]=h),h.getTargetRaySpace()},this.getControllerGrip=function(c){let h=M[c];return h===void 0&&(h=new $p,M[c]=h),h.getGripSpace()},this.getHand=function(c){let h=M[c];return h===void 0&&(h=new $p,M[c]=h),h.getHandSpace()};function K(c){const h=B.indexOf(c.inputSource);if(h===-1)return;const f=M[h];f!==void 0&&(f.update(c.inputSource,c.frame,m||u),f.dispatchEvent({type:c.type,data:c.inputSource}))}function s(){a.removeEventListener("select",K),a.removeEventListener("selectstart",K),a.removeEventListener("selectend",K),a.removeEventListener("squeeze",K),a.removeEventListener("squeezestart",K),a.removeEventListener("squeezeend",K),a.removeEventListener("end",s),a.removeEventListener("inputsourceschange",H);for(let c=0;c<M.length;c++){const h=B[c];h!==null&&(B[c]=null,M[c].disconnect(h))}Q=null,Z=null,C.reset(),e.setRenderTarget(x),w=null,b=null,_=null,a=null,P=null,r.stop(),i.isPresenting=!1,e.setPixelRatio(G),e.setSize(D.width,D.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(c){l=c,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(c){d=c,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||u},this.setReferenceSpace=function(c){m=c},this.getBaseLayer=function(){return b!==null?b:w},this.getBinding=function(){return _},this.getFrame=function(){return E},this.getSession=function(){return a},this.setSession=async function(c){if(a=c,a!==null){if(x=e.getRenderTarget(),a.addEventListener("select",K),a.addEventListener("selectstart",K),a.addEventListener("selectend",K),a.addEventListener("squeeze",K),a.addEventListener("squeezestart",K),a.addEventListener("squeezeend",K),a.addEventListener("end",s),a.addEventListener("inputsourceschange",H),T.xrCompatible!==!0&&await t.makeXRCompatible(),G=e.getPixelRatio(),e.getSize(D),a.enabledFeatures!==void 0&&a.enabledFeatures.includes("layers")){let f=null,g=null,v=null;T.depth&&(v=T.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,f=T.stencil?yl:rl,g=T.stencil?_l:qr);const S={colorFormat:t.RGBA8,depthFormat:v,scaleFactor:l};_=new XRWebGLBinding(a,t),b=_.createProjectionLayer(S),a.updateRenderState({layers:[b]}),e.setPixelRatio(1),e.setSize(b.textureWidth,b.textureHeight,!1),P=new dn(b.textureWidth,b.textureHeight,{format:Xt,type:ui,depthTexture:new LS(b.textureWidth,b.textureHeight,g,void 0,void 0,void 0,void 0,void 0,void 0,f),stencilBuffer:T.stencil,colorSpace:e.outputColorSpace,samples:T.antialias?4:0,resolveDepthBuffer:b.ignoreDepthValues===!1})}else{const f={antialias:T.antialias,alpha:!0,depth:T.depth,stencil:T.stencil,framebufferScaleFactor:l};w=new XRWebGLLayer(a,t,f),a.updateRenderState({baseLayer:w}),e.setPixelRatio(1),e.setSize(w.framebufferWidth,w.framebufferHeight,!1),P=new dn(w.framebufferWidth,w.framebufferHeight,{format:Xt,type:ui,colorSpace:e.outputColorSpace,stencilBuffer:T.stencil})}P.isXRRenderTarget=!0,this.setFoveation(p),m=null,u=await a.requestReferenceSpace(d),r.setContext(a),r.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(a!==null)return a.environmentBlendMode},this.getDepthTexture=function(){return C.getDepthTexture()};function H(c){for(let h=0;h<c.removed.length;h++){const f=c.removed[h],g=B.indexOf(f);g>=0&&(B[g]=null,M[g].disconnect(f))}for(let h=0;h<c.added.length;h++){const f=c.added[h];let g=B.indexOf(f);if(g===-1){for(let S=0;S<M.length;S++)if(S>=B.length){B.push(f),g=S;break}else if(B[S]===null){B[S]=f,g=S;break}if(g===-1)break}const v=M[g];v&&v.connect(f)}}const y=new se,ee=new se;function I(c,h,f){y.setFromMatrixPosition(h.matrixWorld),ee.setFromMatrixPosition(f.matrixWorld);const g=y.distanceTo(ee),v=h.projectionMatrix.elements,S=f.projectionMatrix.elements,R=v[14]/(v[10]-1),L=v[14]/(v[10]+1),F=(v[9]+1)/v[5],$=(v[9]-1)/v[5],O=(v[8]-1)/v[0],W=(S[8]+1)/S[0],Y=R*O,te=R*W,X=g/(-O+W),ie=X*-O;if(h.matrixWorld.decompose(c.position,c.quaternion,c.scale),c.translateX(ie),c.translateZ(X),c.matrixWorld.compose(c.position,c.quaternion,c.scale),c.matrixWorldInverse.copy(c.matrixWorld).invert(),v[10]===-1)c.projectionMatrix.copy(h.projectionMatrix),c.projectionMatrixInverse.copy(h.projectionMatrixInverse);else{const de=R+X,q=L+X,j=Y-ie,ae=te+(g-ie),ge=F*L/q*de,fe=$*L/q*de;c.projectionMatrix.makePerspective(j,ae,ge,fe,de,q),c.projectionMatrixInverse.copy(c.projectionMatrix).invert()}}function re(c,h){h===null?c.matrixWorld.copy(c.matrix):c.matrixWorld.multiplyMatrices(h.matrixWorld,c.matrix),c.matrixWorldInverse.copy(c.matrixWorld).invert()}this.updateCamera=function(c){if(a===null)return;let h=c.near,f=c.far;C.texture!==null&&(C.depthNear>0&&(h=C.depthNear),C.depthFar>0&&(f=C.depthFar)),z.near=V.near=U.near=h,z.far=V.far=U.far=f,(Q!==z.near||Z!==z.far)&&(a.updateRenderState({depthNear:z.near,depthFar:z.far}),Q=z.near,Z=z.far),U.layers.mask=c.layers.mask|2,V.layers.mask=c.layers.mask|4,z.layers.mask=U.layers.mask|V.layers.mask;const g=c.parent,v=z.cameras;re(z,g);for(let S=0;S<v.length;S++)re(v[S],g);v.length===2?I(z,U,V):z.projectionMatrix.copy(U.projectionMatrix),Ae(c,z,g)};function Ae(c,h,f){f===null?c.matrix.copy(h.matrixWorld):(c.matrix.copy(f.matrixWorld),c.matrix.invert(),c.matrix.multiply(h.matrixWorld)),c.matrix.decompose(c.position,c.quaternion,c.scale),c.updateMatrixWorld(!0),c.projectionMatrix.copy(h.projectionMatrix),c.projectionMatrixInverse.copy(h.projectionMatrixInverse),c.isPerspectiveCamera&&(c.fov=El*2*Math.atan(1/c.projectionMatrix.elements[5]),c.zoom=1)}this.getCamera=function(){return z},this.getFoveation=function(){if(!(b===null&&w===null))return p},this.setFoveation=function(c){p=c,b!==null&&(b.fixedFoveation=c),w!==null&&w.fixedFoveation!==void 0&&(w.fixedFoveation=c)},this.hasDepthSensing=function(){return C.texture!==null},this.getDepthSensingMesh=function(){return C.getMesh(z)};let N=null;function n(c,h){if(A=h.getViewerPose(m||u),E=h,A!==null){const f=A.views;w!==null&&(e.setRenderTargetFramebuffer(P,w.framebuffer),e.setRenderTarget(P));let g=!1;f.length!==z.cameras.length&&(z.cameras.length=0,g=!0);for(let S=0;S<f.length;S++){const R=f[S];let L=null;if(w!==null)L=w.getViewport(R);else{const $=_.getViewSubImage(b,R);L=$.viewport,S===0&&(e.setRenderTargetTextures(P,$.colorTexture,b.ignoreDepthValues?void 0:$.depthStencilTexture),e.setRenderTarget(P))}let F=k[S];F===void 0&&(F=new _i,F.layers.enable(S),F.viewport=new Rt,k[S]=F),F.matrix.fromArray(R.transform.matrix),F.matrix.decompose(F.position,F.quaternion,F.scale),F.projectionMatrix.fromArray(R.projectionMatrix),F.projectionMatrixInverse.copy(F.projectionMatrix).invert(),F.viewport.set(L.x,L.y,L.width,L.height),S===0&&(z.matrix.copy(F.matrix),z.matrix.decompose(z.position,z.quaternion,z.scale)),g===!0&&z.cameras.push(F)}const v=a.enabledFeatures;if(v&&v.includes("depth-sensing")){const S=_.getDepthInformation(f[0]);S&&S.isValid&&S.texture&&C.init(e,S,a.renderState)}}for(let f=0;f<M.length;f++){const g=B[f],v=M[f];g!==null&&v!==void 0&&v.update(g,h,m||u)}N&&N(c,h),h.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:h}),E=null}const r=new GS;r.setAnimationLoop(n),this.setAnimationLoop=function(c){N=c},this.dispose=function(){}}}const ca=new qn,ID=new tt;function MD(o,e){function t(T,x){T.matrixAutoUpdate===!0&&T.updateMatrix(),x.value.copy(T.matrix)}function i(T,x){x.color.getRGB(T.fogColor.value,TS(o)),x.isFog?(T.fogNear.value=x.near,T.fogFar.value=x.far):x.isFogExp2&&(T.fogDensity.value=x.density)}function a(T,x,P,M,B){x.isMeshBasicMaterial||x.isMeshLambertMaterial?l(T,x):x.isMeshToonMaterial?(l(T,x),_(T,x)):x.isMeshPhongMaterial?(l(T,x),A(T,x)):x.isMeshStandardMaterial?(l(T,x),b(T,x),x.isMeshPhysicalMaterial&&w(T,x,B)):x.isMeshMatcapMaterial?(l(T,x),E(T,x)):x.isMeshDepthMaterial?l(T,x):x.isMeshDistanceMaterial?(l(T,x),C(T,x)):x.isMeshNormalMaterial?l(T,x):x.isLineBasicMaterial?(u(T,x),x.isLineDashedMaterial&&d(T,x)):x.isPointsMaterial?p(T,x,P,M):x.isSpriteMaterial?m(T,x):x.isShadowMaterial?(T.color.value.copy(x.color),T.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function l(T,x){T.opacity.value=x.opacity,x.color&&T.diffuse.value.copy(x.color),x.emissive&&T.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(T.map.value=x.map,t(x.map,T.mapTransform)),x.alphaMap&&(T.alphaMap.value=x.alphaMap,t(x.alphaMap,T.alphaMapTransform)),x.bumpMap&&(T.bumpMap.value=x.bumpMap,t(x.bumpMap,T.bumpMapTransform),T.bumpScale.value=x.bumpScale,x.side===Fi&&(T.bumpScale.value*=-1)),x.normalMap&&(T.normalMap.value=x.normalMap,t(x.normalMap,T.normalMapTransform),T.normalScale.value.copy(x.normalScale),x.side===Fi&&T.normalScale.value.negate()),x.displacementMap&&(T.displacementMap.value=x.displacementMap,t(x.displacementMap,T.displacementMapTransform),T.displacementScale.value=x.displacementScale,T.displacementBias.value=x.displacementBias),x.emissiveMap&&(T.emissiveMap.value=x.emissiveMap,t(x.emissiveMap,T.emissiveMapTransform)),x.specularMap&&(T.specularMap.value=x.specularMap,t(x.specularMap,T.specularMapTransform)),x.alphaTest>0&&(T.alphaTest.value=x.alphaTest);const P=e.get(x),M=P.envMap,B=P.envMapRotation;M&&(T.envMap.value=M,ca.copy(B),ca.x*=-1,ca.y*=-1,ca.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(ca.y*=-1,ca.z*=-1),T.envMapRotation.value.setFromMatrix4(ID.makeRotationFromEuler(ca)),T.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,T.reflectivity.value=x.reflectivity,T.ior.value=x.ior,T.refractionRatio.value=x.refractionRatio),x.lightMap&&(T.lightMap.value=x.lightMap,T.lightMapIntensity.value=x.lightMapIntensity,t(x.lightMap,T.lightMapTransform)),x.aoMap&&(T.aoMap.value=x.aoMap,T.aoMapIntensity.value=x.aoMapIntensity,t(x.aoMap,T.aoMapTransform))}function u(T,x){T.diffuse.value.copy(x.color),T.opacity.value=x.opacity,x.map&&(T.map.value=x.map,t(x.map,T.mapTransform))}function d(T,x){T.dashSize.value=x.dashSize,T.totalSize.value=x.dashSize+x.gapSize,T.scale.value=x.scale}function p(T,x,P,M){T.diffuse.value.copy(x.color),T.opacity.value=x.opacity,T.size.value=x.size*P,T.scale.value=M*.5,x.map&&(T.map.value=x.map,t(x.map,T.uvTransform)),x.alphaMap&&(T.alphaMap.value=x.alphaMap,t(x.alphaMap,T.alphaMapTransform)),x.alphaTest>0&&(T.alphaTest.value=x.alphaTest)}function m(T,x){T.diffuse.value.copy(x.color),T.opacity.value=x.opacity,T.rotation.value=x.rotation,x.map&&(T.map.value=x.map,t(x.map,T.mapTransform)),x.alphaMap&&(T.alphaMap.value=x.alphaMap,t(x.alphaMap,T.alphaMapTransform)),x.alphaTest>0&&(T.alphaTest.value=x.alphaTest)}function A(T,x){T.specular.value.copy(x.specular),T.shininess.value=Math.max(x.shininess,1e-4)}function _(T,x){x.gradientMap&&(T.gradientMap.value=x.gradientMap)}function b(T,x){T.metalness.value=x.metalness,x.metalnessMap&&(T.metalnessMap.value=x.metalnessMap,t(x.metalnessMap,T.metalnessMapTransform)),T.roughness.value=x.roughness,x.roughnessMap&&(T.roughnessMap.value=x.roughnessMap,t(x.roughnessMap,T.roughnessMapTransform)),x.envMap&&(T.envMapIntensity.value=x.envMapIntensity)}function w(T,x,P){T.ior.value=x.ior,x.sheen>0&&(T.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),T.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(T.sheenColorMap.value=x.sheenColorMap,t(x.sheenColorMap,T.sheenColorMapTransform)),x.sheenRoughnessMap&&(T.sheenRoughnessMap.value=x.sheenRoughnessMap,t(x.sheenRoughnessMap,T.sheenRoughnessMapTransform))),x.clearcoat>0&&(T.clearcoat.value=x.clearcoat,T.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(T.clearcoatMap.value=x.clearcoatMap,t(x.clearcoatMap,T.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(T.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,t(x.clearcoatRoughnessMap,T.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(T.clearcoatNormalMap.value=x.clearcoatNormalMap,t(x.clearcoatNormalMap,T.clearcoatNormalMapTransform),T.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Fi&&T.clearcoatNormalScale.value.negate())),x.dispersion>0&&(T.dispersion.value=x.dispersion),x.iridescence>0&&(T.iridescence.value=x.iridescence,T.iridescenceIOR.value=x.iridescenceIOR,T.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],T.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(T.iridescenceMap.value=x.iridescenceMap,t(x.iridescenceMap,T.iridescenceMapTransform)),x.iridescenceThicknessMap&&(T.iridescenceThicknessMap.value=x.iridescenceThicknessMap,t(x.iridescenceThicknessMap,T.iridescenceThicknessMapTransform))),x.transmission>0&&(T.transmission.value=x.transmission,T.transmissionSamplerMap.value=P.texture,T.transmissionSamplerSize.value.set(P.width,P.height),x.transmissionMap&&(T.transmissionMap.value=x.transmissionMap,t(x.transmissionMap,T.transmissionMapTransform)),T.thickness.value=x.thickness,x.thicknessMap&&(T.thicknessMap.value=x.thicknessMap,t(x.thicknessMap,T.thicknessMapTransform)),T.attenuationDistance.value=x.attenuationDistance,T.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(T.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(T.anisotropyMap.value=x.anisotropyMap,t(x.anisotropyMap,T.anisotropyMapTransform))),T.specularIntensity.value=x.specularIntensity,T.specularColor.value.copy(x.specularColor),x.specularColorMap&&(T.specularColorMap.value=x.specularColorMap,t(x.specularColorMap,T.specularColorMapTransform)),x.specularIntensityMap&&(T.specularIntensityMap.value=x.specularIntensityMap,t(x.specularIntensityMap,T.specularIntensityMapTransform))}function E(T,x){x.matcap&&(T.matcap.value=x.matcap)}function C(T,x){const P=e.get(x).light;T.referencePosition.value.setFromMatrixPosition(P.matrixWorld),T.nearDistance.value=P.shadow.camera.near,T.farDistance.value=P.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:a}}function RD(o,e,t,i){let a={},l={},u=[];const d=o.getParameter(o.MAX_UNIFORM_BUFFER_BINDINGS);function p(P,M){const B=M.program;i.uniformBlockBinding(P,B)}function m(P,M){let B=a[P.id];B===void 0&&(E(P),B=A(P),a[P.id]=B,P.addEventListener("dispose",T));const D=M.program;i.updateUBOMapping(P,D);const G=e.render.frame;l[P.id]!==G&&(b(P),l[P.id]=G)}function A(P){const M=_();P.__bindingPointIndex=M;const B=o.createBuffer(),D=P.__size,G=P.usage;return o.bindBuffer(o.UNIFORM_BUFFER,B),o.bufferData(o.UNIFORM_BUFFER,D,G),o.bindBuffer(o.UNIFORM_BUFFER,null),o.bindBufferBase(o.UNIFORM_BUFFER,M,B),B}function _(){for(let P=0;P<d;P++)if(u.indexOf(P)===-1)return u.push(P),P;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function b(P){const M=a[P.id],B=P.uniforms,D=P.__cache;o.bindBuffer(o.UNIFORM_BUFFER,M);for(let G=0,U=B.length;G<U;G++){const V=Array.isArray(B[G])?B[G]:[B[G]];for(let k=0,z=V.length;k<z;k++){const Q=V[k];if(w(Q,G,k,D)===!0){const Z=Q.__offset,K=Array.isArray(Q.value)?Q.value:[Q.value];let s=0;for(let H=0;H<K.length;H++){const y=K[H],ee=C(y);typeof y=="number"||typeof y=="boolean"?(Q.__data[0]=y,o.bufferSubData(o.UNIFORM_BUFFER,Z+s,Q.__data)):y.isMatrix3?(Q.__data[0]=y.elements[0],Q.__data[1]=y.elements[1],Q.__data[2]=y.elements[2],Q.__data[3]=0,Q.__data[4]=y.elements[3],Q.__data[5]=y.elements[4],Q.__data[6]=y.elements[5],Q.__data[7]=0,Q.__data[8]=y.elements[6],Q.__data[9]=y.elements[7],Q.__data[10]=y.elements[8],Q.__data[11]=0):(y.toArray(Q.__data,s),s+=ee.storage/Float32Array.BYTES_PER_ELEMENT)}o.bufferSubData(o.UNIFORM_BUFFER,Z,Q.__data)}}}o.bindBuffer(o.UNIFORM_BUFFER,null)}function w(P,M,B,D){const G=P.value,U=M+"_"+B;if(D[U]===void 0)return typeof G=="number"||typeof G=="boolean"?D[U]=G:D[U]=G.clone(),!0;{const V=D[U];if(typeof G=="number"||typeof G=="boolean"){if(V!==G)return D[U]=G,!0}else if(V.equals(G)===!1)return V.copy(G),!0}return!1}function E(P){const M=P.uniforms;let B=0;const D=16;for(let U=0,V=M.length;U<V;U++){const k=Array.isArray(M[U])?M[U]:[M[U]];for(let z=0,Q=k.length;z<Q;z++){const Z=k[z],K=Array.isArray(Z.value)?Z.value:[Z.value];for(let s=0,H=K.length;s<H;s++){const y=K[s],ee=C(y),I=B%D,re=I%ee.boundary,Ae=I+re;B+=re,Ae!==0&&D-Ae<ee.storage&&(B+=D-Ae),Z.__data=new Float32Array(ee.storage/Float32Array.BYTES_PER_ELEMENT),Z.__offset=B,B+=ee.storage}}}const G=B%D;return G>0&&(B+=D-G),P.__size=B,P.__cache={},this}function C(P){const M={boundary:0,storage:0};return typeof P=="number"||typeof P=="boolean"?(M.boundary=4,M.storage=4):P.isVector2?(M.boundary=8,M.storage=8):P.isVector3||P.isColor?(M.boundary=16,M.storage=12):P.isVector4?(M.boundary=16,M.storage=16):P.isMatrix3?(M.boundary=48,M.storage=48):P.isMatrix4?(M.boundary=64,M.storage=64):P.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",P),M}function T(P){const M=P.target;M.removeEventListener("dispose",T);const B=u.indexOf(M.__bindingPointIndex);u.splice(B,1),o.deleteBuffer(a[M.id]),delete a[M.id],delete l[M.id]}function x(){for(const P in a)o.deleteBuffer(a[P]);u=[],a={},l={}}return{bind:p,update:m,dispose:x}}class tf{constructor(e={}){const{canvas:t=RM(),context:i=null,depth:a=!0,stencil:l=!1,alpha:u=!1,antialias:d=!1,premultipliedAlpha:p=!0,preserveDrawingBuffer:m=!1,powerPreference:A="default",failIfMajorPerformanceCaveat:_=!1,reverseDepthBuffer:b=!1}=e;this.isWebGLRenderer=!0;let w;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");w=i.getContextAttributes().alpha}else w=u;const E=new Uint32Array(4),C=new Int32Array(4);let T=null,x=null;const P=[],M=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ht,this.toneMapping=Ss,this.toneMappingExposure=1;const B=this;let D=!1,G=0,U=0,V=null,k=-1,z=null;const Q=new Rt,Z=new Rt;let K=null;const s=new Ye(0);let H=0,y=t.width,ee=t.height,I=1,re=null,Ae=null;const N=new Rt(0,0,y,ee),n=new Rt(0,0,y,ee);let r=!1;const c=new $0;let h=!1,f=!1;this.transmissionResolutionScale=1;const g=new tt,v=new tt,S=new se,R=new Rt,L={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let F=!1;function $(){return V===null?I:1}let O=i;function W(J,oe){return t.getContext(J,oe)}try{const J={alpha:!0,depth:a,stencil:l,antialias:d,premultipliedAlpha:p,preserveDrawingBuffer:m,powerPreference:A,failIfMajorPerformanceCaveat:_};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Bf}`),t.addEventListener("webglcontextlost",we,!1),t.addEventListener("webglcontextrestored",ze,!1),t.addEventListener("webglcontextcreationerror",$e,!1),O===null){const oe="webgl2";if(O=W(oe,J),O===null)throw W(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(J){throw console.error("THREE.WebGLRenderer: "+J.message),J}let Y,te,X,ie,de,q,j,ae,ge,fe,ue,ve,Re,Le,Xe,xe,Pe,Ie,Ue,Ne,et,Ke,pt,ne;function Oe(){Y=new $P(O),Y.init(),Ke=new wD(O,Y),te=new DP(O,Y,e,Ke),X=new bD(O,Y),te.reverseDepthBuffer&&b&&X.buffers.depth.setReversed(!0),ie=new HP(O),de=new oD,q=new vD(O,Y,X,de,te,Ke,ie),j=new OP(B),ae=new FP(B),ge=new XR(O),pt=new PP(O,ge),fe=new zP(O,ge,ie,pt),ue=new QP(O,fe,ge,ie),Ue=new VP(O,te,q),xe=new NP(de),ve=new aD(B,j,ae,Y,te,pt,xe),Re=new MD(B,de),Le=new cD,Xe=new mD(Y),Ie=new BP(B,j,ae,X,ue,w,p),Pe=new _D(B,ue,te),ne=new RD(O,ie,te,X),Ne=new LP(O,Y,ie),et=new GP(O,Y,ie),ie.programs=ve.programs,B.capabilities=te,B.extensions=Y,B.properties=de,B.renderLists=Le,B.shadowMap=Pe,B.state=X,B.info=ie}Oe();const ye=new TD(B,O);this.xr=ye,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){const J=Y.get("WEBGL_lose_context");J&&J.loseContext()},this.forceContextRestore=function(){const J=Y.get("WEBGL_lose_context");J&&J.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(J){J!==void 0&&(I=J,this.setSize(y,ee,!1))},this.getSize=function(J){return J.set(y,ee)},this.setSize=function(J,oe,pe=!0){if(ye.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}y=J,ee=oe,t.width=Math.floor(J*I),t.height=Math.floor(oe*I),pe===!0&&(t.style.width=J+"px",t.style.height=oe+"px"),this.setViewport(0,0,J,oe)},this.getDrawingBufferSize=function(J){return J.set(y*I,ee*I).floor()},this.setDrawingBufferSize=function(J,oe,pe){y=J,ee=oe,I=pe,t.width=Math.floor(J*pe),t.height=Math.floor(oe*pe),this.setViewport(0,0,J,oe)},this.getCurrentViewport=function(J){return J.copy(Q)},this.getViewport=function(J){return J.copy(N)},this.setViewport=function(J,oe,pe,me){J.isVector4?N.set(J.x,J.y,J.z,J.w):N.set(J,oe,pe,me),X.viewport(Q.copy(N).multiplyScalar(I).round())},this.getScissor=function(J){return J.copy(n)},this.setScissor=function(J,oe,pe,me){J.isVector4?n.set(J.x,J.y,J.z,J.w):n.set(J,oe,pe,me),X.scissor(Z.copy(n).multiplyScalar(I).round())},this.getScissorTest=function(){return r},this.setScissorTest=function(J){X.setScissorTest(r=J)},this.setOpaqueSort=function(J){re=J},this.setTransparentSort=function(J){Ae=J},this.getClearColor=function(J){return J.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor.apply(Ie,arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha.apply(Ie,arguments)},this.clear=function(J=!0,oe=!0,pe=!0){let me=0;if(J){let ce=!1;if(V!==null){const Ce=V.texture.format;ce=Ce===P0||Ce===B0||Ce===R0}if(ce){const Ce=V.texture.type,ke=Ce===ui||Ce===qr||Ce===vu||Ce===_l||Ce===I0||Ce===M0,He=Ie.getClearColor(),De=Ie.getClearAlpha(),it=He.r,st=He.g,Je=He.b;ke?(E[0]=it,E[1]=st,E[2]=Je,E[3]=De,O.clearBufferuiv(O.COLOR,0,E)):(C[0]=it,C[1]=st,C[2]=Je,C[3]=De,O.clearBufferiv(O.COLOR,0,C))}else me|=O.COLOR_BUFFER_BIT}oe&&(me|=O.DEPTH_BUFFER_BIT),pe&&(me|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(me)},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",we,!1),t.removeEventListener("webglcontextrestored",ze,!1),t.removeEventListener("webglcontextcreationerror",$e,!1),Ie.dispose(),Le.dispose(),Xe.dispose(),de.dispose(),j.dispose(),ae.dispose(),ue.dispose(),pt.dispose(),ne.dispose(),ve.dispose(),ye.dispose(),ye.removeEventListener("sessionstart",Kl),ye.removeEventListener("sessionend",Ku),Ei.stop()};function we(J){J.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),D=!0}function ze(){console.log("THREE.WebGLRenderer: Context Restored."),D=!1;const J=ie.autoReset,oe=Pe.enabled,pe=Pe.autoUpdate,me=Pe.needsUpdate,ce=Pe.type;Oe(),ie.autoReset=J,Pe.enabled=oe,Pe.autoUpdate=pe,Pe.needsUpdate=me,Pe.type=ce}function $e(J){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",J.statusMessage)}function qe(J){const oe=J.target;oe.removeEventListener("dispose",qe),Ot(oe)}function Ot(J){wi(J),de.remove(J)}function wi(J){const oe=de.get(J).programs;oe!==void 0&&(oe.forEach(function(pe){ve.releaseProgram(pe)}),J.isShaderMaterial&&ve.releaseShaderCache(J))}this.renderBufferDirect=function(J,oe,pe,me,ce,Ce){oe===null&&(oe=L);const ke=ce.isMesh&&ce.matrixWorld.determinant()<0,He=Ju(J,oe,pe,me,ce);X.setMaterial(me,ke);let De=pe.index,it=1;if(me.wireframe===!0){if(De=fe.getWireframeAttribute(pe),De===void 0)return;it=2}const st=pe.drawRange,Je=pe.attributes.position;let St=st.start*it,Pt=(st.start+st.count)*it;Ce!==null&&(St=Math.max(St,Ce.start*it),Pt=Math.min(Pt,(Ce.start+Ce.count)*it)),De!==null?(St=Math.max(St,0),Pt=Math.min(Pt,De.count)):Je!=null&&(St=Math.max(St,0),Pt=Math.min(Pt,Je.count));const di=Pt-St;if(di<0||di===1/0)return;pt.setup(ce,me,He,pe,De);let ri,Tt=Ne;if(De!==null&&(ri=ge.get(De),Tt=et,Tt.setIndex(ri)),ce.isMesh)me.wireframe===!0?(X.setLineWidth(me.wireframeLinewidth*$()),Tt.setMode(O.LINES)):Tt.setMode(O.TRIANGLES);else if(ce.isLine){let Ze=me.linewidth;Ze===void 0&&(Ze=1),X.setLineWidth(Ze*$()),ce.isLineSegments?Tt.setMode(O.LINES):ce.isLineLoop?Tt.setMode(O.LINE_LOOP):Tt.setMode(O.LINE_STRIP)}else ce.isPoints?Tt.setMode(O.POINTS):ce.isSprite&&Tt.setMode(O.TRIANGLES);if(ce.isBatchedMesh)if(ce._multiDrawInstances!==null)Tt.renderMultiDrawInstances(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount,ce._multiDrawInstances);else if(Y.get("WEBGL_multi_draw"))Tt.renderMultiDraw(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount);else{const Ze=ce._multiDrawStarts,Ni=ce._multiDrawCounts,Lt=ce._multiDrawCount,Zn=De?ge.get(De).bytesPerElement:1,so=de.get(me).currentProgram.getUniforms();for(let wn=0;wn<Lt;wn++)so.setValue(O,"_gl_DrawID",wn),Tt.render(Ze[wn]/Zn,Ni[wn])}else if(ce.isInstancedMesh)Tt.renderInstances(St,di,ce.count);else if(pe.isInstancedBufferGeometry){const Ze=pe._maxInstanceCount!==void 0?pe._maxInstanceCount:1/0,Ni=Math.min(pe.instanceCount,Ze);Tt.renderInstances(St,di,Ni)}else Tt.render(St,di)};function Ct(J,oe,pe){J.transparent===!0&&J.side===Ri&&J.forceSinglePass===!1?(J.side=Fi,J.needsUpdate=!0,gn(J,oe,pe),J.side=hs,J.needsUpdate=!0,gn(J,oe,pe),J.side=Ri):gn(J,oe,pe)}this.compile=function(J,oe,pe=null){pe===null&&(pe=J),x=Xe.get(pe),x.init(oe),M.push(x),pe.traverseVisible(function(ce){ce.isLight&&ce.layers.test(oe.layers)&&(x.pushLight(ce),ce.castShadow&&x.pushShadow(ce))}),J!==pe&&J.traverseVisible(function(ce){ce.isLight&&ce.layers.test(oe.layers)&&(x.pushLight(ce),ce.castShadow&&x.pushShadow(ce))}),x.setupLights();const me=new Set;return J.traverse(function(ce){if(!(ce.isMesh||ce.isPoints||ce.isLine||ce.isSprite))return;const Ce=ce.material;if(Ce)if(Array.isArray(Ce))for(let ke=0;ke<Ce.length;ke++){const He=Ce[ke];Ct(He,pe,ce),me.add(He)}else Ct(Ce,pe,ce),me.add(Ce)}),M.pop(),x=null,me},this.compileAsync=function(J,oe,pe=null){const me=this.compile(J,oe,pe);return new Promise(ce=>{function Ce(){if(me.forEach(function(ke){de.get(ke).currentProgram.isReady()&&me.delete(ke)}),me.size===0){ce(J);return}setTimeout(Ce,10)}Y.get("KHR_parallel_shader_compile")!==null?Ce():setTimeout(Ce,10)})};let Zi=null;function Nn(J){Zi&&Zi(J)}function Kl(){Ei.stop()}function Ku(){Ei.start()}const Ei=new GS;Ei.setAnimationLoop(Nn),typeof self<"u"&&Ei.setContext(self),this.setAnimationLoop=function(J){Zi=J,ye.setAnimationLoop(J),J===null?Ei.stop():Ei.start()},ye.addEventListener("sessionstart",Kl),ye.addEventListener("sessionend",Ku),this.render=function(J,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(D===!0)return;if(J.matrixWorldAutoUpdate===!0&&J.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),ye.enabled===!0&&ye.isPresenting===!0&&(ye.cameraAutoUpdate===!0&&ye.updateCamera(oe),oe=ye.getCamera()),J.isScene===!0&&J.onBeforeRender(B,J,oe,V),x=Xe.get(J,M.length),x.init(oe),M.push(x),v.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),c.setFromProjectionMatrix(v),f=this.localClippingEnabled,h=xe.init(this.clippingPlanes,f),T=Le.get(J,P.length),T.init(),P.push(T),ye.enabled===!0&&ye.isPresenting===!0){const Ce=B.xr.getDepthSensingMesh();Ce!==null&&Jn(Ce,oe,-1/0,B.sortObjects)}Jn(J,oe,0,B.sortObjects),T.finish(),B.sortObjects===!0&&T.sort(re,Ae),F=ye.enabled===!1||ye.isPresenting===!1||ye.hasDepthSensing()===!1,F&&Ie.addToRenderList(T,J),this.info.render.frame++,h===!0&&xe.beginShadows();const pe=x.state.shadowsArray;Pe.render(pe,J,oe),h===!0&&xe.endShadows(),this.info.autoReset===!0&&this.info.reset();const me=T.opaque,ce=T.transmissive;if(x.setupLights(),oe.isArrayCamera){const Ce=oe.cameras;if(ce.length>0)for(let ke=0,He=Ce.length;ke<He;ke++){const De=Ce[ke];Zl(me,ce,J,De)}F&&Ie.render(J);for(let ke=0,He=Ce.length;ke<He;ke++){const De=Ce[ke];Jl(T,J,De,De.viewport)}}else ce.length>0&&Zl(me,ce,J,oe),F&&Ie.render(J),Jl(T,J,oe);V!==null&&U===0&&(q.updateMultisampleRenderTarget(V),q.updateRenderTargetMipmap(V)),J.isScene===!0&&J.onAfterRender(B,J,oe),pt.resetDefaultState(),k=-1,z=null,M.pop(),M.length>0?(x=M[M.length-1],h===!0&&xe.setGlobalState(B.clippingPlanes,x.state.camera)):x=null,P.pop(),P.length>0?T=P[P.length-1]:T=null};function Jn(J,oe,pe,me){if(J.visible===!1)return;if(J.layers.test(oe.layers)){if(J.isGroup)pe=J.renderOrder;else if(J.isLOD)J.autoUpdate===!0&&J.update(oe);else if(J.isLight)x.pushLight(J),J.castShadow&&x.pushShadow(J);else if(J.isSprite){if(!J.frustumCulled||c.intersectsSprite(J)){me&&R.setFromMatrixPosition(J.matrixWorld).applyMatrix4(v);const ke=ue.update(J),He=J.material;He.visible&&T.push(J,ke,He,pe,R.z,null)}}else if((J.isMesh||J.isLine||J.isPoints)&&(!J.frustumCulled||c.intersectsObject(J))){const ke=ue.update(J),He=J.material;if(me&&(J.boundingSphere!==void 0?(J.boundingSphere===null&&J.computeBoundingSphere(),R.copy(J.boundingSphere.center)):(ke.boundingSphere===null&&ke.computeBoundingSphere(),R.copy(ke.boundingSphere.center)),R.applyMatrix4(J.matrixWorld).applyMatrix4(v)),Array.isArray(He)){const De=ke.groups;for(let it=0,st=De.length;it<st;it++){const Je=De[it],St=He[Je.materialIndex];St&&St.visible&&T.push(J,ke,St,pe,R.z,Je)}}else He.visible&&T.push(J,ke,He,pe,R.z,null)}}const Ce=J.children;for(let ke=0,He=Ce.length;ke<He;ke++)Jn(Ce[ke],oe,pe,me)}function Jl(J,oe,pe,me){const ce=J.opaque,Ce=J.transmissive,ke=J.transparent;x.setupLightsView(pe),h===!0&&xe.setGlobalState(B.clippingPlanes,pe),me&&X.viewport(Q.copy(me)),ce.length>0&&dr(ce,oe,pe),Ce.length>0&&dr(Ce,oe,pe),ke.length>0&&dr(ke,oe,pe),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1)}function Zl(J,oe,pe,me){if((pe.isScene===!0?pe.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[me.id]===void 0&&(x.state.transmissionRenderTarget[me.id]=new dn(1,1,{generateMipmaps:!0,type:Y.has("EXT_color_buffer_half_float")||Y.has("EXT_color_buffer_float")?hi:ui,minFilter:hn,samples:4,stencilBuffer:l,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:wt.workingColorSpace}));const Ce=x.state.transmissionRenderTarget[me.id],ke=me.viewport||Q;Ce.setSize(ke.z*B.transmissionResolutionScale,ke.w*B.transmissionResolutionScale);const He=B.getRenderTarget();B.setRenderTarget(Ce),B.getClearColor(s),H=B.getClearAlpha(),H<1&&B.setClearColor(16777215,.5),B.clear(),F&&Ie.render(pe);const De=B.toneMapping;B.toneMapping=Ss;const it=me.viewport;if(me.viewport!==void 0&&(me.viewport=void 0),x.setupLightsView(me),h===!0&&xe.setGlobalState(B.clippingPlanes,me),dr(J,pe,me),q.updateMultisampleRenderTarget(Ce),q.updateRenderTargetMipmap(Ce),Y.has("WEBGL_multisampled_render_to_texture")===!1){let st=!1;for(let Je=0,St=oe.length;Je<St;Je++){const Pt=oe[Je],di=Pt.object,ri=Pt.geometry,Tt=Pt.material,Ze=Pt.group;if(Tt.side===Ri&&di.layers.test(me.layers)){const Ni=Tt.side;Tt.side=Fi,Tt.needsUpdate=!0,ec(di,pe,me,ri,Tt,Ze),Tt.side=Ni,Tt.needsUpdate=!0,st=!0}}st===!0&&(q.updateMultisampleRenderTarget(Ce),q.updateRenderTargetMipmap(Ce))}B.setRenderTarget(He),B.setClearColor(s,H),it!==void 0&&(me.viewport=it),B.toneMapping=De}function dr(J,oe,pe){const me=oe.isScene===!0?oe.overrideMaterial:null;for(let ce=0,Ce=J.length;ce<Ce;ce++){const ke=J[ce],He=ke.object,De=ke.geometry,it=me===null?ke.material:me,st=ke.group;He.layers.test(pe.layers)&&ec(He,oe,pe,De,it,st)}}function ec(J,oe,pe,me,ce,Ce){J.onBeforeRender(B,oe,pe,me,ce,Ce),J.modelViewMatrix.multiplyMatrices(pe.matrixWorldInverse,J.matrixWorld),J.normalMatrix.getNormalMatrix(J.modelViewMatrix),ce.onBeforeRender(B,oe,pe,me,J,Ce),ce.transparent===!0&&ce.side===Ri&&ce.forceSinglePass===!1?(ce.side=Fi,ce.needsUpdate=!0,B.renderBufferDirect(pe,oe,me,ce,J,Ce),ce.side=hs,ce.needsUpdate=!0,B.renderBufferDirect(pe,oe,me,ce,J,Ce),ce.side=Ri):B.renderBufferDirect(pe,oe,me,ce,J,Ce),J.onAfterRender(B,oe,pe,me,ce,Ce)}function gn(J,oe,pe){oe.isScene!==!0&&(oe=L);const me=de.get(J),ce=x.state.lights,Ce=x.state.shadowsArray,ke=ce.state.version,He=ve.getParameters(J,ce.state,Ce,oe,pe),De=ve.getProgramCacheKey(He);let it=me.programs;me.environment=J.isMeshStandardMaterial?oe.environment:null,me.fog=oe.fog,me.envMap=(J.isMeshStandardMaterial?ae:j).get(J.envMap||me.environment),me.envMapRotation=me.environment!==null&&J.envMap===null?oe.environmentRotation:J.envMapRotation,it===void 0&&(J.addEventListener("dispose",qe),it=new Map,me.programs=it);let st=it.get(De);if(st!==void 0){if(me.currentProgram===st&&me.lightsStateVersion===ke)return ic(J,He),st}else He.uniforms=ve.getUniforms(J),J.onBeforeCompile(He,B),st=ve.acquireProgram(He,De),it.set(De,st),me.uniforms=He.uniforms;const Je=me.uniforms;return(!J.isShaderMaterial&&!J.isRawShaderMaterial||J.clipping===!0)&&(Je.clippingPlanes=xe.uniform),ic(J,He),me.needsLights=ep(J),me.lightsStateVersion=ke,me.needsLights&&(Je.ambientLightColor.value=ce.state.ambient,Je.lightProbe.value=ce.state.probe,Je.directionalLights.value=ce.state.directional,Je.directionalLightShadows.value=ce.state.directionalShadow,Je.spotLights.value=ce.state.spot,Je.spotLightShadows.value=ce.state.spotShadow,Je.rectAreaLights.value=ce.state.rectArea,Je.ltc_1.value=ce.state.rectAreaLTC1,Je.ltc_2.value=ce.state.rectAreaLTC2,Je.pointLights.value=ce.state.point,Je.pointLightShadows.value=ce.state.pointShadow,Je.hemisphereLights.value=ce.state.hemi,Je.directionalShadowMap.value=ce.state.directionalShadowMap,Je.directionalShadowMatrix.value=ce.state.directionalShadowMatrix,Je.spotShadowMap.value=ce.state.spotShadowMap,Je.spotLightMatrix.value=ce.state.spotLightMatrix,Je.spotLightMap.value=ce.state.spotLightMap,Je.pointShadowMap.value=ce.state.pointShadowMap,Je.pointShadowMatrix.value=ce.state.pointShadowMatrix),me.currentProgram=st,me.uniformsList=null,st}function tc(J){if(J.uniformsList===null){const oe=J.currentProgram.getUniforms();J.uniformsList=Ed.seqWithValue(oe.seq,J.uniforms)}return J.uniformsList}function ic(J,oe){const pe=de.get(J);pe.outputColorSpace=oe.outputColorSpace,pe.batching=oe.batching,pe.batchingColor=oe.batchingColor,pe.instancing=oe.instancing,pe.instancingColor=oe.instancingColor,pe.instancingMorph=oe.instancingMorph,pe.skinning=oe.skinning,pe.morphTargets=oe.morphTargets,pe.morphNormals=oe.morphNormals,pe.morphColors=oe.morphColors,pe.morphTargetsCount=oe.morphTargetsCount,pe.numClippingPlanes=oe.numClippingPlanes,pe.numIntersection=oe.numClipIntersection,pe.vertexAlphas=oe.vertexAlphas,pe.vertexTangents=oe.vertexTangents,pe.toneMapping=oe.toneMapping}function Ju(J,oe,pe,me,ce){oe.isScene!==!0&&(oe=L),q.resetTextureUnits();const Ce=oe.fog,ke=me.isMeshStandardMaterial?oe.environment:null,He=V===null?B.outputColorSpace:V.isXRRenderTarget===!0?V.texture.colorSpace:qt,De=(me.isMeshStandardMaterial?ae:j).get(me.envMap||ke),it=me.vertexColors===!0&&!!pe.attributes.color&&pe.attributes.color.itemSize===4,st=!!pe.attributes.tangent&&(!!me.normalMap||me.anisotropy>0),Je=!!pe.morphAttributes.position,St=!!pe.morphAttributes.normal,Pt=!!pe.morphAttributes.color;let di=Ss;me.toneMapped&&(V===null||V.isXRRenderTarget===!0)&&(di=B.toneMapping);const ri=pe.morphAttributes.position||pe.morphAttributes.normal||pe.morphAttributes.color,Tt=ri!==void 0?ri.length:0,Ze=de.get(me),Ni=x.state.lights;if(h===!0&&(f===!0||J!==z)){const en=J===z&&me.id===k;xe.setState(me,J,en)}let Lt=!1;me.version===Ze.__version?(Ze.needsLights&&Ze.lightsStateVersion!==Ni.state.version||Ze.outputColorSpace!==He||ce.isBatchedMesh&&Ze.batching===!1||!ce.isBatchedMesh&&Ze.batching===!0||ce.isBatchedMesh&&Ze.batchingColor===!0&&ce.colorTexture===null||ce.isBatchedMesh&&Ze.batchingColor===!1&&ce.colorTexture!==null||ce.isInstancedMesh&&Ze.instancing===!1||!ce.isInstancedMesh&&Ze.instancing===!0||ce.isSkinnedMesh&&Ze.skinning===!1||!ce.isSkinnedMesh&&Ze.skinning===!0||ce.isInstancedMesh&&Ze.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&Ze.instancingColor===!1&&ce.instanceColor!==null||ce.isInstancedMesh&&Ze.instancingMorph===!0&&ce.morphTexture===null||ce.isInstancedMesh&&Ze.instancingMorph===!1&&ce.morphTexture!==null||Ze.envMap!==De||me.fog===!0&&Ze.fog!==Ce||Ze.numClippingPlanes!==void 0&&(Ze.numClippingPlanes!==xe.numPlanes||Ze.numIntersection!==xe.numIntersection)||Ze.vertexAlphas!==it||Ze.vertexTangents!==st||Ze.morphTargets!==Je||Ze.morphNormals!==St||Ze.morphColors!==Pt||Ze.toneMapping!==di||Ze.morphTargetsCount!==Tt)&&(Lt=!0):(Lt=!0,Ze.__version=me.version);let Zn=Ze.currentProgram;Lt===!0&&(Zn=gn(me,oe,ce));let so=!1,wn=!1,nc=!1;const Jt=Zn.getUniforms(),On=Ze.uniforms;if(X.useProgram(Zn.program)&&(so=!0,wn=!0,nc=!0),me.id!==k&&(k=me.id,wn=!0),so||z!==J){X.buffers.depth.getReversed()?(g.copy(J.projectionMatrix),PM(g),LM(g),Jt.setValue(O,"projectionMatrix",g)):Jt.setValue(O,"projectionMatrix",J.projectionMatrix),Jt.setValue(O,"viewMatrix",J.matrixWorldInverse);const An=Jt.map.cameraPosition;An!==void 0&&An.setValue(O,S.setFromMatrixPosition(J.matrixWorld)),te.logarithmicDepthBuffer&&Jt.setValue(O,"logDepthBufFC",2/(Math.log(J.far+1)/Math.LN2)),(me.isMeshPhongMaterial||me.isMeshToonMaterial||me.isMeshLambertMaterial||me.isMeshBasicMaterial||me.isMeshStandardMaterial||me.isShaderMaterial)&&Jt.setValue(O,"isOrthographic",J.isOrthographicCamera===!0),z!==J&&(z=J,wn=!0,nc=!0)}if(ce.isSkinnedMesh){Jt.setOptional(O,ce,"bindMatrix"),Jt.setOptional(O,ce,"bindMatrixInverse");const en=ce.skeleton;en&&(en.boneTexture===null&&en.computeBoneTexture(),Jt.setValue(O,"boneTexture",en.boneTexture,q))}ce.isBatchedMesh&&(Jt.setOptional(O,ce,"batchingTexture"),Jt.setValue(O,"batchingTexture",ce._matricesTexture,q),Jt.setOptional(O,ce,"batchingIdTexture"),Jt.setValue(O,"batchingIdTexture",ce._indirectTexture,q),Jt.setOptional(O,ce,"batchingColorTexture"),ce._colorsTexture!==null&&Jt.setValue(O,"batchingColorTexture",ce._colorsTexture,q));const kn=pe.morphAttributes;if((kn.position!==void 0||kn.normal!==void 0||kn.color!==void 0)&&Ue.update(ce,pe,Zn),(wn||Ze.receiveShadow!==ce.receiveShadow)&&(Ze.receiveShadow=ce.receiveShadow,Jt.setValue(O,"receiveShadow",ce.receiveShadow)),me.isMeshGouraudMaterial&&me.envMap!==null&&(On.envMap.value=De,On.flipEnvMap.value=De.isCubeTexture&&De.isRenderTargetTexture===!1?-1:1),me.isMeshStandardMaterial&&me.envMap===null&&oe.environment!==null&&(On.envMapIntensity.value=oe.environmentIntensity),wn&&(Jt.setValue(O,"toneMappingExposure",B.toneMappingExposure),Ze.needsLights&&Zu(On,nc),Ce&&me.fog===!0&&Re.refreshFogUniforms(On,Ce),Re.refreshMaterialUniforms(On,me,I,ee,x.state.transmissionRenderTarget[J.id]),Ed.upload(O,tc(Ze),On,q)),me.isShaderMaterial&&me.uniformsNeedUpdate===!0&&(Ed.upload(O,tc(Ze),On,q),me.uniformsNeedUpdate=!1),me.isSpriteMaterial&&Jt.setValue(O,"center",ce.center),Jt.setValue(O,"modelViewMatrix",ce.modelViewMatrix),Jt.setValue(O,"normalMatrix",ce.normalMatrix),Jt.setValue(O,"modelMatrix",ce.matrixWorld),me.isShaderMaterial||me.isRawShaderMaterial){const en=me.uniformsGroups;for(let An=0,tp=en.length;An<tp;An++){const ta=en[An];ne.update(ta,Zn),ne.bind(ta,Zn)}}return Zn}function Zu(J,oe){J.ambientLightColor.needsUpdate=oe,J.lightProbe.needsUpdate=oe,J.directionalLights.needsUpdate=oe,J.directionalLightShadows.needsUpdate=oe,J.pointLights.needsUpdate=oe,J.pointLightShadows.needsUpdate=oe,J.spotLights.needsUpdate=oe,J.spotLightShadows.needsUpdate=oe,J.rectAreaLights.needsUpdate=oe,J.hemisphereLights.needsUpdate=oe}function ep(J){return J.isMeshLambertMaterial||J.isMeshToonMaterial||J.isMeshPhongMaterial||J.isMeshStandardMaterial||J.isShadowMaterial||J.isShaderMaterial&&J.lights===!0}this.getActiveCubeFace=function(){return G},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return V},this.setRenderTargetTextures=function(J,oe,pe){de.get(J.texture).__webglTexture=oe,de.get(J.depthTexture).__webglTexture=pe;const me=de.get(J);me.__hasExternalTextures=!0,me.__autoAllocateDepthBuffer=pe===void 0,me.__autoAllocateDepthBuffer||Y.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),me.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(J,oe){const pe=de.get(J);pe.__webglFramebuffer=oe,pe.__useDefaultFramebuffer=oe===void 0};const We=O.createFramebuffer();this.setRenderTarget=function(J,oe=0,pe=0){V=J,G=oe,U=pe;let me=!0,ce=null,Ce=!1,ke=!1;if(J){const De=de.get(J);if(De.__useDefaultFramebuffer!==void 0)X.bindFramebuffer(O.FRAMEBUFFER,null),me=!1;else if(De.__webglFramebuffer===void 0)q.setupRenderTarget(J);else if(De.__hasExternalTextures)q.rebindTextures(J,de.get(J.texture).__webglTexture,de.get(J.depthTexture).__webglTexture);else if(J.depthBuffer){const Je=J.depthTexture;if(De.__boundDepthTexture!==Je){if(Je!==null&&de.has(Je)&&(J.width!==Je.image.width||J.height!==Je.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");q.setupDepthRenderbuffer(J)}}const it=J.texture;(it.isData3DTexture||it.isDataArrayTexture||it.isCompressedArrayTexture)&&(ke=!0);const st=de.get(J).__webglFramebuffer;J.isWebGLCubeRenderTarget?(Array.isArray(st[oe])?ce=st[oe][pe]:ce=st[oe],Ce=!0):J.samples>0&&q.useMultisampledRTT(J)===!1?ce=de.get(J).__webglMultisampledFramebuffer:Array.isArray(st)?ce=st[pe]:ce=st,Q.copy(J.viewport),Z.copy(J.scissor),K=J.scissorTest}else Q.copy(N).multiplyScalar(I).floor(),Z.copy(n).multiplyScalar(I).floor(),K=r;if(pe!==0&&(ce=We),X.bindFramebuffer(O.FRAMEBUFFER,ce)&&me&&X.drawBuffers(J,ce),X.viewport(Q),X.scissor(Z),X.setScissorTest(K),Ce){const De=de.get(J.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+oe,De.__webglTexture,pe)}else if(ke){const De=de.get(J.texture),it=oe;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,De.__webglTexture,pe,it)}else if(J!==null&&pe!==0){const De=de.get(J.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,De.__webglTexture,pe)}k=-1},this.readRenderTargetPixels=function(J,oe,pe,me,ce,Ce,ke){if(!(J&&J.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let He=de.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&ke!==void 0&&(He=He[ke]),He){X.bindFramebuffer(O.FRAMEBUFFER,He);try{const De=J.texture,it=De.format,st=De.type;if(!te.textureFormatReadable(it)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!te.textureTypeReadable(st)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=J.width-me&&pe>=0&&pe<=J.height-ce&&O.readPixels(oe,pe,me,ce,Ke.convert(it),Ke.convert(st),Ce)}finally{const De=V!==null?de.get(V).__webglFramebuffer:null;X.bindFramebuffer(O.FRAMEBUFFER,De)}}},this.readRenderTargetPixelsAsync=async function(J,oe,pe,me,ce,Ce,ke){if(!(J&&J.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let He=de.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&&ke!==void 0&&(He=He[ke]),He){const De=J.texture,it=De.format,st=De.type;if(!te.textureFormatReadable(it))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!te.textureTypeReadable(st))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(oe>=0&&oe<=J.width-me&&pe>=0&&pe<=J.height-ce){X.bindFramebuffer(O.FRAMEBUFFER,He);const Je=O.createBuffer();O.bindBuffer(O.PIXEL_PACK_BUFFER,Je),O.bufferData(O.PIXEL_PACK_BUFFER,Ce.byteLength,O.STREAM_READ),O.readPixels(oe,pe,me,ce,Ke.convert(it),Ke.convert(st),0);const St=V!==null?de.get(V).__webglFramebuffer:null;X.bindFramebuffer(O.FRAMEBUFFER,St);const Pt=O.fenceSync(O.SYNC_GPU_COMMANDS_COMPLETE,0);return O.flush(),await BM(O,Pt,4),O.bindBuffer(O.PIXEL_PACK_BUFFER,Je),O.getBufferSubData(O.PIXEL_PACK_BUFFER,0,Ce),O.deleteBuffer(Je),O.deleteSync(Pt),Ce}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(J,oe=null,pe=0){J.isTexture!==!0&&(Ho("WebGLRenderer: copyFramebufferToTexture function signature has changed."),oe=arguments[0]||null,J=arguments[1]);const me=Math.pow(2,-pe),ce=Math.floor(J.image.width*me),Ce=Math.floor(J.image.height*me),ke=oe!==null?oe.x:0,He=oe!==null?oe.y:0;q.setTexture2D(J,0),O.copyTexSubImage2D(O.TEXTURE_2D,pe,0,0,ke,He,ce,Ce),X.unbindTexture()};const le=O.createFramebuffer(),Be=O.createFramebuffer();this.copyTextureToTexture=function(J,oe,pe=null,me=null,ce=0,Ce=null){J.isTexture!==!0&&(Ho("WebGLRenderer: copyTextureToTexture function signature has changed."),me=arguments[0]||null,J=arguments[1],oe=arguments[2],Ce=arguments[3]||0,pe=null),Ce===null&&(ce!==0?(Ho("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Ce=ce,ce=0):Ce=0);let ke,He,De,it,st,Je,St,Pt,di;const ri=J.isCompressedTexture?J.mipmaps[Ce]:J.image;if(pe!==null)ke=pe.max.x-pe.min.x,He=pe.max.y-pe.min.y,De=pe.isBox3?pe.max.z-pe.min.z:1,it=pe.min.x,st=pe.min.y,Je=pe.isBox3?pe.min.z:0;else{const kn=Math.pow(2,-ce);ke=Math.floor(ri.width*kn),He=Math.floor(ri.height*kn),J.isDataArrayTexture?De=ri.depth:J.isData3DTexture?De=Math.floor(ri.depth*kn):De=1,it=0,st=0,Je=0}me!==null?(St=me.x,Pt=me.y,di=me.z):(St=0,Pt=0,di=0);const Tt=Ke.convert(oe.format),Ze=Ke.convert(oe.type);let Ni;oe.isData3DTexture?(q.setTexture3D(oe,0),Ni=O.TEXTURE_3D):oe.isDataArrayTexture||oe.isCompressedArrayTexture?(q.setTexture2DArray(oe,0),Ni=O.TEXTURE_2D_ARRAY):(q.setTexture2D(oe,0),Ni=O.TEXTURE_2D),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,oe.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,oe.unpackAlignment);const Lt=O.getParameter(O.UNPACK_ROW_LENGTH),Zn=O.getParameter(O.UNPACK_IMAGE_HEIGHT),so=O.getParameter(O.UNPACK_SKIP_PIXELS),wn=O.getParameter(O.UNPACK_SKIP_ROWS),nc=O.getParameter(O.UNPACK_SKIP_IMAGES);O.pixelStorei(O.UNPACK_ROW_LENGTH,ri.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,ri.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,it),O.pixelStorei(O.UNPACK_SKIP_ROWS,st),O.pixelStorei(O.UNPACK_SKIP_IMAGES,Je);const Jt=J.isDataArrayTexture||J.isData3DTexture,On=oe.isDataArrayTexture||oe.isData3DTexture;if(J.isDepthTexture){const kn=de.get(J),en=de.get(oe),An=de.get(kn.__renderTarget),tp=de.get(en.__renderTarget);X.bindFramebuffer(O.READ_FRAMEBUFFER,An.__webglFramebuffer),X.bindFramebuffer(O.DRAW_FRAMEBUFFER,tp.__webglFramebuffer);for(let ta=0;ta<De;ta++)Jt&&(O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,de.get(J).__webglTexture,ce,Je+ta),O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,de.get(oe).__webglTexture,Ce,di+ta)),O.blitFramebuffer(it,st,ke,He,St,Pt,ke,He,O.DEPTH_BUFFER_BIT,O.NEAREST);X.bindFramebuffer(O.READ_FRAMEBUFFER,null),X.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else if(ce!==0||J.isRenderTargetTexture||de.has(J)){const kn=de.get(J),en=de.get(oe);X.bindFramebuffer(O.READ_FRAMEBUFFER,le),X.bindFramebuffer(O.DRAW_FRAMEBUFFER,Be);for(let An=0;An<De;An++)Jt?O.framebufferTextureLayer(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,kn.__webglTexture,ce,Je+An):O.framebufferTexture2D(O.READ_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,kn.__webglTexture,ce),On?O.framebufferTextureLayer(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,en.__webglTexture,Ce,di+An):O.framebufferTexture2D(O.DRAW_FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,en.__webglTexture,Ce),ce!==0?O.blitFramebuffer(it,st,ke,He,St,Pt,ke,He,O.COLOR_BUFFER_BIT,O.NEAREST):On?O.copyTexSubImage3D(Ni,Ce,St,Pt,di+An,it,st,ke,He):O.copyTexSubImage2D(Ni,Ce,St,Pt,it,st,ke,He);X.bindFramebuffer(O.READ_FRAMEBUFFER,null),X.bindFramebuffer(O.DRAW_FRAMEBUFFER,null)}else On?J.isDataTexture||J.isData3DTexture?O.texSubImage3D(Ni,Ce,St,Pt,di,ke,He,De,Tt,Ze,ri.data):oe.isCompressedArrayTexture?O.compressedTexSubImage3D(Ni,Ce,St,Pt,di,ke,He,De,Tt,ri.data):O.texSubImage3D(Ni,Ce,St,Pt,di,ke,He,De,Tt,Ze,ri):J.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,Ce,St,Pt,ke,He,Tt,Ze,ri.data):J.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,Ce,St,Pt,ri.width,ri.height,Tt,ri.data):O.texSubImage2D(O.TEXTURE_2D,Ce,St,Pt,ke,He,Tt,Ze,ri);O.pixelStorei(O.UNPACK_ROW_LENGTH,Lt),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,Zn),O.pixelStorei(O.UNPACK_SKIP_PIXELS,so),O.pixelStorei(O.UNPACK_SKIP_ROWS,wn),O.pixelStorei(O.UNPACK_SKIP_IMAGES,nc),Ce===0&&oe.generateMipmaps&&O.generateMipmap(Ni),X.unbindTexture()},this.copyTextureToTexture3D=function(J,oe,pe=null,me=null,ce=0){return J.isTexture!==!0&&(Ho("WebGLRenderer: copyTextureToTexture3D function signature has changed."),pe=arguments[0]||null,me=arguments[1]||null,J=arguments[2],oe=arguments[3],ce=arguments[4]||0),Ho('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(J,oe,pe,me,ce)},this.initRenderTarget=function(J){de.get(J).__webglFramebuffer===void 0&&q.setupRenderTarget(J)},this.initTexture=function(J){J.isCubeTexture?q.setTextureCube(J,0):J.isData3DTexture?q.setTexture3D(J,0):J.isDataArrayTexture||J.isCompressedArrayTexture?q.setTexture2DArray(J,0):q.setTexture2D(J,0),X.unbindTexture()},this.resetState=function(){G=0,U=0,V=null,X.reset(),pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return sr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorspace=wt._getDrawingBufferColorSpace(e),t.unpackColorSpace=wt._getUnpackColorSpace()}}class Y0{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const BD=new Kr(-1,1,1,-1,0,1);class PD extends Di{constructor(){super(),this.setAttribute("position",new $i([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new $i([0,2,0,0,2,0],2))}}const LD=new PD;class DD{constructor(e){this._mesh=new lt(LD,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,BD)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}/*!
|
|
3901
3901
|
fflate - fast JavaScript compression/decompression
|
|
3902
3902
|
<https://101arrowz.github.io/fflate>
|
|
3903
3903
|
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
|
3904
3904
|
version 0.8.2
|
|
3905
|
-
*/var Ki=Uint8Array,Rn=Uint16Array,X0=Int32Array,K0=new Ki([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),J0=new Ki([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ub=new Ki([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qS=function(o,e){for(var t=new Rn(31),i=0;i<31;++i)t[i]=e+=1<<o[i-1];for(var a=new X0(t[30]),i=1;i<30;++i)for(var l=t[i];l<t[i+1];++l)a[l]=l-t[i]<<5|i;return{b:t,r:a}},WS=qS(K0,2),ND=WS.b,CA=WS.r;ND[28]=258,CA[258]=28;var OD=qS(J0,0),hb=OD.r,TA=new Rn(32768);for(var Yt=0;Yt<32768;++Yt){var br=(Yt&43690)>>1|(Yt&21845)<<1;br=(br&52428)>>2|(br&13107)<<2,br=(br&61680)>>4|(br&3855)<<4,TA[Yt]=((br&65280)>>8|(br&255)<<8)>>1}var uu=(function(o,e,t){for(var i=o.length,a=0,l=new Rn(e);a<i;++a)o[a]&&++l[o[a]-1];var u=new Rn(e);for(a=1;a<e;++a)u[a]=u[a-1]+l[a-1]<<1;var d;if(t){d=new Rn(1<<e);var p=15-e;for(a=0;a<i;++a)if(o[a])for(var m=a<<4|o[a],A=e-o[a],_=u[o[a]-1]++<<A,b=_|(1<<A)-1;_<=b;++_)d[TA[_]>>p]=m}else for(d=new Rn(i),a=0;a<i;++a)o[a]&&(d[a]=TA[u[o[a]-1]++]>>15-o[a]);return d}),Wa=new Ki(288);for(var Yt=0;Yt<144;++Yt)Wa[Yt]=8;for(var Yt=144;Yt<256;++Yt)Wa[Yt]=9;for(var Yt=256;Yt<280;++Yt)Wa[Yt]=7;for(var Yt=280;Yt<288;++Yt)Wa[Yt]=8;var nf=new Ki(32);for(var Yt=0;Yt<32;++Yt)nf[Yt]=5;var kD=uu(Wa,9,0),UD=uu(nf,5,0),YS=function(o){return(o+7)/8|0},XS=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new Ki(o.subarray(e,t))},FD=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],kf=function(o,e,t){var i=new Error(e||FD[o]);if(i.code=o,Error.captureStackTrace&&Error.captureStackTrace(i,kf),!t)throw i;return i},Hs=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8},mc=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8,o[i+2]|=t>>16},zp=function(o,e){for(var t=[],i=0;i<o.length;++i)o[i]&&t.push({s:i,f:o[i]});var a=t.length,l=t.slice();if(!a)return{t:JS,l:0};if(a==1){var u=new Ki(t[0].s+1);return u[t[0].s]=1,{t:u,l:1}}t.sort(function(D,G){return D.f-G.f}),t.push({s:-1,f:25001});var d=t[0],p=t[1],m=0,A=1,_=2;for(t[0]={s:-1,f:d.f+p.f,l:d,r:p};A!=a-1;)d=t[t[m].f<t[_].f?m++:_++],p=t[m!=A&&t[m].f<t[_].f?m++:_++],t[A++]={s:-1,f:d.f+p.f,l:d,r:p};for(var b=l[0].s,i=1;i<a;++i)l[i].s>b&&(b=l[i].s);var w=new Rn(b+1),E=IA(t[A-1],w,0);if(E>e){var i=0,C=0,T=E-e,x=1<<T;for(l.sort(function(G,U){return w[U.s]-w[G.s]||G.f-U.f});i<a;++i){var P=l[i].s;if(w[P]>e)C+=x-(1<<E-w[P]),w[P]=e;else break}for(C>>=T;C>0;){var M=l[i].s;w[M]<e?C-=1<<e-w[M]++-1:++i}for(;i>=0&&C;--i){var B=l[i].s;w[B]==e&&(--w[B],++C)}E=e}return{t:new Ki(w),l:E}},IA=function(o,e,t){return o.s==-1?Math.max(IA(o.l,e,t+1),IA(o.r,e,t+1)):e[o.s]=t},db=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new Rn(++e),i=0,a=o[0],l=1,u=function(p){t[i++]=p},d=1;d<=e;++d)if(o[d]==a&&d!=e)++l;else{if(!a&&l>2){for(;l>138;l-=138)u(32754);l>2&&(u(l>10?l-11<<5|28690:l-3<<5|12305),l=0)}else if(l>3){for(u(a),--l;l>6;l-=6)u(8304);l>2&&(u(l-3<<5|8208),l=0)}for(;l--;)u(a);l=1,a=o[d]}return{c:t.subarray(0,i),n:e}},gc=function(o,e){for(var t=0,i=0;i<e.length;++i)t+=o[i]*e[i];return t},KS=function(o,e,t){var i=t.length,a=YS(e+2);o[a]=i&255,o[a+1]=i>>8,o[a+2]=o[a]^255,o[a+3]=o[a+1]^255;for(var l=0;l<i;++l)o[a+l+4]=t[l];return(a+4+i)*8},fb=function(o,e,t,i,a,l,u,d,p,m,A){Hs(e,A++,t),++a[256];for(var _=zp(a,15),b=_.t,w=_.l,E=zp(l,15),C=E.t,T=E.l,x=db(b),P=x.c,M=x.n,B=db(C),D=B.c,G=B.n,U=new Rn(19),V=0;V<P.length;++V)++U[P[V]&31];for(var V=0;V<D.length;++V)++U[D[V]&31];for(var k=zp(U,7),z=k.t,Q=k.l,Z=19;Z>4&&!z[ub[Z-1]];--Z);var K=m+5<<3,s=gc(a,Wa)+gc(l,nf)+u,H=gc(a,b)+gc(l,C)+u+14+3*Z+gc(U,z)+2*U[16]+3*U[17]+7*U[18];if(p>=0&&K<=s&&K<=H)return KS(e,A,o.subarray(p,p+m));var y,ee,I,re;if(Hs(e,A,1+(H<s)),A+=2,H<s){y=uu(b,w,0),ee=b,I=uu(C,T,0),re=C;var Ae=uu(z,Q,0);Hs(e,A,M-257),Hs(e,A+5,G-1),Hs(e,A+10,Z-4),A+=14;for(var V=0;V<Z;++V)Hs(e,A+3*V,z[ub[V]]);A+=3*Z;for(var N=[P,D],n=0;n<2;++n)for(var r=N[n],V=0;V<r.length;++V){var c=r[V]&31;Hs(e,A,Ae[c]),A+=z[c],c>15&&(Hs(e,A,r[V]>>5&127),A+=r[V]>>12)}}else y=kD,ee=Wa,I=UD,re=nf;for(var V=0;V<d;++V){var h=i[V];if(h>255){var c=h>>18&31;mc(e,A,y[c+257]),A+=ee[c+257],c>7&&(Hs(e,A,h>>23&31),A+=K0[c]);var f=h&31;mc(e,A,I[f]),A+=re[f],f>3&&(mc(e,A,h>>5&8191),A+=J0[f])}else mc(e,A,y[h]),A+=ee[h]}return mc(e,A,y[256]),A+ee[256]},$D=new X0([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),JS=new Ki(0),zD=function(o,e,t,i,a,l){var u=l.z||o.length,d=new Ki(i+u+5*(1+Math.ceil(u/7e3))+a),p=d.subarray(i,d.length-a),m=l.l,A=(l.r||0)&7;if(e){A&&(p[0]=l.r>>3);for(var _=$D[e-1],b=_>>13,w=_&8191,E=(1<<t)-1,C=l.p||new Rn(32768),T=l.h||new Rn(E+1),x=Math.ceil(t/3),P=2*x,M=function(O){return(o[O]^o[O+1]<<x^o[O+2]<<P)&E},B=new X0(25e3),D=new Rn(288),G=new Rn(32),U=0,V=0,k=l.i||0,z=0,Q=l.w||0,Z=0;k+2<u;++k){var K=M(k),s=k&32767,H=T[K];if(C[s]=H,T[K]=s,Q<=k){var y=u-k;if((U>7e3||z>24576)&&(y>423||!m)){A=fb(o,p,0,B,D,G,V,z,Z,k-Z,A),z=U=V=0,Z=k;for(var ee=0;ee<286;++ee)D[ee]=0;for(var ee=0;ee<30;++ee)G[ee]=0}var I=2,re=0,Ae=w,N=s-H&32767;if(y>2&&K==M(k-N))for(var n=Math.min(b,y)-1,r=Math.min(32767,k),c=Math.min(258,y);N<=r&&--Ae&&s!=H;){if(o[k+I]==o[k+I-N]){for(var h=0;h<c&&o[k+h]==o[k+h-N];++h);if(h>I){if(I=h,re=N,h>n)break;for(var f=Math.min(N,h-2),g=0,ee=0;ee<f;++ee){var v=k-N+ee&32767,S=C[v],R=v-S&32767;R>g&&(g=R,H=v)}}}s=H,H=C[s],N+=s-H&32767}if(re){B[z++]=268435456|CA[I]<<18|hb[re];var L=CA[I]&31,F=hb[re]&31;V+=K0[L]+J0[F],++D[257+L],++G[F],Q=k+I,++U}else B[z++]=o[k],++D[o[k]]}}for(k=Math.max(k,Q);k<u;++k)B[z++]=o[k],++D[o[k]];A=fb(o,p,m,B,D,G,V,z,Z,k-Z,A),m||(l.r=A&7|p[A/8|0]<<3,A-=7,l.h=T,l.p=C,l.i=k,l.w=Q)}else{for(var k=l.w||0;k<u+m;k+=65535){var $=k+65535;$>=u&&(p[A/8|0]=m,$=u),A=KS(p,A+1,o.subarray(k,$))}l.i=u}return XS(d,0,i+YS(A)+a)},GD=(function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o})(),HD=function(){var o=-1;return{p:function(e){for(var t=o,i=0;i<e.length;++i)t=GD[t&255^e[i]]^t>>>8;o=t},d:function(){return~o}}},VD=function(o,e,t,i,a){if(!a&&(a={l:1},e.dictionary)){var l=e.dictionary.subarray(-32768),u=new Ki(l.length+o.length);u.set(l),u.set(o,l.length),o=u,a.w=l.length}return zD(o,e.level==null?6:e.level,e.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(o.length)))*1.5):20:12+e.mem,t,i,a)},ZS=function(o,e){var t={};for(var i in o)t[i]=o[i];for(var i in e)t[i]=e[i];return t},Oi=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8};function QD(o,e){return VD(o,e||{},0,0)}var e1=function(o,e,t,i){for(var a in o){var l=o[a],u=e+a,d=i;Array.isArray(l)&&(d=ZS(i,l[1]),l=l[0]),l instanceof Ki?t[u]=[l,d]:(t[u+="/"]=[new Ki(0),d],e1(l,u,t,i))}},pb=typeof TextEncoder<"u"&&new TextEncoder,jD=typeof TextDecoder<"u"&&new TextDecoder,qD=0;try{jD.decode(JS,{stream:!0}),qD=1}catch{}function sf(o,e){var t;if(pb)return pb.encode(o);for(var i=o.length,a=new Ki(o.length+(o.length>>1)),l=0,u=function(m){a[l++]=m},t=0;t<i;++t){if(l+5>a.length){var d=new Ki(l+8+(i-t<<1));d.set(a),a=d}var p=o.charCodeAt(t);p<128||e?u(p):p<2048?(u(192|p>>6),u(128|p&63)):p>55295&&p<57344?(p=65536+(p&1047552)|o.charCodeAt(++t)&1023,u(240|p>>18),u(128|p>>12&63),u(128|p>>6&63),u(128|p&63)):(u(224|p>>12),u(128|p>>6&63),u(128|p&63))}return XS(a,0,l)}var MA=function(o){var e=0;if(o)for(var t in o){var i=o[t].length;i>65535&&kf(9),e+=i+4}return e},mb=function(o,e,t,i,a,l,u,d){var p=i.length,m=t.extra,A=d&&d.length,_=MA(m);Oi(o,e,u!=null?33639248:67324752),e+=4,u!=null&&(o[e++]=20,o[e++]=t.os),o[e]=20,e+=2,o[e++]=t.flag<<1|(l<0&&8),o[e++]=a&&8,o[e++]=t.compression&255,o[e++]=t.compression>>8;var b=new Date(t.mtime==null?Date.now():t.mtime),w=b.getFullYear()-1980;if((w<0||w>119)&&kf(10),Oi(o,e,w<<25|b.getMonth()+1<<21|b.getDate()<<16|b.getHours()<<11|b.getMinutes()<<5|b.getSeconds()>>1),e+=4,l!=-1&&(Oi(o,e,t.crc),Oi(o,e+4,l<0?-l-2:l),Oi(o,e+8,t.size)),Oi(o,e+12,p),Oi(o,e+14,_),e+=16,u!=null&&(Oi(o,e,A),Oi(o,e+6,t.attrs),Oi(o,e+10,u),e+=14),o.set(i,e),e+=p,_)for(var E in m){var C=m[E],T=C.length;Oi(o,e,+E),Oi(o,e+2,T),o.set(C,e+4),e+=4+T}return A&&(o.set(d,e),e+=A),e},WD=function(o,e,t,i,a){Oi(o,e,101010256),Oi(o,e+8,t),Oi(o,e+10,t),Oi(o,e+12,i),Oi(o,e+16,a)};function YD(o,e){e||(e={});var t={},i=[];e1(o,"",t,e);var a=0,l=0;for(var u in t){var d=t[u],p=d[0],m=d[1],A=m.level==0?0:8,_=sf(u),b=_.length,w=m.comment,E=w&&sf(w),C=E&&E.length,T=MA(m.extra);b>65535&&kf(11);var x=A?QD(p,m):p,P=x.length,M=HD();M.p(p),i.push(ZS(m,{size:p.length,crc:M.d(),c:x,f:_,m:E,u:b!=u.length||E&&w.length!=C,o:a,compression:A})),a+=30+b+T+P,l+=76+2*(b+T)+(C||0)+P}for(var B=new Ki(l+22),D=a,G=l-a,U=0;U<i.length;++U){var _=i[U];mb(B,_.o,_,_.f,_.u,_.c.length);var V=30+_.f.length+MA(_.extra);B.set(_.c,_.o+V),mb(B,a,_,_.f,_.u,_.c.length,_.o,_.m),a+=16+V+(_.m?_.m.length:0)}return WD(B,a,i.length,G,D),B}const gb={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class Cu{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new rN(e)}),this.register(function(e){return new aN(e)}),this.register(function(e){return new uN(e)}),this.register(function(e){return new hN(e)}),this.register(function(e){return new dN(e)}),this.register(function(e){return new fN(e)}),this.register(function(e){return new oN(e)}),this.register(function(e){return new lN(e)}),this.register(function(e){return new cN(e)}),this.register(function(e){return new pN(e)}),this.register(function(e){return new mN(e)}),this.register(function(e){return new gN(e)}),this.register(function(e){return new AN(e)}),this.register(function(e){return new _N(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}setTextureUtils(e){return this.textureUtils=e,this}parse(e,t,i,a){const l=new sN,u=[];for(let d=0,p=this.pluginCallbacks.length;d<p;d++)u.push(this.pluginCallbacks[d](l));l.setPlugins(u),l.setTextureUtils(this.textureUtils),l.writeAsync(e,t,a).catch(i)}parseAsync(e,t){const i=this;return new Promise(function(a,l){i.parse(e,a,l,t)})}}const gt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Gp="KHR_mesh_quantization",Bn={};Bn[gi]=gt.NEAREST;Bn[Lu]=gt.NEAREST_MIPMAP_NEAREST;Bn[Nr]=gt.NEAREST_MIPMAP_LINEAR;Bn[wt]=gt.LINEAR;Bn[Oa]=gt.LINEAR_MIPMAP_NEAREST;Bn[hn]=gt.LINEAR_MIPMAP_LINEAR;Bn[ai]=gt.CLAMP_TO_EDGE;Bn[ds]=gt.REPEAT;Bn[qa]=gt.MIRRORED_REPEAT;const Ab={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},XD=new Ye,_b=12,KD=1179937895,JD=2,yb=8,ZD=1313821514,eN=5130562;function Qc(o,e){return o.length===e.length&&o.every(function(t,i){return t===e[i]})}function tN(o){return new TextEncoder().encode(o).buffer}function iN(o){return Qc(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function nN(o,e,t){const i={min:new Array(o.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(o.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let a=e;a<e+t;a++)for(let l=0;l<o.itemSize;l++){let u;o.itemSize>4?u=o.array[a*o.itemSize+l]:(l===0?u=o.getX(a):l===1?u=o.getY(a):l===2?u=o.getZ(a):l===3&&(u=o.getW(a)),o.normalized===!0&&(u=xl.normalize(u,o.array))),i.min[l]=Math.min(i.min[l],u),i.max[l]=Math.max(i.max[l],u)}return i}function t1(o){return Math.ceil(o/4)*4}function Hp(o,e=0){const t=t1(o.byteLength);if(t!==o.byteLength){const i=new Uint8Array(t);if(i.set(new Uint8Array(o)),e!==0)for(let a=o.byteLength;a<t;a++)i[a]=e;return i.buffer}return o}function bb(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function vb(o,e){if(o.toBlob!==void 0)return new Promise(i=>o.toBlob(i,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}let sN=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+Bf}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,t,i={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);const a=this,l=a.buffers,u=a.json;i=a.options;const d=a.extensionsUsed,p=a.extensionsRequired,m=new Blob(l,{type:"application/octet-stream"}),A=Object.keys(d),_=Object.keys(p);if(A.length>0&&(u.extensionsUsed=A),_.length>0&&(u.extensionsRequired=_),u.buffers&&u.buffers.length>0&&(u.buffers[0].byteLength=m.size),i.binary===!0){const b=new FileReader;b.readAsArrayBuffer(m),b.onloadend=function(){const w=Hp(b.result),E=new DataView(new ArrayBuffer(yb));E.setUint32(0,w.byteLength,!0),E.setUint32(4,eN,!0);const C=Hp(tN(JSON.stringify(u)),32),T=new DataView(new ArrayBuffer(yb));T.setUint32(0,C.byteLength,!0),T.setUint32(4,ZD,!0);const x=new ArrayBuffer(_b),P=new DataView(x);P.setUint32(0,KD,!0),P.setUint32(4,JD,!0);const M=_b+T.byteLength+C.byteLength+E.byteLength+w.byteLength;P.setUint32(8,M,!0);const B=new Blob([x,T,C,E,w],{type:"application/octet-stream"}),D=new FileReader;D.readAsArrayBuffer(B),D.onloadend=function(){t(D.result)}}}else if(u.buffers&&u.buffers.length>0){const b=new FileReader;b.readAsDataURL(m),b.onloadend=function(){const w=b.result;u.buffers[0].uri=w,t(u)}}else t(u)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const i=this.options,a=this.extensionsUsed;try{const l=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&l.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const u in l.gltfExtensions)t.extensions[u]=l.gltfExtensions[u],a[u]=!0;delete l.gltfExtensions}Object.keys(l).length>0&&(t.extras=l)}catch(l){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+l.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const a=new Map;a.set(!0,this.uid++),a.set(!1,this.uid++),this.uids.set(e,a)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const i=new se;for(let a=0,l=e.count;a<l;a++)if(Math.abs(i.fromBufferAttribute(e,a).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const i=e.clone(),a=new se;for(let l=0,u=i.count;l<u;l++)a.fromBufferAttribute(i,l),a.x===0&&a.y===0&&a.z===0?a.setX(1):a.normalize(),i.setXYZ(l,a.x,a.y,a.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1;const a={};(t.offset.x!==0||t.offset.y!==0)&&(a.offset=t.offset.toArray(),i=!0),t.rotation!==0&&(a.rotation=t.rotation,i=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(a.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=a,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,t){if(e===t)return e;function i(w){return w.colorSpace===Ht?function(C){return C<.04045?C*.0773993808:Math.pow(C*.9478672986+.0521327014,2.4)}:function(C){return C}}e instanceof Ua&&(e=await this.decompressTextureAsync(e)),t instanceof Ua&&(t=await this.decompressTextureAsync(t));const a=e?e.image:null,l=t?t.image:null,u=Math.max(a?a.width:0,l?l.width:0),d=Math.max(a?a.height:0,l?l.height:0),p=bb();p.width=u,p.height=d;const m=p.getContext("2d",{willReadFrequently:!0});m.fillStyle="#00ffff",m.fillRect(0,0,u,d);const A=m.getImageData(0,0,u,d);if(a){m.drawImage(a,0,0,u,d);const w=i(e),E=m.getImageData(0,0,u,d).data;for(let C=2;C<E.length;C+=4)A.data[C]=w(E[C]/256)*256}if(l){m.drawImage(l,0,0,u,d);const w=i(t),E=m.getImageData(0,0,u,d).data;for(let C=1;C<E.length;C+=4)A.data[C]=w(E[C]/256)*256}m.putImageData(A,0,0);const b=(e||t).clone();return b.source=new N0(p),b.colorSpace=Gn,b.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),b}async decompressTextureAsync(e,t=1/0){if(this.textureUtils===null)throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,t)}processBuffer(e){const t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,a,l){const u=this.json;u.bufferViews||(u.bufferViews=[]);let d;switch(t){case gt.BYTE:case gt.UNSIGNED_BYTE:d=1;break;case gt.SHORT:case gt.UNSIGNED_SHORT:d=2;break;default:d=4}let p=e.itemSize*d;l===gt.ARRAY_BUFFER&&(p=Math.ceil(p/4)*4);const m=t1(a*p),A=new DataView(new ArrayBuffer(m));let _=0;for(let E=i;E<i+a;E++){for(let C=0;C<e.itemSize;C++){let T;e.itemSize>4?T=e.array[E*e.itemSize+C]:(C===0?T=e.getX(E):C===1?T=e.getY(E):C===2?T=e.getZ(E):C===3&&(T=e.getW(E)),e.normalized===!0&&(T=xl.normalize(T,e.array))),t===gt.FLOAT?A.setFloat32(_,T,!0):t===gt.INT?A.setInt32(_,T,!0):t===gt.UNSIGNED_INT?A.setUint32(_,T,!0):t===gt.SHORT?A.setInt16(_,T,!0):t===gt.UNSIGNED_SHORT?A.setUint16(_,T,!0):t===gt.BYTE?A.setInt8(_,T):t===gt.UNSIGNED_BYTE&&A.setUint8(_,T),_+=d}_%p!==0&&(_+=p-_%p)}const b={buffer:this.processBuffer(A.buffer),byteOffset:this.byteOffset,byteLength:m};return l!==void 0&&(b.target=l),l===gt.ARRAY_BUFFER&&(b.byteStride=p),this.byteOffset+=m,u.bufferViews.push(b),{id:u.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(a){const l=new FileReader;l.readAsArrayBuffer(e),l.onloadend=function(){const u=Hp(l.result),d={buffer:t.processBuffer(u),byteOffset:t.byteOffset,byteLength:u.byteLength};t.byteOffset+=u.byteLength,a(i.bufferViews.push(d)-1)}})}processAccessor(e,t,i,a){const l=this.json,u={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let d;if(e.array.constructor===Float32Array)d=gt.FLOAT;else if(e.array.constructor===Int32Array)d=gt.INT;else if(e.array.constructor===Uint32Array)d=gt.UNSIGNED_INT;else if(e.array.constructor===Int16Array)d=gt.SHORT;else if(e.array.constructor===Uint16Array)d=gt.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)d=gt.BYTE;else if(e.array.constructor===Uint8Array)d=gt.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(i===void 0&&(i=0),(a===void 0||a===1/0)&&(a=e.count),a===0)return null;const p=nN(e,i,a);let m;t!==void 0&&(m=e===t.index?gt.ELEMENT_ARRAY_BUFFER:gt.ARRAY_BUFFER);const A=this.processBufferView(e,d,i,a,m),_={bufferView:A.id,byteOffset:A.byteOffset,componentType:d,count:a,max:p.max,min:p.min,type:u[e.itemSize]};return e.normalized===!0&&(_.normalized=!0),l.accessors||(l.accessors=[]),l.accessors.push(_)-1}processImage(e,t,i,a="image/png"){if(e!==null){const l=this,u=l.cache,d=l.json,p=l.options,m=l.pending;u.images.has(e)||u.images.set(e,{});const A=u.images.get(e),_=a+":flipY/"+i.toString();if(A[_]!==void 0)return A[_];d.images||(d.images=[]);const b={mimeType:a},w=bb();w.width=Math.min(e.width,p.maxTextureSize),w.height=Math.min(e.height,p.maxTextureSize);const E=w.getContext("2d",{willReadFrequently:!0});if(i===!0&&(E.translate(0,w.height),E.scale(1,-1)),e.data!==void 0){t!==Xt&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>p.maxTextureSize||e.height>p.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const T=new Uint8ClampedArray(e.height*e.width*4);for(let x=0;x<T.length;x+=4)T[x+0]=e.data[x+0],T[x+1]=e.data[x+1],T[x+2]=e.data[x+2],T[x+3]=e.data[x+3];E.putImageData(new ImageData(T,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)E.drawImage(e,0,0,w.width,w.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");p.binary===!0?m.push(vb(w,a).then(T=>l.processBufferViewImage(T)).then(T=>{b.bufferView=T})):w.toDataURL!==void 0?b.uri=w.toDataURL(a):m.push(vb(w,a).then(T=>new FileReader().readAsDataURL(T)).then(T=>{b.uri=T}));const C=d.images.push(b)-1;return A[_]=C,C}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const i={magFilter:Bn[e.magFilter],minFilter:Bn[e.minFilter],wrapS:Bn[e.wrapS],wrapT:Bn[e.wrapT]};return t.samplers.push(i)-1}async processTextureAsync(e){const i=this.options,a=this.cache,l=this.json;if(a.textures.has(e))return a.textures.get(e);l.textures||(l.textures=[]),e instanceof Ua&&(e=await this.decompressTextureAsync(e,i.maxTextureSize));let u=e.userData.mimeType;u==="image/webp"&&(u="image/png");const d={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,u)};e.name&&(d.name=e.name),await this._invokeAllAsync(async function(m){m.writeTexture&&await m.writeTexture(e,d)});const p=l.textures.push(d)-1;return a.textures.set(e,p),p}async processMaterialAsync(e){const t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);const a={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const l=e.color.toArray().concat([e.opacity]);if(Qc(l,[1,1,1,1])||(a.pbrMetallicRoughness.baseColorFactor=l),e.isMeshStandardMaterial?(a.pbrMetallicRoughness.metallicFactor=e.metalness,a.pbrMetallicRoughness.roughnessFactor=e.roughness):(a.pbrMetallicRoughness.metallicFactor=0,a.pbrMetallicRoughness.roughnessFactor=1),e.metalnessMap||e.roughnessMap){const d=await this.buildMetalRoughTextureAsync(e.metalnessMap,e.roughnessMap),p={index:await this.processTextureAsync(d),texCoord:d.channel};this.applyTextureTransform(p,d),a.pbrMetallicRoughness.metallicRoughnessTexture=p}if(e.map){const d={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(d,e.map),a.pbrMetallicRoughness.baseColorTexture=d}if(e.emissive){const d=e.emissive;if(Math.max(d.r,d.g,d.b)>0&&(a.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const m={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(m,e.emissiveMap),a.emissiveTexture=m}}if(e.normalMap){const d={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(d.scale=e.normalScale.x),this.applyTextureTransform(d,e.normalMap),a.normalTexture=d}if(e.aoMap){const d={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(d.strength=e.aoMapIntensity),this.applyTextureTransform(d,e.aoMap),a.occlusionTexture=d}e.transparent?a.alphaMode="BLEND":e.alphaTest>0&&(a.alphaMode="MASK",a.alphaCutoff=e.alphaTest),e.side===Ri&&(a.doubleSided=!0),e.name!==""&&(a.name=e.name),this.serializeUserData(e,a),await this._invokeAllAsync(async function(d){d.writeMaterialAsync&&await d.writeMaterialAsync(e,a)});const u=i.materials.push(a)-1;return t.materials.set(e,u),u}async processMeshAsync(e){const t=this.cache,i=this.json,a=[e.geometry.uuid];if(Array.isArray(e.material))for(let B=0,D=e.material.length;B<D;B++)a.push(e.material[B].uuid);else a.push(e.material.uuid);const l=a.join(":");if(t.meshes.has(l))return t.meshes.get(l);const u=e.geometry;let d;e.isLineSegments?d=gt.LINES:e.isLineLoop?d=gt.LINE_LOOP:e.isLine?d=gt.LINE_STRIP:e.isPoints?d=gt.POINTS:d=e.material.wireframe?gt.LINES:gt.TRIANGLES;const p={},m={},A=[],_=[],b={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},w=u.getAttribute("normal");w!==void 0&&!this.isNormalizedNormalAttribute(w)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),u.setAttribute("normal",this.createNormalizedNormalAttribute(w)));let E=null;for(let B in u.attributes){if(B.slice(0,5)==="morph")continue;const D=u.attributes[B];if(B=b[B]||B.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(B)||(B="_"+B),t.attributes.has(this.getUID(D))){m[B]=t.attributes.get(this.getUID(D));continue}E=null;const U=D.array;B==="JOINTS_0"&&!(U instanceof Uint16Array)&&!(U instanceof Uint8Array)?(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),E=new Vt(new Uint16Array(U),D.itemSize,D.normalized)):(U instanceof Uint32Array||U instanceof Int32Array)&&!B.startsWith("_")&&(console.warn(`GLTFExporter: Attribute "${B}" converted to type FLOAT.`),E=Cu.Utils.toFloat32BufferAttribute(D));const V=this.processAccessor(E||D,u);V!==null&&(B.startsWith("_")||this.detectMeshQuantization(B,D),m[B]=V,t.attributes.set(this.getUID(D),V))}if(w!==void 0&&u.setAttribute("normal",w),Object.keys(m).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const B=[],D=[],G={};if(e.morphTargetDictionary!==void 0)for(const U in e.morphTargetDictionary)G[e.morphTargetDictionary[U]]=U;for(let U=0;U<e.morphTargetInfluences.length;++U){const V={};let k=!1;for(const z in u.morphAttributes){if(z!=="position"&&z!=="normal"){k||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),k=!0);continue}const Q=u.morphAttributes[z][U],Z=z.toUpperCase(),K=u.attributes[z];if(t.attributes.has(this.getUID(Q,!0))){V[Z]=t.attributes.get(this.getUID(Q,!0));continue}const s=Q.clone();if(!u.morphTargetsRelative)for(let H=0,y=Q.count;H<y;H++)for(let ee=0;ee<Q.itemSize;ee++)ee===0&&s.setX(H,Q.getX(H)-K.getX(H)),ee===1&&s.setY(H,Q.getY(H)-K.getY(H)),ee===2&&s.setZ(H,Q.getZ(H)-K.getZ(H)),ee===3&&s.setW(H,Q.getW(H)-K.getW(H));V[Z]=this.processAccessor(s,u),t.attributes.set(this.getUID(K,!0),V[Z])}_.push(V),B.push(e.morphTargetInfluences[U]),e.morphTargetDictionary!==void 0&&D.push(G[U])}p.weights=B,D.length>0&&(p.extras={},p.extras.targetNames=D)}const C=Array.isArray(e.material);if(C&&u.groups.length===0)return null;let T=!1;if(C&&u.index===null){const B=[];for(let D=0,G=u.attributes.position.count;D<G;D++)B[D]=D;u.setIndex(B),T=!0}const x=C?e.material:[e.material],P=C?u.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let B=0,D=P.length;B<D;B++){const G={mode:d,attributes:m};if(this.serializeUserData(u,G),_.length>0&&(G.targets=_),u.index!==null){let V=this.getUID(u.index);(P[B].start!==void 0||P[B].count!==void 0)&&(V+=":"+P[B].start+":"+P[B].count),t.attributes.has(V)?G.indices=t.attributes.get(V):(G.indices=this.processAccessor(u.index,u,P[B].start,P[B].count),t.attributes.set(V,G.indices)),G.indices===null&&delete G.indices}const U=await this.processMaterialAsync(x[P[B].materialIndex]);U!==null&&(G.material=U),A.push(G)}T===!0&&u.setIndex(null),p.primitives=A,i.meshes||(i.meshes=[]),await this._invokeAllAsync(function(B){B.writeMesh&&B.writeMesh(e,p)});const M=i.meshes.push(p)-1;return t.meshes.set(l,M),M}detectMeshQuantization(e,t){if(this.extensionsUsed[Gp])return;let i;switch(t.array.constructor){case Int8Array:i="byte";break;case Uint8Array:i="unsigned byte";break;case Int16Array:i="short";break;case Uint16Array:i="unsigned short";break;default:return}t.normalized&&(i+=" normalized");const a=e.split("_",1)[0];gb[a]&&gb[a].includes(i)&&(this.extensionsUsed[Gp]=!0,this.extensionsRequired[Gp]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const i=e.isOrthographicCamera,a={type:i?"orthographic":"perspective"};return i?a.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:a.perspective={aspectRatio:e.aspect,yfov:xl.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(a.name=e.type),t.cameras.push(a)-1}processAnimation(e,t){const i=this.json,a=this.nodeMap;i.animations||(i.animations=[]),e=Cu.Utils.mergeMorphTargetTracks(e.clone(),t);const l=e.tracks,u=[],d=[];for(let p=0;p<l.length;++p){const m=l[p],A=xt.parseTrackName(m.name);let _=xt.findNode(t,A.nodeName);const b=Ab[A.propertyName];if(A.objectName==="bones"&&(_.isSkinnedMesh===!0?_=_.skeleton.getBoneByName(A.objectIndex):_=void 0),!_||!b){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',m.name);continue}const w=1;let E=m.values.length/m.times.length;b===Ab.morphTargetInfluences&&(E/=_.morphTargetInfluences.length);let C;m.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(C="CUBICSPLINE",E/=3):m.getInterpolation()===vl?C="STEP":C="LINEAR",d.push({input:this.processAccessor(new Vt(m.times,w)),output:this.processAccessor(new Vt(m.values,E)),interpolation:C}),u.push({sampler:d.length-1,target:{node:a.get(_),path:b}})}return i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:d,channels:u}),i.animations.length-1}processSkin(e){const t=this.json,i=this.nodeMap,a=t.nodes[i.get(e)],l=e.skeleton;if(l===void 0)return null;const u=e.skeleton.bones[0];if(u===void 0)return null;const d=[],p=new Float32Array(l.bones.length*16),m=new tt;for(let _=0;_<l.bones.length;++_)d.push(i.get(l.bones[_])),m.copy(l.boneInverses[_]),m.multiply(e.bindMatrix).toArray(p,_*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new Vt(p,16)),joints:d,skeleton:i.get(u)}),a.skin=t.skins.length-1}async processNodeAsync(e){const t=this.json,i=this.options,a=this.nodeMap;t.nodes||(t.nodes=[]);const l={};if(i.trs){const d=e.quaternion.toArray(),p=e.position.toArray(),m=e.scale.toArray();Qc(d,[0,0,0,1])||(l.rotation=d),Qc(p,[0,0,0])||(l.translation=p),Qc(m,[1,1,1])||(l.scale=m)}else e.matrixAutoUpdate&&e.updateMatrix(),iN(e.matrix)===!1&&(l.matrix=e.matrix.elements);if(e.name!==""&&(l.name=String(e.name)),this.serializeUserData(e,l),e.isMesh||e.isLine||e.isPoints){const d=await this.processMeshAsync(e);d!==null&&(l.mesh=d)}else e.isCamera&&(l.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const d=[];for(let p=0,m=e.children.length;p<m;p++){const A=e.children[p];if(A.visible||i.onlyVisible===!1){const _=await this.processNodeAsync(A);_!==null&&d.push(_)}}d.length>0&&(l.children=d)}await this._invokeAllAsync(function(d){d.writeNode&&d.writeNode(e,l)});const u=t.nodes.push(l)-1;return a.set(e,u),u}async processSceneAsync(e){const t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);const a={};e.name!==""&&(a.name=e.name),t.scenes.push(a);const l=[];for(let u=0,d=e.children.length;u<d;u++){const p=e.children[u];if(p.visible||i.onlyVisible===!1){const m=await this.processNodeAsync(p);m!==null&&l.push(m)}}l.length>0&&(a.nodes=l),this.serializeUserData(e,a)}async processObjectsAsync(e){const t=new Wr;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);await this.processSceneAsync(t)}async processInputAsync(e){const t=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(a){a.beforeParse&&a.beforeParse(e)});const i=[];for(let a=0;a<e.length;a++)e[a]instanceof Wr?await this.processSceneAsync(e[a]):i.push(e[a]);i.length>0&&await this.processObjectsAsync(i);for(let a=0;a<this.skins.length;++a)this.processSkin(this.skins[a]);for(let a=0;a<t.animations.length;++a)this.processAnimation(t.animations[a],e[0]);await this._invokeAllAsync(function(a){a.afterParse&&a.afterParse(e)})}async _invokeAllAsync(e){for(let t=0,i=this.plugins.length;t<i;t++)await e(this.plugins[t])}};class rN{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const i=this.writer,a=i.json,l=i.extensionsUsed,u={};e.name&&(u.name=e.name),u.color=e.color.toArray(),u.intensity=e.intensity,e.isDirectionalLight?u.type="directional":e.isPointLight?(u.type="point",e.distance>0&&(u.range=e.distance)):e.isSpotLight&&(u.type="spot",e.distance>0&&(u.range=e.distance),u.spot={},u.spot.innerConeAngle=(1-e.penumbra)*e.angle,u.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),l[this.name]||(a.extensions=a.extensions||{},a.extensions[this.name]={lights:[]},l[this.name]=!0);const d=a.extensions[this.name].lights;d.push(u),t.extensions=t.extensions||{},t.extensions[this.name]={light:d.length-1}}}let aN=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,t){if(!e.isMeshBasicMaterial)return;const a=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},a[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},oN=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const i=this.writer,a=i.extensionsUsed,l={};if(l.clearcoatFactor=e.clearcoat,e.clearcoatMap){const u={index:await i.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};i.applyTextureTransform(u,e.clearcoatMap),l.clearcoatTexture=u}if(l.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const u={index:await i.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};i.applyTextureTransform(u,e.clearcoatRoughnessMap),l.clearcoatRoughnessTexture=u}if(e.clearcoatNormalMap){const u={index:await i.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(u.scale=e.clearcoatNormalScale.x),i.applyTextureTransform(u,e.clearcoatNormalMap),l.clearcoatNormalTexture=u}t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},lN=class{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const a=this.writer.extensionsUsed,l={};l.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},cN=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const i=this.writer,a=i.extensionsUsed,l={};if(l.iridescenceFactor=e.iridescence,e.iridescenceMap){const u={index:await i.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};i.applyTextureTransform(u,e.iridescenceMap),l.iridescenceTexture=u}if(l.iridescenceIor=e.iridescenceIOR,l.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],l.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const u={index:await i.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};i.applyTextureTransform(u,e.iridescenceThicknessMap),l.iridescenceThicknessTexture=u}t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},uN=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,a=i.extensionsUsed,l={};if(l.transmissionFactor=e.transmission,e.transmissionMap){const u={index:await i.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};i.applyTextureTransform(u,e.transmissionMap),l.transmissionTexture=u}t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},hN=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,a=i.extensionsUsed,l={};if(l.thicknessFactor=e.thickness,e.thicknessMap){const u={index:await i.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};i.applyTextureTransform(u,e.thicknessMap),l.thicknessTexture=u}e.attenuationDistance!==1/0&&(l.attenuationDistance=e.attenuationDistance),l.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},dN=class{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const a=this.writer.extensionsUsed,l={};l.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},fN=class{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(XD)&&!e.specularIntensityMap&&!e.specularColorMap)return;const i=this.writer,a=i.extensionsUsed,l={};if(e.specularIntensityMap){const u={index:await i.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};i.applyTextureTransform(u,e.specularIntensityMap),l.specularTexture=u}if(e.specularColorMap){const u={index:await i.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};i.applyTextureTransform(u,e.specularColorMap),l.specularColorTexture=u}l.specularFactor=e.specularIntensity,l.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},pN=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const i=this.writer,a=i.extensionsUsed,l={};if(e.sheenRoughnessMap){const u={index:await i.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};i.applyTextureTransform(u,e.sheenRoughnessMap),l.sheenRoughnessTexture=u}if(e.sheenColorMap){const u={index:await i.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};i.applyTextureTransform(u,e.sheenColorMap),l.sheenColorTexture=u}l.sheenRoughnessFactor=e.sheenRoughness,l.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},mN=class{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const i=this.writer,a=i.extensionsUsed,l={};if(e.anisotropyMap){const u={index:await i.processTextureAsync(e.anisotropyMap)};i.applyTextureTransform(u,e.anisotropyMap),l.anisotropyTexture=u}l.anisotropyStrength=e.anisotropy,l.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},gN=class{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const a=this.writer.extensionsUsed,l={};l.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},AN=class{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const i=this.writer,a=i.extensionsUsed,l={};if(e.bumpMap){const u={index:await i.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};i.applyTextureTransform(u,e.bumpMap),l.bumpTexture=u}l.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},_N=class{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const i=this.writer,a=e,l=new Float32Array(a.count*3),u=new Float32Array(a.count*4),d=new Float32Array(a.count*3),p=new tt,m=new se,A=new Yi,_=new se;for(let w=0;w<a.count;w++)a.getMatrixAt(w,p),p.decompose(m,A,_),m.toArray(l,w*3),A.toArray(u,w*4),_.toArray(d,w*3);const b={TRANSLATION:i.processAccessor(new Vt(l,3)),ROTATION:i.processAccessor(new Vt(u,4)),SCALE:i.processAccessor(new Vt(d,3))};a.instanceColor&&(b._COLOR_0=i.processAccessor(a.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:b},i.extensionsUsed[this.name]=!0,i.extensionsRequired[this.name]=!0}};Cu.Utils={insertKeyframe:function(o,e){const i=o.getValueSize(),a=new o.TimeBufferType(o.times.length+1),l=new o.ValueBufferType(o.values.length+i),u=o.createInterpolant(new o.ValueBufferType(i));let d;if(o.times.length===0){a[0]=e;for(let p=0;p<i;p++)l[p]=0;d=0}else if(e<o.times[0]){if(Math.abs(o.times[0]-e)<.001)return 0;a[0]=e,a.set(o.times,1),l.set(u.evaluate(e),0),l.set(o.values,i),d=0}else if(e>o.times[o.times.length-1]){if(Math.abs(o.times[o.times.length-1]-e)<.001)return o.times.length-1;a[a.length-1]=e,a.set(o.times,0),l.set(o.values,0),l.set(u.evaluate(e),o.values.length),d=a.length-1}else for(let p=0;p<o.times.length;p++){if(Math.abs(o.times[p]-e)<.001)return p;if(o.times[p]<e&&o.times[p+1]>e){a.set(o.times.slice(0,p+1),0),a[p+1]=e,a.set(o.times.slice(p+1),p+2),l.set(o.values.slice(0,(p+1)*i),0),l.set(u.evaluate(e),(p+1)*i),l.set(o.values.slice((p+1)*i),(p+2)*i),d=p+1;break}}return o.times=a,o.values=l,d},mergeMorphTargetTracks:function(o,e){const t=[],i={},a=o.tracks;for(let l=0;l<a.length;++l){let u=a[l];const d=xt.parseTrackName(u.name),p=xt.findNode(e,d.nodeName);if(d.propertyName!=="morphTargetInfluences"||d.propertyIndex===void 0){t.push(u);continue}if(u.createInterpolant!==u.InterpolantFactoryMethodDiscrete&&u.createInterpolant!==u.InterpolantFactoryMethodLinear){if(u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),u=u.clone(),u.setInterpolation(wl)}const m=p.morphTargetInfluences.length,A=p.morphTargetDictionary[d.propertyIndex];if(A===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+d.propertyIndex);let _;if(i[p.uuid]===void 0){_=u.clone();const w=new _.ValueBufferType(m*_.times.length);for(let E=0;E<_.times.length;E++)w[E*m+A]=_.values[E];_.name=(d.nodeName||"")+".morphTargetInfluences",_.values=w,i[p.uuid]=_,t.push(_);continue}const b=u.createInterpolant(new u.ValueBufferType(1));_=i[p.uuid];for(let w=0;w<_.times.length;w++)_.values[w*m+A]=b.evaluate(_.times[w]);for(let w=0;w<u.times.length;w++){const E=this.insertKeyframe(_,u.times[w]);_.values[E*m+A]=u.values[w]}}return o.tracks=t,o},toFloat32BufferAttribute:function(o){const e=new Vt(new Float32Array(o.count*o.itemSize),o.itemSize,!1);if(!o.normalized&&!o.isInterleavedBufferAttribute)return e.array.set(o.array),e;for(let t=0,i=o.count;t<i;t++)for(let a=0;a<o.itemSize;a++)e.setComponent(t,a,o.getComponent(t,a));return e}};const yN=0,wb=2,bN=1,Eb=2,vN=0,wN=1,EN=10,xN=0,i1=9,n1=15,s1=16,r1=22,a1=37,o1=43,l1=76,c1=83,u1=97,h1=100,d1=103,f1=109,p1=165,m1=166,Z0=1000066e3;class SN{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Ac{constructor(e,t,i,a){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,i),this._littleEndian=a,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t){t===void 0&&(t=0);const i=this._offset;let a=0;for(;this._dataView.getUint8(this._offset)!==t&&a<e;)a++,this._offset++;return a<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,a)}}const nn=[171,75,84,88,32,50,48,187,13,10,26,10];function xb(o){return new TextDecoder().decode(o)}function CN(o){const e=new Uint8Array(o.buffer,o.byteOffset,nn.length);if(e[0]!==nn[0]||e[1]!==nn[1]||e[2]!==nn[2]||e[3]!==nn[3]||e[4]!==nn[4]||e[5]!==nn[5]||e[6]!==nn[6]||e[7]!==nn[7]||e[8]!==nn[8]||e[9]!==nn[9]||e[10]!==nn[10]||e[11]!==nn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new SN,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new Ac(o,nn.length,i,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32();const l=a._nextUint32();t.supercompressionScheme=a._nextUint32();const u=a._nextUint32(),d=a._nextUint32(),p=a._nextUint32(),m=a._nextUint32(),A=a._nextUint64(),_=a._nextUint64(),b=new Ac(o,nn.length+i,3*l*8,!0);for(let ee=0;ee<l;ee++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const w=new Ac(o,u,d,!0),E={vendorId:w._skip(4)._nextUint16(),descriptorType:w._nextUint16(),versionNumber:w._nextUint16(),descriptorBlockSize:w._nextUint16(),colorModel:w._nextUint8(),colorPrimaries:w._nextUint8(),transferFunction:w._nextUint8(),flags:w._nextUint8(),texelBlockDimension:[w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8()],bytesPlane:[w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8()],samples:[]},C=(E.descriptorBlockSize/4-6)/4;for(let ee=0;ee<C;ee++){const I={bitOffset:w._nextUint16(),bitLength:w._nextUint8(),channelType:w._nextUint8(),samplePosition:[w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&I.channelType?(I.sampleLower=w._nextInt32(),I.sampleUpper=w._nextInt32()):(I.sampleLower=w._nextUint32(),I.sampleUpper=w._nextUint32()),E.samples[ee]=I}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const T=new Ac(o,p,m,!0);for(;T._offset<m;){const ee=T._nextUint32(),I=T._scan(ee),re=xb(I);if(t.keyValue[re]=T._nextUint8Array(ee-I.byteLength-1),re.match(/^ktx/i)){const Ae=xb(t.keyValue[re]);t.keyValue[re]=Ae.substring(0,Ae.lastIndexOf("\0"))}T._skip(ee%4?4-ee%4:0)}if(_<=0)return t;const x=new Ac(o,A,_,!0),P=x._nextUint16(),M=x._nextUint16(),B=x._nextUint32(),D=x._nextUint32(),G=x._nextUint32(),U=x._nextUint32(),V=[];for(let ee=0;ee<l;ee++)V.push({imageFlags:x._nextUint32(),rgbSliceByteOffset:x._nextUint32(),rgbSliceByteLength:x._nextUint32(),alphaSliceByteOffset:x._nextUint32(),alphaSliceByteLength:x._nextUint32()});const k=A+x._offset,z=k+B,Q=z+D,Z=Q+G,K=new Uint8Array(o.buffer,o.byteOffset+k,B),s=new Uint8Array(o.buffer,o.byteOffset+z,D),H=new Uint8Array(o.buffer,o.byteOffset+Q,G),y=new Uint8Array(o.buffer,o.byteOffset+Z,U);return t.globalData={endpointCount:P,selectorCount:M,imageDescs:V,endpointsData:K,selectorsData:s,tablesData:H,extendedData:y},t}class g1{constructor(){this.textureUtils=null}setTextureUtils(e){this.textureUtils=e}parse(e,t,i,a){this.parseAsync(e,a).then(t).catch(i)}async parseAsync(e,t={}){t=Object.assign({ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:"horizontal"}},includeAnchoringProperties:!0,quickLookCompatible:!1,maxTextureSize:1024},t);const i={},a="model.usda";i[a]=null;let l=A1();l+=IN(t);const u={},d={};e.traverseVisible(m=>{if(m.isMesh){const A=m.geometry,_=m.material;if(_.isMeshStandardMaterial){const b="geometries/Geometry_"+A.id+".usda";if(!(b in i)){const w=PN(A);i[b]=RN(w)}_.uuid in u||(u[_.uuid]=_),l+=BN(m,A,_)}else console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m)}else m.isCamera&&(l+=zN(m))}),l+=MN(),l+=UN(u,d,t.quickLookCompatible),i[a]=sf(l),l=null;for(const m in d){let A=d[m];if(A.isCompressedTexture===!0){if(this.textureUtils===null)throw new Error("THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.");A=await this.textureUtils.decompress(A)}const _=TN(A.image,A.flipY,t.maxTextureSize),b=await new Promise(w=>_.toBlob(w,"image/png",1));i[`textures/Texture_${m}.png`]=new Uint8Array(await b.arrayBuffer())}let p=0;for(const m in i){const A=i[m],_=34+m.length;p+=_;const b=p&63;if(b!==4){const w=64-b,E=new Uint8Array(w);i[m]=[A,{extra:{12345:E}}]}p=A.length}return YD(i,{level:0})}}function TN(o,e,t){if(typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&o instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&o instanceof ImageBitmap){const i=t/Math.max(o.width,o.height),a=document.createElement("canvas");a.width=o.width*Math.min(1,i),a.height=o.height*Math.min(1,i);const l=a.getContext("2d");return e===!0&&(l.translate(0,a.height),l.scale(1,-1)),l.drawImage(o,0,0,a.width,a.height),a}else throw new Error("THREE.USDZExporter: No valid image data found. Unable to process texture.")}const Wi=7;function A1(){return`#usda 1.0
|
|
3905
|
+
*/var Ki=Uint8Array,Rn=Uint16Array,X0=Int32Array,K0=new Ki([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),J0=new Ki([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ub=new Ki([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qS=function(o,e){for(var t=new Rn(31),i=0;i<31;++i)t[i]=e+=1<<o[i-1];for(var a=new X0(t[30]),i=1;i<30;++i)for(var l=t[i];l<t[i+1];++l)a[l]=l-t[i]<<5|i;return{b:t,r:a}},WS=qS(K0,2),ND=WS.b,CA=WS.r;ND[28]=258,CA[258]=28;var OD=qS(J0,0),hb=OD.r,TA=new Rn(32768);for(var Yt=0;Yt<32768;++Yt){var br=(Yt&43690)>>1|(Yt&21845)<<1;br=(br&52428)>>2|(br&13107)<<2,br=(br&61680)>>4|(br&3855)<<4,TA[Yt]=((br&65280)>>8|(br&255)<<8)>>1}var uu=(function(o,e,t){for(var i=o.length,a=0,l=new Rn(e);a<i;++a)o[a]&&++l[o[a]-1];var u=new Rn(e);for(a=1;a<e;++a)u[a]=u[a-1]+l[a-1]<<1;var d;if(t){d=new Rn(1<<e);var p=15-e;for(a=0;a<i;++a)if(o[a])for(var m=a<<4|o[a],A=e-o[a],_=u[o[a]-1]++<<A,b=_|(1<<A)-1;_<=b;++_)d[TA[_]>>p]=m}else for(d=new Rn(i),a=0;a<i;++a)o[a]&&(d[a]=TA[u[o[a]-1]++]>>15-o[a]);return d}),Wa=new Ki(288);for(var Yt=0;Yt<144;++Yt)Wa[Yt]=8;for(var Yt=144;Yt<256;++Yt)Wa[Yt]=9;for(var Yt=256;Yt<280;++Yt)Wa[Yt]=7;for(var Yt=280;Yt<288;++Yt)Wa[Yt]=8;var nf=new Ki(32);for(var Yt=0;Yt<32;++Yt)nf[Yt]=5;var kD=uu(Wa,9,0),UD=uu(nf,5,0),YS=function(o){return(o+7)/8|0},XS=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new Ki(o.subarray(e,t))},FD=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],kf=function(o,e,t){var i=new Error(e||FD[o]);if(i.code=o,Error.captureStackTrace&&Error.captureStackTrace(i,kf),!t)throw i;return i},Hs=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8},mc=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8,o[i+2]|=t>>16},zp=function(o,e){for(var t=[],i=0;i<o.length;++i)o[i]&&t.push({s:i,f:o[i]});var a=t.length,l=t.slice();if(!a)return{t:JS,l:0};if(a==1){var u=new Ki(t[0].s+1);return u[t[0].s]=1,{t:u,l:1}}t.sort(function(D,G){return D.f-G.f}),t.push({s:-1,f:25001});var d=t[0],p=t[1],m=0,A=1,_=2;for(t[0]={s:-1,f:d.f+p.f,l:d,r:p};A!=a-1;)d=t[t[m].f<t[_].f?m++:_++],p=t[m!=A&&t[m].f<t[_].f?m++:_++],t[A++]={s:-1,f:d.f+p.f,l:d,r:p};for(var b=l[0].s,i=1;i<a;++i)l[i].s>b&&(b=l[i].s);var w=new Rn(b+1),E=IA(t[A-1],w,0);if(E>e){var i=0,C=0,T=E-e,x=1<<T;for(l.sort(function(G,U){return w[U.s]-w[G.s]||G.f-U.f});i<a;++i){var P=l[i].s;if(w[P]>e)C+=x-(1<<E-w[P]),w[P]=e;else break}for(C>>=T;C>0;){var M=l[i].s;w[M]<e?C-=1<<e-w[M]++-1:++i}for(;i>=0&&C;--i){var B=l[i].s;w[B]==e&&(--w[B],++C)}E=e}return{t:new Ki(w),l:E}},IA=function(o,e,t){return o.s==-1?Math.max(IA(o.l,e,t+1),IA(o.r,e,t+1)):e[o.s]=t},db=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new Rn(++e),i=0,a=o[0],l=1,u=function(p){t[i++]=p},d=1;d<=e;++d)if(o[d]==a&&d!=e)++l;else{if(!a&&l>2){for(;l>138;l-=138)u(32754);l>2&&(u(l>10?l-11<<5|28690:l-3<<5|12305),l=0)}else if(l>3){for(u(a),--l;l>6;l-=6)u(8304);l>2&&(u(l-3<<5|8208),l=0)}for(;l--;)u(a);l=1,a=o[d]}return{c:t.subarray(0,i),n:e}},gc=function(o,e){for(var t=0,i=0;i<e.length;++i)t+=o[i]*e[i];return t},KS=function(o,e,t){var i=t.length,a=YS(e+2);o[a]=i&255,o[a+1]=i>>8,o[a+2]=o[a]^255,o[a+3]=o[a+1]^255;for(var l=0;l<i;++l)o[a+l+4]=t[l];return(a+4+i)*8},fb=function(o,e,t,i,a,l,u,d,p,m,A){Hs(e,A++,t),++a[256];for(var _=zp(a,15),b=_.t,w=_.l,E=zp(l,15),C=E.t,T=E.l,x=db(b),P=x.c,M=x.n,B=db(C),D=B.c,G=B.n,U=new Rn(19),V=0;V<P.length;++V)++U[P[V]&31];for(var V=0;V<D.length;++V)++U[D[V]&31];for(var k=zp(U,7),z=k.t,Q=k.l,Z=19;Z>4&&!z[ub[Z-1]];--Z);var K=m+5<<3,s=gc(a,Wa)+gc(l,nf)+u,H=gc(a,b)+gc(l,C)+u+14+3*Z+gc(U,z)+2*U[16]+3*U[17]+7*U[18];if(p>=0&&K<=s&&K<=H)return KS(e,A,o.subarray(p,p+m));var y,ee,I,re;if(Hs(e,A,1+(H<s)),A+=2,H<s){y=uu(b,w,0),ee=b,I=uu(C,T,0),re=C;var Ae=uu(z,Q,0);Hs(e,A,M-257),Hs(e,A+5,G-1),Hs(e,A+10,Z-4),A+=14;for(var V=0;V<Z;++V)Hs(e,A+3*V,z[ub[V]]);A+=3*Z;for(var N=[P,D],n=0;n<2;++n)for(var r=N[n],V=0;V<r.length;++V){var c=r[V]&31;Hs(e,A,Ae[c]),A+=z[c],c>15&&(Hs(e,A,r[V]>>5&127),A+=r[V]>>12)}}else y=kD,ee=Wa,I=UD,re=nf;for(var V=0;V<d;++V){var h=i[V];if(h>255){var c=h>>18&31;mc(e,A,y[c+257]),A+=ee[c+257],c>7&&(Hs(e,A,h>>23&31),A+=K0[c]);var f=h&31;mc(e,A,I[f]),A+=re[f],f>3&&(mc(e,A,h>>5&8191),A+=J0[f])}else mc(e,A,y[h]),A+=ee[h]}return mc(e,A,y[256]),A+ee[256]},$D=new X0([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),JS=new Ki(0),zD=function(o,e,t,i,a,l){var u=l.z||o.length,d=new Ki(i+u+5*(1+Math.ceil(u/7e3))+a),p=d.subarray(i,d.length-a),m=l.l,A=(l.r||0)&7;if(e){A&&(p[0]=l.r>>3);for(var _=$D[e-1],b=_>>13,w=_&8191,E=(1<<t)-1,C=l.p||new Rn(32768),T=l.h||new Rn(E+1),x=Math.ceil(t/3),P=2*x,M=function(O){return(o[O]^o[O+1]<<x^o[O+2]<<P)&E},B=new X0(25e3),D=new Rn(288),G=new Rn(32),U=0,V=0,k=l.i||0,z=0,Q=l.w||0,Z=0;k+2<u;++k){var K=M(k),s=k&32767,H=T[K];if(C[s]=H,T[K]=s,Q<=k){var y=u-k;if((U>7e3||z>24576)&&(y>423||!m)){A=fb(o,p,0,B,D,G,V,z,Z,k-Z,A),z=U=V=0,Z=k;for(var ee=0;ee<286;++ee)D[ee]=0;for(var ee=0;ee<30;++ee)G[ee]=0}var I=2,re=0,Ae=w,N=s-H&32767;if(y>2&&K==M(k-N))for(var n=Math.min(b,y)-1,r=Math.min(32767,k),c=Math.min(258,y);N<=r&&--Ae&&s!=H;){if(o[k+I]==o[k+I-N]){for(var h=0;h<c&&o[k+h]==o[k+h-N];++h);if(h>I){if(I=h,re=N,h>n)break;for(var f=Math.min(N,h-2),g=0,ee=0;ee<f;++ee){var v=k-N+ee&32767,S=C[v],R=v-S&32767;R>g&&(g=R,H=v)}}}s=H,H=C[s],N+=s-H&32767}if(re){B[z++]=268435456|CA[I]<<18|hb[re];var L=CA[I]&31,F=hb[re]&31;V+=K0[L]+J0[F],++D[257+L],++G[F],Q=k+I,++U}else B[z++]=o[k],++D[o[k]]}}for(k=Math.max(k,Q);k<u;++k)B[z++]=o[k],++D[o[k]];A=fb(o,p,m,B,D,G,V,z,Z,k-Z,A),m||(l.r=A&7|p[A/8|0]<<3,A-=7,l.h=T,l.p=C,l.i=k,l.w=Q)}else{for(var k=l.w||0;k<u+m;k+=65535){var $=k+65535;$>=u&&(p[A/8|0]=m,$=u),A=KS(p,A+1,o.subarray(k,$))}l.i=u}return XS(d,0,i+YS(A)+a)},GD=(function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o})(),HD=function(){var o=-1;return{p:function(e){for(var t=o,i=0;i<e.length;++i)t=GD[t&255^e[i]]^t>>>8;o=t},d:function(){return~o}}},VD=function(o,e,t,i,a){if(!a&&(a={l:1},e.dictionary)){var l=e.dictionary.subarray(-32768),u=new Ki(l.length+o.length);u.set(l),u.set(o,l.length),o=u,a.w=l.length}return zD(o,e.level==null?6:e.level,e.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(o.length)))*1.5):20:12+e.mem,t,i,a)},ZS=function(o,e){var t={};for(var i in o)t[i]=o[i];for(var i in e)t[i]=e[i];return t},Oi=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8};function QD(o,e){return VD(o,e||{},0,0)}var e1=function(o,e,t,i){for(var a in o){var l=o[a],u=e+a,d=i;Array.isArray(l)&&(d=ZS(i,l[1]),l=l[0]),l instanceof Ki?t[u]=[l,d]:(t[u+="/"]=[new Ki(0),d],e1(l,u,t,i))}},pb=typeof TextEncoder<"u"&&new TextEncoder,jD=typeof TextDecoder<"u"&&new TextDecoder,qD=0;try{jD.decode(JS,{stream:!0}),qD=1}catch{}function sf(o,e){var t;if(pb)return pb.encode(o);for(var i=o.length,a=new Ki(o.length+(o.length>>1)),l=0,u=function(m){a[l++]=m},t=0;t<i;++t){if(l+5>a.length){var d=new Ki(l+8+(i-t<<1));d.set(a),a=d}var p=o.charCodeAt(t);p<128||e?u(p):p<2048?(u(192|p>>6),u(128|p&63)):p>55295&&p<57344?(p=65536+(p&1047552)|o.charCodeAt(++t)&1023,u(240|p>>18),u(128|p>>12&63),u(128|p>>6&63),u(128|p&63)):(u(224|p>>12),u(128|p>>6&63),u(128|p&63))}return XS(a,0,l)}var MA=function(o){var e=0;if(o)for(var t in o){var i=o[t].length;i>65535&&kf(9),e+=i+4}return e},mb=function(o,e,t,i,a,l,u,d){var p=i.length,m=t.extra,A=d&&d.length,_=MA(m);Oi(o,e,u!=null?33639248:67324752),e+=4,u!=null&&(o[e++]=20,o[e++]=t.os),o[e]=20,e+=2,o[e++]=t.flag<<1|(l<0&&8),o[e++]=a&&8,o[e++]=t.compression&255,o[e++]=t.compression>>8;var b=new Date(t.mtime==null?Date.now():t.mtime),w=b.getFullYear()-1980;if((w<0||w>119)&&kf(10),Oi(o,e,w<<25|b.getMonth()+1<<21|b.getDate()<<16|b.getHours()<<11|b.getMinutes()<<5|b.getSeconds()>>1),e+=4,l!=-1&&(Oi(o,e,t.crc),Oi(o,e+4,l<0?-l-2:l),Oi(o,e+8,t.size)),Oi(o,e+12,p),Oi(o,e+14,_),e+=16,u!=null&&(Oi(o,e,A),Oi(o,e+6,t.attrs),Oi(o,e+10,u),e+=14),o.set(i,e),e+=p,_)for(var E in m){var C=m[E],T=C.length;Oi(o,e,+E),Oi(o,e+2,T),o.set(C,e+4),e+=4+T}return A&&(o.set(d,e),e+=A),e},WD=function(o,e,t,i,a){Oi(o,e,101010256),Oi(o,e+8,t),Oi(o,e+10,t),Oi(o,e+12,i),Oi(o,e+16,a)};function YD(o,e){e||(e={});var t={},i=[];e1(o,"",t,e);var a=0,l=0;for(var u in t){var d=t[u],p=d[0],m=d[1],A=m.level==0?0:8,_=sf(u),b=_.length,w=m.comment,E=w&&sf(w),C=E&&E.length,T=MA(m.extra);b>65535&&kf(11);var x=A?QD(p,m):p,P=x.length,M=HD();M.p(p),i.push(ZS(m,{size:p.length,crc:M.d(),c:x,f:_,m:E,u:b!=u.length||E&&w.length!=C,o:a,compression:A})),a+=30+b+T+P,l+=76+2*(b+T)+(C||0)+P}for(var B=new Ki(l+22),D=a,G=l-a,U=0;U<i.length;++U){var _=i[U];mb(B,_.o,_,_.f,_.u,_.c.length);var V=30+_.f.length+MA(_.extra);B.set(_.c,_.o+V),mb(B,a,_,_.f,_.u,_.c.length,_.o,_.m),a+=16+V+(_.m?_.m.length:0)}return WD(B,a,i.length,G,D),B}const gb={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class Cu{constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new rN(e)}),this.register(function(e){return new aN(e)}),this.register(function(e){return new uN(e)}),this.register(function(e){return new hN(e)}),this.register(function(e){return new dN(e)}),this.register(function(e){return new fN(e)}),this.register(function(e){return new oN(e)}),this.register(function(e){return new lN(e)}),this.register(function(e){return new cN(e)}),this.register(function(e){return new pN(e)}),this.register(function(e){return new mN(e)}),this.register(function(e){return new gN(e)}),this.register(function(e){return new AN(e)}),this.register(function(e){return new _N(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}setTextureUtils(e){return this.textureUtils=e,this}parse(e,t,i,a){const l=new sN,u=[];for(let d=0,p=this.pluginCallbacks.length;d<p;d++)u.push(this.pluginCallbacks[d](l));l.setPlugins(u),l.setTextureUtils(this.textureUtils),l.writeAsync(e,t,a).catch(i)}parseAsync(e,t){const i=this;return new Promise(function(a,l){i.parse(e,a,l,t)})}}const At={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Gp="KHR_mesh_quantization",Bn={};Bn[gi]=At.NEAREST;Bn[Lu]=At.NEAREST_MIPMAP_NEAREST;Bn[Nr]=At.NEAREST_MIPMAP_LINEAR;Bn[Et]=At.LINEAR;Bn[Oa]=At.LINEAR_MIPMAP_NEAREST;Bn[hn]=At.LINEAR_MIPMAP_LINEAR;Bn[ai]=At.CLAMP_TO_EDGE;Bn[ds]=At.REPEAT;Bn[qa]=At.MIRRORED_REPEAT;const Ab={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},XD=new Ye,_b=12,KD=1179937895,JD=2,yb=8,ZD=1313821514,eN=5130562;function Qc(o,e){return o.length===e.length&&o.every(function(t,i){return t===e[i]})}function tN(o){return new TextEncoder().encode(o).buffer}function iN(o){return Qc(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function nN(o,e,t){const i={min:new Array(o.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(o.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let a=e;a<e+t;a++)for(let l=0;l<o.itemSize;l++){let u;o.itemSize>4?u=o.array[a*o.itemSize+l]:(l===0?u=o.getX(a):l===1?u=o.getY(a):l===2?u=o.getZ(a):l===3&&(u=o.getW(a)),o.normalized===!0&&(u=xl.normalize(u,o.array))),i.min[l]=Math.min(i.min[l],u),i.max[l]=Math.max(i.max[l],u)}return i}function t1(o){return Math.ceil(o/4)*4}function Hp(o,e=0){const t=t1(o.byteLength);if(t!==o.byteLength){const i=new Uint8Array(t);if(i.set(new Uint8Array(o)),e!==0)for(let a=o.byteLength;a<t;a++)i[a]=e;return i.buffer}return o}function bb(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function vb(o,e){if(o.toBlob!==void 0)return new Promise(i=>o.toBlob(i,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}let sN=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+Bf}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,t,i={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);const a=this,l=a.buffers,u=a.json;i=a.options;const d=a.extensionsUsed,p=a.extensionsRequired,m=new Blob(l,{type:"application/octet-stream"}),A=Object.keys(d),_=Object.keys(p);if(A.length>0&&(u.extensionsUsed=A),_.length>0&&(u.extensionsRequired=_),u.buffers&&u.buffers.length>0&&(u.buffers[0].byteLength=m.size),i.binary===!0){const b=new FileReader;b.readAsArrayBuffer(m),b.onloadend=function(){const w=Hp(b.result),E=new DataView(new ArrayBuffer(yb));E.setUint32(0,w.byteLength,!0),E.setUint32(4,eN,!0);const C=Hp(tN(JSON.stringify(u)),32),T=new DataView(new ArrayBuffer(yb));T.setUint32(0,C.byteLength,!0),T.setUint32(4,ZD,!0);const x=new ArrayBuffer(_b),P=new DataView(x);P.setUint32(0,KD,!0),P.setUint32(4,JD,!0);const M=_b+T.byteLength+C.byteLength+E.byteLength+w.byteLength;P.setUint32(8,M,!0);const B=new Blob([x,T,C,E,w],{type:"application/octet-stream"}),D=new FileReader;D.readAsArrayBuffer(B),D.onloadend=function(){t(D.result)}}}else if(u.buffers&&u.buffers.length>0){const b=new FileReader;b.readAsDataURL(m),b.onloadend=function(){const w=b.result;u.buffers[0].uri=w,t(u)}}else t(u)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const i=this.options,a=this.extensionsUsed;try{const l=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&l.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const u in l.gltfExtensions)t.extensions[u]=l.gltfExtensions[u],a[u]=!0;delete l.gltfExtensions}Object.keys(l).length>0&&(t.extras=l)}catch(l){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+l.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const a=new Map;a.set(!0,this.uid++),a.set(!1,this.uid++),this.uids.set(e,a)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const i=new se;for(let a=0,l=e.count;a<l;a++)if(Math.abs(i.fromBufferAttribute(e,a).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const i=e.clone(),a=new se;for(let l=0,u=i.count;l<u;l++)a.fromBufferAttribute(i,l),a.x===0&&a.y===0&&a.z===0?a.setX(1):a.normalize(),i.setXYZ(l,a.x,a.y,a.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1;const a={};(t.offset.x!==0||t.offset.y!==0)&&(a.offset=t.offset.toArray(),i=!0),t.rotation!==0&&(a.rotation=t.rotation,i=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(a.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=a,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,t){if(e===t)return e;function i(w){return w.colorSpace===Ht?function(C){return C<.04045?C*.0773993808:Math.pow(C*.9478672986+.0521327014,2.4)}:function(C){return C}}e instanceof Ua&&(e=await this.decompressTextureAsync(e)),t instanceof Ua&&(t=await this.decompressTextureAsync(t));const a=e?e.image:null,l=t?t.image:null,u=Math.max(a?a.width:0,l?l.width:0),d=Math.max(a?a.height:0,l?l.height:0),p=bb();p.width=u,p.height=d;const m=p.getContext("2d",{willReadFrequently:!0});m.fillStyle="#00ffff",m.fillRect(0,0,u,d);const A=m.getImageData(0,0,u,d);if(a){m.drawImage(a,0,0,u,d);const w=i(e),E=m.getImageData(0,0,u,d).data;for(let C=2;C<E.length;C+=4)A.data[C]=w(E[C]/256)*256}if(l){m.drawImage(l,0,0,u,d);const w=i(t),E=m.getImageData(0,0,u,d).data;for(let C=1;C<E.length;C+=4)A.data[C]=w(E[C]/256)*256}m.putImageData(A,0,0);const b=(e||t).clone();return b.source=new N0(p),b.colorSpace=Gn,b.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),b}async decompressTextureAsync(e,t=1/0){if(this.textureUtils===null)throw new Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,t)}processBuffer(e){const t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,a,l){const u=this.json;u.bufferViews||(u.bufferViews=[]);let d;switch(t){case At.BYTE:case At.UNSIGNED_BYTE:d=1;break;case At.SHORT:case At.UNSIGNED_SHORT:d=2;break;default:d=4}let p=e.itemSize*d;l===At.ARRAY_BUFFER&&(p=Math.ceil(p/4)*4);const m=t1(a*p),A=new DataView(new ArrayBuffer(m));let _=0;for(let E=i;E<i+a;E++){for(let C=0;C<e.itemSize;C++){let T;e.itemSize>4?T=e.array[E*e.itemSize+C]:(C===0?T=e.getX(E):C===1?T=e.getY(E):C===2?T=e.getZ(E):C===3&&(T=e.getW(E)),e.normalized===!0&&(T=xl.normalize(T,e.array))),t===At.FLOAT?A.setFloat32(_,T,!0):t===At.INT?A.setInt32(_,T,!0):t===At.UNSIGNED_INT?A.setUint32(_,T,!0):t===At.SHORT?A.setInt16(_,T,!0):t===At.UNSIGNED_SHORT?A.setUint16(_,T,!0):t===At.BYTE?A.setInt8(_,T):t===At.UNSIGNED_BYTE&&A.setUint8(_,T),_+=d}_%p!==0&&(_+=p-_%p)}const b={buffer:this.processBuffer(A.buffer),byteOffset:this.byteOffset,byteLength:m};return l!==void 0&&(b.target=l),l===At.ARRAY_BUFFER&&(b.byteStride=p),this.byteOffset+=m,u.bufferViews.push(b),{id:u.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(a){const l=new FileReader;l.readAsArrayBuffer(e),l.onloadend=function(){const u=Hp(l.result),d={buffer:t.processBuffer(u),byteOffset:t.byteOffset,byteLength:u.byteLength};t.byteOffset+=u.byteLength,a(i.bufferViews.push(d)-1)}})}processAccessor(e,t,i,a){const l=this.json,u={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let d;if(e.array.constructor===Float32Array)d=At.FLOAT;else if(e.array.constructor===Int32Array)d=At.INT;else if(e.array.constructor===Uint32Array)d=At.UNSIGNED_INT;else if(e.array.constructor===Int16Array)d=At.SHORT;else if(e.array.constructor===Uint16Array)d=At.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)d=At.BYTE;else if(e.array.constructor===Uint8Array)d=At.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(i===void 0&&(i=0),(a===void 0||a===1/0)&&(a=e.count),a===0)return null;const p=nN(e,i,a);let m;t!==void 0&&(m=e===t.index?At.ELEMENT_ARRAY_BUFFER:At.ARRAY_BUFFER);const A=this.processBufferView(e,d,i,a,m),_={bufferView:A.id,byteOffset:A.byteOffset,componentType:d,count:a,max:p.max,min:p.min,type:u[e.itemSize]};return e.normalized===!0&&(_.normalized=!0),l.accessors||(l.accessors=[]),l.accessors.push(_)-1}processImage(e,t,i,a="image/png"){if(e!==null){const l=this,u=l.cache,d=l.json,p=l.options,m=l.pending;u.images.has(e)||u.images.set(e,{});const A=u.images.get(e),_=a+":flipY/"+i.toString();if(A[_]!==void 0)return A[_];d.images||(d.images=[]);const b={mimeType:a},w=bb();w.width=Math.min(e.width,p.maxTextureSize),w.height=Math.min(e.height,p.maxTextureSize);const E=w.getContext("2d",{willReadFrequently:!0});if(i===!0&&(E.translate(0,w.height),E.scale(1,-1)),e.data!==void 0){t!==Xt&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>p.maxTextureSize||e.height>p.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const T=new Uint8ClampedArray(e.height*e.width*4);for(let x=0;x<T.length;x+=4)T[x+0]=e.data[x+0],T[x+1]=e.data[x+1],T[x+2]=e.data[x+2],T[x+3]=e.data[x+3];E.putImageData(new ImageData(T,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)E.drawImage(e,0,0,w.width,w.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");p.binary===!0?m.push(vb(w,a).then(T=>l.processBufferViewImage(T)).then(T=>{b.bufferView=T})):w.toDataURL!==void 0?b.uri=w.toDataURL(a):m.push(vb(w,a).then(T=>new FileReader().readAsDataURL(T)).then(T=>{b.uri=T}));const C=d.images.push(b)-1;return A[_]=C,C}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const i={magFilter:Bn[e.magFilter],minFilter:Bn[e.minFilter],wrapS:Bn[e.wrapS],wrapT:Bn[e.wrapT]};return t.samplers.push(i)-1}async processTextureAsync(e){const i=this.options,a=this.cache,l=this.json;if(a.textures.has(e))return a.textures.get(e);l.textures||(l.textures=[]),e instanceof Ua&&(e=await this.decompressTextureAsync(e,i.maxTextureSize));let u=e.userData.mimeType;u==="image/webp"&&(u="image/png");const d={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,u)};e.name&&(d.name=e.name),await this._invokeAllAsync(async function(m){m.writeTexture&&await m.writeTexture(e,d)});const p=l.textures.push(d)-1;return a.textures.set(e,p),p}async processMaterialAsync(e){const t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);const a={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const l=e.color.toArray().concat([e.opacity]);if(Qc(l,[1,1,1,1])||(a.pbrMetallicRoughness.baseColorFactor=l),e.isMeshStandardMaterial?(a.pbrMetallicRoughness.metallicFactor=e.metalness,a.pbrMetallicRoughness.roughnessFactor=e.roughness):(a.pbrMetallicRoughness.metallicFactor=0,a.pbrMetallicRoughness.roughnessFactor=1),e.metalnessMap||e.roughnessMap){const d=await this.buildMetalRoughTextureAsync(e.metalnessMap,e.roughnessMap),p={index:await this.processTextureAsync(d),texCoord:d.channel};this.applyTextureTransform(p,d),a.pbrMetallicRoughness.metallicRoughnessTexture=p}if(e.map){const d={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(d,e.map),a.pbrMetallicRoughness.baseColorTexture=d}if(e.emissive){const d=e.emissive;if(Math.max(d.r,d.g,d.b)>0&&(a.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const m={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(m,e.emissiveMap),a.emissiveTexture=m}}if(e.normalMap){const d={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(d.scale=e.normalScale.x),this.applyTextureTransform(d,e.normalMap),a.normalTexture=d}if(e.aoMap){const d={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(d.strength=e.aoMapIntensity),this.applyTextureTransform(d,e.aoMap),a.occlusionTexture=d}e.transparent?a.alphaMode="BLEND":e.alphaTest>0&&(a.alphaMode="MASK",a.alphaCutoff=e.alphaTest),e.side===Ri&&(a.doubleSided=!0),e.name!==""&&(a.name=e.name),this.serializeUserData(e,a),await this._invokeAllAsync(async function(d){d.writeMaterialAsync&&await d.writeMaterialAsync(e,a)});const u=i.materials.push(a)-1;return t.materials.set(e,u),u}async processMeshAsync(e){const t=this.cache,i=this.json,a=[e.geometry.uuid];if(Array.isArray(e.material))for(let B=0,D=e.material.length;B<D;B++)a.push(e.material[B].uuid);else a.push(e.material.uuid);const l=a.join(":");if(t.meshes.has(l))return t.meshes.get(l);const u=e.geometry;let d;e.isLineSegments?d=At.LINES:e.isLineLoop?d=At.LINE_LOOP:e.isLine?d=At.LINE_STRIP:e.isPoints?d=At.POINTS:d=e.material.wireframe?At.LINES:At.TRIANGLES;const p={},m={},A=[],_=[],b={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},w=u.getAttribute("normal");w!==void 0&&!this.isNormalizedNormalAttribute(w)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),u.setAttribute("normal",this.createNormalizedNormalAttribute(w)));let E=null;for(let B in u.attributes){if(B.slice(0,5)==="morph")continue;const D=u.attributes[B];if(B=b[B]||B.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(B)||(B="_"+B),t.attributes.has(this.getUID(D))){m[B]=t.attributes.get(this.getUID(D));continue}E=null;const U=D.array;B==="JOINTS_0"&&!(U instanceof Uint16Array)&&!(U instanceof Uint8Array)?(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),E=new Vt(new Uint16Array(U),D.itemSize,D.normalized)):(U instanceof Uint32Array||U instanceof Int32Array)&&!B.startsWith("_")&&(console.warn(`GLTFExporter: Attribute "${B}" converted to type FLOAT.`),E=Cu.Utils.toFloat32BufferAttribute(D));const V=this.processAccessor(E||D,u);V!==null&&(B.startsWith("_")||this.detectMeshQuantization(B,D),m[B]=V,t.attributes.set(this.getUID(D),V))}if(w!==void 0&&u.setAttribute("normal",w),Object.keys(m).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const B=[],D=[],G={};if(e.morphTargetDictionary!==void 0)for(const U in e.morphTargetDictionary)G[e.morphTargetDictionary[U]]=U;for(let U=0;U<e.morphTargetInfluences.length;++U){const V={};let k=!1;for(const z in u.morphAttributes){if(z!=="position"&&z!=="normal"){k||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),k=!0);continue}const Q=u.morphAttributes[z][U],Z=z.toUpperCase(),K=u.attributes[z];if(t.attributes.has(this.getUID(Q,!0))){V[Z]=t.attributes.get(this.getUID(Q,!0));continue}const s=Q.clone();if(!u.morphTargetsRelative)for(let H=0,y=Q.count;H<y;H++)for(let ee=0;ee<Q.itemSize;ee++)ee===0&&s.setX(H,Q.getX(H)-K.getX(H)),ee===1&&s.setY(H,Q.getY(H)-K.getY(H)),ee===2&&s.setZ(H,Q.getZ(H)-K.getZ(H)),ee===3&&s.setW(H,Q.getW(H)-K.getW(H));V[Z]=this.processAccessor(s,u),t.attributes.set(this.getUID(K,!0),V[Z])}_.push(V),B.push(e.morphTargetInfluences[U]),e.morphTargetDictionary!==void 0&&D.push(G[U])}p.weights=B,D.length>0&&(p.extras={},p.extras.targetNames=D)}const C=Array.isArray(e.material);if(C&&u.groups.length===0)return null;let T=!1;if(C&&u.index===null){const B=[];for(let D=0,G=u.attributes.position.count;D<G;D++)B[D]=D;u.setIndex(B),T=!0}const x=C?e.material:[e.material],P=C?u.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let B=0,D=P.length;B<D;B++){const G={mode:d,attributes:m};if(this.serializeUserData(u,G),_.length>0&&(G.targets=_),u.index!==null){let V=this.getUID(u.index);(P[B].start!==void 0||P[B].count!==void 0)&&(V+=":"+P[B].start+":"+P[B].count),t.attributes.has(V)?G.indices=t.attributes.get(V):(G.indices=this.processAccessor(u.index,u,P[B].start,P[B].count),t.attributes.set(V,G.indices)),G.indices===null&&delete G.indices}const U=await this.processMaterialAsync(x[P[B].materialIndex]);U!==null&&(G.material=U),A.push(G)}T===!0&&u.setIndex(null),p.primitives=A,i.meshes||(i.meshes=[]),await this._invokeAllAsync(function(B){B.writeMesh&&B.writeMesh(e,p)});const M=i.meshes.push(p)-1;return t.meshes.set(l,M),M}detectMeshQuantization(e,t){if(this.extensionsUsed[Gp])return;let i;switch(t.array.constructor){case Int8Array:i="byte";break;case Uint8Array:i="unsigned byte";break;case Int16Array:i="short";break;case Uint16Array:i="unsigned short";break;default:return}t.normalized&&(i+=" normalized");const a=e.split("_",1)[0];gb[a]&&gb[a].includes(i)&&(this.extensionsUsed[Gp]=!0,this.extensionsRequired[Gp]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const i=e.isOrthographicCamera,a={type:i?"orthographic":"perspective"};return i?a.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:a.perspective={aspectRatio:e.aspect,yfov:xl.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(a.name=e.type),t.cameras.push(a)-1}processAnimation(e,t){const i=this.json,a=this.nodeMap;i.animations||(i.animations=[]),e=Cu.Utils.mergeMorphTargetTracks(e.clone(),t);const l=e.tracks,u=[],d=[];for(let p=0;p<l.length;++p){const m=l[p],A=xt.parseTrackName(m.name);let _=xt.findNode(t,A.nodeName);const b=Ab[A.propertyName];if(A.objectName==="bones"&&(_.isSkinnedMesh===!0?_=_.skeleton.getBoneByName(A.objectIndex):_=void 0),!_||!b){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',m.name);continue}const w=1;let E=m.values.length/m.times.length;b===Ab.morphTargetInfluences&&(E/=_.morphTargetInfluences.length);let C;m.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(C="CUBICSPLINE",E/=3):m.getInterpolation()===vl?C="STEP":C="LINEAR",d.push({input:this.processAccessor(new Vt(m.times,w)),output:this.processAccessor(new Vt(m.values,E)),interpolation:C}),u.push({sampler:d.length-1,target:{node:a.get(_),path:b}})}return i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:d,channels:u}),i.animations.length-1}processSkin(e){const t=this.json,i=this.nodeMap,a=t.nodes[i.get(e)],l=e.skeleton;if(l===void 0)return null;const u=e.skeleton.bones[0];if(u===void 0)return null;const d=[],p=new Float32Array(l.bones.length*16),m=new tt;for(let _=0;_<l.bones.length;++_)d.push(i.get(l.bones[_])),m.copy(l.boneInverses[_]),m.multiply(e.bindMatrix).toArray(p,_*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new Vt(p,16)),joints:d,skeleton:i.get(u)}),a.skin=t.skins.length-1}async processNodeAsync(e){const t=this.json,i=this.options,a=this.nodeMap;t.nodes||(t.nodes=[]);const l={};if(i.trs){const d=e.quaternion.toArray(),p=e.position.toArray(),m=e.scale.toArray();Qc(d,[0,0,0,1])||(l.rotation=d),Qc(p,[0,0,0])||(l.translation=p),Qc(m,[1,1,1])||(l.scale=m)}else e.matrixAutoUpdate&&e.updateMatrix(),iN(e.matrix)===!1&&(l.matrix=e.matrix.elements);if(e.name!==""&&(l.name=String(e.name)),this.serializeUserData(e,l),e.isMesh||e.isLine||e.isPoints){const d=await this.processMeshAsync(e);d!==null&&(l.mesh=d)}else e.isCamera&&(l.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const d=[];for(let p=0,m=e.children.length;p<m;p++){const A=e.children[p];if(A.visible||i.onlyVisible===!1){const _=await this.processNodeAsync(A);_!==null&&d.push(_)}}d.length>0&&(l.children=d)}await this._invokeAllAsync(function(d){d.writeNode&&d.writeNode(e,l)});const u=t.nodes.push(l)-1;return a.set(e,u),u}async processSceneAsync(e){const t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);const a={};e.name!==""&&(a.name=e.name),t.scenes.push(a);const l=[];for(let u=0,d=e.children.length;u<d;u++){const p=e.children[u];if(p.visible||i.onlyVisible===!1){const m=await this.processNodeAsync(p);m!==null&&l.push(m)}}l.length>0&&(a.nodes=l),this.serializeUserData(e,a)}async processObjectsAsync(e){const t=new Wr;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);await this.processSceneAsync(t)}async processInputAsync(e){const t=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(a){a.beforeParse&&a.beforeParse(e)});const i=[];for(let a=0;a<e.length;a++)e[a]instanceof Wr?await this.processSceneAsync(e[a]):i.push(e[a]);i.length>0&&await this.processObjectsAsync(i);for(let a=0;a<this.skins.length;++a)this.processSkin(this.skins[a]);for(let a=0;a<t.animations.length;++a)this.processAnimation(t.animations[a],e[0]);await this._invokeAllAsync(function(a){a.afterParse&&a.afterParse(e)})}async _invokeAllAsync(e){for(let t=0,i=this.plugins.length;t<i;t++)await e(this.plugins[t])}};class rN{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const i=this.writer,a=i.json,l=i.extensionsUsed,u={};e.name&&(u.name=e.name),u.color=e.color.toArray(),u.intensity=e.intensity,e.isDirectionalLight?u.type="directional":e.isPointLight?(u.type="point",e.distance>0&&(u.range=e.distance)):e.isSpotLight&&(u.type="spot",e.distance>0&&(u.range=e.distance),u.spot={},u.spot.innerConeAngle=(1-e.penumbra)*e.angle,u.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),l[this.name]||(a.extensions=a.extensions||{},a.extensions[this.name]={lights:[]},l[this.name]=!0);const d=a.extensions[this.name].lights;d.push(u),t.extensions=t.extensions||{},t.extensions[this.name]={light:d.length-1}}}let aN=class{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}async writeMaterialAsync(e,t){if(!e.isMeshBasicMaterial)return;const a=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},a[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},oN=class{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const i=this.writer,a=i.extensionsUsed,l={};if(l.clearcoatFactor=e.clearcoat,e.clearcoatMap){const u={index:await i.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};i.applyTextureTransform(u,e.clearcoatMap),l.clearcoatTexture=u}if(l.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const u={index:await i.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};i.applyTextureTransform(u,e.clearcoatRoughnessMap),l.clearcoatRoughnessTexture=u}if(e.clearcoatNormalMap){const u={index:await i.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(u.scale=e.clearcoatNormalScale.x),i.applyTextureTransform(u,e.clearcoatNormalMap),l.clearcoatNormalTexture=u}t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},lN=class{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const a=this.writer.extensionsUsed,l={};l.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},cN=class{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const i=this.writer,a=i.extensionsUsed,l={};if(l.iridescenceFactor=e.iridescence,e.iridescenceMap){const u={index:await i.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};i.applyTextureTransform(u,e.iridescenceMap),l.iridescenceTexture=u}if(l.iridescenceIor=e.iridescenceIOR,l.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],l.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const u={index:await i.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};i.applyTextureTransform(u,e.iridescenceThicknessMap),l.iridescenceThicknessTexture=u}t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},uN=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,a=i.extensionsUsed,l={};if(l.transmissionFactor=e.transmission,e.transmissionMap){const u={index:await i.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};i.applyTextureTransform(u,e.transmissionMap),l.transmissionTexture=u}t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},hN=class{constructor(e){this.writer=e,this.name="KHR_materials_volume"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,a=i.extensionsUsed,l={};if(l.thicknessFactor=e.thickness,e.thicknessMap){const u={index:await i.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};i.applyTextureTransform(u,e.thicknessMap),l.thicknessTexture=u}e.attenuationDistance!==1/0&&(l.attenuationDistance=e.attenuationDistance),l.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},dN=class{constructor(e){this.writer=e,this.name="KHR_materials_ior"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const a=this.writer.extensionsUsed,l={};l.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},fN=class{constructor(e){this.writer=e,this.name="KHR_materials_specular"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(XD)&&!e.specularIntensityMap&&!e.specularColorMap)return;const i=this.writer,a=i.extensionsUsed,l={};if(e.specularIntensityMap){const u={index:await i.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};i.applyTextureTransform(u,e.specularIntensityMap),l.specularTexture=u}if(e.specularColorMap){const u={index:await i.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};i.applyTextureTransform(u,e.specularColorMap),l.specularColorTexture=u}l.specularFactor=e.specularIntensity,l.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},pN=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const i=this.writer,a=i.extensionsUsed,l={};if(e.sheenRoughnessMap){const u={index:await i.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};i.applyTextureTransform(u,e.sheenRoughnessMap),l.sheenRoughnessTexture=u}if(e.sheenColorMap){const u={index:await i.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};i.applyTextureTransform(u,e.sheenColorMap),l.sheenColorTexture=u}l.sheenRoughnessFactor=e.sheenRoughness,l.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},mN=class{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const i=this.writer,a=i.extensionsUsed,l={};if(e.anisotropyMap){const u={index:await i.processTextureAsync(e.anisotropyMap)};i.applyTextureTransform(u,e.anisotropyMap),l.anisotropyTexture=u}l.anisotropyStrength=e.anisotropy,l.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},gN=class{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const a=this.writer.extensionsUsed,l={};l.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},AN=class{constructor(e){this.writer=e,this.name="EXT_materials_bump"}async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const i=this.writer,a=i.extensionsUsed,l={};if(e.bumpMap){const u={index:await i.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};i.applyTextureTransform(u,e.bumpMap),l.bumpTexture=u}l.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=l,a[this.name]=!0}},_N=class{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const i=this.writer,a=e,l=new Float32Array(a.count*3),u=new Float32Array(a.count*4),d=new Float32Array(a.count*3),p=new tt,m=new se,A=new Yi,_=new se;for(let w=0;w<a.count;w++)a.getMatrixAt(w,p),p.decompose(m,A,_),m.toArray(l,w*3),A.toArray(u,w*4),_.toArray(d,w*3);const b={TRANSLATION:i.processAccessor(new Vt(l,3)),ROTATION:i.processAccessor(new Vt(u,4)),SCALE:i.processAccessor(new Vt(d,3))};a.instanceColor&&(b._COLOR_0=i.processAccessor(a.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:b},i.extensionsUsed[this.name]=!0,i.extensionsRequired[this.name]=!0}};Cu.Utils={insertKeyframe:function(o,e){const i=o.getValueSize(),a=new o.TimeBufferType(o.times.length+1),l=new o.ValueBufferType(o.values.length+i),u=o.createInterpolant(new o.ValueBufferType(i));let d;if(o.times.length===0){a[0]=e;for(let p=0;p<i;p++)l[p]=0;d=0}else if(e<o.times[0]){if(Math.abs(o.times[0]-e)<.001)return 0;a[0]=e,a.set(o.times,1),l.set(u.evaluate(e),0),l.set(o.values,i),d=0}else if(e>o.times[o.times.length-1]){if(Math.abs(o.times[o.times.length-1]-e)<.001)return o.times.length-1;a[a.length-1]=e,a.set(o.times,0),l.set(o.values,0),l.set(u.evaluate(e),o.values.length),d=a.length-1}else for(let p=0;p<o.times.length;p++){if(Math.abs(o.times[p]-e)<.001)return p;if(o.times[p]<e&&o.times[p+1]>e){a.set(o.times.slice(0,p+1),0),a[p+1]=e,a.set(o.times.slice(p+1),p+2),l.set(o.values.slice(0,(p+1)*i),0),l.set(u.evaluate(e),(p+1)*i),l.set(o.values.slice((p+1)*i),(p+2)*i),d=p+1;break}}return o.times=a,o.values=l,d},mergeMorphTargetTracks:function(o,e){const t=[],i={},a=o.tracks;for(let l=0;l<a.length;++l){let u=a[l];const d=xt.parseTrackName(u.name),p=xt.findNode(e,d.nodeName);if(d.propertyName!=="morphTargetInfluences"||d.propertyIndex===void 0){t.push(u);continue}if(u.createInterpolant!==u.InterpolantFactoryMethodDiscrete&&u.createInterpolant!==u.InterpolantFactoryMethodLinear){if(u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),u=u.clone(),u.setInterpolation(wl)}const m=p.morphTargetInfluences.length,A=p.morphTargetDictionary[d.propertyIndex];if(A===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+d.propertyIndex);let _;if(i[p.uuid]===void 0){_=u.clone();const w=new _.ValueBufferType(m*_.times.length);for(let E=0;E<_.times.length;E++)w[E*m+A]=_.values[E];_.name=(d.nodeName||"")+".morphTargetInfluences",_.values=w,i[p.uuid]=_,t.push(_);continue}const b=u.createInterpolant(new u.ValueBufferType(1));_=i[p.uuid];for(let w=0;w<_.times.length;w++)_.values[w*m+A]=b.evaluate(_.times[w]);for(let w=0;w<u.times.length;w++){const E=this.insertKeyframe(_,u.times[w]);_.values[E*m+A]=u.values[w]}}return o.tracks=t,o},toFloat32BufferAttribute:function(o){const e=new Vt(new Float32Array(o.count*o.itemSize),o.itemSize,!1);if(!o.normalized&&!o.isInterleavedBufferAttribute)return e.array.set(o.array),e;for(let t=0,i=o.count;t<i;t++)for(let a=0;a<o.itemSize;a++)e.setComponent(t,a,o.getComponent(t,a));return e}};const yN=0,wb=2,bN=1,Eb=2,vN=0,wN=1,EN=10,xN=0,i1=9,n1=15,s1=16,r1=22,a1=37,o1=43,l1=76,c1=83,u1=97,h1=100,d1=103,f1=109,p1=165,m1=166,Z0=1000066e3;class SN{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Ac{constructor(e,t,i,a){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,i),this._littleEndian=a,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t){t===void 0&&(t=0);const i=this._offset;let a=0;for(;this._dataView.getUint8(this._offset)!==t&&a<e;)a++,this._offset++;return a<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,a)}}const nn=[171,75,84,88,32,50,48,187,13,10,26,10];function xb(o){return new TextDecoder().decode(o)}function CN(o){const e=new Uint8Array(o.buffer,o.byteOffset,nn.length);if(e[0]!==nn[0]||e[1]!==nn[1]||e[2]!==nn[2]||e[3]!==nn[3]||e[4]!==nn[4]||e[5]!==nn[5]||e[6]!==nn[6]||e[7]!==nn[7]||e[8]!==nn[8]||e[9]!==nn[9]||e[10]!==nn[10]||e[11]!==nn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new SN,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new Ac(o,nn.length,i,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32();const l=a._nextUint32();t.supercompressionScheme=a._nextUint32();const u=a._nextUint32(),d=a._nextUint32(),p=a._nextUint32(),m=a._nextUint32(),A=a._nextUint64(),_=a._nextUint64(),b=new Ac(o,nn.length+i,3*l*8,!0);for(let ee=0;ee<l;ee++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+b._nextUint64(),b._nextUint64()),uncompressedByteLength:b._nextUint64()});const w=new Ac(o,u,d,!0),E={vendorId:w._skip(4)._nextUint16(),descriptorType:w._nextUint16(),versionNumber:w._nextUint16(),descriptorBlockSize:w._nextUint16(),colorModel:w._nextUint8(),colorPrimaries:w._nextUint8(),transferFunction:w._nextUint8(),flags:w._nextUint8(),texelBlockDimension:[w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8()],bytesPlane:[w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8()],samples:[]},C=(E.descriptorBlockSize/4-6)/4;for(let ee=0;ee<C;ee++){const I={bitOffset:w._nextUint16(),bitLength:w._nextUint8(),channelType:w._nextUint8(),samplePosition:[w._nextUint8(),w._nextUint8(),w._nextUint8(),w._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&I.channelType?(I.sampleLower=w._nextInt32(),I.sampleUpper=w._nextInt32()):(I.sampleLower=w._nextUint32(),I.sampleUpper=w._nextUint32()),E.samples[ee]=I}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const T=new Ac(o,p,m,!0);for(;T._offset<m;){const ee=T._nextUint32(),I=T._scan(ee),re=xb(I);if(t.keyValue[re]=T._nextUint8Array(ee-I.byteLength-1),re.match(/^ktx/i)){const Ae=xb(t.keyValue[re]);t.keyValue[re]=Ae.substring(0,Ae.lastIndexOf("\0"))}T._skip(ee%4?4-ee%4:0)}if(_<=0)return t;const x=new Ac(o,A,_,!0),P=x._nextUint16(),M=x._nextUint16(),B=x._nextUint32(),D=x._nextUint32(),G=x._nextUint32(),U=x._nextUint32(),V=[];for(let ee=0;ee<l;ee++)V.push({imageFlags:x._nextUint32(),rgbSliceByteOffset:x._nextUint32(),rgbSliceByteLength:x._nextUint32(),alphaSliceByteOffset:x._nextUint32(),alphaSliceByteLength:x._nextUint32()});const k=A+x._offset,z=k+B,Q=z+D,Z=Q+G,K=new Uint8Array(o.buffer,o.byteOffset+k,B),s=new Uint8Array(o.buffer,o.byteOffset+z,D),H=new Uint8Array(o.buffer,o.byteOffset+Q,G),y=new Uint8Array(o.buffer,o.byteOffset+Z,U);return t.globalData={endpointCount:P,selectorCount:M,imageDescs:V,endpointsData:K,selectorsData:s,tablesData:H,extendedData:y},t}class g1{constructor(){this.textureUtils=null}setTextureUtils(e){this.textureUtils=e}parse(e,t,i,a){this.parseAsync(e,a).then(t).catch(i)}async parseAsync(e,t={}){t=Object.assign({ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:"horizontal"}},includeAnchoringProperties:!0,quickLookCompatible:!1,maxTextureSize:1024},t);const i={},a="model.usda";i[a]=null;let l=A1();l+=IN(t);const u={},d={};e.traverseVisible(m=>{if(m.isMesh){const A=m.geometry,_=m.material;if(_.isMeshStandardMaterial){const b="geometries/Geometry_"+A.id+".usda";if(!(b in i)){const w=PN(A);i[b]=RN(w)}_.uuid in u||(u[_.uuid]=_),l+=BN(m,A,_)}else console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",m)}else m.isCamera&&(l+=zN(m))}),l+=MN(),l+=UN(u,d,t.quickLookCompatible),i[a]=sf(l),l=null;for(const m in d){let A=d[m];if(A.isCompressedTexture===!0){if(this.textureUtils===null)throw new Error("THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.");A=await this.textureUtils.decompress(A)}const _=TN(A.image,A.flipY,t.maxTextureSize),b=await new Promise(w=>_.toBlob(w,"image/png",1));i[`textures/Texture_${m}.png`]=new Uint8Array(await b.arrayBuffer())}let p=0;for(const m in i){const A=i[m],_=34+m.length;p+=_;const b=p&63;if(b!==4){const w=64-b,E=new Uint8Array(w);i[m]=[A,{extra:{12345:E}}]}p=A.length}return YD(i,{level:0})}}function TN(o,e,t){if(typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&o instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&o instanceof ImageBitmap){const i=t/Math.max(o.width,o.height),a=document.createElement("canvas");a.width=o.width*Math.min(1,i),a.height=o.height*Math.min(1,i);const l=a.getContext("2d");return e===!0&&(l.translate(0,a.height),l.scale(1,-1)),l.drawImage(o,0,0,a.width,a.height),a}else throw new Error("THREE.USDZExporter: No valid image data found. Unable to process texture.")}const Wi=7;function A1(){return`#usda 1.0
|
|
3906
3906
|
(
|
|
3907
3907
|
customLayerData = {
|
|
3908
3908
|
string creator = "Three.js USDZExporter"
|
|
@@ -4048,13 +4048,13 @@ ${l.join(`
|
|
|
4048
4048
|
float verticalAperture = ${o.getFilmHeight().toPrecision(Wi)}
|
|
4049
4049
|
}
|
|
4050
4050
|
|
|
4051
|
-
`}function Tb(o,e){if(e===nM)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===_A||e===_S){let t=o.getIndex();if(t===null){const u=[],d=o.getAttribute("position");if(d!==void 0){for(let p=0;p<d.count;p++)u.push(p);o.setIndex(u),t=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const i=t.count-2,a=[];if(e===_A)for(let u=1;u<=i;u++)a.push(t.getX(0)),a.push(t.getX(u)),a.push(t.getX(u+1));else for(let u=0;u<i;u++)u%2===0?(a.push(t.getX(u)),a.push(t.getX(u+1)),a.push(t.getX(u+2))):(a.push(t.getX(u+2)),a.push(t.getX(u+1)),a.push(t.getX(u)));a.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const l=o.clone();return l.setIndex(a),l.clearGroups(),l}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}const Vp=new WeakMap;class y1 extends Ps{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,a){const l=new lr(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,u=>{this.parse(u,t,a)},i,a)}parse(e,t,i=()=>{}){this.decodeDracoFile(e,t,null,null,Ht,i).catch(i)}decodeDracoFile(e,t,i,a,l=qt,u=()=>{}){const d={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:l};return this.decodeGeometry(e,d).then(t).catch(u)}decodeGeometry(e,t){const i=JSON.stringify(t);if(Vp.has(e)){const p=Vp.get(e);if(p.key===i)return p.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let a;const l=this.workerNextTaskID++,u=e.byteLength,d=this._getWorker(l,u).then(p=>(a=p,new Promise((m,A)=>{a._callbacks[l]={resolve:m,reject:A},a.postMessage({type:"decode",id:l,taskConfig:t,buffer:e},[e])}))).then(p=>this._createGeometry(p.geometry));return d.catch(()=>!0).then(()=>{a&&l&&this._releaseTask(a,l)}),Vp.set(e,{key:i,promise:d}),d}_createGeometry(e){const t=new Di;e.index&&t.setIndex(new Vt(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const a=e.attributes[i],l=a.name,u=a.array,d=a.itemSize,p=new Vt(u,d);l==="color"&&(this._assignVertexColorSpace(p,a.vertexColorSpace),p.normalized=!(u instanceof Float32Array)),t.setAttribute(l,p)}return t}_assignVertexColorSpace(e,t){if(t!==Ht)return;const i=new Ye;for(let a=0,l=e.count;a<l;a++)i.fromBufferAttribute(e,a),
|
|
4052
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([u]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const a=new Worker(this.workerSourceURL);a._callbacks={},a._taskCosts={},a._taskLoad=0,a.postMessage({type:"init",decoderConfig:this.decoderConfig}),a.onmessage=function(l){const u=l.data;switch(u.type){case"decode":a._callbacks[u.id].resolve(u);break;case"error":a._callbacks[u.id].reject(u);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+u.type+'"')}},this.workerPool.push(a)}else this.workerPool.sort(function(a,l){return a._taskLoad>l._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function GN(){let o,e;onmessage=function(u){const d=u.data;switch(d.type){case"init":o=d.decoderConfig,e=new Promise(function(A){o.onModuleLoaded=function(_){A({draco:_})},DracoDecoderModule(o)});break;case"decode":const p=d.buffer,m=d.taskConfig;e.then(A=>{const _=A.draco,b=new _.Decoder;try{const w=t(_,b,new Int8Array(p),m),E=w.attributes.map(C=>C.array.buffer);w.index&&E.push(w.index.array.buffer),self.postMessage({type:"decode",id:d.id,geometry:w},E)}catch(w){console.error(w),self.postMessage({type:"error",id:d.id,error:w.message})}finally{_.destroy(b)}});break}};function t(u,d,p,m){const A=m.attributeIDs,_=m.attributeTypes;let b,w;const E=d.GetEncodedGeometryType(p);if(E===u.TRIANGULAR_MESH)b=new u.Mesh,w=d.DecodeArrayToMesh(p,p.byteLength,b);else if(E===u.POINT_CLOUD)b=new u.PointCloud,w=d.DecodeArrayToPointCloud(p,p.byteLength,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!w.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+w.error_msg());const C={index:null,attributes:[]};for(const T in A){const x=self[_[T]];let P,M;if(m.useUniqueIDs)M=A[T],P=d.GetAttributeByUniqueId(b,M);else{if(M=d.GetAttributeId(b,u[A[T]]),M===-1)continue;P=d.GetAttribute(b,M)}const B=a(u,d,b,T,x,P);T==="color"&&(B.vertexColorSpace=m.vertexColorSpace),C.attributes.push(B)}return E===u.TRIANGULAR_MESH&&(C.index=i(u,d,b)),u.destroy(b),C}function i(u,d,p){const A=p.num_faces()*3,_=A*4,b=u._malloc(_);d.GetTrianglesUInt32Array(p,_,b);const w=new Uint32Array(u.HEAPF32.buffer,b,A).slice();return u._free(b),{array:w,itemSize:1}}function a(u,d,p,m,A,_){const b=_.num_components(),E=p.num_points()*b,C=E*A.BYTES_PER_ELEMENT,T=l(u,A),x=u._malloc(C);d.GetAttributeDataArrayForAllPoints(p,_,T,C,x);const P=new A(u.HEAPF32.buffer,x,E).slice();return u._free(x),{name:m,array:P,itemSize:b}}function l(u,d){switch(d){case Float32Array:return u.DT_FLOAT32;case Int8Array:return u.DT_INT8;case Int16Array:return u.DT_INT16;case Int32Array:return u.DT_INT32;case Uint8Array:return u.DT_UINT8;case Uint16Array:return u.DT_UINT16;case Uint32Array:return u.DT_UINT32}}}class b1 extends Ps{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new qN(t)}),this.register(function(t){return new WN(t)}),this.register(function(t){return new nO(t)}),this.register(function(t){return new sO(t)}),this.register(function(t){return new rO(t)}),this.register(function(t){return new XN(t)}),this.register(function(t){return new KN(t)}),this.register(function(t){return new JN(t)}),this.register(function(t){return new ZN(t)}),this.register(function(t){return new jN(t)}),this.register(function(t){return new eO(t)}),this.register(function(t){return new YN(t)}),this.register(function(t){return new iO(t)}),this.register(function(t){return new tO(t)}),this.register(function(t){return new VN(t)}),this.register(function(t){return new aO(t)}),this.register(function(t){return new oO(t)})}load(e,t,i,a){const l=this;let u;if(this.resourcePath!=="")u=this.resourcePath;else if(this.path!==""){const m=cu.extractUrlBase(e);u=cu.resolveURL(m,this.path)}else u=cu.extractUrlBase(e);this.manager.itemStart(e);const d=function(m){a?a(m):console.error(m),l.manager.itemError(e),l.manager.itemEnd(e)},p=new lr(this.manager);p.setPath(this.path),p.setResponseType("arraybuffer"),p.setRequestHeader(this.requestHeader),p.setWithCredentials(this.withCredentials),p.load(e,function(m){try{l.parse(m,u,function(A){t(A),l.manager.itemEnd(e)},d)}catch(A){d(A)}},i,d)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,a){let l;const u={},d={},p=new TextDecoder;if(typeof e=="string")l=JSON.parse(e);else if(e instanceof ArrayBuffer)if(p.decode(new Uint8Array(e,0,4))===v1){try{u[_t.KHR_BINARY_GLTF]=new lO(e)}catch(_){a&&a(_);return}l=JSON.parse(u[_t.KHR_BINARY_GLTF].content)}else l=JSON.parse(p.decode(e));else l=e;if(l.asset===void 0||l.asset.version[0]<2){a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const m=new vO(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});m.fileLoader.setRequestHeader(this.requestHeader);for(let A=0;A<this.pluginCallbacks.length;A++){const _=this.pluginCallbacks[A](m);_.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),d[_.name]=_,u[_.name]=!0}if(l.extensionsUsed)for(let A=0;A<l.extensionsUsed.length;++A){const _=l.extensionsUsed[A],b=l.extensionsRequired||[];switch(_){case _t.KHR_MATERIALS_UNLIT:u[_]=new QN;break;case _t.KHR_DRACO_MESH_COMPRESSION:u[_]=new cO(l,this.dracoLoader);break;case _t.KHR_TEXTURE_TRANSFORM:u[_]=new uO;break;case _t.KHR_MESH_QUANTIZATION:u[_]=new hO;break;default:b.indexOf(_)>=0&&d[_]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}m.setExtensions(u),m.setPlugins(d),m.parse(i,a)}parseAsync(e,t){const i=this;return new Promise(function(a,l){i.parse(e,t,a,l)})}}function HN(){let o={};return{get:function(e){return o[e]},add:function(e,t){o[e]=t},remove:function(e){delete o[e]},removeAll:function(){o={}}}}const _t={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class VN{constructor(e){this.parser=e,this.name=_t.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,a=t.length;i<a;i++){const l=t[i];l.extensions&&l.extensions[this.name]&&l.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,l.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let a=t.cache.get(i);if(a)return a;const l=t.json,p=((l.extensions&&l.extensions[this.name]||{}).lights||[])[e];let m;const A=new Ye(16777215);p.color!==void 0&&A.setRGB(p.color[0],p.color[1],p.color[2],qt);const _=p.range!==void 0?p.range:0;switch(p.type){case"directional":m=new FS(A),m.target.position.set(0,0,-1),m.add(m.target);break;case"point":m=new US(A),m.distance=_;break;case"spot":m=new IR(A),m.distance=_,p.spot=p.spot||{},p.spot.innerConeAngle=p.spot.innerConeAngle!==void 0?p.spot.innerConeAngle:0,p.spot.outerConeAngle=p.spot.outerConeAngle!==void 0?p.spot.outerConeAngle:Math.PI/4,m.angle=p.spot.outerConeAngle,m.penumbra=1-p.spot.innerConeAngle/p.spot.outerConeAngle,m.target.position.set(0,0,-1),m.add(m.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+p.type)}return m.position.set(0,0,0),m.decay=2,Zs(m,p),p.intensity!==void 0&&(m.intensity=p.intensity),m.name=t.createUniqueName(p.name||"light_"+e),a=Promise.resolve(m),t.cache.add(i,a),a}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,l=i.json.nodes[e],d=(l.extensions&&l.extensions[this.name]||{}).light;return d===void 0?null:this._loadLight(d).then(function(p){return i._getNodeRef(t.cache,d,p)})}}class QN{constructor(){this.name=_t.KHR_MATERIALS_UNLIT}getMaterialType(){return Pi}extendParams(e,t,i){const a=[];e.color=new Ye(1,1,1),e.opacity=1;const l=t.pbrMetallicRoughness;if(l){if(Array.isArray(l.baseColorFactor)){const u=l.baseColorFactor;e.color.setRGB(u[0],u[1],u[2],qt),e.opacity=u[3]}l.baseColorTexture!==void 0&&a.push(i.assignTexture(e,"map",l.baseColorTexture,Ht))}return Promise.all(a)}}class jN{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const a=this.parser.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=a.extensions[this.name].emissiveStrength;return l!==void 0&&(t.emissiveIntensity=l),Promise.resolve()}}class qN{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];if(u.clearcoatFactor!==void 0&&(t.clearcoat=u.clearcoatFactor),u.clearcoatTexture!==void 0&&l.push(i.assignTexture(t,"clearcoatMap",u.clearcoatTexture)),u.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=u.clearcoatRoughnessFactor),u.clearcoatRoughnessTexture!==void 0&&l.push(i.assignTexture(t,"clearcoatRoughnessMap",u.clearcoatRoughnessTexture)),u.clearcoatNormalTexture!==void 0&&(l.push(i.assignTexture(t,"clearcoatNormalMap",u.clearcoatNormalTexture)),u.clearcoatNormalTexture.scale!==void 0)){const d=u.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ve(d,d)}return Promise.all(l)}}class WN{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_DISPERSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const a=this.parser.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=a.extensions[this.name];return t.dispersion=l.dispersion!==void 0?l.dispersion:0,Promise.resolve()}}class YN{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];return u.iridescenceFactor!==void 0&&(t.iridescence=u.iridescenceFactor),u.iridescenceTexture!==void 0&&l.push(i.assignTexture(t,"iridescenceMap",u.iridescenceTexture)),u.iridescenceIor!==void 0&&(t.iridescenceIOR=u.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),u.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=u.iridescenceThicknessMinimum),u.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=u.iridescenceThicknessMaximum),u.iridescenceThicknessTexture!==void 0&&l.push(i.assignTexture(t,"iridescenceThicknessMap",u.iridescenceThicknessTexture)),Promise.all(l)}}class XN{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[];t.sheenColor=new Ye(0,0,0),t.sheenRoughness=0,t.sheen=1;const u=a.extensions[this.name];if(u.sheenColorFactor!==void 0){const d=u.sheenColorFactor;t.sheenColor.setRGB(d[0],d[1],d[2],qt)}return u.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=u.sheenRoughnessFactor),u.sheenColorTexture!==void 0&&l.push(i.assignTexture(t,"sheenColorMap",u.sheenColorTexture,Ht)),u.sheenRoughnessTexture!==void 0&&l.push(i.assignTexture(t,"sheenRoughnessMap",u.sheenRoughnessTexture)),Promise.all(l)}}class KN{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];return u.transmissionFactor!==void 0&&(t.transmission=u.transmissionFactor),u.transmissionTexture!==void 0&&l.push(i.assignTexture(t,"transmissionMap",u.transmissionTexture)),Promise.all(l)}}class JN{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];t.thickness=u.thicknessFactor!==void 0?u.thicknessFactor:0,u.thicknessTexture!==void 0&&l.push(i.assignTexture(t,"thicknessMap",u.thicknessTexture)),t.attenuationDistance=u.attenuationDistance||1/0;const d=u.attenuationColor||[1,1,1];return t.attenuationColor=new Ye().setRGB(d[0],d[1],d[2],qt),Promise.all(l)}}class ZN{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const a=this.parser.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=a.extensions[this.name];return t.ior=l.ior!==void 0?l.ior:1.5,Promise.resolve()}}class eO{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];t.specularIntensity=u.specularFactor!==void 0?u.specularFactor:1,u.specularTexture!==void 0&&l.push(i.assignTexture(t,"specularIntensityMap",u.specularTexture));const d=u.specularColorFactor||[1,1,1];return t.specularColor=new Ye().setRGB(d[0],d[1],d[2],qt),u.specularColorTexture!==void 0&&l.push(i.assignTexture(t,"specularColorMap",u.specularColorTexture,Ht)),Promise.all(l)}}class tO{constructor(e){this.parser=e,this.name=_t.EXT_MATERIALS_BUMP}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];return t.bumpScale=u.bumpFactor!==void 0?u.bumpFactor:1,u.bumpTexture!==void 0&&l.push(i.assignTexture(t,"bumpMap",u.bumpTexture)),Promise.all(l)}}class iO{constructor(e){this.parser=e,this.name=_t.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];return u.anisotropyStrength!==void 0&&(t.anisotropy=u.anisotropyStrength),u.anisotropyRotation!==void 0&&(t.anisotropyRotation=u.anisotropyRotation),u.anisotropyTexture!==void 0&&l.push(i.assignTexture(t,"anisotropyMap",u.anisotropyTexture)),Promise.all(l)}}class nO{constructor(e){this.parser=e,this.name=_t.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,a=i.textures[e];if(!a.extensions||!a.extensions[this.name])return null;const l=a.extensions[this.name],u=t.options.ktx2Loader;if(!u){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,l.source,u)}}class sO{constructor(e){this.parser=e,this.name=_t.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,a=i.json,l=a.textures[e];if(!l.extensions||!l.extensions[t])return null;const u=l.extensions[t],d=a.images[u.source];let p=i.textureLoader;if(d.uri){const m=i.options.manager.getHandler(d.uri);m!==null&&(p=m)}return this.detectSupport().then(function(m){if(m)return i.loadTextureImage(e,u.source,p);if(a.extensionsRequired&&a.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class rO{constructor(e){this.parser=e,this.name=_t.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,a=i.json,l=a.textures[e];if(!l.extensions||!l.extensions[t])return null;const u=l.extensions[t],d=a.images[u.source];let p=i.textureLoader;if(d.uri){const m=i.options.manager.getHandler(d.uri);m!==null&&(p=m)}return this.detectSupport().then(function(m){if(m)return i.loadTextureImage(e,u.source,p);if(a.extensionsRequired&&a.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class aO{constructor(e){this.name=_t.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const a=i.extensions[this.name],l=this.parser.getDependency("buffer",a.buffer),u=this.parser.options.meshoptDecoder;if(!u||!u.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return l.then(function(d){const p=a.byteOffset||0,m=a.byteLength||0,A=a.count,_=a.byteStride,b=new Uint8Array(d,p,m);return u.decodeGltfBufferAsync?u.decodeGltfBufferAsync(A,_,b,a.mode,a.filter).then(function(w){return w.buffer}):u.ready.then(function(){const w=new ArrayBuffer(A*_);return u.decodeGltfBuffer(new Uint8Array(w),A,_,b,a.mode,a.filter),w})})}else return null}}class oO{constructor(e){this.name=_t.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const a=t.meshes[i.mesh];for(const m of a.primitives)if(m.mode!==zn.TRIANGLES&&m.mode!==zn.TRIANGLE_STRIP&&m.mode!==zn.TRIANGLE_FAN&&m.mode!==void 0)return null;const u=i.extensions[this.name].attributes,d=[],p={};for(const m in u)d.push(this.parser.getDependency("accessor",u[m]).then(A=>(p[m]=A,p[m])));return d.length<1?null:(d.push(this.parser.createNodeMesh(e)),Promise.all(d).then(m=>{const A=m.pop(),_=A.isGroup?A.children:[A],b=m[0].count,w=[];for(const E of _){const C=new tt,T=new se,x=new Yi,P=new se(1,1,1),M=new aR(E.geometry,E.material,b);for(let B=0;B<b;B++)p.TRANSLATION&&T.fromBufferAttribute(p.TRANSLATION,B),p.ROTATION&&x.fromBufferAttribute(p.ROTATION,B),p.SCALE&&P.fromBufferAttribute(p.SCALE,B),M.setMatrixAt(B,C.compose(T,x,P));for(const B in p)if(B==="_COLOR_0"){const D=p[B];M.instanceColor=new vA(D.array,D.itemSize,D.normalized)}else B!=="TRANSLATION"&&B!=="ROTATION"&&B!=="SCALE"&&E.geometry.setAttribute(B,p[B]);Qt.prototype.copy.call(M,E),this.parser.assignFinalMaterial(M),w.push(M)}return A.isGroup?(A.clear(),A.add(...w),A):w[0]}))}}const v1="glTF",_c=12,Ib={JSON:1313821514,BIN:5130562};class lO{constructor(e){this.name=_t.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,_c),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==v1)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const a=this.header.length-_c,l=new DataView(e,_c);let u=0;for(;u<a;){const d=l.getUint32(u,!0);u+=4;const p=l.getUint32(u,!0);if(u+=4,p===Ib.JSON){const m=new Uint8Array(e,_c+u,d);this.content=i.decode(m)}else if(p===Ib.BIN){const m=_c+u;this.body=e.slice(m,m+d)}u+=d}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class cO{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=_t.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,a=this.dracoLoader,l=e.extensions[this.name].bufferView,u=e.extensions[this.name].attributes,d={},p={},m={};for(const A in u){const _=BA[A]||A.toLowerCase();d[_]=u[A]}for(const A in e.attributes){const _=BA[A]||A.toLowerCase();if(u[A]!==void 0){const b=i.accessors[e.attributes[A]],w=ll[b.componentType];m[_]=w.name,p[_]=b.normalized===!0}}return t.getDependency("bufferView",l).then(function(A){return new Promise(function(_,b){a.decodeDracoFile(A,function(w){for(const E in w.attributes){const C=w.attributes[E],T=p[E];T!==void 0&&(C.normalized=T)}_(w)},d,m,qt,b)})})}}class uO{constructor(){this.name=_t.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class hO{constructor(){this.name=_t.KHR_MESH_QUANTIZATION}}class w1 extends ku{constructor(e,t,i,a){super(e,t,i,a)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,a=this.valueSize,l=e*a*3+a;for(let u=0;u!==a;u++)t[u]=i[l+u];return t}interpolate_(e,t,i,a){const l=this.resultBuffer,u=this.sampleValues,d=this.valueSize,p=d*2,m=d*3,A=a-t,_=(i-t)/A,b=_*_,w=b*_,E=e*m,C=E-m,T=-2*w+3*b,x=w-b,P=1-T,M=x-b+_;for(let B=0;B!==d;B++){const D=u[C+B+d],G=u[C+B+p]*A,U=u[E+B+d],V=u[E+B]*A;l[B]=P*D+M*G+T*U+x*V}return l}}const dO=new Yi;class fO extends w1{interpolate_(e,t,i,a){const l=super.interpolate_(e,t,i,a);return dO.fromArray(l).normalize().toArray(l),l}}const zn={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ll={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Mb={9728:gi,9729:wt,9984:Lu,9985:Oa,9986:Nr,9987:hn},Rb={33071:ai,33648:qa,10497:ds},Qp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},BA={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},vr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},pO={CUBICSPLINE:void 0,LINEAR:wl,STEP:vl},jp={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function mO(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new Su({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:hs})),o.DefaultMaterial}function ua(o,e,t){for(const i in t.extensions)o[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Zs(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function gO(o,e,t){let i=!1,a=!1,l=!1;for(let m=0,A=e.length;m<A;m++){const _=e[m];if(_.POSITION!==void 0&&(i=!0),_.NORMAL!==void 0&&(a=!0),_.COLOR_0!==void 0&&(l=!0),i&&a&&l)break}if(!i&&!a&&!l)return Promise.resolve(o);const u=[],d=[],p=[];for(let m=0,A=e.length;m<A;m++){const _=e[m];if(i){const b=_.POSITION!==void 0?t.getDependency("accessor",_.POSITION):o.attributes.position;u.push(b)}if(a){const b=_.NORMAL!==void 0?t.getDependency("accessor",_.NORMAL):o.attributes.normal;d.push(b)}if(l){const b=_.COLOR_0!==void 0?t.getDependency("accessor",_.COLOR_0):o.attributes.color;p.push(b)}}return Promise.all([Promise.all(u),Promise.all(d),Promise.all(p)]).then(function(m){const A=m[0],_=m[1],b=m[2];return i&&(o.morphAttributes.position=A),a&&(o.morphAttributes.normal=_),l&&(o.morphAttributes.color=b),o.morphTargetsRelative=!0,o})}function AO(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)o.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(o.morphTargetInfluences.length===t.length){o.morphTargetDictionary={};for(let i=0,a=t.length;i<a;i++)o.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function _O(o){let e;const t=o.extensions&&o.extensions[_t.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+qp(t.attributes):e=o.indices+":"+qp(o.attributes)+":"+o.mode,o.targets!==void 0)for(let i=0,a=o.targets.length;i<a;i++)e+=":"+qp(o.targets[i]);return e}function qp(o){let e="";const t=Object.keys(o).sort();for(let i=0,a=t.length;i<a;i++)e+=t[i]+":"+o[t[i]]+";";return e}function PA(o){switch(o){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function yO(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":o.search(/\.ktx2($|\?)/i)>0||o.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const bO=new tt;class vO{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new HN,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,a=-1,l=!1,u=-1;if(typeof navigator<"u"){const d=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(d)===!0;const p=d.match(/Version\/(\d+)/);a=i&&p?parseInt(p[1],10):-1,l=d.indexOf("Firefox")>-1,u=l?d.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&a<17||l&&u<98?this.textureLoader=new H0(this.options.manager):this.textureLoader=new LR(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new lr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,a=this.json,l=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(u){return u._markDefs&&u._markDefs()}),Promise.all(this._invokeAll(function(u){return u.beforeRoot&&u.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(u){const d={scene:u[0][a.scene||0],scenes:u[0],animations:u[1],cameras:u[2],asset:a.asset,parser:i,userData:{}};return ua(l,d,a),Zs(d,a),Promise.all(i._invokeAll(function(p){return p.afterRoot&&p.afterRoot(d)})).then(function(){for(const p of d.scenes)p.updateMatrixWorld();e(d)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let a=0,l=t.length;a<l;a++){const u=t[a].joints;for(let d=0,p=u.length;d<p;d++)e[u[d]].isBone=!0}for(let a=0,l=e.length;a<l;a++){const u=e[a];u.mesh!==void 0&&(this._addNodeRef(this.meshCache,u.mesh),u.skin!==void 0&&(i[u.mesh].isSkinnedMesh=!0)),u.camera!==void 0&&this._addNodeRef(this.cameraCache,u.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const a=i.clone(),l=(u,d)=>{const p=this.associations.get(u);p!=null&&this.associations.set(d,p);for(const[m,A]of u.children.entries())l(A,d.children[m])};return l(i,a),a.name+="_instance_"+e.uses[t]++,a}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const a=e(t[i]);if(a)return a}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let a=0;a<t.length;a++){const l=e(t[a]);l&&i.push(l)}return i}getDependency(e,t){const i=e+":"+t;let a=this.cache.get(i);if(!a){switch(e){case"scene":a=this.loadScene(t);break;case"node":a=this._invokeOne(function(l){return l.loadNode&&l.loadNode(t)});break;case"mesh":a=this._invokeOne(function(l){return l.loadMesh&&l.loadMesh(t)});break;case"accessor":a=this.loadAccessor(t);break;case"bufferView":a=this._invokeOne(function(l){return l.loadBufferView&&l.loadBufferView(t)});break;case"buffer":a=this.loadBuffer(t);break;case"material":a=this._invokeOne(function(l){return l.loadMaterial&&l.loadMaterial(t)});break;case"texture":a=this._invokeOne(function(l){return l.loadTexture&&l.loadTexture(t)});break;case"skin":a=this.loadSkin(t);break;case"animation":a=this._invokeOne(function(l){return l.loadAnimation&&l.loadAnimation(t)});break;case"camera":a=this.loadCamera(t);break;default:if(a=this._invokeOne(function(l){return l!=this&&l.getDependency&&l.getDependency(e,t)}),!a)throw new Error("Unknown type: "+e);break}this.cache.add(i,a)}return a}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,a=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(a.map(function(l,u){return i.getDependency(e,u)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[_t.KHR_BINARY_GLTF].body);const a=this.options;return new Promise(function(l,u){i.load(cu.resolveURL(t.uri,a.path),l,void 0,function(){u(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const a=t.byteLength||0,l=t.byteOffset||0;return i.slice(l,l+a)})}loadAccessor(e){const t=this,i=this.json,a=this.json.accessors[e];if(a.bufferView===void 0&&a.sparse===void 0){const u=Qp[a.type],d=ll[a.componentType],p=a.normalized===!0,m=new d(a.count*u);return Promise.resolve(new Vt(m,u,p))}const l=[];return a.bufferView!==void 0?l.push(this.getDependency("bufferView",a.bufferView)):l.push(null),a.sparse!==void 0&&(l.push(this.getDependency("bufferView",a.sparse.indices.bufferView)),l.push(this.getDependency("bufferView",a.sparse.values.bufferView))),Promise.all(l).then(function(u){const d=u[0],p=Qp[a.type],m=ll[a.componentType],A=m.BYTES_PER_ELEMENT,_=A*p,b=a.byteOffset||0,w=a.bufferView!==void 0?i.bufferViews[a.bufferView].byteStride:void 0,E=a.normalized===!0;let C,T;if(w&&w!==_){const x=Math.floor(b/w),P="InterleavedBuffer:"+a.bufferView+":"+a.componentType+":"+x+":"+a.count;let M=t.cache.get(P);M||(C=new m(d,x*w,a.count*w/A),M=new tR(C,w/A),t.cache.add(P,M)),T=new U0(M,p,b%w/A,E)}else d===null?C=new m(a.count*p):C=new m(d,b,a.count*p),T=new Vt(C,p,E);if(a.sparse!==void 0){const x=Qp.SCALAR,P=ll[a.sparse.indices.componentType],M=a.sparse.indices.byteOffset||0,B=a.sparse.values.byteOffset||0,D=new P(u[1],M,a.sparse.count*x),G=new m(u[2],B,a.sparse.count*p);d!==null&&(T=new Vt(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let U=0,V=D.length;U<V;U++){const k=D[U];if(T.setX(k,G[U*p]),p>=2&&T.setY(k,G[U*p+1]),p>=3&&T.setZ(k,G[U*p+2]),p>=4&&T.setW(k,G[U*p+3]),p>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=E}return T})}loadTexture(e){const t=this.json,i=this.options,l=t.textures[e].source,u=t.images[l];let d=this.textureLoader;if(u.uri){const p=i.manager.getHandler(u.uri);p!==null&&(d=p)}return this.loadTextureImage(e,l,d)}loadTextureImage(e,t,i){const a=this,l=this.json,u=l.textures[e],d=l.images[t],p=(d.uri||d.bufferView)+":"+u.sampler;if(this.textureCache[p])return this.textureCache[p];const m=this.loadImageSource(t,i).then(function(A){A.flipY=!1,A.name=u.name||d.name||"",A.name===""&&typeof d.uri=="string"&&d.uri.startsWith("data:image/")===!1&&(A.name=d.uri);const b=(l.samplers||{})[u.sampler]||{};return A.magFilter=Mb[b.magFilter]||wt,A.minFilter=Mb[b.minFilter]||hn,A.wrapS=Rb[b.wrapS]||ds,A.wrapT=Rb[b.wrapT]||ds,A.generateMipmaps=!A.isCompressedTexture&&A.minFilter!==gi&&A.minFilter!==wt,a.associations.set(A,{textures:e}),A}).catch(function(){return null});return this.textureCache[p]=m,m}loadImageSource(e,t){const i=this,a=this.json,l=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(_=>_.clone());const u=a.images[e],d=self.URL||self.webkitURL;let p=u.uri||"",m=!1;if(u.bufferView!==void 0)p=i.getDependency("bufferView",u.bufferView).then(function(_){m=!0;const b=new Blob([_],{type:u.mimeType});return p=d.createObjectURL(b),p});else if(u.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const A=Promise.resolve(p).then(function(_){return new Promise(function(b,w){let E=b;t.isImageBitmapLoader===!0&&(E=function(C){const T=new Kt(C);T.needsUpdate=!0,b(T)}),t.load(cu.resolveURL(_,l.path),E,void 0,w)})}).then(function(_){return m===!0&&d.revokeObjectURL(p),Zs(_,u),_.userData.mimeType=u.mimeType||yO(u.uri),_}).catch(function(_){throw console.error("THREE.GLTFLoader: Couldn't load texture",p),_});return this.sourceCache[e]=A,A}assignTexture(e,t,i,a){const l=this;return this.getDependency("texture",i.index).then(function(u){if(!u)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(u=u.clone(),u.channel=i.texCoord),l.extensions[_t.KHR_TEXTURE_TRANSFORM]){const d=i.extensions!==void 0?i.extensions[_t.KHR_TEXTURE_TRANSFORM]:void 0;if(d){const p=l.associations.get(u);u=l.extensions[_t.KHR_TEXTURE_TRANSFORM].extendTexture(u,d),l.associations.set(u,p)}}return a!==void 0&&(u.colorSpace=a),e[t]=u,u})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const a=t.attributes.tangent===void 0,l=t.attributes.color!==void 0,u=t.attributes.normal===void 0;if(e.isPoints){const d="PointsMaterial:"+i.uuid;let p=this.cache.get(d);p||(p=new PS,jn.prototype.copy.call(p,i),p.color.copy(i.color),p.map=i.map,p.sizeAttenuation=!1,this.cache.add(d,p)),i=p}else if(e.isLine){const d="LineBasicMaterial:"+i.uuid;let p=this.cache.get(d);p||(p=new Ou,jn.prototype.copy.call(p,i),p.color.copy(i.color),p.map=i.map,this.cache.add(d,p)),i=p}if(a||l||u){let d="ClonedMaterial:"+i.uuid+":";a&&(d+="derivative-tangents:"),l&&(d+="vertex-colors:"),u&&(d+="flat-shading:");let p=this.cache.get(d);p||(p=i.clone(),l&&(p.vertexColors=!0),u&&(p.flatShading=!0),a&&(p.normalScale&&(p.normalScale.y*=-1),p.clearcoatNormalScale&&(p.clearcoatNormalScale.y*=-1)),this.cache.add(d,p),this.associations.set(p,this.associations.get(i))),i=p}e.material=i}getMaterialType(){return Su}loadMaterial(e){const t=this,i=this.json,a=this.extensions,l=i.materials[e];let u;const d={},p=l.extensions||{},m=[];if(p[_t.KHR_MATERIALS_UNLIT]){const _=a[_t.KHR_MATERIALS_UNLIT];u=_.getMaterialType(),m.push(_.extendParams(d,l,t))}else{const _=l.pbrMetallicRoughness||{};if(d.color=new Ye(1,1,1),d.opacity=1,Array.isArray(_.baseColorFactor)){const b=_.baseColorFactor;d.color.setRGB(b[0],b[1],b[2],qt),d.opacity=b[3]}_.baseColorTexture!==void 0&&m.push(t.assignTexture(d,"map",_.baseColorTexture,Ht)),d.metalness=_.metallicFactor!==void 0?_.metallicFactor:1,d.roughness=_.roughnessFactor!==void 0?_.roughnessFactor:1,_.metallicRoughnessTexture!==void 0&&(m.push(t.assignTexture(d,"metalnessMap",_.metallicRoughnessTexture)),m.push(t.assignTexture(d,"roughnessMap",_.metallicRoughnessTexture))),u=this._invokeOne(function(b){return b.getMaterialType&&b.getMaterialType(e)}),m.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,d)})))}l.doubleSided===!0&&(d.side=Ri);const A=l.alphaMode||jp.OPAQUE;if(A===jp.BLEND?(d.transparent=!0,d.depthWrite=!1):(d.transparent=!1,A===jp.MASK&&(d.alphaTest=l.alphaCutoff!==void 0?l.alphaCutoff:.5)),l.normalTexture!==void 0&&u!==Pi&&(m.push(t.assignTexture(d,"normalMap",l.normalTexture)),d.normalScale=new Ve(1,1),l.normalTexture.scale!==void 0)){const _=l.normalTexture.scale;d.normalScale.set(_,_)}if(l.occlusionTexture!==void 0&&u!==Pi&&(m.push(t.assignTexture(d,"aoMap",l.occlusionTexture)),l.occlusionTexture.strength!==void 0&&(d.aoMapIntensity=l.occlusionTexture.strength)),l.emissiveFactor!==void 0&&u!==Pi){const _=l.emissiveFactor;d.emissive=new Ye().setRGB(_[0],_[1],_[2],qt)}return l.emissiveTexture!==void 0&&u!==Pi&&m.push(t.assignTexture(d,"emissiveMap",l.emissiveTexture,Ht)),Promise.all(m).then(function(){const _=new u(d);return l.name&&(_.name=l.name),Zs(_,l),t.associations.set(_,{materials:e}),l.extensions&&ua(a,_,l),_})}createUniqueName(e){const t=xt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,a=this.primitiveCache;function l(d){return i[_t.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(d,t).then(function(p){return Bb(p,d,t)})}const u=[];for(let d=0,p=e.length;d<p;d++){const m=e[d],A=_O(m),_=a[A];if(_)u.push(_.promise);else{let b;m.extensions&&m.extensions[_t.KHR_DRACO_MESH_COMPRESSION]?b=l(m):b=Bb(new Di,m,t),a[A]={primitive:m,promise:b},u.push(b)}}return Promise.all(u)}loadMesh(e){const t=this,i=this.json,a=this.extensions,l=i.meshes[e],u=l.primitives,d=[];for(let p=0,m=u.length;p<m;p++){const A=u[p].material===void 0?mO(this.cache):this.getDependency("material",u[p].material);d.push(A)}return d.push(t.loadGeometries(u)),Promise.all(d).then(function(p){const m=p.slice(0,p.length-1),A=p[p.length-1],_=[];for(let w=0,E=A.length;w<E;w++){const C=A[w],T=u[w];let x;const P=m[w];if(T.mode===zn.TRIANGLES||T.mode===zn.TRIANGLE_STRIP||T.mode===zn.TRIANGLE_FAN||T.mode===void 0)x=l.isSkinnedMesh===!0?new nR(C,P):new lt(C,P),x.isSkinnedMesh===!0&&x.normalizeSkinWeights(),T.mode===zn.TRIANGLE_STRIP?x.geometry=Tb(x.geometry,_S):T.mode===zn.TRIANGLE_FAN&&(x.geometry=Tb(x.geometry,_A));else if(T.mode===zn.LINES)x=new z0(C,P);else if(T.mode===zn.LINE_STRIP)x=new Cl(C,P);else if(T.mode===zn.LINE_LOOP)x=new cR(C,P);else if(T.mode===zn.POINTS)x=new uR(C,P);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(x.geometry.morphAttributes).length>0&&AO(x,l),x.name=t.createUniqueName(l.name||"mesh_"+e),Zs(x,l),T.extensions&&ua(a,x,T),t.assignFinalMaterial(x),_.push(x)}for(let w=0,E=_.length;w<E;w++)t.associations.set(_[w],{meshes:e,primitives:w});if(_.length===1)return l.extensions&&ua(a,_[0],l),_[0];const b=new mi;l.extensions&&ua(a,b,l),t.associations.set(b,{meshes:e});for(let w=0,E=_.length;w<E;w++)b.add(_[w]);return b})}loadCamera(e){let t;const i=this.json.cameras[e],a=i[i.type];if(!a){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new _i(xl.radToDeg(a.yfov),a.aspectRatio||1,a.znear||1,a.zfar||2e6):i.type==="orthographic"&&(t=new Kr(-a.xmag,a.xmag,a.ymag,-a.ymag,a.znear,a.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),Zs(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let a=0,l=t.joints.length;a<l;a++)i.push(this._loadNodeShallow(t.joints[a]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(a){const l=a.pop(),u=a,d=[],p=[];for(let m=0,A=u.length;m<A;m++){const _=u[m];if(_){d.push(_);const b=new tt;l!==null&&b.fromArray(l.array,m*16),p.push(b)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[m])}return new F0(d,p)})}loadAnimation(e){const t=this.json,i=this,a=t.animations[e],l=a.name?a.name:"animation_"+e,u=[],d=[],p=[],m=[],A=[];for(let _=0,b=a.channels.length;_<b;_++){const w=a.channels[_],E=a.samplers[w.sampler],C=w.target,T=C.node,x=a.parameters!==void 0?a.parameters[E.input]:E.input,P=a.parameters!==void 0?a.parameters[E.output]:E.output;C.node!==void 0&&(u.push(this.getDependency("node",T)),d.push(this.getDependency("accessor",x)),p.push(this.getDependency("accessor",P)),m.push(E),A.push(C))}return Promise.all([Promise.all(u),Promise.all(d),Promise.all(p),Promise.all(m),Promise.all(A)]).then(function(_){const b=_[0],w=_[1],E=_[2],C=_[3],T=_[4],x=[];for(let P=0,M=b.length;P<M;P++){const B=b[P],D=w[P],G=E[P],U=C[P],V=T[P];if(B===void 0)continue;B.updateMatrix&&B.updateMatrix();const k=i._createAnimationTracks(B,D,G,U,V);if(k)for(let z=0;z<k.length;z++)x.push(k[z])}return new EA(l,void 0,x)})}createNodeMesh(e){const t=this.json,i=this,a=t.nodes[e];return a.mesh===void 0?null:i.getDependency("mesh",a.mesh).then(function(l){const u=i._getNodeRef(i.meshCache,a.mesh,l);return a.weights!==void 0&&u.traverse(function(d){if(d.isMesh)for(let p=0,m=a.weights.length;p<m;p++)d.morphTargetInfluences[p]=a.weights[p]}),u})}loadNode(e){const t=this.json,i=this,a=t.nodes[e],l=i._loadNodeShallow(e),u=[],d=a.children||[];for(let m=0,A=d.length;m<A;m++)u.push(i.getDependency("node",d[m]));const p=a.skin===void 0?Promise.resolve(null):i.getDependency("skin",a.skin);return Promise.all([l,Promise.all(u),p]).then(function(m){const A=m[0],_=m[1],b=m[2];b!==null&&A.traverse(function(w){w.isSkinnedMesh&&w.bind(b,bO)});for(let w=0,E=_.length;w<E;w++)A.add(_[w]);return A})}_loadNodeShallow(e){const t=this.json,i=this.extensions,a=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const l=t.nodes[e],u=l.name?a.createUniqueName(l.name):"",d=[],p=a._invokeOne(function(m){return m.createNodeMesh&&m.createNodeMesh(e)});return p&&d.push(p),l.camera!==void 0&&d.push(a.getDependency("camera",l.camera).then(function(m){return a._getNodeRef(a.cameraCache,l.camera,m)})),a._invokeAll(function(m){return m.createNodeAttachment&&m.createNodeAttachment(e)}).forEach(function(m){d.push(m)}),this.nodeCache[e]=Promise.all(d).then(function(m){let A;if(l.isBone===!0?A=new BS:m.length>1?A=new mi:m.length===1?A=m[0]:A=new Qt,A!==m[0])for(let _=0,b=m.length;_<b;_++)A.add(m[_]);if(l.name&&(A.userData.name=l.name,A.name=u),Zs(A,l),l.extensions&&ua(i,A,l),l.matrix!==void 0){const _=new tt;_.fromArray(l.matrix),A.applyMatrix4(_)}else l.translation!==void 0&&A.position.fromArray(l.translation),l.rotation!==void 0&&A.quaternion.fromArray(l.rotation),l.scale!==void 0&&A.scale.fromArray(l.scale);return a.associations.has(A)||a.associations.set(A,{}),a.associations.get(A).nodes=e,A}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],a=this,l=new mi;i.name&&(l.name=a.createUniqueName(i.name)),Zs(l,i),i.extensions&&ua(t,l,i);const u=i.nodes||[],d=[];for(let p=0,m=u.length;p<m;p++)d.push(a.getDependency("node",u[p]));return Promise.all(d).then(function(p){for(let A=0,_=p.length;A<_;A++)l.add(p[A]);const m=A=>{const _=new Map;for(const[b,w]of a.associations)(b instanceof jn||b instanceof Kt)&&_.set(b,w);return A.traverse(b=>{const w=a.associations.get(b);w!=null&&_.set(b,w)}),_};return a.associations=m(l),l})}_createAnimationTracks(e,t,i,a,l){const u=[],d=e.name?e.name:e.uuid,p=[];vr[l.path]===vr.weights?e.traverse(function(b){b.morphTargetInfluences&&p.push(b.name?b.name:b.uuid)}):p.push(d);let m;switch(vr[l.path]){case vr.weights:m=Tl;break;case vr.rotation:m=Il;break;case vr.position:case vr.scale:m=Ml;break;default:switch(i.itemSize){case 1:m=Tl;break;case 2:case 3:default:m=Ml;break}break}const A=a.interpolation!==void 0?pO[a.interpolation]:wl,_=this._getArrayFromAccessor(i);for(let b=0,w=p.length;b<w;b++){const E=new m(p[b]+"."+vr[l.path],t.array,_,A);a.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(E),u.push(E)}return u}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const i=PA(t.constructor),a=new Float32Array(t.length);for(let l=0,u=t.length;l<u;l++)a[l]=t[l]*i;t=a}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(i){const a=this instanceof Il?fO:w1;return new a(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function wO(o,e,t){const i=e.attributes,a=new yi;if(i.POSITION!==void 0){const d=t.json.accessors[i.POSITION],p=d.min,m=d.max;if(p!==void 0&&m!==void 0){if(a.set(new se(p[0],p[1],p[2]),new se(m[0],m[1],m[2])),d.normalized){const A=PA(ll[d.componentType]);a.min.multiplyScalar(A),a.max.multiplyScalar(A)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const l=e.targets;if(l!==void 0){const d=new se,p=new se;for(let m=0,A=l.length;m<A;m++){const _=l[m];if(_.POSITION!==void 0){const b=t.json.accessors[_.POSITION],w=b.min,E=b.max;if(w!==void 0&&E!==void 0){if(p.setX(Math.max(Math.abs(w[0]),Math.abs(E[0]))),p.setY(Math.max(Math.abs(w[1]),Math.abs(E[1]))),p.setZ(Math.max(Math.abs(w[2]),Math.abs(E[2]))),b.normalized){const C=PA(ll[b.componentType]);p.multiplyScalar(C)}d.max(p)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}a.expandByVector(d)}o.boundingBox=a;const u=new bn;a.getCenter(u.center),u.radius=a.min.distanceTo(a.max)/2,o.boundingSphere=u}function Bb(o,e,t){const i=e.attributes,a=[];function l(u,d){return t.getDependency("accessor",u).then(function(p){o.setAttribute(d,p)})}for(const u in i){const d=BA[u]||u.toLowerCase();d in o.attributes||a.push(l(i[u],d))}if(e.indices!==void 0&&!o.index){const u=t.getDependency("accessor",e.indices).then(function(d){o.setIndex(d)});a.push(u)}return vt.workingColorSpace!==qt&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${vt.workingColorSpace}" not supported.`),Zs(o,e),wO(o,e,t),Promise.all(a).then(function(){return e.targets!==void 0?gO(o,e.targets,t):o})}class E1 extends CR{constructor(e){super(e),this.type=hi}parse(e){const u=function(V,k){switch(V){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(k||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(k||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(k||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(k||""))}},_=function(V,k,z){k=k||1024;let Z=V.pos,K=-1,s=0,H="",y=String.fromCharCode.apply(null,new Uint16Array(V.subarray(Z,Z+128)));for(;0>(K=y.indexOf(`
|
|
4051
|
+
`}function Tb(o,e){if(e===nM)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===_A||e===_S){let t=o.getIndex();if(t===null){const u=[],d=o.getAttribute("position");if(d!==void 0){for(let p=0;p<d.count;p++)u.push(p);o.setIndex(u),t=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const i=t.count-2,a=[];if(e===_A)for(let u=1;u<=i;u++)a.push(t.getX(0)),a.push(t.getX(u)),a.push(t.getX(u+1));else for(let u=0;u<i;u++)u%2===0?(a.push(t.getX(u)),a.push(t.getX(u+1)),a.push(t.getX(u+2))):(a.push(t.getX(u+2)),a.push(t.getX(u+1)),a.push(t.getX(u)));a.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const l=o.clone();return l.setIndex(a),l.clearGroups(),l}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}const Vp=new WeakMap;class y1 extends Ps{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,a){const l=new lr(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,u=>{this.parse(u,t,a)},i,a)}parse(e,t,i=()=>{}){this.decodeDracoFile(e,t,null,null,Ht,i).catch(i)}decodeDracoFile(e,t,i,a,l=qt,u=()=>{}){const d={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:l};return this.decodeGeometry(e,d).then(t).catch(u)}decodeGeometry(e,t){const i=JSON.stringify(t);if(Vp.has(e)){const p=Vp.get(e);if(p.key===i)return p.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let a;const l=this.workerNextTaskID++,u=e.byteLength,d=this._getWorker(l,u).then(p=>(a=p,new Promise((m,A)=>{a._callbacks[l]={resolve:m,reject:A},a.postMessage({type:"decode",id:l,taskConfig:t,buffer:e},[e])}))).then(p=>this._createGeometry(p.geometry));return d.catch(()=>!0).then(()=>{a&&l&&this._releaseTask(a,l)}),Vp.set(e,{key:i,promise:d}),d}_createGeometry(e){const t=new Di;e.index&&t.setIndex(new Vt(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const a=e.attributes[i],l=a.name,u=a.array,d=a.itemSize,p=new Vt(u,d);l==="color"&&(this._assignVertexColorSpace(p,a.vertexColorSpace),p.normalized=!(u instanceof Float32Array)),t.setAttribute(l,p)}return t}_assignVertexColorSpace(e,t){if(t!==Ht)return;const i=new Ye;for(let a=0,l=e.count;a<l;a++)i.fromBufferAttribute(e,a),wt.toWorkingColorSpace(i,Ht),e.setXYZ(a,i.r,i.g,i.b)}_loadLibrary(e,t){const i=new lr(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((a,l)=>{i.load(e,a,void 0,l)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const a=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const l=GN.toString(),u=["/* draco decoder */",a,"","/* worker */",l.substring(l.indexOf("{")+1,l.lastIndexOf("}"))].join(`
|
|
4052
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([u]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const a=new Worker(this.workerSourceURL);a._callbacks={},a._taskCosts={},a._taskLoad=0,a.postMessage({type:"init",decoderConfig:this.decoderConfig}),a.onmessage=function(l){const u=l.data;switch(u.type){case"decode":a._callbacks[u.id].resolve(u);break;case"error":a._callbacks[u.id].reject(u);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+u.type+'"')}},this.workerPool.push(a)}else this.workerPool.sort(function(a,l){return a._taskLoad>l._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function GN(){let o,e;onmessage=function(u){const d=u.data;switch(d.type){case"init":o=d.decoderConfig,e=new Promise(function(A){o.onModuleLoaded=function(_){A({draco:_})},DracoDecoderModule(o)});break;case"decode":const p=d.buffer,m=d.taskConfig;e.then(A=>{const _=A.draco,b=new _.Decoder;try{const w=t(_,b,new Int8Array(p),m),E=w.attributes.map(C=>C.array.buffer);w.index&&E.push(w.index.array.buffer),self.postMessage({type:"decode",id:d.id,geometry:w},E)}catch(w){console.error(w),self.postMessage({type:"error",id:d.id,error:w.message})}finally{_.destroy(b)}});break}};function t(u,d,p,m){const A=m.attributeIDs,_=m.attributeTypes;let b,w;const E=d.GetEncodedGeometryType(p);if(E===u.TRIANGULAR_MESH)b=new u.Mesh,w=d.DecodeArrayToMesh(p,p.byteLength,b);else if(E===u.POINT_CLOUD)b=new u.PointCloud,w=d.DecodeArrayToPointCloud(p,p.byteLength,b);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!w.ok()||b.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+w.error_msg());const C={index:null,attributes:[]};for(const T in A){const x=self[_[T]];let P,M;if(m.useUniqueIDs)M=A[T],P=d.GetAttributeByUniqueId(b,M);else{if(M=d.GetAttributeId(b,u[A[T]]),M===-1)continue;P=d.GetAttribute(b,M)}const B=a(u,d,b,T,x,P);T==="color"&&(B.vertexColorSpace=m.vertexColorSpace),C.attributes.push(B)}return E===u.TRIANGULAR_MESH&&(C.index=i(u,d,b)),u.destroy(b),C}function i(u,d,p){const A=p.num_faces()*3,_=A*4,b=u._malloc(_);d.GetTrianglesUInt32Array(p,_,b);const w=new Uint32Array(u.HEAPF32.buffer,b,A).slice();return u._free(b),{array:w,itemSize:1}}function a(u,d,p,m,A,_){const b=_.num_components(),E=p.num_points()*b,C=E*A.BYTES_PER_ELEMENT,T=l(u,A),x=u._malloc(C);d.GetAttributeDataArrayForAllPoints(p,_,T,C,x);const P=new A(u.HEAPF32.buffer,x,E).slice();return u._free(x),{name:m,array:P,itemSize:b}}function l(u,d){switch(d){case Float32Array:return u.DT_FLOAT32;case Int8Array:return u.DT_INT8;case Int16Array:return u.DT_INT16;case Int32Array:return u.DT_INT32;case Uint8Array:return u.DT_UINT8;case Uint16Array:return u.DT_UINT16;case Uint32Array:return u.DT_UINT32}}}class b1 extends Ps{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new qN(t)}),this.register(function(t){return new WN(t)}),this.register(function(t){return new nO(t)}),this.register(function(t){return new sO(t)}),this.register(function(t){return new rO(t)}),this.register(function(t){return new XN(t)}),this.register(function(t){return new KN(t)}),this.register(function(t){return new JN(t)}),this.register(function(t){return new ZN(t)}),this.register(function(t){return new jN(t)}),this.register(function(t){return new eO(t)}),this.register(function(t){return new YN(t)}),this.register(function(t){return new iO(t)}),this.register(function(t){return new tO(t)}),this.register(function(t){return new VN(t)}),this.register(function(t){return new aO(t)}),this.register(function(t){return new oO(t)})}load(e,t,i,a){const l=this;let u;if(this.resourcePath!=="")u=this.resourcePath;else if(this.path!==""){const m=cu.extractUrlBase(e);u=cu.resolveURL(m,this.path)}else u=cu.extractUrlBase(e);this.manager.itemStart(e);const d=function(m){a?a(m):console.error(m),l.manager.itemError(e),l.manager.itemEnd(e)},p=new lr(this.manager);p.setPath(this.path),p.setResponseType("arraybuffer"),p.setRequestHeader(this.requestHeader),p.setWithCredentials(this.withCredentials),p.load(e,function(m){try{l.parse(m,u,function(A){t(A),l.manager.itemEnd(e)},d)}catch(A){d(A)}},i,d)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,a){let l;const u={},d={},p=new TextDecoder;if(typeof e=="string")l=JSON.parse(e);else if(e instanceof ArrayBuffer)if(p.decode(new Uint8Array(e,0,4))===v1){try{u[yt.KHR_BINARY_GLTF]=new lO(e)}catch(_){a&&a(_);return}l=JSON.parse(u[yt.KHR_BINARY_GLTF].content)}else l=JSON.parse(p.decode(e));else l=e;if(l.asset===void 0||l.asset.version[0]<2){a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const m=new vO(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});m.fileLoader.setRequestHeader(this.requestHeader);for(let A=0;A<this.pluginCallbacks.length;A++){const _=this.pluginCallbacks[A](m);_.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),d[_.name]=_,u[_.name]=!0}if(l.extensionsUsed)for(let A=0;A<l.extensionsUsed.length;++A){const _=l.extensionsUsed[A],b=l.extensionsRequired||[];switch(_){case yt.KHR_MATERIALS_UNLIT:u[_]=new QN;break;case yt.KHR_DRACO_MESH_COMPRESSION:u[_]=new cO(l,this.dracoLoader);break;case yt.KHR_TEXTURE_TRANSFORM:u[_]=new uO;break;case yt.KHR_MESH_QUANTIZATION:u[_]=new hO;break;default:b.indexOf(_)>=0&&d[_]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}m.setExtensions(u),m.setPlugins(d),m.parse(i,a)}parseAsync(e,t){const i=this;return new Promise(function(a,l){i.parse(e,t,a,l)})}}function HN(){let o={};return{get:function(e){return o[e]},add:function(e,t){o[e]=t},remove:function(e){delete o[e]},removeAll:function(){o={}}}}const yt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class VN{constructor(e){this.parser=e,this.name=yt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,a=t.length;i<a;i++){const l=t[i];l.extensions&&l.extensions[this.name]&&l.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,l.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let a=t.cache.get(i);if(a)return a;const l=t.json,p=((l.extensions&&l.extensions[this.name]||{}).lights||[])[e];let m;const A=new Ye(16777215);p.color!==void 0&&A.setRGB(p.color[0],p.color[1],p.color[2],qt);const _=p.range!==void 0?p.range:0;switch(p.type){case"directional":m=new FS(A),m.target.position.set(0,0,-1),m.add(m.target);break;case"point":m=new US(A),m.distance=_;break;case"spot":m=new IR(A),m.distance=_,p.spot=p.spot||{},p.spot.innerConeAngle=p.spot.innerConeAngle!==void 0?p.spot.innerConeAngle:0,p.spot.outerConeAngle=p.spot.outerConeAngle!==void 0?p.spot.outerConeAngle:Math.PI/4,m.angle=p.spot.outerConeAngle,m.penumbra=1-p.spot.innerConeAngle/p.spot.outerConeAngle,m.target.position.set(0,0,-1),m.add(m.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+p.type)}return m.position.set(0,0,0),m.decay=2,Zs(m,p),p.intensity!==void 0&&(m.intensity=p.intensity),m.name=t.createUniqueName(p.name||"light_"+e),a=Promise.resolve(m),t.cache.add(i,a),a}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,l=i.json.nodes[e],d=(l.extensions&&l.extensions[this.name]||{}).light;return d===void 0?null:this._loadLight(d).then(function(p){return i._getNodeRef(t.cache,d,p)})}}class QN{constructor(){this.name=yt.KHR_MATERIALS_UNLIT}getMaterialType(){return Pi}extendParams(e,t,i){const a=[];e.color=new Ye(1,1,1),e.opacity=1;const l=t.pbrMetallicRoughness;if(l){if(Array.isArray(l.baseColorFactor)){const u=l.baseColorFactor;e.color.setRGB(u[0],u[1],u[2],qt),e.opacity=u[3]}l.baseColorTexture!==void 0&&a.push(i.assignTexture(e,"map",l.baseColorTexture,Ht))}return Promise.all(a)}}class jN{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const a=this.parser.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=a.extensions[this.name].emissiveStrength;return l!==void 0&&(t.emissiveIntensity=l),Promise.resolve()}}class qN{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];if(u.clearcoatFactor!==void 0&&(t.clearcoat=u.clearcoatFactor),u.clearcoatTexture!==void 0&&l.push(i.assignTexture(t,"clearcoatMap",u.clearcoatTexture)),u.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=u.clearcoatRoughnessFactor),u.clearcoatRoughnessTexture!==void 0&&l.push(i.assignTexture(t,"clearcoatRoughnessMap",u.clearcoatRoughnessTexture)),u.clearcoatNormalTexture!==void 0&&(l.push(i.assignTexture(t,"clearcoatNormalMap",u.clearcoatNormalTexture)),u.clearcoatNormalTexture.scale!==void 0)){const d=u.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ve(d,d)}return Promise.all(l)}}class WN{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_DISPERSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const a=this.parser.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=a.extensions[this.name];return t.dispersion=l.dispersion!==void 0?l.dispersion:0,Promise.resolve()}}class YN{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];return u.iridescenceFactor!==void 0&&(t.iridescence=u.iridescenceFactor),u.iridescenceTexture!==void 0&&l.push(i.assignTexture(t,"iridescenceMap",u.iridescenceTexture)),u.iridescenceIor!==void 0&&(t.iridescenceIOR=u.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),u.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=u.iridescenceThicknessMinimum),u.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=u.iridescenceThicknessMaximum),u.iridescenceThicknessTexture!==void 0&&l.push(i.assignTexture(t,"iridescenceThicknessMap",u.iridescenceThicknessTexture)),Promise.all(l)}}class XN{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[];t.sheenColor=new Ye(0,0,0),t.sheenRoughness=0,t.sheen=1;const u=a.extensions[this.name];if(u.sheenColorFactor!==void 0){const d=u.sheenColorFactor;t.sheenColor.setRGB(d[0],d[1],d[2],qt)}return u.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=u.sheenRoughnessFactor),u.sheenColorTexture!==void 0&&l.push(i.assignTexture(t,"sheenColorMap",u.sheenColorTexture,Ht)),u.sheenRoughnessTexture!==void 0&&l.push(i.assignTexture(t,"sheenRoughnessMap",u.sheenRoughnessTexture)),Promise.all(l)}}class KN{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];return u.transmissionFactor!==void 0&&(t.transmission=u.transmissionFactor),u.transmissionTexture!==void 0&&l.push(i.assignTexture(t,"transmissionMap",u.transmissionTexture)),Promise.all(l)}}class JN{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];t.thickness=u.thicknessFactor!==void 0?u.thicknessFactor:0,u.thicknessTexture!==void 0&&l.push(i.assignTexture(t,"thicknessMap",u.thicknessTexture)),t.attenuationDistance=u.attenuationDistance||1/0;const d=u.attenuationColor||[1,1,1];return t.attenuationColor=new Ye().setRGB(d[0],d[1],d[2],qt),Promise.all(l)}}class ZN{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const a=this.parser.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=a.extensions[this.name];return t.ior=l.ior!==void 0?l.ior:1.5,Promise.resolve()}}class eO{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];t.specularIntensity=u.specularFactor!==void 0?u.specularFactor:1,u.specularTexture!==void 0&&l.push(i.assignTexture(t,"specularIntensityMap",u.specularTexture));const d=u.specularColorFactor||[1,1,1];return t.specularColor=new Ye().setRGB(d[0],d[1],d[2],qt),u.specularColorTexture!==void 0&&l.push(i.assignTexture(t,"specularColorMap",u.specularColorTexture,Ht)),Promise.all(l)}}class tO{constructor(e){this.parser=e,this.name=yt.EXT_MATERIALS_BUMP}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];return t.bumpScale=u.bumpFactor!==void 0?u.bumpFactor:1,u.bumpTexture!==void 0&&l.push(i.assignTexture(t,"bumpMap",u.bumpTexture)),Promise.all(l)}}class iO{constructor(e){this.parser=e,this.name=yt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Rs}extendMaterialParams(e,t){const i=this.parser,a=i.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();const l=[],u=a.extensions[this.name];return u.anisotropyStrength!==void 0&&(t.anisotropy=u.anisotropyStrength),u.anisotropyRotation!==void 0&&(t.anisotropyRotation=u.anisotropyRotation),u.anisotropyTexture!==void 0&&l.push(i.assignTexture(t,"anisotropyMap",u.anisotropyTexture)),Promise.all(l)}}class nO{constructor(e){this.parser=e,this.name=yt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,a=i.textures[e];if(!a.extensions||!a.extensions[this.name])return null;const l=a.extensions[this.name],u=t.options.ktx2Loader;if(!u){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,l.source,u)}}class sO{constructor(e){this.parser=e,this.name=yt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,a=i.json,l=a.textures[e];if(!l.extensions||!l.extensions[t])return null;const u=l.extensions[t],d=a.images[u.source];let p=i.textureLoader;if(d.uri){const m=i.options.manager.getHandler(d.uri);m!==null&&(p=m)}return this.detectSupport().then(function(m){if(m)return i.loadTextureImage(e,u.source,p);if(a.extensionsRequired&&a.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class rO{constructor(e){this.parser=e,this.name=yt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,a=i.json,l=a.textures[e];if(!l.extensions||!l.extensions[t])return null;const u=l.extensions[t],d=a.images[u.source];let p=i.textureLoader;if(d.uri){const m=i.options.manager.getHandler(d.uri);m!==null&&(p=m)}return this.detectSupport().then(function(m){if(m)return i.loadTextureImage(e,u.source,p);if(a.extensionsRequired&&a.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class aO{constructor(e){this.name=yt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const a=i.extensions[this.name],l=this.parser.getDependency("buffer",a.buffer),u=this.parser.options.meshoptDecoder;if(!u||!u.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return l.then(function(d){const p=a.byteOffset||0,m=a.byteLength||0,A=a.count,_=a.byteStride,b=new Uint8Array(d,p,m);return u.decodeGltfBufferAsync?u.decodeGltfBufferAsync(A,_,b,a.mode,a.filter).then(function(w){return w.buffer}):u.ready.then(function(){const w=new ArrayBuffer(A*_);return u.decodeGltfBuffer(new Uint8Array(w),A,_,b,a.mode,a.filter),w})})}else return null}}class oO{constructor(e){this.name=yt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const a=t.meshes[i.mesh];for(const m of a.primitives)if(m.mode!==zn.TRIANGLES&&m.mode!==zn.TRIANGLE_STRIP&&m.mode!==zn.TRIANGLE_FAN&&m.mode!==void 0)return null;const u=i.extensions[this.name].attributes,d=[],p={};for(const m in u)d.push(this.parser.getDependency("accessor",u[m]).then(A=>(p[m]=A,p[m])));return d.length<1?null:(d.push(this.parser.createNodeMesh(e)),Promise.all(d).then(m=>{const A=m.pop(),_=A.isGroup?A.children:[A],b=m[0].count,w=[];for(const E of _){const C=new tt,T=new se,x=new Yi,P=new se(1,1,1),M=new aR(E.geometry,E.material,b);for(let B=0;B<b;B++)p.TRANSLATION&&T.fromBufferAttribute(p.TRANSLATION,B),p.ROTATION&&x.fromBufferAttribute(p.ROTATION,B),p.SCALE&&P.fromBufferAttribute(p.SCALE,B),M.setMatrixAt(B,C.compose(T,x,P));for(const B in p)if(B==="_COLOR_0"){const D=p[B];M.instanceColor=new vA(D.array,D.itemSize,D.normalized)}else B!=="TRANSLATION"&&B!=="ROTATION"&&B!=="SCALE"&&E.geometry.setAttribute(B,p[B]);Qt.prototype.copy.call(M,E),this.parser.assignFinalMaterial(M),w.push(M)}return A.isGroup?(A.clear(),A.add(...w),A):w[0]}))}}const v1="glTF",_c=12,Ib={JSON:1313821514,BIN:5130562};class lO{constructor(e){this.name=yt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,_c),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==v1)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const a=this.header.length-_c,l=new DataView(e,_c);let u=0;for(;u<a;){const d=l.getUint32(u,!0);u+=4;const p=l.getUint32(u,!0);if(u+=4,p===Ib.JSON){const m=new Uint8Array(e,_c+u,d);this.content=i.decode(m)}else if(p===Ib.BIN){const m=_c+u;this.body=e.slice(m,m+d)}u+=d}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class cO{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=yt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,a=this.dracoLoader,l=e.extensions[this.name].bufferView,u=e.extensions[this.name].attributes,d={},p={},m={};for(const A in u){const _=BA[A]||A.toLowerCase();d[_]=u[A]}for(const A in e.attributes){const _=BA[A]||A.toLowerCase();if(u[A]!==void 0){const b=i.accessors[e.attributes[A]],w=ll[b.componentType];m[_]=w.name,p[_]=b.normalized===!0}}return t.getDependency("bufferView",l).then(function(A){return new Promise(function(_,b){a.decodeDracoFile(A,function(w){for(const E in w.attributes){const C=w.attributes[E],T=p[E];T!==void 0&&(C.normalized=T)}_(w)},d,m,qt,b)})})}}class uO{constructor(){this.name=yt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class hO{constructor(){this.name=yt.KHR_MESH_QUANTIZATION}}class w1 extends ku{constructor(e,t,i,a){super(e,t,i,a)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,a=this.valueSize,l=e*a*3+a;for(let u=0;u!==a;u++)t[u]=i[l+u];return t}interpolate_(e,t,i,a){const l=this.resultBuffer,u=this.sampleValues,d=this.valueSize,p=d*2,m=d*3,A=a-t,_=(i-t)/A,b=_*_,w=b*_,E=e*m,C=E-m,T=-2*w+3*b,x=w-b,P=1-T,M=x-b+_;for(let B=0;B!==d;B++){const D=u[C+B+d],G=u[C+B+p]*A,U=u[E+B+d],V=u[E+B]*A;l[B]=P*D+M*G+T*U+x*V}return l}}const dO=new Yi;class fO extends w1{interpolate_(e,t,i,a){const l=super.interpolate_(e,t,i,a);return dO.fromArray(l).normalize().toArray(l),l}}const zn={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ll={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Mb={9728:gi,9729:Et,9984:Lu,9985:Oa,9986:Nr,9987:hn},Rb={33071:ai,33648:qa,10497:ds},Qp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},BA={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},vr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},pO={CUBICSPLINE:void 0,LINEAR:wl,STEP:vl},jp={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function mO(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new Su({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:hs})),o.DefaultMaterial}function ua(o,e,t){for(const i in t.extensions)o[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Zs(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function gO(o,e,t){let i=!1,a=!1,l=!1;for(let m=0,A=e.length;m<A;m++){const _=e[m];if(_.POSITION!==void 0&&(i=!0),_.NORMAL!==void 0&&(a=!0),_.COLOR_0!==void 0&&(l=!0),i&&a&&l)break}if(!i&&!a&&!l)return Promise.resolve(o);const u=[],d=[],p=[];for(let m=0,A=e.length;m<A;m++){const _=e[m];if(i){const b=_.POSITION!==void 0?t.getDependency("accessor",_.POSITION):o.attributes.position;u.push(b)}if(a){const b=_.NORMAL!==void 0?t.getDependency("accessor",_.NORMAL):o.attributes.normal;d.push(b)}if(l){const b=_.COLOR_0!==void 0?t.getDependency("accessor",_.COLOR_0):o.attributes.color;p.push(b)}}return Promise.all([Promise.all(u),Promise.all(d),Promise.all(p)]).then(function(m){const A=m[0],_=m[1],b=m[2];return i&&(o.morphAttributes.position=A),a&&(o.morphAttributes.normal=_),l&&(o.morphAttributes.color=b),o.morphTargetsRelative=!0,o})}function AO(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)o.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(o.morphTargetInfluences.length===t.length){o.morphTargetDictionary={};for(let i=0,a=t.length;i<a;i++)o.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function _O(o){let e;const t=o.extensions&&o.extensions[yt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+qp(t.attributes):e=o.indices+":"+qp(o.attributes)+":"+o.mode,o.targets!==void 0)for(let i=0,a=o.targets.length;i<a;i++)e+=":"+qp(o.targets[i]);return e}function qp(o){let e="";const t=Object.keys(o).sort();for(let i=0,a=t.length;i<a;i++)e+=t[i]+":"+o[t[i]]+";";return e}function PA(o){switch(o){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function yO(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":o.search(/\.ktx2($|\?)/i)>0||o.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const bO=new tt;class vO{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new HN,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,a=-1,l=!1,u=-1;if(typeof navigator<"u"){const d=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(d)===!0;const p=d.match(/Version\/(\d+)/);a=i&&p?parseInt(p[1],10):-1,l=d.indexOf("Firefox")>-1,u=l?d.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&a<17||l&&u<98?this.textureLoader=new H0(this.options.manager):this.textureLoader=new LR(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new lr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,a=this.json,l=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(u){return u._markDefs&&u._markDefs()}),Promise.all(this._invokeAll(function(u){return u.beforeRoot&&u.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(u){const d={scene:u[0][a.scene||0],scenes:u[0],animations:u[1],cameras:u[2],asset:a.asset,parser:i,userData:{}};return ua(l,d,a),Zs(d,a),Promise.all(i._invokeAll(function(p){return p.afterRoot&&p.afterRoot(d)})).then(function(){for(const p of d.scenes)p.updateMatrixWorld();e(d)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let a=0,l=t.length;a<l;a++){const u=t[a].joints;for(let d=0,p=u.length;d<p;d++)e[u[d]].isBone=!0}for(let a=0,l=e.length;a<l;a++){const u=e[a];u.mesh!==void 0&&(this._addNodeRef(this.meshCache,u.mesh),u.skin!==void 0&&(i[u.mesh].isSkinnedMesh=!0)),u.camera!==void 0&&this._addNodeRef(this.cameraCache,u.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const a=i.clone(),l=(u,d)=>{const p=this.associations.get(u);p!=null&&this.associations.set(d,p);for(const[m,A]of u.children.entries())l(A,d.children[m])};return l(i,a),a.name+="_instance_"+e.uses[t]++,a}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const a=e(t[i]);if(a)return a}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let a=0;a<t.length;a++){const l=e(t[a]);l&&i.push(l)}return i}getDependency(e,t){const i=e+":"+t;let a=this.cache.get(i);if(!a){switch(e){case"scene":a=this.loadScene(t);break;case"node":a=this._invokeOne(function(l){return l.loadNode&&l.loadNode(t)});break;case"mesh":a=this._invokeOne(function(l){return l.loadMesh&&l.loadMesh(t)});break;case"accessor":a=this.loadAccessor(t);break;case"bufferView":a=this._invokeOne(function(l){return l.loadBufferView&&l.loadBufferView(t)});break;case"buffer":a=this.loadBuffer(t);break;case"material":a=this._invokeOne(function(l){return l.loadMaterial&&l.loadMaterial(t)});break;case"texture":a=this._invokeOne(function(l){return l.loadTexture&&l.loadTexture(t)});break;case"skin":a=this.loadSkin(t);break;case"animation":a=this._invokeOne(function(l){return l.loadAnimation&&l.loadAnimation(t)});break;case"camera":a=this.loadCamera(t);break;default:if(a=this._invokeOne(function(l){return l!=this&&l.getDependency&&l.getDependency(e,t)}),!a)throw new Error("Unknown type: "+e);break}this.cache.add(i,a)}return a}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,a=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(a.map(function(l,u){return i.getDependency(e,u)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[yt.KHR_BINARY_GLTF].body);const a=this.options;return new Promise(function(l,u){i.load(cu.resolveURL(t.uri,a.path),l,void 0,function(){u(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const a=t.byteLength||0,l=t.byteOffset||0;return i.slice(l,l+a)})}loadAccessor(e){const t=this,i=this.json,a=this.json.accessors[e];if(a.bufferView===void 0&&a.sparse===void 0){const u=Qp[a.type],d=ll[a.componentType],p=a.normalized===!0,m=new d(a.count*u);return Promise.resolve(new Vt(m,u,p))}const l=[];return a.bufferView!==void 0?l.push(this.getDependency("bufferView",a.bufferView)):l.push(null),a.sparse!==void 0&&(l.push(this.getDependency("bufferView",a.sparse.indices.bufferView)),l.push(this.getDependency("bufferView",a.sparse.values.bufferView))),Promise.all(l).then(function(u){const d=u[0],p=Qp[a.type],m=ll[a.componentType],A=m.BYTES_PER_ELEMENT,_=A*p,b=a.byteOffset||0,w=a.bufferView!==void 0?i.bufferViews[a.bufferView].byteStride:void 0,E=a.normalized===!0;let C,T;if(w&&w!==_){const x=Math.floor(b/w),P="InterleavedBuffer:"+a.bufferView+":"+a.componentType+":"+x+":"+a.count;let M=t.cache.get(P);M||(C=new m(d,x*w,a.count*w/A),M=new tR(C,w/A),t.cache.add(P,M)),T=new U0(M,p,b%w/A,E)}else d===null?C=new m(a.count*p):C=new m(d,b,a.count*p),T=new Vt(C,p,E);if(a.sparse!==void 0){const x=Qp.SCALAR,P=ll[a.sparse.indices.componentType],M=a.sparse.indices.byteOffset||0,B=a.sparse.values.byteOffset||0,D=new P(u[1],M,a.sparse.count*x),G=new m(u[2],B,a.sparse.count*p);d!==null&&(T=new Vt(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let U=0,V=D.length;U<V;U++){const k=D[U];if(T.setX(k,G[U*p]),p>=2&&T.setY(k,G[U*p+1]),p>=3&&T.setZ(k,G[U*p+2]),p>=4&&T.setW(k,G[U*p+3]),p>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=E}return T})}loadTexture(e){const t=this.json,i=this.options,l=t.textures[e].source,u=t.images[l];let d=this.textureLoader;if(u.uri){const p=i.manager.getHandler(u.uri);p!==null&&(d=p)}return this.loadTextureImage(e,l,d)}loadTextureImage(e,t,i){const a=this,l=this.json,u=l.textures[e],d=l.images[t],p=(d.uri||d.bufferView)+":"+u.sampler;if(this.textureCache[p])return this.textureCache[p];const m=this.loadImageSource(t,i).then(function(A){A.flipY=!1,A.name=u.name||d.name||"",A.name===""&&typeof d.uri=="string"&&d.uri.startsWith("data:image/")===!1&&(A.name=d.uri);const b=(l.samplers||{})[u.sampler]||{};return A.magFilter=Mb[b.magFilter]||Et,A.minFilter=Mb[b.minFilter]||hn,A.wrapS=Rb[b.wrapS]||ds,A.wrapT=Rb[b.wrapT]||ds,A.generateMipmaps=!A.isCompressedTexture&&A.minFilter!==gi&&A.minFilter!==Et,a.associations.set(A,{textures:e}),A}).catch(function(){return null});return this.textureCache[p]=m,m}loadImageSource(e,t){const i=this,a=this.json,l=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(_=>_.clone());const u=a.images[e],d=self.URL||self.webkitURL;let p=u.uri||"",m=!1;if(u.bufferView!==void 0)p=i.getDependency("bufferView",u.bufferView).then(function(_){m=!0;const b=new Blob([_],{type:u.mimeType});return p=d.createObjectURL(b),p});else if(u.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const A=Promise.resolve(p).then(function(_){return new Promise(function(b,w){let E=b;t.isImageBitmapLoader===!0&&(E=function(C){const T=new Kt(C);T.needsUpdate=!0,b(T)}),t.load(cu.resolveURL(_,l.path),E,void 0,w)})}).then(function(_){return m===!0&&d.revokeObjectURL(p),Zs(_,u),_.userData.mimeType=u.mimeType||yO(u.uri),_}).catch(function(_){throw console.error("THREE.GLTFLoader: Couldn't load texture",p),_});return this.sourceCache[e]=A,A}assignTexture(e,t,i,a){const l=this;return this.getDependency("texture",i.index).then(function(u){if(!u)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(u=u.clone(),u.channel=i.texCoord),l.extensions[yt.KHR_TEXTURE_TRANSFORM]){const d=i.extensions!==void 0?i.extensions[yt.KHR_TEXTURE_TRANSFORM]:void 0;if(d){const p=l.associations.get(u);u=l.extensions[yt.KHR_TEXTURE_TRANSFORM].extendTexture(u,d),l.associations.set(u,p)}}return a!==void 0&&(u.colorSpace=a),e[t]=u,u})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const a=t.attributes.tangent===void 0,l=t.attributes.color!==void 0,u=t.attributes.normal===void 0;if(e.isPoints){const d="PointsMaterial:"+i.uuid;let p=this.cache.get(d);p||(p=new PS,jn.prototype.copy.call(p,i),p.color.copy(i.color),p.map=i.map,p.sizeAttenuation=!1,this.cache.add(d,p)),i=p}else if(e.isLine){const d="LineBasicMaterial:"+i.uuid;let p=this.cache.get(d);p||(p=new Ou,jn.prototype.copy.call(p,i),p.color.copy(i.color),p.map=i.map,this.cache.add(d,p)),i=p}if(a||l||u){let d="ClonedMaterial:"+i.uuid+":";a&&(d+="derivative-tangents:"),l&&(d+="vertex-colors:"),u&&(d+="flat-shading:");let p=this.cache.get(d);p||(p=i.clone(),l&&(p.vertexColors=!0),u&&(p.flatShading=!0),a&&(p.normalScale&&(p.normalScale.y*=-1),p.clearcoatNormalScale&&(p.clearcoatNormalScale.y*=-1)),this.cache.add(d,p),this.associations.set(p,this.associations.get(i))),i=p}e.material=i}getMaterialType(){return Su}loadMaterial(e){const t=this,i=this.json,a=this.extensions,l=i.materials[e];let u;const d={},p=l.extensions||{},m=[];if(p[yt.KHR_MATERIALS_UNLIT]){const _=a[yt.KHR_MATERIALS_UNLIT];u=_.getMaterialType(),m.push(_.extendParams(d,l,t))}else{const _=l.pbrMetallicRoughness||{};if(d.color=new Ye(1,1,1),d.opacity=1,Array.isArray(_.baseColorFactor)){const b=_.baseColorFactor;d.color.setRGB(b[0],b[1],b[2],qt),d.opacity=b[3]}_.baseColorTexture!==void 0&&m.push(t.assignTexture(d,"map",_.baseColorTexture,Ht)),d.metalness=_.metallicFactor!==void 0?_.metallicFactor:1,d.roughness=_.roughnessFactor!==void 0?_.roughnessFactor:1,_.metallicRoughnessTexture!==void 0&&(m.push(t.assignTexture(d,"metalnessMap",_.metallicRoughnessTexture)),m.push(t.assignTexture(d,"roughnessMap",_.metallicRoughnessTexture))),u=this._invokeOne(function(b){return b.getMaterialType&&b.getMaterialType(e)}),m.push(Promise.all(this._invokeAll(function(b){return b.extendMaterialParams&&b.extendMaterialParams(e,d)})))}l.doubleSided===!0&&(d.side=Ri);const A=l.alphaMode||jp.OPAQUE;if(A===jp.BLEND?(d.transparent=!0,d.depthWrite=!1):(d.transparent=!1,A===jp.MASK&&(d.alphaTest=l.alphaCutoff!==void 0?l.alphaCutoff:.5)),l.normalTexture!==void 0&&u!==Pi&&(m.push(t.assignTexture(d,"normalMap",l.normalTexture)),d.normalScale=new Ve(1,1),l.normalTexture.scale!==void 0)){const _=l.normalTexture.scale;d.normalScale.set(_,_)}if(l.occlusionTexture!==void 0&&u!==Pi&&(m.push(t.assignTexture(d,"aoMap",l.occlusionTexture)),l.occlusionTexture.strength!==void 0&&(d.aoMapIntensity=l.occlusionTexture.strength)),l.emissiveFactor!==void 0&&u!==Pi){const _=l.emissiveFactor;d.emissive=new Ye().setRGB(_[0],_[1],_[2],qt)}return l.emissiveTexture!==void 0&&u!==Pi&&m.push(t.assignTexture(d,"emissiveMap",l.emissiveTexture,Ht)),Promise.all(m).then(function(){const _=new u(d);return l.name&&(_.name=l.name),Zs(_,l),t.associations.set(_,{materials:e}),l.extensions&&ua(a,_,l),_})}createUniqueName(e){const t=xt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,a=this.primitiveCache;function l(d){return i[yt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(d,t).then(function(p){return Bb(p,d,t)})}const u=[];for(let d=0,p=e.length;d<p;d++){const m=e[d],A=_O(m),_=a[A];if(_)u.push(_.promise);else{let b;m.extensions&&m.extensions[yt.KHR_DRACO_MESH_COMPRESSION]?b=l(m):b=Bb(new Di,m,t),a[A]={primitive:m,promise:b},u.push(b)}}return Promise.all(u)}loadMesh(e){const t=this,i=this.json,a=this.extensions,l=i.meshes[e],u=l.primitives,d=[];for(let p=0,m=u.length;p<m;p++){const A=u[p].material===void 0?mO(this.cache):this.getDependency("material",u[p].material);d.push(A)}return d.push(t.loadGeometries(u)),Promise.all(d).then(function(p){const m=p.slice(0,p.length-1),A=p[p.length-1],_=[];for(let w=0,E=A.length;w<E;w++){const C=A[w],T=u[w];let x;const P=m[w];if(T.mode===zn.TRIANGLES||T.mode===zn.TRIANGLE_STRIP||T.mode===zn.TRIANGLE_FAN||T.mode===void 0)x=l.isSkinnedMesh===!0?new nR(C,P):new lt(C,P),x.isSkinnedMesh===!0&&x.normalizeSkinWeights(),T.mode===zn.TRIANGLE_STRIP?x.geometry=Tb(x.geometry,_S):T.mode===zn.TRIANGLE_FAN&&(x.geometry=Tb(x.geometry,_A));else if(T.mode===zn.LINES)x=new z0(C,P);else if(T.mode===zn.LINE_STRIP)x=new Cl(C,P);else if(T.mode===zn.LINE_LOOP)x=new cR(C,P);else if(T.mode===zn.POINTS)x=new uR(C,P);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(x.geometry.morphAttributes).length>0&&AO(x,l),x.name=t.createUniqueName(l.name||"mesh_"+e),Zs(x,l),T.extensions&&ua(a,x,T),t.assignFinalMaterial(x),_.push(x)}for(let w=0,E=_.length;w<E;w++)t.associations.set(_[w],{meshes:e,primitives:w});if(_.length===1)return l.extensions&&ua(a,_[0],l),_[0];const b=new mi;l.extensions&&ua(a,b,l),t.associations.set(b,{meshes:e});for(let w=0,E=_.length;w<E;w++)b.add(_[w]);return b})}loadCamera(e){let t;const i=this.json.cameras[e],a=i[i.type];if(!a){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new _i(xl.radToDeg(a.yfov),a.aspectRatio||1,a.znear||1,a.zfar||2e6):i.type==="orthographic"&&(t=new Kr(-a.xmag,a.xmag,a.ymag,-a.ymag,a.znear,a.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),Zs(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let a=0,l=t.joints.length;a<l;a++)i.push(this._loadNodeShallow(t.joints[a]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(a){const l=a.pop(),u=a,d=[],p=[];for(let m=0,A=u.length;m<A;m++){const _=u[m];if(_){d.push(_);const b=new tt;l!==null&&b.fromArray(l.array,m*16),p.push(b)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[m])}return new F0(d,p)})}loadAnimation(e){const t=this.json,i=this,a=t.animations[e],l=a.name?a.name:"animation_"+e,u=[],d=[],p=[],m=[],A=[];for(let _=0,b=a.channels.length;_<b;_++){const w=a.channels[_],E=a.samplers[w.sampler],C=w.target,T=C.node,x=a.parameters!==void 0?a.parameters[E.input]:E.input,P=a.parameters!==void 0?a.parameters[E.output]:E.output;C.node!==void 0&&(u.push(this.getDependency("node",T)),d.push(this.getDependency("accessor",x)),p.push(this.getDependency("accessor",P)),m.push(E),A.push(C))}return Promise.all([Promise.all(u),Promise.all(d),Promise.all(p),Promise.all(m),Promise.all(A)]).then(function(_){const b=_[0],w=_[1],E=_[2],C=_[3],T=_[4],x=[];for(let P=0,M=b.length;P<M;P++){const B=b[P],D=w[P],G=E[P],U=C[P],V=T[P];if(B===void 0)continue;B.updateMatrix&&B.updateMatrix();const k=i._createAnimationTracks(B,D,G,U,V);if(k)for(let z=0;z<k.length;z++)x.push(k[z])}return new EA(l,void 0,x)})}createNodeMesh(e){const t=this.json,i=this,a=t.nodes[e];return a.mesh===void 0?null:i.getDependency("mesh",a.mesh).then(function(l){const u=i._getNodeRef(i.meshCache,a.mesh,l);return a.weights!==void 0&&u.traverse(function(d){if(d.isMesh)for(let p=0,m=a.weights.length;p<m;p++)d.morphTargetInfluences[p]=a.weights[p]}),u})}loadNode(e){const t=this.json,i=this,a=t.nodes[e],l=i._loadNodeShallow(e),u=[],d=a.children||[];for(let m=0,A=d.length;m<A;m++)u.push(i.getDependency("node",d[m]));const p=a.skin===void 0?Promise.resolve(null):i.getDependency("skin",a.skin);return Promise.all([l,Promise.all(u),p]).then(function(m){const A=m[0],_=m[1],b=m[2];b!==null&&A.traverse(function(w){w.isSkinnedMesh&&w.bind(b,bO)});for(let w=0,E=_.length;w<E;w++)A.add(_[w]);return A})}_loadNodeShallow(e){const t=this.json,i=this.extensions,a=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const l=t.nodes[e],u=l.name?a.createUniqueName(l.name):"",d=[],p=a._invokeOne(function(m){return m.createNodeMesh&&m.createNodeMesh(e)});return p&&d.push(p),l.camera!==void 0&&d.push(a.getDependency("camera",l.camera).then(function(m){return a._getNodeRef(a.cameraCache,l.camera,m)})),a._invokeAll(function(m){return m.createNodeAttachment&&m.createNodeAttachment(e)}).forEach(function(m){d.push(m)}),this.nodeCache[e]=Promise.all(d).then(function(m){let A;if(l.isBone===!0?A=new BS:m.length>1?A=new mi:m.length===1?A=m[0]:A=new Qt,A!==m[0])for(let _=0,b=m.length;_<b;_++)A.add(m[_]);if(l.name&&(A.userData.name=l.name,A.name=u),Zs(A,l),l.extensions&&ua(i,A,l),l.matrix!==void 0){const _=new tt;_.fromArray(l.matrix),A.applyMatrix4(_)}else l.translation!==void 0&&A.position.fromArray(l.translation),l.rotation!==void 0&&A.quaternion.fromArray(l.rotation),l.scale!==void 0&&A.scale.fromArray(l.scale);return a.associations.has(A)||a.associations.set(A,{}),a.associations.get(A).nodes=e,A}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],a=this,l=new mi;i.name&&(l.name=a.createUniqueName(i.name)),Zs(l,i),i.extensions&&ua(t,l,i);const u=i.nodes||[],d=[];for(let p=0,m=u.length;p<m;p++)d.push(a.getDependency("node",u[p]));return Promise.all(d).then(function(p){for(let A=0,_=p.length;A<_;A++)l.add(p[A]);const m=A=>{const _=new Map;for(const[b,w]of a.associations)(b instanceof jn||b instanceof Kt)&&_.set(b,w);return A.traverse(b=>{const w=a.associations.get(b);w!=null&&_.set(b,w)}),_};return a.associations=m(l),l})}_createAnimationTracks(e,t,i,a,l){const u=[],d=e.name?e.name:e.uuid,p=[];vr[l.path]===vr.weights?e.traverse(function(b){b.morphTargetInfluences&&p.push(b.name?b.name:b.uuid)}):p.push(d);let m;switch(vr[l.path]){case vr.weights:m=Tl;break;case vr.rotation:m=Il;break;case vr.position:case vr.scale:m=Ml;break;default:switch(i.itemSize){case 1:m=Tl;break;case 2:case 3:default:m=Ml;break}break}const A=a.interpolation!==void 0?pO[a.interpolation]:wl,_=this._getArrayFromAccessor(i);for(let b=0,w=p.length;b<w;b++){const E=new m(p[b]+"."+vr[l.path],t.array,_,A);a.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(E),u.push(E)}return u}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const i=PA(t.constructor),a=new Float32Array(t.length);for(let l=0,u=t.length;l<u;l++)a[l]=t[l]*i;t=a}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(i){const a=this instanceof Il?fO:w1;return new a(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function wO(o,e,t){const i=e.attributes,a=new yi;if(i.POSITION!==void 0){const d=t.json.accessors[i.POSITION],p=d.min,m=d.max;if(p!==void 0&&m!==void 0){if(a.set(new se(p[0],p[1],p[2]),new se(m[0],m[1],m[2])),d.normalized){const A=PA(ll[d.componentType]);a.min.multiplyScalar(A),a.max.multiplyScalar(A)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const l=e.targets;if(l!==void 0){const d=new se,p=new se;for(let m=0,A=l.length;m<A;m++){const _=l[m];if(_.POSITION!==void 0){const b=t.json.accessors[_.POSITION],w=b.min,E=b.max;if(w!==void 0&&E!==void 0){if(p.setX(Math.max(Math.abs(w[0]),Math.abs(E[0]))),p.setY(Math.max(Math.abs(w[1]),Math.abs(E[1]))),p.setZ(Math.max(Math.abs(w[2]),Math.abs(E[2]))),b.normalized){const C=PA(ll[b.componentType]);p.multiplyScalar(C)}d.max(p)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}a.expandByVector(d)}o.boundingBox=a;const u=new bn;a.getCenter(u.center),u.radius=a.min.distanceTo(a.max)/2,o.boundingSphere=u}function Bb(o,e,t){const i=e.attributes,a=[];function l(u,d){return t.getDependency("accessor",u).then(function(p){o.setAttribute(d,p)})}for(const u in i){const d=BA[u]||u.toLowerCase();d in o.attributes||a.push(l(i[u],d))}if(e.indices!==void 0&&!o.index){const u=t.getDependency("accessor",e.indices).then(function(d){o.setIndex(d)});a.push(u)}return wt.workingColorSpace!==qt&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${wt.workingColorSpace}" not supported.`),Zs(o,e),wO(o,e,t),Promise.all(a).then(function(){return e.targets!==void 0?gO(o,e.targets,t):o})}class E1 extends CR{constructor(e){super(e),this.type=hi}parse(e){const u=function(V,k){switch(V){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(k||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(k||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(k||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(k||""))}},_=function(V,k,z){k=k||1024;let Z=V.pos,K=-1,s=0,H="",y=String.fromCharCode.apply(null,new Uint16Array(V.subarray(Z,Z+128)));for(;0>(K=y.indexOf(`
|
|
4053
4053
|
`))&&s<k&&Z<V.byteLength;)H+=y,s+=y.length,Z+=128,y+=String.fromCharCode.apply(null,new Uint16Array(V.subarray(Z,Z+128)));return-1<K?(V.pos+=s+K+1,H+y.slice(0,K)):!1},b=function(V){const k=/^#\?(\S+)/,z=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,Q=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,Z=/^\s*FORMAT=(\S+)\s*$/,K=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,s={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let H,y;for((V.pos>=V.byteLength||!(H=_(V)))&&u(1,"no header found"),(y=H.match(k))||u(3,"bad initial token"),s.valid|=1,s.programtype=y[1],s.string+=H+`
|
|
4054
4054
|
`;H=_(V),H!==!1;){if(s.string+=H+`
|
|
4055
4055
|
`,H.charAt(0)==="#"){s.comments+=H+`
|
|
4056
|
-
`;continue}if((y=H.match(z))&&(s.gamma=parseFloat(y[1])),(y=H.match(Q))&&(s.exposure=parseFloat(y[1])),(y=H.match(Z))&&(s.valid|=2,s.format=y[1]),(y=H.match(K))&&(s.valid|=4,s.height=parseInt(y[1],10),s.width=parseInt(y[2],10)),s.valid&2&&s.valid&4)break}return s.valid&2||u(3,"missing format specifier"),s.valid&4||u(3,"missing image size specifier"),s},w=function(V,k,z){const Q=k;if(Q<8||Q>32767||V[0]!==2||V[1]!==2||V[2]&128)return new Uint8Array(V);Q!==(V[2]<<8|V[3])&&u(3,"wrong scanline width");const Z=new Uint8Array(4*k*z);Z.length||u(4,"unable to allocate buffer space");let K=0,s=0;const H=4*Q,y=new Uint8Array(4),ee=new Uint8Array(H);let I=z;for(;I>0&&s<V.byteLength;){s+4>V.byteLength&&u(1),y[0]=V[s++],y[1]=V[s++],y[2]=V[s++],y[3]=V[s++],(y[0]!=2||y[1]!=2||(y[2]<<8|y[3])!=Q)&&u(3,"bad rgbe scanline format");let re=0,Ae;for(;re<H&&s<V.byteLength;){Ae=V[s++];const n=Ae>128;if(n&&(Ae-=128),(Ae===0||re+Ae>H)&&u(3,"bad scanline data"),n){const r=V[s++];for(let c=0;c<Ae;c++)ee[re++]=r}else ee.set(V.subarray(s,s+Ae),re),re+=Ae,s+=Ae}const N=Q;for(let n=0;n<N;n++){let r=0;Z[K]=ee[n+r],r+=Q,Z[K+1]=ee[n+r],r+=Q,Z[K+2]=ee[n+r],r+=Q,Z[K+3]=ee[n+r],K+=4}I--}return Z},E=function(V,k,z,Q){const Z=V[k+3],K=Math.pow(2,Z-128)/255;z[Q+0]=V[k+0]*K,z[Q+1]=V[k+1]*K,z[Q+2]=V[k+2]*K,z[Q+3]=1},C=function(V,k,z,Q){const Z=V[k+3],K=Math.pow(2,Z-128)/255;z[Q+0]=ch.toHalfFloat(Math.min(V[k+0]*K,65504)),z[Q+1]=ch.toHalfFloat(Math.min(V[k+1]*K,65504)),z[Q+2]=ch.toHalfFloat(Math.min(V[k+2]*K,65504)),z[Q+3]=ch.toHalfFloat(1)},T=new Uint8Array(e);T.pos=0;const x=b(T),P=x.width,M=x.height,B=w(T.subarray(T.pos),P,M);let D,G,U;switch(this.type){case oi:U=B.length/4;const V=new Float32Array(U*4);for(let z=0;z<U;z++)E(B,z*4,V,z*4);D=V,G=oi;break;case hi:U=B.length/4;const k=new Uint16Array(U*4);for(let z=0;z<U;z++)C(B,z*4,k,z*4);D=k,G=hi;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:P,height:M,data:D,header:x.string,gamma:x.gamma,exposure:x.exposure,type:G}}setDataType(e){return this.type=e,this}load(e,t,i,a){function l(u,d){switch(u.type){case oi:case hi:u.colorSpace=qt,u.minFilter=wt,u.magFilter=wt,u.generateMipmaps=!1,u.flipY=!0;break}t&&t(u,d)}return super.load(e,l,i,a)}}class EO{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const i=this.workersResolve[e];if(i&&i(t),this.queue.length){const{resolve:a,msg:l,transfer:u}=this.queue.shift();this.workersResolve[e]=a,this.workers[e].postMessage(l,u)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{const a=this._getIdleWorker();a!==-1?(this._initWorker(a),this.workerStatus|=1<<a,this.workersResolve[a]=i,this.workers[a].postMessage(e,t)):this.queue.push({resolve:i,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}let Wp,Ks,LA;const Yp={env:{emscripten_notify_memory_growth:function(o){LA=new Uint8Array(Ks.exports.memory.buffer)}}};class xO{init(){return Wp||(Wp=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Pb).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Yp)).then(this._init):WebAssembly.instantiate(Buffer.from(Pb,"base64"),Yp).then(this._init),Wp)}_init(e){Ks=e.instance,Yp.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Ks)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=e.byteLength,a=Ks.exports.malloc(i);LA.set(e,a),t=t||Number(Ks.exports.ZSTD_findDecompressedSize(a,i));const l=Ks.exports.malloc(t),u=Ks.exports.ZSTD_decompress(l,t,a,i),d=LA.slice(l,l+u);return Ks.exports.free(a),Ks.exports.free(l),d}}const Pb="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",SO="display-p3",CO="display-p3-linear",Xp=new WeakMap;let Kp=0,Jp;class Hn extends Ps{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new EO,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new lr(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),i=new lr(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);const a=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,a]).then(([l,u])=>{const d=Hn.BasisWorker.toString(),p=["/* constants */","let _EngineFormat = "+JSON.stringify(Hn.EngineFormat),"let _EngineType = "+JSON.stringify(Hn.EngineType),"let _TranscoderFormat = "+JSON.stringify(Hn.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Hn.BasisFormat),"/* basis_transcoder.js */",l,"/* worker */",d.substring(d.indexOf("{")+1,d.lastIndexOf("}"))].join(`
|
|
4057
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([p])),this.transcoderBinary=u,this.workerPool.setWorkerCreator(()=>{const m=new Worker(this.workerSourceURL),A=this.transcoderBinary.slice(0);return m.postMessage({type:"init",config:this.workerConfig,transcoderBinary:A},[A]),m})}),Kp>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Kp++}return this.transcoderPending}load(e,t,i,a){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const l=new lr(this.manager);l.setResponseType("arraybuffer"),l.setWithCredentials(this.withCredentials),l.load(e,u=>{this.parse(u,t,a)},i,a)}parse(e,t,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Xp.has(e))return Xp.get(e).promise.then(t).catch(i);this._createTexture(e).then(a=>t?t(a):null).catch(i)}_createTextureFrom(e,t){const{type:i,error:a,data:{faces:l,width:u,height:d,format:p,type:m,dfdFlags:A}}=e;if(i==="error")return Promise.reject(a);let _;if(t.faceCount===6)_=new fR(l,p,m);else{const b=l[0].mipmaps;_=t.layerCount>1?new dR(b,u,d,t.layerCount,p,m):new Ua(b,u,d,p,m)}return _.minFilter=l[0].mipmaps.length===1?
|
|
4056
|
+
`;continue}if((y=H.match(z))&&(s.gamma=parseFloat(y[1])),(y=H.match(Q))&&(s.exposure=parseFloat(y[1])),(y=H.match(Z))&&(s.valid|=2,s.format=y[1]),(y=H.match(K))&&(s.valid|=4,s.height=parseInt(y[1],10),s.width=parseInt(y[2],10)),s.valid&2&&s.valid&4)break}return s.valid&2||u(3,"missing format specifier"),s.valid&4||u(3,"missing image size specifier"),s},w=function(V,k,z){const Q=k;if(Q<8||Q>32767||V[0]!==2||V[1]!==2||V[2]&128)return new Uint8Array(V);Q!==(V[2]<<8|V[3])&&u(3,"wrong scanline width");const Z=new Uint8Array(4*k*z);Z.length||u(4,"unable to allocate buffer space");let K=0,s=0;const H=4*Q,y=new Uint8Array(4),ee=new Uint8Array(H);let I=z;for(;I>0&&s<V.byteLength;){s+4>V.byteLength&&u(1),y[0]=V[s++],y[1]=V[s++],y[2]=V[s++],y[3]=V[s++],(y[0]!=2||y[1]!=2||(y[2]<<8|y[3])!=Q)&&u(3,"bad rgbe scanline format");let re=0,Ae;for(;re<H&&s<V.byteLength;){Ae=V[s++];const n=Ae>128;if(n&&(Ae-=128),(Ae===0||re+Ae>H)&&u(3,"bad scanline data"),n){const r=V[s++];for(let c=0;c<Ae;c++)ee[re++]=r}else ee.set(V.subarray(s,s+Ae),re),re+=Ae,s+=Ae}const N=Q;for(let n=0;n<N;n++){let r=0;Z[K]=ee[n+r],r+=Q,Z[K+1]=ee[n+r],r+=Q,Z[K+2]=ee[n+r],r+=Q,Z[K+3]=ee[n+r],K+=4}I--}return Z},E=function(V,k,z,Q){const Z=V[k+3],K=Math.pow(2,Z-128)/255;z[Q+0]=V[k+0]*K,z[Q+1]=V[k+1]*K,z[Q+2]=V[k+2]*K,z[Q+3]=1},C=function(V,k,z,Q){const Z=V[k+3],K=Math.pow(2,Z-128)/255;z[Q+0]=ch.toHalfFloat(Math.min(V[k+0]*K,65504)),z[Q+1]=ch.toHalfFloat(Math.min(V[k+1]*K,65504)),z[Q+2]=ch.toHalfFloat(Math.min(V[k+2]*K,65504)),z[Q+3]=ch.toHalfFloat(1)},T=new Uint8Array(e);T.pos=0;const x=b(T),P=x.width,M=x.height,B=w(T.subarray(T.pos),P,M);let D,G,U;switch(this.type){case oi:U=B.length/4;const V=new Float32Array(U*4);for(let z=0;z<U;z++)E(B,z*4,V,z*4);D=V,G=oi;break;case hi:U=B.length/4;const k=new Uint16Array(U*4);for(let z=0;z<U;z++)C(B,z*4,k,z*4);D=k,G=hi;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:P,height:M,data:D,header:x.string,gamma:x.gamma,exposure:x.exposure,type:G}}setDataType(e){return this.type=e,this}load(e,t,i,a){function l(u,d){switch(u.type){case oi:case hi:u.colorSpace=qt,u.minFilter=Et,u.magFilter=Et,u.generateMipmaps=!1,u.flipY=!0;break}t&&t(u,d)}return super.load(e,l,i,a)}}class EO{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const i=this.workersResolve[e];if(i&&i(t),this.queue.length){const{resolve:a,msg:l,transfer:u}=this.queue.shift();this.workersResolve[e]=a,this.workers[e].postMessage(l,u)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{const a=this._getIdleWorker();a!==-1?(this._initWorker(a),this.workerStatus|=1<<a,this.workersResolve[a]=i,this.workers[a].postMessage(e,t)):this.queue.push({resolve:i,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}let Wp,Ks,LA;const Yp={env:{emscripten_notify_memory_growth:function(o){LA=new Uint8Array(Ks.exports.memory.buffer)}}};class xO{init(){return Wp||(Wp=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Pb).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Yp)).then(this._init):WebAssembly.instantiate(Buffer.from(Pb,"base64"),Yp).then(this._init),Wp)}_init(e){Ks=e.instance,Yp.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Ks)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=e.byteLength,a=Ks.exports.malloc(i);LA.set(e,a),t=t||Number(Ks.exports.ZSTD_findDecompressedSize(a,i));const l=Ks.exports.malloc(t),u=Ks.exports.ZSTD_decompress(l,t,a,i),d=LA.slice(l,l+u);return Ks.exports.free(a),Ks.exports.free(l),d}}const Pb="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",SO="display-p3",CO="display-p3-linear",Xp=new WeakMap;let Kp=0,Jp;class Hn extends Ps{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new EO,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new lr(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),i=new lr(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);const a=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,a]).then(([l,u])=>{const d=Hn.BasisWorker.toString(),p=["/* constants */","let _EngineFormat = "+JSON.stringify(Hn.EngineFormat),"let _EngineType = "+JSON.stringify(Hn.EngineType),"let _TranscoderFormat = "+JSON.stringify(Hn.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Hn.BasisFormat),"/* basis_transcoder.js */",l,"/* worker */",d.substring(d.indexOf("{")+1,d.lastIndexOf("}"))].join(`
|
|
4057
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([p])),this.transcoderBinary=u,this.workerPool.setWorkerCreator(()=>{const m=new Worker(this.workerSourceURL),A=this.transcoderBinary.slice(0);return m.postMessage({type:"init",config:this.workerConfig,transcoderBinary:A},[A]),m})}),Kp>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Kp++}return this.transcoderPending}load(e,t,i,a){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const l=new lr(this.manager);l.setResponseType("arraybuffer"),l.setWithCredentials(this.withCredentials),l.load(e,u=>{this.parse(u,t,a)},i,a)}parse(e,t,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Xp.has(e))return Xp.get(e).promise.then(t).catch(i);this._createTexture(e).then(a=>t?t(a):null).catch(i)}_createTextureFrom(e,t){const{type:i,error:a,data:{faces:l,width:u,height:d,format:p,type:m,dfdFlags:A}}=e;if(i==="error")return Promise.reject(a);let _;if(t.faceCount===6)_=new fR(l,p,m);else{const b=l[0].mipmaps;_=t.layerCount>1?new dR(b,u,d,t.layerCount,p,m):new Ua(b,u,d,p,m)}return _.minFilter=l[0].mipmaps.length===1?Et:hn,_.magFilter=Et,_.generateMipmaps=!1,_.needsUpdate=!0,_.colorSpace=x1(t),_.premultiplyAlpha=!!(A&bN),_}async _createTexture(e,t={}){const i=CN(new Uint8Array(e)),a=i.vkFormat===Z0&&i.dataFormatDescriptor[0].colorModel===167;if(!(i.vkFormat===xN||a&&!this.workerConfig.astcHDRSupported))return IO(i);const u=t,d=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:u},[e])).then(p=>this._createTextureFrom(p.data,i));return Xp.set(e,{promise:d}),d}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Kp--,this}}Hn.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};Hn.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25};Hn.EngineFormat={RGBAFormat:Xt,RGBA_ASTC_4x4_Format:wu,RGB_BPTC_UNSIGNED_Format:Wd,RGBA_BPTC_Format:au,RGBA_ETC2_EAC_Format:qd,RGBA_PVRTC_4BPPV1_Format:Vd,RGBA_S3TC_DXT5_Format:ru,RGB_ETC1_Format:Qd,RGB_ETC2_Format:jd,RGB_PVRTC_4BPPV1_Format:Hd,RGBA_S3TC_DXT1_Format:su};Hn.EngineType={UnsignedByteType:ui,HalfFloatType:hi,FloatType:oi};Hn.BasisWorker=function(){let o,e,t;const i=_EngineFormat,a=_EngineType,l=_TranscoderFormat,u=_BasisFormat;self.addEventListener("message",function(E){const C=E.data;switch(C.type){case"init":o=C.config,d(C.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:T,buffers:x,width:P,height:M,hasAlpha:B,format:D,type:G,dfdFlags:U}=p(C.buffer);self.postMessage({type:"transcode",id:C.id,data:{faces:T,width:P,height:M,hasAlpha:B,format:D,type:G,dfdFlags:U}},x)}catch(T){console.error(T),self.postMessage({type:"error",id:C.id,error:T.message})}});break}});function d(E){e=new Promise(C=>{t={wasmBinary:E,onRuntimeInitialized:C},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function p(E){const C=new t.KTX2File(new Uint8Array(E));function T(){C.close(),C.delete()}if(!C.isValid())throw T(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let x;if(C.isUASTC())x=u.UASTC;else if(C.isETC1S())x=u.ETC1S;else if(C.isHDR())x=u.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const P=C.getWidth(),M=C.getHeight(),B=C.getLayers()||1,D=C.getLevels(),G=C.getFaces(),U=C.getHasAlpha(),V=C.getDFDFlags(),{transcoderFormat:k,engineFormat:z,engineType:Q}=_(x,P,M,U);if(!P||!M||!D)throw T(),new Error("THREE.KTX2Loader: Invalid texture");if(!C.startTranscoding())throw T(),new Error("THREE.KTX2Loader: .startTranscoding failed");const Z=[],K=[];for(let s=0;s<G;s++){const H=[];for(let y=0;y<D;y++){const ee=[];let I,re;for(let N=0;N<B;N++){const n=C.getImageLevelInfo(y,N,s);s===0&&y===0&&N===0&&(n.origWidth%4!==0||n.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),D>1?(I=n.origWidth,re=n.origHeight):(I=n.width,re=n.height);let r=new Uint8Array(C.getImageTranscodedSizeInBytes(y,N,0,k));const c=C.transcodeImage(r,y,N,s,k,0,-1,-1);if(Q===a.HalfFloatType&&(r=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!c)throw T(),new Error("THREE.KTX2Loader: .transcodeImage failed.");ee.push(r)}const Ae=w(ee);H.push({data:Ae,width:I,height:re}),K.push(Ae.buffer)}Z.push({mipmaps:H,width:P,height:M,format:z,type:Q})}return T(),{faces:Z,buffers:K,width:P,height:M,hasAlpha:U,dfdFlags:V,format:z,type:Q}}const m=[{if:"astcSupported",basisFormat:[u.UASTC],transcoderFormat:[l.ASTC_4x4,l.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],engineType:[a.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[u.ETC1S,u.UASTC],transcoderFormat:[l.BC7_M5,l.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],engineType:[a.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[u.ETC1S,u.UASTC],transcoderFormat:[l.BC1,l.BC3],engineFormat:[i.RGBA_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],engineType:[a.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[u.ETC1S,u.UASTC],transcoderFormat:[l.ETC1,l.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],engineType:[a.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[u.ETC1S,u.UASTC],transcoderFormat:[l.ETC1],engineFormat:[i.RGB_ETC1_Format],engineType:[a.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[u.ETC1S,u.UASTC],transcoderFormat:[l.PVRTC1_4_RGB,l.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],engineType:[a.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[u.UASTC_HDR],transcoderFormat:[l.BC6H],engineFormat:[i.RGB_BPTC_UNSIGNED_Format],engineType:[a.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[u.ETC1S,u.UASTC],transcoderFormat:[l.RGBA32,l.RGBA32],engineFormat:[i.RGBAFormat,i.RGBAFormat],engineType:[a.UnsignedByteType,a.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[u.UASTC_HDR],transcoderFormat:[l.RGBA_HALF],engineFormat:[i.RGBAFormat],engineType:[a.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],A={[u.ETC1S]:m.filter(E=>E.basisFormat.includes(u.ETC1S)).sort((E,C)=>E.priorityUASTC-C.priorityUASTC),[u.UASTC]:m.filter(E=>E.basisFormat.includes(u.UASTC)).sort((E,C)=>E.priorityUASTC-C.priorityUASTC),[u.UASTC_HDR]:m.filter(E=>E.basisFormat.includes(u.UASTC_HDR)).sort((E,C)=>E.priorityHDR-C.priorityHDR)};function _(E,C,T,x){const P=A[E];for(let M=0;M<P.length;M++){const B=P[M];if(B.if&&!o[B.if]||!B.basisFormat.includes(E)||x&&B.transcoderFormat.length<2||B.needsPowerOfTwo&&!(b(C)&&b(T)))continue;const D=B.transcoderFormat[x?1:0],G=B.engineFormat[x?1:0],U=B.engineType[0];return{transcoderFormat:D,engineFormat:G,engineType:U}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function b(E){return E<=2?!0:(E&E-1)===0&&E!==0}function w(E){if(E.length===1)return E[0];let C=0;for(let P=0;P<E.length;P++){const M=E[P];C+=M.byteLength}const T=new Uint8Array(C);let x=0;for(let P=0;P<E.length;P++){const M=E[P];T.set(M,x),x+=M.byteLength}return T}};const TO=new Set([Xt,La,Or]),Zp={[f1]:Xt,[u1]:Xt,[a1]:Xt,[o1]:Xt,[d1]:La,[c1]:La,[s1]:La,[r1]:La,[h1]:Or,[l1]:Or,[n1]:Or,[i1]:Or,[Z0]:wu,[m1]:Eu,[p1]:Eu},em={[f1]:oi,[u1]:hi,[a1]:ui,[o1]:ui,[d1]:oi,[c1]:hi,[s1]:ui,[r1]:ui,[h1]:oi,[l1]:hi,[n1]:ui,[i1]:ui,[Z0]:hi,[m1]:ui,[p1]:ui};async function IO(o){const{vkFormat:e}=o;if(Zp[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;o.supercompressionScheme===wb&&(Jp||(Jp=new Promise(async l=>{const u=new xO;await u.init(),l(u)})),t=await Jp);const i=[];for(let l=0;l<o.levels.length;l++){const u=Math.max(1,o.pixelWidth>>l),d=Math.max(1,o.pixelHeight>>l),p=o.pixelDepth?Math.max(1,o.pixelDepth>>l):0,m=o.levels[l];let A;if(o.supercompressionScheme===yN)A=m.levelData;else if(o.supercompressionScheme===wb)A=t.decode(m.levelData,m.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let _;em[e]===oi?_=new Float32Array(A.buffer,A.byteOffset,A.byteLength/Float32Array.BYTES_PER_ELEMENT):em[e]===hi?_=new Uint16Array(A.buffer,A.byteOffset,A.byteLength/Uint16Array.BYTES_PER_ELEMENT):_=A,i.push({data:_,width:u,height:d,depth:p})}let a;if(TO.has(Zp[e]))a=o.pixelDepth===0?new Nu(i[0].data,o.pixelWidth,o.pixelHeight):new ES(i[0].data,o.pixelWidth,o.pixelHeight,o.pixelDepth);else{if(o.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");a=new Ua(i,o.pixelWidth,o.pixelHeight),a.minFilter=i.length===1?Et:hn,a.magFilter=Et}return a.mipmaps=i,a.type=em[e],a.format=Zp[e],a.colorSpace=x1(o),a.needsUpdate=!0,Promise.resolve(a)}function x1(o){const e=o.dataFormatDescriptor[0];return e.colorPrimaries===wN?e.transferFunction===Eb?Ht:qt:e.colorPrimaries===EN?e.transferFunction===Eb?SO:CO:(e.colorPrimaries===vN||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),Gn)}const MO={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
|
|
4058
4058
|
|
|
4059
4059
|
varying vec2 vUv;
|
|
4060
4060
|
|
|
@@ -4141,7 +4141,7 @@ ${l.join(`
|
|
|
4141
4141
|
|
|
4142
4142
|
gl_FragColor = sum;
|
|
4143
4143
|
|
|
4144
|
-
}`};function Bh(o,e,t){let i=t;const a=new se;return o.updateWorldMatrix(!0,!0),o.traverseVisible(l=>{const{geometry:u}=l;if(u!==void 0){const{position:d}=u.attributes;if(d!==void 0)for(let p=0,m=d.count;p<m;p++)l.isMesh?l.getVertexPosition(p,a):a.fromBufferAttribute(d,p),l.isSkinnedMesh||a.applyMatrix4(l.matrixWorld),i=e(i,a)}}),i}function NO(o){const e=new Map,t=new Map,i=o.clone();return T1(o,i,function(a,l){e.set(l,a),t.set(a,l)}),i.traverse(function(a){if(!a.isSkinnedMesh)return;const l=a,u=e.get(a),d=u.skeleton.bones;l.skeleton=u.skeleton.clone(),l.bindMatrix.copy(u.bindMatrix),l.skeleton.bones=d.map(function(p){return t.get(p)}),l.bind(l.skeleton,l.bindMatrix)}),i}function T1(o,e,t){t(o,e);for(let i=0;i<o.children.length;i++)T1(o.children[i],e.children[i],t)}class OO{constructor(e,t,i,a,l){this.xrLight=e,this.renderer=t,this.lightProbe=i,this.xrWebGLBinding=null,this.estimationStartCallback=l,this.frameCallback=this.onXRFrame.bind(this);const u=t.xr.getSession();if(a&&"XRWebGLBinding"in window){const d=new k0(16);e.environment=d.texture;const p=t.getContext();switch(u.preferredReflectionFormat){case"srgba8":p.getExtension("EXT_sRGB");break;case"rgba16f":p.getExtension("OES_texture_half_float");break}this.xrWebGLBinding=new XRWebGLBinding(u,p),this.lightProbe.addEventListener("reflectionchange",()=>{this.updateReflection()})}u.requestAnimationFrame(this.frameCallback)}updateReflection(){const e=this.renderer.properties.get(this.xrLight.environment);if(e){const t=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);t&&(e.__webglTexture=t,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(e,t){if(!this.xrLight)return;t.session.requestAnimationFrame(this.frameCallback);const a=t.getLightEstimate(this.lightProbe);if(a){this.xrLight.lightProbe.sh.fromArray(a.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;const l=Math.max(1,Math.max(a.primaryLightIntensity.x,Math.max(a.primaryLightIntensity.y,a.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(a.primaryLightIntensity.x/l,a.primaryLightIntensity.y/l,a.primaryLightIntensity.z/l),this.xrLight.directionalLight.intensity=l,this.xrLight.directionalLight.position.copy(a.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class kO extends mi{constructor(e,t=!0){super(),this.lightProbe=new PR,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new FS,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let i=null,a=!1;e.xr.addEventListener("sessionstart",()=>{const l=e.xr.getSession();"requestLightProbe"in l&&l.requestLightProbe({reflectionFormat:l.preferredReflectionFormat}).then(u=>{i=new OO(this,e,u,t,()=>{a=!0,this.dispatchEvent({type:"estimationstart"})})})}),e.xr.addEventListener("sessionend",()=>{i&&(i.dispose(),i=null),a&&this.dispatchEvent({type:"estimationend"})}),this.dispose=()=>{i&&(i.dispose(),i=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}class rf{constructor(){if(this.gltfLoader={},this.textureLoader={},rf.instance)return rf.instance;this.gltfLoader=this.initializeGltfLoader(),this.textureLoader=this.initializeTextureLoader()}initializeGltfLoader(){const e=new b1,t=new y1;return t.setDecoderPath("https://asset.myepigraph.com/configurator-assets/configurator-lite/external-libs/draco/"),e.setDRACOLoader(t),e}initializeTextureLoader(){return new H0}}var UO=function(){return performance.now()},I1=(function(){function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return o.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},o.prototype.removeAll=function(){this._tweens={}},o.prototype.add=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];for(var a=0,l=t;a<l.length;a++){var u=l[a];(e=u._group)===null||e===void 0||e.remove(u),u._group=this,this._tweens[u.getId()]=u,this._tweensAddedDuringUpdate[u.getId()]=u}},o.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i=0,a=e;i<a.length;i++){var l=a[i];l._group=void 0,delete this._tweens[l.getId()],delete this._tweensAddedDuringUpdate[l.getId()]}},o.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},o.prototype.update=function(e,t){e===void 0&&(e=UO()),t===void 0&&(t=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var a=0;a<i.length;a++){var l=this._tweens[i[a]],u=!t;l&&l.update(e,u)===!1&&!t&&this.remove(l)}i=Object.keys(this._tweensAddedDuringUpdate)}},o})(),FO=new I1,Cs=FO;Cs.getAll.bind(Cs);Cs.removeAll.bind(Cs);Cs.add.bind(Cs);Cs.remove.bind(Cs);Cs.update.bind(Cs);let M1=class{constructor(){this._listeners={}}addEventListener(e,t){const i=this._listeners;return i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t),this}removeEventListener(e,t){const a=this._listeners[e];if(a!==void 0){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}return this}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){const a=i.slice(0);for(let l=0,u=a.length;l<u;l++)a[l].call(this,e)}return this}dispose(){for(const e in this._listeners)delete this._listeners[e]}};class Xo{constructor(e,t,i,a={}){if(this._name=void 0,this._parent=void 0,this._child=void 0,this._attributes=void 0,this._disposed=!1,this._name=e,this._parent=t,this._child=i,this._attributes=a,!t.isOnGraph(i))throw new Error("Cannot connect disconnected graphs.")}getName(){return this._name}getParent(){return this._parent}getChild(){return this._child}setChild(e){return this._child=e,this}getAttributes(){return this._attributes}dispose(){this._disposed||(this._parent._destroyRef(this),this._disposed=!0)}isDisposed(){return this._disposed}}class $O extends M1{constructor(...e){super(...e),this._emptySet=new Set,this._edges=new Set,this._parentEdges=new Map,this._childEdges=new Map}listEdges(){return Array.from(this._edges)}listParentEdges(e){return Array.from(this._childEdges.get(e)||this._emptySet)}listParents(e){const t=new Set;for(const i of this.listParentEdges(e))t.add(i.getParent());return Array.from(t)}listChildEdges(e){return Array.from(this._parentEdges.get(e)||this._emptySet)}listChildren(e){const t=new Set;for(const i of this.listChildEdges(e))t.add(i.getChild());return Array.from(t)}disconnectParents(e,t){for(const i of this.listParentEdges(e))(!t||t(i.getParent()))&&i.dispose();return this}_createEdge(e,t,i,a){const l=new Xo(e,t,i,a);this._edges.add(l);const u=l.getParent();this._parentEdges.has(u)||this._parentEdges.set(u,new Set),this._parentEdges.get(u).add(l);const d=l.getChild();return this._childEdges.has(d)||this._childEdges.set(d,new Set),this._childEdges.get(d).add(l),l}_destroyEdge(e){return this._edges.delete(e),this._parentEdges.get(e.getParent()).delete(e),this._childEdges.get(e.getChild()).delete(e),this}}function hu(){return hu=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(o[i]=t[i])}return o},hu.apply(this,arguments)}class Ur{constructor(e){if(this.list=[],e)for(const t of e)this.list.push(t)}add(e){this.list.push(e)}remove(e){const t=this.list.indexOf(e);t>=0&&this.list.splice(t,1)}removeChild(e){const t=[];for(const i of this.list)i.getChild()===e&&t.push(i);for(const i of t)this.remove(i);return t}listRefsByChild(e){const t=[];for(const i of this.list)i.getChild()===e&&t.push(i);return t}values(){return this.list}}class Zt{constructor(e){if(this.set=new Set,this.map=new Map,e)for(const t of e)this.add(t)}add(e){const t=e.getChild();this.removeChild(t),this.set.add(e),this.map.set(t,e)}remove(e){this.set.delete(e),this.map.delete(e.getChild())}removeChild(e){const t=this.map.get(e)||null;return t&&this.remove(t),t}getRefByChild(e){return this.map.get(e)||null}values(){return Array.from(this.set)}}class Es{constructor(e){this.map={},e&&Object.assign(this.map,e)}set(e,t){this.map[e]=t}delete(e){delete this.map[e]}get(e){return this.map[e]||null}keys(){return Object.keys(this.map)}values(){return Object.values(this.map)}}const Bt=Symbol("attributes"),Ra=Symbol("immutableKeys");class e_ extends M1{constructor(e){super(),this._disposed=!1,this.graph=void 0,this[Bt]=void 0,this[Ra]=void 0,this.graph=e,this[Ra]=new Set,this[Bt]=this._createAttributes()}getDefaults(){return{}}_createAttributes(){const e=this.getDefaults(),t={};for(const i in e){const a=e[i];if(a instanceof e_){const l=this.graph._createEdge(i,this,a);this[Ra].add(i),t[i]=l}else t[i]=a}return t}isOnGraph(e){return this.graph===e.graph}isDisposed(){return this._disposed}dispose(){this._disposed||(this.graph.listChildEdges(this).forEach(e=>e.dispose()),this.graph.disconnectParents(this),this._disposed=!0,this.dispatchEvent({type:"dispose"}))}detach(){return this.graph.disconnectParents(this),this}swap(e,t){for(const i in this[Bt]){const a=this[Bt][i];if(a instanceof Xo){const l=a;l.getChild()===e&&this.setRef(i,t,l.getAttributes())}else if(a instanceof Ur)for(const l of a.listRefsByChild(e)){const u=l.getAttributes();this.removeRef(i,e),this.addRef(i,t,u)}else if(a instanceof Zt){const l=a.getRefByChild(e);if(l){const u=l.getAttributes();this.removeRef(i,e),this.addRef(i,t,u)}}else if(a instanceof Es)for(const l of a.keys()){const u=a.get(l);u.getChild()===e&&this.setRefMap(i,l,t,u.getAttributes())}}return this}get(e){return this[Bt][e]}set(e,t){return this[Bt][e]=t,this.dispatchEvent({type:"change",attribute:e})}getRef(e){const t=this[Bt][e];return t?t.getChild():null}setRef(e,t,i){if(this[Ra].has(e))throw new Error(`Cannot overwrite immutable attribute, "${e}".`);const a=this[Bt][e];if(a&&a.dispose(),!t)return this;const l=this.graph._createEdge(e,this,t,i);return this[Bt][e]=l,this.dispatchEvent({type:"change",attribute:e})}listRefs(e){return this.assertRefList(e).values().map(i=>i.getChild())}addRef(e,t,i){const a=this.graph._createEdge(e,this,t,i);return this.assertRefList(e).add(a),this.dispatchEvent({type:"change",attribute:e})}removeRef(e,t){const i=this.assertRefList(e);if(i instanceof Ur)for(const a of i.listRefsByChild(t))a.dispose();else{const a=i.getRefByChild(t);a&&a.dispose()}return this}assertRefList(e){const t=this[Bt][e];if(t instanceof Ur||t instanceof Zt)return t;throw new Error(`Expected RefList or RefSet for attribute "${e}"`)}listRefMapKeys(e){return this.assertRefMap(e).keys()}listRefMapValues(e){return this.assertRefMap(e).values().map(t=>t.getChild())}getRefMap(e,t){const a=this.assertRefMap(e).get(t);return a?a.getChild():null}setRefMap(e,t,i,a){const l=this.assertRefMap(e),u=l.get(t);if(u&&u.dispose(),!i)return this;a=Object.assign(a||{},{key:t});const d=this.graph._createEdge(e,this,i,hu({},a,{key:t}));return l.set(t,d),this.dispatchEvent({type:"change",attribute:e,key:t})}assertRefMap(e){const t=this[Bt][e];if(t instanceof Es)return t;throw new Error(`Expected RefMap for attribute "${e}"`)}dispatchEvent(e){return super.dispatchEvent(hu({},e,{target:this})),this.graph.dispatchEvent(hu({},e,{target:this,type:`node:${e.type}`})),this}_destroyRef(e){const t=e.getName();if(this[Bt][t]===e)this[Bt][t]=null,this[Ra].has(t)&&e.getChild().dispose();else if(this[Bt][t]instanceof Ur)this[Bt][t].remove(e);else if(this[Bt][t]instanceof Zt)this[Bt][t].remove(e);else if(this[Bt][t]instanceof Es){const i=this[Bt][t];for(const a of i.keys())i.get(a)===e&&i.delete(a)}else return;this.graph._destroyEdge(e),this.dispatchEvent({type:"change",attribute:t})}}const R1="v4.2.1",af="@glb.bin";var Te;(function(o){o.ACCESSOR="Accessor",o.ANIMATION="Animation",o.ANIMATION_CHANNEL="AnimationChannel",o.ANIMATION_SAMPLER="AnimationSampler",o.BUFFER="Buffer",o.CAMERA="Camera",o.MATERIAL="Material",o.MESH="Mesh",o.PRIMITIVE="Primitive",o.PRIMITIVE_TARGET="PrimitiveTarget",o.NODE="Node",o.ROOT="Root",o.SCENE="Scene",o.SKIN="Skin",o.TEXTURE="Texture",o.TEXTURE_INFO="TextureInfo"})(Te||(Te={}));var of;(function(o){o.INTERLEAVED="interleaved",o.SEPARATE="separate"})(of||(of={}));var Ln;(function(o){o.ARRAY_BUFFER="ARRAY_BUFFER",o.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",o.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",o.OTHER="OTHER",o.SPARSE="SPARSE"})(Ln||(Ln={}));var DA;(function(o){o[o.R=4096]="R",o[o.G=256]="G",o[o.B=16]="B",o[o.A=1]="A"})(DA||(DA={}));var Hr;(function(o){o.GLTF="GLTF",o.GLB="GLB"})(Hr||(Hr={}));const Uf={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};class yt{static createBufferFromDataURI(e){if(typeof Buffer>"u"){const t=atob(e.split(",")[1]),i=new Uint8Array(t.length);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}else{const t=e.split(",")[1],i=e.indexOf("base64")>=0;return Buffer.from(t,i?"base64":"utf8")}}static encodeText(e){return new TextEncoder().encode(e)}static decodeText(e){return new TextDecoder().decode(e)}static concat(e){let t=0;for(const l of e)t+=l.byteLength;const i=new Uint8Array(t);let a=0;for(const l of e)i.set(l,a),a+=l.byteLength;return i}static pad(e,t=0){const i=this.padNumber(e.byteLength);if(i===e.byteLength)return e;const a=new Uint8Array(i);if(a.set(e),t!==0)for(let l=e.byteLength;l<i;l++)a[l]=t;return a}static padNumber(e){return Math.ceil(e/4)*4}static equals(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;let i=e.byteLength;for(;i--;)if(e[i]!==t[i])return!1;return!0}static toView(e,t=0,i=1/0){return new Uint8Array(e.buffer,e.byteOffset+t,Math.min(e.byteLength,i))}static assertView(e){if(e&&!ArrayBuffer.isView(e))throw new Error(`Method requires Uint8Array parameter; received "${typeof e}".`);return e}}class zO{static hexToFactor(e,t){e=Math.floor(e);const i=t;return i[0]=(e>>16&255)/255,i[1]=(e>>8&255)/255,i[2]=(e&255)/255,this.convertSRGBToLinear(t,t)}static factorToHex(e){const t=[...e],[i,a,l]=this.convertLinearToSRGB(e,t);return i*255<<16^a*255<<8^l*255<<0}static convertSRGBToLinear(e,t){const i=e,a=t;for(let l=0;l<3;l++)a[l]=i[l]<.04045?i[l]*.0773993808:Math.pow(i[l]*.9478672986+.0521327014,2.4);return t}static convertLinearToSRGB(e,t){const i=e,a=t;for(let l=0;l<3;l++)a[l]=i[l]<.0031308?i[l]*12.92:1.055*Math.pow(i[l],.41666)-.055;return t}}class GO{match(e){return e.length>=3&&e[0]===255&&e[1]===216&&e[2]===255}getSize(e){let t=new DataView(e.buffer,e.byteOffset+4),i,a;for(;t.byteLength;){if(i=t.getUint16(0,!1),HO(t,i),a=t.getUint8(i+1),a===192||a===193||a===194)return[t.getUint16(i+7,!1),t.getUint16(i+5,!1)];t=new DataView(e.buffer,t.byteOffset+i+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(e){return 3}}class Ff{match(e){return e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10}getSize(e){const t=new DataView(e.buffer,e.byteOffset);return yt.decodeText(e.slice(12,16))===Ff.PNG_FRIED_CHUNK_NAME?[t.getUint32(32,!1),t.getUint32(36,!1)]:[t.getUint32(16,!1),t.getUint32(20,!1)]}getChannels(e){return 4}}Ff.PNG_FRIED_CHUNK_NAME="CgBI";class Fa{static registerFormat(e,t){this.impls[e]=t}static getMimeType(e){for(const t in this.impls)if(this.impls[t].match(e))return t;return null}static getSize(e,t){return this.impls[t]?this.impls[t].getSize(e):null}static getChannels(e,t){return this.impls[t]?this.impls[t].getChannels(e):null}static getVRAMByteLength(e,t){if(!this.impls[t])return null;if(this.impls[t].getVRAMByteLength)return this.impls[t].getVRAMByteLength(e);let i=0;const a=4,l=this.getSize(e,t);if(!l)return null;for(;l[0]>1||l[1]>1;)i+=l[0]*l[1]*a,l[0]=Math.max(Math.floor(l[0]/2),1),l[1]=Math.max(Math.floor(l[1]/2),1);return i+=1*a,i}static mimeTypeToExtension(e){return e==="image/jpeg"?"jpg":e.split("/").pop()}static extensionToMimeType(e){return e==="jpg"?"image/jpeg":e?`image/${e}`:""}}Fa.impls={"image/jpeg":new GO,"image/png":new Ff};function HO(o,e){if(e>o.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(o.getUint8(e)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return o}class Rl{static basename(e){const t=e.split(/[\\/]/).pop();return t.substring(0,t.lastIndexOf("."))}static extension(e){if(e.startsWith("data:image/")){const t=e.match(/data:(image\/\w+)/)[1];return Fa.mimeTypeToExtension(t)}else{if(e.startsWith("data:model/gltf+json"))return"gltf";if(e.startsWith("data:model/gltf-binary"))return"glb";if(e.startsWith("data:application/"))return"bin"}return e.split(/[\\/]/).pop().split(/[.]/).pop()}}var NA=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var o=0,e=arguments.length;e--;)o+=arguments[e]*arguments[e];return Math.sqrt(o)});function VO(){var o=new NA(3);return NA!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),o}function tm(o){var e=o[0],t=o[1],i=o[2];return Math.hypot(e,t,i)}(function(){var o=VO();return function(e,t,i,a,l,u){var d,p;for(t||(t=3),i||(i=0),a?p=Math.min(a*t+i,e.length):p=e.length,d=i;d<p;d+=t)o[0]=e[d],o[1]=e[d+1],o[2]=e[d+2],l(o,o,u),e[d]=o[0],e[d+1]=o[1],e[d+2]=o[2];return e}})();const Ub="https://null.example";class du{static dirname(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substring(0,t+1)}static basename(e){return Rl.basename(new URL(e,Ub).pathname)}static extension(e){return Rl.extension(new URL(e,Ub).pathname)}static resolve(e,t){if(!this.isRelativePath(t))return t;const i=e.split("/"),a=t.split("/");i.pop();for(let l=0;l<a.length;l++)a[l]!=="."&&(a[l]===".."?i.pop():i.push(a[l]));return i.join("/")}static isAbsoluteURL(e){return this.PROTOCOL_REGEXP.test(e)}static isRelativePath(e){return!/^(?:[a-zA-Z]+:)?\//.test(e)}}du.DEFAULT_INIT={};du.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;function Fb(o){return Object.prototype.toString.call(o)==="[object Object]"}function Da(o){if(Fb(o)===!1)return!1;const e=o.constructor;if(e===void 0)return!0;const t=e.prototype;return!(Fb(t)===!1||Object.hasOwn(t,"isPrototypeOf")===!1)}var OA,kA;(function(o){o[o.SILENT=4]="SILENT",o[o.ERROR=3]="ERROR",o[o.WARN=2]="WARN",o[o.INFO=1]="INFO",o[o.DEBUG=0]="DEBUG"})(kA||(kA={}));class Qn{constructor(e){this.verbosity=void 0,this.verbosity=e}debug(e){this.verbosity<=Qn.Verbosity.DEBUG&&console.debug(e)}info(e){this.verbosity<=Qn.Verbosity.INFO&&console.info(e)}warn(e){this.verbosity<=Qn.Verbosity.WARN&&console.warn(e)}error(e){this.verbosity<=Qn.Verbosity.ERROR&&console.error(e)}}OA=Qn;Qn.Verbosity=kA;Qn.DEFAULT_INSTANCE=new OA(OA.Verbosity.INFO);function QO(o){var e=o[0],t=o[1],i=o[2],a=o[3],l=o[4],u=o[5],d=o[6],p=o[7],m=o[8],A=o[9],_=o[10],b=o[11],w=o[12],E=o[13],C=o[14],T=o[15],x=e*u-t*l,P=e*d-i*l,M=e*p-a*l,B=t*d-i*u,D=t*p-a*u,G=i*p-a*d,U=m*E-A*w,V=m*C-_*w,k=m*T-b*w,z=A*C-_*E,Q=A*T-b*E,Z=_*T-b*C;return x*Z-P*Q+M*z+B*k-D*V+G*U}function jO(o,e,t){var i=e[0],a=e[1],l=e[2],u=e[3],d=e[4],p=e[5],m=e[6],A=e[7],_=e[8],b=e[9],w=e[10],E=e[11],C=e[12],T=e[13],x=e[14],P=e[15],M=t[0],B=t[1],D=t[2],G=t[3];return o[0]=M*i+B*d+D*_+G*C,o[1]=M*a+B*p+D*b+G*T,o[2]=M*l+B*m+D*w+G*x,o[3]=M*u+B*A+D*E+G*P,M=t[4],B=t[5],D=t[6],G=t[7],o[4]=M*i+B*d+D*_+G*C,o[5]=M*a+B*p+D*b+G*T,o[6]=M*l+B*m+D*w+G*x,o[7]=M*u+B*A+D*E+G*P,M=t[8],B=t[9],D=t[10],G=t[11],o[8]=M*i+B*d+D*_+G*C,o[9]=M*a+B*p+D*b+G*T,o[10]=M*l+B*m+D*w+G*x,o[11]=M*u+B*A+D*E+G*P,M=t[12],B=t[13],D=t[14],G=t[15],o[12]=M*i+B*d+D*_+G*C,o[13]=M*a+B*p+D*b+G*T,o[14]=M*l+B*m+D*w+G*x,o[15]=M*u+B*A+D*E+G*P,o}function qO(o,e){var t=e[0],i=e[1],a=e[2],l=e[4],u=e[5],d=e[6],p=e[8],m=e[9],A=e[10];return o[0]=Math.hypot(t,i,a),o[1]=Math.hypot(l,u,d),o[2]=Math.hypot(p,m,A),o}function WO(o,e){var t=new NA(3);qO(t,e);var i=1/t[0],a=1/t[1],l=1/t[2],u=e[0]*i,d=e[1]*a,p=e[2]*l,m=e[4]*i,A=e[5]*a,_=e[6]*l,b=e[8]*i,w=e[9]*a,E=e[10]*l,C=u+A+E,T=0;return C>0?(T=Math.sqrt(C+1)*2,o[3]=.25*T,o[0]=(_-w)/T,o[1]=(b-p)/T,o[2]=(d-m)/T):u>A&&u>E?(T=Math.sqrt(1+u-A-E)*2,o[3]=(_-w)/T,o[0]=.25*T,o[1]=(d+m)/T,o[2]=(b+p)/T):A>E?(T=Math.sqrt(1+A-u-E)*2,o[3]=(b-p)/T,o[0]=(d+m)/T,o[1]=.25*T,o[2]=(_+w)/T):(T=Math.sqrt(1+E-u-A)*2,o[3]=(d-m)/T,o[0]=(b+p)/T,o[1]=(_+w)/T,o[2]=.25*T),o}class si{static identity(e){return e}static eq(e,t,i=1e-5){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(Math.abs(e[a]-t[a])>i)return!1;return!0}static clamp(e,t,i){return e<t?t:e>i?i:e}static decodeNormalizedInt(e,t){switch(t){case 5126:return e;case 5123:return e/65535;case 5121:return e/255;case 5122:return Math.max(e/32767,-1);case 5120:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(e,t){switch(t){case 5126:return e;case 5123:return Math.round(si.clamp(e,0,1)*65535);case 5121:return Math.round(si.clamp(e,0,1)*255);case 5122:return Math.round(si.clamp(e,-1,1)*32767);case 5120:return Math.round(si.clamp(e,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(e,t,i,a){let l=tm([e[0],e[1],e[2]]);const u=tm([e[4],e[5],e[6]]),d=tm([e[8],e[9],e[10]]);QO(e)<0&&(l=-l),t[0]=e[12],t[1]=e[13],t[2]=e[14];const m=e.slice(),A=1/l,_=1/u,b=1/d;m[0]*=A,m[1]*=A,m[2]*=A,m[4]*=_,m[5]*=_,m[6]*=_,m[8]*=b,m[9]*=b,m[10]*=b,WO(i,m),a[0]=l,a[1]=u,a[2]=d}static compose(e,t,i,a){const l=a,u=t[0],d=t[1],p=t[2],m=t[3],A=u+u,_=d+d,b=p+p,w=u*A,E=u*_,C=u*b,T=d*_,x=d*b,P=p*b,M=m*A,B=m*_,D=m*b,G=i[0],U=i[1],V=i[2];return l[0]=(1-(T+P))*G,l[1]=(E+D)*G,l[2]=(C-B)*G,l[3]=0,l[4]=(E-D)*U,l[5]=(1-(w+P))*U,l[6]=(x+M)*U,l[7]=0,l[8]=(C+B)*V,l[9]=(x-M)*V,l[10]=(1-(w+T))*V,l[11]=0,l[12]=e[0],l[13]=e[1],l[14]=e[2],l[15]=1,l}}function YO(o,e){if(!!o!=!!e)return!1;const t=o.getChild(),i=e.getChild();return t===i||t.equals(i)}function XO(o,e){if(!!o!=!!e)return!1;const t=o.values(),i=e.values();if(t.length!==i.length)return!1;for(let a=0;a<t.length;a++){const l=t[a],u=i[a];if(l.getChild()!==u.getChild()&&!l.getChild().equals(u.getChild()))return!1}return!0}function KO(o,e){if(!!o!=!!e)return!1;const t=o.keys(),i=e.keys();if(t.length!==i.length)return!1;for(const a of t){const l=o.get(a),u=e.get(a);if(!!l!=!!u)return!1;const d=l.getChild(),p=u.getChild();if(d!==p&&!d.equals(p))return!1}return!0}function B1(o,e){if(o===e)return!0;if(!!o!=!!e||!o||!e||o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!==e[t])return!1;return!0}function P1(o,e){if(o===e)return!0;if(!!o!=!!e)return!1;if(!Da(o)||!Da(e))return o===e;const t=o,i=e;let a=0,l=0,u;for(u in t)a++;for(u in i)l++;if(a!==l)return!1;for(u in t){const d=t[u],p=i[u];if(lf(d)&&lf(p)){if(!B1(d,p))return!1}else if(Da(d)&&Da(p)){if(!P1(d,p))return!1}else if(d!==p)return!1}return!0}function lf(o){return Array.isArray(o)||ArrayBuffer.isView(o)}const $b="23456789abdegjkmnpqrvwxyzABDEGJKMNPQRVWXYZ",JO=999,ZO=6,zb=new Set,ek=function(){let e="";for(let t=0;t<ZO;t++)e+=$b.charAt(Math.floor(Math.random()*$b.length));return e},tk=function(){for(let e=0;e<JO;e++){const t=ek();if(!zb.has(t))return zb.add(t),t}return""},Yr=o=>o,ik=new Set;class t_ extends e_{constructor(e,t=""){super(e),this[Bt].name=t,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(e,t){return Array.isArray(t)&&(t=t.slice()),super.set(e,t)}getName(){return this.get("name")}setName(e){return this.set("name",e)}getExtras(){return this.get("extras")}setExtras(e){return this.set("extras",e)}clone(){const e=this.constructor;return new e(this.graph).copy(this,Yr)}copy(e,t=Yr){for(const i in this[Bt]){const a=this[Bt][i];if(a instanceof Xo)this[Ra].has(i)||a.dispose();else if(a instanceof Ur||a instanceof Zt)for(const l of a.values())l.dispose();else if(a instanceof Es)for(const l of a.values())l.dispose()}for(const i in e[Bt]){const a=this[Bt][i],l=e[Bt][i];if(l instanceof Xo)this[Ra].has(i)?a.getChild().copy(t(l.getChild()),t):this.setRef(i,t(l.getChild()),l.getAttributes());else if(l instanceof Zt||l instanceof Ur)for(const u of l.values())this.addRef(i,t(u.getChild()),u.getAttributes());else if(l instanceof Es)for(const u of l.keys()){const d=l.get(u);this.setRefMap(i,u,t(d.getChild()),d.getAttributes())}else Da(l)?this[Bt][i]=JSON.parse(JSON.stringify(l)):Array.isArray(l)||l instanceof ArrayBuffer||ArrayBuffer.isView(l)?this[Bt][i]=l.slice():this[Bt][i]=l}return this}equals(e,t=ik){if(this===e)return!0;if(this.propertyType!==e.propertyType)return!1;for(const i in this[Bt]){if(t.has(i))continue;const a=this[Bt][i],l=e[Bt][i];if(a instanceof Xo||l instanceof Xo){if(!YO(a,l))return!1}else if(a instanceof Zt||l instanceof Zt||a instanceof Ur||l instanceof Ur){if(!XO(a,l))return!1}else if(a instanceof Es||l instanceof Es){if(!KO(a,l))return!1}else if(Da(a)||Da(l)){if(!P1(a,l))return!1}else if(lf(a)||lf(l)){if(!B1(a,l))return!1}else if(a!==l)return!1}return!0}detach(){return this.graph.disconnectParents(this,e=>e.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class mn extends t_{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new Es})}getExtension(e){return this.getRefMap("extensions",e)}setExtension(e,t){return t&&t._validateParent(this),this.setRefMap("extensions",e,t)}listExtensions(){return this.listRefMapValues("extensions")}}class at extends mn{init(){this.propertyType=Te.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:at.Type.SCALAR,componentType:at.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}static getElementSize(e){switch(e){case at.Type.SCALAR:return 1;case at.Type.VEC2:return 2;case at.Type.VEC3:return 3;case at.Type.VEC4:return 4;case at.Type.MAT2:return 4;case at.Type.MAT3:return 9;case at.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+e)}}static getComponentSize(e){switch(e){case at.ComponentType.BYTE:return 1;case at.ComponentType.UNSIGNED_BYTE:return 1;case at.ComponentType.SHORT:return 2;case at.ComponentType.UNSIGNED_SHORT:return 2;case at.ComponentType.UNSIGNED_INT:return 4;case at.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+e)}}getMinNormalized(e){const t=this.getNormalized(),i=this.getElementSize(),a=this.getComponentType();if(this.getMin(e),t)for(let l=0;l<i;l++)e[l]=si.decodeNormalizedInt(e[l],a);return e}getMin(e){const t=this.getArray(),i=this.getCount(),a=this.getElementSize();for(let l=0;l<a;l++)e[l]=1/0;for(let l=0;l<i*a;l+=a)for(let u=0;u<a;u++){const d=t[l+u];Number.isFinite(d)&&(e[u]=Math.min(e[u],d))}return e}getMaxNormalized(e){const t=this.getNormalized(),i=this.getElementSize(),a=this.getComponentType();if(this.getMax(e),t)for(let l=0;l<i;l++)e[l]=si.decodeNormalizedInt(e[l],a);return e}getMax(e){const t=this.get("array"),i=this.getCount(),a=this.getElementSize();for(let l=0;l<a;l++)e[l]=-1/0;for(let l=0;l<i*a;l+=a)for(let u=0;u<a;u++){const d=t[l+u];Number.isFinite(d)&&(e[u]=Math.max(e[u],d))}return e}getCount(){const e=this.get("array");return e?e.length/this.getElementSize():0}getType(){return this.get("type")}setType(e){return this.set("type",e)}getElementSize(){return at.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(e){return this.set("normalized",e)}getScalar(e){const t=this.getElementSize(),i=this.getComponentType(),a=this.getArray();return this.getNormalized()?si.decodeNormalizedInt(a[e*t],i):a[e*t]}setScalar(e,t){const i=this.getElementSize(),a=this.getComponentType(),l=this.getArray();return this.getNormalized()?l[e*i]=si.encodeNormalizedInt(t,a):l[e*i]=t,this}getElement(e,t){const i=this.getNormalized(),a=this.getElementSize(),l=this.getComponentType(),u=this.getArray();for(let d=0;d<a;d++)i?t[d]=si.decodeNormalizedInt(u[e*a+d],l):t[d]=u[e*a+d];return t}setElement(e,t){const i=this.getNormalized(),a=this.getElementSize(),l=this.getComponentType(),u=this.getArray();for(let d=0;d<a;d++)i?u[e*a+d]=si.encodeNormalizedInt(t[d],l):u[e*a+d]=t[d];return this}getSparse(){return this.get("sparse")}setSparse(e){return this.set("sparse",e)}getBuffer(){return this.getRef("buffer")}setBuffer(e){return this.setRef("buffer",e)}getArray(){return this.get("array")}setArray(e){return this.set("componentType",e?nk(e):at.ComponentType.FLOAT),this.set("array",e),this}getByteLength(){const e=this.get("array");return e?e.byteLength:0}}at.Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};at.ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function nk(o){switch(o.constructor){case Float32Array:return at.ComponentType.FLOAT;case Uint32Array:return at.ComponentType.UNSIGNED_INT;case Uint16Array:return at.ComponentType.UNSIGNED_SHORT;case Uint8Array:return at.ComponentType.UNSIGNED_BYTE;case Int16Array:return at.ComponentType.SHORT;case Int8Array:return at.ComponentType.BYTE;default:throw new Error("Unknown accessor componentType.")}}class L1 extends mn{init(){this.propertyType=Te.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new Zt,samplers:new Zt})}addChannel(e){return this.addRef("channels",e)}removeChannel(e){return this.removeRef("channels",e)}listChannels(){return this.listRefs("channels")}addSampler(e){return this.addRef("samplers",e)}removeSampler(e){return this.removeRef("samplers",e)}listSamplers(){return this.listRefs("samplers")}}class $f extends mn{init(){this.propertyType=Te.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(e){return this.set("targetPath",e)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(e){return this.setRef("targetNode",e)}getSampler(){return this.getRef("sampler")}setSampler(e){return this.setRef("sampler",e)}}$f.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class Uu extends mn{init(){this.propertyType=Te.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:Uu.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(e){return this.set("interpolation",e)}getInput(){return this.getRef("input")}setInput(e){return this.setRef("input",e,{usage:Ln.OTHER})}getOutput(){return this.getRef("output")}setOutput(e){return this.setRef("output",e,{usage:Ln.OTHER})}}Uu.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class D1 extends mn{init(){this.propertyType=Te.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(e){return this.set("uri",e)}}class Ja extends mn{init(){this.propertyType=Te.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:Ja.Type.PERSPECTIVE,znear:.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(e){return this.set("type",e)}getZNear(){return this.get("znear")}setZNear(e){return this.set("znear",e)}getZFar(){return this.get("zfar")}setZFar(e){return this.set("zfar",e)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(e){return this.set("aspectRatio",e)}getYFov(){return this.get("yfov")}setYFov(e){return this.set("yfov",e)}getXMag(){return this.get("xmag")}setXMag(e){return this.set("xmag",e)}getYMag(){return this.get("ymag")}setYMag(e){return this.set("ymag",e)}}Ja.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class i_ extends t_{_validateParent(e){if(!this.parentTypes.includes(e.propertyType))throw new Error(`Parent "${e.propertyType}" invalid for child "${this.propertyType}".`)}}i_.EXTENSION_NAME=void 0;let vs=class UA extends mn{init(){this.propertyType=Te.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:UA.WrapMode.REPEAT,wrapT:UA.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(e){return this.set("texCoord",e)}getMagFilter(){return this.get("magFilter")}setMagFilter(e){return this.set("magFilter",e)}getMinFilter(){return this.get("minFilter")}setMinFilter(e){return this.set("minFilter",e)}getWrapS(){return this.get("wrapS")}setWrapS(e){return this.set("wrapS",e)}getWrapT(){return this.get("wrapT")}setWrapT(e){return this.set("wrapT",e)}};vs.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};vs.MagFilter={NEAREST:9728,LINEAR:9729};vs.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};const{R:Ph,G:Lh,B:Dh,A:sk}=DA;let Ya=class N1 extends mn{init(){this.propertyType=Te.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:N1.AlphaMode.OPAQUE,alphaCutoff:.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new vs(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new vs(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new vs(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new vs(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new vs(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(e){return this.set("doubleSided",e)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(e){const t=this.get("baseColorFactor").slice();return t[3]=e,this.set("baseColorFactor",t)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(e){return this.set("alphaMode",e)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(e){return this.set("alphaCutoff",e)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(e){return this.set("baseColorFactor",e)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(e){return this.setRef("baseColorTexture",e,{channels:Ph|Lh|Dh|sk,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(e){return this.set("emissiveFactor",e)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(e){return this.setRef("emissiveTexture",e,{channels:Ph|Lh|Dh,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(e){return this.set("normalScale",e)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(e){return this.setRef("normalTexture",e,{channels:Ph|Lh|Dh})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(e){return this.set("occlusionStrength",e)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(e){return this.setRef("occlusionTexture",e,{channels:Ph})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(e){return this.set("roughnessFactor",e)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(e){return this.set("metallicFactor",e)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(e){return this.setRef("metallicRoughnessTexture",e,{channels:Lh|Dh})}};Ya.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class O1 extends mn{init(){this.propertyType=Te.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new Zt})}addPrimitive(e){return this.addRef("primitives",e)}removePrimitive(e){return this.removeRef("primitives",e)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(e){return this.set("weights",e)}}let k1=class extends mn{init(){this.propertyType=Te.NODE}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new Zt})}copy(e,t=Yr){if(t===Yr)throw new Error("Node cannot be copied.");return super.copy(e,t)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(e){return this.set("translation",e)}setRotation(e){return this.set("rotation",e)}setScale(e){return this.set("scale",e)}getMatrix(){return si.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(e){const t=this.get("translation").slice(),i=this.get("rotation").slice(),a=this.get("scale").slice();return si.decompose(e,t,i,a),this.set("translation",t).set("rotation",i).set("scale",a)}getWorldTranslation(){const e=[0,0,0];return si.decompose(this.getWorldMatrix(),e,[0,0,0,1],[1,1,1]),e}getWorldRotation(){const e=[0,0,0,1];return si.decompose(this.getWorldMatrix(),[0,0,0],e,[1,1,1]),e}getWorldScale(){const e=[1,1,1];return si.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],e),e}getWorldMatrix(){const e=[];for(let a=this;a!=null;a=a.getParentNode())e.push(a);let t;const i=e.pop().getMatrix();for(;t=e.pop();)jO(i,i,t.getMatrix());return i}addChild(e){const t=e.getParentNode();t&&t.removeChild(e);for(const i of e.listParents())i.propertyType===Te.SCENE&&i.removeChild(e);return this.addRef("children",e)}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}getParentNode(){for(const e of this.listParents())if(e.propertyType===Te.NODE)return e;return null}getMesh(){return this.getRef("mesh")}setMesh(e){return this.setRef("mesh",e)}getCamera(){return this.getRef("camera")}setCamera(e){return this.setRef("camera",e)}getSkin(){return this.getRef("skin")}setSkin(e){return this.setRef("skin",e)}getWeights(){return this.get("weights")}setWeights(e){return this.set("weights",e)}traverse(e){e(this);for(const t of this.listChildren())t.traverse(e);return this}};class Ls extends mn{init(){this.propertyType=Te.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:Ls.Mode.TRIANGLES,material:null,indices:null,attributes:new Es,targets:new Zt})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:Ln.ELEMENT_ARRAY_BUFFER})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:Ln.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}getMode(){return this.get("mode")}setMode(e){return this.set("mode",e)}listTargets(){return this.listRefs("targets")}addTarget(e){return this.addRef("targets",e)}removeTarget(e){return this.removeRef("targets",e)}}Ls.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class rk extends t_{init(){this.propertyType=Te.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new Es})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:Ln.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function cn(){return cn=Object.assign?Object.assign.bind():function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(o[i]=t[i])}return o},cn.apply(null,arguments)}class n_ extends mn{init(){this.propertyType=Te.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new Zt})}copy(e,t=Yr){if(t===Yr)throw new Error("Scene cannot be copied.");return super.copy(e,t)}addChild(e){const t=e.getParentNode();return t&&t.removeChild(e),this.addRef("children",e)}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}traverse(e){for(const t of this.listChildren())t.traverse(e);return this}}class U1 extends mn{init(){this.propertyType=Te.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new Zt})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(e){return this.setRef("skeleton",e)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(e){return this.setRef("inverseBindMatrices",e,{usage:Ln.INVERSE_BIND_MATRICES})}addJoint(e){return this.addRef("joints",e)}removeJoint(e){return this.removeRef("joints",e)}listJoints(){return this.listRefs("joints")}}let Tu=class extends mn{init(){this.propertyType=Te.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||Fa.extensionToMimeType(Rl.extension(this.get("uri")))}setMimeType(e){return this.set("mimeType",e)}getURI(){return this.get("uri")}setURI(e){this.set("uri",e);const t=Fa.extensionToMimeType(Rl.extension(e));return t&&this.set("mimeType",t),this}getImage(){return this.get("image")}setImage(e){return this.set("image",yt.assertView(e))}getSize(){const e=this.get("image");return e?Fa.getSize(e,this.getMimeType()):null}};class Fu extends mn{init(){this.propertyType=Te.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${R1}`,version:"2.0"},defaultScene:null,accessors:new Zt,animations:new Zt,buffers:new Zt,cameras:new Zt,materials:new Zt,meshes:new Zt,nodes:new Zt,scenes:new Zt,skins:new Zt,textures:new Zt})}constructor(e){super(e),this._extensions=new Set,e.addEventListener("node:create",t=>{this._addChildOfRoot(t.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(e,t=Yr){if(t===Yr)throw new Error("Root cannot be copied.");this.set("asset",cn({},e.get("asset"))),this.setName(e.getName()),this.setExtras(cn({},e.getExtras())),this.setDefaultScene(e.getDefaultScene()?t(e.getDefaultScene()):null);for(const i of e.listRefMapKeys("extensions")){const a=e.getExtension(i);this.setExtension(i,t(a))}return this}_addChildOfRoot(e){return e instanceof n_?this.addRef("scenes",e):e instanceof k1?this.addRef("nodes",e):e instanceof Ja?this.addRef("cameras",e):e instanceof U1?this.addRef("skins",e):e instanceof O1?this.addRef("meshes",e):e instanceof Ya?this.addRef("materials",e):e instanceof Tu?this.addRef("textures",e):e instanceof L1?this.addRef("animations",e):e instanceof at?this.addRef("accessors",e):e instanceof D1&&this.addRef("buffers",e),this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter(e=>e.isRequired())}_enableExtension(e){return this._extensions.add(e),this}_disableExtension(e){return this._extensions.delete(e),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(e){return this.setRef("defaultScene",e)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}}let s_=class FA{static fromGraph(e){return FA._GRAPH_DOCUMENTS.get(e)||null}constructor(){this._graph=new $O,this._root=new Fu(this._graph),this._logger=Qn.DEFAULT_INSTANCE,FA._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(e){return this._logger=e,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(e){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...e){const t=e.map(i=>i.name);for(const i of e)await i(this,{stack:t});return this}createExtension(e){const t=e.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(a=>a.extensionName===t)||new e(this)}createScene(e=""){return new n_(this._graph,e)}createNode(e=""){return new k1(this._graph,e)}createCamera(e=""){return new Ja(this._graph,e)}createSkin(e=""){return new U1(this._graph,e)}createMesh(e=""){return new O1(this._graph,e)}createPrimitive(){return new Ls(this._graph)}createPrimitiveTarget(e=""){return new rk(this._graph,e)}createMaterial(e=""){return new Ya(this._graph,e)}createTexture(e=""){return new Tu(this._graph,e)}createAnimation(e=""){return new L1(this._graph,e)}createAnimationChannel(e=""){return new $f(this._graph,e)}createAnimationSampler(e=""){return new Uu(this._graph,e)}createAccessor(e="",t=null){return t||(t=this.getRoot().listBuffers()[0]),new at(this._graph,e).setBuffer(t)}createBuffer(e=""){return new D1(this._graph,e)}};s_._GRAPH_DOCUMENTS=new WeakMap;class ak{constructor(e){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=e}setTextureInfo(e,t){this.textureInfos.set(e,t),t.texCoord!==void 0&&e.setTexCoord(t.texCoord),t.extras!==void 0&&e.setExtras(t.extras);const i=this.jsonDoc.json.textures[t.index];if(i.sampler===void 0)return;const a=this.jsonDoc.json.samplers[i.sampler];a.magFilter!==void 0&&e.setMagFilter(a.magFilter),a.minFilter!==void 0&&e.setMinFilter(a.minFilter),a.wrapS!==void 0&&e.setWrapS(a.wrapS),a.wrapT!==void 0&&e.setWrapT(a.wrapT)}}const Gb={logger:Qn.DEFAULT_INSTANCE,extensions:[],dependencies:{}},ok=new Set([Te.BUFFER,Te.TEXTURE,Te.MATERIAL,Te.MESH,Te.PRIMITIVE,Te.NODE,Te.SCENE]);class lk{static read(e,t=Gb){const i=cn({},Gb,t),{json:a}=e,l=new s_().setLogger(i.logger);this.validate(e,i);const u=new ak(e),d=a.asset,p=l.getRoot().getAsset();d.copyright&&(p.copyright=d.copyright),d.extras&&(p.extras=d.extras),a.extras!==void 0&&l.getRoot().setExtras(cn({},a.extras));const m=a.extensionsUsed||[],A=a.extensionsRequired||[];i.extensions.sort((U,V)=>U.EXTENSION_NAME>V.EXTENSION_NAME?1:-1);for(const U of i.extensions)if(m.includes(U.EXTENSION_NAME)){const V=l.createExtension(U).setRequired(A.includes(U.EXTENSION_NAME)),k=V.prereadTypes.filter(z=>!ok.has(z));k.length&&i.logger.warn(`Preread hooks for some types (${k.join()}), requested by extension ${V.extensionName}, are unsupported. Please file an issue or a PR.`);for(const z of V.readDependencies)V.install(z,i.dependencies[z])}const _=a.buffers||[];l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.BUFFER)).forEach(U=>U.preread(u,Te.BUFFER)),u.buffers=_.map(U=>{const V=l.createBuffer(U.name);return U.extras&&V.setExtras(U.extras),U.uri&&U.uri.indexOf("__")!==0&&V.setURI(U.uri),V});const b=a.bufferViews||[];u.bufferViewBuffers=b.map((U,V)=>{if(!u.bufferViews[V]){const k=e.json.buffers[U.buffer],z=k.uri?e.resources[k.uri]:e.resources[af],Q=U.byteOffset||0;u.bufferViews[V]=yt.toView(z,Q,U.byteLength)}return u.buffers[U.buffer]});const w=a.accessors||[];u.accessors=w.map(U=>{const V=u.bufferViewBuffers[U.bufferView],k=l.createAccessor(U.name,V).setType(U.type);return U.extras&&k.setExtras(U.extras),U.normalized!==void 0&&k.setNormalized(U.normalized),U.bufferView===void 0||k.setArray(xd(U,u)),k});const E=a.images||[],C=a.textures||[];l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.TEXTURE)).forEach(U=>U.preread(u,Te.TEXTURE)),u.textures=E.map(U=>{const V=l.createTexture(U.name);if(U.extras&&V.setExtras(U.extras),U.bufferView!==void 0){const k=a.bufferViews[U.bufferView],z=e.json.buffers[k.buffer],Q=z.uri?e.resources[z.uri]:e.resources[af],Z=k.byteOffset||0,K=k.byteLength,s=Q.slice(Z,Z+K);V.setImage(s)}else U.uri!==void 0&&(V.setImage(e.resources[U.uri]),U.uri.indexOf("__")!==0&&V.setURI(U.uri));if(U.mimeType!==void 0)V.setMimeType(U.mimeType);else if(U.uri){const k=Rl.extension(U.uri);V.setMimeType(Fa.extensionToMimeType(k))}return V}),l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.MATERIAL)).forEach(U=>U.preread(u,Te.MATERIAL));const T=a.materials||[];u.materials=T.map(U=>{const V=l.createMaterial(U.name);U.extras&&V.setExtras(U.extras),U.alphaMode!==void 0&&V.setAlphaMode(U.alphaMode),U.alphaCutoff!==void 0&&V.setAlphaCutoff(U.alphaCutoff),U.doubleSided!==void 0&&V.setDoubleSided(U.doubleSided);const k=U.pbrMetallicRoughness||{};if(k.baseColorFactor!==void 0&&V.setBaseColorFactor(k.baseColorFactor),U.emissiveFactor!==void 0&&V.setEmissiveFactor(U.emissiveFactor),k.metallicFactor!==void 0&&V.setMetallicFactor(k.metallicFactor),k.roughnessFactor!==void 0&&V.setRoughnessFactor(k.roughnessFactor),k.baseColorTexture!==void 0){const z=k.baseColorTexture,Q=u.textures[C[z.index].source];V.setBaseColorTexture(Q),u.setTextureInfo(V.getBaseColorTextureInfo(),z)}if(U.emissiveTexture!==void 0){const z=U.emissiveTexture,Q=u.textures[C[z.index].source];V.setEmissiveTexture(Q),u.setTextureInfo(V.getEmissiveTextureInfo(),z)}if(U.normalTexture!==void 0){const z=U.normalTexture,Q=u.textures[C[z.index].source];V.setNormalTexture(Q),u.setTextureInfo(V.getNormalTextureInfo(),z),U.normalTexture.scale!==void 0&&V.setNormalScale(U.normalTexture.scale)}if(U.occlusionTexture!==void 0){const z=U.occlusionTexture,Q=u.textures[C[z.index].source];V.setOcclusionTexture(Q),u.setTextureInfo(V.getOcclusionTextureInfo(),z),U.occlusionTexture.strength!==void 0&&V.setOcclusionStrength(U.occlusionTexture.strength)}if(k.metallicRoughnessTexture!==void 0){const z=k.metallicRoughnessTexture,Q=u.textures[C[z.index].source];V.setMetallicRoughnessTexture(Q),u.setTextureInfo(V.getMetallicRoughnessTextureInfo(),z)}return V}),l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.MESH)).forEach(U=>U.preread(u,Te.MESH));const x=a.meshes||[];l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.PRIMITIVE)).forEach(U=>U.preread(u,Te.PRIMITIVE)),u.meshes=x.map(U=>{const V=l.createMesh(U.name);return U.extras&&V.setExtras(U.extras),U.weights!==void 0&&V.setWeights(U.weights),(U.primitives||[]).forEach(z=>{const Q=l.createPrimitive();z.extras&&Q.setExtras(z.extras),z.material!==void 0&&Q.setMaterial(u.materials[z.material]),z.mode!==void 0&&Q.setMode(z.mode);for(const[s,H]of Object.entries(z.attributes||{}))Q.setAttribute(s,u.accessors[H]);z.indices!==void 0&&Q.setIndices(u.accessors[z.indices]);const Z=U.extras&&U.extras.targetNames||[];(z.targets||[]).forEach((s,H)=>{const y=Z[H]||H.toString(),ee=l.createPrimitiveTarget(y);for(const[I,re]of Object.entries(s))ee.setAttribute(I,u.accessors[re]);Q.addTarget(ee)}),V.addPrimitive(Q)}),V});const P=a.cameras||[];u.cameras=P.map(U=>{const V=l.createCamera(U.name).setType(U.type);if(U.extras&&V.setExtras(U.extras),U.type===Ja.Type.PERSPECTIVE){const k=U.perspective;V.setYFov(k.yfov),V.setZNear(k.znear),k.zfar!==void 0&&V.setZFar(k.zfar),k.aspectRatio!==void 0&&V.setAspectRatio(k.aspectRatio)}else{const k=U.orthographic;V.setZNear(k.znear).setZFar(k.zfar).setXMag(k.xmag).setYMag(k.ymag)}return V});const M=a.nodes||[];l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.NODE)).forEach(U=>U.preread(u,Te.NODE)),u.nodes=M.map(U=>{const V=l.createNode(U.name);if(U.extras&&V.setExtras(U.extras),U.translation!==void 0&&V.setTranslation(U.translation),U.rotation!==void 0&&V.setRotation(U.rotation),U.scale!==void 0&&V.setScale(U.scale),U.matrix!==void 0){const k=[0,0,0],z=[0,0,0,1],Q=[1,1,1];si.decompose(U.matrix,k,z,Q),V.setTranslation(k),V.setRotation(z),V.setScale(Q)}return U.weights!==void 0&&V.setWeights(U.weights),V});const B=a.skins||[];u.skins=B.map(U=>{const V=l.createSkin(U.name);U.extras&&V.setExtras(U.extras),U.inverseBindMatrices!==void 0&&V.setInverseBindMatrices(u.accessors[U.inverseBindMatrices]),U.skeleton!==void 0&&V.setSkeleton(u.nodes[U.skeleton]);for(const k of U.joints)V.addJoint(u.nodes[k]);return V}),M.map((U,V)=>{const k=u.nodes[V];(U.children||[]).forEach(Q=>k.addChild(u.nodes[Q])),U.mesh!==void 0&&k.setMesh(u.meshes[U.mesh]),U.camera!==void 0&&k.setCamera(u.cameras[U.camera]),U.skin!==void 0&&k.setSkin(u.skins[U.skin])});const D=a.animations||[];u.animations=D.map(U=>{const V=l.createAnimation(U.name);U.extras&&V.setExtras(U.extras);const z=(U.samplers||[]).map(Z=>{const K=l.createAnimationSampler().setInput(u.accessors[Z.input]).setOutput(u.accessors[Z.output]).setInterpolation(Z.interpolation||Uu.Interpolation.LINEAR);return Z.extras&&K.setExtras(Z.extras),V.addSampler(K),K});return(U.channels||[]).forEach(Z=>{const K=l.createAnimationChannel().setSampler(z[Z.sampler]).setTargetPath(Z.target.path);Z.target.node!==void 0&&K.setTargetNode(u.nodes[Z.target.node]),Z.extras&&K.setExtras(Z.extras),V.addChannel(K)}),V});const G=a.scenes||[];return l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.SCENE)).forEach(U=>U.preread(u,Te.SCENE)),u.scenes=G.map(U=>{const V=l.createScene(U.name);return U.extras&&V.setExtras(U.extras),(U.nodes||[]).map(z=>u.nodes[z]).forEach(z=>V.addChild(z)),V}),a.scene!==void 0&&l.getRoot().setDefaultScene(u.scenes[a.scene]),l.getRoot().listExtensionsUsed().forEach(U=>U.read(u)),w.forEach((U,V)=>{const k=u.accessors[V],z=!!U.sparse,Q=!U.bufferView&&!k.getArray();(z||Q)&&k.setSparse(!0).setArray(uk(U,u))}),l}static validate(e,t){const i=e.json;if(i.asset.version!=="2.0")throw new Error(`Unsupported glTF version, "${i.asset.version}".`);if(i.extensionsRequired){for(const a of i.extensionsRequired)if(!t.extensions.find(l=>l.EXTENSION_NAME===a))throw new Error(`Missing required extension, "${a}".`)}if(i.extensionsUsed)for(const a of i.extensionsUsed)t.extensions.find(l=>l.EXTENSION_NAME===a)||t.logger.warn(`Missing optional extension, "${a}".`)}}function ck(o,e){const t=e.jsonDoc,i=e.bufferViews[o.bufferView],a=t.json.bufferViews[o.bufferView],l=Uf[o.componentType],u=at.getElementSize(o.type),d=l.BYTES_PER_ELEMENT,p=o.byteOffset||0,m=new l(o.count*u),A=new DataView(i.buffer,i.byteOffset,i.byteLength),_=a.byteStride;for(let b=0;b<o.count;b++)for(let w=0;w<u;w++){const E=p+b*_+w*d;let C;switch(o.componentType){case at.ComponentType.FLOAT:C=A.getFloat32(E,!0);break;case at.ComponentType.UNSIGNED_INT:C=A.getUint32(E,!0);break;case at.ComponentType.UNSIGNED_SHORT:C=A.getUint16(E,!0);break;case at.ComponentType.UNSIGNED_BYTE:C=A.getUint8(E);break;case at.ComponentType.SHORT:C=A.getInt16(E,!0);break;case at.ComponentType.BYTE:C=A.getInt8(E);break;default:throw new Error(`Unexpected componentType "${o.componentType}".`)}m[b*u+w]=C}return m}function xd(o,e){const t=e.jsonDoc,i=e.bufferViews[o.bufferView],a=t.json.bufferViews[o.bufferView],l=Uf[o.componentType],u=at.getElementSize(o.type),d=l.BYTES_PER_ELEMENT,p=u*d;if(a.byteStride!==void 0&&a.byteStride!==p)return ck(o,e);const m=i.byteOffset+(o.byteOffset||0),A=o.count*u*d;return new l(i.buffer.slice(m,m+A))}function uk(o,e){const t=Uf[o.componentType],i=at.getElementSize(o.type);let a;o.bufferView!==void 0?a=xd(o,e):a=new t(o.count*i);const l=o.sparse;if(!l)return a;const u=l.count,d=cn({},o,l.indices,{count:u,type:"SCALAR"}),p=cn({},o,l.values,{count:u}),m=xd(d,e),A=xd(p,e);for(let _=0;_<d.count;_++)for(let b=0;b<i;b++)a[m[_]*i+b]=A[_*i+b];return a}var Iu;(function(o){o[o.ARRAY_BUFFER=34962]="ARRAY_BUFFER",o[o.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(Iu||(Iu={}));class $a{constructor(e,t,i){this._doc=void 0,this.jsonDoc=void 0,this.options=void 0,this.accessorIndexMap=new Map,this.animationIndexMap=new Map,this.bufferIndexMap=new Map,this.cameraIndexMap=new Map,this.skinIndexMap=new Map,this.materialIndexMap=new Map,this.meshIndexMap=new Map,this.nodeIndexMap=new Map,this.imageIndexMap=new Map,this.textureDefIndexMap=new Map,this.textureInfoDefMap=new Map,this.samplerDefIndexMap=new Map,this.sceneIndexMap=new Map,this.imageBufferViews=[],this.otherBufferViews=new Map,this.otherBufferViewsIndexMap=new Map,this.extensionData={},this.bufferURIGenerator=void 0,this.imageURIGenerator=void 0,this.logger=void 0,this._accessorUsageMap=new Map,this.accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]),this.accessorParents=new Map,this._doc=e,this.jsonDoc=t,this.options=i;const a=e.getRoot(),l=a.listBuffers().length,u=a.listTextures().length;this.bufferURIGenerator=new Hb(l>1,()=>i.basename||"buffer"),this.imageURIGenerator=new Hb(u>1,d=>hk(e,d)||i.basename||"texture"),this.logger=e.getLogger()}createTextureInfoDef(e,t){const i={magFilter:t.getMagFilter()||void 0,minFilter:t.getMinFilter()||void 0,wrapS:t.getWrapS(),wrapT:t.getWrapT()},a=JSON.stringify(i);this.samplerDefIndexMap.has(a)||(this.samplerDefIndexMap.set(a,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(i));const l={source:this.imageIndexMap.get(e),sampler:this.samplerDefIndexMap.get(a)},u=JSON.stringify(l);this.textureDefIndexMap.has(u)||(this.textureDefIndexMap.set(u,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(l));const d={index:this.textureDefIndexMap.get(u)};return t.getTexCoord()!==0&&(d.texCoord=t.getTexCoord()),Object.keys(t.getExtras()).length>0&&(d.extras=t.getExtras()),this.textureInfoDefMap.set(t,d),d}createPropertyDef(e){const t={};return e.getName()&&(t.name=e.getName()),Object.keys(e.getExtras()).length>0&&(t.extras=e.getExtras()),t}createAccessorDef(e){const t=this.createPropertyDef(e);return t.type=e.getType(),t.componentType=e.getComponentType(),t.count=e.getCount(),this._doc.getGraph().listParentEdges(e).some(a=>a.getName()==="attributes"&&a.getAttributes().key==="POSITION"||a.getName()==="input")&&(t.max=e.getMax([]).map(Math.fround),t.min=e.getMin([]).map(Math.fround)),e.getNormalized()&&(t.normalized=e.getNormalized()),t}createImageData(e,t,i){if(this.options.format===Hr.GLB)this.imageBufferViews.push(t),e.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:t.byteLength});else{const a=Fa.mimeTypeToExtension(i.getMimeType());e.uri=this.imageURIGenerator.createURI(i,a),this.assignResourceURI(e.uri,t,!1)}}assignResourceURI(e,t,i){const a=this.jsonDoc.resources;if(!(e in a)){a[e]=t;return}if(t===a[e]){this.logger.warn(`Duplicate resource URI, "${e}".`);return}const l=`Resource URI "${e}" already assigned to different data.`;if(!i){this.logger.warn(l);return}throw new Error(l)}getAccessorUsage(e){const t=this._accessorUsageMap.get(e);if(t)return t;if(e.getSparse())return Ln.SPARSE;for(const i of this._doc.getGraph().listParentEdges(e)){const{usage:a}=i.getAttributes();if(a)return a;i.getParent().propertyType!==Te.ROOT&&this.logger.warn(`Missing attribute ".usage" on edge, "${i.getName()}".`)}return Ln.OTHER}addAccessorToUsageGroup(e,t){const i=this._accessorUsageMap.get(e);if(i&&i!==t)throw new Error(`Accessor with usage "${i}" cannot be reused as "${t}".`);return this._accessorUsageMap.set(e,t),this}}$a.BufferViewTarget=Iu;$a.BufferViewUsage=Ln;$a.USAGE_TO_TARGET={[Ln.ARRAY_BUFFER]:Iu.ARRAY_BUFFER,[Ln.ELEMENT_ARRAY_BUFFER]:Iu.ELEMENT_ARRAY_BUFFER};class Hb{constructor(e,t){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=e,this.basename=t}createURI(e,t){if(e.getURI())return e.getURI();if(this.multiple){const i=this.basename(e);return this.counter[i]=this.counter[i]||1,`${i}_${this.counter[i]++}.${t}`}else return`${this.basename(e)}.${t}`}}function hk(o,e){const t=o.getGraph().listParentEdges(e).find(i=>i.getParent()!==o.getRoot());return t?t.getName().replace(/texture$/i,""):""}const{BufferViewUsage:Nh}=$a,{UNSIGNED_INT:dk,UNSIGNED_SHORT:fk,UNSIGNED_BYTE:pk}=at.ComponentType,mk=new Set([Te.ACCESSOR,Te.BUFFER,Te.MATERIAL,Te.MESH]);class gk{static write(e,t){const i=e.getGraph(),a=e.getRoot(),l={asset:cn({generator:`glTF-Transform ${R1}`},a.getAsset()),extras:cn({},a.getExtras())},u={json:l,resources:{}},d=new $a(e,u,t),p=t.logger||Qn.DEFAULT_INSTANCE,m=new Set(t.extensions.map(x=>x.EXTENSION_NAME)),A=e.getRoot().listExtensionsUsed().filter(x=>m.has(x.extensionName)).sort((x,P)=>x.extensionName>P.extensionName?1:-1),_=e.getRoot().listExtensionsRequired().filter(x=>m.has(x.extensionName)).sort((x,P)=>x.extensionName>P.extensionName?1:-1);A.length<e.getRoot().listExtensionsUsed().length&&p.warn("Some extensions were not registered for I/O, and will not be written.");for(const x of A){const P=x.prewriteTypes.filter(M=>!mk.has(M));P.length&&p.warn(`Prewrite hooks for some types (${P.join()}), requested by extension ${x.extensionName}, are unsupported. Please file an issue or a PR.`);for(const M of x.writeDependencies)x.install(M,t.dependencies[M])}function b(x,P,M,B){const D=[];let G=0;for(const k of x){const z=d.createAccessorDef(k);z.bufferView=l.bufferViews.length;const Q=k.getArray(),Z=yt.pad(yt.toView(Q));z.byteOffset=G,G+=Z.byteLength,D.push(Z),d.accessorIndexMap.set(k,l.accessors.length),l.accessors.push(z)}const U=yt.concat(D),V={buffer:P,byteOffset:M,byteLength:U.byteLength};return B&&(V.target=B),l.bufferViews.push(V),{buffers:D,byteLength:G}}function w(x,P,M){const B=x[0].getCount();let D=0;for(const z of x){const Q=d.createAccessorDef(z);Q.bufferView=l.bufferViews.length,Q.byteOffset=D;const Z=z.getElementSize(),K=z.getComponentSize();D+=yt.padNumber(Z*K),d.accessorIndexMap.set(z,l.accessors.length),l.accessors.push(Q)}const G=B*D,U=new ArrayBuffer(G),V=new DataView(U);for(let z=0;z<B;z++){let Q=0;for(const Z of x){const K=Z.getElementSize(),s=Z.getComponentSize(),H=Z.getComponentType(),y=Z.getArray();for(let ee=0;ee<K;ee++){const I=z*D+Q+ee*s,re=y[z*K+ee];switch(H){case at.ComponentType.FLOAT:V.setFloat32(I,re,!0);break;case at.ComponentType.BYTE:V.setInt8(I,re);break;case at.ComponentType.SHORT:V.setInt16(I,re,!0);break;case at.ComponentType.UNSIGNED_BYTE:V.setUint8(I,re);break;case at.ComponentType.UNSIGNED_SHORT:V.setUint16(I,re,!0);break;case at.ComponentType.UNSIGNED_INT:V.setUint32(I,re,!0);break;default:throw new Error("Unexpected component type: "+H)}}Q+=yt.padNumber(K*s)}}const k={buffer:P,byteOffset:M,byteLength:G,byteStride:D,target:$a.BufferViewTarget.ARRAY_BUFFER};return l.bufferViews.push(k),{byteLength:G,buffers:[new Uint8Array(U)]}}function E(x,P,M){const B=[];let D=0;const G=new Map;let U=-1/0,V=!1;for(const H of x){const y=d.createAccessorDef(H);l.accessors.push(y),d.accessorIndexMap.set(H,l.accessors.length-1);const ee=[],I=[],re=[],Ae=new Array(H.getElementSize()).fill(0);for(let c=0,h=H.getCount();c<h;c++)if(H.getElement(c,re),!si.eq(re,Ae,0)){U=Math.max(c,U),ee.push(c);for(let f=0;f<re.length;f++)I.push(re[f])}const N=ee.length,n={accessorDef:y,count:N};if(G.set(H,n),N===0)continue;N>H.getCount()/2&&(V=!0);const r=Uf[H.getComponentType()];n.indices=ee,n.values=new r(I)}if(!Number.isFinite(U))return{buffers:B,byteLength:D};V&&p.warn("Some sparse accessors have >50% non-zero elements, which may increase file size.");const k=U<255?Uint8Array:U<65535?Uint16Array:Uint32Array,z=U<255?pk:U<65535?fk:dk,Q={buffer:P,byteOffset:M+D,byteLength:0};for(const H of x){const y=G.get(H);if(y.count===0)continue;y.indicesByteOffset=Q.byteLength;const ee=yt.pad(yt.toView(new k(y.indices)));B.push(ee),D+=ee.byteLength,Q.byteLength+=ee.byteLength}l.bufferViews.push(Q);const Z=l.bufferViews.length-1,K={buffer:P,byteOffset:M+D,byteLength:0};for(const H of x){const y=G.get(H);if(y.count===0)continue;y.valuesByteOffset=K.byteLength;const ee=yt.pad(yt.toView(y.values));B.push(ee),D+=ee.byteLength,K.byteLength+=ee.byteLength}l.bufferViews.push(K);const s=l.bufferViews.length-1;for(const H of x){const y=G.get(H);y.count!==0&&(y.accessorDef.sparse={count:y.count,indices:{bufferView:Z,byteOffset:y.indicesByteOffset,componentType:z},values:{bufferView:s,byteOffset:y.valuesByteOffset}})}return{buffers:B,byteLength:D}}if(l.accessors=[],l.bufferViews=[],l.samplers=[],l.textures=[],l.images=a.listTextures().map((x,P)=>{const M=d.createPropertyDef(x);x.getMimeType()&&(M.mimeType=x.getMimeType());const B=x.getImage();return B&&d.createImageData(M,B,x),d.imageIndexMap.set(x,P),M}),A.filter(x=>x.prewriteTypes.includes(Te.ACCESSOR)).forEach(x=>x.prewrite(d,Te.ACCESSOR)),a.listAccessors().forEach(x=>{const P=d.accessorUsageGroupedByParent,M=d.accessorParents;if(d.accessorIndexMap.has(x))return;const B=d.getAccessorUsage(x);if(d.addAccessorToUsageGroup(x,B),P.has(B)){const D=i.listParents(x).find(G=>G.propertyType!==Te.ROOT);M.set(x,D)}}),A.filter(x=>x.prewriteTypes.includes(Te.BUFFER)).forEach(x=>x.prewrite(d,Te.BUFFER)),(a.listAccessors().length>0||d.otherBufferViews.size>0||a.listTextures().length>0&&t.format===Hr.GLB)&&a.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");l.buffers=[],a.listBuffers().forEach((x,P)=>{const M=d.createPropertyDef(x),B=d.accessorUsageGroupedByParent,D=x.listParents().filter(K=>K instanceof at),G=new Set(D.map(K=>d.accessorParents.get(K))),U=new Map(Array.from(G).map((K,s)=>[K,s])),V={};for(const K of D){var k;if(d.accessorIndexMap.has(K))continue;const s=d.getAccessorUsage(K);let H=s;if(B.has(s)){const y=d.accessorParents.get(K);H+=`:${U.get(y)}`}V[k=H]||(V[k]={usage:s,accessors:[]}),V[H].accessors.push(K)}const z=[],Q=l.buffers.length;let Z=0;for(const{usage:K,accessors:s}of Object.values(V))if(K===Nh.ARRAY_BUFFER&&t.vertexLayout===of.INTERLEAVED){const H=w(s,Q,Z);Z+=H.byteLength;for(const y of H.buffers)z.push(y)}else if(K===Nh.ARRAY_BUFFER)for(const H of s){const y=w([H],Q,Z);Z+=y.byteLength;for(const ee of y.buffers)z.push(ee)}else if(K===Nh.SPARSE){const H=E(s,Q,Z);Z+=H.byteLength;for(const y of H.buffers)z.push(y)}else if(K===Nh.ELEMENT_ARRAY_BUFFER){const H=$a.BufferViewTarget.ELEMENT_ARRAY_BUFFER,y=b(s,Q,Z,H);Z+=y.byteLength;for(const ee of y.buffers)z.push(ee)}else{const H=b(s,Q,Z);Z+=H.byteLength;for(const y of H.buffers)z.push(y)}if(d.imageBufferViews.length&&P===0){for(let K=0;K<d.imageBufferViews.length;K++)if(l.bufferViews[l.images[K].bufferView].byteOffset=Z,Z+=d.imageBufferViews[K].byteLength,z.push(d.imageBufferViews[K]),Z%8){const s=8-Z%8;Z+=s,z.push(new Uint8Array(s))}}if(d.otherBufferViews.has(x))for(const K of d.otherBufferViews.get(x))l.bufferViews.push({buffer:Q,byteOffset:Z,byteLength:K.byteLength}),d.otherBufferViewsIndexMap.set(K,l.bufferViews.length-1),Z+=K.byteLength,z.push(K);if(Z){let K;t.format===Hr.GLB?K=af:(K=d.bufferURIGenerator.createURI(x,"bin"),M.uri=K),M.byteLength=Z,d.assignResourceURI(K,yt.concat(z),!0)}l.buffers.push(M),d.bufferIndexMap.set(x,P)}),a.listAccessors().find(x=>!x.getBuffer())&&p.warn("Skipped writing one or more Accessors: no Buffer assigned."),A.filter(x=>x.prewriteTypes.includes(Te.MATERIAL)).forEach(x=>x.prewrite(d,Te.MATERIAL)),l.materials=a.listMaterials().map((x,P)=>{const M=d.createPropertyDef(x);if(x.getAlphaMode()!==Ya.AlphaMode.OPAQUE&&(M.alphaMode=x.getAlphaMode()),x.getAlphaMode()===Ya.AlphaMode.MASK&&(M.alphaCutoff=x.getAlphaCutoff()),x.getDoubleSided()&&(M.doubleSided=!0),M.pbrMetallicRoughness={},si.eq(x.getBaseColorFactor(),[1,1,1,1])||(M.pbrMetallicRoughness.baseColorFactor=x.getBaseColorFactor()),si.eq(x.getEmissiveFactor(),[0,0,0])||(M.emissiveFactor=x.getEmissiveFactor()),x.getRoughnessFactor()!==1&&(M.pbrMetallicRoughness.roughnessFactor=x.getRoughnessFactor()),x.getMetallicFactor()!==1&&(M.pbrMetallicRoughness.metallicFactor=x.getMetallicFactor()),x.getBaseColorTexture()){const B=x.getBaseColorTexture(),D=x.getBaseColorTextureInfo();M.pbrMetallicRoughness.baseColorTexture=d.createTextureInfoDef(B,D)}if(x.getEmissiveTexture()){const B=x.getEmissiveTexture(),D=x.getEmissiveTextureInfo();M.emissiveTexture=d.createTextureInfoDef(B,D)}if(x.getNormalTexture()){const B=x.getNormalTexture(),D=x.getNormalTextureInfo(),G=d.createTextureInfoDef(B,D);x.getNormalScale()!==1&&(G.scale=x.getNormalScale()),M.normalTexture=G}if(x.getOcclusionTexture()){const B=x.getOcclusionTexture(),D=x.getOcclusionTextureInfo(),G=d.createTextureInfoDef(B,D);x.getOcclusionStrength()!==1&&(G.strength=x.getOcclusionStrength()),M.occlusionTexture=G}if(x.getMetallicRoughnessTexture()){const B=x.getMetallicRoughnessTexture(),D=x.getMetallicRoughnessTextureInfo();M.pbrMetallicRoughness.metallicRoughnessTexture=d.createTextureInfoDef(B,D)}return d.materialIndexMap.set(x,P),M}),A.filter(x=>x.prewriteTypes.includes(Te.MESH)).forEach(x=>x.prewrite(d,Te.MESH)),l.meshes=a.listMeshes().map((x,P)=>{const M=d.createPropertyDef(x);let B=null;return M.primitives=x.listPrimitives().map(D=>{const G={attributes:{}};G.mode=D.getMode();const U=D.getMaterial();U&&(G.material=d.materialIndexMap.get(U)),Object.keys(D.getExtras()).length&&(G.extras=D.getExtras());const V=D.getIndices();V&&(G.indices=d.accessorIndexMap.get(V));for(const k of D.listSemantics())G.attributes[k]=d.accessorIndexMap.get(D.getAttribute(k));for(const k of D.listTargets()){const z={};for(const Q of k.listSemantics())z[Q]=d.accessorIndexMap.get(k.getAttribute(Q));G.targets=G.targets||[],G.targets.push(z)}return D.listTargets().length&&!B&&(B=D.listTargets().map(k=>k.getName())),G}),x.getWeights().length&&(M.weights=x.getWeights()),B&&(M.extras=M.extras||{},M.extras.targetNames=B),d.meshIndexMap.set(x,P),M}),l.cameras=a.listCameras().map((x,P)=>{const M=d.createPropertyDef(x);if(M.type=x.getType(),M.type===Ja.Type.PERSPECTIVE){M.perspective={znear:x.getZNear(),zfar:x.getZFar(),yfov:x.getYFov()};const B=x.getAspectRatio();B!==null&&(M.perspective.aspectRatio=B)}else M.orthographic={znear:x.getZNear(),zfar:x.getZFar(),xmag:x.getXMag(),ymag:x.getYMag()};return d.cameraIndexMap.set(x,P),M}),l.nodes=a.listNodes().map((x,P)=>{const M=d.createPropertyDef(x);return si.eq(x.getTranslation(),[0,0,0])||(M.translation=x.getTranslation()),si.eq(x.getRotation(),[0,0,0,1])||(M.rotation=x.getRotation()),si.eq(x.getScale(),[1,1,1])||(M.scale=x.getScale()),x.getWeights().length&&(M.weights=x.getWeights()),d.nodeIndexMap.set(x,P),M}),l.skins=a.listSkins().map((x,P)=>{const M=d.createPropertyDef(x),B=x.getInverseBindMatrices();B&&(M.inverseBindMatrices=d.accessorIndexMap.get(B));const D=x.getSkeleton();return D&&(M.skeleton=d.nodeIndexMap.get(D)),M.joints=x.listJoints().map(G=>d.nodeIndexMap.get(G)),d.skinIndexMap.set(x,P),M}),a.listNodes().forEach((x,P)=>{const M=l.nodes[P],B=x.getMesh();B&&(M.mesh=d.meshIndexMap.get(B));const D=x.getCamera();D&&(M.camera=d.cameraIndexMap.get(D));const G=x.getSkin();G&&(M.skin=d.skinIndexMap.get(G)),x.listChildren().length>0&&(M.children=x.listChildren().map(U=>d.nodeIndexMap.get(U)))}),l.animations=a.listAnimations().map((x,P)=>{const M=d.createPropertyDef(x),B=new Map;return M.samplers=x.listSamplers().map((D,G)=>{const U=d.createPropertyDef(D);return U.input=d.accessorIndexMap.get(D.getInput()),U.output=d.accessorIndexMap.get(D.getOutput()),U.interpolation=D.getInterpolation(),B.set(D,G),U}),M.channels=x.listChannels().map(D=>{const G=d.createPropertyDef(D);return G.sampler=B.get(D.getSampler()),G.target={node:d.nodeIndexMap.get(D.getTargetNode()),path:D.getTargetPath()},G}),d.animationIndexMap.set(x,P),M}),l.scenes=a.listScenes().map((x,P)=>{const M=d.createPropertyDef(x);return M.nodes=x.listChildren().map(B=>d.nodeIndexMap.get(B)),d.sceneIndexMap.set(x,P),M});const T=a.getDefaultScene();return T&&(l.scene=a.listScenes().indexOf(T)),l.extensionsUsed=A.map(x=>x.extensionName),l.extensionsRequired=_.map(x=>x.extensionName),A.forEach(x=>x.write(d)),Ak(l),u}}function Ak(o){const e=[];for(const t in o){const i=o[t];(Array.isArray(i)&&i.length===0||i===null||i===""||i&&typeof i=="object"&&Object.keys(i).length===0)&&e.push(t)}for(const t of e)delete o[t]}var cf;(function(o){o[o.JSON=1313821514]="JSON",o[o.BIN=5130562]="BIN"})(cf||(cf={}));class _k{constructor(){this._logger=Qn.DEFAULT_INSTANCE,this._extensions=new Set,this._dependencies={},this._vertexLayout=of.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(e){return this._logger=e,this}registerExtensions(e){for(const t of e)this._extensions.add(t),t.register();return this}registerDependencies(e){return Object.assign(this._dependencies,e),this}setVertexLayout(e){return this._vertexLayout=e,this}async read(e){return await this.readJSON(await this.readAsJSON(e))}async readAsJSON(e){const t=await this.readURI(e,"view");this.lastReadBytes=t.byteLength;const i=Vb(t)?this._binaryToJSON(t):{json:JSON.parse(yt.decodeText(t)),resources:{}};return await this._readResourcesExternal(i,this.dirname(e)),this._readResourcesInternal(i),i}async readJSON(e){return e=this._copyJSON(e),this._readResourcesInternal(e),lk.read(e,{extensions:Array.from(this._extensions),dependencies:this._dependencies,logger:this._logger})}async binaryToJSON(e){const t=this._binaryToJSON(yt.assertView(e));this._readResourcesInternal(t);const i=t.json;if(i.buffers&&i.buffers.some(a=>yk(t,a)))throw new Error("Cannot resolve external buffers with binaryToJSON().");if(i.images&&i.images.some(a=>bk(t,a)))throw new Error("Cannot resolve external images with binaryToJSON().");return t}async readBinary(e){return this.readJSON(await this.binaryToJSON(yt.assertView(e)))}async writeJSON(e,t={}){if(t.format===Hr.GLB&&e.getRoot().listBuffers().length>1)throw new Error("GLB must have 0–1 buffers.");return gk.write(e,{format:t.format||Hr.GLTF,basename:t.basename||"",logger:this._logger,vertexLayout:this._vertexLayout,dependencies:cn({},this._dependencies),extensions:Array.from(this._extensions)})}async writeBinary(e){const{json:t,resources:i}=await this.writeJSON(e,{format:Hr.GLB}),a=new Uint32Array([1179937895,2,12]),l=JSON.stringify(t),u=yt.pad(yt.encodeText(l),32),d=yt.toView(new Uint32Array([u.byteLength,1313821514])),p=yt.concat([d,u]);a[a.length-1]+=p.byteLength;const m=Object.values(i)[0];if(!m||!m.byteLength)return yt.concat([yt.toView(a),p]);const A=yt.pad(m,0),_=yt.toView(new Uint32Array([A.byteLength,5130562])),b=yt.concat([_,A]);return a[a.length-1]+=b.byteLength,yt.concat([yt.toView(a),p,b])}async _readResourcesExternal(e,t){var i=this;const a=e.json.images||[],l=e.json.buffers||[],u=[...a,...l].map(async function(d){const p=d.uri;if(!p||p.match(/data:/))return Promise.resolve();e.resources[p]=await i.readURI(i.resolve(t,p),"view"),i.lastReadBytes+=e.resources[p].byteLength});await Promise.all(u)}_readResourcesInternal(e){function t(l){if(l.uri){if(l.uri in e.resources){yt.assertView(e.resources[l.uri]);return}if(l.uri.match(/data:/)){const u=`__${tk()}.${Rl.extension(l.uri)}`;e.resources[u]=yt.createBufferFromDataURI(l.uri),l.uri=u}}}(e.json.images||[]).forEach(l=>{if(l.bufferView===void 0&&l.uri===void 0)throw new Error("Missing resource URI or buffer view.");t(l)}),(e.json.buffers||[]).forEach(t)}_copyJSON(e){const{images:t,buffers:i}=e.json;return e={json:cn({},e.json),resources:cn({},e.resources)},t&&(e.json.images=t.map(a=>cn({},a))),i&&(e.json.buffers=i.map(a=>cn({},a))),e}_binaryToJSON(e){if(!Vb(e))throw new Error("Invalid glTF 2.0 binary.");const t=new Uint32Array(e.buffer,e.byteOffset+12,2);if(t[1]!==cf.JSON)throw new Error("Missing required GLB JSON chunk.");const i=20,a=t[0],l=yt.decodeText(yt.toView(e,i,a)),u=JSON.parse(l),d=i+a;if(e.byteLength<=d)return{json:u,resources:{}};const p=new Uint32Array(e.buffer,e.byteOffset+d,2);if(p[1]!==cf.BIN)return{json:u,resources:{}};const m=p[0],A=yt.toView(e,d+8,m);return{json:u,resources:{[af]:A}}}}function yk(o,e){return e.uri!==void 0&&!(e.uri in o.resources)}function bk(o,e){return e.uri!==void 0&&!(e.uri in o.resources)&&e.bufferView===void 0}function Vb(o){if(o.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;const e=new Uint32Array(o.buffer,o.byteOffset,3);return e[0]===1179937895&&e[1]===2}class vk extends _k{constructor(e=du.DEFAULT_INIT){super(),this._fetchConfig=void 0,this._fetchConfig=e}async readURI(e,t){const i=await fetch(e,this._fetchConfig);switch(t){case"view":return new Uint8Array(await i.arrayBuffer());case"text":return i.text()}}resolve(e,t){return du.resolve(e,t)}dirname(e){return du.dirname(e)}}function F1(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var im,Qb;function wk(){if(Qb)return im;Qb=1;function o(e){for(var t=new Array(e),i=0;i<e;++i)t[i]=i;return t}return im=o,im}/*!
|
|
4144
|
+
}`};function Bh(o,e,t){let i=t;const a=new se;return o.updateWorldMatrix(!0,!0),o.traverseVisible(l=>{const{geometry:u}=l;if(u!==void 0){const{position:d}=u.attributes;if(d!==void 0)for(let p=0,m=d.count;p<m;p++)l.isMesh?l.getVertexPosition(p,a):a.fromBufferAttribute(d,p),l.isSkinnedMesh||a.applyMatrix4(l.matrixWorld),i=e(i,a)}}),i}function NO(o){const e=new Map,t=new Map,i=o.clone();return T1(o,i,function(a,l){e.set(l,a),t.set(a,l)}),i.traverse(function(a){if(!a.isSkinnedMesh)return;const l=a,u=e.get(a),d=u.skeleton.bones;l.skeleton=u.skeleton.clone(),l.bindMatrix.copy(u.bindMatrix),l.skeleton.bones=d.map(function(p){return t.get(p)}),l.bind(l.skeleton,l.bindMatrix)}),i}function T1(o,e,t){t(o,e);for(let i=0;i<o.children.length;i++)T1(o.children[i],e.children[i],t)}class OO{constructor(e,t,i,a,l){this.xrLight=e,this.renderer=t,this.lightProbe=i,this.xrWebGLBinding=null,this.estimationStartCallback=l,this.frameCallback=this.onXRFrame.bind(this);const u=t.xr.getSession();if(a&&"XRWebGLBinding"in window){const d=new k0(16);e.environment=d.texture;const p=t.getContext();switch(u.preferredReflectionFormat){case"srgba8":p.getExtension("EXT_sRGB");break;case"rgba16f":p.getExtension("OES_texture_half_float");break}this.xrWebGLBinding=new XRWebGLBinding(u,p),this.lightProbe.addEventListener("reflectionchange",()=>{this.updateReflection()})}u.requestAnimationFrame(this.frameCallback)}updateReflection(){const e=this.renderer.properties.get(this.xrLight.environment);if(e){const t=this.xrWebGLBinding.getReflectionCubeMap(this.lightProbe);t&&(e.__webglTexture=t,this.xrLight.environment.needsPMREMUpdate=!0)}}onXRFrame(e,t){if(!this.xrLight)return;t.session.requestAnimationFrame(this.frameCallback);const a=t.getLightEstimate(this.lightProbe);if(a){this.xrLight.lightProbe.sh.fromArray(a.sphericalHarmonicsCoefficients),this.xrLight.lightProbe.intensity=1;const l=Math.max(1,Math.max(a.primaryLightIntensity.x,Math.max(a.primaryLightIntensity.y,a.primaryLightIntensity.z)));this.xrLight.directionalLight.color.setRGB(a.primaryLightIntensity.x/l,a.primaryLightIntensity.y/l,a.primaryLightIntensity.z/l),this.xrLight.directionalLight.intensity=l,this.xrLight.directionalLight.position.copy(a.primaryLightDirection),this.estimationStartCallback&&(this.estimationStartCallback(),this.estimationStartCallback=null)}}dispose(){this.xrLight=null,this.renderer=null,this.lightProbe=null,this.xrWebGLBinding=null}}class kO extends mi{constructor(e,t=!0){super(),this.lightProbe=new PR,this.lightProbe.intensity=0,this.add(this.lightProbe),this.directionalLight=new FS,this.directionalLight.intensity=0,this.add(this.directionalLight),this.environment=null;let i=null,a=!1;e.xr.addEventListener("sessionstart",()=>{const l=e.xr.getSession();"requestLightProbe"in l&&l.requestLightProbe({reflectionFormat:l.preferredReflectionFormat}).then(u=>{i=new OO(this,e,u,t,()=>{a=!0,this.dispatchEvent({type:"estimationstart"})})})}),e.xr.addEventListener("sessionend",()=>{i&&(i.dispose(),i=null),a&&this.dispatchEvent({type:"estimationend"})}),this.dispose=()=>{i&&(i.dispose(),i=null),this.remove(this.lightProbe),this.lightProbe=null,this.remove(this.directionalLight),this.directionalLight=null,this.environment=null}}}class rf{constructor(){if(this.gltfLoader={},this.textureLoader={},rf.instance)return rf.instance;this.gltfLoader=this.initializeGltfLoader(),this.textureLoader=this.initializeTextureLoader()}initializeGltfLoader(){const e=new b1,t=new y1;return t.setDecoderPath("https://asset.myepigraph.com/configurator-assets/configurator-lite/external-libs/draco/"),e.setDRACOLoader(t),e}initializeTextureLoader(){return new H0}}var UO=function(){return performance.now()},I1=(function(){function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return o.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},o.prototype.removeAll=function(){this._tweens={}},o.prototype.add=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];for(var a=0,l=t;a<l.length;a++){var u=l[a];(e=u._group)===null||e===void 0||e.remove(u),u._group=this,this._tweens[u.getId()]=u,this._tweensAddedDuringUpdate[u.getId()]=u}},o.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i=0,a=e;i<a.length;i++){var l=a[i];l._group=void 0,delete this._tweens[l.getId()],delete this._tweensAddedDuringUpdate[l.getId()]}},o.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},o.prototype.update=function(e,t){e===void 0&&(e=UO()),t===void 0&&(t=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var a=0;a<i.length;a++){var l=this._tweens[i[a]],u=!t;l&&l.update(e,u)===!1&&!t&&this.remove(l)}i=Object.keys(this._tweensAddedDuringUpdate)}},o})(),FO=new I1,Cs=FO;Cs.getAll.bind(Cs);Cs.removeAll.bind(Cs);Cs.add.bind(Cs);Cs.remove.bind(Cs);Cs.update.bind(Cs);let M1=class{constructor(){this._listeners={}}addEventListener(e,t){const i=this._listeners;return i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t),this}removeEventListener(e,t){const a=this._listeners[e];if(a!==void 0){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}return this}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){const a=i.slice(0);for(let l=0,u=a.length;l<u;l++)a[l].call(this,e)}return this}dispose(){for(const e in this._listeners)delete this._listeners[e]}};class Xo{constructor(e,t,i,a={}){if(this._name=void 0,this._parent=void 0,this._child=void 0,this._attributes=void 0,this._disposed=!1,this._name=e,this._parent=t,this._child=i,this._attributes=a,!t.isOnGraph(i))throw new Error("Cannot connect disconnected graphs.")}getName(){return this._name}getParent(){return this._parent}getChild(){return this._child}setChild(e){return this._child=e,this}getAttributes(){return this._attributes}dispose(){this._disposed||(this._parent._destroyRef(this),this._disposed=!0)}isDisposed(){return this._disposed}}class $O extends M1{constructor(...e){super(...e),this._emptySet=new Set,this._edges=new Set,this._parentEdges=new Map,this._childEdges=new Map}listEdges(){return Array.from(this._edges)}listParentEdges(e){return Array.from(this._childEdges.get(e)||this._emptySet)}listParents(e){const t=new Set;for(const i of this.listParentEdges(e))t.add(i.getParent());return Array.from(t)}listChildEdges(e){return Array.from(this._parentEdges.get(e)||this._emptySet)}listChildren(e){const t=new Set;for(const i of this.listChildEdges(e))t.add(i.getChild());return Array.from(t)}disconnectParents(e,t){for(const i of this.listParentEdges(e))(!t||t(i.getParent()))&&i.dispose();return this}_createEdge(e,t,i,a){const l=new Xo(e,t,i,a);this._edges.add(l);const u=l.getParent();this._parentEdges.has(u)||this._parentEdges.set(u,new Set),this._parentEdges.get(u).add(l);const d=l.getChild();return this._childEdges.has(d)||this._childEdges.set(d,new Set),this._childEdges.get(d).add(l),l}_destroyEdge(e){return this._edges.delete(e),this._parentEdges.get(e.getParent()).delete(e),this._childEdges.get(e.getChild()).delete(e),this}}function hu(){return hu=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(o[i]=t[i])}return o},hu.apply(this,arguments)}class Ur{constructor(e){if(this.list=[],e)for(const t of e)this.list.push(t)}add(e){this.list.push(e)}remove(e){const t=this.list.indexOf(e);t>=0&&this.list.splice(t,1)}removeChild(e){const t=[];for(const i of this.list)i.getChild()===e&&t.push(i);for(const i of t)this.remove(i);return t}listRefsByChild(e){const t=[];for(const i of this.list)i.getChild()===e&&t.push(i);return t}values(){return this.list}}class Zt{constructor(e){if(this.set=new Set,this.map=new Map,e)for(const t of e)this.add(t)}add(e){const t=e.getChild();this.removeChild(t),this.set.add(e),this.map.set(t,e)}remove(e){this.set.delete(e),this.map.delete(e.getChild())}removeChild(e){const t=this.map.get(e)||null;return t&&this.remove(t),t}getRefByChild(e){return this.map.get(e)||null}values(){return Array.from(this.set)}}class Es{constructor(e){this.map={},e&&Object.assign(this.map,e)}set(e,t){this.map[e]=t}delete(e){delete this.map[e]}get(e){return this.map[e]||null}keys(){return Object.keys(this.map)}values(){return Object.values(this.map)}}const Bt=Symbol("attributes"),Ra=Symbol("immutableKeys");class e_ extends M1{constructor(e){super(),this._disposed=!1,this.graph=void 0,this[Bt]=void 0,this[Ra]=void 0,this.graph=e,this[Ra]=new Set,this[Bt]=this._createAttributes()}getDefaults(){return{}}_createAttributes(){const e=this.getDefaults(),t={};for(const i in e){const a=e[i];if(a instanceof e_){const l=this.graph._createEdge(i,this,a);this[Ra].add(i),t[i]=l}else t[i]=a}return t}isOnGraph(e){return this.graph===e.graph}isDisposed(){return this._disposed}dispose(){this._disposed||(this.graph.listChildEdges(this).forEach(e=>e.dispose()),this.graph.disconnectParents(this),this._disposed=!0,this.dispatchEvent({type:"dispose"}))}detach(){return this.graph.disconnectParents(this),this}swap(e,t){for(const i in this[Bt]){const a=this[Bt][i];if(a instanceof Xo){const l=a;l.getChild()===e&&this.setRef(i,t,l.getAttributes())}else if(a instanceof Ur)for(const l of a.listRefsByChild(e)){const u=l.getAttributes();this.removeRef(i,e),this.addRef(i,t,u)}else if(a instanceof Zt){const l=a.getRefByChild(e);if(l){const u=l.getAttributes();this.removeRef(i,e),this.addRef(i,t,u)}}else if(a instanceof Es)for(const l of a.keys()){const u=a.get(l);u.getChild()===e&&this.setRefMap(i,l,t,u.getAttributes())}}return this}get(e){return this[Bt][e]}set(e,t){return this[Bt][e]=t,this.dispatchEvent({type:"change",attribute:e})}getRef(e){const t=this[Bt][e];return t?t.getChild():null}setRef(e,t,i){if(this[Ra].has(e))throw new Error(`Cannot overwrite immutable attribute, "${e}".`);const a=this[Bt][e];if(a&&a.dispose(),!t)return this;const l=this.graph._createEdge(e,this,t,i);return this[Bt][e]=l,this.dispatchEvent({type:"change",attribute:e})}listRefs(e){return this.assertRefList(e).values().map(i=>i.getChild())}addRef(e,t,i){const a=this.graph._createEdge(e,this,t,i);return this.assertRefList(e).add(a),this.dispatchEvent({type:"change",attribute:e})}removeRef(e,t){const i=this.assertRefList(e);if(i instanceof Ur)for(const a of i.listRefsByChild(t))a.dispose();else{const a=i.getRefByChild(t);a&&a.dispose()}return this}assertRefList(e){const t=this[Bt][e];if(t instanceof Ur||t instanceof Zt)return t;throw new Error(`Expected RefList or RefSet for attribute "${e}"`)}listRefMapKeys(e){return this.assertRefMap(e).keys()}listRefMapValues(e){return this.assertRefMap(e).values().map(t=>t.getChild())}getRefMap(e,t){const a=this.assertRefMap(e).get(t);return a?a.getChild():null}setRefMap(e,t,i,a){const l=this.assertRefMap(e),u=l.get(t);if(u&&u.dispose(),!i)return this;a=Object.assign(a||{},{key:t});const d=this.graph._createEdge(e,this,i,hu({},a,{key:t}));return l.set(t,d),this.dispatchEvent({type:"change",attribute:e,key:t})}assertRefMap(e){const t=this[Bt][e];if(t instanceof Es)return t;throw new Error(`Expected RefMap for attribute "${e}"`)}dispatchEvent(e){return super.dispatchEvent(hu({},e,{target:this})),this.graph.dispatchEvent(hu({},e,{target:this,type:`node:${e.type}`})),this}_destroyRef(e){const t=e.getName();if(this[Bt][t]===e)this[Bt][t]=null,this[Ra].has(t)&&e.getChild().dispose();else if(this[Bt][t]instanceof Ur)this[Bt][t].remove(e);else if(this[Bt][t]instanceof Zt)this[Bt][t].remove(e);else if(this[Bt][t]instanceof Es){const i=this[Bt][t];for(const a of i.keys())i.get(a)===e&&i.delete(a)}else return;this.graph._destroyEdge(e),this.dispatchEvent({type:"change",attribute:t})}}const R1="v4.2.1",af="@glb.bin";var Te;(function(o){o.ACCESSOR="Accessor",o.ANIMATION="Animation",o.ANIMATION_CHANNEL="AnimationChannel",o.ANIMATION_SAMPLER="AnimationSampler",o.BUFFER="Buffer",o.CAMERA="Camera",o.MATERIAL="Material",o.MESH="Mesh",o.PRIMITIVE="Primitive",o.PRIMITIVE_TARGET="PrimitiveTarget",o.NODE="Node",o.ROOT="Root",o.SCENE="Scene",o.SKIN="Skin",o.TEXTURE="Texture",o.TEXTURE_INFO="TextureInfo"})(Te||(Te={}));var of;(function(o){o.INTERLEAVED="interleaved",o.SEPARATE="separate"})(of||(of={}));var Ln;(function(o){o.ARRAY_BUFFER="ARRAY_BUFFER",o.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",o.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",o.OTHER="OTHER",o.SPARSE="SPARSE"})(Ln||(Ln={}));var DA;(function(o){o[o.R=4096]="R",o[o.G=256]="G",o[o.B=16]="B",o[o.A=1]="A"})(DA||(DA={}));var Hr;(function(o){o.GLTF="GLTF",o.GLB="GLB"})(Hr||(Hr={}));const Uf={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};class vt{static createBufferFromDataURI(e){if(typeof Buffer>"u"){const t=atob(e.split(",")[1]),i=new Uint8Array(t.length);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}else{const t=e.split(",")[1],i=e.indexOf("base64")>=0;return Buffer.from(t,i?"base64":"utf8")}}static encodeText(e){return new TextEncoder().encode(e)}static decodeText(e){return new TextDecoder().decode(e)}static concat(e){let t=0;for(const l of e)t+=l.byteLength;const i=new Uint8Array(t);let a=0;for(const l of e)i.set(l,a),a+=l.byteLength;return i}static pad(e,t=0){const i=this.padNumber(e.byteLength);if(i===e.byteLength)return e;const a=new Uint8Array(i);if(a.set(e),t!==0)for(let l=e.byteLength;l<i;l++)a[l]=t;return a}static padNumber(e){return Math.ceil(e/4)*4}static equals(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;let i=e.byteLength;for(;i--;)if(e[i]!==t[i])return!1;return!0}static toView(e,t=0,i=1/0){return new Uint8Array(e.buffer,e.byteOffset+t,Math.min(e.byteLength,i))}static assertView(e){if(e&&!ArrayBuffer.isView(e))throw new Error(`Method requires Uint8Array parameter; received "${typeof e}".`);return e}}class zO{static hexToFactor(e,t){e=Math.floor(e);const i=t;return i[0]=(e>>16&255)/255,i[1]=(e>>8&255)/255,i[2]=(e&255)/255,this.convertSRGBToLinear(t,t)}static factorToHex(e){const t=[...e],[i,a,l]=this.convertLinearToSRGB(e,t);return i*255<<16^a*255<<8^l*255<<0}static convertSRGBToLinear(e,t){const i=e,a=t;for(let l=0;l<3;l++)a[l]=i[l]<.04045?i[l]*.0773993808:Math.pow(i[l]*.9478672986+.0521327014,2.4);return t}static convertLinearToSRGB(e,t){const i=e,a=t;for(let l=0;l<3;l++)a[l]=i[l]<.0031308?i[l]*12.92:1.055*Math.pow(i[l],.41666)-.055;return t}}class GO{match(e){return e.length>=3&&e[0]===255&&e[1]===216&&e[2]===255}getSize(e){let t=new DataView(e.buffer,e.byteOffset+4),i,a;for(;t.byteLength;){if(i=t.getUint16(0,!1),HO(t,i),a=t.getUint8(i+1),a===192||a===193||a===194)return[t.getUint16(i+7,!1),t.getUint16(i+5,!1)];t=new DataView(e.buffer,t.byteOffset+i+2)}throw new TypeError("Invalid JPG, no size found")}getChannels(e){return 3}}class Ff{match(e){return e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10}getSize(e){const t=new DataView(e.buffer,e.byteOffset);return vt.decodeText(e.slice(12,16))===Ff.PNG_FRIED_CHUNK_NAME?[t.getUint32(32,!1),t.getUint32(36,!1)]:[t.getUint32(16,!1),t.getUint32(20,!1)]}getChannels(e){return 4}}Ff.PNG_FRIED_CHUNK_NAME="CgBI";class Fa{static registerFormat(e,t){this.impls[e]=t}static getMimeType(e){for(const t in this.impls)if(this.impls[t].match(e))return t;return null}static getSize(e,t){return this.impls[t]?this.impls[t].getSize(e):null}static getChannels(e,t){return this.impls[t]?this.impls[t].getChannels(e):null}static getVRAMByteLength(e,t){if(!this.impls[t])return null;if(this.impls[t].getVRAMByteLength)return this.impls[t].getVRAMByteLength(e);let i=0;const a=4,l=this.getSize(e,t);if(!l)return null;for(;l[0]>1||l[1]>1;)i+=l[0]*l[1]*a,l[0]=Math.max(Math.floor(l[0]/2),1),l[1]=Math.max(Math.floor(l[1]/2),1);return i+=1*a,i}static mimeTypeToExtension(e){return e==="image/jpeg"?"jpg":e.split("/").pop()}static extensionToMimeType(e){return e==="jpg"?"image/jpeg":e?`image/${e}`:""}}Fa.impls={"image/jpeg":new GO,"image/png":new Ff};function HO(o,e){if(e>o.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(o.getUint8(e)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return o}class Rl{static basename(e){const t=e.split(/[\\/]/).pop();return t.substring(0,t.lastIndexOf("."))}static extension(e){if(e.startsWith("data:image/")){const t=e.match(/data:(image\/\w+)/)[1];return Fa.mimeTypeToExtension(t)}else{if(e.startsWith("data:model/gltf+json"))return"gltf";if(e.startsWith("data:model/gltf-binary"))return"glb";if(e.startsWith("data:application/"))return"bin"}return e.split(/[\\/]/).pop().split(/[.]/).pop()}}var NA=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var o=0,e=arguments.length;e--;)o+=arguments[e]*arguments[e];return Math.sqrt(o)});function VO(){var o=new NA(3);return NA!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),o}function tm(o){var e=o[0],t=o[1],i=o[2];return Math.hypot(e,t,i)}(function(){var o=VO();return function(e,t,i,a,l,u){var d,p;for(t||(t=3),i||(i=0),a?p=Math.min(a*t+i,e.length):p=e.length,d=i;d<p;d+=t)o[0]=e[d],o[1]=e[d+1],o[2]=e[d+2],l(o,o,u),e[d]=o[0],e[d+1]=o[1],e[d+2]=o[2];return e}})();const Ub="https://null.example";class du{static dirname(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substring(0,t+1)}static basename(e){return Rl.basename(new URL(e,Ub).pathname)}static extension(e){return Rl.extension(new URL(e,Ub).pathname)}static resolve(e,t){if(!this.isRelativePath(t))return t;const i=e.split("/"),a=t.split("/");i.pop();for(let l=0;l<a.length;l++)a[l]!=="."&&(a[l]===".."?i.pop():i.push(a[l]));return i.join("/")}static isAbsoluteURL(e){return this.PROTOCOL_REGEXP.test(e)}static isRelativePath(e){return!/^(?:[a-zA-Z]+:)?\//.test(e)}}du.DEFAULT_INIT={};du.PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;function Fb(o){return Object.prototype.toString.call(o)==="[object Object]"}function Da(o){if(Fb(o)===!1)return!1;const e=o.constructor;if(e===void 0)return!0;const t=e.prototype;return!(Fb(t)===!1||Object.hasOwn(t,"isPrototypeOf")===!1)}var OA,kA;(function(o){o[o.SILENT=4]="SILENT",o[o.ERROR=3]="ERROR",o[o.WARN=2]="WARN",o[o.INFO=1]="INFO",o[o.DEBUG=0]="DEBUG"})(kA||(kA={}));class Qn{constructor(e){this.verbosity=void 0,this.verbosity=e}debug(e){this.verbosity<=Qn.Verbosity.DEBUG&&console.debug(e)}info(e){this.verbosity<=Qn.Verbosity.INFO&&console.info(e)}warn(e){this.verbosity<=Qn.Verbosity.WARN&&console.warn(e)}error(e){this.verbosity<=Qn.Verbosity.ERROR&&console.error(e)}}OA=Qn;Qn.Verbosity=kA;Qn.DEFAULT_INSTANCE=new OA(OA.Verbosity.INFO);function QO(o){var e=o[0],t=o[1],i=o[2],a=o[3],l=o[4],u=o[5],d=o[6],p=o[7],m=o[8],A=o[9],_=o[10],b=o[11],w=o[12],E=o[13],C=o[14],T=o[15],x=e*u-t*l,P=e*d-i*l,M=e*p-a*l,B=t*d-i*u,D=t*p-a*u,G=i*p-a*d,U=m*E-A*w,V=m*C-_*w,k=m*T-b*w,z=A*C-_*E,Q=A*T-b*E,Z=_*T-b*C;return x*Z-P*Q+M*z+B*k-D*V+G*U}function jO(o,e,t){var i=e[0],a=e[1],l=e[2],u=e[3],d=e[4],p=e[5],m=e[6],A=e[7],_=e[8],b=e[9],w=e[10],E=e[11],C=e[12],T=e[13],x=e[14],P=e[15],M=t[0],B=t[1],D=t[2],G=t[3];return o[0]=M*i+B*d+D*_+G*C,o[1]=M*a+B*p+D*b+G*T,o[2]=M*l+B*m+D*w+G*x,o[3]=M*u+B*A+D*E+G*P,M=t[4],B=t[5],D=t[6],G=t[7],o[4]=M*i+B*d+D*_+G*C,o[5]=M*a+B*p+D*b+G*T,o[6]=M*l+B*m+D*w+G*x,o[7]=M*u+B*A+D*E+G*P,M=t[8],B=t[9],D=t[10],G=t[11],o[8]=M*i+B*d+D*_+G*C,o[9]=M*a+B*p+D*b+G*T,o[10]=M*l+B*m+D*w+G*x,o[11]=M*u+B*A+D*E+G*P,M=t[12],B=t[13],D=t[14],G=t[15],o[12]=M*i+B*d+D*_+G*C,o[13]=M*a+B*p+D*b+G*T,o[14]=M*l+B*m+D*w+G*x,o[15]=M*u+B*A+D*E+G*P,o}function qO(o,e){var t=e[0],i=e[1],a=e[2],l=e[4],u=e[5],d=e[6],p=e[8],m=e[9],A=e[10];return o[0]=Math.hypot(t,i,a),o[1]=Math.hypot(l,u,d),o[2]=Math.hypot(p,m,A),o}function WO(o,e){var t=new NA(3);qO(t,e);var i=1/t[0],a=1/t[1],l=1/t[2],u=e[0]*i,d=e[1]*a,p=e[2]*l,m=e[4]*i,A=e[5]*a,_=e[6]*l,b=e[8]*i,w=e[9]*a,E=e[10]*l,C=u+A+E,T=0;return C>0?(T=Math.sqrt(C+1)*2,o[3]=.25*T,o[0]=(_-w)/T,o[1]=(b-p)/T,o[2]=(d-m)/T):u>A&&u>E?(T=Math.sqrt(1+u-A-E)*2,o[3]=(_-w)/T,o[0]=.25*T,o[1]=(d+m)/T,o[2]=(b+p)/T):A>E?(T=Math.sqrt(1+A-u-E)*2,o[3]=(b-p)/T,o[0]=(d+m)/T,o[1]=.25*T,o[2]=(_+w)/T):(T=Math.sqrt(1+E-u-A)*2,o[3]=(d-m)/T,o[0]=(b+p)/T,o[1]=(_+w)/T,o[2]=.25*T),o}class si{static identity(e){return e}static eq(e,t,i=1e-5){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(Math.abs(e[a]-t[a])>i)return!1;return!0}static clamp(e,t,i){return e<t?t:e>i?i:e}static decodeNormalizedInt(e,t){switch(t){case 5126:return e;case 5123:return e/65535;case 5121:return e/255;case 5122:return Math.max(e/32767,-1);case 5120:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(e,t){switch(t){case 5126:return e;case 5123:return Math.round(si.clamp(e,0,1)*65535);case 5121:return Math.round(si.clamp(e,0,1)*255);case 5122:return Math.round(si.clamp(e,-1,1)*32767);case 5120:return Math.round(si.clamp(e,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(e,t,i,a){let l=tm([e[0],e[1],e[2]]);const u=tm([e[4],e[5],e[6]]),d=tm([e[8],e[9],e[10]]);QO(e)<0&&(l=-l),t[0]=e[12],t[1]=e[13],t[2]=e[14];const m=e.slice(),A=1/l,_=1/u,b=1/d;m[0]*=A,m[1]*=A,m[2]*=A,m[4]*=_,m[5]*=_,m[6]*=_,m[8]*=b,m[9]*=b,m[10]*=b,WO(i,m),a[0]=l,a[1]=u,a[2]=d}static compose(e,t,i,a){const l=a,u=t[0],d=t[1],p=t[2],m=t[3],A=u+u,_=d+d,b=p+p,w=u*A,E=u*_,C=u*b,T=d*_,x=d*b,P=p*b,M=m*A,B=m*_,D=m*b,G=i[0],U=i[1],V=i[2];return l[0]=(1-(T+P))*G,l[1]=(E+D)*G,l[2]=(C-B)*G,l[3]=0,l[4]=(E-D)*U,l[5]=(1-(w+P))*U,l[6]=(x+M)*U,l[7]=0,l[8]=(C+B)*V,l[9]=(x-M)*V,l[10]=(1-(w+T))*V,l[11]=0,l[12]=e[0],l[13]=e[1],l[14]=e[2],l[15]=1,l}}function YO(o,e){if(!!o!=!!e)return!1;const t=o.getChild(),i=e.getChild();return t===i||t.equals(i)}function XO(o,e){if(!!o!=!!e)return!1;const t=o.values(),i=e.values();if(t.length!==i.length)return!1;for(let a=0;a<t.length;a++){const l=t[a],u=i[a];if(l.getChild()!==u.getChild()&&!l.getChild().equals(u.getChild()))return!1}return!0}function KO(o,e){if(!!o!=!!e)return!1;const t=o.keys(),i=e.keys();if(t.length!==i.length)return!1;for(const a of t){const l=o.get(a),u=e.get(a);if(!!l!=!!u)return!1;const d=l.getChild(),p=u.getChild();if(d!==p&&!d.equals(p))return!1}return!0}function B1(o,e){if(o===e)return!0;if(!!o!=!!e||!o||!e||o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!==e[t])return!1;return!0}function P1(o,e){if(o===e)return!0;if(!!o!=!!e)return!1;if(!Da(o)||!Da(e))return o===e;const t=o,i=e;let a=0,l=0,u;for(u in t)a++;for(u in i)l++;if(a!==l)return!1;for(u in t){const d=t[u],p=i[u];if(lf(d)&&lf(p)){if(!B1(d,p))return!1}else if(Da(d)&&Da(p)){if(!P1(d,p))return!1}else if(d!==p)return!1}return!0}function lf(o){return Array.isArray(o)||ArrayBuffer.isView(o)}const $b="23456789abdegjkmnpqrvwxyzABDEGJKMNPQRVWXYZ",JO=999,ZO=6,zb=new Set,ek=function(){let e="";for(let t=0;t<ZO;t++)e+=$b.charAt(Math.floor(Math.random()*$b.length));return e},tk=function(){for(let e=0;e<JO;e++){const t=ek();if(!zb.has(t))return zb.add(t),t}return""},Yr=o=>o,ik=new Set;class t_ extends e_{constructor(e,t=""){super(e),this[Bt].name=t,this.init(),this.dispatchEvent({type:"create"})}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(e,t){return Array.isArray(t)&&(t=t.slice()),super.set(e,t)}getName(){return this.get("name")}setName(e){return this.set("name",e)}getExtras(){return this.get("extras")}setExtras(e){return this.set("extras",e)}clone(){const e=this.constructor;return new e(this.graph).copy(this,Yr)}copy(e,t=Yr){for(const i in this[Bt]){const a=this[Bt][i];if(a instanceof Xo)this[Ra].has(i)||a.dispose();else if(a instanceof Ur||a instanceof Zt)for(const l of a.values())l.dispose();else if(a instanceof Es)for(const l of a.values())l.dispose()}for(const i in e[Bt]){const a=this[Bt][i],l=e[Bt][i];if(l instanceof Xo)this[Ra].has(i)?a.getChild().copy(t(l.getChild()),t):this.setRef(i,t(l.getChild()),l.getAttributes());else if(l instanceof Zt||l instanceof Ur)for(const u of l.values())this.addRef(i,t(u.getChild()),u.getAttributes());else if(l instanceof Es)for(const u of l.keys()){const d=l.get(u);this.setRefMap(i,u,t(d.getChild()),d.getAttributes())}else Da(l)?this[Bt][i]=JSON.parse(JSON.stringify(l)):Array.isArray(l)||l instanceof ArrayBuffer||ArrayBuffer.isView(l)?this[Bt][i]=l.slice():this[Bt][i]=l}return this}equals(e,t=ik){if(this===e)return!0;if(this.propertyType!==e.propertyType)return!1;for(const i in this[Bt]){if(t.has(i))continue;const a=this[Bt][i],l=e[Bt][i];if(a instanceof Xo||l instanceof Xo){if(!YO(a,l))return!1}else if(a instanceof Zt||l instanceof Zt||a instanceof Ur||l instanceof Ur){if(!XO(a,l))return!1}else if(a instanceof Es||l instanceof Es){if(!KO(a,l))return!1}else if(Da(a)||Da(l)){if(!P1(a,l))return!1}else if(lf(a)||lf(l)){if(!B1(a,l))return!1}else if(a!==l)return!1}return!0}detach(){return this.graph.disconnectParents(this,e=>e.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}}class mn extends t_{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new Es})}getExtension(e){return this.getRefMap("extensions",e)}setExtension(e,t){return t&&t._validateParent(this),this.setRefMap("extensions",e,t)}listExtensions(){return this.listRefMapValues("extensions")}}class at extends mn{init(){this.propertyType=Te.ACCESSOR}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:at.Type.SCALAR,componentType:at.ComponentType.FLOAT,normalized:!1,sparse:!1,buffer:null})}static getElementSize(e){switch(e){case at.Type.SCALAR:return 1;case at.Type.VEC2:return 2;case at.Type.VEC3:return 3;case at.Type.VEC4:return 4;case at.Type.MAT2:return 4;case at.Type.MAT3:return 9;case at.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+e)}}static getComponentSize(e){switch(e){case at.ComponentType.BYTE:return 1;case at.ComponentType.UNSIGNED_BYTE:return 1;case at.ComponentType.SHORT:return 2;case at.ComponentType.UNSIGNED_SHORT:return 2;case at.ComponentType.UNSIGNED_INT:return 4;case at.ComponentType.FLOAT:return 4;default:throw new Error("Unexpected component type: "+e)}}getMinNormalized(e){const t=this.getNormalized(),i=this.getElementSize(),a=this.getComponentType();if(this.getMin(e),t)for(let l=0;l<i;l++)e[l]=si.decodeNormalizedInt(e[l],a);return e}getMin(e){const t=this.getArray(),i=this.getCount(),a=this.getElementSize();for(let l=0;l<a;l++)e[l]=1/0;for(let l=0;l<i*a;l+=a)for(let u=0;u<a;u++){const d=t[l+u];Number.isFinite(d)&&(e[u]=Math.min(e[u],d))}return e}getMaxNormalized(e){const t=this.getNormalized(),i=this.getElementSize(),a=this.getComponentType();if(this.getMax(e),t)for(let l=0;l<i;l++)e[l]=si.decodeNormalizedInt(e[l],a);return e}getMax(e){const t=this.get("array"),i=this.getCount(),a=this.getElementSize();for(let l=0;l<a;l++)e[l]=-1/0;for(let l=0;l<i*a;l+=a)for(let u=0;u<a;u++){const d=t[l+u];Number.isFinite(d)&&(e[u]=Math.max(e[u],d))}return e}getCount(){const e=this.get("array");return e?e.length/this.getElementSize():0}getType(){return this.get("type")}setType(e){return this.set("type",e)}getElementSize(){return at.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(e){return this.set("normalized",e)}getScalar(e){const t=this.getElementSize(),i=this.getComponentType(),a=this.getArray();return this.getNormalized()?si.decodeNormalizedInt(a[e*t],i):a[e*t]}setScalar(e,t){const i=this.getElementSize(),a=this.getComponentType(),l=this.getArray();return this.getNormalized()?l[e*i]=si.encodeNormalizedInt(t,a):l[e*i]=t,this}getElement(e,t){const i=this.getNormalized(),a=this.getElementSize(),l=this.getComponentType(),u=this.getArray();for(let d=0;d<a;d++)i?t[d]=si.decodeNormalizedInt(u[e*a+d],l):t[d]=u[e*a+d];return t}setElement(e,t){const i=this.getNormalized(),a=this.getElementSize(),l=this.getComponentType(),u=this.getArray();for(let d=0;d<a;d++)i?u[e*a+d]=si.encodeNormalizedInt(t[d],l):u[e*a+d]=t[d];return this}getSparse(){return this.get("sparse")}setSparse(e){return this.set("sparse",e)}getBuffer(){return this.getRef("buffer")}setBuffer(e){return this.setRef("buffer",e)}getArray(){return this.get("array")}setArray(e){return this.set("componentType",e?nk(e):at.ComponentType.FLOAT),this.set("array",e),this}getByteLength(){const e=this.get("array");return e?e.byteLength:0}}at.Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};at.ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function nk(o){switch(o.constructor){case Float32Array:return at.ComponentType.FLOAT;case Uint32Array:return at.ComponentType.UNSIGNED_INT;case Uint16Array:return at.ComponentType.UNSIGNED_SHORT;case Uint8Array:return at.ComponentType.UNSIGNED_BYTE;case Int16Array:return at.ComponentType.SHORT;case Int8Array:return at.ComponentType.BYTE;default:throw new Error("Unknown accessor componentType.")}}class L1 extends mn{init(){this.propertyType=Te.ANIMATION}getDefaults(){return Object.assign(super.getDefaults(),{channels:new Zt,samplers:new Zt})}addChannel(e){return this.addRef("channels",e)}removeChannel(e){return this.removeRef("channels",e)}listChannels(){return this.listRefs("channels")}addSampler(e){return this.addRef("samplers",e)}removeSampler(e){return this.removeRef("samplers",e)}listSamplers(){return this.listRefs("samplers")}}class $f extends mn{init(){this.propertyType=Te.ANIMATION_CHANNEL}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(e){return this.set("targetPath",e)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(e){return this.setRef("targetNode",e)}getSampler(){return this.getRef("sampler")}setSampler(e){return this.setRef("sampler",e)}}$f.TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};class Uu extends mn{init(){this.propertyType=Te.ANIMATION_SAMPLER}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:Uu.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(e){return this.set("interpolation",e)}getInput(){return this.getRef("input")}setInput(e){return this.setRef("input",e,{usage:Ln.OTHER})}getOutput(){return this.getRef("output")}setOutput(e){return this.setRef("output",e,{usage:Ln.OTHER})}}Uu.Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};class D1 extends mn{init(){this.propertyType=Te.BUFFER}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(e){return this.set("uri",e)}}class Ja extends mn{init(){this.propertyType=Te.CAMERA}getDefaults(){return Object.assign(super.getDefaults(),{type:Ja.Type.PERSPECTIVE,znear:.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(e){return this.set("type",e)}getZNear(){return this.get("znear")}setZNear(e){return this.set("znear",e)}getZFar(){return this.get("zfar")}setZFar(e){return this.set("zfar",e)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(e){return this.set("aspectRatio",e)}getYFov(){return this.get("yfov")}setYFov(e){return this.set("yfov",e)}getXMag(){return this.get("xmag")}setXMag(e){return this.set("xmag",e)}getYMag(){return this.get("ymag")}setYMag(e){return this.set("ymag",e)}}Ja.Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};class i_ extends t_{_validateParent(e){if(!this.parentTypes.includes(e.propertyType))throw new Error(`Parent "${e.propertyType}" invalid for child "${this.propertyType}".`)}}i_.EXTENSION_NAME=void 0;let vs=class UA extends mn{init(){this.propertyType=Te.TEXTURE_INFO}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:UA.WrapMode.REPEAT,wrapT:UA.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(e){return this.set("texCoord",e)}getMagFilter(){return this.get("magFilter")}setMagFilter(e){return this.set("magFilter",e)}getMinFilter(){return this.get("minFilter")}setMinFilter(e){return this.set("minFilter",e)}getWrapS(){return this.get("wrapS")}setWrapS(e){return this.set("wrapS",e)}getWrapT(){return this.get("wrapT")}setWrapT(e){return this.set("wrapT",e)}};vs.WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};vs.MagFilter={NEAREST:9728,LINEAR:9729};vs.MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};const{R:Ph,G:Lh,B:Dh,A:sk}=DA;let Ya=class N1 extends mn{init(){this.propertyType=Te.MATERIAL}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:N1.AlphaMode.OPAQUE,alphaCutoff:.5,doubleSided:!1,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new vs(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new vs(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new vs(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new vs(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new vs(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(e){return this.set("doubleSided",e)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(e){const t=this.get("baseColorFactor").slice();return t[3]=e,this.set("baseColorFactor",t)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(e){return this.set("alphaMode",e)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(e){return this.set("alphaCutoff",e)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(e){return this.set("baseColorFactor",e)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(e){return this.setRef("baseColorTexture",e,{channels:Ph|Lh|Dh|sk,isColor:!0})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(e){return this.set("emissiveFactor",e)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(e){return this.setRef("emissiveTexture",e,{channels:Ph|Lh|Dh,isColor:!0})}getNormalScale(){return this.get("normalScale")}setNormalScale(e){return this.set("normalScale",e)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(e){return this.setRef("normalTexture",e,{channels:Ph|Lh|Dh})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(e){return this.set("occlusionStrength",e)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(e){return this.setRef("occlusionTexture",e,{channels:Ph})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(e){return this.set("roughnessFactor",e)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(e){return this.set("metallicFactor",e)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(e){return this.setRef("metallicRoughnessTexture",e,{channels:Lh|Dh})}};Ya.AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};class O1 extends mn{init(){this.propertyType=Te.MESH}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new Zt})}addPrimitive(e){return this.addRef("primitives",e)}removePrimitive(e){return this.removeRef("primitives",e)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(e){return this.set("weights",e)}}let k1=class extends mn{init(){this.propertyType=Te.NODE}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new Zt})}copy(e,t=Yr){if(t===Yr)throw new Error("Node cannot be copied.");return super.copy(e,t)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(e){return this.set("translation",e)}setRotation(e){return this.set("rotation",e)}setScale(e){return this.set("scale",e)}getMatrix(){return si.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(e){const t=this.get("translation").slice(),i=this.get("rotation").slice(),a=this.get("scale").slice();return si.decompose(e,t,i,a),this.set("translation",t).set("rotation",i).set("scale",a)}getWorldTranslation(){const e=[0,0,0];return si.decompose(this.getWorldMatrix(),e,[0,0,0,1],[1,1,1]),e}getWorldRotation(){const e=[0,0,0,1];return si.decompose(this.getWorldMatrix(),[0,0,0],e,[1,1,1]),e}getWorldScale(){const e=[1,1,1];return si.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],e),e}getWorldMatrix(){const e=[];for(let a=this;a!=null;a=a.getParentNode())e.push(a);let t;const i=e.pop().getMatrix();for(;t=e.pop();)jO(i,i,t.getMatrix());return i}addChild(e){const t=e.getParentNode();t&&t.removeChild(e);for(const i of e.listParents())i.propertyType===Te.SCENE&&i.removeChild(e);return this.addRef("children",e)}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}getParentNode(){for(const e of this.listParents())if(e.propertyType===Te.NODE)return e;return null}getMesh(){return this.getRef("mesh")}setMesh(e){return this.setRef("mesh",e)}getCamera(){return this.getRef("camera")}setCamera(e){return this.setRef("camera",e)}getSkin(){return this.getRef("skin")}setSkin(e){return this.setRef("skin",e)}getWeights(){return this.get("weights")}setWeights(e){return this.set("weights",e)}traverse(e){e(this);for(const t of this.listChildren())t.traverse(e);return this}};class Ls extends mn{init(){this.propertyType=Te.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:Ls.Mode.TRIANGLES,material:null,indices:null,attributes:new Es,targets:new Zt})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:Ln.ELEMENT_ARRAY_BUFFER})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:Ln.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}getMode(){return this.get("mode")}setMode(e){return this.set("mode",e)}listTargets(){return this.listRefs("targets")}addTarget(e){return this.addRef("targets",e)}removeTarget(e){return this.removeRef("targets",e)}}Ls.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class rk extends t_{init(){this.propertyType=Te.PRIMITIVE_TARGET}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new Es})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,t){return this.setRefMap("attributes",e,t,{usage:Ln.ARRAY_BUFFER})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}}function cn(){return cn=Object.assign?Object.assign.bind():function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(o[i]=t[i])}return o},cn.apply(null,arguments)}class n_ extends mn{init(){this.propertyType=Te.SCENE}getDefaults(){return Object.assign(super.getDefaults(),{children:new Zt})}copy(e,t=Yr){if(t===Yr)throw new Error("Scene cannot be copied.");return super.copy(e,t)}addChild(e){const t=e.getParentNode();return t&&t.removeChild(e),this.addRef("children",e)}removeChild(e){return this.removeRef("children",e)}listChildren(){return this.listRefs("children")}traverse(e){for(const t of this.listChildren())t.traverse(e);return this}}class U1 extends mn{init(){this.propertyType=Te.SKIN}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new Zt})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(e){return this.setRef("skeleton",e)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(e){return this.setRef("inverseBindMatrices",e,{usage:Ln.INVERSE_BIND_MATRICES})}addJoint(e){return this.addRef("joints",e)}removeJoint(e){return this.removeRef("joints",e)}listJoints(){return this.listRefs("joints")}}let Tu=class extends mn{init(){this.propertyType=Te.TEXTURE}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||Fa.extensionToMimeType(Rl.extension(this.get("uri")))}setMimeType(e){return this.set("mimeType",e)}getURI(){return this.get("uri")}setURI(e){this.set("uri",e);const t=Fa.extensionToMimeType(Rl.extension(e));return t&&this.set("mimeType",t),this}getImage(){return this.get("image")}setImage(e){return this.set("image",vt.assertView(e))}getSize(){const e=this.get("image");return e?Fa.getSize(e,this.getMimeType()):null}};class Fu extends mn{init(){this.propertyType=Te.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${R1}`,version:"2.0"},defaultScene:null,accessors:new Zt,animations:new Zt,buffers:new Zt,cameras:new Zt,materials:new Zt,meshes:new Zt,nodes:new Zt,scenes:new Zt,skins:new Zt,textures:new Zt})}constructor(e){super(e),this._extensions=new Set,e.addEventListener("node:create",t=>{this._addChildOfRoot(t.target)})}clone(){throw new Error("Root cannot be cloned.")}copy(e,t=Yr){if(t===Yr)throw new Error("Root cannot be copied.");this.set("asset",cn({},e.get("asset"))),this.setName(e.getName()),this.setExtras(cn({},e.getExtras())),this.setDefaultScene(e.getDefaultScene()?t(e.getDefaultScene()):null);for(const i of e.listRefMapKeys("extensions")){const a=e.getExtension(i);this.setExtension(i,t(a))}return this}_addChildOfRoot(e){return e instanceof n_?this.addRef("scenes",e):e instanceof k1?this.addRef("nodes",e):e instanceof Ja?this.addRef("cameras",e):e instanceof U1?this.addRef("skins",e):e instanceof O1?this.addRef("meshes",e):e instanceof Ya?this.addRef("materials",e):e instanceof Tu?this.addRef("textures",e):e instanceof L1?this.addRef("animations",e):e instanceof at?this.addRef("accessors",e):e instanceof D1&&this.addRef("buffers",e),this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter(e=>e.isRequired())}_enableExtension(e){return this._extensions.add(e),this}_disableExtension(e){return this._extensions.delete(e),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(e){return this.setRef("defaultScene",e)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}}let s_=class FA{static fromGraph(e){return FA._GRAPH_DOCUMENTS.get(e)||null}constructor(){this._graph=new $O,this._root=new Fu(this._graph),this._logger=Qn.DEFAULT_INSTANCE,FA._GRAPH_DOCUMENTS.set(this._graph,this)}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(e){return this._logger=e,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(e){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...e){const t=e.map(i=>i.name);for(const i of e)await i(this,{stack:t});return this}createExtension(e){const t=e.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(a=>a.extensionName===t)||new e(this)}createScene(e=""){return new n_(this._graph,e)}createNode(e=""){return new k1(this._graph,e)}createCamera(e=""){return new Ja(this._graph,e)}createSkin(e=""){return new U1(this._graph,e)}createMesh(e=""){return new O1(this._graph,e)}createPrimitive(){return new Ls(this._graph)}createPrimitiveTarget(e=""){return new rk(this._graph,e)}createMaterial(e=""){return new Ya(this._graph,e)}createTexture(e=""){return new Tu(this._graph,e)}createAnimation(e=""){return new L1(this._graph,e)}createAnimationChannel(e=""){return new $f(this._graph,e)}createAnimationSampler(e=""){return new Uu(this._graph,e)}createAccessor(e="",t=null){return t||(t=this.getRoot().listBuffers()[0]),new at(this._graph,e).setBuffer(t)}createBuffer(e=""){return new D1(this._graph,e)}};s_._GRAPH_DOCUMENTS=new WeakMap;class ak{constructor(e){this.jsonDoc=void 0,this.buffers=[],this.bufferViews=[],this.bufferViewBuffers=[],this.accessors=[],this.textures=[],this.textureInfos=new Map,this.materials=[],this.meshes=[],this.cameras=[],this.nodes=[],this.skins=[],this.animations=[],this.scenes=[],this.jsonDoc=e}setTextureInfo(e,t){this.textureInfos.set(e,t),t.texCoord!==void 0&&e.setTexCoord(t.texCoord),t.extras!==void 0&&e.setExtras(t.extras);const i=this.jsonDoc.json.textures[t.index];if(i.sampler===void 0)return;const a=this.jsonDoc.json.samplers[i.sampler];a.magFilter!==void 0&&e.setMagFilter(a.magFilter),a.minFilter!==void 0&&e.setMinFilter(a.minFilter),a.wrapS!==void 0&&e.setWrapS(a.wrapS),a.wrapT!==void 0&&e.setWrapT(a.wrapT)}}const Gb={logger:Qn.DEFAULT_INSTANCE,extensions:[],dependencies:{}},ok=new Set([Te.BUFFER,Te.TEXTURE,Te.MATERIAL,Te.MESH,Te.PRIMITIVE,Te.NODE,Te.SCENE]);class lk{static read(e,t=Gb){const i=cn({},Gb,t),{json:a}=e,l=new s_().setLogger(i.logger);this.validate(e,i);const u=new ak(e),d=a.asset,p=l.getRoot().getAsset();d.copyright&&(p.copyright=d.copyright),d.extras&&(p.extras=d.extras),a.extras!==void 0&&l.getRoot().setExtras(cn({},a.extras));const m=a.extensionsUsed||[],A=a.extensionsRequired||[];i.extensions.sort((U,V)=>U.EXTENSION_NAME>V.EXTENSION_NAME?1:-1);for(const U of i.extensions)if(m.includes(U.EXTENSION_NAME)){const V=l.createExtension(U).setRequired(A.includes(U.EXTENSION_NAME)),k=V.prereadTypes.filter(z=>!ok.has(z));k.length&&i.logger.warn(`Preread hooks for some types (${k.join()}), requested by extension ${V.extensionName}, are unsupported. Please file an issue or a PR.`);for(const z of V.readDependencies)V.install(z,i.dependencies[z])}const _=a.buffers||[];l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.BUFFER)).forEach(U=>U.preread(u,Te.BUFFER)),u.buffers=_.map(U=>{const V=l.createBuffer(U.name);return U.extras&&V.setExtras(U.extras),U.uri&&U.uri.indexOf("__")!==0&&V.setURI(U.uri),V});const b=a.bufferViews||[];u.bufferViewBuffers=b.map((U,V)=>{if(!u.bufferViews[V]){const k=e.json.buffers[U.buffer],z=k.uri?e.resources[k.uri]:e.resources[af],Q=U.byteOffset||0;u.bufferViews[V]=vt.toView(z,Q,U.byteLength)}return u.buffers[U.buffer]});const w=a.accessors||[];u.accessors=w.map(U=>{const V=u.bufferViewBuffers[U.bufferView],k=l.createAccessor(U.name,V).setType(U.type);return U.extras&&k.setExtras(U.extras),U.normalized!==void 0&&k.setNormalized(U.normalized),U.bufferView===void 0||k.setArray(xd(U,u)),k});const E=a.images||[],C=a.textures||[];l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.TEXTURE)).forEach(U=>U.preread(u,Te.TEXTURE)),u.textures=E.map(U=>{const V=l.createTexture(U.name);if(U.extras&&V.setExtras(U.extras),U.bufferView!==void 0){const k=a.bufferViews[U.bufferView],z=e.json.buffers[k.buffer],Q=z.uri?e.resources[z.uri]:e.resources[af],Z=k.byteOffset||0,K=k.byteLength,s=Q.slice(Z,Z+K);V.setImage(s)}else U.uri!==void 0&&(V.setImage(e.resources[U.uri]),U.uri.indexOf("__")!==0&&V.setURI(U.uri));if(U.mimeType!==void 0)V.setMimeType(U.mimeType);else if(U.uri){const k=Rl.extension(U.uri);V.setMimeType(Fa.extensionToMimeType(k))}return V}),l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.MATERIAL)).forEach(U=>U.preread(u,Te.MATERIAL));const T=a.materials||[];u.materials=T.map(U=>{const V=l.createMaterial(U.name);U.extras&&V.setExtras(U.extras),U.alphaMode!==void 0&&V.setAlphaMode(U.alphaMode),U.alphaCutoff!==void 0&&V.setAlphaCutoff(U.alphaCutoff),U.doubleSided!==void 0&&V.setDoubleSided(U.doubleSided);const k=U.pbrMetallicRoughness||{};if(k.baseColorFactor!==void 0&&V.setBaseColorFactor(k.baseColorFactor),U.emissiveFactor!==void 0&&V.setEmissiveFactor(U.emissiveFactor),k.metallicFactor!==void 0&&V.setMetallicFactor(k.metallicFactor),k.roughnessFactor!==void 0&&V.setRoughnessFactor(k.roughnessFactor),k.baseColorTexture!==void 0){const z=k.baseColorTexture,Q=u.textures[C[z.index].source];V.setBaseColorTexture(Q),u.setTextureInfo(V.getBaseColorTextureInfo(),z)}if(U.emissiveTexture!==void 0){const z=U.emissiveTexture,Q=u.textures[C[z.index].source];V.setEmissiveTexture(Q),u.setTextureInfo(V.getEmissiveTextureInfo(),z)}if(U.normalTexture!==void 0){const z=U.normalTexture,Q=u.textures[C[z.index].source];V.setNormalTexture(Q),u.setTextureInfo(V.getNormalTextureInfo(),z),U.normalTexture.scale!==void 0&&V.setNormalScale(U.normalTexture.scale)}if(U.occlusionTexture!==void 0){const z=U.occlusionTexture,Q=u.textures[C[z.index].source];V.setOcclusionTexture(Q),u.setTextureInfo(V.getOcclusionTextureInfo(),z),U.occlusionTexture.strength!==void 0&&V.setOcclusionStrength(U.occlusionTexture.strength)}if(k.metallicRoughnessTexture!==void 0){const z=k.metallicRoughnessTexture,Q=u.textures[C[z.index].source];V.setMetallicRoughnessTexture(Q),u.setTextureInfo(V.getMetallicRoughnessTextureInfo(),z)}return V}),l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.MESH)).forEach(U=>U.preread(u,Te.MESH));const x=a.meshes||[];l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.PRIMITIVE)).forEach(U=>U.preread(u,Te.PRIMITIVE)),u.meshes=x.map(U=>{const V=l.createMesh(U.name);return U.extras&&V.setExtras(U.extras),U.weights!==void 0&&V.setWeights(U.weights),(U.primitives||[]).forEach(z=>{const Q=l.createPrimitive();z.extras&&Q.setExtras(z.extras),z.material!==void 0&&Q.setMaterial(u.materials[z.material]),z.mode!==void 0&&Q.setMode(z.mode);for(const[s,H]of Object.entries(z.attributes||{}))Q.setAttribute(s,u.accessors[H]);z.indices!==void 0&&Q.setIndices(u.accessors[z.indices]);const Z=U.extras&&U.extras.targetNames||[];(z.targets||[]).forEach((s,H)=>{const y=Z[H]||H.toString(),ee=l.createPrimitiveTarget(y);for(const[I,re]of Object.entries(s))ee.setAttribute(I,u.accessors[re]);Q.addTarget(ee)}),V.addPrimitive(Q)}),V});const P=a.cameras||[];u.cameras=P.map(U=>{const V=l.createCamera(U.name).setType(U.type);if(U.extras&&V.setExtras(U.extras),U.type===Ja.Type.PERSPECTIVE){const k=U.perspective;V.setYFov(k.yfov),V.setZNear(k.znear),k.zfar!==void 0&&V.setZFar(k.zfar),k.aspectRatio!==void 0&&V.setAspectRatio(k.aspectRatio)}else{const k=U.orthographic;V.setZNear(k.znear).setZFar(k.zfar).setXMag(k.xmag).setYMag(k.ymag)}return V});const M=a.nodes||[];l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.NODE)).forEach(U=>U.preread(u,Te.NODE)),u.nodes=M.map(U=>{const V=l.createNode(U.name);if(U.extras&&V.setExtras(U.extras),U.translation!==void 0&&V.setTranslation(U.translation),U.rotation!==void 0&&V.setRotation(U.rotation),U.scale!==void 0&&V.setScale(U.scale),U.matrix!==void 0){const k=[0,0,0],z=[0,0,0,1],Q=[1,1,1];si.decompose(U.matrix,k,z,Q),V.setTranslation(k),V.setRotation(z),V.setScale(Q)}return U.weights!==void 0&&V.setWeights(U.weights),V});const B=a.skins||[];u.skins=B.map(U=>{const V=l.createSkin(U.name);U.extras&&V.setExtras(U.extras),U.inverseBindMatrices!==void 0&&V.setInverseBindMatrices(u.accessors[U.inverseBindMatrices]),U.skeleton!==void 0&&V.setSkeleton(u.nodes[U.skeleton]);for(const k of U.joints)V.addJoint(u.nodes[k]);return V}),M.map((U,V)=>{const k=u.nodes[V];(U.children||[]).forEach(Q=>k.addChild(u.nodes[Q])),U.mesh!==void 0&&k.setMesh(u.meshes[U.mesh]),U.camera!==void 0&&k.setCamera(u.cameras[U.camera]),U.skin!==void 0&&k.setSkin(u.skins[U.skin])});const D=a.animations||[];u.animations=D.map(U=>{const V=l.createAnimation(U.name);U.extras&&V.setExtras(U.extras);const z=(U.samplers||[]).map(Z=>{const K=l.createAnimationSampler().setInput(u.accessors[Z.input]).setOutput(u.accessors[Z.output]).setInterpolation(Z.interpolation||Uu.Interpolation.LINEAR);return Z.extras&&K.setExtras(Z.extras),V.addSampler(K),K});return(U.channels||[]).forEach(Z=>{const K=l.createAnimationChannel().setSampler(z[Z.sampler]).setTargetPath(Z.target.path);Z.target.node!==void 0&&K.setTargetNode(u.nodes[Z.target.node]),Z.extras&&K.setExtras(Z.extras),V.addChannel(K)}),V});const G=a.scenes||[];return l.getRoot().listExtensionsUsed().filter(U=>U.prereadTypes.includes(Te.SCENE)).forEach(U=>U.preread(u,Te.SCENE)),u.scenes=G.map(U=>{const V=l.createScene(U.name);return U.extras&&V.setExtras(U.extras),(U.nodes||[]).map(z=>u.nodes[z]).forEach(z=>V.addChild(z)),V}),a.scene!==void 0&&l.getRoot().setDefaultScene(u.scenes[a.scene]),l.getRoot().listExtensionsUsed().forEach(U=>U.read(u)),w.forEach((U,V)=>{const k=u.accessors[V],z=!!U.sparse,Q=!U.bufferView&&!k.getArray();(z||Q)&&k.setSparse(!0).setArray(uk(U,u))}),l}static validate(e,t){const i=e.json;if(i.asset.version!=="2.0")throw new Error(`Unsupported glTF version, "${i.asset.version}".`);if(i.extensionsRequired){for(const a of i.extensionsRequired)if(!t.extensions.find(l=>l.EXTENSION_NAME===a))throw new Error(`Missing required extension, "${a}".`)}if(i.extensionsUsed)for(const a of i.extensionsUsed)t.extensions.find(l=>l.EXTENSION_NAME===a)||t.logger.warn(`Missing optional extension, "${a}".`)}}function ck(o,e){const t=e.jsonDoc,i=e.bufferViews[o.bufferView],a=t.json.bufferViews[o.bufferView],l=Uf[o.componentType],u=at.getElementSize(o.type),d=l.BYTES_PER_ELEMENT,p=o.byteOffset||0,m=new l(o.count*u),A=new DataView(i.buffer,i.byteOffset,i.byteLength),_=a.byteStride;for(let b=0;b<o.count;b++)for(let w=0;w<u;w++){const E=p+b*_+w*d;let C;switch(o.componentType){case at.ComponentType.FLOAT:C=A.getFloat32(E,!0);break;case at.ComponentType.UNSIGNED_INT:C=A.getUint32(E,!0);break;case at.ComponentType.UNSIGNED_SHORT:C=A.getUint16(E,!0);break;case at.ComponentType.UNSIGNED_BYTE:C=A.getUint8(E);break;case at.ComponentType.SHORT:C=A.getInt16(E,!0);break;case at.ComponentType.BYTE:C=A.getInt8(E);break;default:throw new Error(`Unexpected componentType "${o.componentType}".`)}m[b*u+w]=C}return m}function xd(o,e){const t=e.jsonDoc,i=e.bufferViews[o.bufferView],a=t.json.bufferViews[o.bufferView],l=Uf[o.componentType],u=at.getElementSize(o.type),d=l.BYTES_PER_ELEMENT,p=u*d;if(a.byteStride!==void 0&&a.byteStride!==p)return ck(o,e);const m=i.byteOffset+(o.byteOffset||0),A=o.count*u*d;return new l(i.buffer.slice(m,m+A))}function uk(o,e){const t=Uf[o.componentType],i=at.getElementSize(o.type);let a;o.bufferView!==void 0?a=xd(o,e):a=new t(o.count*i);const l=o.sparse;if(!l)return a;const u=l.count,d=cn({},o,l.indices,{count:u,type:"SCALAR"}),p=cn({},o,l.values,{count:u}),m=xd(d,e),A=xd(p,e);for(let _=0;_<d.count;_++)for(let b=0;b<i;b++)a[m[_]*i+b]=A[_*i+b];return a}var Iu;(function(o){o[o.ARRAY_BUFFER=34962]="ARRAY_BUFFER",o[o.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"})(Iu||(Iu={}));class $a{constructor(e,t,i){this._doc=void 0,this.jsonDoc=void 0,this.options=void 0,this.accessorIndexMap=new Map,this.animationIndexMap=new Map,this.bufferIndexMap=new Map,this.cameraIndexMap=new Map,this.skinIndexMap=new Map,this.materialIndexMap=new Map,this.meshIndexMap=new Map,this.nodeIndexMap=new Map,this.imageIndexMap=new Map,this.textureDefIndexMap=new Map,this.textureInfoDefMap=new Map,this.samplerDefIndexMap=new Map,this.sceneIndexMap=new Map,this.imageBufferViews=[],this.otherBufferViews=new Map,this.otherBufferViewsIndexMap=new Map,this.extensionData={},this.bufferURIGenerator=void 0,this.imageURIGenerator=void 0,this.logger=void 0,this._accessorUsageMap=new Map,this.accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]),this.accessorParents=new Map,this._doc=e,this.jsonDoc=t,this.options=i;const a=e.getRoot(),l=a.listBuffers().length,u=a.listTextures().length;this.bufferURIGenerator=new Hb(l>1,()=>i.basename||"buffer"),this.imageURIGenerator=new Hb(u>1,d=>hk(e,d)||i.basename||"texture"),this.logger=e.getLogger()}createTextureInfoDef(e,t){const i={magFilter:t.getMagFilter()||void 0,minFilter:t.getMinFilter()||void 0,wrapS:t.getWrapS(),wrapT:t.getWrapT()},a=JSON.stringify(i);this.samplerDefIndexMap.has(a)||(this.samplerDefIndexMap.set(a,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(i));const l={source:this.imageIndexMap.get(e),sampler:this.samplerDefIndexMap.get(a)},u=JSON.stringify(l);this.textureDefIndexMap.has(u)||(this.textureDefIndexMap.set(u,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(l));const d={index:this.textureDefIndexMap.get(u)};return t.getTexCoord()!==0&&(d.texCoord=t.getTexCoord()),Object.keys(t.getExtras()).length>0&&(d.extras=t.getExtras()),this.textureInfoDefMap.set(t,d),d}createPropertyDef(e){const t={};return e.getName()&&(t.name=e.getName()),Object.keys(e.getExtras()).length>0&&(t.extras=e.getExtras()),t}createAccessorDef(e){const t=this.createPropertyDef(e);return t.type=e.getType(),t.componentType=e.getComponentType(),t.count=e.getCount(),this._doc.getGraph().listParentEdges(e).some(a=>a.getName()==="attributes"&&a.getAttributes().key==="POSITION"||a.getName()==="input")&&(t.max=e.getMax([]).map(Math.fround),t.min=e.getMin([]).map(Math.fround)),e.getNormalized()&&(t.normalized=e.getNormalized()),t}createImageData(e,t,i){if(this.options.format===Hr.GLB)this.imageBufferViews.push(t),e.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:t.byteLength});else{const a=Fa.mimeTypeToExtension(i.getMimeType());e.uri=this.imageURIGenerator.createURI(i,a),this.assignResourceURI(e.uri,t,!1)}}assignResourceURI(e,t,i){const a=this.jsonDoc.resources;if(!(e in a)){a[e]=t;return}if(t===a[e]){this.logger.warn(`Duplicate resource URI, "${e}".`);return}const l=`Resource URI "${e}" already assigned to different data.`;if(!i){this.logger.warn(l);return}throw new Error(l)}getAccessorUsage(e){const t=this._accessorUsageMap.get(e);if(t)return t;if(e.getSparse())return Ln.SPARSE;for(const i of this._doc.getGraph().listParentEdges(e)){const{usage:a}=i.getAttributes();if(a)return a;i.getParent().propertyType!==Te.ROOT&&this.logger.warn(`Missing attribute ".usage" on edge, "${i.getName()}".`)}return Ln.OTHER}addAccessorToUsageGroup(e,t){const i=this._accessorUsageMap.get(e);if(i&&i!==t)throw new Error(`Accessor with usage "${i}" cannot be reused as "${t}".`);return this._accessorUsageMap.set(e,t),this}}$a.BufferViewTarget=Iu;$a.BufferViewUsage=Ln;$a.USAGE_TO_TARGET={[Ln.ARRAY_BUFFER]:Iu.ARRAY_BUFFER,[Ln.ELEMENT_ARRAY_BUFFER]:Iu.ELEMENT_ARRAY_BUFFER};class Hb{constructor(e,t){this.multiple=void 0,this.basename=void 0,this.counter={},this.multiple=e,this.basename=t}createURI(e,t){if(e.getURI())return e.getURI();if(this.multiple){const i=this.basename(e);return this.counter[i]=this.counter[i]||1,`${i}_${this.counter[i]++}.${t}`}else return`${this.basename(e)}.${t}`}}function hk(o,e){const t=o.getGraph().listParentEdges(e).find(i=>i.getParent()!==o.getRoot());return t?t.getName().replace(/texture$/i,""):""}const{BufferViewUsage:Nh}=$a,{UNSIGNED_INT:dk,UNSIGNED_SHORT:fk,UNSIGNED_BYTE:pk}=at.ComponentType,mk=new Set([Te.ACCESSOR,Te.BUFFER,Te.MATERIAL,Te.MESH]);class gk{static write(e,t){const i=e.getGraph(),a=e.getRoot(),l={asset:cn({generator:`glTF-Transform ${R1}`},a.getAsset()),extras:cn({},a.getExtras())},u={json:l,resources:{}},d=new $a(e,u,t),p=t.logger||Qn.DEFAULT_INSTANCE,m=new Set(t.extensions.map(x=>x.EXTENSION_NAME)),A=e.getRoot().listExtensionsUsed().filter(x=>m.has(x.extensionName)).sort((x,P)=>x.extensionName>P.extensionName?1:-1),_=e.getRoot().listExtensionsRequired().filter(x=>m.has(x.extensionName)).sort((x,P)=>x.extensionName>P.extensionName?1:-1);A.length<e.getRoot().listExtensionsUsed().length&&p.warn("Some extensions were not registered for I/O, and will not be written.");for(const x of A){const P=x.prewriteTypes.filter(M=>!mk.has(M));P.length&&p.warn(`Prewrite hooks for some types (${P.join()}), requested by extension ${x.extensionName}, are unsupported. Please file an issue or a PR.`);for(const M of x.writeDependencies)x.install(M,t.dependencies[M])}function b(x,P,M,B){const D=[];let G=0;for(const k of x){const z=d.createAccessorDef(k);z.bufferView=l.bufferViews.length;const Q=k.getArray(),Z=vt.pad(vt.toView(Q));z.byteOffset=G,G+=Z.byteLength,D.push(Z),d.accessorIndexMap.set(k,l.accessors.length),l.accessors.push(z)}const U=vt.concat(D),V={buffer:P,byteOffset:M,byteLength:U.byteLength};return B&&(V.target=B),l.bufferViews.push(V),{buffers:D,byteLength:G}}function w(x,P,M){const B=x[0].getCount();let D=0;for(const z of x){const Q=d.createAccessorDef(z);Q.bufferView=l.bufferViews.length,Q.byteOffset=D;const Z=z.getElementSize(),K=z.getComponentSize();D+=vt.padNumber(Z*K),d.accessorIndexMap.set(z,l.accessors.length),l.accessors.push(Q)}const G=B*D,U=new ArrayBuffer(G),V=new DataView(U);for(let z=0;z<B;z++){let Q=0;for(const Z of x){const K=Z.getElementSize(),s=Z.getComponentSize(),H=Z.getComponentType(),y=Z.getArray();for(let ee=0;ee<K;ee++){const I=z*D+Q+ee*s,re=y[z*K+ee];switch(H){case at.ComponentType.FLOAT:V.setFloat32(I,re,!0);break;case at.ComponentType.BYTE:V.setInt8(I,re);break;case at.ComponentType.SHORT:V.setInt16(I,re,!0);break;case at.ComponentType.UNSIGNED_BYTE:V.setUint8(I,re);break;case at.ComponentType.UNSIGNED_SHORT:V.setUint16(I,re,!0);break;case at.ComponentType.UNSIGNED_INT:V.setUint32(I,re,!0);break;default:throw new Error("Unexpected component type: "+H)}}Q+=vt.padNumber(K*s)}}const k={buffer:P,byteOffset:M,byteLength:G,byteStride:D,target:$a.BufferViewTarget.ARRAY_BUFFER};return l.bufferViews.push(k),{byteLength:G,buffers:[new Uint8Array(U)]}}function E(x,P,M){const B=[];let D=0;const G=new Map;let U=-1/0,V=!1;for(const H of x){const y=d.createAccessorDef(H);l.accessors.push(y),d.accessorIndexMap.set(H,l.accessors.length-1);const ee=[],I=[],re=[],Ae=new Array(H.getElementSize()).fill(0);for(let c=0,h=H.getCount();c<h;c++)if(H.getElement(c,re),!si.eq(re,Ae,0)){U=Math.max(c,U),ee.push(c);for(let f=0;f<re.length;f++)I.push(re[f])}const N=ee.length,n={accessorDef:y,count:N};if(G.set(H,n),N===0)continue;N>H.getCount()/2&&(V=!0);const r=Uf[H.getComponentType()];n.indices=ee,n.values=new r(I)}if(!Number.isFinite(U))return{buffers:B,byteLength:D};V&&p.warn("Some sparse accessors have >50% non-zero elements, which may increase file size.");const k=U<255?Uint8Array:U<65535?Uint16Array:Uint32Array,z=U<255?pk:U<65535?fk:dk,Q={buffer:P,byteOffset:M+D,byteLength:0};for(const H of x){const y=G.get(H);if(y.count===0)continue;y.indicesByteOffset=Q.byteLength;const ee=vt.pad(vt.toView(new k(y.indices)));B.push(ee),D+=ee.byteLength,Q.byteLength+=ee.byteLength}l.bufferViews.push(Q);const Z=l.bufferViews.length-1,K={buffer:P,byteOffset:M+D,byteLength:0};for(const H of x){const y=G.get(H);if(y.count===0)continue;y.valuesByteOffset=K.byteLength;const ee=vt.pad(vt.toView(y.values));B.push(ee),D+=ee.byteLength,K.byteLength+=ee.byteLength}l.bufferViews.push(K);const s=l.bufferViews.length-1;for(const H of x){const y=G.get(H);y.count!==0&&(y.accessorDef.sparse={count:y.count,indices:{bufferView:Z,byteOffset:y.indicesByteOffset,componentType:z},values:{bufferView:s,byteOffset:y.valuesByteOffset}})}return{buffers:B,byteLength:D}}if(l.accessors=[],l.bufferViews=[],l.samplers=[],l.textures=[],l.images=a.listTextures().map((x,P)=>{const M=d.createPropertyDef(x);x.getMimeType()&&(M.mimeType=x.getMimeType());const B=x.getImage();return B&&d.createImageData(M,B,x),d.imageIndexMap.set(x,P),M}),A.filter(x=>x.prewriteTypes.includes(Te.ACCESSOR)).forEach(x=>x.prewrite(d,Te.ACCESSOR)),a.listAccessors().forEach(x=>{const P=d.accessorUsageGroupedByParent,M=d.accessorParents;if(d.accessorIndexMap.has(x))return;const B=d.getAccessorUsage(x);if(d.addAccessorToUsageGroup(x,B),P.has(B)){const D=i.listParents(x).find(G=>G.propertyType!==Te.ROOT);M.set(x,D)}}),A.filter(x=>x.prewriteTypes.includes(Te.BUFFER)).forEach(x=>x.prewrite(d,Te.BUFFER)),(a.listAccessors().length>0||d.otherBufferViews.size>0||a.listTextures().length>0&&t.format===Hr.GLB)&&a.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");l.buffers=[],a.listBuffers().forEach((x,P)=>{const M=d.createPropertyDef(x),B=d.accessorUsageGroupedByParent,D=x.listParents().filter(K=>K instanceof at),G=new Set(D.map(K=>d.accessorParents.get(K))),U=new Map(Array.from(G).map((K,s)=>[K,s])),V={};for(const K of D){var k;if(d.accessorIndexMap.has(K))continue;const s=d.getAccessorUsage(K);let H=s;if(B.has(s)){const y=d.accessorParents.get(K);H+=`:${U.get(y)}`}V[k=H]||(V[k]={usage:s,accessors:[]}),V[H].accessors.push(K)}const z=[],Q=l.buffers.length;let Z=0;for(const{usage:K,accessors:s}of Object.values(V))if(K===Nh.ARRAY_BUFFER&&t.vertexLayout===of.INTERLEAVED){const H=w(s,Q,Z);Z+=H.byteLength;for(const y of H.buffers)z.push(y)}else if(K===Nh.ARRAY_BUFFER)for(const H of s){const y=w([H],Q,Z);Z+=y.byteLength;for(const ee of y.buffers)z.push(ee)}else if(K===Nh.SPARSE){const H=E(s,Q,Z);Z+=H.byteLength;for(const y of H.buffers)z.push(y)}else if(K===Nh.ELEMENT_ARRAY_BUFFER){const H=$a.BufferViewTarget.ELEMENT_ARRAY_BUFFER,y=b(s,Q,Z,H);Z+=y.byteLength;for(const ee of y.buffers)z.push(ee)}else{const H=b(s,Q,Z);Z+=H.byteLength;for(const y of H.buffers)z.push(y)}if(d.imageBufferViews.length&&P===0){for(let K=0;K<d.imageBufferViews.length;K++)if(l.bufferViews[l.images[K].bufferView].byteOffset=Z,Z+=d.imageBufferViews[K].byteLength,z.push(d.imageBufferViews[K]),Z%8){const s=8-Z%8;Z+=s,z.push(new Uint8Array(s))}}if(d.otherBufferViews.has(x))for(const K of d.otherBufferViews.get(x))l.bufferViews.push({buffer:Q,byteOffset:Z,byteLength:K.byteLength}),d.otherBufferViewsIndexMap.set(K,l.bufferViews.length-1),Z+=K.byteLength,z.push(K);if(Z){let K;t.format===Hr.GLB?K=af:(K=d.bufferURIGenerator.createURI(x,"bin"),M.uri=K),M.byteLength=Z,d.assignResourceURI(K,vt.concat(z),!0)}l.buffers.push(M),d.bufferIndexMap.set(x,P)}),a.listAccessors().find(x=>!x.getBuffer())&&p.warn("Skipped writing one or more Accessors: no Buffer assigned."),A.filter(x=>x.prewriteTypes.includes(Te.MATERIAL)).forEach(x=>x.prewrite(d,Te.MATERIAL)),l.materials=a.listMaterials().map((x,P)=>{const M=d.createPropertyDef(x);if(x.getAlphaMode()!==Ya.AlphaMode.OPAQUE&&(M.alphaMode=x.getAlphaMode()),x.getAlphaMode()===Ya.AlphaMode.MASK&&(M.alphaCutoff=x.getAlphaCutoff()),x.getDoubleSided()&&(M.doubleSided=!0),M.pbrMetallicRoughness={},si.eq(x.getBaseColorFactor(),[1,1,1,1])||(M.pbrMetallicRoughness.baseColorFactor=x.getBaseColorFactor()),si.eq(x.getEmissiveFactor(),[0,0,0])||(M.emissiveFactor=x.getEmissiveFactor()),x.getRoughnessFactor()!==1&&(M.pbrMetallicRoughness.roughnessFactor=x.getRoughnessFactor()),x.getMetallicFactor()!==1&&(M.pbrMetallicRoughness.metallicFactor=x.getMetallicFactor()),x.getBaseColorTexture()){const B=x.getBaseColorTexture(),D=x.getBaseColorTextureInfo();M.pbrMetallicRoughness.baseColorTexture=d.createTextureInfoDef(B,D)}if(x.getEmissiveTexture()){const B=x.getEmissiveTexture(),D=x.getEmissiveTextureInfo();M.emissiveTexture=d.createTextureInfoDef(B,D)}if(x.getNormalTexture()){const B=x.getNormalTexture(),D=x.getNormalTextureInfo(),G=d.createTextureInfoDef(B,D);x.getNormalScale()!==1&&(G.scale=x.getNormalScale()),M.normalTexture=G}if(x.getOcclusionTexture()){const B=x.getOcclusionTexture(),D=x.getOcclusionTextureInfo(),G=d.createTextureInfoDef(B,D);x.getOcclusionStrength()!==1&&(G.strength=x.getOcclusionStrength()),M.occlusionTexture=G}if(x.getMetallicRoughnessTexture()){const B=x.getMetallicRoughnessTexture(),D=x.getMetallicRoughnessTextureInfo();M.pbrMetallicRoughness.metallicRoughnessTexture=d.createTextureInfoDef(B,D)}return d.materialIndexMap.set(x,P),M}),A.filter(x=>x.prewriteTypes.includes(Te.MESH)).forEach(x=>x.prewrite(d,Te.MESH)),l.meshes=a.listMeshes().map((x,P)=>{const M=d.createPropertyDef(x);let B=null;return M.primitives=x.listPrimitives().map(D=>{const G={attributes:{}};G.mode=D.getMode();const U=D.getMaterial();U&&(G.material=d.materialIndexMap.get(U)),Object.keys(D.getExtras()).length&&(G.extras=D.getExtras());const V=D.getIndices();V&&(G.indices=d.accessorIndexMap.get(V));for(const k of D.listSemantics())G.attributes[k]=d.accessorIndexMap.get(D.getAttribute(k));for(const k of D.listTargets()){const z={};for(const Q of k.listSemantics())z[Q]=d.accessorIndexMap.get(k.getAttribute(Q));G.targets=G.targets||[],G.targets.push(z)}return D.listTargets().length&&!B&&(B=D.listTargets().map(k=>k.getName())),G}),x.getWeights().length&&(M.weights=x.getWeights()),B&&(M.extras=M.extras||{},M.extras.targetNames=B),d.meshIndexMap.set(x,P),M}),l.cameras=a.listCameras().map((x,P)=>{const M=d.createPropertyDef(x);if(M.type=x.getType(),M.type===Ja.Type.PERSPECTIVE){M.perspective={znear:x.getZNear(),zfar:x.getZFar(),yfov:x.getYFov()};const B=x.getAspectRatio();B!==null&&(M.perspective.aspectRatio=B)}else M.orthographic={znear:x.getZNear(),zfar:x.getZFar(),xmag:x.getXMag(),ymag:x.getYMag()};return d.cameraIndexMap.set(x,P),M}),l.nodes=a.listNodes().map((x,P)=>{const M=d.createPropertyDef(x);return si.eq(x.getTranslation(),[0,0,0])||(M.translation=x.getTranslation()),si.eq(x.getRotation(),[0,0,0,1])||(M.rotation=x.getRotation()),si.eq(x.getScale(),[1,1,1])||(M.scale=x.getScale()),x.getWeights().length&&(M.weights=x.getWeights()),d.nodeIndexMap.set(x,P),M}),l.skins=a.listSkins().map((x,P)=>{const M=d.createPropertyDef(x),B=x.getInverseBindMatrices();B&&(M.inverseBindMatrices=d.accessorIndexMap.get(B));const D=x.getSkeleton();return D&&(M.skeleton=d.nodeIndexMap.get(D)),M.joints=x.listJoints().map(G=>d.nodeIndexMap.get(G)),d.skinIndexMap.set(x,P),M}),a.listNodes().forEach((x,P)=>{const M=l.nodes[P],B=x.getMesh();B&&(M.mesh=d.meshIndexMap.get(B));const D=x.getCamera();D&&(M.camera=d.cameraIndexMap.get(D));const G=x.getSkin();G&&(M.skin=d.skinIndexMap.get(G)),x.listChildren().length>0&&(M.children=x.listChildren().map(U=>d.nodeIndexMap.get(U)))}),l.animations=a.listAnimations().map((x,P)=>{const M=d.createPropertyDef(x),B=new Map;return M.samplers=x.listSamplers().map((D,G)=>{const U=d.createPropertyDef(D);return U.input=d.accessorIndexMap.get(D.getInput()),U.output=d.accessorIndexMap.get(D.getOutput()),U.interpolation=D.getInterpolation(),B.set(D,G),U}),M.channels=x.listChannels().map(D=>{const G=d.createPropertyDef(D);return G.sampler=B.get(D.getSampler()),G.target={node:d.nodeIndexMap.get(D.getTargetNode()),path:D.getTargetPath()},G}),d.animationIndexMap.set(x,P),M}),l.scenes=a.listScenes().map((x,P)=>{const M=d.createPropertyDef(x);return M.nodes=x.listChildren().map(B=>d.nodeIndexMap.get(B)),d.sceneIndexMap.set(x,P),M});const T=a.getDefaultScene();return T&&(l.scene=a.listScenes().indexOf(T)),l.extensionsUsed=A.map(x=>x.extensionName),l.extensionsRequired=_.map(x=>x.extensionName),A.forEach(x=>x.write(d)),Ak(l),u}}function Ak(o){const e=[];for(const t in o){const i=o[t];(Array.isArray(i)&&i.length===0||i===null||i===""||i&&typeof i=="object"&&Object.keys(i).length===0)&&e.push(t)}for(const t of e)delete o[t]}var cf;(function(o){o[o.JSON=1313821514]="JSON",o[o.BIN=5130562]="BIN"})(cf||(cf={}));class _k{constructor(){this._logger=Qn.DEFAULT_INSTANCE,this._extensions=new Set,this._dependencies={},this._vertexLayout=of.INTERLEAVED,this.lastReadBytes=0,this.lastWriteBytes=0}setLogger(e){return this._logger=e,this}registerExtensions(e){for(const t of e)this._extensions.add(t),t.register();return this}registerDependencies(e){return Object.assign(this._dependencies,e),this}setVertexLayout(e){return this._vertexLayout=e,this}async read(e){return await this.readJSON(await this.readAsJSON(e))}async readAsJSON(e){const t=await this.readURI(e,"view");this.lastReadBytes=t.byteLength;const i=Vb(t)?this._binaryToJSON(t):{json:JSON.parse(vt.decodeText(t)),resources:{}};return await this._readResourcesExternal(i,this.dirname(e)),this._readResourcesInternal(i),i}async readJSON(e){return e=this._copyJSON(e),this._readResourcesInternal(e),lk.read(e,{extensions:Array.from(this._extensions),dependencies:this._dependencies,logger:this._logger})}async binaryToJSON(e){const t=this._binaryToJSON(vt.assertView(e));this._readResourcesInternal(t);const i=t.json;if(i.buffers&&i.buffers.some(a=>yk(t,a)))throw new Error("Cannot resolve external buffers with binaryToJSON().");if(i.images&&i.images.some(a=>bk(t,a)))throw new Error("Cannot resolve external images with binaryToJSON().");return t}async readBinary(e){return this.readJSON(await this.binaryToJSON(vt.assertView(e)))}async writeJSON(e,t={}){if(t.format===Hr.GLB&&e.getRoot().listBuffers().length>1)throw new Error("GLB must have 0–1 buffers.");return gk.write(e,{format:t.format||Hr.GLTF,basename:t.basename||"",logger:this._logger,vertexLayout:this._vertexLayout,dependencies:cn({},this._dependencies),extensions:Array.from(this._extensions)})}async writeBinary(e){const{json:t,resources:i}=await this.writeJSON(e,{format:Hr.GLB}),a=new Uint32Array([1179937895,2,12]),l=JSON.stringify(t),u=vt.pad(vt.encodeText(l),32),d=vt.toView(new Uint32Array([u.byteLength,1313821514])),p=vt.concat([d,u]);a[a.length-1]+=p.byteLength;const m=Object.values(i)[0];if(!m||!m.byteLength)return vt.concat([vt.toView(a),p]);const A=vt.pad(m,0),_=vt.toView(new Uint32Array([A.byteLength,5130562])),b=vt.concat([_,A]);return a[a.length-1]+=b.byteLength,vt.concat([vt.toView(a),p,b])}async _readResourcesExternal(e,t){var i=this;const a=e.json.images||[],l=e.json.buffers||[],u=[...a,...l].map(async function(d){const p=d.uri;if(!p||p.match(/data:/))return Promise.resolve();e.resources[p]=await i.readURI(i.resolve(t,p),"view"),i.lastReadBytes+=e.resources[p].byteLength});await Promise.all(u)}_readResourcesInternal(e){function t(l){if(l.uri){if(l.uri in e.resources){vt.assertView(e.resources[l.uri]);return}if(l.uri.match(/data:/)){const u=`__${tk()}.${Rl.extension(l.uri)}`;e.resources[u]=vt.createBufferFromDataURI(l.uri),l.uri=u}}}(e.json.images||[]).forEach(l=>{if(l.bufferView===void 0&&l.uri===void 0)throw new Error("Missing resource URI or buffer view.");t(l)}),(e.json.buffers||[]).forEach(t)}_copyJSON(e){const{images:t,buffers:i}=e.json;return e={json:cn({},e.json),resources:cn({},e.resources)},t&&(e.json.images=t.map(a=>cn({},a))),i&&(e.json.buffers=i.map(a=>cn({},a))),e}_binaryToJSON(e){if(!Vb(e))throw new Error("Invalid glTF 2.0 binary.");const t=new Uint32Array(e.buffer,e.byteOffset+12,2);if(t[1]!==cf.JSON)throw new Error("Missing required GLB JSON chunk.");const i=20,a=t[0],l=vt.decodeText(vt.toView(e,i,a)),u=JSON.parse(l),d=i+a;if(e.byteLength<=d)return{json:u,resources:{}};const p=new Uint32Array(e.buffer,e.byteOffset+d,2);if(p[1]!==cf.BIN)return{json:u,resources:{}};const m=p[0],A=vt.toView(e,d+8,m);return{json:u,resources:{[af]:A}}}}function yk(o,e){return e.uri!==void 0&&!(e.uri in o.resources)}function bk(o,e){return e.uri!==void 0&&!(e.uri in o.resources)&&e.bufferView===void 0}function Vb(o){if(o.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return!1;const e=new Uint32Array(o.buffer,o.byteOffset,3);return e[0]===1179937895&&e[1]===2}class vk extends _k{constructor(e=du.DEFAULT_INIT){super(),this._fetchConfig=void 0,this._fetchConfig=e}async readURI(e,t){const i=await fetch(e,this._fetchConfig);switch(t){case"view":return new Uint8Array(await i.arrayBuffer());case"text":return i.text()}}resolve(e,t){return du.resolve(e,t)}dirname(e){return du.dirname(e)}}function F1(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var im,Qb;function wk(){if(Qb)return im;Qb=1;function o(e){for(var t=new Array(e),i=0;i<e;++i)t[i]=i;return t}return im=o,im}/*!
|
|
4145
4145
|
* Determine if an object is a Buffer
|
|
4146
4146
|
*
|
|
4147
4147
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -4160,10 +4160,10 @@ ${l.join(`
|
|
|
4160
4160
|
`+i.join(`
|
|
4161
4161
|
`)+`
|
|
4162
4162
|
----------`);var w=new Function("compile",i.join(`
|
|
4163
|
-
`));return w(o.bind(void 0,t))}return lm=e,lm}var cm,Kb;function Rk(){if(Kb)return cm;Kb=1;var o=Mk();function e(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function t(i){var a=new e;a.pre=i.pre,a.body=i.body,a.post=i.post;var l=i.args.slice(0);a.argTypes=l;for(var u=0;u<l.length;++u){var d=l[u];if(d==="array"||typeof d=="object"&&d.blockIndices){if(a.argTypes[u]="array",a.arrayArgs.push(u),a.arrayBlockIndices.push(d.blockIndices?d.blockIndices:0),a.shimArgs.push("array"+u),u<a.pre.args.length&&a.pre.args[u].count>0)throw new Error("cwise: pre() block may not reference array args");if(u<a.post.args.length&&a.post.args[u].count>0)throw new Error("cwise: post() block may not reference array args")}else if(d==="scalar")a.scalarArgs.push(u),a.shimArgs.push("scalar"+u);else if(d==="index"){if(a.indexArgs.push(u),u<a.pre.args.length&&a.pre.args[u].count>0)throw new Error("cwise: pre() block may not reference array index");if(u<a.body.args.length&&a.body.args[u].lvalue)throw new Error("cwise: body() block may not write to array index");if(u<a.post.args.length&&a.post.args[u].count>0)throw new Error("cwise: post() block may not reference array index")}else if(d==="shape"){if(a.shapeArgs.push(u),u<a.pre.args.length&&a.pre.args[u].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(u<a.body.args.length&&a.body.args[u].lvalue)throw new Error("cwise: body() block may not write to array shape");if(u<a.post.args.length&&a.post.args[u].lvalue)throw new Error("cwise: post() block may not write to array shape")}else if(typeof d=="object"&&d.offset)a.argTypes[u]="offset",a.offsetArgs.push({array:d.array,offset:d.offset}),a.offsetArgIndex.push(u);else throw new Error("cwise: Unknown argument type "+l[u])}if(a.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(a.pre.args.length>l.length)throw new Error("cwise: Too many arguments in pre() block");if(a.body.args.length>l.length)throw new Error("cwise: Too many arguments in body() block");if(a.post.args.length>l.length)throw new Error("cwise: Too many arguments in post() block");return a.debug=!!i.printCode||!!i.debug,a.funcName=i.funcName||"cwise",a.blockSize=i.blockSize||64,o(a)}return cm=t,cm}var Jb;function Bk(){return Jb||(Jb=1,(function(o){var e=Rk(),t={body:"",args:[],thisVars:[],localVars:[]};function i(b){if(!b)return t;for(var w=0;w<b.args.length;++w){var E=b.args[w];w===0?b.args[w]={name:E,lvalue:!0,rvalue:!!b.rvalue,count:b.count||1}:b.args[w]={name:E,lvalue:!1,rvalue:!0,count:1}}return b.thisVars||(b.thisVars=[]),b.localVars||(b.localVars=[]),b}function a(b){return e({args:b.args,pre:i(b.pre),body:i(b.body),post:i(b.proc),funcName:b.funcName})}function l(b){for(var w=[],E=0;E<b.args.length;++E)w.push("a"+E);var C=new Function("P",["return function ",b.funcName,"_ndarrayops(",w.join(","),") {P(",w.join(","),");return a0}"].join(""));return C(a(b))}var u={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};(function(){for(var b in u){var w=u[b];o[b]=l({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+w+"c"},funcName:b}),o[b+"eq"]=l({args:["array","array"],body:{args:["a","b"],body:"a"+w+"=b"},funcName:b+"eq"}),o[b+"s"]=l({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+w+"s"},funcName:b+"s"}),o[b+"seq"]=l({args:["array","scalar"],body:{args:["a","s"],body:"a"+w+"=s"},funcName:b+"seq"})}})();var d={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var b in d){var w=d[b];o[b]=l({args:["array","array"],body:{args:["a","b"],body:"a="+w+"b"},funcName:b}),o[b+"eq"]=l({args:["array"],body:{args:["a"],body:"a="+w+"a"},funcName:b+"eq"})}})();var p={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var b in p){var w=p[b];o[b]=l({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+w+"c"},funcName:b}),o[b+"s"]=l({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+w+"s"},funcName:b+"s"}),o[b+"eq"]=l({args:["array","array"],body:{args:["a","b"],body:"a=a"+w+"b"},funcName:b+"eq"}),o[b+"seq"]=l({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+w+"s"},funcName:b+"seq"})}})();var m=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var b=0;b<m.length;++b){var w=m[b];o[w]=l({args:["array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:w}),o[w+"eq"]=l({args:["array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},funcName:w+"eq"})}})();var A=["max","min","atan2","pow"];(function(){for(var b=0;b<A.length;++b){var w=A[b];o[w]=l({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:w}),o[w+"s"]=l({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:w+"s"}),o[w+"eq"]=l({args:["array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},funcName:w+"eq"}),o[w+"seq"]=l({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},funcName:w+"seq"})}})();var _=["atan2","pow"];(function(){for(var b=0;b<_.length;++b){var w=_[b];o[w+"op"]=l({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:w+"op"}),o[w+"ops"]=l({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:w+"ops"}),o[w+"opeq"]=l({args:["array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},funcName:w+"opeq"}),o[w+"opseq"]=l({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},funcName:w+"opseq"})}})(),o.any=e({args:["array"],pre:t,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),o.all=e({args:["array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),o.sum=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),o.prod=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),o.norm2squared=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),o.norm2=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),o.norminf=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),o.norm1=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),o.sup=e({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),o.inf=e({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),o.argmin=e({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),o.argmax=e({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),o.random=l({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),o.assign=l({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),o.assigns=l({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),o.equals=e({args:["array","array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})(rm)),rm}Bk();function Pk(o,e){if(!(o instanceof Uint8Array))throw new Error("[ndarray-pixels] Input must be Uint8Array or Buffer.");const t=new Blob([o],{type:e});return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(i=>{const l=new OffscreenCanvas(i.width,i.height).getContext("2d");l.drawImage(i,0,0);const u=l.getImageData(0,0,i.width,i.height);return Ck(new Uint8Array(u.data),[i.width,i.height,4],[4,4*i.width,1],0)})}async function Lk(o,e){return Pk(o,e)}function uf(){return uf=Object.assign?Object.assign.bind():function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(o[i]=t[i])}return o},uf.apply(null,arguments)}const{POINTS:l5,LINES:c5,LINE_STRIP:u5,LINE_LOOP:h5,TRIANGLES:d5,TRIANGLE_STRIP:f5,TRIANGLE_FAN:p5}=Ls.Mode;function $1(o,e){return Object.defineProperty(e,"name",{value:o}),e}function z1(o,e){const t=uf({},o);for(const i in e)e[i]!==void 0&&(t[i]=e[i]);return t}function Dk(o,e){if(o==null&&e==null)return!0;if(o==null||e==null||o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!==e[t])return!1;return!0}function G1(o){for(const e in o)return!1;return!0}var hf=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var o=0,e=arguments.length;e--;)o+=arguments[e]*arguments[e];return Math.sqrt(o)});var Zb;(function(o){o.RENDER="render",o.RENDER_CACHED="render-cached",o.UPLOAD="upload",o.UPLOAD_NAIVE="upload-naive",o.DISTINCT="distinct",o.DISTINCT_POSITION="distinct-position",o.UNUSED="unused"})(Zb||(Zb={}));function Nk(){var o=new hf(3);return hf!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),o}function Ok(o,e,t){return o[0]=e[0]*t[0],o[1]=e[1]*t[1],o[2]=e[2]*t[2],o}var kk=Ok;(function(){var o=Nk();return function(e,t,i,a,l,u){var d,p;for(t||(t=3),i||(i=0),a?p=Math.min(a*t+i,e.length):p=e.length,d=i;d<p;d+=t)o[0]=e[d],o[1]=e[d+1],o[2]=e[d+2],l(o,o,u),e[d]=o[0],e[d+1]=o[1],e[d+2]=o[2];return e}})();const{FLOAT:m5}=at.ComponentType,{LINES:g5,LINE_STRIP:A5,LINE_LOOP:_5,TRIANGLES:y5,TRIANGLE_STRIP:b5,TRIANGLE_FAN:v5}=Ls.Mode,Vr="dedup",um={keepUniqueNames:!1,propertyTypes:[Te.ACCESSOR,Te.MESH,Te.TEXTURE,Te.MATERIAL,Te.SKIN]};function Uk(o=um){const e=z1(um,o),t=new Set(e.propertyTypes);for(const i of e.propertyTypes)if(!um.propertyTypes.includes(i))throw new Error(`${Vr}: Unsupported deduplication on type "${i}".`);return $1(Vr,i=>{const a=i.getLogger();t.has(Te.ACCESSOR)&&Fk(i),t.has(Te.TEXTURE)&&zk(i,e),t.has(Te.MATERIAL)&&Gk(i,e),t.has(Te.MESH)&&$k(i,e),t.has(Te.SKIN)&&Hk(i,e),a.debug(`${Vr}: Complete.`)})}function Fk(o){const e=o.getLogger(),t=new Map,i=new Map,a=new Map,l=new Map,u=o.getRoot().listMeshes();u.forEach(_=>{_.listPrimitives().forEach(b=>{b.listAttributes().forEach(w=>d(w,i)),d(b.getIndices(),t)})});for(const _ of o.getRoot().listAnimations())for(const b of _.listSamplers())d(b.getInput(),a),d(b.getOutput(),l);function d(_,b){if(!_)return;const w=[_.getCount(),_.getType(),_.getComponentType(),_.getNormalized(),_.getSparse()].join(":");let E=b.get(w);E||b.set(w,E=new Set),E.add(_)}function p(_,b){for(let w=0;w<_.length;w++){const E=_[w],C=yt.toView(E.getArray());if(!b.has(E))for(let T=w+1;T<_.length;T++){const x=_[T];b.has(x)||yt.equals(C,yt.toView(x.getArray()))&&b.set(x,E)}}}let m=0;const A=new Map;for(const _ of[i,t,a,l])for(const b of _.values())m+=b.size,p(Array.from(b),A);e.debug(`${Vr}: Merged ${A.size} of ${m} accessors.`),u.forEach(_=>{_.listPrimitives().forEach(b=>{b.listAttributes().forEach(E=>{A.has(E)&&b.swap(E,A.get(E))});const w=b.getIndices();w&&A.has(w)&&b.swap(w,A.get(w))})});for(const _ of o.getRoot().listAnimations())for(const b of _.listSamplers()){const w=b.getInput(),E=b.getOutput();w&&A.has(w)&&b.swap(w,A.get(w)),E&&A.has(E)&&b.swap(E,A.get(E))}Array.from(A.keys()).forEach(_=>_.dispose())}function $k(o,e){const t=o.getLogger(),i=o.getRoot(),a=new Map;i.listAccessors().forEach((d,p)=>a.set(d,p)),i.listMaterials().forEach((d,p)=>a.set(d,p));const l=i.listMeshes().length,u=new Map;for(const d of i.listMeshes()){const p=[];for(const A of d.listPrimitives())p.push(H1(A,a));let m="";if(e.keepUniqueNames&&(m+=d.getName()+";"),m+=p.join(";"),u.has(m)){const A=u.get(m);d.listParents().forEach(_=>{_.propertyType!==Te.ROOT&&_.swap(d,A)}),d.dispose()}else u.set(m,d)}t.debug(`${Vr}: Merged ${l-u.size} of ${l} meshes.`)}function zk(o,e){const t=o.getLogger(),i=o.getRoot(),a=i.listTextures(),l=new Map;for(let u=0;u<a.length;u++){const d=a[u],p=d.getImage();if(!l.has(d))for(let m=u+1;m<a.length;m++){const A=a[m],_=A.getImage();if(l.has(A)||d.getMimeType()!==A.getMimeType()||e.keepUniqueNames&&d.getName()!==A.getName())continue;const b=d.getSize(),w=A.getSize();!b||!w||b[0]===w[0]&&b[1]===w[1]&&(!p||!_||yt.equals(p,_)&&l.set(A,d))}}t.debug(`${Vr}: Merged ${l.size} of ${i.listTextures().length} textures.`),Array.from(l.entries()).forEach(([u,d])=>{u.listParents().forEach(p=>{p instanceof Fu||p.swap(u,d)}),u.dispose()})}function Gk(o,e){const t=o.getLogger(),a=o.getRoot().listMaterials(),l=new Map,u=new Map,d=new Set;e.keepUniqueNames||d.add("name");for(let p=0;p<a.length;p++){const m=a[p];if(!l.has(m)&&!ev(m,u))for(let A=p+1;A<a.length;A++){const _=a[A];l.has(_)||ev(_,u)||m.equals(_,d)&&l.set(_,m)}}t.debug(`${Vr}: Merged ${l.size} of ${a.length} materials.`),Array.from(l.entries()).forEach(([p,m])=>{p.listParents().forEach(A=>{A instanceof Fu||A.swap(p,m)}),p.dispose()})}function Hk(o,e){const t=o.getLogger(),a=o.getRoot().listSkins(),l=new Map,u=new Set(["joints"]);e.keepUniqueNames||u.add("name");for(let d=0;d<a.length;d++){const p=a[d];if(!l.has(p))for(let m=d+1;m<a.length;m++){const A=a[m];l.has(A)||p.equals(A,u)&&Dk(p.listJoints(),A.listJoints())&&l.set(A,p)}}t.debug(`${Vr}: Merged ${l.size} of ${a.length} skins.`),Array.from(l.entries()).forEach(([d,p])=>{d.listParents().forEach(m=>{m instanceof Fu||m.swap(d,p)}),d.dispose()})}function H1(o,e){const t=[];for(const i of o.listSemantics()){const a=o.getAttribute(i);t.push(i+":"+e.get(a))}if(o instanceof Ls){const i=o.getIndices();i&&t.push("indices:"+e.get(i));const a=o.getMaterial();a&&t.push("material:"+e.get(a)),t.push("mode:"+o.getMode());for(const l of o.listTargets())t.push("target:"+H1(l,e))}return t.join(",")}function ev(o,e){if(e.has(o))return e.get(o);const t=o.getGraph(),i=new Set,a=t.listParentEdges(o);for(;a.length>0;){const l=a.pop();if(l.getAttributes().modifyChild===!0)return e.set(o,!0),!0;const u=l.getChild();if(!i.has(u))for(const d of t.listChildEdges(u))a.push(d)}return e.set(o,!1),!1}const{TEXTURE_INFO:w5,ROOT:E5}=Te;function V1(){var o=new hf(4);return hf!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0,o[3]=0),o}function Vk(o,e,t){return o[0]=e[0]+t[0],o[1]=e[1]+t[1],o[2]=e[2]+t[2],o[3]=e[3]+t[3],o}function Qk(o,e,t){return o[0]=e[0]-t[0],o[1]=e[1]-t[1],o[2]=e[2]-t[2],o[3]=e[3]-t[3],o}function jk(o,e,t){return o[0]=e[0]*t[0],o[1]=e[1]*t[1],o[2]=e[2]*t[2],o[3]=e[3]*t[3],o}function qk(o,e,t){return o[0]=e[0]*t,o[1]=e[1]*t,o[2]=e[2]*t,o[3]=e[3]*t,o}function Wk(o){var e=o[0],t=o[1],i=o[2],a=o[3];return Math.hypot(e,t,i,a)}var Q1=Qk,Yk=jk,j1=Wk;(function(){var o=V1();return function(e,t,i,a,l,u){var d,p;for(t||(t=4),i||(i=0),a?p=Math.min(a*t+i,e.length):p=e.length,d=i;d<p;d+=t)o[0]=e[d],o[1]=e[d+1],o[2]=e[d+2],o[3]=e[d+3],l(o,o,u),e[d]=o[0],e[d+1]=o[1],e[d+2]=o[2],e[d+3]=o[3];return e}})();const Xk=/color|emissive|diffuse/i;function Kk(o){return o.getGraph().listParentEdges(o).some(a=>a.getAttributes().isColor||Xk.test(a.getName()))?"srgb":null}function Jk(o){const e=o.getGraph(),t=new Set,i=new Set;function a(l){const u=new Set;for(const d of e.listChildEdges(l))d.getChild()instanceof Tu&&u.add(d.getName()+"Info");for(const d of e.listChildEdges(l)){const p=d.getChild();t.has(p)||(t.add(p),p instanceof vs&&u.has(d.getName())?i.add(p):p instanceof i_&&a(p))}}return a(o),Array.from(i)}function Zk(o){const t=s_.fromGraph(o.getGraph()).getRoot(),i=o.getGraph().listParentEdges(o).filter(a=>a.getParent()!==t).map(a=>a.getName());return Array.from(new Set(i))}const Ko="prune",$A=3/255,tv={propertyTypes:[Te.NODE,Te.SKIN,Te.MESH,Te.CAMERA,Te.PRIMITIVE,Te.PRIMITIVE_TARGET,Te.ANIMATION,Te.MATERIAL,Te.TEXTURE,Te.ACCESSOR,Te.BUFFER],keepLeaves:!1,keepAttributes:!1,keepIndices:!1,keepSolidTextures:!1,keepExtras:!1};function eU(o=tv){const e=z1(tv,o),t=new Set(e.propertyTypes),i=e.keepExtras;return $1(Ko,async a=>{const l=a.getLogger(),u=a.getRoot(),d=a.getGraph(),p=new tU,m=A=>p.dispose(A.target);if(d.addEventListener("node:dispose",m),t.has(Te.MESH))for(const A of u.listMeshes())A.listPrimitives().length>0||A.dispose();if(t.has(Te.NODE)){if(!e.keepLeaves)for(const A of u.listScenes())q1(d,A,i);for(const A of u.listNodes())$n(A,i)}if(t.has(Te.SKIN))for(const A of u.listSkins())$n(A,i);if(t.has(Te.MESH))for(const A of u.listMeshes())$n(A,i);if(t.has(Te.CAMERA))for(const A of u.listCameras())$n(A,i);if(t.has(Te.PRIMITIVE)&&iv(d,Te.PRIMITIVE,i),t.has(Te.PRIMITIVE_TARGET)&&iv(d,Te.PRIMITIVE_TARGET,i),!e.keepAttributes&&t.has(Te.ACCESSOR)){const A=new Map;for(const _ of u.listMeshes())for(const b of _.listPrimitives()){const w=b.getMaterial();if(!w)continue;const E=W1(a,b,w),C=iU(b,E);nv(b,C),b.listTargets().forEach(T=>nv(T,C)),A.has(w)?A.get(w).add(b):A.set(w,new Set([b]))}for(const[_,b]of A)nU(_,Array.from(b))}if(t.has(Te.ANIMATION))for(const A of u.listAnimations()){for(const _ of A.listChannels())_.getTargetNode()||_.dispose();if(A.listChannels().length)A.listSamplers().forEach(_=>$n(_,i));else{const _=A.listSamplers();$n(A,i),_.forEach(b=>$n(b,i))}}if(t.has(Te.MATERIAL)&&u.listMaterials().forEach(A=>$n(A,i)),t.has(Te.TEXTURE)&&(u.listTextures().forEach(A=>$n(A,i)),e.keepSolidTextures||await sU(a)),t.has(Te.ACCESSOR)&&u.listAccessors().forEach(A=>$n(A,i)),t.has(Te.BUFFER)&&u.listBuffers().forEach(A=>$n(A,i)),d.removeEventListener("node:dispose",m),p.empty())l.debug(`${Ko}: No unused properties found.`);else{const A=p.entries().map(([_,b])=>`${_} (${b})`).join(", ");l.info(`${Ko}: Removed types... ${A}`)}l.debug(`${Ko}: Complete.`)})}class tU{constructor(){this.disposed={}}empty(){for(const e in this.disposed)return!1;return!0}entries(){return Object.entries(this.disposed)}dispose(e){this.disposed[e.propertyType]=this.disposed[e.propertyType]||0,this.disposed[e.propertyType]++}}function $n(o,e){const t=o.listParents().filter(a=>!(a instanceof Fu||a instanceof $f)),i=e&&!G1(o.getExtras());!t.length&&!i&&o.dispose()}function iv(o,e,t){for(const i of o.listEdges()){const a=i.getParent();a.propertyType===e&&$n(a,t)}}function q1(o,e,t){if(e.listChildren().forEach(u=>q1(o,u,t)),e instanceof n_)return;const i=o.listParentEdges(e).some(u=>{const d=u.getParent().propertyType;return d!==Te.ROOT&&d!==Te.SCENE&&d!==Te.NODE}),a=o.listChildren(e).length===0,l=t&&!G1(e.getExtras());a&&!i&&!l&&e.dispose()}function nv(o,e){for(const t of e)o.setAttribute(t,null)}function iU(o,e){const t=[];for(const i of o.listSemantics())(i==="NORMAL"&&!e.has(i)||i==="TANGENT"&&!e.has(i)||i.startsWith("TEXCOORD_")&&!e.has(i)||i.startsWith("COLOR_")&&i!=="COLOR_0")&&t.push(i);return t}function W1(o,e,t,i=new Set){const l=o.getGraph().listChildEdges(t),u=new Set;for(const m of l)m.getChild()instanceof Tu&&u.add(m.getName());for(const m of l){const A=m.getName(),_=m.getChild();_ instanceof vs&&u.has(A.replace(/Info$/,""))&&i.add(`TEXCOORD_${_.getTexCoord()}`),_ instanceof Tu&&A.match(/normalTexture/i)&&i.add("TANGENT"),_ instanceof i_&&W1(o,e,_,i)}const d=t instanceof Ya&&!t.getExtension("KHR_materials_unlit"),p=e.getMode()===Ls.Mode.POINTS;return d&&!p&&i.add("NORMAL"),i}function nU(o,e){const t=Jk(o),i=new Set(t.map(p=>p.getTexCoord())),a=Array.from(i).sort(),l=new Map(a.map((p,m)=>[p,m])),u=new Map(a.map((p,m)=>[`TEXCOORD_${p}`,`TEXCOORD_${m}`]));for(const p of t){const m=p.getTexCoord();p.setTexCoord(l.get(m))}for(const p of e){const m=p.listSemantics().filter(A=>A.startsWith("TEXCOORD_")).sort();d(p,m),p.listTargets().forEach(A=>d(A,m))}function d(p,m){for(const A of m){const _=p.getAttribute(A);if(!_)continue;const b=u.get(A);b!==A&&(p.setAttribute(b,_),p.setAttribute(A,null))}}}async function sU(o){const e=o.getRoot(),t=o.getGraph(),i=o.getLogger(),l=e.listTextures().map(async u=>{var d;const p=await aU(u);if(!p)return;Kk(u)==="srgb"&&zO.convertSRGBToLinear(p,p);const m=u.getName()||u.getURI(),A=(d=u.getSize())==null?void 0:d.join("x"),_=Zk(u);for(const b of t.listParentEdges(u)){const w=b.getParent();w!==e&&rU(w,p,b.getName(),i)&&b.dispose()}u.listParents().length===1&&(u.dispose(),i.debug(`${Ko}: Removed solid-color texture "${m}" (${A}px ${_.join(", ")})`))});await Promise.all(l)}function rU(o,e,t,i){if(o instanceof Ya)switch(t){case"baseColorTexture":return o.setBaseColorFactor(Yk(e,e,o.getBaseColorFactor())),!0;case"emissiveTexture":return o.setEmissiveFactor(kk([0,0,0],e.slice(0,3),o.getEmissiveFactor())),!0;case"occlusionTexture":return Math.abs(e[0]-1)<=$A;case"metallicRoughnessTexture":return o.setRoughnessFactor(e[1]*o.getRoughnessFactor()),o.setMetallicFactor(e[2]*o.getMetallicFactor()),!0;case"normalTexture":return j1(Q1(V1(),e,[.5,.5,1,1]))<=$A}return i.warn(`${Ko}: Detected single-color ${t} texture. Pruning ${t} not yet supported.`),!1}async function aU(o){const e=await oU(o);if(!e)return null;const t=[1/0,1/0,1/0,1/0],i=[-1/0,-1/0,-1/0,-1/0],a=[0,0,0,0],[l,u]=e.shape;for(let d=0;d<l;d++){for(let p=0;p<u;p++)for(let m=0;m<4;m++)t[m]=Math.min(t[m],e.get(d,p,m)),i[m]=Math.max(i[m],e.get(d,p,m));if(j1(Q1(a,i,t))/255>$A)return null}return qk(a,Vk(a,i,t),.5/255)}async function oU(o){try{return await Lk(o.getImage(),o.getMimeType())}catch{return null}}const{LINE_STRIP:x5,LINE_LOOP:S5,TRIANGLE_STRIP:C5,TRIANGLE_FAN:T5}=Ls.Mode,{ROOT:I5,NODE:M5,MESH:R5,PRIMITIVE:B5,ACCESSOR:P5}=Te,{TRANSLATION:L5,ROTATION:D5,SCALE:N5,WEIGHTS:O5}=$f.TargetPath,lU={pattern:/.*/,quantizationVolume:"mesh",quantizePosition:14,quantizeNormal:10,quantizeTexcoord:12,quantizeColor:8,quantizeWeight:8,quantizeGeneric:12,normalizeWeights:!0,cleanup:!0};uf({level:"high"},lU);var sv;(function(o){o[o.STEP=0]="STEP",o[o.LERP=1]="LERP",o[o.SLERP=2]="SLERP"})(sv||(sv={}));Promise.resolve();const{POINTS:k5,LINES:U5,LINE_STRIP:F5,LINE_LOOP:$5,TRIANGLES:z5,TRIANGLE_STRIP:G5,TRIANGLE_FAN:H5}=Ls.Mode;var zA;(function(o){o.LANCZOS3="lanczos3",o.LANCZOS2="lanczos2"})(zA||(zA={}));zA.LANCZOS3;class cU{constructor({scene:e,targetRenderer:t,contactShadowSettings:i}){this.__contactShadowSettings={},this.__shadowState={shadow:{blur:4,darkness:.6,opacity:1},plane:{color:"#ffffff",opacity:0},showWireframe:!1},this.__blurPlane={},this.__renderTarget={},this.__renderTargetBlur={},this.__shadowCamera={},this.__depthMaterial={},this.__horizontalBlurMaterial={},this.__verticalBlurMaterial={},this.__scene=e,this.__targetRenderer=t,this.__contactShadowSettings=i,this.isEnabled()&&this.setupContactShadows()}isEnabled(){return this.__contactShadowSettings.enabled}enable(){this.__contactShadowSettings.enabled=!0}disable(){this.__contactShadowSettings.enabled=!1}__blurShadow(e){this.__blurPlane.visible=!0,this.__blurPlane.material=this.__horizontalBlurMaterial,this.__blurPlane.material.uniforms.tDiffuse.value=this.__renderTarget.texture,this.__horizontalBlurMaterial.uniforms.h.value=e*1/256,this.__targetRenderer.setRenderTarget(this.__renderTargetBlur),this.__targetRenderer.render(this.__blurPlane,this.__shadowCamera),this.__blurPlane.material=this.__verticalBlurMaterial,this.__blurPlane.material.uniforms.tDiffuse.value=this.__renderTargetBlur.texture,this.__verticalBlurMaterial.uniforms.v.value=e*1/256,this.__targetRenderer.setRenderTarget(this.__renderTarget),this.__targetRenderer.render(this.__blurPlane,this.__shadowCamera),this.__blurPlane.visible=!1}setupContactShadows(){if(!this.__contactShadowSettings.enabled)return;const{planeLength:e,planeWidth:t,cameraHeight:i}=this.__contactShadowSettings,a=e,l=t,u=i,d=new mi;d.position.y=0,this.__scene.add(d),this.__renderTarget=new dn(512,512),this.__renderTarget.texture.generateMipmaps=!1,this.__renderTargetBlur=new dn(512,512),this.__renderTargetBlur.texture.generateMipmaps=!1;const p=new Ms(l,a).rotateX(Math.PI/2),m=new Pi({map:this.__renderTarget.texture,opacity:this.__shadowState.shadow.opacity,transparent:!0,depthWrite:!1}),A=new lt(p,m);A.renderOrder=1,d.add(A),A.scale.y=-1,this.__blurPlane=new lt(p),this.__blurPlane.visible=!1,d.add(this.__blurPlane);const _=new Pi({color:this.__shadowState.plane.color,opacity:this.__shadowState.plane.opacity,transparent:!0,depthWrite:!1}),b=new lt(p,_);b.rotateX(Math.PI),d.add(b),this.__shadowCamera=new Kr(-l/2,l/2,a/2,-a/2,0,u),this.__shadowCamera.rotation.x=Math.PI/2,d.add(this.__shadowCamera),this.__depthMaterial=new G0,this.__depthMaterial.userData.darkness={value:this.__shadowState.shadow.darkness},this.__depthMaterial.onBeforeCompile=w=>{w.uniforms.darkness=this.__depthMaterial.userData.darkness,w.fragmentShader=`
|
|
4163
|
+
`));return w(o.bind(void 0,t))}return lm=e,lm}var cm,Kb;function Rk(){if(Kb)return cm;Kb=1;var o=Mk();function e(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function t(i){var a=new e;a.pre=i.pre,a.body=i.body,a.post=i.post;var l=i.args.slice(0);a.argTypes=l;for(var u=0;u<l.length;++u){var d=l[u];if(d==="array"||typeof d=="object"&&d.blockIndices){if(a.argTypes[u]="array",a.arrayArgs.push(u),a.arrayBlockIndices.push(d.blockIndices?d.blockIndices:0),a.shimArgs.push("array"+u),u<a.pre.args.length&&a.pre.args[u].count>0)throw new Error("cwise: pre() block may not reference array args");if(u<a.post.args.length&&a.post.args[u].count>0)throw new Error("cwise: post() block may not reference array args")}else if(d==="scalar")a.scalarArgs.push(u),a.shimArgs.push("scalar"+u);else if(d==="index"){if(a.indexArgs.push(u),u<a.pre.args.length&&a.pre.args[u].count>0)throw new Error("cwise: pre() block may not reference array index");if(u<a.body.args.length&&a.body.args[u].lvalue)throw new Error("cwise: body() block may not write to array index");if(u<a.post.args.length&&a.post.args[u].count>0)throw new Error("cwise: post() block may not reference array index")}else if(d==="shape"){if(a.shapeArgs.push(u),u<a.pre.args.length&&a.pre.args[u].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(u<a.body.args.length&&a.body.args[u].lvalue)throw new Error("cwise: body() block may not write to array shape");if(u<a.post.args.length&&a.post.args[u].lvalue)throw new Error("cwise: post() block may not write to array shape")}else if(typeof d=="object"&&d.offset)a.argTypes[u]="offset",a.offsetArgs.push({array:d.array,offset:d.offset}),a.offsetArgIndex.push(u);else throw new Error("cwise: Unknown argument type "+l[u])}if(a.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(a.pre.args.length>l.length)throw new Error("cwise: Too many arguments in pre() block");if(a.body.args.length>l.length)throw new Error("cwise: Too many arguments in body() block");if(a.post.args.length>l.length)throw new Error("cwise: Too many arguments in post() block");return a.debug=!!i.printCode||!!i.debug,a.funcName=i.funcName||"cwise",a.blockSize=i.blockSize||64,o(a)}return cm=t,cm}var Jb;function Bk(){return Jb||(Jb=1,(function(o){var e=Rk(),t={body:"",args:[],thisVars:[],localVars:[]};function i(b){if(!b)return t;for(var w=0;w<b.args.length;++w){var E=b.args[w];w===0?b.args[w]={name:E,lvalue:!0,rvalue:!!b.rvalue,count:b.count||1}:b.args[w]={name:E,lvalue:!1,rvalue:!0,count:1}}return b.thisVars||(b.thisVars=[]),b.localVars||(b.localVars=[]),b}function a(b){return e({args:b.args,pre:i(b.pre),body:i(b.body),post:i(b.proc),funcName:b.funcName})}function l(b){for(var w=[],E=0;E<b.args.length;++E)w.push("a"+E);var C=new Function("P",["return function ",b.funcName,"_ndarrayops(",w.join(","),") {P(",w.join(","),");return a0}"].join(""));return C(a(b))}var u={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};(function(){for(var b in u){var w=u[b];o[b]=l({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+w+"c"},funcName:b}),o[b+"eq"]=l({args:["array","array"],body:{args:["a","b"],body:"a"+w+"=b"},funcName:b+"eq"}),o[b+"s"]=l({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+w+"s"},funcName:b+"s"}),o[b+"seq"]=l({args:["array","scalar"],body:{args:["a","s"],body:"a"+w+"=s"},funcName:b+"seq"})}})();var d={not:"!",bnot:"~",neg:"-",recip:"1.0/"};(function(){for(var b in d){var w=d[b];o[b]=l({args:["array","array"],body:{args:["a","b"],body:"a="+w+"b"},funcName:b}),o[b+"eq"]=l({args:["array"],body:{args:["a"],body:"a="+w+"a"},funcName:b+"eq"})}})();var p={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};(function(){for(var b in p){var w=p[b];o[b]=l({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+w+"c"},funcName:b}),o[b+"s"]=l({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+w+"s"},funcName:b+"s"}),o[b+"eq"]=l({args:["array","array"],body:{args:["a","b"],body:"a=a"+w+"b"},funcName:b+"eq"}),o[b+"seq"]=l({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+w+"s"},funcName:b+"seq"})}})();var m=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];(function(){for(var b=0;b<m.length;++b){var w=m[b];o[w]=l({args:["array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:w}),o[w+"eq"]=l({args:["array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},funcName:w+"eq"})}})();var A=["max","min","atan2","pow"];(function(){for(var b=0;b<A.length;++b){var w=A[b];o[w]=l({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:w}),o[w+"s"]=l({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:w+"s"}),o[w+"eq"]=l({args:["array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},funcName:w+"eq"}),o[w+"seq"]=l({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},funcName:w+"seq"})}})();var _=["atan2","pow"];(function(){for(var b=0;b<_.length;++b){var w=_[b];o[w+"op"]=l({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:w+"op"}),o[w+"ops"]=l({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:w+"ops"}),o[w+"opeq"]=l({args:["array","array"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},funcName:w+"opeq"}),o[w+"opseq"]=l({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+w,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},funcName:w+"opseq"})}})(),o.any=e({args:["array"],pre:t,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),o.all=e({args:["array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),o.sum=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),o.prod=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),o.norm2squared=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),o.norm2=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),o.norminf=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),o.norm1=e({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),o.sup=e({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),o.inf=e({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),o.argmin=e({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),o.argmax=e({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),o.random=l({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),o.assign=l({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),o.assigns=l({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),o.equals=e({args:["array","array"],pre:t,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})})(rm)),rm}Bk();function Pk(o,e){if(!(o instanceof Uint8Array))throw new Error("[ndarray-pixels] Input must be Uint8Array or Buffer.");const t=new Blob([o],{type:e});return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(i=>{const l=new OffscreenCanvas(i.width,i.height).getContext("2d");l.drawImage(i,0,0);const u=l.getImageData(0,0,i.width,i.height);return Ck(new Uint8Array(u.data),[i.width,i.height,4],[4,4*i.width,1],0)})}async function Lk(o,e){return Pk(o,e)}function uf(){return uf=Object.assign?Object.assign.bind():function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(o[i]=t[i])}return o},uf.apply(null,arguments)}const{POINTS:l5,LINES:c5,LINE_STRIP:u5,LINE_LOOP:h5,TRIANGLES:d5,TRIANGLE_STRIP:f5,TRIANGLE_FAN:p5}=Ls.Mode;function $1(o,e){return Object.defineProperty(e,"name",{value:o}),e}function z1(o,e){const t=uf({},o);for(const i in e)e[i]!==void 0&&(t[i]=e[i]);return t}function Dk(o,e){if(o==null&&e==null)return!0;if(o==null||e==null||o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!==e[t])return!1;return!0}function G1(o){for(const e in o)return!1;return!0}var hf=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var o=0,e=arguments.length;e--;)o+=arguments[e]*arguments[e];return Math.sqrt(o)});var Zb;(function(o){o.RENDER="render",o.RENDER_CACHED="render-cached",o.UPLOAD="upload",o.UPLOAD_NAIVE="upload-naive",o.DISTINCT="distinct",o.DISTINCT_POSITION="distinct-position",o.UNUSED="unused"})(Zb||(Zb={}));function Nk(){var o=new hf(3);return hf!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),o}function Ok(o,e,t){return o[0]=e[0]*t[0],o[1]=e[1]*t[1],o[2]=e[2]*t[2],o}var kk=Ok;(function(){var o=Nk();return function(e,t,i,a,l,u){var d,p;for(t||(t=3),i||(i=0),a?p=Math.min(a*t+i,e.length):p=e.length,d=i;d<p;d+=t)o[0]=e[d],o[1]=e[d+1],o[2]=e[d+2],l(o,o,u),e[d]=o[0],e[d+1]=o[1],e[d+2]=o[2];return e}})();const{FLOAT:m5}=at.ComponentType,{LINES:g5,LINE_STRIP:A5,LINE_LOOP:_5,TRIANGLES:y5,TRIANGLE_STRIP:b5,TRIANGLE_FAN:v5}=Ls.Mode,Vr="dedup",um={keepUniqueNames:!1,propertyTypes:[Te.ACCESSOR,Te.MESH,Te.TEXTURE,Te.MATERIAL,Te.SKIN]};function Uk(o=um){const e=z1(um,o),t=new Set(e.propertyTypes);for(const i of e.propertyTypes)if(!um.propertyTypes.includes(i))throw new Error(`${Vr}: Unsupported deduplication on type "${i}".`);return $1(Vr,i=>{const a=i.getLogger();t.has(Te.ACCESSOR)&&Fk(i),t.has(Te.TEXTURE)&&zk(i,e),t.has(Te.MATERIAL)&&Gk(i,e),t.has(Te.MESH)&&$k(i,e),t.has(Te.SKIN)&&Hk(i,e),a.debug(`${Vr}: Complete.`)})}function Fk(o){const e=o.getLogger(),t=new Map,i=new Map,a=new Map,l=new Map,u=o.getRoot().listMeshes();u.forEach(_=>{_.listPrimitives().forEach(b=>{b.listAttributes().forEach(w=>d(w,i)),d(b.getIndices(),t)})});for(const _ of o.getRoot().listAnimations())for(const b of _.listSamplers())d(b.getInput(),a),d(b.getOutput(),l);function d(_,b){if(!_)return;const w=[_.getCount(),_.getType(),_.getComponentType(),_.getNormalized(),_.getSparse()].join(":");let E=b.get(w);E||b.set(w,E=new Set),E.add(_)}function p(_,b){for(let w=0;w<_.length;w++){const E=_[w],C=vt.toView(E.getArray());if(!b.has(E))for(let T=w+1;T<_.length;T++){const x=_[T];b.has(x)||vt.equals(C,vt.toView(x.getArray()))&&b.set(x,E)}}}let m=0;const A=new Map;for(const _ of[i,t,a,l])for(const b of _.values())m+=b.size,p(Array.from(b),A);e.debug(`${Vr}: Merged ${A.size} of ${m} accessors.`),u.forEach(_=>{_.listPrimitives().forEach(b=>{b.listAttributes().forEach(E=>{A.has(E)&&b.swap(E,A.get(E))});const w=b.getIndices();w&&A.has(w)&&b.swap(w,A.get(w))})});for(const _ of o.getRoot().listAnimations())for(const b of _.listSamplers()){const w=b.getInput(),E=b.getOutput();w&&A.has(w)&&b.swap(w,A.get(w)),E&&A.has(E)&&b.swap(E,A.get(E))}Array.from(A.keys()).forEach(_=>_.dispose())}function $k(o,e){const t=o.getLogger(),i=o.getRoot(),a=new Map;i.listAccessors().forEach((d,p)=>a.set(d,p)),i.listMaterials().forEach((d,p)=>a.set(d,p));const l=i.listMeshes().length,u=new Map;for(const d of i.listMeshes()){const p=[];for(const A of d.listPrimitives())p.push(H1(A,a));let m="";if(e.keepUniqueNames&&(m+=d.getName()+";"),m+=p.join(";"),u.has(m)){const A=u.get(m);d.listParents().forEach(_=>{_.propertyType!==Te.ROOT&&_.swap(d,A)}),d.dispose()}else u.set(m,d)}t.debug(`${Vr}: Merged ${l-u.size} of ${l} meshes.`)}function zk(o,e){const t=o.getLogger(),i=o.getRoot(),a=i.listTextures(),l=new Map;for(let u=0;u<a.length;u++){const d=a[u],p=d.getImage();if(!l.has(d))for(let m=u+1;m<a.length;m++){const A=a[m],_=A.getImage();if(l.has(A)||d.getMimeType()!==A.getMimeType()||e.keepUniqueNames&&d.getName()!==A.getName())continue;const b=d.getSize(),w=A.getSize();!b||!w||b[0]===w[0]&&b[1]===w[1]&&(!p||!_||vt.equals(p,_)&&l.set(A,d))}}t.debug(`${Vr}: Merged ${l.size} of ${i.listTextures().length} textures.`),Array.from(l.entries()).forEach(([u,d])=>{u.listParents().forEach(p=>{p instanceof Fu||p.swap(u,d)}),u.dispose()})}function Gk(o,e){const t=o.getLogger(),a=o.getRoot().listMaterials(),l=new Map,u=new Map,d=new Set;e.keepUniqueNames||d.add("name");for(let p=0;p<a.length;p++){const m=a[p];if(!l.has(m)&&!ev(m,u))for(let A=p+1;A<a.length;A++){const _=a[A];l.has(_)||ev(_,u)||m.equals(_,d)&&l.set(_,m)}}t.debug(`${Vr}: Merged ${l.size} of ${a.length} materials.`),Array.from(l.entries()).forEach(([p,m])=>{p.listParents().forEach(A=>{A instanceof Fu||A.swap(p,m)}),p.dispose()})}function Hk(o,e){const t=o.getLogger(),a=o.getRoot().listSkins(),l=new Map,u=new Set(["joints"]);e.keepUniqueNames||u.add("name");for(let d=0;d<a.length;d++){const p=a[d];if(!l.has(p))for(let m=d+1;m<a.length;m++){const A=a[m];l.has(A)||p.equals(A,u)&&Dk(p.listJoints(),A.listJoints())&&l.set(A,p)}}t.debug(`${Vr}: Merged ${l.size} of ${a.length} skins.`),Array.from(l.entries()).forEach(([d,p])=>{d.listParents().forEach(m=>{m instanceof Fu||m.swap(d,p)}),d.dispose()})}function H1(o,e){const t=[];for(const i of o.listSemantics()){const a=o.getAttribute(i);t.push(i+":"+e.get(a))}if(o instanceof Ls){const i=o.getIndices();i&&t.push("indices:"+e.get(i));const a=o.getMaterial();a&&t.push("material:"+e.get(a)),t.push("mode:"+o.getMode());for(const l of o.listTargets())t.push("target:"+H1(l,e))}return t.join(",")}function ev(o,e){if(e.has(o))return e.get(o);const t=o.getGraph(),i=new Set,a=t.listParentEdges(o);for(;a.length>0;){const l=a.pop();if(l.getAttributes().modifyChild===!0)return e.set(o,!0),!0;const u=l.getChild();if(!i.has(u))for(const d of t.listChildEdges(u))a.push(d)}return e.set(o,!1),!1}const{TEXTURE_INFO:w5,ROOT:E5}=Te;function V1(){var o=new hf(4);return hf!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0,o[3]=0),o}function Vk(o,e,t){return o[0]=e[0]+t[0],o[1]=e[1]+t[1],o[2]=e[2]+t[2],o[3]=e[3]+t[3],o}function Qk(o,e,t){return o[0]=e[0]-t[0],o[1]=e[1]-t[1],o[2]=e[2]-t[2],o[3]=e[3]-t[3],o}function jk(o,e,t){return o[0]=e[0]*t[0],o[1]=e[1]*t[1],o[2]=e[2]*t[2],o[3]=e[3]*t[3],o}function qk(o,e,t){return o[0]=e[0]*t,o[1]=e[1]*t,o[2]=e[2]*t,o[3]=e[3]*t,o}function Wk(o){var e=o[0],t=o[1],i=o[2],a=o[3];return Math.hypot(e,t,i,a)}var Q1=Qk,Yk=jk,j1=Wk;(function(){var o=V1();return function(e,t,i,a,l,u){var d,p;for(t||(t=4),i||(i=0),a?p=Math.min(a*t+i,e.length):p=e.length,d=i;d<p;d+=t)o[0]=e[d],o[1]=e[d+1],o[2]=e[d+2],o[3]=e[d+3],l(o,o,u),e[d]=o[0],e[d+1]=o[1],e[d+2]=o[2],e[d+3]=o[3];return e}})();const Xk=/color|emissive|diffuse/i;function Kk(o){return o.getGraph().listParentEdges(o).some(a=>a.getAttributes().isColor||Xk.test(a.getName()))?"srgb":null}function Jk(o){const e=o.getGraph(),t=new Set,i=new Set;function a(l){const u=new Set;for(const d of e.listChildEdges(l))d.getChild()instanceof Tu&&u.add(d.getName()+"Info");for(const d of e.listChildEdges(l)){const p=d.getChild();t.has(p)||(t.add(p),p instanceof vs&&u.has(d.getName())?i.add(p):p instanceof i_&&a(p))}}return a(o),Array.from(i)}function Zk(o){const t=s_.fromGraph(o.getGraph()).getRoot(),i=o.getGraph().listParentEdges(o).filter(a=>a.getParent()!==t).map(a=>a.getName());return Array.from(new Set(i))}const Ko="prune",$A=3/255,tv={propertyTypes:[Te.NODE,Te.SKIN,Te.MESH,Te.CAMERA,Te.PRIMITIVE,Te.PRIMITIVE_TARGET,Te.ANIMATION,Te.MATERIAL,Te.TEXTURE,Te.ACCESSOR,Te.BUFFER],keepLeaves:!1,keepAttributes:!1,keepIndices:!1,keepSolidTextures:!1,keepExtras:!1};function eU(o=tv){const e=z1(tv,o),t=new Set(e.propertyTypes),i=e.keepExtras;return $1(Ko,async a=>{const l=a.getLogger(),u=a.getRoot(),d=a.getGraph(),p=new tU,m=A=>p.dispose(A.target);if(d.addEventListener("node:dispose",m),t.has(Te.MESH))for(const A of u.listMeshes())A.listPrimitives().length>0||A.dispose();if(t.has(Te.NODE)){if(!e.keepLeaves)for(const A of u.listScenes())q1(d,A,i);for(const A of u.listNodes())$n(A,i)}if(t.has(Te.SKIN))for(const A of u.listSkins())$n(A,i);if(t.has(Te.MESH))for(const A of u.listMeshes())$n(A,i);if(t.has(Te.CAMERA))for(const A of u.listCameras())$n(A,i);if(t.has(Te.PRIMITIVE)&&iv(d,Te.PRIMITIVE,i),t.has(Te.PRIMITIVE_TARGET)&&iv(d,Te.PRIMITIVE_TARGET,i),!e.keepAttributes&&t.has(Te.ACCESSOR)){const A=new Map;for(const _ of u.listMeshes())for(const b of _.listPrimitives()){const w=b.getMaterial();if(!w)continue;const E=W1(a,b,w),C=iU(b,E);nv(b,C),b.listTargets().forEach(T=>nv(T,C)),A.has(w)?A.get(w).add(b):A.set(w,new Set([b]))}for(const[_,b]of A)nU(_,Array.from(b))}if(t.has(Te.ANIMATION))for(const A of u.listAnimations()){for(const _ of A.listChannels())_.getTargetNode()||_.dispose();if(A.listChannels().length)A.listSamplers().forEach(_=>$n(_,i));else{const _=A.listSamplers();$n(A,i),_.forEach(b=>$n(b,i))}}if(t.has(Te.MATERIAL)&&u.listMaterials().forEach(A=>$n(A,i)),t.has(Te.TEXTURE)&&(u.listTextures().forEach(A=>$n(A,i)),e.keepSolidTextures||await sU(a)),t.has(Te.ACCESSOR)&&u.listAccessors().forEach(A=>$n(A,i)),t.has(Te.BUFFER)&&u.listBuffers().forEach(A=>$n(A,i)),d.removeEventListener("node:dispose",m),p.empty())l.debug(`${Ko}: No unused properties found.`);else{const A=p.entries().map(([_,b])=>`${_} (${b})`).join(", ");l.info(`${Ko}: Removed types... ${A}`)}l.debug(`${Ko}: Complete.`)})}class tU{constructor(){this.disposed={}}empty(){for(const e in this.disposed)return!1;return!0}entries(){return Object.entries(this.disposed)}dispose(e){this.disposed[e.propertyType]=this.disposed[e.propertyType]||0,this.disposed[e.propertyType]++}}function $n(o,e){const t=o.listParents().filter(a=>!(a instanceof Fu||a instanceof $f)),i=e&&!G1(o.getExtras());!t.length&&!i&&o.dispose()}function iv(o,e,t){for(const i of o.listEdges()){const a=i.getParent();a.propertyType===e&&$n(a,t)}}function q1(o,e,t){if(e.listChildren().forEach(u=>q1(o,u,t)),e instanceof n_)return;const i=o.listParentEdges(e).some(u=>{const d=u.getParent().propertyType;return d!==Te.ROOT&&d!==Te.SCENE&&d!==Te.NODE}),a=o.listChildren(e).length===0,l=t&&!G1(e.getExtras());a&&!i&&!l&&e.dispose()}function nv(o,e){for(const t of e)o.setAttribute(t,null)}function iU(o,e){const t=[];for(const i of o.listSemantics())(i==="NORMAL"&&!e.has(i)||i==="TANGENT"&&!e.has(i)||i.startsWith("TEXCOORD_")&&!e.has(i)||i.startsWith("COLOR_")&&i!=="COLOR_0")&&t.push(i);return t}function W1(o,e,t,i=new Set){const l=o.getGraph().listChildEdges(t),u=new Set;for(const m of l)m.getChild()instanceof Tu&&u.add(m.getName());for(const m of l){const A=m.getName(),_=m.getChild();_ instanceof vs&&u.has(A.replace(/Info$/,""))&&i.add(`TEXCOORD_${_.getTexCoord()}`),_ instanceof Tu&&A.match(/normalTexture/i)&&i.add("TANGENT"),_ instanceof i_&&W1(o,e,_,i)}const d=t instanceof Ya&&!t.getExtension("KHR_materials_unlit"),p=e.getMode()===Ls.Mode.POINTS;return d&&!p&&i.add("NORMAL"),i}function nU(o,e){const t=Jk(o),i=new Set(t.map(p=>p.getTexCoord())),a=Array.from(i).sort(),l=new Map(a.map((p,m)=>[p,m])),u=new Map(a.map((p,m)=>[`TEXCOORD_${p}`,`TEXCOORD_${m}`]));for(const p of t){const m=p.getTexCoord();p.setTexCoord(l.get(m))}for(const p of e){const m=p.listSemantics().filter(A=>A.startsWith("TEXCOORD_")).sort();d(p,m),p.listTargets().forEach(A=>d(A,m))}function d(p,m){for(const A of m){const _=p.getAttribute(A);if(!_)continue;const b=u.get(A);b!==A&&(p.setAttribute(b,_),p.setAttribute(A,null))}}}async function sU(o){const e=o.getRoot(),t=o.getGraph(),i=o.getLogger(),l=e.listTextures().map(async u=>{var d;const p=await aU(u);if(!p)return;Kk(u)==="srgb"&&zO.convertSRGBToLinear(p,p);const m=u.getName()||u.getURI(),A=(d=u.getSize())==null?void 0:d.join("x"),_=Zk(u);for(const b of t.listParentEdges(u)){const w=b.getParent();w!==e&&rU(w,p,b.getName(),i)&&b.dispose()}u.listParents().length===1&&(u.dispose(),i.debug(`${Ko}: Removed solid-color texture "${m}" (${A}px ${_.join(", ")})`))});await Promise.all(l)}function rU(o,e,t,i){if(o instanceof Ya)switch(t){case"baseColorTexture":return o.setBaseColorFactor(Yk(e,e,o.getBaseColorFactor())),!0;case"emissiveTexture":return o.setEmissiveFactor(kk([0,0,0],e.slice(0,3),o.getEmissiveFactor())),!0;case"occlusionTexture":return Math.abs(e[0]-1)<=$A;case"metallicRoughnessTexture":return o.setRoughnessFactor(e[1]*o.getRoughnessFactor()),o.setMetallicFactor(e[2]*o.getMetallicFactor()),!0;case"normalTexture":return j1(Q1(V1(),e,[.5,.5,1,1]))<=$A}return i.warn(`${Ko}: Detected single-color ${t} texture. Pruning ${t} not yet supported.`),!1}async function aU(o){const e=await oU(o);if(!e)return null;const t=[1/0,1/0,1/0,1/0],i=[-1/0,-1/0,-1/0,-1/0],a=[0,0,0,0],[l,u]=e.shape;for(let d=0;d<l;d++){for(let p=0;p<u;p++)for(let m=0;m<4;m++)t[m]=Math.min(t[m],e.get(d,p,m)),i[m]=Math.max(i[m],e.get(d,p,m));if(j1(Q1(a,i,t))/255>$A)return null}return qk(a,Vk(a,i,t),.5/255)}async function oU(o){try{return await Lk(o.getImage(),o.getMimeType())}catch{return null}}const{LINE_STRIP:x5,LINE_LOOP:S5,TRIANGLE_STRIP:C5,TRIANGLE_FAN:T5}=Ls.Mode,{ROOT:I5,NODE:M5,MESH:R5,PRIMITIVE:B5,ACCESSOR:P5}=Te,{TRANSLATION:L5,ROTATION:D5,SCALE:N5,WEIGHTS:O5}=$f.TargetPath,lU={pattern:/.*/,quantizationVolume:"mesh",quantizePosition:14,quantizeNormal:10,quantizeTexcoord:12,quantizeColor:8,quantizeWeight:8,quantizeGeneric:12,normalizeWeights:!0,cleanup:!0};uf({level:"high"},lU);var sv;(function(o){o[o.STEP=0]="STEP",o[o.LERP=1]="LERP",o[o.SLERP=2]="SLERP"})(sv||(sv={}));Promise.resolve();const{POINTS:k5,LINES:U5,LINE_STRIP:F5,LINE_LOOP:$5,TRIANGLES:z5,TRIANGLE_STRIP:G5,TRIANGLE_FAN:H5}=Ls.Mode;var zA;(function(o){o.LANCZOS3="lanczos3",o.LANCZOS2="lanczos2"})(zA||(zA={}));zA.LANCZOS3;class cU{constructor({scene:e,targetRenderer:t,contactShadowSettings:i}){this.__contactShadowSettings={},this.__shadowState={shadow:{blur:4,darkness:.6,opacity:1},plane:{color:"#ffffff",opacity:0},showWireframe:!1},this.__blurPlane={},this.__renderTarget={},this.__renderTargetBlur={},this.__shadowCamera={},this.__depthMaterial={},this.__horizontalBlurMaterial={},this.__verticalBlurMaterial={},this.__planeMaterial={},this.__scene=e,this.__targetRenderer=t,this.__contactShadowSettings=i,this.isEnabled()&&this.setupContactShadows()}isEnabled(){return this.__contactShadowSettings.enabled}enable(){this.__contactShadowSettings.enabled=!0}disable(){this.__contactShadowSettings.enabled=!1}updateShadowSoftness(e){this.__shadowState.shadow.blur=e}updateShadowIntensity(e){this.__shadowState.shadow.opacity=e,this.__planeMaterial.opacity=e,this.__planeMaterial.needsUpdate=!0}__blurShadow(e){this.__blurPlane.visible=!0,this.__blurPlane.material=this.__horizontalBlurMaterial,this.__blurPlane.material.uniforms.tDiffuse.value=this.__renderTarget.texture,this.__horizontalBlurMaterial.uniforms.h.value=e*1/256,this.__targetRenderer.setRenderTarget(this.__renderTargetBlur),this.__targetRenderer.render(this.__blurPlane,this.__shadowCamera),this.__blurPlane.material=this.__verticalBlurMaterial,this.__blurPlane.material.uniforms.tDiffuse.value=this.__renderTargetBlur.texture,this.__verticalBlurMaterial.uniforms.v.value=e*1/256,this.__targetRenderer.setRenderTarget(this.__renderTarget),this.__targetRenderer.render(this.__blurPlane,this.__shadowCamera),this.__blurPlane.visible=!1}setupContactShadows(){if(!this.__contactShadowSettings.enabled)return;const{planeLength:e,planeWidth:t,cameraHeight:i}=this.__contactShadowSettings,a=e,l=t,u=i,d=new mi;d.position.y=0,this.__scene.add(d),this.__renderTarget=new dn(512,512),this.__renderTarget.texture.generateMipmaps=!1,this.__renderTargetBlur=new dn(512,512),this.__renderTargetBlur.texture.generateMipmaps=!1;const p=new Ms(l,a).rotateX(Math.PI/2);this.__planeMaterial=new Pi({map:this.__renderTarget.texture,opacity:this.__shadowState.shadow.opacity,transparent:!0,depthWrite:!1});const m=new lt(p,this.__planeMaterial);m.renderOrder=1,d.add(m),m.scale.y=-1,this.__blurPlane=new lt(p),this.__blurPlane.visible=!1,d.add(this.__blurPlane);const A=new Pi({color:this.__shadowState.plane.color,opacity:this.__shadowState.plane.opacity,transparent:!0,depthWrite:!1}),_=new lt(p,A);_.rotateX(Math.PI),d.add(_),this.__shadowCamera=new Kr(-l/2,l/2,a/2,-a/2,0,u),this.__shadowCamera.rotation.x=Math.PI/2,d.add(this.__shadowCamera),this.__depthMaterial=new G0,this.__depthMaterial.userData.darkness={value:this.__shadowState.shadow.darkness},this.__depthMaterial.onBeforeCompile=b=>{b.uniforms.darkness=this.__depthMaterial.userData.darkness,b.fragmentShader=`
|
|
4164
4164
|
uniform float darkness;
|
|
4165
|
-
${
|
|
4166
|
-
`},this.__depthMaterial.depthTest=!1,this.__depthMaterial.depthWrite=!1,this.__horizontalBlurMaterial=new zi(S1),this.__horizontalBlurMaterial.depthTest=!1,this.__verticalBlurMaterial=new zi(C1),this.__verticalBlurMaterial.depthTest=!1}reCalculateContactShadows(){const e=this.__scene.background;this.__scene.background=null,this.__scene.overrideMaterial=this.__depthMaterial;const t=this.__targetRenderer.getClearAlpha();this.__targetRenderer.setClearAlpha(0),this.__targetRenderer.setRenderTarget(this.__renderTarget),this.__targetRenderer.render(this.__scene,this.__shadowCamera),this.__scene.overrideMaterial=null,this.__blurShadow(this.__shadowState.shadow.blur),this.__blurShadow(this.__shadowState.shadow.blur*.4),this.__targetRenderer.setRenderTarget(null),this.__targetRenderer.setClearAlpha(t),this.__scene.background=e}}class Ft{static isTouchDevice(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}static async wait(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}static generateStylesDomElem(e,t=""){const i=document.createElement("style");return i.setAttribute("id",e),i.innerHTML=t,i}static generateHtmlDivElem(e,t=""){const i=document.createElement("div");return i.setAttribute("id",e),i.innerHTML=t,i}static getRandomIntegerInRange(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}static getUrlParameterByName(e,t=window.location.search){const i=new URLSearchParams(t);return Object.fromEntries(i.entries())[e]}static getBaseUrl(){const e=Ft.getUrlParameterByName("parentUrl");return e||window.location.href}static normalizeRadian(e){return Math.atan2(Math.sin(e),Math.cos(e))}static isBetweenOnCircle(e,t,i){return e=Ft.normalizeRadian(e),t=Ft.normalizeRadian(t),i=Ft.normalizeRadian(i),t<=i?e>=t&&e<=i:e>=t||e<=i}static getPointInBetweenByPercentage(e,t,i){let a=t.clone().sub(e);const l=a.length();return a=a.normalize().multiplyScalar(l*i),e.clone().add(a)}static clampAzimuth(e,t,i){if(Math.abs(t)==1/0||i==1/0)return e;const a=Ft.normalizeRadian(e),l=Ft.normalizeRadian(t),u=Ft.normalizeRadian(i);if(Ft.isBetweenOnCircle(a,l,u))return a;const d=Math.abs(Ft.normalizeRadian(a-l)),p=Math.abs(Ft.normalizeRadian(a-u));return d<p?l:u}static resolveNexusEndpoint(e){let t=_d.PRODUCTION;return e=="local"?t=_d.LOCAL:e==="staging"&&(t=_d.STAGING),t}static parseUrlForEpigraphParams(e){const t=new Map,i=new $g(e);t.set(Si.epigraphSessionId,i.getParameterInUrl(Si.epigraphSessionId)),t.set(Si.identifier,i.getParameterInUrl(Si.identifier)),t.set(Si.identifierType,i.getParameterInUrl(Si.identifierType)),t.set(Si.type,i.getParameterInUrl(Si.type));const a=i.getParameterInUrl(Si.action);return a&&t.set(il.AR,JSON.parse(a)[il.AR]),t}static generateShareableUrl({baseUrl:e,identifier:t,identifierType:i,sharedConfig:a,arCompatible:l=!1}){const u=new Map;return u.set(Si.epigraphSessionId,window.epigraph.epigraphSessionId),u.set(Si.identifier,t),u.set(Si.identifierType,i),a&&u.set(Si.sharedConfig,a),l&&u.set(Si.action,`{"${il.AR}":true}`),new $g(e).generateQrCodeUrl(Object.fromEntries(u.entries()),!1)}static _dispose3(e){e instanceof lt&&e.geometry.dispose(),e instanceof lt&&(Array.isArray(e.material)?e.material.forEach(t=>t.dispose()):e.material.dispose(),e.material?.map?.dispose())}static dispose3(e){e.traverse(t=>{t instanceof lt&&Ft._dispose3(t)}),(e instanceof lt||e instanceof jn)&&Ft._dispose3(e)}static animateValue(e,t,i,a){const l=performance.now();function u(d){const p=d-l,m=Math.min(p/i,1),A=e+(t-e)*m;a(A),m<1&&requestAnimationFrame(u)}requestAnimationFrame(u)}static getCustomStylesTemplate(){const t=document.querySelector("#epigraphCustomStyles")?.content?.cloneNode(!0);return t||Ge}}class uU extends EventTarget{constructor(e){super(),this._loggerContext="THREEJS ENGINE",this.__assetLoaders=new rf,this.__scene=new Wr,this.__tweenGroup=new I1,this.__clock=new $S,this.__effectsComposer={},this.__canvas={},this.__mainRenderer={},this.__screenshotRenderer={},this.__sceneHierarchy={baseSceneGrp:new mi,lightsGrp:new mi,sceneStructure:new mi,dimensionLinesGrp:new mi,miscGrp:new mi},this.__defaultEnvMap="https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/env-maps/neutral.hdr",this.__lengthLine={},this.__depthLine={},this.__heightLine={},this.__textureAnisotropyToUse=4,this.renderEngineSettings={hotspots:{enabled:!1},dimensions:{enabled:!1},contactShadows:{enabled:!0,planeLength:3,planeWidth:3,cameraHeight:1},postEffect:{ao:!1},camera:{clearColor:"#ffffff",focalLength:35,canPan:!0,canZoom:!0,minDistance:2,maxDistance:8,minPolarAngle:0,maxPolarAngle:1.5,minAzimuthAngle:-1/0,maxAzimuthAngle:1/0},renderQuality:{antiAlias:!0},screenshots:{enabled:!1}},this.__gridHelper=new qR(10,20),this.__appWcRef=e}get canvas(){return this.__canvas}get scene(){return this.__scene}get mainRenderer(){return this.__mainRenderer}get effectsComposer(){return this.__effectsComposer}get screenshotRenderer(){return this.__screenshotRenderer}get sceneHierarchy(){return this.__sceneHierarchy}getClockDelta(){return this.__clock.getDelta()}get tweenGroup(){return this.__tweenGroup}updateAllTextureAnisotropy(){this.__scene.traverse(e=>{const i=e.material;i?.map&&(i.map.anisotropy=this.__textureAnisotropyToUse,i.needsUpdate=!0)})}showSceneDebuggers(){this.__sceneHierarchy.miscGrp.add(this.__gridHelper)}hideSceneDebuggers(){this.__gridHelper.removeFromParent()}printSceneHierarchy(e=!1){(function t(i){e===!0?(console.group(`------ ${i.name} ------`),console.log(i)):console.group(" <"+i.type+"> "+i.name),i.children.forEach(t),console.groupEnd()})(this.__scene)}async emptyScene(){Ft.dispose3(this.scene),this.__sceneHierarchy.baseSceneGrp.clear(),this.__sceneHierarchy.lightsGrp.clear(),this.__sceneHierarchy.sceneStructure.clear()}async _setupSceneHierarchy(){this.__sceneHierarchy.baseSceneGrp.name="GRP_BASE_SCENE",this.__scene.add(this.__sceneHierarchy.baseSceneGrp),this.__sceneHierarchy.lightsGrp.name="GRP_LIGHTS",this.__scene.add(this.__sceneHierarchy.lightsGrp),this.__sceneHierarchy.sceneStructure.name="GRP_SCENE_STRUCTURE",this.__scene.add(this.__sceneHierarchy.sceneStructure),this.__sceneHierarchy.dimensionLinesGrp.name="GRP_DIMENSIONS_LINES",this.__scene.add(this.__sceneHierarchy.dimensionLinesGrp),this.__sceneHierarchy.miscGrp.name="GRP_MISC",this.__scene.add(this.__sceneHierarchy.miscGrp)}async _setupLights({envMap:e=this.__defaultEnvMap}){this.__mainRenderer.outputColorSpace=Ht,this.__mainRenderer.toneMapping=S0,new E1().load(e,i=>{i.mapping=bu,this.__scene.environment=i})}__setupEffectComposer(){this.__effectsComposer=new PO(this.__mainRenderer),window.epigraph.logger.info({title:"Effects to enable",details:this.renderEngineSettings.postEffect,contextOverride:this._loggerContext})}__constructLineSegment(e,t,i){const a=[e,t],l=new Di().setFromPoints(a),u=new Cl(l,i);return u.castShadow=!1,u}__setupDimensionLines(){const e={color:new Ye().setHex(11776947).convertSRGBToLinear(),scale:1,dashSize:.02,gapSize:.02},t=new Bp(e),i=new Bp(e),a=new Bp(e),l=new se;this.__lengthLine=this.__constructLineSegment(l,l,t),this.__depthLine=this.__constructLineSegment(l,l,i),this.__heightLine=this.__constructLineSegment(l,l,a),this.__sceneHierarchy.dimensionLinesGrp.add(this.__lengthLine),this.__sceneHierarchy.dimensionLinesGrp.add(this.__depthLine),this.__sceneHierarchy.dimensionLinesGrp.add(this.__heightLine),this.setDimensionsVisibility(!1)}updateDimensionLines(e){this.__lengthLine.geometry?.setFromPoints([e.length.begin.worldPos,e.length.end.worldPos]),this.__depthLine.geometry?.setFromPoints([e.width.begin.worldPos,e.width.end.worldPos]),this.__heightLine.geometry?.setFromPoints([e.height.begin.worldPos,e.height.end.worldPos]),this.__lengthLine?.computeLineDistances(),this.__depthLine?.computeLineDistances(),this.__heightLine?.computeLineDistances()}frameUpdate(){this.__appWcRef.appEvents.frameUpdated.fire()}repopulateHotspotIndicators(){this.__appWcRef.appEvents.hotspotsUpdatedEvent.fire()}setDimensionsVisibility(e){this.__lengthLine.visible=e,this.__depthLine.visible=e,this.__heightLine.visible=e}async getSceneAsUsdzUrl(){const e=this.__sceneHierarchy.sceneStructure;this.printSceneHierarchy();const i=await new g1().parseAsync(e),a=new Blob([i],{type:"model/vnd.usdz+zip"});return URL.createObjectURL(a)}async getSceneAsGlbUrl(){const e=new vk,t=new Cu,a=this.__sceneHierarchy.sceneStructure;this.printSceneHierarchy();const l={binary:!0,forceIndices:!0,trs:!1,onlyVisible:!1,embedImages:!0,maxTextureSize:1024},u=await t.parseAsync(a,l),d=await e.readBinary(new Uint8Array(u)),p=await this.optimizeGlb(d),m=await e.writeBinary(p);return await this.saveArrayBufferAsURL(m)}async optimizeGlb(e){const i=e.getRoot().listNodes();for(const a of i){a.setExtras({});const l=a.getName();(l==="GRP_ProxyMesh"||l==="GRP_LoadingPlaceholder")&&a.dispose()}return await e.transform(Uk(),eU()),e}async saveArrayBufferAsURL(e){const t=new Blob([e],{type:"application/gltf-buffer"});return window.epigraph.logger.info({title:"Approx scene GLB size: "+t.size/1e6}),URL.createObjectURL(t)}__perFrameUpdate(){const e=this.__clock.getDelta();this.__contactShadows.isEnabled()&&this.__contactShadows.reCalculateContactShadows(),this.__appWcRef.postRenderFrameUpdateInEngine(e),this.__effectsComposer.render(),this.__tweenGroup.update(),requestAnimationFrame(this.__perFrameUpdate.bind(this))}__setupRenderers(){this.__mainRenderer=new tf({antialias:this.renderEngineSettings.renderQuality.antiAlias,alpha:this.__appWcRef.transparentBackground}),this.__appWcRef.transparentBackground||this.__mainRenderer.setClearColor(this.renderEngineSettings.camera.clearColor),this.__mainRenderer.shadowMap.enabled=!0,this.__mainRenderer.shadowMap.type=x0,this.renderEngineSettings.screenshots.enabled&&(this.__screenshotRenderer=new tf({antialias:this.renderEngineSettings.renderQuality.antiAlias,preserveDrawingBuffer:!0}),document.body.appendChild(this.__screenshotRenderer.domElement),this.__screenshotRenderer.domElement.style.display="none")}async setup(e){e&&(this.renderEngineSettings=e),this.__setupRenderers(),this.__canvas=this.__mainRenderer.domElement,await this._setupSceneHierarchy(),await this._setupLights({envMap:this.__defaultEnvMap}),this.__contactShadows=new cU({scene:this.__scene,targetRenderer:this.__mainRenderer,contactShadowSettings:this.renderEngineSettings.contactShadows}),this.__setupDimensionLines(),this.__setupEffectComposer();const t=this.__mainRenderer.capabilities.getMaxAnisotropy();t<this.__textureAnisotropyToUse&&(this.__textureAnisotropyToUse=t),this.__perFrameUpdate(),requestAnimationFrame(this.__perFrameUpdate.bind(this));const i={assetLoaders:this.__assetLoaders,canvasHtmlElem:this.__canvas,renderer:this.__mainRenderer,screenshotRenderer:this.__screenshotRenderer??void 0},a=1;return this.mainRenderer.setPixelRatio(a),this.effectsComposer.setPixelRatio(a),Promise.resolve(i)}}var zf=(o=>(o.Empty="asset-empty",o.Gltf="asset-gltf",o.Render="asset-render",o.Proxy="asset-proxy",o.Collider="asset-collider",o.Product="asset-product",o))(zf||{});class $u{constructor(e){this._success=e}get success(){return this._success}set success(e){this._success=e}get failed(){return!this._success}}class df extends $u{constructor(e,t=void 0){super(e),this.__payload=t}get payload(){return this.__payload}set payload(e){this.__payload=e}}class hU extends $u{constructor(e=!1,t=void 0){super(e),this.__payload=t}get payload(){return this.__payload}set payload(e){this.__payload=e}}class dU extends $u{constructor(e=!1,t=void 0){super(e),this.__payload=t}get payload(){return this.__payload}set payload(e){this.__payload=e}}var Br=(o=>(o.declared="declared",o.Loading="loading",o.Loaded="loaded",o.Unloaded="unloaded",o.Failed="failed",o))(Br||{});class fU{constructor({id:e,uri:t="",preload:i=!1,appWcRef:a}){this._id=crypto.randomUUID(),this._preload=!1,this._loadingProgress=0,this._state=Br.declared,this._type=zf.Empty,e&&(this._id=e),this._appWcRef=a,this._uri=t,this._preload=i}get id(){return this._id}get uri(){return this._uri}get preload(){return this._preload}set preload(e){this._preload=e}get loadingProgress(){return this._loadingProgress}get state(){return this._state}get isLoaded(){return this._state===Br.Loaded}get type(){return this._type}async load(){return window.epigraph.logger.info({title:"Loading asset..."}),new df(!0)}updateLoadingProgress(e){this._loadingProgress=e,this._appWcRef.appEvents.assetLoadProgress.fire({progress:e})}async unload(){return window.epigraph.logger.info({title:"Unloading asset..."}),new Promise(e=>{const t=new df(!0);e(t)})}}class Y1 extends fU{constructor({id:e,uri:t,preload:i,appWcRef:a}){super({id:e,uri:t,preload:i,appWcRef:a}),this._type=zf.Gltf,this._isAcceptableAsGltfAsset=!0,this.__variantsExtensionName="KHR_materials_variants",this.__variantNamesFromAsset=[],this.__resource={}}get resource(){return this.__resource}get variantsExtensionName(){return this.__variantsExtensionName}get variantsExtension(){return this.__variantsExtension}get isAcceptableAsGltfAsset(){return this._isAcceptableAsGltfAsset}get variantNamesFromAsset(){return this.__variantNamesFromAsset}highlight(){}async load(){const e=new df(!1);if(this._state===Br.Loaded||this._state===Br.Loading)return e.success=!0,e.payload=this,Promise.resolve(e);this._state=Br.Loading;const t=await this._appWcRef.assetLoaders.gltfLoader.loadAsync(this._uri,a=>{this.updateLoadingProgress(a.loaded/a.total*100)}).catch(a=>(window.epigraph.logger.groupCollapsed({title:"An error occurred while trying to load an asset!"}),window.epigraph.logger.error({title:"details",details:a}),this._state=Br.Failed,Promise.reject()));if(t===void 0)return Promise.reject(e);this.__resource=t;const i=this.__resource?.userData?.gltfExtensions;if(i&&(this.__variantsExtension=i[this.__variantsExtensionName]),this.__variantsExtension?.variants)for(const a of this.__variantsExtension.variants)this.__variantNamesFromAsset.push(a.name);return this._state=Br.Loaded,e.success=!0,e.payload=this,Promise.resolve(e)}unload(){const e=new $u(!0);return this.__resource={},this.__variantsExtension={},this.__variantNamesFromAsset=[],Promise.resolve(e)}}class pU{constructor(e){this.__loggerContext="ASSET MANAGER",this.__assets=new Map,window.epigraph.logger.info({title:"Initializing...",contextOverride:this.__loggerContext}),this.__appWcRef=e}get assets(){return this.__assets}getAssetById(e){const t=new df(!1),i=this.__assets.get(e);return i&&(t.success=!0,t.payload=i),t}getAssetGltfById(e){const t=new hU(!1),i=this.getAssetById(e);return i.success&&(t.success=!0,t.payload=i.payload),t}async loadAssetGltfConfig(e){const{id:t,uri:i,preload:a}=e,l=new Y1({id:t,uri:i,preload:a,appWcRef:this.__appWcRef});e.preload&&await l.load(),this.__assets.set(t,l)}async addAssetsFromJson(e){for(const t of e)t.type===zf.Gltf&&await this.loadAssetGltfConfig(t).catch(i=>{window.epigraph.logger.error({title:`Error adding asset: ${t}`,details:i,contextOverride:this.__loggerContext})})}}/*!
|
|
4165
|
+
${b.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")}
|
|
4166
|
+
`},this.__depthMaterial.depthTest=!1,this.__depthMaterial.depthWrite=!1,this.__horizontalBlurMaterial=new zi(S1),this.__horizontalBlurMaterial.depthTest=!1,this.__verticalBlurMaterial=new zi(C1),this.__verticalBlurMaterial.depthTest=!1}reCalculateContactShadows(){const e=this.__scene.background;this.__scene.background=null,this.__scene.overrideMaterial=this.__depthMaterial;const t=this.__targetRenderer.getClearAlpha();this.__targetRenderer.setClearAlpha(0),this.__targetRenderer.setRenderTarget(this.__renderTarget),this.__targetRenderer.render(this.__scene,this.__shadowCamera),this.__scene.overrideMaterial=null,this.__blurShadow(this.__shadowState.shadow.blur),this.__blurShadow(this.__shadowState.shadow.blur*.4),this.__targetRenderer.setRenderTarget(null),this.__targetRenderer.setClearAlpha(t),this.__scene.background=e}}class Ft{static isTouchDevice(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}static async wait(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}static generateStylesDomElem(e,t=""){const i=document.createElement("style");return i.setAttribute("id",e),i.innerHTML=t,i}static generateHtmlDivElem(e,t=""){const i=document.createElement("div");return i.setAttribute("id",e),i.innerHTML=t,i}static getRandomIntegerInRange(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}static getUrlParameterByName(e,t=window.location.search){const i=new URLSearchParams(t);return Object.fromEntries(i.entries())[e]}static getBaseUrl(){const e=Ft.getUrlParameterByName("parentUrl");return e||window.location.href}static normalizeRadian(e){return Math.atan2(Math.sin(e),Math.cos(e))}static isBetweenOnCircle(e,t,i){return e=Ft.normalizeRadian(e),t=Ft.normalizeRadian(t),i=Ft.normalizeRadian(i),t<=i?e>=t&&e<=i:e>=t||e<=i}static getPointInBetweenByPercentage(e,t,i){let a=t.clone().sub(e);const l=a.length();return a=a.normalize().multiplyScalar(l*i),e.clone().add(a)}static clampAzimuth(e,t,i){if(Math.abs(t)==1/0||i==1/0)return e;const a=Ft.normalizeRadian(e),l=Ft.normalizeRadian(t),u=Ft.normalizeRadian(i);if(Ft.isBetweenOnCircle(a,l,u))return a;const d=Math.abs(Ft.normalizeRadian(a-l)),p=Math.abs(Ft.normalizeRadian(a-u));return d<p?l:u}static resolveNexusEndpoint(e){let t=_d.PRODUCTION;return e=="local"?t=_d.LOCAL:e==="staging"&&(t=_d.STAGING),t}static parseUrlForEpigraphParams(e){const t=new Map,i=new $g(e);t.set(Si.epigraphSessionId,i.getParameterInUrl(Si.epigraphSessionId)),t.set(Si.identifier,i.getParameterInUrl(Si.identifier)),t.set(Si.identifierType,i.getParameterInUrl(Si.identifierType)),t.set(Si.type,i.getParameterInUrl(Si.type));const a=i.getParameterInUrl(Si.action);return a&&t.set(il.AR,JSON.parse(a)[il.AR]),t}static generateShareableUrl({baseUrl:e,identifier:t,identifierType:i,sharedConfig:a,arCompatible:l=!1}){const u=new Map;return u.set(Si.epigraphSessionId,window.epigraph.epigraphSessionId),u.set(Si.identifier,t),u.set(Si.identifierType,i),a&&u.set(Si.sharedConfig,a),l&&u.set(Si.action,`{"${il.AR}":true}`),new $g(e).generateQrCodeUrl(Object.fromEntries(u.entries()),!1)}static _dispose3(e){e instanceof lt&&e.geometry.dispose(),e instanceof lt&&(Array.isArray(e.material)?e.material.forEach(t=>t.dispose()):e.material.dispose(),e.material?.map?.dispose())}static dispose3(e){e.traverse(t=>{t instanceof lt&&Ft._dispose3(t)}),(e instanceof lt||e instanceof jn)&&Ft._dispose3(e)}static animateValue(e,t,i,a){const l=performance.now();function u(d){const p=d-l,m=Math.min(p/i,1),A=e+(t-e)*m;a(A),m<1&&requestAnimationFrame(u)}requestAnimationFrame(u)}static getCustomStylesTemplate(){const t=document.querySelector("#epigraphCustomStyles")?.content?.cloneNode(!0);return t||Ge}}class uU extends EventTarget{constructor(e){super(),this._loggerContext="THREEJS ENGINE",this.__assetLoaders=new rf,this.__scene=new Wr,this.__tweenGroup=new I1,this.__clock=new $S,this.__effectsComposer={},this.__canvas={},this.__mainRenderer={},this.__screenshotRenderer={},this.__sceneHierarchy={baseSceneGrp:new mi,lightsGrp:new mi,sceneStructure:new mi,dimensionLinesGrp:new mi,miscGrp:new mi},this.__defaultEnvMap="https://asset.myepigraph.com/configurator-assets/epigraph-solution-assets/env-maps/neutral.hdr",this.__lengthLine={},this.__depthLine={},this.__heightLine={},this.__textureAnisotropyToUse=4,this.renderEngineSettings={hotspots:{enabled:!1},dimensions:{enabled:!1},contactShadows:{enabled:!0,planeLength:3,planeWidth:3,cameraHeight:1},postEffect:{ao:!1},camera:{clearColor:"#ffffff",focalLength:35,canPan:!0,canZoom:!0,minDistance:2,maxDistance:8,minPolarAngle:0,maxPolarAngle:1.5,minAzimuthAngle:-1/0,maxAzimuthAngle:1/0},renderQuality:{antiAlias:!0},screenshots:{enabled:!1}},this.__gridHelper=new qR(10,20),this.__appWcRef=e}get canvas(){return this.__canvas}get scene(){return this.__scene}get mainRenderer(){return this.__mainRenderer}get effectsComposer(){return this.__effectsComposer}get screenshotRenderer(){return this.__screenshotRenderer}get sceneHierarchy(){return this.__sceneHierarchy}get contactShadows(){return this.__contactShadows}getClockDelta(){return this.__clock.getDelta()}get tweenGroup(){return this.__tweenGroup}updateAllTextureAnisotropy(){this.__scene.traverse(e=>{const i=e.material;i?.map&&(i.map.anisotropy=this.__textureAnisotropyToUse,i.needsUpdate=!0)})}showSceneDebuggers(){this.__sceneHierarchy.miscGrp.add(this.__gridHelper)}hideSceneDebuggers(){this.__gridHelper.removeFromParent()}printSceneHierarchy(e=!1){(function t(i){e===!0?(console.group(`------ ${i.name} ------`),console.log(i)):console.group(" <"+i.type+"> "+i.name),i.children.forEach(t),console.groupEnd()})(this.__scene)}async emptyScene(){Ft.dispose3(this.scene),this.__sceneHierarchy.baseSceneGrp.clear(),this.__sceneHierarchy.lightsGrp.clear(),this.__sceneHierarchy.sceneStructure.clear()}async _setupSceneHierarchy(){this.__sceneHierarchy.baseSceneGrp.name="GRP_BASE_SCENE",this.__scene.add(this.__sceneHierarchy.baseSceneGrp),this.__sceneHierarchy.lightsGrp.name="GRP_LIGHTS",this.__scene.add(this.__sceneHierarchy.lightsGrp),this.__sceneHierarchy.sceneStructure.name="GRP_SCENE_STRUCTURE",this.__scene.add(this.__sceneHierarchy.sceneStructure),this.__sceneHierarchy.dimensionLinesGrp.name="GRP_DIMENSIONS_LINES",this.__scene.add(this.__sceneHierarchy.dimensionLinesGrp),this.__sceneHierarchy.miscGrp.name="GRP_MISC",this.__scene.add(this.__sceneHierarchy.miscGrp)}async _setupLights({envMap:e=this.__defaultEnvMap}){this.__mainRenderer.outputColorSpace=Ht,this.__mainRenderer.toneMapping=S0,new E1().load(e,i=>{i.mapping=bu,this.__scene.environment=i})}__setupEffectComposer(){this.__effectsComposer=new PO(this.__mainRenderer),window.epigraph.logger.info({title:"Effects to enable",details:this.renderEngineSettings.postEffect,contextOverride:this._loggerContext})}__constructLineSegment(e,t,i){const a=[e,t],l=new Di().setFromPoints(a),u=new Cl(l,i);return u.castShadow=!1,u}__setupDimensionLines(){const e={color:new Ye().setHex(11776947).convertSRGBToLinear(),scale:1,dashSize:.02,gapSize:.02},t=new Bp(e),i=new Bp(e),a=new Bp(e),l=new se;this.__lengthLine=this.__constructLineSegment(l,l,t),this.__depthLine=this.__constructLineSegment(l,l,i),this.__heightLine=this.__constructLineSegment(l,l,a),this.__sceneHierarchy.dimensionLinesGrp.add(this.__lengthLine),this.__sceneHierarchy.dimensionLinesGrp.add(this.__depthLine),this.__sceneHierarchy.dimensionLinesGrp.add(this.__heightLine),this.setDimensionsVisibility(!1)}updateDimensionLines(e){this.__lengthLine.geometry?.setFromPoints([e.length.begin.worldPos,e.length.end.worldPos]),this.__depthLine.geometry?.setFromPoints([e.width.begin.worldPos,e.width.end.worldPos]),this.__heightLine.geometry?.setFromPoints([e.height.begin.worldPos,e.height.end.worldPos]),this.__lengthLine?.computeLineDistances(),this.__depthLine?.computeLineDistances(),this.__heightLine?.computeLineDistances()}frameUpdate(){this.__appWcRef.appEvents.frameUpdated.fire()}repopulateHotspotIndicators(){this.__appWcRef.appEvents.hotspotsUpdatedEvent.fire()}setDimensionsVisibility(e){this.__lengthLine.visible=e,this.__depthLine.visible=e,this.__heightLine.visible=e}async getSceneAsUsdzUrl(){const e=this.__sceneHierarchy.sceneStructure;this.printSceneHierarchy();const i=await new g1().parseAsync(e),a=new Blob([i],{type:"model/vnd.usdz+zip"});return URL.createObjectURL(a)}async getSceneAsGlbUrl(){const e=new vk,t=new Cu,a=this.__sceneHierarchy.sceneStructure;this.printSceneHierarchy();const l={binary:!0,forceIndices:!0,trs:!1,onlyVisible:!1,embedImages:!0,maxTextureSize:1024},u=await t.parseAsync(a,l),d=await e.readBinary(new Uint8Array(u)),p=await this.optimizeGlb(d),m=await e.writeBinary(p);return await this.saveArrayBufferAsURL(m)}async optimizeGlb(e){const i=e.getRoot().listNodes();for(const a of i){a.setExtras({});const l=a.getName();(l==="GRP_ProxyMesh"||l==="GRP_LoadingPlaceholder")&&a.dispose()}return await e.transform(Uk(),eU()),e}async saveArrayBufferAsURL(e){const t=new Blob([e],{type:"application/gltf-buffer"});return window.epigraph.logger.info({title:"Approx scene GLB size: "+t.size/1e6}),URL.createObjectURL(t)}__perFrameUpdate(){const e=this.__clock.getDelta();this.__contactShadows.isEnabled()&&this.__contactShadows.reCalculateContactShadows(),this.__appWcRef.postRenderFrameUpdateInEngine(e),this.__effectsComposer.render(),this.__tweenGroup.update(),requestAnimationFrame(this.__perFrameUpdate.bind(this))}__setupRenderers(){this.__mainRenderer=new tf({antialias:this.renderEngineSettings.renderQuality.antiAlias,alpha:this.__appWcRef.transparentBackground}),this.__appWcRef.transparentBackground||this.__mainRenderer.setClearColor(this.renderEngineSettings.camera.clearColor),this.__mainRenderer.shadowMap.enabled=!0,this.__mainRenderer.shadowMap.type=x0,this.renderEngineSettings.screenshots.enabled&&(this.__screenshotRenderer=new tf({antialias:this.renderEngineSettings.renderQuality.antiAlias,preserveDrawingBuffer:!0}),document.body.appendChild(this.__screenshotRenderer.domElement),this.__screenshotRenderer.domElement.style.display="none")}async setup(e){e&&(this.renderEngineSettings=e),this.__setupRenderers(),this.__canvas=this.__mainRenderer.domElement,await this._setupSceneHierarchy(),await this._setupLights({envMap:this.__defaultEnvMap}),this.__contactShadows=new cU({scene:this.__scene,targetRenderer:this.__mainRenderer,contactShadowSettings:this.renderEngineSettings.contactShadows}),this.__setupDimensionLines(),this.__setupEffectComposer();const t=this.__mainRenderer.capabilities.getMaxAnisotropy();t<this.__textureAnisotropyToUse&&(this.__textureAnisotropyToUse=t),this.__perFrameUpdate(),requestAnimationFrame(this.__perFrameUpdate.bind(this));const i={assetLoaders:this.__assetLoaders,canvasHtmlElem:this.__canvas,renderer:this.__mainRenderer,screenshotRenderer:this.__screenshotRenderer??void 0},a=1;return this.mainRenderer.setPixelRatio(a),this.effectsComposer.setPixelRatio(a),Promise.resolve(i)}}var zf=(o=>(o.Empty="asset-empty",o.Gltf="asset-gltf",o.Render="asset-render",o.Proxy="asset-proxy",o.Collider="asset-collider",o.Product="asset-product",o))(zf||{});class $u{constructor(e){this._success=e}get success(){return this._success}set success(e){this._success=e}get failed(){return!this._success}}class df extends $u{constructor(e,t=void 0){super(e),this.__payload=t}get payload(){return this.__payload}set payload(e){this.__payload=e}}class hU extends $u{constructor(e=!1,t=void 0){super(e),this.__payload=t}get payload(){return this.__payload}set payload(e){this.__payload=e}}class dU extends $u{constructor(e=!1,t=void 0){super(e),this.__payload=t}get payload(){return this.__payload}set payload(e){this.__payload=e}}var Br=(o=>(o.declared="declared",o.Loading="loading",o.Loaded="loaded",o.Unloaded="unloaded",o.Failed="failed",o))(Br||{});class fU{constructor({id:e,uri:t="",preload:i=!1,appWcRef:a}){this._id=crypto.randomUUID(),this._preload=!1,this._loadingProgress=0,this._state=Br.declared,this._type=zf.Empty,e&&(this._id=e),this._appWcRef=a,this._uri=t,this._preload=i}get id(){return this._id}get uri(){return this._uri}get preload(){return this._preload}set preload(e){this._preload=e}get loadingProgress(){return this._loadingProgress}get state(){return this._state}get isLoaded(){return this._state===Br.Loaded}get type(){return this._type}async load(){return window.epigraph.logger.info({title:"Loading asset..."}),new df(!0)}updateLoadingProgress(e){this._loadingProgress=e,this._appWcRef.appEvents.assetLoadProgress.fire({progress:e})}async unload(){return window.epigraph.logger.info({title:"Unloading asset..."}),new Promise(e=>{const t=new df(!0);e(t)})}}class Y1 extends fU{constructor({id:e,uri:t,preload:i,appWcRef:a}){super({id:e,uri:t,preload:i,appWcRef:a}),this._type=zf.Gltf,this._isAcceptableAsGltfAsset=!0,this.__variantsExtensionName="KHR_materials_variants",this.__variantNamesFromAsset=[],this.__resource={}}get resource(){return this.__resource}get variantsExtensionName(){return this.__variantsExtensionName}get variantsExtension(){return this.__variantsExtension}get isAcceptableAsGltfAsset(){return this._isAcceptableAsGltfAsset}get variantNamesFromAsset(){return this.__variantNamesFromAsset}highlight(){}async load(){const e=new df(!1);if(this._state===Br.Loaded||this._state===Br.Loading)return e.success=!0,e.payload=this,Promise.resolve(e);this._state=Br.Loading;const t=await this._appWcRef.assetLoaders.gltfLoader.loadAsync(this._uri,a=>{this.updateLoadingProgress(a.loaded/a.total*100)}).catch(a=>(window.epigraph.logger.groupCollapsed({title:"An error occurred while trying to load an asset!"}),window.epigraph.logger.error({title:"details",details:a}),this._state=Br.Failed,Promise.reject()));if(t===void 0)return Promise.reject(e);this.__resource=t;const i=this.__resource?.userData?.gltfExtensions;if(i&&(this.__variantsExtension=i[this.__variantsExtensionName]),this.__variantsExtension?.variants)for(const a of this.__variantsExtension.variants)this.__variantNamesFromAsset.push(a.name);return this._state=Br.Loaded,e.success=!0,e.payload=this,Promise.resolve(e)}unload(){const e=new $u(!0);return this.__resource={},this.__variantsExtension={},this.__variantNamesFromAsset=[],Promise.resolve(e)}}class pU{constructor(e){this.__loggerContext="ASSET MANAGER",this.__assets=new Map,window.epigraph.logger.info({title:"Initializing...",contextOverride:this.__loggerContext}),this.__appWcRef=e}get assets(){return this.__assets}getAssetById(e){const t=new df(!1),i=this.__assets.get(e);return i&&(t.success=!0,t.payload=i),t}getAssetGltfById(e){const t=new hU(!1),i=this.getAssetById(e);return i.success&&(t.success=!0,t.payload=i.payload),t}async loadAssetGltfConfig(e){const{id:t,uri:i,preload:a}=e,l=new Y1({id:t,uri:i,preload:a,appWcRef:this.__appWcRef});e.preload&&await l.load(),this.__assets.set(t,l)}async addAssetsFromJson(e){for(const t of e)t.type===zf.Gltf&&await this.loadAssetGltfConfig(t).catch(i=>{window.epigraph.logger.error({title:`Error adding asset: ${t}`,details:i,contextOverride:this.__loggerContext})})}}/*!
|
|
4167
4167
|
* camera-controls
|
|
4168
4168
|
* https://github.com/yomotsu/camera-controls
|
|
4169
4169
|
* (c) 2017 @yomotsu
|
|
@@ -4890,7 +4890,7 @@ ${l.join(`
|
|
|
4890
4890
|
${this.__generateMediaHtmlElemType()}
|
|
4891
4891
|
</div>
|
|
4892
4892
|
</slot>
|
|
4893
|
-
`}}Vl([he({attribute:za.mediaAlt.name})],eo.prototype,"mediaAlt");Vl([he({attribute:za.mediaSrc.name})],eo.prototype,"mediaSrc");Vl([he({attribute:za.mediaType.name})],eo.prototype,"mediaType");Vl([he({type:Boolean,attribute:za.mediaAutoplay.name})],eo.prototype,"mediaAutoplay");Vl([he({attribute:!1})],eo.prototype,"onClick");Vl([Gi()],eo.prototype,"__isPlaying");window.customElements.get(Cv)||window.customElements.define(Cv,eo);function Mv(o){return o!==null&&typeof o=="object"&&"constructor"in o&&o.constructor===Object}function p_(o,e){o===void 0&&(o={}),e===void 0&&(e={});const t=["__proto__","constructor","prototype"];Object.keys(e).filter(i=>t.indexOf(i)<0).forEach(i=>{typeof o[i]>"u"?o[i]=e[i]:Mv(e[i])&&Mv(o[i])&&Object.keys(e[i]).length>0&&p_(o[i],e[i])})}const oC={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Li(){const o=typeof document<"u"?document:{};return p_(o,oC),o}const XU={document:oC,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(o){return typeof setTimeout>"u"?(o(),null):setTimeout(o,0)},cancelAnimationFrame(o){typeof setTimeout>"u"||clearTimeout(o)}};function ti(){const o=typeof window<"u"?window:{};return p_(o,XU),o}function Sr(o){return o===void 0&&(o=""),o.trim().split(" ").filter(e=>!!e.trim())}function KU(o){const e=o;Object.keys(e).forEach(t=>{try{e[t]=null}catch{}try{delete e[t]}catch{}})}function Dl(o,e){return e===void 0&&(e=0),setTimeout(o,e)}function Vn(){return Date.now()}function JU(o){const e=ti();let t;return e.getComputedStyle&&(t=e.getComputedStyle(o,null)),!t&&o.currentStyle&&(t=o.currentStyle),t||(t=o.style),t}function HA(o,e){e===void 0&&(e="x");const t=ti();let i,a,l;const u=JU(o);return t.WebKitCSSMatrix?(a=u.transform||u.webkitTransform,a.split(",").length>6&&(a=a.split(", ").map(d=>d.replace(",",".")).join(", ")),l=new t.WebKitCSSMatrix(a==="none"?"":a)):(l=u.MozTransform||u.OTransform||u.MsTransform||u.msTransform||u.transform||u.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=l.toString().split(",")),e==="x"&&(t.WebKitCSSMatrix?a=l.m41:i.length===16?a=parseFloat(i[12]):a=parseFloat(i[4])),e==="y"&&(t.WebKitCSSMatrix?a=l.m42:i.length===16?a=parseFloat(i[13]):a=parseFloat(i[5])),a||0}function jc(o){return typeof o=="object"&&o!==null&&o.constructor&&Object.prototype.toString.call(o).slice(8,-1)==="Object"}function ZU(o){return typeof window<"u"&&typeof window.HTMLElement<"u"?o instanceof HTMLElement:o&&(o.nodeType===1||o.nodeType===11)}function In(){const o=Object(arguments.length<=0?void 0:arguments[0]),e=["__proto__","constructor","prototype"];for(let t=1;t<arguments.length;t+=1){const i=t<0||arguments.length<=t?void 0:arguments[t];if(i!=null&&!ZU(i)){const a=Object.keys(Object(i)).filter(l=>e.indexOf(l)<0);for(let l=0,u=a.length;l<u;l+=1){const d=a[l],p=Object.getOwnPropertyDescriptor(i,d);p!==void 0&&p.enumerable&&(jc(o[d])&&jc(i[d])?i[d].__swiper__?o[d]=i[d]:In(o[d],i[d]):!jc(o[d])&&jc(i[d])?(o[d]={},i[d].__swiper__?o[d]=i[d]:In(o[d],i[d])):o[d]=i[d])}}}return o}function qc(o,e,t){o.style.setProperty(e,t)}function lC(o){let{swiper:e,targetPosition:t,side:i}=o;const a=ti(),l=-e.translate;let u=null,d;const p=e.params.speed;e.wrapperEl.style.scrollSnapType="none",a.cancelAnimationFrame(e.cssModeFrameID);const m=t>l?"next":"prev",A=(b,w)=>m==="next"&&b>=w||m==="prev"&&b<=w,_=()=>{d=new Date().getTime(),u===null&&(u=d);const b=Math.max(Math.min((d-u)/p,1),0),w=.5-Math.cos(b*Math.PI)/2;let E=l+w*(t-l);if(A(E,t)&&(E=t),e.wrapperEl.scrollTo({[i]:E}),A(E,t)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[i]:E})}),a.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=a.requestAnimationFrame(_)};_()}function to(o){return o.querySelector(".swiper-slide-transform")||o.shadowRoot&&o.shadowRoot.querySelector(".swiper-slide-transform")||o}function Ui(o,e){e===void 0&&(e="");const t=ti(),i=[...o.children];return t.HTMLSlotElement&&o instanceof HTMLSlotElement&&i.push(...o.assignedElements()),e?i.filter(a=>a.matches(e)):i}function e3(o,e){const t=[e];for(;t.length>0;){const i=t.shift();if(o===i)return!0;t.push(...i.children,...i.shadowRoot?i.shadowRoot.children:[],...i.assignedElements?i.assignedElements():[])}}function t3(o,e){const t=ti();let i=e.contains(o);return!i&&t.HTMLSlotElement&&e instanceof HTMLSlotElement&&(i=[...e.assignedElements()].includes(o),i||(i=e3(o,e))),i}function gf(o){try{console.warn(o);return}catch{}}function Pn(o,e){e===void 0&&(e=[]);const t=document.createElement(o);return t.classList.add(...Array.isArray(e)?e:Sr(e)),t}function Af(o){const e=ti(),t=Li(),i=o.getBoundingClientRect(),a=t.body,l=o.clientTop||a.clientTop||0,u=o.clientLeft||a.clientLeft||0,d=o===e?e.scrollY:o.scrollTop,p=o===e?e.scrollX:o.scrollLeft;return{top:i.top+d-l,left:i.left+p-u}}function i3(o,e){const t=[];for(;o.previousElementSibling;){const i=o.previousElementSibling;e?i.matches(e)&&t.push(i):t.push(i),o=i}return t}function n3(o,e){const t=[];for(;o.nextElementSibling;){const i=o.nextElementSibling;e?i.matches(e)&&t.push(i):t.push(i),o=i}return t}function Fr(o,e){return ti().getComputedStyle(o,null).getPropertyValue(e)}function Mu(o){let e=o,t;if(e){for(t=0;(e=e.previousSibling)!==null;)e.nodeType===1&&(t+=1);return t}}function Ga(o,e){const t=[];let i=o.parentElement;for(;i;)e?i.matches(e)&&t.push(i):t.push(i),i=i.parentElement;return t}function pu(o,e){function t(i){i.target===o&&(e.call(o,i),o.removeEventListener("transitionend",t))}e&&o.addEventListener("transitionend",t)}function VA(o,e,t){const i=ti();return o[e==="width"?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(o,null).getPropertyValue(e==="width"?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(o,null).getPropertyValue(e==="width"?"margin-left":"margin-bottom"))}function At(o){return(Array.isArray(o)?o:[o]).filter(e=>!!e)}function Hf(o){return e=>Math.abs(e)>0&&o.browser&&o.browser.need3dFix&&Math.abs(e)%90===0?e+.001:e}function Yn(o,e){e===void 0&&(e=""),typeof trustedTypes<"u"?o.innerHTML=trustedTypes.createPolicy("html",{createHTML:t=>t}).createHTML(e):o.innerHTML=e}let ym;function s3(){const o=ti(),e=Li();return{smoothScroll:e.documentElement&&e.documentElement.style&&"scrollBehavior"in e.documentElement.style,touch:!!("ontouchstart"in o||o.DocumentTouch&&e instanceof o.DocumentTouch)}}function cC(){return ym||(ym=s3()),ym}let bm;function r3(o){let{userAgent:e}=o===void 0?{}:o;const t=cC(),i=ti(),a=i.navigator.platform,l=e||i.navigator.userAgent,u={ios:!1,android:!1},d=i.screen.width,p=i.screen.height,m=l.match(/(Android);?[\s\/]+([\d.]+)?/);let A=l.match(/(iPad).*OS\s([\d_]+)/);const _=l.match(/(iPod)(.*OS\s([\d_]+))?/),b=!A&&l.match(/(iPhone\sOS|iOS)\s([\d_]+)/),w=a==="Win32";let E=a==="MacIntel";const C=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!A&&E&&t.touch&&C.indexOf(`${d}x${p}`)>=0&&(A=l.match(/(Version)\/([\d.]+)/),A||(A=[0,1,"13_0_0"]),E=!1),m&&!w&&(u.os="android",u.android=!0),(A||b||_)&&(u.os="ios",u.ios=!0),u}function uC(o){return o===void 0&&(o={}),bm||(bm=r3(o)),bm}let vm;function a3(){const o=ti(),e=uC();let t=!1;function i(){const d=o.navigator.userAgent.toLowerCase();return d.indexOf("safari")>=0&&d.indexOf("chrome")<0&&d.indexOf("android")<0}if(i()){const d=String(o.navigator.userAgent);if(d.includes("Version/")){const[p,m]=d.split("Version/")[1].split(" ")[0].split(".").map(A=>Number(A));t=p<16||p===16&&m<2}}const a=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(o.navigator.userAgent),l=i(),u=l||a&&e.ios;return{isSafari:t||l,needPerspectiveFix:t,need3dFix:u,isWebView:a}}function hC(){return vm||(vm=a3()),vm}function o3(o){let{swiper:e,on:t,emit:i}=o;const a=ti();let l=null,u=null;const d=()=>{!e||e.destroyed||!e.initialized||(i("beforeResize"),i("resize"))},p=()=>{!e||e.destroyed||!e.initialized||(l=new ResizeObserver(_=>{u=a.requestAnimationFrame(()=>{const{width:b,height:w}=e;let E=b,C=w;_.forEach(T=>{let{contentBoxSize:x,contentRect:P,target:M}=T;M&&M!==e.el||(E=P?P.width:(x[0]||x).inlineSize,C=P?P.height:(x[0]||x).blockSize)}),(E!==b||C!==w)&&d()})}),l.observe(e.el))},m=()=>{u&&a.cancelAnimationFrame(u),l&&l.unobserve&&e.el&&(l.unobserve(e.el),l=null)},A=()=>{!e||e.destroyed||!e.initialized||i("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof a.ResizeObserver<"u"){p();return}a.addEventListener("resize",d),a.addEventListener("orientationchange",A)}),t("destroy",()=>{m(),a.removeEventListener("resize",d),a.removeEventListener("orientationchange",A)})}function l3(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=[],u=ti(),d=function(A,_){_===void 0&&(_={});const b=u.MutationObserver||u.WebkitMutationObserver,w=new b(E=>{if(e.__preventObserver__)return;if(E.length===1){a("observerUpdate",E[0]);return}const C=function(){a("observerUpdate",E[0])};u.requestAnimationFrame?u.requestAnimationFrame(C):u.setTimeout(C,0)});w.observe(A,{attributes:typeof _.attributes>"u"?!0:_.attributes,childList:e.isElement||(typeof _.childList>"u"?!0:_).childList,characterData:typeof _.characterData>"u"?!0:_.characterData}),l.push(w)},p=()=>{if(e.params.observer){if(e.params.observeParents){const A=Ga(e.hostEl);for(let _=0;_<A.length;_+=1)d(A[_])}d(e.hostEl,{childList:e.params.observeSlideChildren}),d(e.wrapperEl,{attributes:!1})}},m=()=>{l.forEach(A=>{A.disconnect()}),l.splice(0,l.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),i("init",p),i("destroy",m)}var c3={on(o,e,t){const i=this;if(!i.eventsListeners||i.destroyed||typeof e!="function")return i;const a=t?"unshift":"push";return o.split(" ").forEach(l=>{i.eventsListeners[l]||(i.eventsListeners[l]=[]),i.eventsListeners[l][a](e)}),i},once(o,e,t){const i=this;if(!i.eventsListeners||i.destroyed||typeof e!="function")return i;function a(){i.off(o,a),a.__emitterProxy&&delete a.__emitterProxy;for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];e.apply(i,u)}return a.__emitterProxy=e,i.on(o,a,t)},onAny(o,e){const t=this;if(!t.eventsListeners||t.destroyed||typeof o!="function")return t;const i=e?"unshift":"push";return t.eventsAnyListeners.indexOf(o)<0&&t.eventsAnyListeners[i](o),t},offAny(o){const e=this;if(!e.eventsListeners||e.destroyed||!e.eventsAnyListeners)return e;const t=e.eventsAnyListeners.indexOf(o);return t>=0&&e.eventsAnyListeners.splice(t,1),e},off(o,e){const t=this;return!t.eventsListeners||t.destroyed||!t.eventsListeners||o.split(" ").forEach(i=>{typeof e>"u"?t.eventsListeners[i]=[]:t.eventsListeners[i]&&t.eventsListeners[i].forEach((a,l)=>{(a===e||a.__emitterProxy&&a.__emitterProxy===e)&&t.eventsListeners[i].splice(l,1)})}),t},emit(){const o=this;if(!o.eventsListeners||o.destroyed||!o.eventsListeners)return o;let e,t,i;for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return typeof l[0]=="string"||Array.isArray(l[0])?(e=l[0],t=l.slice(1,l.length),i=o):(e=l[0].events,t=l[0].data,i=l[0].context||o),t.unshift(i),(Array.isArray(e)?e:e.split(" ")).forEach(p=>{o.eventsAnyListeners&&o.eventsAnyListeners.length&&o.eventsAnyListeners.forEach(m=>{m.apply(i,[p,...t])}),o.eventsListeners&&o.eventsListeners[p]&&o.eventsListeners[p].forEach(m=>{m.apply(i,t)})}),o}};function u3(){const o=this;let e,t;const i=o.el;typeof o.params.width<"u"&&o.params.width!==null?e=o.params.width:e=i.clientWidth,typeof o.params.height<"u"&&o.params.height!==null?t=o.params.height:t=i.clientHeight,!(e===0&&o.isHorizontal()||t===0&&o.isVertical())&&(e=e-parseInt(Fr(i,"padding-left")||0,10)-parseInt(Fr(i,"padding-right")||0,10),t=t-parseInt(Fr(i,"padding-top")||0,10)-parseInt(Fr(i,"padding-bottom")||0,10),Number.isNaN(e)&&(e=0),Number.isNaN(t)&&(t=0),Object.assign(o,{width:e,height:t,size:o.isHorizontal()?e:t}))}function h3(){const o=this;function e(z,Q){return parseFloat(z.getPropertyValue(o.getDirectionLabel(Q))||0)}const t=o.params,{wrapperEl:i,slidesEl:a,size:l,rtlTranslate:u,wrongRTL:d}=o,p=o.virtual&&t.virtual.enabled,m=p?o.virtual.slides.length:o.slides.length,A=Ui(a,`.${o.params.slideClass}, swiper-slide`),_=p?o.virtual.slides.length:A.length;let b=[];const w=[],E=[];let C=t.slidesOffsetBefore;typeof C=="function"&&(C=t.slidesOffsetBefore.call(o));let T=t.slidesOffsetAfter;typeof T=="function"&&(T=t.slidesOffsetAfter.call(o));const x=o.snapGrid.length,P=o.slidesGrid.length;let M=t.spaceBetween,B=-C,D=0,G=0;if(typeof l>"u")return;typeof M=="string"&&M.indexOf("%")>=0?M=parseFloat(M.replace("%",""))/100*l:typeof M=="string"&&(M=parseFloat(M)),o.virtualSize=-M,A.forEach(z=>{u?z.style.marginLeft="":z.style.marginRight="",z.style.marginBottom="",z.style.marginTop=""}),t.centeredSlides&&t.cssMode&&(qc(i,"--swiper-centered-offset-before",""),qc(i,"--swiper-centered-offset-after",""));const U=t.grid&&t.grid.rows>1&&o.grid;U?o.grid.initSlides(A):o.grid&&o.grid.unsetSlides();let V;const k=t.slidesPerView==="auto"&&t.breakpoints&&Object.keys(t.breakpoints).filter(z=>typeof t.breakpoints[z].slidesPerView<"u").length>0;for(let z=0;z<_;z+=1){V=0;let Q;if(A[z]&&(Q=A[z]),U&&o.grid.updateSlide(z,Q,A),!(A[z]&&Fr(Q,"display")==="none")){if(t.slidesPerView==="auto"){k&&(A[z].style[o.getDirectionLabel("width")]="");const Z=getComputedStyle(Q),K=Q.style.transform,s=Q.style.webkitTransform;if(K&&(Q.style.transform="none"),s&&(Q.style.webkitTransform="none"),t.roundLengths)V=o.isHorizontal()?VA(Q,"width"):VA(Q,"height");else{const H=e(Z,"width"),y=e(Z,"padding-left"),ee=e(Z,"padding-right"),I=e(Z,"margin-left"),re=e(Z,"margin-right"),Ae=Z.getPropertyValue("box-sizing");if(Ae&&Ae==="border-box")V=H+I+re;else{const{clientWidth:N,offsetWidth:n}=Q;V=H+y+ee+I+re+(n-N)}}K&&(Q.style.transform=K),s&&(Q.style.webkitTransform=s),t.roundLengths&&(V=Math.floor(V))}else V=(l-(t.slidesPerView-1)*M)/t.slidesPerView,t.roundLengths&&(V=Math.floor(V)),A[z]&&(A[z].style[o.getDirectionLabel("width")]=`${V}px`);A[z]&&(A[z].swiperSlideSize=V),E.push(V),t.centeredSlides?(B=B+V/2+D/2+M,D===0&&z!==0&&(B=B-l/2-M),z===0&&(B=B-l/2-M),Math.abs(B)<1/1e3&&(B=0),t.roundLengths&&(B=Math.floor(B)),G%t.slidesPerGroup===0&&b.push(B),w.push(B)):(t.roundLengths&&(B=Math.floor(B)),(G-Math.min(o.params.slidesPerGroupSkip,G))%o.params.slidesPerGroup===0&&b.push(B),w.push(B),B=B+V+M),o.virtualSize+=V+M,D=V,G+=1}}if(o.virtualSize=Math.max(o.virtualSize,l)+T,u&&d&&(t.effect==="slide"||t.effect==="coverflow")&&(i.style.width=`${o.virtualSize+M}px`),t.setWrapperSize&&(i.style[o.getDirectionLabel("width")]=`${o.virtualSize+M}px`),U&&o.grid.updateWrapperSize(V,b),!t.centeredSlides){const z=[];for(let Q=0;Q<b.length;Q+=1){let Z=b[Q];t.roundLengths&&(Z=Math.floor(Z)),b[Q]<=o.virtualSize-l&&z.push(Z)}b=z,Math.floor(o.virtualSize-l)-Math.floor(b[b.length-1])>1&&b.push(o.virtualSize-l)}if(p&&t.loop){const z=E[0]+M;if(t.slidesPerGroup>1){const Q=Math.ceil((o.virtual.slidesBefore+o.virtual.slidesAfter)/t.slidesPerGroup),Z=z*t.slidesPerGroup;for(let K=0;K<Q;K+=1)b.push(b[b.length-1]+Z)}for(let Q=0;Q<o.virtual.slidesBefore+o.virtual.slidesAfter;Q+=1)t.slidesPerGroup===1&&b.push(b[b.length-1]+z),w.push(w[w.length-1]+z),o.virtualSize+=z}if(b.length===0&&(b=[0]),M!==0){const z=o.isHorizontal()&&u?"marginLeft":o.getDirectionLabel("marginRight");A.filter((Q,Z)=>!t.cssMode||t.loop?!0:Z!==A.length-1).forEach(Q=>{Q.style[z]=`${M}px`})}if(t.centeredSlides&&t.centeredSlidesBounds){let z=0;E.forEach(Z=>{z+=Z+(M||0)}),z-=M;const Q=z>l?z-l:0;b=b.map(Z=>Z<=0?-C:Z>Q?Q+T:Z)}if(t.centerInsufficientSlides){let z=0;E.forEach(Z=>{z+=Z+(M||0)}),z-=M;const Q=(t.slidesOffsetBefore||0)+(t.slidesOffsetAfter||0);if(z+Q<l){const Z=(l-z-Q)/2;b.forEach((K,s)=>{b[s]=K-Z}),w.forEach((K,s)=>{w[s]=K+Z})}}if(Object.assign(o,{slides:A,snapGrid:b,slidesGrid:w,slidesSizesGrid:E}),t.centeredSlides&&t.cssMode&&!t.centeredSlidesBounds){qc(i,"--swiper-centered-offset-before",`${-b[0]}px`),qc(i,"--swiper-centered-offset-after",`${o.size/2-E[E.length-1]/2}px`);const z=-o.snapGrid[0],Q=-o.slidesGrid[0];o.snapGrid=o.snapGrid.map(Z=>Z+z),o.slidesGrid=o.slidesGrid.map(Z=>Z+Q)}if(_!==m&&o.emit("slidesLengthChange"),b.length!==x&&(o.params.watchOverflow&&o.checkOverflow(),o.emit("snapGridLengthChange")),w.length!==P&&o.emit("slidesGridLengthChange"),t.watchSlidesProgress&&o.updateSlidesOffset(),o.emit("slidesUpdated"),!p&&!t.cssMode&&(t.effect==="slide"||t.effect==="fade")){const z=`${t.containerModifierClass}backface-hidden`,Q=o.el.classList.contains(z);_<=t.maxBackfaceHiddenSlides?Q||o.el.classList.add(z):Q&&o.el.classList.remove(z)}}function d3(o){const e=this,t=[],i=e.virtual&&e.params.virtual.enabled;let a=0,l;typeof o=="number"?e.setTransition(o):o===!0&&e.setTransition(e.params.speed);const u=d=>i?e.slides[e.getSlideIndexByData(d)]:e.slides[d];if(e.params.slidesPerView!=="auto"&&e.params.slidesPerView>1)if(e.params.centeredSlides)(e.visibleSlides||[]).forEach(d=>{t.push(d)});else for(l=0;l<Math.ceil(e.params.slidesPerView);l+=1){const d=e.activeIndex+l;if(d>e.slides.length&&!i)break;t.push(u(d))}else t.push(u(e.activeIndex));for(l=0;l<t.length;l+=1)if(typeof t[l]<"u"){const d=t[l].offsetHeight;a=d>a?d:a}(a||a===0)&&(e.wrapperEl.style.height=`${a}px`)}function f3(){const o=this,e=o.slides,t=o.isElement?o.isHorizontal()?o.wrapperEl.offsetLeft:o.wrapperEl.offsetTop:0;for(let i=0;i<e.length;i+=1)e[i].swiperSlideOffset=(o.isHorizontal()?e[i].offsetLeft:e[i].offsetTop)-t-o.cssOverflowAdjustment()}const Rv=(o,e,t)=>{e&&!o.classList.contains(t)?o.classList.add(t):!e&&o.classList.contains(t)&&o.classList.remove(t)};function p3(o){o===void 0&&(o=this&&this.translate||0);const e=this,t=e.params,{slides:i,rtlTranslate:a,snapGrid:l}=e;if(i.length===0)return;typeof i[0].swiperSlideOffset>"u"&&e.updateSlidesOffset();let u=-o;a&&(u=o),e.visibleSlidesIndexes=[],e.visibleSlides=[];let d=t.spaceBetween;typeof d=="string"&&d.indexOf("%")>=0?d=parseFloat(d.replace("%",""))/100*e.size:typeof d=="string"&&(d=parseFloat(d));for(let p=0;p<i.length;p+=1){const m=i[p];let A=m.swiperSlideOffset;t.cssMode&&t.centeredSlides&&(A-=i[0].swiperSlideOffset);const _=(u+(t.centeredSlides?e.minTranslate():0)-A)/(m.swiperSlideSize+d),b=(u-l[0]+(t.centeredSlides?e.minTranslate():0)-A)/(m.swiperSlideSize+d),w=-(u-A),E=w+e.slidesSizesGrid[p],C=w>=0&&w<=e.size-e.slidesSizesGrid[p],T=w>=0&&w<e.size-1||E>1&&E<=e.size||w<=0&&E>=e.size;T&&(e.visibleSlides.push(m),e.visibleSlidesIndexes.push(p)),Rv(m,T,t.slideVisibleClass),Rv(m,C,t.slideFullyVisibleClass),m.progress=a?-_:_,m.originalProgress=a?-b:b}}function m3(o){const e=this;if(typeof o>"u"){const A=e.rtlTranslate?-1:1;o=e&&e.translate&&e.translate*A||0}const t=e.params,i=e.maxTranslate()-e.minTranslate();let{progress:a,isBeginning:l,isEnd:u,progressLoop:d}=e;const p=l,m=u;if(i===0)a=0,l=!0,u=!0;else{a=(o-e.minTranslate())/i;const A=Math.abs(o-e.minTranslate())<1,_=Math.abs(o-e.maxTranslate())<1;l=A||a<=0,u=_||a>=1,A&&(a=0),_&&(a=1)}if(t.loop){const A=e.getSlideIndexByData(0),_=e.getSlideIndexByData(e.slides.length-1),b=e.slidesGrid[A],w=e.slidesGrid[_],E=e.slidesGrid[e.slidesGrid.length-1],C=Math.abs(o);C>=b?d=(C-b)/E:d=(C+E-w)/E,d>1&&(d-=1)}Object.assign(e,{progress:a,progressLoop:d,isBeginning:l,isEnd:u}),(t.watchSlidesProgress||t.centeredSlides&&t.autoHeight)&&e.updateSlidesProgress(o),l&&!p&&e.emit("reachBeginning toEdge"),u&&!m&&e.emit("reachEnd toEdge"),(p&&!l||m&&!u)&&e.emit("fromEdge"),e.emit("progress",a)}const wm=(o,e,t)=>{e&&!o.classList.contains(t)?o.classList.add(t):!e&&o.classList.contains(t)&&o.classList.remove(t)};function g3(){const o=this,{slides:e,params:t,slidesEl:i,activeIndex:a}=o,l=o.virtual&&t.virtual.enabled,u=o.grid&&t.grid&&t.grid.rows>1,d=_=>Ui(i,`.${t.slideClass}${_}, swiper-slide${_}`)[0];let p,m,A;if(l)if(t.loop){let _=a-o.virtual.slidesBefore;_<0&&(_=o.virtual.slides.length+_),_>=o.virtual.slides.length&&(_-=o.virtual.slides.length),p=d(`[data-swiper-slide-index="${_}"]`)}else p=d(`[data-swiper-slide-index="${a}"]`);else u?(p=e.find(_=>_.column===a),A=e.find(_=>_.column===a+1),m=e.find(_=>_.column===a-1)):p=e[a];p&&(u||(A=n3(p,`.${t.slideClass}, swiper-slide`)[0],t.loop&&!A&&(A=e[0]),m=i3(p,`.${t.slideClass}, swiper-slide`)[0],t.loop&&!m===0&&(m=e[e.length-1]))),e.forEach(_=>{wm(_,_===p,t.slideActiveClass),wm(_,_===A,t.slideNextClass),wm(_,_===m,t.slidePrevClass)}),o.emitSlidesClasses()}const Td=(o,e)=>{if(!o||o.destroyed||!o.params)return;const t=()=>o.isElement?"swiper-slide":`.${o.params.slideClass}`,i=e.closest(t());if(i){let a=i.querySelector(`.${o.params.lazyPreloaderClass}`);!a&&o.isElement&&(i.shadowRoot?a=i.shadowRoot.querySelector(`.${o.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{i.shadowRoot&&(a=i.shadowRoot.querySelector(`.${o.params.lazyPreloaderClass}`),a&&a.remove())})),a&&a.remove()}},Em=(o,e)=>{if(!o.slides[e])return;const t=o.slides[e].querySelector('[loading="lazy"]');t&&t.removeAttribute("loading")},QA=o=>{if(!o||o.destroyed||!o.params)return;let e=o.params.lazyPreloadPrevNext;const t=o.slides.length;if(!t||!e||e<0)return;e=Math.min(e,t);const i=o.params.slidesPerView==="auto"?o.slidesPerViewDynamic():Math.ceil(o.params.slidesPerView),a=o.activeIndex;if(o.params.grid&&o.params.grid.rows>1){const u=a,d=[u-e];d.push(...Array.from({length:e}).map((p,m)=>u+i+m)),o.slides.forEach((p,m)=>{d.includes(p.column)&&Em(o,m)});return}const l=a+i-1;if(o.params.rewind||o.params.loop)for(let u=a-e;u<=l+e;u+=1){const d=(u%t+t)%t;(d<a||d>l)&&Em(o,d)}else for(let u=Math.max(a-e,0);u<=Math.min(l+e,t-1);u+=1)u!==a&&(u>l||u<a)&&Em(o,u)};function A3(o){const{slidesGrid:e,params:t}=o,i=o.rtlTranslate?o.translate:-o.translate;let a;for(let l=0;l<e.length;l+=1)typeof e[l+1]<"u"?i>=e[l]&&i<e[l+1]-(e[l+1]-e[l])/2?a=l:i>=e[l]&&i<e[l+1]&&(a=l+1):i>=e[l]&&(a=l);return t.normalizeSlideIndex&&(a<0||typeof a>"u")&&(a=0),a}function _3(o){const e=this,t=e.rtlTranslate?e.translate:-e.translate,{snapGrid:i,params:a,activeIndex:l,realIndex:u,snapIndex:d}=e;let p=o,m;const A=w=>{let E=w-e.virtual.slidesBefore;return E<0&&(E=e.virtual.slides.length+E),E>=e.virtual.slides.length&&(E-=e.virtual.slides.length),E};if(typeof p>"u"&&(p=A3(e)),i.indexOf(t)>=0)m=i.indexOf(t);else{const w=Math.min(a.slidesPerGroupSkip,p);m=w+Math.floor((p-w)/a.slidesPerGroup)}if(m>=i.length&&(m=i.length-1),p===l&&!e.params.loop){m!==d&&(e.snapIndex=m,e.emit("snapIndexChange"));return}if(p===l&&e.params.loop&&e.virtual&&e.params.virtual.enabled){e.realIndex=A(p);return}const _=e.grid&&a.grid&&a.grid.rows>1;let b;if(e.virtual&&a.virtual.enabled&&a.loop)b=A(p);else if(_){const w=e.slides.find(C=>C.column===p);let E=parseInt(w.getAttribute("data-swiper-slide-index"),10);Number.isNaN(E)&&(E=Math.max(e.slides.indexOf(w),0)),b=Math.floor(E/a.grid.rows)}else if(e.slides[p]){const w=e.slides[p].getAttribute("data-swiper-slide-index");w?b=parseInt(w,10):b=p}else b=p;Object.assign(e,{previousSnapIndex:d,snapIndex:m,previousRealIndex:u,realIndex:b,previousIndex:l,activeIndex:p}),e.initialized&&QA(e),e.emit("activeIndexChange"),e.emit("snapIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&(u!==b&&e.emit("realIndexChange"),e.emit("slideChange"))}function y3(o,e){const t=this,i=t.params;let a=o.closest(`.${i.slideClass}, swiper-slide`);!a&&t.isElement&&e&&e.length>1&&e.includes(o)&&[...e.slice(e.indexOf(o)+1,e.length)].forEach(d=>{!a&&d.matches&&d.matches(`.${i.slideClass}, swiper-slide`)&&(a=d)});let l=!1,u;if(a){for(let d=0;d<t.slides.length;d+=1)if(t.slides[d]===a){l=!0,u=d;break}}if(a&&l)t.clickedSlide=a,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(a.getAttribute("data-swiper-slide-index"),10):t.clickedIndex=u;else{t.clickedSlide=void 0,t.clickedIndex=void 0;return}i.slideToClickedSlide&&t.clickedIndex!==void 0&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}var b3={updateSize:u3,updateSlides:h3,updateAutoHeight:d3,updateSlidesOffset:f3,updateSlidesProgress:p3,updateProgress:m3,updateSlidesClasses:g3,updateActiveIndex:_3,updateClickedSlide:y3};function v3(o){o===void 0&&(o=this.isHorizontal()?"x":"y");const e=this,{params:t,rtlTranslate:i,translate:a,wrapperEl:l}=e;if(t.virtualTranslate)return i?-a:a;if(t.cssMode)return a;let u=HA(l,o);return u+=e.cssOverflowAdjustment(),i&&(u=-u),u||0}function w3(o,e){const t=this,{rtlTranslate:i,params:a,wrapperEl:l,progress:u}=t;let d=0,p=0;const m=0;t.isHorizontal()?d=i?-o:o:p=o,a.roundLengths&&(d=Math.floor(d),p=Math.floor(p)),t.previousTranslate=t.translate,t.translate=t.isHorizontal()?d:p,a.cssMode?l[t.isHorizontal()?"scrollLeft":"scrollTop"]=t.isHorizontal()?-d:-p:a.virtualTranslate||(t.isHorizontal()?d-=t.cssOverflowAdjustment():p-=t.cssOverflowAdjustment(),l.style.transform=`translate3d(${d}px, ${p}px, ${m}px)`);let A;const _=t.maxTranslate()-t.minTranslate();_===0?A=0:A=(o-t.minTranslate())/_,A!==u&&t.updateProgress(o),t.emit("setTranslate",t.translate,e)}function E3(){return-this.snapGrid[0]}function x3(){return-this.snapGrid[this.snapGrid.length-1]}function S3(o,e,t,i,a){o===void 0&&(o=0),e===void 0&&(e=this.params.speed),t===void 0&&(t=!0),i===void 0&&(i=!0);const l=this,{params:u,wrapperEl:d}=l;if(l.animating&&u.preventInteractionOnTransition)return!1;const p=l.minTranslate(),m=l.maxTranslate();let A;if(i&&o>p?A=p:i&&o<m?A=m:A=o,l.updateProgress(A),u.cssMode){const _=l.isHorizontal();if(e===0)d[_?"scrollLeft":"scrollTop"]=-A;else{if(!l.support.smoothScroll)return lC({swiper:l,targetPosition:-A,side:_?"left":"top"}),!0;d.scrollTo({[_?"left":"top"]:-A,behavior:"smooth"})}return!0}return e===0?(l.setTransition(0),l.setTranslate(A),t&&(l.emit("beforeTransitionStart",e,a),l.emit("transitionEnd"))):(l.setTransition(e),l.setTranslate(A),t&&(l.emit("beforeTransitionStart",e,a),l.emit("transitionStart")),l.animating||(l.animating=!0,l.onTranslateToWrapperTransitionEnd||(l.onTranslateToWrapperTransitionEnd=function(b){!l||l.destroyed||b.target===this&&(l.wrapperEl.removeEventListener("transitionend",l.onTranslateToWrapperTransitionEnd),l.onTranslateToWrapperTransitionEnd=null,delete l.onTranslateToWrapperTransitionEnd,l.animating=!1,t&&l.emit("transitionEnd"))}),l.wrapperEl.addEventListener("transitionend",l.onTranslateToWrapperTransitionEnd))),!0}var C3={getTranslate:v3,setTranslate:w3,minTranslate:E3,maxTranslate:x3,translateTo:S3};function T3(o,e){const t=this;t.params.cssMode||(t.wrapperEl.style.transitionDuration=`${o}ms`,t.wrapperEl.style.transitionDelay=o===0?"0ms":""),t.emit("setTransition",o,e)}function dC(o){let{swiper:e,runCallbacks:t,direction:i,step:a}=o;const{activeIndex:l,previousIndex:u}=e;let d=i;d||(l>u?d="next":l<u?d="prev":d="reset"),e.emit(`transition${a}`),t&&d==="reset"?e.emit(`slideResetTransition${a}`):t&&l!==u&&(e.emit(`slideChangeTransition${a}`),d==="next"?e.emit(`slideNextTransition${a}`):e.emit(`slidePrevTransition${a}`))}function I3(o,e){o===void 0&&(o=!0);const t=this,{params:i}=t;i.cssMode||(i.autoHeight&&t.updateAutoHeight(),dC({swiper:t,runCallbacks:o,direction:e,step:"Start"}))}function M3(o,e){o===void 0&&(o=!0);const t=this,{params:i}=t;t.animating=!1,!i.cssMode&&(t.setTransition(0),dC({swiper:t,runCallbacks:o,direction:e,step:"End"}))}var R3={setTransition:T3,transitionStart:I3,transitionEnd:M3};function B3(o,e,t,i,a){o===void 0&&(o=0),t===void 0&&(t=!0),typeof o=="string"&&(o=parseInt(o,10));const l=this;let u=o;u<0&&(u=0);const{params:d,snapGrid:p,slidesGrid:m,previousIndex:A,activeIndex:_,rtlTranslate:b,wrapperEl:w,enabled:E}=l;if(!E&&!i&&!a||l.destroyed||l.animating&&d.preventInteractionOnTransition)return!1;typeof e>"u"&&(e=l.params.speed);const C=Math.min(l.params.slidesPerGroupSkip,u);let T=C+Math.floor((u-C)/l.params.slidesPerGroup);T>=p.length&&(T=p.length-1);const x=-p[T];if(d.normalizeSlideIndex)for(let U=0;U<m.length;U+=1){const V=-Math.floor(x*100),k=Math.floor(m[U]*100),z=Math.floor(m[U+1]*100);typeof m[U+1]<"u"?V>=k&&V<z-(z-k)/2?u=U:V>=k&&V<z&&(u=U+1):V>=k&&(u=U)}if(l.initialized&&u!==_&&(!l.allowSlideNext&&(b?x>l.translate&&x>l.minTranslate():x<l.translate&&x<l.minTranslate())||!l.allowSlidePrev&&x>l.translate&&x>l.maxTranslate()&&(_||0)!==u))return!1;u!==(A||0)&&t&&l.emit("beforeSlideChangeStart"),l.updateProgress(x);let P;u>_?P="next":u<_?P="prev":P="reset";const M=l.virtual&&l.params.virtual.enabled;if(!(M&&a)&&(b&&-x===l.translate||!b&&x===l.translate))return l.updateActiveIndex(u),d.autoHeight&&l.updateAutoHeight(),l.updateSlidesClasses(),d.effect!=="slide"&&l.setTranslate(x),P!=="reset"&&(l.transitionStart(t,P),l.transitionEnd(t,P)),!1;if(d.cssMode){const U=l.isHorizontal(),V=b?x:-x;if(e===0)M&&(l.wrapperEl.style.scrollSnapType="none",l._immediateVirtual=!0),M&&!l._cssModeVirtualInitialSet&&l.params.initialSlide>0?(l._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{w[U?"scrollLeft":"scrollTop"]=V})):w[U?"scrollLeft":"scrollTop"]=V,M&&requestAnimationFrame(()=>{l.wrapperEl.style.scrollSnapType="",l._immediateVirtual=!1});else{if(!l.support.smoothScroll)return lC({swiper:l,targetPosition:V,side:U?"left":"top"}),!0;w.scrollTo({[U?"left":"top"]:V,behavior:"smooth"})}return!0}const G=hC().isSafari;return M&&!a&&G&&l.isElement&&l.virtual.update(!1,!1,u),l.setTransition(e),l.setTranslate(x),l.updateActiveIndex(u),l.updateSlidesClasses(),l.emit("beforeTransitionStart",e,i),l.transitionStart(t,P),e===0?l.transitionEnd(t,P):l.animating||(l.animating=!0,l.onSlideToWrapperTransitionEnd||(l.onSlideToWrapperTransitionEnd=function(V){!l||l.destroyed||V.target===this&&(l.wrapperEl.removeEventListener("transitionend",l.onSlideToWrapperTransitionEnd),l.onSlideToWrapperTransitionEnd=null,delete l.onSlideToWrapperTransitionEnd,l.transitionEnd(t,P))}),l.wrapperEl.addEventListener("transitionend",l.onSlideToWrapperTransitionEnd)),!0}function P3(o,e,t,i){o===void 0&&(o=0),t===void 0&&(t=!0),typeof o=="string"&&(o=parseInt(o,10));const a=this;if(a.destroyed)return;typeof e>"u"&&(e=a.params.speed);const l=a.grid&&a.params.grid&&a.params.grid.rows>1;let u=o;if(a.params.loop)if(a.virtual&&a.params.virtual.enabled)u=u+a.virtual.slidesBefore;else{let d;if(l){const b=u*a.params.grid.rows;d=a.slides.find(w=>w.getAttribute("data-swiper-slide-index")*1===b).column}else d=a.getSlideIndexByData(u);const p=l?Math.ceil(a.slides.length/a.params.grid.rows):a.slides.length,{centeredSlides:m}=a.params;let A=a.params.slidesPerView;A==="auto"?A=a.slidesPerViewDynamic():(A=Math.ceil(parseFloat(a.params.slidesPerView,10)),m&&A%2===0&&(A=A+1));let _=p-d<A;if(m&&(_=_||d<Math.ceil(A/2)),i&&m&&a.params.slidesPerView!=="auto"&&!l&&(_=!1),_){const b=m?d<a.activeIndex?"prev":"next":d-a.activeIndex-1<a.params.slidesPerView?"next":"prev";a.loopFix({direction:b,slideTo:!0,activeSlideIndex:b==="next"?d+1:d-p+1,slideRealIndex:b==="next"?a.realIndex:void 0})}if(l){const b=u*a.params.grid.rows;u=a.slides.find(w=>w.getAttribute("data-swiper-slide-index")*1===b).column}else u=a.getSlideIndexByData(u)}return requestAnimationFrame(()=>{a.slideTo(u,e,t,i)}),a}function L3(o,e,t){e===void 0&&(e=!0);const i=this,{enabled:a,params:l,animating:u}=i;if(!a||i.destroyed)return i;typeof o>"u"&&(o=i.params.speed);let d=l.slidesPerGroup;l.slidesPerView==="auto"&&l.slidesPerGroup===1&&l.slidesPerGroupAuto&&(d=Math.max(i.slidesPerViewDynamic("current",!0),1));const p=i.activeIndex<l.slidesPerGroupSkip?1:d,m=i.virtual&&l.virtual.enabled;if(l.loop){if(u&&!m&&l.loopPreventsSliding)return!1;if(i.loopFix({direction:"next"}),i._clientLeft=i.wrapperEl.clientLeft,i.activeIndex===i.slides.length-1&&l.cssMode)return requestAnimationFrame(()=>{i.slideTo(i.activeIndex+p,o,e,t)}),!0}return l.rewind&&i.isEnd?i.slideTo(0,o,e,t):i.slideTo(i.activeIndex+p,o,e,t)}function D3(o,e,t){e===void 0&&(e=!0);const i=this,{params:a,snapGrid:l,slidesGrid:u,rtlTranslate:d,enabled:p,animating:m}=i;if(!p||i.destroyed)return i;typeof o>"u"&&(o=i.params.speed);const A=i.virtual&&a.virtual.enabled;if(a.loop){if(m&&!A&&a.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}const _=d?i.translate:-i.translate;function b(P){return P<0?-Math.floor(Math.abs(P)):Math.floor(P)}const w=b(_),E=l.map(P=>b(P)),C=a.freeMode&&a.freeMode.enabled;let T=l[E.indexOf(w)-1];if(typeof T>"u"&&(a.cssMode||C)){let P;l.forEach((M,B)=>{w>=M&&(P=B)}),typeof P<"u"&&(T=C?l[P]:l[P>0?P-1:P])}let x=0;if(typeof T<"u"&&(x=u.indexOf(T),x<0&&(x=i.activeIndex-1),a.slidesPerView==="auto"&&a.slidesPerGroup===1&&a.slidesPerGroupAuto&&(x=x-i.slidesPerViewDynamic("previous",!0)+1,x=Math.max(x,0))),a.rewind&&i.isBeginning){const P=i.params.virtual&&i.params.virtual.enabled&&i.virtual?i.virtual.slides.length-1:i.slides.length-1;return i.slideTo(P,o,e,t)}else if(a.loop&&i.activeIndex===0&&a.cssMode)return requestAnimationFrame(()=>{i.slideTo(x,o,e,t)}),!0;return i.slideTo(x,o,e,t)}function N3(o,e,t){e===void 0&&(e=!0);const i=this;if(!i.destroyed)return typeof o>"u"&&(o=i.params.speed),i.slideTo(i.activeIndex,o,e,t)}function O3(o,e,t,i){e===void 0&&(e=!0),i===void 0&&(i=.5);const a=this;if(a.destroyed)return;typeof o>"u"&&(o=a.params.speed);let l=a.activeIndex;const u=Math.min(a.params.slidesPerGroupSkip,l),d=u+Math.floor((l-u)/a.params.slidesPerGroup),p=a.rtlTranslate?a.translate:-a.translate;if(p>=a.snapGrid[d]){const m=a.snapGrid[d],A=a.snapGrid[d+1];p-m>(A-m)*i&&(l+=a.params.slidesPerGroup)}else{const m=a.snapGrid[d-1],A=a.snapGrid[d];p-m<=(A-m)*i&&(l-=a.params.slidesPerGroup)}return l=Math.max(l,0),l=Math.min(l,a.slidesGrid.length-1),a.slideTo(l,o,e,t)}function k3(){const o=this;if(o.destroyed)return;const{params:e,slidesEl:t}=o,i=e.slidesPerView==="auto"?o.slidesPerViewDynamic():e.slidesPerView;let a=o.getSlideIndexWhenGrid(o.clickedIndex),l;const u=o.isElement?"swiper-slide":`.${e.slideClass}`,d=o.grid&&o.params.grid&&o.params.grid.rows>1;if(e.loop){if(o.animating)return;l=parseInt(o.clickedSlide.getAttribute("data-swiper-slide-index"),10),e.centeredSlides?o.slideToLoop(l):a>(d?(o.slides.length-i)/2-(o.params.grid.rows-1):o.slides.length-i)?(o.loopFix(),a=o.getSlideIndex(Ui(t,`${u}[data-swiper-slide-index="${l}"]`)[0]),Dl(()=>{o.slideTo(a)})):o.slideTo(a)}else o.slideTo(a)}var U3={slideTo:B3,slideToLoop:P3,slideNext:L3,slidePrev:D3,slideReset:N3,slideToClosest:O3,slideToClickedSlide:k3};function F3(o,e){const t=this,{params:i,slidesEl:a}=t;if(!i.loop||t.virtual&&t.params.virtual.enabled)return;const l=()=>{Ui(a,`.${i.slideClass}, swiper-slide`).forEach((w,E)=>{w.setAttribute("data-swiper-slide-index",E)})},u=()=>{const b=Ui(a,`.${i.slideBlankClass}`);b.forEach(w=>{w.remove()}),b.length>0&&(t.recalcSlides(),t.updateSlides())},d=t.grid&&i.grid&&i.grid.rows>1;i.loopAddBlankSlides&&(i.slidesPerGroup>1||d)&&u();const p=i.slidesPerGroup*(d?i.grid.rows:1),m=t.slides.length%p!==0,A=d&&t.slides.length%i.grid.rows!==0,_=b=>{for(let w=0;w<b;w+=1){const E=t.isElement?Pn("swiper-slide",[i.slideBlankClass]):Pn("div",[i.slideClass,i.slideBlankClass]);t.slidesEl.append(E)}};if(m){if(i.loopAddBlankSlides){const b=p-t.slides.length%p;_(b),t.recalcSlides(),t.updateSlides()}else gf("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");l()}else if(A){if(i.loopAddBlankSlides){const b=i.grid.rows-t.slides.length%i.grid.rows;_(b),t.recalcSlides(),t.updateSlides()}else gf("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");l()}else l();t.loopFix({slideRealIndex:o,direction:i.centeredSlides?void 0:"next",initial:e})}function $3(o){let{slideRealIndex:e,slideTo:t=!0,direction:i,setTranslate:a,activeSlideIndex:l,initial:u,byController:d,byMousewheel:p}=o===void 0?{}:o;const m=this;if(!m.params.loop)return;m.emit("beforeLoopFix");const{slides:A,allowSlidePrev:_,allowSlideNext:b,slidesEl:w,params:E}=m,{centeredSlides:C,initialSlide:T}=E;if(m.allowSlidePrev=!0,m.allowSlideNext=!0,m.virtual&&E.virtual.enabled){t&&(!E.centeredSlides&&m.snapIndex===0?m.slideTo(m.virtual.slides.length,0,!1,!0):E.centeredSlides&&m.snapIndex<E.slidesPerView?m.slideTo(m.virtual.slides.length+m.snapIndex,0,!1,!0):m.snapIndex===m.snapGrid.length-1&&m.slideTo(m.virtual.slidesBefore,0,!1,!0)),m.allowSlidePrev=_,m.allowSlideNext=b,m.emit("loopFix");return}let x=E.slidesPerView;x==="auto"?x=m.slidesPerViewDynamic():(x=Math.ceil(parseFloat(E.slidesPerView,10)),C&&x%2===0&&(x=x+1));const P=E.slidesPerGroupAuto?x:E.slidesPerGroup;let M=C?Math.max(P,Math.ceil(x/2)):P;M%P!==0&&(M+=P-M%P),M+=E.loopAdditionalSlides,m.loopedSlides=M;const B=m.grid&&E.grid&&E.grid.rows>1;A.length<x+M||m.params.effect==="cards"&&A.length<x+M*2?gf("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):B&&E.grid.fill==="row"&&gf("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const D=[],G=[],U=B?Math.ceil(A.length/E.grid.rows):A.length,V=u&&U-T<x&&!C;let k=V?T:m.activeIndex;typeof l>"u"?l=m.getSlideIndex(A.find(y=>y.classList.contains(E.slideActiveClass))):k=l;const z=i==="next"||!i,Q=i==="prev"||!i;let Z=0,K=0;const H=(B?A[l].column:l)+(C&&typeof a>"u"?-x/2+.5:0);if(H<M){Z=Math.max(M-H,P);for(let y=0;y<M-H;y+=1){const ee=y-Math.floor(y/U)*U;if(B){const I=U-ee-1;for(let re=A.length-1;re>=0;re-=1)A[re].column===I&&D.push(re)}else D.push(U-ee-1)}}else if(H+x>U-M){K=Math.max(H-(U-M*2),P),V&&(K=Math.max(K,x-U+T+1));for(let y=0;y<K;y+=1){const ee=y-Math.floor(y/U)*U;B?A.forEach((I,re)=>{I.column===ee&&G.push(re)}):G.push(ee)}}if(m.__preventObserver__=!0,requestAnimationFrame(()=>{m.__preventObserver__=!1}),m.params.effect==="cards"&&A.length<x+M*2&&(G.includes(l)&&G.splice(G.indexOf(l),1),D.includes(l)&&D.splice(D.indexOf(l),1)),Q&&D.forEach(y=>{A[y].swiperLoopMoveDOM=!0,w.prepend(A[y]),A[y].swiperLoopMoveDOM=!1}),z&&G.forEach(y=>{A[y].swiperLoopMoveDOM=!0,w.append(A[y]),A[y].swiperLoopMoveDOM=!1}),m.recalcSlides(),E.slidesPerView==="auto"?m.updateSlides():B&&(D.length>0&&Q||G.length>0&&z)&&m.slides.forEach((y,ee)=>{m.grid.updateSlide(ee,y,m.slides)}),E.watchSlidesProgress&&m.updateSlidesOffset(),t){if(D.length>0&&Q){if(typeof e>"u"){const y=m.slidesGrid[k],I=m.slidesGrid[k+Z]-y;p?m.setTranslate(m.translate-I):(m.slideTo(k+Math.ceil(Z),0,!1,!0),a&&(m.touchEventsData.startTranslate=m.touchEventsData.startTranslate-I,m.touchEventsData.currentTranslate=m.touchEventsData.currentTranslate-I))}else if(a){const y=B?D.length/E.grid.rows:D.length;m.slideTo(m.activeIndex+y,0,!1,!0),m.touchEventsData.currentTranslate=m.translate}}else if(G.length>0&&z)if(typeof e>"u"){const y=m.slidesGrid[k],I=m.slidesGrid[k-K]-y;p?m.setTranslate(m.translate-I):(m.slideTo(k-K,0,!1,!0),a&&(m.touchEventsData.startTranslate=m.touchEventsData.startTranslate-I,m.touchEventsData.currentTranslate=m.touchEventsData.currentTranslate-I))}else{const y=B?G.length/E.grid.rows:G.length;m.slideTo(m.activeIndex-y,0,!1,!0)}}if(m.allowSlidePrev=_,m.allowSlideNext=b,m.controller&&m.controller.control&&!d){const y={slideRealIndex:e,direction:i,setTranslate:a,activeSlideIndex:l,byController:!0};Array.isArray(m.controller.control)?m.controller.control.forEach(ee=>{!ee.destroyed&&ee.params.loop&&ee.loopFix({...y,slideTo:ee.params.slidesPerView===E.slidesPerView?t:!1})}):m.controller.control instanceof m.constructor&&m.controller.control.params.loop&&m.controller.control.loopFix({...y,slideTo:m.controller.control.params.slidesPerView===E.slidesPerView?t:!1})}m.emit("loopFix")}function z3(){const o=this,{params:e,slidesEl:t}=o;if(!e.loop||!t||o.virtual&&o.params.virtual.enabled)return;o.recalcSlides();const i=[];o.slides.forEach(a=>{const l=typeof a.swiperSlideIndex>"u"?a.getAttribute("data-swiper-slide-index")*1:a.swiperSlideIndex;i[l]=a}),o.slides.forEach(a=>{a.removeAttribute("data-swiper-slide-index")}),i.forEach(a=>{t.append(a)}),o.recalcSlides(),o.slideTo(o.realIndex,0)}var G3={loopCreate:F3,loopFix:$3,loopDestroy:z3};function H3(o){const e=this;if(!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const t=e.params.touchEventsTarget==="container"?e.el:e.wrapperEl;e.isElement&&(e.__preventObserver__=!0),t.style.cursor="move",t.style.cursor=o?"grabbing":"grab",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1})}function V3(){const o=this;o.params.watchOverflow&&o.isLocked||o.params.cssMode||(o.isElement&&(o.__preventObserver__=!0),o[o.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",o.isElement&&requestAnimationFrame(()=>{o.__preventObserver__=!1}))}var Q3={setGrabCursor:H3,unsetGrabCursor:V3};function j3(o,e){e===void 0&&(e=this);function t(i){if(!i||i===Li()||i===ti())return null;i.assignedSlot&&(i=i.assignedSlot);const a=i.closest(o);return!a&&!i.getRootNode?null:a||t(i.getRootNode().host)}return t(e)}function Bv(o,e,t){const i=ti(),{params:a}=o,l=a.edgeSwipeDetection,u=a.edgeSwipeThreshold;return l&&(t<=u||t>=i.innerWidth-u)?l==="prevent"?(e.preventDefault(),!0):!1:!0}function q3(o){const e=this,t=Li();let i=o;i.originalEvent&&(i=i.originalEvent);const a=e.touchEventsData;if(i.type==="pointerdown"){if(a.pointerId!==null&&a.pointerId!==i.pointerId)return;a.pointerId=i.pointerId}else i.type==="touchstart"&&i.targetTouches.length===1&&(a.touchId=i.targetTouches[0].identifier);if(i.type==="touchstart"){Bv(e,i,i.targetTouches[0].pageX);return}const{params:l,touches:u,enabled:d}=e;if(!d||!l.simulateTouch&&i.pointerType==="mouse"||e.animating&&l.preventInteractionOnTransition)return;!e.animating&&l.cssMode&&l.loop&&e.loopFix();let p=i.target;if(l.touchEventsTarget==="wrapper"&&!t3(p,e.wrapperEl)||"which"in i&&i.which===3||"button"in i&&i.button>0||a.isTouched&&a.isMoved)return;const m=!!l.noSwipingClass&&l.noSwipingClass!=="",A=i.composedPath?i.composedPath():i.path;m&&i.target&&i.target.shadowRoot&&A&&(p=A[0]);const _=l.noSwipingSelector?l.noSwipingSelector:`.${l.noSwipingClass}`,b=!!(i.target&&i.target.shadowRoot);if(l.noSwiping&&(b?j3(_,p):p.closest(_))){e.allowClick=!0;return}if(l.swipeHandler&&!p.closest(l.swipeHandler))return;u.currentX=i.pageX,u.currentY=i.pageY;const w=u.currentX,E=u.currentY;if(!Bv(e,i,w))return;Object.assign(a,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),u.startX=w,u.startY=E,a.touchStartTime=Vn(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,l.threshold>0&&(a.allowThresholdMove=!1);let C=!0;p.matches(a.focusableElements)&&(C=!1,p.nodeName==="SELECT"&&(a.isTouched=!1)),t.activeElement&&t.activeElement.matches(a.focusableElements)&&t.activeElement!==p&&(i.pointerType==="mouse"||i.pointerType!=="mouse"&&!p.matches(a.focusableElements))&&t.activeElement.blur();const T=C&&e.allowTouchMove&&l.touchStartPreventDefault;(l.touchStartForcePreventDefault||T)&&!p.isContentEditable&&i.preventDefault(),l.freeMode&&l.freeMode.enabled&&e.freeMode&&e.animating&&!l.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",i)}function W3(o){const e=Li(),t=this,i=t.touchEventsData,{params:a,touches:l,rtlTranslate:u,enabled:d}=t;if(!d||!a.simulateTouch&&o.pointerType==="mouse")return;let p=o;if(p.originalEvent&&(p=p.originalEvent),p.type==="pointermove"&&(i.touchId!==null||p.pointerId!==i.pointerId))return;let m;if(p.type==="touchmove"){if(m=[...p.changedTouches].find(D=>D.identifier===i.touchId),!m||m.identifier!==i.touchId)return}else m=p;if(!i.isTouched){i.startMoving&&i.isScrolling&&t.emit("touchMoveOpposite",p);return}const A=m.pageX,_=m.pageY;if(p.preventedByNestedSwiper){l.startX=A,l.startY=_;return}if(!t.allowTouchMove){p.target.matches(i.focusableElements)||(t.allowClick=!1),i.isTouched&&(Object.assign(l,{startX:A,startY:_,currentX:A,currentY:_}),i.touchStartTime=Vn());return}if(a.touchReleaseOnEdges&&!a.loop)if(t.isVertical()){if(_<l.startY&&t.translate<=t.maxTranslate()||_>l.startY&&t.translate>=t.minTranslate()){i.isTouched=!1,i.isMoved=!1;return}}else{if(u&&(A>l.startX&&-t.translate<=t.maxTranslate()||A<l.startX&&-t.translate>=t.minTranslate()))return;if(!u&&(A<l.startX&&t.translate<=t.maxTranslate()||A>l.startX&&t.translate>=t.minTranslate()))return}if(e.activeElement&&e.activeElement.matches(i.focusableElements)&&e.activeElement!==p.target&&p.pointerType!=="mouse"&&e.activeElement.blur(),e.activeElement&&p.target===e.activeElement&&p.target.matches(i.focusableElements)){i.isMoved=!0,t.allowClick=!1;return}i.allowTouchCallbacks&&t.emit("touchMove",p),l.previousX=l.currentX,l.previousY=l.currentY,l.currentX=A,l.currentY=_;const b=l.currentX-l.startX,w=l.currentY-l.startY;if(t.params.threshold&&Math.sqrt(b**2+w**2)<t.params.threshold)return;if(typeof i.isScrolling>"u"){let D;t.isHorizontal()&&l.currentY===l.startY||t.isVertical()&&l.currentX===l.startX?i.isScrolling=!1:b*b+w*w>=25&&(D=Math.atan2(Math.abs(w),Math.abs(b))*180/Math.PI,i.isScrolling=t.isHorizontal()?D>a.touchAngle:90-D>a.touchAngle)}if(i.isScrolling&&t.emit("touchMoveOpposite",p),typeof i.startMoving>"u"&&(l.currentX!==l.startX||l.currentY!==l.startY)&&(i.startMoving=!0),i.isScrolling||p.type==="touchmove"&&i.preventTouchMoveFromPointerMove){i.isTouched=!1;return}if(!i.startMoving)return;t.allowClick=!1,!a.cssMode&&p.cancelable&&p.preventDefault(),a.touchMoveStopPropagation&&!a.nested&&p.stopPropagation();let E=t.isHorizontal()?b:w,C=t.isHorizontal()?l.currentX-l.previousX:l.currentY-l.previousY;a.oneWayMovement&&(E=Math.abs(E)*(u?1:-1),C=Math.abs(C)*(u?1:-1)),l.diff=E,E*=a.touchRatio,u&&(E=-E,C=-C);const T=t.touchesDirection;t.swipeDirection=E>0?"prev":"next",t.touchesDirection=C>0?"prev":"next";const x=t.params.loop&&!a.cssMode,P=t.touchesDirection==="next"&&t.allowSlideNext||t.touchesDirection==="prev"&&t.allowSlidePrev;if(!i.isMoved){if(x&&P&&t.loopFix({direction:t.swipeDirection}),i.startTranslate=t.getTranslate(),t.setTransition(0),t.animating){const D=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});t.wrapperEl.dispatchEvent(D)}i.allowMomentumBounce=!1,a.grabCursor&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!0),t.emit("sliderFirstMove",p)}if(new Date().getTime(),a._loopSwapReset!==!1&&i.isMoved&&i.allowThresholdMove&&T!==t.touchesDirection&&x&&P&&Math.abs(E)>=1){Object.assign(l,{startX:A,startY:_,currentX:A,currentY:_,startTranslate:i.currentTranslate}),i.loopSwapReset=!0,i.startTranslate=i.currentTranslate;return}t.emit("sliderMove",p),i.isMoved=!0,i.currentTranslate=E+i.startTranslate;let M=!0,B=a.resistanceRatio;if(a.touchReleaseOnEdges&&(B=0),E>0?(x&&P&&i.allowThresholdMove&&i.currentTranslate>(a.centeredSlides?t.minTranslate()-t.slidesSizesGrid[t.activeIndex+1]-(a.slidesPerView!=="auto"&&t.slides.length-a.slidesPerView>=2?t.slidesSizesGrid[t.activeIndex+1]+t.params.spaceBetween:0)-t.params.spaceBetween:t.minTranslate())&&t.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>t.minTranslate()&&(M=!1,a.resistance&&(i.currentTranslate=t.minTranslate()-1+(-t.minTranslate()+i.startTranslate+E)**B))):E<0&&(x&&P&&i.allowThresholdMove&&i.currentTranslate<(a.centeredSlides?t.maxTranslate()+t.slidesSizesGrid[t.slidesSizesGrid.length-1]+t.params.spaceBetween+(a.slidesPerView!=="auto"&&t.slides.length-a.slidesPerView>=2?t.slidesSizesGrid[t.slidesSizesGrid.length-1]+t.params.spaceBetween:0):t.maxTranslate())&&t.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:t.slides.length-(a.slidesPerView==="auto"?t.slidesPerViewDynamic():Math.ceil(parseFloat(a.slidesPerView,10)))}),i.currentTranslate<t.maxTranslate()&&(M=!1,a.resistance&&(i.currentTranslate=t.maxTranslate()+1-(t.maxTranslate()-i.startTranslate-E)**B))),M&&(p.preventedByNestedSwiper=!0),!t.allowSlideNext&&t.swipeDirection==="next"&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!t.allowSlidePrev&&t.swipeDirection==="prev"&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),!t.allowSlidePrev&&!t.allowSlideNext&&(i.currentTranslate=i.startTranslate),a.threshold>0)if(Math.abs(E)>a.threshold||i.allowThresholdMove){if(!i.allowThresholdMove){i.allowThresholdMove=!0,l.startX=l.currentX,l.startY=l.currentY,i.currentTranslate=i.startTranslate,l.diff=t.isHorizontal()?l.currentX-l.startX:l.currentY-l.startY;return}}else{i.currentTranslate=i.startTranslate;return}!a.followFinger||a.cssMode||((a.freeMode&&a.freeMode.enabled&&t.freeMode||a.watchSlidesProgress)&&(t.updateActiveIndex(),t.updateSlidesClasses()),a.freeMode&&a.freeMode.enabled&&t.freeMode&&t.freeMode.onTouchMove(),t.updateProgress(i.currentTranslate),t.setTranslate(i.currentTranslate))}function Y3(o){const e=this,t=e.touchEventsData;let i=o;i.originalEvent&&(i=i.originalEvent);let a;if(i.type==="touchend"||i.type==="touchcancel"){if(a=[...i.changedTouches].find(D=>D.identifier===t.touchId),!a||a.identifier!==t.touchId)return}else{if(t.touchId!==null||i.pointerId!==t.pointerId)return;a=i}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(i.type)&&!(["pointercancel","contextmenu"].includes(i.type)&&(e.browser.isSafari||e.browser.isWebView)))return;t.pointerId=null,t.touchId=null;const{params:u,touches:d,rtlTranslate:p,slidesGrid:m,enabled:A}=e;if(!A||!u.simulateTouch&&i.pointerType==="mouse")return;if(t.allowTouchCallbacks&&e.emit("touchEnd",i),t.allowTouchCallbacks=!1,!t.isTouched){t.isMoved&&u.grabCursor&&e.setGrabCursor(!1),t.isMoved=!1,t.startMoving=!1;return}u.grabCursor&&t.isMoved&&t.isTouched&&(e.allowSlideNext===!0||e.allowSlidePrev===!0)&&e.setGrabCursor(!1);const _=Vn(),b=_-t.touchStartTime;if(e.allowClick){const D=i.path||i.composedPath&&i.composedPath();e.updateClickedSlide(D&&D[0]||i.target,D),e.emit("tap click",i),b<300&&_-t.lastClickTime<300&&e.emit("doubleTap doubleClick",i)}if(t.lastClickTime=Vn(),Dl(()=>{e.destroyed||(e.allowClick=!0)}),!t.isTouched||!t.isMoved||!e.swipeDirection||d.diff===0&&!t.loopSwapReset||t.currentTranslate===t.startTranslate&&!t.loopSwapReset){t.isTouched=!1,t.isMoved=!1,t.startMoving=!1;return}t.isTouched=!1,t.isMoved=!1,t.startMoving=!1;let w;if(u.followFinger?w=p?e.translate:-e.translate:w=-t.currentTranslate,u.cssMode)return;if(u.freeMode&&u.freeMode.enabled){e.freeMode.onTouchEnd({currentPos:w});return}const E=w>=-e.maxTranslate()&&!e.params.loop;let C=0,T=e.slidesSizesGrid[0];for(let D=0;D<m.length;D+=D<u.slidesPerGroupSkip?1:u.slidesPerGroup){const G=D<u.slidesPerGroupSkip-1?1:u.slidesPerGroup;typeof m[D+G]<"u"?(E||w>=m[D]&&w<m[D+G])&&(C=D,T=m[D+G]-m[D]):(E||w>=m[D])&&(C=D,T=m[m.length-1]-m[m.length-2])}let x=null,P=null;u.rewind&&(e.isBeginning?P=u.virtual&&u.virtual.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(x=0));const M=(w-m[C])/T,B=C<u.slidesPerGroupSkip-1?1:u.slidesPerGroup;if(b>u.longSwipesMs){if(!u.longSwipes){e.slideTo(e.activeIndex);return}e.swipeDirection==="next"&&(M>=u.longSwipesRatio?e.slideTo(u.rewind&&e.isEnd?x:C+B):e.slideTo(C)),e.swipeDirection==="prev"&&(M>1-u.longSwipesRatio?e.slideTo(C+B):P!==null&&M<0&&Math.abs(M)>u.longSwipesRatio?e.slideTo(P):e.slideTo(C))}else{if(!u.shortSwipes){e.slideTo(e.activeIndex);return}e.navigation&&(i.target===e.navigation.nextEl||i.target===e.navigation.prevEl)?i.target===e.navigation.nextEl?e.slideTo(C+B):e.slideTo(C):(e.swipeDirection==="next"&&e.slideTo(x!==null?x:C+B),e.swipeDirection==="prev"&&e.slideTo(P!==null?P:C))}}function Pv(){const o=this,{params:e,el:t}=o;if(t&&t.offsetWidth===0)return;e.breakpoints&&o.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:a,snapGrid:l}=o,u=o.virtual&&o.params.virtual.enabled;o.allowSlideNext=!0,o.allowSlidePrev=!0,o.updateSize(),o.updateSlides(),o.updateSlidesClasses();const d=u&&e.loop;(e.slidesPerView==="auto"||e.slidesPerView>1)&&o.isEnd&&!o.isBeginning&&!o.params.centeredSlides&&!d?o.slideTo(o.slides.length-1,0,!1,!0):o.params.loop&&!u?o.slideToLoop(o.realIndex,0,!1,!0):o.slideTo(o.activeIndex,0,!1,!0),o.autoplay&&o.autoplay.running&&o.autoplay.paused&&(clearTimeout(o.autoplay.resizeTimeout),o.autoplay.resizeTimeout=setTimeout(()=>{o.autoplay&&o.autoplay.running&&o.autoplay.paused&&o.autoplay.resume()},500)),o.allowSlidePrev=a,o.allowSlideNext=i,o.params.watchOverflow&&l!==o.snapGrid&&o.checkOverflow()}function X3(o){const e=this;e.enabled&&(e.allowClick||(e.params.preventClicks&&o.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(o.stopPropagation(),o.stopImmediatePropagation())))}function K3(){const o=this,{wrapperEl:e,rtlTranslate:t,enabled:i}=o;if(!i)return;o.previousTranslate=o.translate,o.isHorizontal()?o.translate=-e.scrollLeft:o.translate=-e.scrollTop,o.translate===0&&(o.translate=0),o.updateActiveIndex(),o.updateSlidesClasses();let a;const l=o.maxTranslate()-o.minTranslate();l===0?a=0:a=(o.translate-o.minTranslate())/l,a!==o.progress&&o.updateProgress(t?-o.translate:o.translate),o.emit("setTranslate",o.translate,!1)}function J3(o){const e=this;Td(e,o.target),!(e.params.cssMode||e.params.slidesPerView!=="auto"&&!e.params.autoHeight)&&e.update()}function Z3(){const o=this;o.documentTouchHandlerProceeded||(o.documentTouchHandlerProceeded=!0,o.params.touchReleaseOnEdges&&(o.el.style.touchAction="auto"))}const fC=(o,e)=>{const t=Li(),{params:i,el:a,wrapperEl:l,device:u}=o,d=!!i.nested,p=e==="on"?"addEventListener":"removeEventListener",m=e;!a||typeof a=="string"||(t[p]("touchstart",o.onDocumentTouchStart,{passive:!1,capture:d}),a[p]("touchstart",o.onTouchStart,{passive:!1}),a[p]("pointerdown",o.onTouchStart,{passive:!1}),t[p]("touchmove",o.onTouchMove,{passive:!1,capture:d}),t[p]("pointermove",o.onTouchMove,{passive:!1,capture:d}),t[p]("touchend",o.onTouchEnd,{passive:!0}),t[p]("pointerup",o.onTouchEnd,{passive:!0}),t[p]("pointercancel",o.onTouchEnd,{passive:!0}),t[p]("touchcancel",o.onTouchEnd,{passive:!0}),t[p]("pointerout",o.onTouchEnd,{passive:!0}),t[p]("pointerleave",o.onTouchEnd,{passive:!0}),t[p]("contextmenu",o.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&a[p]("click",o.onClick,!0),i.cssMode&&l[p]("scroll",o.onScroll),i.updateOnWindowResize?o[m](u.ios||u.android?"resize orientationchange observerUpdate":"resize observerUpdate",Pv,!0):o[m]("observerUpdate",Pv,!0),a[p]("load",o.onLoad,{capture:!0}))};function eF(){const o=this,{params:e}=o;o.onTouchStart=q3.bind(o),o.onTouchMove=W3.bind(o),o.onTouchEnd=Y3.bind(o),o.onDocumentTouchStart=Z3.bind(o),e.cssMode&&(o.onScroll=K3.bind(o)),o.onClick=X3.bind(o),o.onLoad=J3.bind(o),fC(o,"on")}function tF(){fC(this,"off")}var iF={attachEvents:eF,detachEvents:tF};const Lv=(o,e)=>o.grid&&e.grid&&e.grid.rows>1;function nF(){const o=this,{realIndex:e,initialized:t,params:i,el:a}=o,l=i.breakpoints;if(!l||l&&Object.keys(l).length===0)return;const u=Li(),d=i.breakpointsBase==="window"||!i.breakpointsBase?i.breakpointsBase:"container",p=["window","container"].includes(i.breakpointsBase)||!i.breakpointsBase?o.el:u.querySelector(i.breakpointsBase),m=o.getBreakpoint(l,d,p);if(!m||o.currentBreakpoint===m)return;const _=(m in l?l[m]:void 0)||o.originalParams,b=Lv(o,i),w=Lv(o,_),E=o.params.grabCursor,C=_.grabCursor,T=i.enabled;b&&!w?(a.classList.remove(`${i.containerModifierClass}grid`,`${i.containerModifierClass}grid-column`),o.emitContainerClasses()):!b&&w&&(a.classList.add(`${i.containerModifierClass}grid`),(_.grid.fill&&_.grid.fill==="column"||!_.grid.fill&&i.grid.fill==="column")&&a.classList.add(`${i.containerModifierClass}grid-column`),o.emitContainerClasses()),E&&!C?o.unsetGrabCursor():!E&&C&&o.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(G=>{if(typeof _[G]>"u")return;const U=i[G]&&i[G].enabled,V=_[G]&&_[G].enabled;U&&!V&&o[G].disable(),!U&&V&&o[G].enable()});const x=_.direction&&_.direction!==i.direction,P=i.loop&&(_.slidesPerView!==i.slidesPerView||x),M=i.loop;x&&t&&o.changeDirection(),In(o.params,_);const B=o.params.enabled,D=o.params.loop;Object.assign(o,{allowTouchMove:o.params.allowTouchMove,allowSlideNext:o.params.allowSlideNext,allowSlidePrev:o.params.allowSlidePrev}),T&&!B?o.disable():!T&&B&&o.enable(),o.currentBreakpoint=m,o.emit("_beforeBreakpoint",_),t&&(P?(o.loopDestroy(),o.loopCreate(e),o.updateSlides()):!M&&D?(o.loopCreate(e),o.updateSlides()):M&&!D&&o.loopDestroy()),o.emit("breakpoint",_)}function sF(o,e,t){if(e===void 0&&(e="window"),!o||e==="container"&&!t)return;let i=!1;const a=ti(),l=e==="window"?a.innerHeight:t.clientHeight,u=Object.keys(o).map(d=>{if(typeof d=="string"&&d.indexOf("@")===0){const p=parseFloat(d.substr(1));return{value:l*p,point:d}}return{value:d,point:d}});u.sort((d,p)=>parseInt(d.value,10)-parseInt(p.value,10));for(let d=0;d<u.length;d+=1){const{point:p,value:m}=u[d];e==="window"?a.matchMedia(`(min-width: ${m}px)`).matches&&(i=p):m<=t.clientWidth&&(i=p)}return i||"max"}var rF={setBreakpoint:nF,getBreakpoint:sF};function aF(o,e){const t=[];return o.forEach(i=>{typeof i=="object"?Object.keys(i).forEach(a=>{i[a]&&t.push(e+a)}):typeof i=="string"&&t.push(e+i)}),t}function oF(){const o=this,{classNames:e,params:t,rtl:i,el:a,device:l}=o,u=aF(["initialized",t.direction,{"free-mode":o.params.freeMode&&t.freeMode.enabled},{autoheight:t.autoHeight},{rtl:i},{grid:t.grid&&t.grid.rows>1},{"grid-column":t.grid&&t.grid.rows>1&&t.grid.fill==="column"},{android:l.android},{ios:l.ios},{"css-mode":t.cssMode},{centered:t.cssMode&&t.centeredSlides},{"watch-progress":t.watchSlidesProgress}],t.containerModifierClass);e.push(...u),a.classList.add(...e),o.emitContainerClasses()}function lF(){const o=this,{el:e,classNames:t}=o;!e||typeof e=="string"||(e.classList.remove(...t),o.emitContainerClasses())}var cF={addClasses:oF,removeClasses:lF};function uF(){const o=this,{isLocked:e,params:t}=o,{slidesOffsetBefore:i}=t;if(i){const a=o.slides.length-1,l=o.slidesGrid[a]+o.slidesSizesGrid[a]+i*2;o.isLocked=o.size>l}else o.isLocked=o.snapGrid.length===1;t.allowSlideNext===!0&&(o.allowSlideNext=!o.isLocked),t.allowSlidePrev===!0&&(o.allowSlidePrev=!o.isLocked),e&&e!==o.isLocked&&(o.isEnd=!1),e!==o.isLocked&&o.emit(o.isLocked?"lock":"unlock")}var hF={checkOverflow:uF},jA={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function dF(o,e){return function(i){i===void 0&&(i={});const a=Object.keys(i)[0],l=i[a];if(typeof l!="object"||l===null){In(e,i);return}if(o[a]===!0&&(o[a]={enabled:!0}),a==="navigation"&&o[a]&&o[a].enabled&&!o[a].prevEl&&!o[a].nextEl&&(o[a].auto=!0),["pagination","scrollbar"].indexOf(a)>=0&&o[a]&&o[a].enabled&&!o[a].el&&(o[a].auto=!0),!(a in o&&"enabled"in l)){In(e,i);return}typeof o[a]=="object"&&!("enabled"in o[a])&&(o[a].enabled=!0),o[a]||(o[a]={enabled:!1}),In(e,i)}}const xm={eventsEmitter:c3,update:b3,translate:C3,transition:R3,slide:U3,loop:G3,grabCursor:Q3,events:iF,breakpoints:rF,checkOverflow:hF,classes:cF},Sm={};class Tn{constructor(){let e,t;for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length===1&&a[0].constructor&&Object.prototype.toString.call(a[0]).slice(8,-1)==="Object"?t=a[0]:[e,t]=a,t||(t={}),t=In({},t),e&&!t.el&&(t.el=e);const u=Li();if(t.el&&typeof t.el=="string"&&u.querySelectorAll(t.el).length>1){const A=[];return u.querySelectorAll(t.el).forEach(_=>{const b=In({},t,{el:_});A.push(new Tn(b))}),A}const d=this;d.__swiper__=!0,d.support=cC(),d.device=uC({userAgent:t.userAgent}),d.browser=hC(),d.eventsListeners={},d.eventsAnyListeners=[],d.modules=[...d.__modules__],t.modules&&Array.isArray(t.modules)&&d.modules.push(...t.modules);const p={};d.modules.forEach(A=>{A({params:t,swiper:d,extendParams:dF(t,p),on:d.on.bind(d),once:d.once.bind(d),off:d.off.bind(d),emit:d.emit.bind(d)})});const m=In({},jA,p);return d.params=In({},m,Sm,t),d.originalParams=In({},d.params),d.passedParams=In({},t),d.params&&d.params.on&&Object.keys(d.params.on).forEach(A=>{d.on(A,d.params.on[A])}),d.params&&d.params.onAny&&d.onAny(d.params.onAny),Object.assign(d,{enabled:d.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return d.params.direction==="horizontal"},isVertical(){return d.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:d.params.allowSlideNext,allowSlidePrev:d.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:d.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:d.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),d.emit("_swiper"),d.params.init&&d.init(),d}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:i}=this,a=Ui(t,`.${i.slideClass}, swiper-slide`),l=Mu(a[0]);return Mu(e)-l}getSlideIndexByData(e){return this.getSlideIndex(this.slides.find(t=>t.getAttribute("data-swiper-slide-index")*1===e))}getSlideIndexWhenGrid(e){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill==="column"?e=Math.floor(e/this.params.grid.rows):this.params.grid.fill==="row"&&(e=e%Math.ceil(this.slides.length/this.params.grid.rows))),e}recalcSlides(){const e=this,{slidesEl:t,params:i}=e;e.slides=Ui(t,`.${i.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const i=this;e=Math.min(Math.max(e,0),1);const a=i.minTranslate(),u=(i.maxTranslate()-a)*e+a;i.translateTo(u,typeof t>"u"?0:t),i.updateActiveIndex(),i.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter(i=>i.indexOf("swiper")===0||i.indexOf(e.params.containerModifierClass)===0);e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter(i=>i.indexOf("swiper-slide")===0||i.indexOf(t.params.slideClass)===0).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach(i=>{const a=e.getSlideClasses(i);t.push({slideEl:i,classNames:a}),e.emit("_slideClass",i,a)}),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){e===void 0&&(e="current"),t===void 0&&(t=!1);const i=this,{params:a,slides:l,slidesGrid:u,slidesSizesGrid:d,size:p,activeIndex:m}=i;let A=1;if(typeof a.slidesPerView=="number")return a.slidesPerView;if(a.centeredSlides){let _=l[m]?Math.ceil(l[m].swiperSlideSize):0,b;for(let w=m+1;w<l.length;w+=1)l[w]&&!b&&(_+=Math.ceil(l[w].swiperSlideSize),A+=1,_>p&&(b=!0));for(let w=m-1;w>=0;w-=1)l[w]&&!b&&(_+=l[w].swiperSlideSize,A+=1,_>p&&(b=!0))}else if(e==="current")for(let _=m+1;_<l.length;_+=1)(t?u[_]+d[_]-u[m]<p:u[_]-u[m]<p)&&(A+=1);else for(let _=m-1;_>=0;_-=1)u[m]-u[_]<p&&(A+=1);return A}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:i}=e;i.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach(u=>{u.complete&&Td(e,u)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses();function a(){const u=e.rtlTranslate?e.translate*-1:e.translate,d=Math.min(Math.max(u,e.maxTranslate()),e.minTranslate());e.setTranslate(d),e.updateActiveIndex(),e.updateSlidesClasses()}let l;if(i.freeMode&&i.freeMode.enabled&&!i.cssMode)a(),i.autoHeight&&e.updateAutoHeight();else{if((i.slidesPerView==="auto"||i.slidesPerView>1)&&e.isEnd&&!i.centeredSlides){const u=e.virtual&&i.virtual.enabled?e.virtual.slides:e.slides;l=e.slideTo(u.length-1,0,!1,!0)}else l=e.slideTo(e.activeIndex,0,!1,!0);l||a()}i.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){t===void 0&&(t=!0);const i=this,a=i.params.direction;return e||(e=a==="horizontal"?"vertical":"horizontal"),e===a||e!=="horizontal"&&e!=="vertical"||(i.el.classList.remove(`${i.params.containerModifierClass}${a}`),i.el.classList.add(`${i.params.containerModifierClass}${e}`),i.emitContainerClasses(),i.params.direction=e,i.slides.forEach(l=>{e==="vertical"?l.style.width="":l.style.height=""}),i.emit("changeDirection"),t&&i.update()),i}changeLanguageDirection(e){const t=this;t.rtl&&e==="rtl"||!t.rtl&&e==="ltr"||(t.rtl=e==="rtl",t.rtlTranslate=t.params.direction==="horizontal"&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let i=e||t.params.el;if(typeof i=="string"&&(i=document.querySelector(i)),!i)return!1;i.swiper=t,i.parentNode&&i.parentNode.host&&i.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);const a=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let u=i&&i.shadowRoot&&i.shadowRoot.querySelector?i.shadowRoot.querySelector(a()):Ui(i,a())[0];return!u&&t.params.createElements&&(u=Pn("div",t.params.wrapperClass),i.append(u),Ui(i,`.${t.params.slideClass}`).forEach(d=>{u.append(d)})),Object.assign(t,{el:i,wrapperEl:u,slidesEl:t.isElement&&!i.parentNode.host.slideSlots?i.parentNode.host:u,hostEl:t.isElement?i.parentNode.host:i,mounted:!0,rtl:i.dir.toLowerCase()==="rtl"||Fr(i,"direction")==="rtl",rtlTranslate:t.params.direction==="horizontal"&&(i.dir.toLowerCase()==="rtl"||Fr(i,"direction")==="rtl"),wrongRTL:Fr(u,"display")==="-webkit-box"}),!0}init(e){const t=this;if(t.initialized||t.mount(e)===!1)return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(void 0,!0),t.attachEvents();const a=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&a.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),a.forEach(l=>{l.complete?Td(t,l):l.addEventListener("load",u=>{Td(t,u.target)})}),QA(t),t.initialized=!0,QA(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){e===void 0&&(e=!0),t===void 0&&(t=!0);const i=this,{params:a,el:l,wrapperEl:u,slides:d}=i;return typeof i.params>"u"||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),a.loop&&i.loopDestroy(),t&&(i.removeClasses(),l&&typeof l!="string"&&l.removeAttribute("style"),u&&u.removeAttribute("style"),d&&d.length&&d.forEach(p=>{p.classList.remove(a.slideVisibleClass,a.slideFullyVisibleClass,a.slideActiveClass,a.slideNextClass,a.slidePrevClass),p.removeAttribute("style"),p.removeAttribute("data-swiper-slide-index")})),i.emit("destroy"),Object.keys(i.eventsListeners).forEach(p=>{i.off(p)}),e!==!1&&(i.el&&typeof i.el!="string"&&(i.el.swiper=null),KU(i)),i.destroyed=!0),null}static extendDefaults(e){In(Sm,e)}static get extendedDefaults(){return Sm}static get defaults(){return jA}static installModule(e){Tn.prototype.__modules__||(Tn.prototype.__modules__=[]);const t=Tn.prototype.__modules__;typeof e=="function"&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach(t=>Tn.installModule(t)),Tn):(Tn.installModule(e),Tn)}}Object.keys(xm).forEach(o=>{Object.keys(xm[o]).forEach(e=>{Tn.prototype[e]=xm[o][e]})});Tn.use([o3,l3]);function fF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;t({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});let l;const u=Li();e.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const d=u.createElement("div");function p(E,C){const T=e.params.virtual;if(T.cache&&e.virtual.cache[C])return e.virtual.cache[C];let x;return T.renderSlide?(x=T.renderSlide.call(e,E,C),typeof x=="string"&&(Yn(d,x),x=d.children[0])):e.isElement?x=Pn("swiper-slide"):x=Pn("div",e.params.slideClass),x.setAttribute("data-swiper-slide-index",C),T.renderSlide||Yn(x,E),T.cache&&(e.virtual.cache[C]=x),x}function m(E,C,T){const{slidesPerView:x,slidesPerGroup:P,centeredSlides:M,loop:B,initialSlide:D}=e.params;if(C&&!B&&D>0)return;const{addSlidesBefore:G,addSlidesAfter:U}=e.params.virtual,{from:V,to:k,slides:z,slidesGrid:Q,offset:Z}=e.virtual;e.params.cssMode||e.updateActiveIndex();const K=typeof T>"u"?e.activeIndex||0:T;let s;e.rtlTranslate?s="right":s=e.isHorizontal()?"left":"top";let H,y;M?(H=Math.floor(x/2)+P+U,y=Math.floor(x/2)+P+G):(H=x+(P-1)+U,y=(B?x:P)+G);let ee=K-y,I=K+H;B||(ee=Math.max(ee,0),I=Math.min(I,z.length-1));let re=(e.slidesGrid[ee]||0)-(e.slidesGrid[0]||0);B&&K>=y?(ee-=y,M||(re+=e.slidesGrid[0])):B&&K<y&&(ee=-y,M&&(re+=e.slidesGrid[0])),Object.assign(e.virtual,{from:ee,to:I,offset:re,slidesGrid:e.slidesGrid,slidesBefore:y,slidesAfter:H});function Ae(){e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),a("virtualUpdate")}if(V===ee&&k===I&&!E){e.slidesGrid!==Q&&re!==Z&&e.slides.forEach(f=>{f.style[s]=`${re-Math.abs(e.cssOverflowAdjustment())}px`}),e.updateProgress(),a("virtualUpdate");return}if(e.params.virtual.renderExternal){e.params.virtual.renderExternal.call(e,{offset:re,from:ee,to:I,slides:(function(){const g=[];for(let v=ee;v<=I;v+=1)g.push(z[v]);return g})()}),e.params.virtual.renderExternalUpdate?Ae():a("virtualUpdate");return}const N=[],n=[],r=f=>{let g=f;return f<0?g=z.length+f:g>=z.length&&(g=g-z.length),g};if(E)e.slides.filter(f=>f.matches(`.${e.params.slideClass}, swiper-slide`)).forEach(f=>{f.remove()});else for(let f=V;f<=k;f+=1)if(f<ee||f>I){const g=r(f);e.slides.filter(v=>v.matches(`.${e.params.slideClass}[data-swiper-slide-index="${g}"], swiper-slide[data-swiper-slide-index="${g}"]`)).forEach(v=>{v.remove()})}const c=B?-z.length:0,h=B?z.length*2:z.length;for(let f=c;f<h;f+=1)if(f>=ee&&f<=I){const g=r(f);typeof k>"u"||E?n.push(g):(f>k&&n.push(g),f<V&&N.push(g))}if(n.forEach(f=>{e.slidesEl.append(p(z[f],f))}),B)for(let f=N.length-1;f>=0;f-=1){const g=N[f];e.slidesEl.prepend(p(z[g],g))}else N.sort((f,g)=>g-f),N.forEach(f=>{e.slidesEl.prepend(p(z[f],f))});Ui(e.slidesEl,".swiper-slide, swiper-slide").forEach(f=>{f.style[s]=`${re-Math.abs(e.cssOverflowAdjustment())}px`}),Ae()}function A(E){if(typeof E=="object"&&"length"in E)for(let C=0;C<E.length;C+=1)E[C]&&e.virtual.slides.push(E[C]);else e.virtual.slides.push(E);m(!0)}function _(E){const C=e.activeIndex;let T=C+1,x=1;if(Array.isArray(E)){for(let P=0;P<E.length;P+=1)E[P]&&e.virtual.slides.unshift(E[P]);T=C+E.length,x=E.length}else e.virtual.slides.unshift(E);if(e.params.virtual.cache){const P=e.virtual.cache,M={};Object.keys(P).forEach(B=>{const D=P[B],G=D.getAttribute("data-swiper-slide-index");G&&D.setAttribute("data-swiper-slide-index",parseInt(G,10)+x),M[parseInt(B,10)+x]=D}),e.virtual.cache=M}m(!0),e.slideTo(T,0)}function b(E){if(typeof E>"u"||E===null)return;let C=e.activeIndex;if(Array.isArray(E))for(let T=E.length-1;T>=0;T-=1)e.params.virtual.cache&&(delete e.virtual.cache[E[T]],Object.keys(e.virtual.cache).forEach(x=>{x>E&&(e.virtual.cache[x-1]=e.virtual.cache[x],e.virtual.cache[x-1].setAttribute("data-swiper-slide-index",x-1),delete e.virtual.cache[x])})),e.virtual.slides.splice(E[T],1),E[T]<C&&(C-=1),C=Math.max(C,0);else e.params.virtual.cache&&(delete e.virtual.cache[E],Object.keys(e.virtual.cache).forEach(T=>{T>E&&(e.virtual.cache[T-1]=e.virtual.cache[T],e.virtual.cache[T-1].setAttribute("data-swiper-slide-index",T-1),delete e.virtual.cache[T])})),e.virtual.slides.splice(E,1),E<C&&(C-=1),C=Math.max(C,0);m(!0),e.slideTo(C,0)}function w(){e.virtual.slides=[],e.params.virtual.cache&&(e.virtual.cache={}),m(!0),e.slideTo(0,0)}i("beforeInit",()=>{if(!e.params.virtual.enabled)return;let E;if(typeof e.passedParams.virtual.slides>"u"){const C=[...e.slidesEl.children].filter(T=>T.matches(`.${e.params.slideClass}, swiper-slide`));C&&C.length&&(e.virtual.slides=[...C],E=!0,C.forEach((T,x)=>{T.setAttribute("data-swiper-slide-index",x),e.virtual.cache[x]=T,T.remove()}))}E||(e.virtual.slides=e.params.virtual.slides),e.classNames.push(`${e.params.containerModifierClass}virtual`),e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0,m(!1,!0)}),i("setTranslate",()=>{e.params.virtual.enabled&&(e.params.cssMode&&!e._immediateVirtual?(clearTimeout(l),l=setTimeout(()=>{m()},100)):m())}),i("init update resize",()=>{e.params.virtual.enabled&&e.params.cssMode&&qc(e.wrapperEl,"--swiper-virtual-size",`${e.virtualSize}px`)}),Object.assign(e.virtual,{appendSlide:A,prependSlide:_,removeSlide:b,removeAllSlides:w,update:m})}function pF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=Li(),u=ti();e.keyboard={enabled:!1},t({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function d(A){if(!e.enabled)return;const{rtlTranslate:_}=e;let b=A;b.originalEvent&&(b=b.originalEvent);const w=b.keyCode||b.charCode,E=e.params.keyboard.pageUpDown,C=E&&w===33,T=E&&w===34,x=w===37,P=w===39,M=w===38,B=w===40;if(!e.allowSlideNext&&(e.isHorizontal()&&P||e.isVertical()&&B||T)||!e.allowSlidePrev&&(e.isHorizontal()&&x||e.isVertical()&&M||C))return!1;if(!(b.shiftKey||b.altKey||b.ctrlKey||b.metaKey)&&!(l.activeElement&&(l.activeElement.isContentEditable||l.activeElement.nodeName&&(l.activeElement.nodeName.toLowerCase()==="input"||l.activeElement.nodeName.toLowerCase()==="textarea")))){if(e.params.keyboard.onlyInViewport&&(C||T||x||P||M||B)){let D=!1;if(Ga(e.el,`.${e.params.slideClass}, swiper-slide`).length>0&&Ga(e.el,`.${e.params.slideActiveClass}`).length===0)return;const G=e.el,U=G.clientWidth,V=G.clientHeight,k=u.innerWidth,z=u.innerHeight,Q=Af(G);_&&(Q.left-=G.scrollLeft);const Z=[[Q.left,Q.top],[Q.left+U,Q.top],[Q.left,Q.top+V],[Q.left+U,Q.top+V]];for(let K=0;K<Z.length;K+=1){const s=Z[K];if(s[0]>=0&&s[0]<=k&&s[1]>=0&&s[1]<=z){if(s[0]===0&&s[1]===0)continue;D=!0}}if(!D)return}e.isHorizontal()?((C||T||x||P)&&(b.preventDefault?b.preventDefault():b.returnValue=!1),((T||P)&&!_||(C||x)&&_)&&e.slideNext(),((C||x)&&!_||(T||P)&&_)&&e.slidePrev()):((C||T||M||B)&&(b.preventDefault?b.preventDefault():b.returnValue=!1),(T||B)&&e.slideNext(),(C||M)&&e.slidePrev()),a("keyPress",w)}}function p(){e.keyboard.enabled||(l.addEventListener("keydown",d),e.keyboard.enabled=!0)}function m(){e.keyboard.enabled&&(l.removeEventListener("keydown",d),e.keyboard.enabled=!1)}i("init",()=>{e.params.keyboard.enabled&&p()}),i("destroy",()=>{e.keyboard.enabled&&m()}),Object.assign(e.keyboard,{enable:p,disable:m})}function mF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=ti();t({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),e.mousewheel={enabled:!1};let u,d=Vn(),p;const m=[];function A(M){let U=0,V=0,k=0,z=0;return"detail"in M&&(V=M.detail),"wheelDelta"in M&&(V=-M.wheelDelta/120),"wheelDeltaY"in M&&(V=-M.wheelDeltaY/120),"wheelDeltaX"in M&&(U=-M.wheelDeltaX/120),"axis"in M&&M.axis===M.HORIZONTAL_AXIS&&(U=V,V=0),k=U*10,z=V*10,"deltaY"in M&&(z=M.deltaY),"deltaX"in M&&(k=M.deltaX),M.shiftKey&&!k&&(k=z,z=0),(k||z)&&M.deltaMode&&(M.deltaMode===1?(k*=40,z*=40):(k*=800,z*=800)),k&&!U&&(U=k<1?-1:1),z&&!V&&(V=z<1?-1:1),{spinX:U,spinY:V,pixelX:k,pixelY:z}}function _(){e.enabled&&(e.mouseEntered=!0)}function b(){e.enabled&&(e.mouseEntered=!1)}function w(M){return e.params.mousewheel.thresholdDelta&&M.delta<e.params.mousewheel.thresholdDelta||e.params.mousewheel.thresholdTime&&Vn()-d<e.params.mousewheel.thresholdTime?!1:M.delta>=6&&Vn()-d<60?!0:(M.direction<0?(!e.isEnd||e.params.loop)&&!e.animating&&(e.slideNext(),a("scroll",M.raw)):(!e.isBeginning||e.params.loop)&&!e.animating&&(e.slidePrev(),a("scroll",M.raw)),d=new l.Date().getTime(),!1)}function E(M){const B=e.params.mousewheel;if(M.direction<0){if(e.isEnd&&!e.params.loop&&B.releaseOnEdges)return!0}else if(e.isBeginning&&!e.params.loop&&B.releaseOnEdges)return!0;return!1}function C(M){let B=M,D=!0;if(!e.enabled||M.target.closest(`.${e.params.mousewheel.noMousewheelClass}`))return;const G=e.params.mousewheel;e.params.cssMode&&B.preventDefault();let U=e.el;e.params.mousewheel.eventsTarget!=="container"&&(U=document.querySelector(e.params.mousewheel.eventsTarget));const V=U&&U.contains(B.target);if(!e.mouseEntered&&!V&&!G.releaseOnEdges)return!0;B.originalEvent&&(B=B.originalEvent);let k=0;const z=e.rtlTranslate?-1:1,Q=A(B);if(G.forceToAxis)if(e.isHorizontal())if(Math.abs(Q.pixelX)>Math.abs(Q.pixelY))k=-Q.pixelX*z;else return!0;else if(Math.abs(Q.pixelY)>Math.abs(Q.pixelX))k=-Q.pixelY;else return!0;else k=Math.abs(Q.pixelX)>Math.abs(Q.pixelY)?-Q.pixelX*z:-Q.pixelY;if(k===0)return!0;G.invert&&(k=-k);let Z=e.getTranslate()+k*G.sensitivity;if(Z>=e.minTranslate()&&(Z=e.minTranslate()),Z<=e.maxTranslate()&&(Z=e.maxTranslate()),D=e.params.loop?!0:!(Z===e.minTranslate()||Z===e.maxTranslate()),D&&e.params.nested&&B.stopPropagation(),!e.params.freeMode||!e.params.freeMode.enabled){const K={time:Vn(),delta:Math.abs(k),direction:Math.sign(k),raw:M};m.length>=2&&m.shift();const s=m.length?m[m.length-1]:void 0;if(m.push(K),s?(K.direction!==s.direction||K.delta>s.delta||K.time>s.time+150)&&w(K):w(K),E(K))return!0}else{const K={time:Vn(),delta:Math.abs(k),direction:Math.sign(k)},s=p&&K.time<p.time+500&&K.delta<=p.delta&&K.direction===p.direction;if(!s){p=void 0;let H=e.getTranslate()+k*G.sensitivity;const y=e.isBeginning,ee=e.isEnd;if(H>=e.minTranslate()&&(H=e.minTranslate()),H<=e.maxTranslate()&&(H=e.maxTranslate()),e.setTransition(0),e.setTranslate(H),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses(),(!y&&e.isBeginning||!ee&&e.isEnd)&&e.updateSlidesClasses(),e.params.loop&&e.loopFix({direction:K.direction<0?"next":"prev",byMousewheel:!0}),e.params.freeMode.sticky){clearTimeout(u),u=void 0,m.length>=15&&m.shift();const I=m.length?m[m.length-1]:void 0,re=m[0];if(m.push(K),I&&(K.delta>I.delta||K.direction!==I.direction))m.splice(0);else if(m.length>=15&&K.time-re.time<500&&re.delta-K.delta>=1&&K.delta<=6){const Ae=k>0?.8:.2;p=K,m.splice(0),u=Dl(()=>{e.destroyed||!e.params||e.slideToClosest(e.params.speed,!0,void 0,Ae)},0)}u||(u=Dl(()=>{if(e.destroyed||!e.params)return;const Ae=.5;p=K,m.splice(0),e.slideToClosest(e.params.speed,!0,void 0,Ae)},500))}if(s||a("scroll",B),e.params.autoplay&&e.params.autoplay.disableOnInteraction&&e.autoplay.stop(),G.releaseOnEdges&&(H===e.minTranslate()||H===e.maxTranslate()))return!0}}return B.preventDefault?B.preventDefault():B.returnValue=!1,!1}function T(M){let B=e.el;e.params.mousewheel.eventsTarget!=="container"&&(B=document.querySelector(e.params.mousewheel.eventsTarget)),B[M]("mouseenter",_),B[M]("mouseleave",b),B[M]("wheel",C)}function x(){return e.params.cssMode?(e.wrapperEl.removeEventListener("wheel",C),!0):e.mousewheel.enabled?!1:(T("addEventListener"),e.mousewheel.enabled=!0,!0)}function P(){return e.params.cssMode?(e.wrapperEl.addEventListener(event,C),!0):e.mousewheel.enabled?(T("removeEventListener"),e.mousewheel.enabled=!1,!0):!1}i("init",()=>{!e.params.mousewheel.enabled&&e.params.cssMode&&P(),e.params.mousewheel.enabled&&x()}),i("destroy",()=>{e.params.cssMode&&x(),e.mousewheel.enabled&&P()}),Object.assign(e.mousewheel,{enable:x,disable:P})}function m_(o,e,t,i){return o.params.createElements&&Object.keys(i).forEach(a=>{if(!t[a]&&t.auto===!0){let l=Ui(o.el,`.${i[a]}`)[0];l||(l=Pn("div",i[a]),l.className=i[a],o.el.append(l)),t[a]=l,e[a]=l}}),t}function gF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;t({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),e.navigation={nextEl:null,prevEl:null};function l(E){let C;return E&&typeof E=="string"&&e.isElement&&(C=e.el.querySelector(E)||e.hostEl.querySelector(E),C)?C:(E&&(typeof E=="string"&&(C=[...document.querySelectorAll(E)]),e.params.uniqueNavElements&&typeof E=="string"&&C&&C.length>1&&e.el.querySelectorAll(E).length===1?C=e.el.querySelector(E):C&&C.length===1&&(C=C[0])),E&&!C?E:C)}function u(E,C){const T=e.params.navigation;E=At(E),E.forEach(x=>{x&&(x.classList[C?"add":"remove"](...T.disabledClass.split(" ")),x.tagName==="BUTTON"&&(x.disabled=C),e.params.watchOverflow&&e.enabled&&x.classList[e.isLocked?"add":"remove"](T.lockClass))})}function d(){const{nextEl:E,prevEl:C}=e.navigation;if(e.params.loop){u(C,!1),u(E,!1);return}u(C,e.isBeginning&&!e.params.rewind),u(E,e.isEnd&&!e.params.rewind)}function p(E){E.preventDefault(),!(e.isBeginning&&!e.params.loop&&!e.params.rewind)&&(e.slidePrev(),a("navigationPrev"))}function m(E){E.preventDefault(),!(e.isEnd&&!e.params.loop&&!e.params.rewind)&&(e.slideNext(),a("navigationNext"))}function A(){const E=e.params.navigation;if(e.params.navigation=m_(e,e.originalParams.navigation,e.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(E.nextEl||E.prevEl))return;let C=l(E.nextEl),T=l(E.prevEl);Object.assign(e.navigation,{nextEl:C,prevEl:T}),C=At(C),T=At(T);const x=(P,M)=>{P&&P.addEventListener("click",M==="next"?m:p),!e.enabled&&P&&P.classList.add(...E.lockClass.split(" "))};C.forEach(P=>x(P,"next")),T.forEach(P=>x(P,"prev"))}function _(){let{nextEl:E,prevEl:C}=e.navigation;E=At(E),C=At(C);const T=(x,P)=>{x.removeEventListener("click",P==="next"?m:p),x.classList.remove(...e.params.navigation.disabledClass.split(" "))};E.forEach(x=>T(x,"next")),C.forEach(x=>T(x,"prev"))}i("init",()=>{e.params.navigation.enabled===!1?w():(A(),d())}),i("toEdge fromEdge lock unlock",()=>{d()}),i("destroy",()=>{_()}),i("enable disable",()=>{let{nextEl:E,prevEl:C}=e.navigation;if(E=At(E),C=At(C),e.enabled){d();return}[...E,...C].filter(T=>!!T).forEach(T=>T.classList.add(e.params.navigation.lockClass))}),i("click",(E,C)=>{let{nextEl:T,prevEl:x}=e.navigation;T=At(T),x=At(x);const P=C.target;let M=x.includes(P)||T.includes(P);if(e.isElement&&!M){const B=C.path||C.composedPath&&C.composedPath();B&&(M=B.find(D=>T.includes(D)||x.includes(D)))}if(e.params.navigation.hideOnClick&&!M){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===P||e.pagination.el.contains(P)))return;let B;T.length?B=T[0].classList.contains(e.params.navigation.hiddenClass):x.length&&(B=x[0].classList.contains(e.params.navigation.hiddenClass)),a(B===!0?"navigationShow":"navigationHide"),[...T,...x].filter(D=>!!D).forEach(D=>D.classList.toggle(e.params.navigation.hiddenClass))}});const b=()=>{e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")),A(),d()},w=()=>{e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")),_()};Object.assign(e.navigation,{enable:b,disable:w,update:d,init:A,destroy:_})}function nr(o){return o===void 0&&(o=""),`.${o.trim().replace(/([\.:!+\/()[\]])/g,"\\$1").replace(/ /g,".")}`}function AF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l="swiper-pagination";t({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:P=>P,formatFractionTotal:P=>P,bulletClass:`${l}-bullet`,bulletActiveClass:`${l}-bullet-active`,modifierClass:`${l}-`,currentClass:`${l}-current`,totalClass:`${l}-total`,hiddenClass:`${l}-hidden`,progressbarFillClass:`${l}-progressbar-fill`,progressbarOppositeClass:`${l}-progressbar-opposite`,clickableClass:`${l}-clickable`,lockClass:`${l}-lock`,horizontalClass:`${l}-horizontal`,verticalClass:`${l}-vertical`,paginationDisabledClass:`${l}-disabled`}}),e.pagination={el:null,bullets:[]};let u,d=0;function p(){return!e.params.pagination.el||!e.pagination.el||Array.isArray(e.pagination.el)&&e.pagination.el.length===0}function m(P,M){const{bulletActiveClass:B}=e.params.pagination;P&&(P=P[`${M==="prev"?"previous":"next"}ElementSibling`],P&&(P.classList.add(`${B}-${M}`),P=P[`${M==="prev"?"previous":"next"}ElementSibling`],P&&P.classList.add(`${B}-${M}-${M}`)))}function A(P,M,B){if(P=P%B,M=M%B,M===P+1)return"next";if(M===P-1)return"previous"}function _(P){const M=P.target.closest(nr(e.params.pagination.bulletClass));if(!M)return;P.preventDefault();const B=Mu(M)*e.params.slidesPerGroup;if(e.params.loop){if(e.realIndex===B)return;const D=A(e.realIndex,B,e.slides.length);D==="next"?e.slideNext():D==="previous"?e.slidePrev():e.slideToLoop(B)}else e.slideTo(B)}function b(){const P=e.rtl,M=e.params.pagination;if(p())return;let B=e.pagination.el;B=At(B);let D,G;const U=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,V=e.params.loop?Math.ceil(U/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?(G=e.previousRealIndex||0,D=e.params.slidesPerGroup>1?Math.floor(e.realIndex/e.params.slidesPerGroup):e.realIndex):typeof e.snapIndex<"u"?(D=e.snapIndex,G=e.previousSnapIndex):(G=e.previousIndex||0,D=e.activeIndex||0),M.type==="bullets"&&e.pagination.bullets&&e.pagination.bullets.length>0){const k=e.pagination.bullets;let z,Q,Z;if(M.dynamicBullets&&(u=VA(k[0],e.isHorizontal()?"width":"height"),B.forEach(K=>{K.style[e.isHorizontal()?"width":"height"]=`${u*(M.dynamicMainBullets+4)}px`}),M.dynamicMainBullets>1&&G!==void 0&&(d+=D-(G||0),d>M.dynamicMainBullets-1?d=M.dynamicMainBullets-1:d<0&&(d=0)),z=Math.max(D-d,0),Q=z+(Math.min(k.length,M.dynamicMainBullets)-1),Z=(Q+z)/2),k.forEach(K=>{const s=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(H=>`${M.bulletActiveClass}${H}`)].map(H=>typeof H=="string"&&H.includes(" ")?H.split(" "):H).flat();K.classList.remove(...s)}),B.length>1)k.forEach(K=>{const s=Mu(K);s===D?K.classList.add(...M.bulletActiveClass.split(" ")):e.isElement&&K.setAttribute("part","bullet"),M.dynamicBullets&&(s>=z&&s<=Q&&K.classList.add(...`${M.bulletActiveClass}-main`.split(" ")),s===z&&m(K,"prev"),s===Q&&m(K,"next"))});else{const K=k[D];if(K&&K.classList.add(...M.bulletActiveClass.split(" ")),e.isElement&&k.forEach((s,H)=>{s.setAttribute("part",H===D?"bullet-active":"bullet")}),M.dynamicBullets){const s=k[z],H=k[Q];for(let y=z;y<=Q;y+=1)k[y]&&k[y].classList.add(...`${M.bulletActiveClass}-main`.split(" "));m(s,"prev"),m(H,"next")}}if(M.dynamicBullets){const K=Math.min(k.length,M.dynamicMainBullets+4),s=(u*K-u)/2-Z*u,H=P?"right":"left";k.forEach(y=>{y.style[e.isHorizontal()?H:"top"]=`${s}px`})}}B.forEach((k,z)=>{if(M.type==="fraction"&&(k.querySelectorAll(nr(M.currentClass)).forEach(Q=>{Q.textContent=M.formatFractionCurrent(D+1)}),k.querySelectorAll(nr(M.totalClass)).forEach(Q=>{Q.textContent=M.formatFractionTotal(V)})),M.type==="progressbar"){let Q;M.progressbarOpposite?Q=e.isHorizontal()?"vertical":"horizontal":Q=e.isHorizontal()?"horizontal":"vertical";const Z=(D+1)/V;let K=1,s=1;Q==="horizontal"?K=Z:s=Z,k.querySelectorAll(nr(M.progressbarFillClass)).forEach(H=>{H.style.transform=`translate3d(0,0,0) scaleX(${K}) scaleY(${s})`,H.style.transitionDuration=`${e.params.speed}ms`})}M.type==="custom"&&M.renderCustom?(Yn(k,M.renderCustom(e,D+1,V)),z===0&&a("paginationRender",k)):(z===0&&a("paginationRender",k),a("paginationUpdate",k)),e.params.watchOverflow&&e.enabled&&k.classList[e.isLocked?"add":"remove"](M.lockClass)})}function w(){const P=e.params.pagination;if(p())return;const M=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.grid&&e.params.grid.rows>1?e.slides.length/Math.ceil(e.params.grid.rows):e.slides.length;let B=e.pagination.el;B=At(B);let D="";if(P.type==="bullets"){let G=e.params.loop?Math.ceil(M/e.params.slidesPerGroup):e.snapGrid.length;e.params.freeMode&&e.params.freeMode.enabled&&G>M&&(G=M);for(let U=0;U<G;U+=1)P.renderBullet?D+=P.renderBullet.call(e,U,P.bulletClass):D+=`<${P.bulletElement} ${e.isElement?'part="bullet"':""} class="${P.bulletClass}"></${P.bulletElement}>`}P.type==="fraction"&&(P.renderFraction?D=P.renderFraction.call(e,P.currentClass,P.totalClass):D=`<span class="${P.currentClass}"></span> / <span class="${P.totalClass}"></span>`),P.type==="progressbar"&&(P.renderProgressbar?D=P.renderProgressbar.call(e,P.progressbarFillClass):D=`<span class="${P.progressbarFillClass}"></span>`),e.pagination.bullets=[],B.forEach(G=>{P.type!=="custom"&&Yn(G,D||""),P.type==="bullets"&&e.pagination.bullets.push(...G.querySelectorAll(nr(P.bulletClass)))}),P.type!=="custom"&&a("paginationRender",B[0])}function E(){e.params.pagination=m_(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const P=e.params.pagination;if(!P.el)return;let M;typeof P.el=="string"&&e.isElement&&(M=e.el.querySelector(P.el)),!M&&typeof P.el=="string"&&(M=[...document.querySelectorAll(P.el)]),M||(M=P.el),!(!M||M.length===0)&&(e.params.uniqueNavElements&&typeof P.el=="string"&&Array.isArray(M)&&M.length>1&&(M=[...e.el.querySelectorAll(P.el)],M.length>1&&(M=M.find(B=>Ga(B,".swiper")[0]===e.el))),Array.isArray(M)&&M.length===1&&(M=M[0]),Object.assign(e.pagination,{el:M}),M=At(M),M.forEach(B=>{P.type==="bullets"&&P.clickable&&B.classList.add(...(P.clickableClass||"").split(" ")),B.classList.add(P.modifierClass+P.type),B.classList.add(e.isHorizontal()?P.horizontalClass:P.verticalClass),P.type==="bullets"&&P.dynamicBullets&&(B.classList.add(`${P.modifierClass}${P.type}-dynamic`),d=0,P.dynamicMainBullets<1&&(P.dynamicMainBullets=1)),P.type==="progressbar"&&P.progressbarOpposite&&B.classList.add(P.progressbarOppositeClass),P.clickable&&B.addEventListener("click",_),e.enabled||B.classList.add(P.lockClass)}))}function C(){const P=e.params.pagination;if(p())return;let M=e.pagination.el;M&&(M=At(M),M.forEach(B=>{B.classList.remove(P.hiddenClass),B.classList.remove(P.modifierClass+P.type),B.classList.remove(e.isHorizontal()?P.horizontalClass:P.verticalClass),P.clickable&&(B.classList.remove(...(P.clickableClass||"").split(" ")),B.removeEventListener("click",_))})),e.pagination.bullets&&e.pagination.bullets.forEach(B=>B.classList.remove(...P.bulletActiveClass.split(" ")))}i("changeDirection",()=>{if(!e.pagination||!e.pagination.el)return;const P=e.params.pagination;let{el:M}=e.pagination;M=At(M),M.forEach(B=>{B.classList.remove(P.horizontalClass,P.verticalClass),B.classList.add(e.isHorizontal()?P.horizontalClass:P.verticalClass)})}),i("init",()=>{e.params.pagination.enabled===!1?x():(E(),w(),b())}),i("activeIndexChange",()=>{typeof e.snapIndex>"u"&&b()}),i("snapIndexChange",()=>{b()}),i("snapGridLengthChange",()=>{w(),b()}),i("destroy",()=>{C()}),i("enable disable",()=>{let{el:P}=e.pagination;P&&(P=At(P),P.forEach(M=>M.classList[e.enabled?"remove":"add"](e.params.pagination.lockClass)))}),i("lock unlock",()=>{b()}),i("click",(P,M)=>{const B=M.target,D=At(e.pagination.el);if(e.params.pagination.el&&e.params.pagination.hideOnClick&&D&&D.length>0&&!B.classList.contains(e.params.pagination.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&B===e.navigation.nextEl||e.navigation.prevEl&&B===e.navigation.prevEl))return;const G=D[0].classList.contains(e.params.pagination.hiddenClass);a(G===!0?"paginationShow":"paginationHide"),D.forEach(U=>U.classList.toggle(e.params.pagination.hiddenClass))}});const T=()=>{e.el.classList.remove(e.params.pagination.paginationDisabledClass);let{el:P}=e.pagination;P&&(P=At(P),P.forEach(M=>M.classList.remove(e.params.pagination.paginationDisabledClass))),E(),w(),b()},x=()=>{e.el.classList.add(e.params.pagination.paginationDisabledClass);let{el:P}=e.pagination;P&&(P=At(P),P.forEach(M=>M.classList.add(e.params.pagination.paginationDisabledClass))),C()};Object.assign(e.pagination,{enable:T,disable:x,render:w,update:b,init:E,destroy:C})}function _F(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=Li();let u=!1,d=null,p=null,m,A,_,b;t({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),e.scrollbar={el:null,dragEl:null};function w(){if(!e.params.scrollbar.el||!e.scrollbar.el)return;const{scrollbar:Z,rtlTranslate:K}=e,{dragEl:s,el:H}=Z,y=e.params.scrollbar,ee=e.params.loop?e.progressLoop:e.progress;let I=A,re=(_-A)*ee;K?(re=-re,re>0?(I=A-re,re=0):-re+A>_&&(I=_+re)):re<0?(I=A+re,re=0):re+A>_&&(I=_-re),e.isHorizontal()?(s.style.transform=`translate3d(${re}px, 0, 0)`,s.style.width=`${I}px`):(s.style.transform=`translate3d(0px, ${re}px, 0)`,s.style.height=`${I}px`),y.hide&&(clearTimeout(d),H.style.opacity=1,d=setTimeout(()=>{H.style.opacity=0,H.style.transitionDuration="400ms"},1e3))}function E(Z){!e.params.scrollbar.el||!e.scrollbar.el||(e.scrollbar.dragEl.style.transitionDuration=`${Z}ms`)}function C(){if(!e.params.scrollbar.el||!e.scrollbar.el)return;const{scrollbar:Z}=e,{dragEl:K,el:s}=Z;K.style.width="",K.style.height="",_=e.isHorizontal()?s.offsetWidth:s.offsetHeight,b=e.size/(e.virtualSize+e.params.slidesOffsetBefore-(e.params.centeredSlides?e.snapGrid[0]:0)),e.params.scrollbar.dragSize==="auto"?A=_*b:A=parseInt(e.params.scrollbar.dragSize,10),e.isHorizontal()?K.style.width=`${A}px`:K.style.height=`${A}px`,b>=1?s.style.display="none":s.style.display="",e.params.scrollbar.hide&&(s.style.opacity=0),e.params.watchOverflow&&e.enabled&&Z.el.classList[e.isLocked?"add":"remove"](e.params.scrollbar.lockClass)}function T(Z){return e.isHorizontal()?Z.clientX:Z.clientY}function x(Z){const{scrollbar:K,rtlTranslate:s}=e,{el:H}=K;let y;y=(T(Z)-Af(H)[e.isHorizontal()?"left":"top"]-(m!==null?m:A/2))/(_-A),y=Math.max(Math.min(y,1),0),s&&(y=1-y);const ee=e.minTranslate()+(e.maxTranslate()-e.minTranslate())*y;e.updateProgress(ee),e.setTranslate(ee),e.updateActiveIndex(),e.updateSlidesClasses()}function P(Z){const K=e.params.scrollbar,{scrollbar:s,wrapperEl:H}=e,{el:y,dragEl:ee}=s;u=!0,m=Z.target===ee?T(Z)-Z.target.getBoundingClientRect()[e.isHorizontal()?"left":"top"]:null,Z.preventDefault(),Z.stopPropagation(),H.style.transitionDuration="100ms",ee.style.transitionDuration="100ms",x(Z),clearTimeout(p),y.style.transitionDuration="0ms",K.hide&&(y.style.opacity=1),e.params.cssMode&&(e.wrapperEl.style["scroll-snap-type"]="none"),a("scrollbarDragStart",Z)}function M(Z){const{scrollbar:K,wrapperEl:s}=e,{el:H,dragEl:y}=K;u&&(Z.preventDefault&&Z.cancelable?Z.preventDefault():Z.returnValue=!1,x(Z),s.style.transitionDuration="0ms",H.style.transitionDuration="0ms",y.style.transitionDuration="0ms",a("scrollbarDragMove",Z))}function B(Z){const K=e.params.scrollbar,{scrollbar:s,wrapperEl:H}=e,{el:y}=s;u&&(u=!1,e.params.cssMode&&(e.wrapperEl.style["scroll-snap-type"]="",H.style.transitionDuration=""),K.hide&&(clearTimeout(p),p=Dl(()=>{y.style.opacity=0,y.style.transitionDuration="400ms"},1e3)),a("scrollbarDragEnd",Z),K.snapOnRelease&&e.slideToClosest())}function D(Z){const{scrollbar:K,params:s}=e,H=K.el;if(!H)return;const y=H,ee=s.passiveListeners?{passive:!1,capture:!1}:!1,I=s.passiveListeners?{passive:!0,capture:!1}:!1;if(!y)return;const re=Z==="on"?"addEventListener":"removeEventListener";y[re]("pointerdown",P,ee),l[re]("pointermove",M,ee),l[re]("pointerup",B,I)}function G(){!e.params.scrollbar.el||!e.scrollbar.el||D("on")}function U(){!e.params.scrollbar.el||!e.scrollbar.el||D("off")}function V(){const{scrollbar:Z,el:K}=e;e.params.scrollbar=m_(e,e.originalParams.scrollbar,e.params.scrollbar,{el:"swiper-scrollbar"});const s=e.params.scrollbar;if(!s.el)return;let H;if(typeof s.el=="string"&&e.isElement&&(H=e.el.querySelector(s.el)),!H&&typeof s.el=="string"){if(H=l.querySelectorAll(s.el),!H.length)return}else H||(H=s.el);e.params.uniqueNavElements&&typeof s.el=="string"&&H.length>1&&K.querySelectorAll(s.el).length===1&&(H=K.querySelector(s.el)),H.length>0&&(H=H[0]),H.classList.add(e.isHorizontal()?s.horizontalClass:s.verticalClass);let y;H&&(y=H.querySelector(nr(e.params.scrollbar.dragClass)),y||(y=Pn("div",e.params.scrollbar.dragClass),H.append(y))),Object.assign(Z,{el:H,dragEl:y}),s.draggable&&G(),H&&H.classList[e.enabled?"remove":"add"](...Sr(e.params.scrollbar.lockClass))}function k(){const Z=e.params.scrollbar,K=e.scrollbar.el;K&&K.classList.remove(...Sr(e.isHorizontal()?Z.horizontalClass:Z.verticalClass)),U()}i("changeDirection",()=>{if(!e.scrollbar||!e.scrollbar.el)return;const Z=e.params.scrollbar;let{el:K}=e.scrollbar;K=At(K),K.forEach(s=>{s.classList.remove(Z.horizontalClass,Z.verticalClass),s.classList.add(e.isHorizontal()?Z.horizontalClass:Z.verticalClass)})}),i("init",()=>{e.params.scrollbar.enabled===!1?Q():(V(),C(),w())}),i("update resize observerUpdate lock unlock changeDirection",()=>{C()}),i("setTranslate",()=>{w()}),i("setTransition",(Z,K)=>{E(K)}),i("enable disable",()=>{const{el:Z}=e.scrollbar;Z&&Z.classList[e.enabled?"remove":"add"](...Sr(e.params.scrollbar.lockClass))}),i("destroy",()=>{k()});const z=()=>{e.el.classList.remove(...Sr(e.params.scrollbar.scrollbarDisabledClass)),e.scrollbar.el&&e.scrollbar.el.classList.remove(...Sr(e.params.scrollbar.scrollbarDisabledClass)),V(),C(),w()},Q=()=>{e.el.classList.add(...Sr(e.params.scrollbar.scrollbarDisabledClass)),e.scrollbar.el&&e.scrollbar.el.classList.add(...Sr(e.params.scrollbar.scrollbarDisabledClass)),k()};Object.assign(e.scrollbar,{enable:z,disable:Q,updateSize:C,setTranslate:w,init:V,destroy:k})}function yF(o){let{swiper:e,extendParams:t,on:i}=o;t({parallax:{enabled:!1}});const a="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",l=(p,m)=>{const{rtl:A}=e,_=A?-1:1,b=p.getAttribute("data-swiper-parallax")||"0";let w=p.getAttribute("data-swiper-parallax-x"),E=p.getAttribute("data-swiper-parallax-y");const C=p.getAttribute("data-swiper-parallax-scale"),T=p.getAttribute("data-swiper-parallax-opacity"),x=p.getAttribute("data-swiper-parallax-rotate");if(w||E?(w=w||"0",E=E||"0"):e.isHorizontal()?(w=b,E="0"):(E=b,w="0"),w.indexOf("%")>=0?w=`${parseInt(w,10)*m*_}%`:w=`${w*m*_}px`,E.indexOf("%")>=0?E=`${parseInt(E,10)*m}%`:E=`${E*m}px`,typeof T<"u"&&T!==null){const M=T-(T-1)*(1-Math.abs(m));p.style.opacity=M}let P=`translate3d(${w}, ${E}, 0px)`;if(typeof C<"u"&&C!==null){const M=C-(C-1)*(1-Math.abs(m));P+=` scale(${M})`}if(x&&typeof x<"u"&&x!==null){const M=x*m*-1;P+=` rotate(${M}deg)`}p.style.transform=P},u=()=>{const{el:p,slides:m,progress:A,snapGrid:_,isElement:b}=e,w=Ui(p,a);e.isElement&&w.push(...Ui(e.hostEl,a)),w.forEach(E=>{l(E,A)}),m.forEach((E,C)=>{let T=E.progress;e.params.slidesPerGroup>1&&e.params.slidesPerView!=="auto"&&(T+=Math.ceil(C/2)-A*(_.length-1)),T=Math.min(Math.max(T,-1),1),E.querySelectorAll(`${a}, [data-swiper-parallax-rotate]`).forEach(x=>{l(x,T)})})},d=function(p){p===void 0&&(p=e.params.speed);const{el:m,hostEl:A}=e,_=[...m.querySelectorAll(a)];e.isElement&&_.push(...A.querySelectorAll(a)),_.forEach(b=>{let w=parseInt(b.getAttribute("data-swiper-parallax-duration"),10)||p;p===0&&(w=0),b.style.transitionDuration=`${w}ms`})};i("beforeInit",()=>{e.params.parallax.enabled&&(e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)}),i("init",()=>{e.params.parallax.enabled&&u()}),i("setTranslate",()=>{e.params.parallax.enabled&&u()}),i("setTransition",(p,m)=>{e.params.parallax.enabled&&d(m)})}function bF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=ti();t({zoom:{enabled:!1,limitToOriginalSize:!1,maxRatio:3,minRatio:1,panOnMouseMove:!1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),e.zoom={enabled:!1};let u=1,d=!1,p=!1,m={x:0,y:0};const A=-3;let _,b;const w=[],E={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},C={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},T={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let x=1;Object.defineProperty(e.zoom,"scale",{get(){return x},set(h){if(x!==h){const f=E.imageEl,g=E.slideEl;a("zoomChange",h,f,g)}x=h}});function P(){if(w.length<2)return 1;const h=w[0].pageX,f=w[0].pageY,g=w[1].pageX,v=w[1].pageY;return Math.sqrt((g-h)**2+(v-f)**2)}function M(){const h=e.params.zoom,f=E.imageWrapEl.getAttribute("data-swiper-zoom")||h.maxRatio;if(h.limitToOriginalSize&&E.imageEl&&E.imageEl.naturalWidth){const g=E.imageEl.naturalWidth/E.imageEl.offsetWidth;return Math.min(g,f)}return f}function B(){if(w.length<2)return{x:null,y:null};const h=E.imageEl.getBoundingClientRect();return[(w[0].pageX+(w[1].pageX-w[0].pageX)/2-h.x-l.scrollX)/u,(w[0].pageY+(w[1].pageY-w[0].pageY)/2-h.y-l.scrollY)/u]}function D(){return e.isElement?"swiper-slide":`.${e.params.slideClass}`}function G(h){const f=D();return!!(h.target.matches(f)||e.slides.filter(g=>g.contains(h.target)).length>0)}function U(h){const f=`.${e.params.zoom.containerClass}`;return!!(h.target.matches(f)||[...e.hostEl.querySelectorAll(f)].filter(g=>g.contains(h.target)).length>0)}function V(h){if(h.pointerType==="mouse"&&w.splice(0,w.length),!G(h))return;const f=e.params.zoom;if(_=!1,b=!1,w.push(h),!(w.length<2)){if(_=!0,E.scaleStart=P(),!E.slideEl){E.slideEl=h.target.closest(`.${e.params.slideClass}, swiper-slide`),E.slideEl||(E.slideEl=e.slides[e.activeIndex]);let g=E.slideEl.querySelector(`.${f.containerClass}`);if(g&&(g=g.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=g,g?E.imageWrapEl=Ga(E.imageEl,`.${f.containerClass}`)[0]:E.imageWrapEl=void 0,!E.imageWrapEl){E.imageEl=void 0;return}E.maxRatio=M()}if(E.imageEl){const[g,v]=B();E.originX=g,E.originY=v,E.imageEl.style.transitionDuration="0ms"}d=!0}}function k(h){if(!G(h))return;const f=e.params.zoom,g=e.zoom,v=w.findIndex(S=>S.pointerId===h.pointerId);v>=0&&(w[v]=h),!(w.length<2)&&(b=!0,E.scaleMove=P(),E.imageEl&&(g.scale=E.scaleMove/E.scaleStart*u,g.scale>E.maxRatio&&(g.scale=E.maxRatio-1+(g.scale-E.maxRatio+1)**.5),g.scale<f.minRatio&&(g.scale=f.minRatio+1-(f.minRatio-g.scale+1)**.5),E.imageEl.style.transform=`translate3d(0,0,0) scale(${g.scale})`))}function z(h){if(!G(h)||h.pointerType==="mouse"&&h.type==="pointerout")return;const f=e.params.zoom,g=e.zoom,v=w.findIndex(S=>S.pointerId===h.pointerId);v>=0&&w.splice(v,1),!(!_||!b)&&(_=!1,b=!1,E.imageEl&&(g.scale=Math.max(Math.min(g.scale,E.maxRatio),f.minRatio),E.imageEl.style.transitionDuration=`${e.params.speed}ms`,E.imageEl.style.transform=`translate3d(0,0,0) scale(${g.scale})`,u=g.scale,d=!1,g.scale>1&&E.slideEl?E.slideEl.classList.add(`${f.zoomedSlideClass}`):g.scale<=1&&E.slideEl&&E.slideEl.classList.remove(`${f.zoomedSlideClass}`),g.scale===1&&(E.originX=0,E.originY=0,E.slideEl=void 0)))}let Q;function Z(){e.touchEventsData.preventTouchMoveFromPointerMove=!1}function K(){clearTimeout(Q),e.touchEventsData.preventTouchMoveFromPointerMove=!0,Q=setTimeout(()=>{e.destroyed||Z()})}function s(h){const f=e.device;if(!E.imageEl||C.isTouched)return;f.android&&h.cancelable&&h.preventDefault(),C.isTouched=!0;const g=w.length>0?w[0]:h;C.touchesStart.x=g.pageX,C.touchesStart.y=g.pageY}function H(h){const g=h.pointerType==="mouse"&&e.params.zoom.panOnMouseMove;if(!G(h)||!U(h))return;const v=e.zoom;if(!E.imageEl)return;if(!C.isTouched||!E.slideEl){g&&I(h);return}if(g){I(h);return}C.isMoved||(C.width=E.imageEl.offsetWidth||E.imageEl.clientWidth,C.height=E.imageEl.offsetHeight||E.imageEl.clientHeight,C.startX=HA(E.imageWrapEl,"x")||0,C.startY=HA(E.imageWrapEl,"y")||0,E.slideWidth=E.slideEl.offsetWidth,E.slideHeight=E.slideEl.offsetHeight,E.imageWrapEl.style.transitionDuration="0ms");const S=C.width*v.scale,R=C.height*v.scale;if(C.minX=Math.min(E.slideWidth/2-S/2,0),C.maxX=-C.minX,C.minY=Math.min(E.slideHeight/2-R/2,0),C.maxY=-C.minY,C.touchesCurrent.x=w.length>0?w[0].pageX:h.pageX,C.touchesCurrent.y=w.length>0?w[0].pageY:h.pageY,Math.max(Math.abs(C.touchesCurrent.x-C.touchesStart.x),Math.abs(C.touchesCurrent.y-C.touchesStart.y))>5&&(e.allowClick=!1),!C.isMoved&&!d){if(e.isHorizontal()&&(Math.floor(C.minX)===Math.floor(C.startX)&&C.touchesCurrent.x<C.touchesStart.x||Math.floor(C.maxX)===Math.floor(C.startX)&&C.touchesCurrent.x>C.touchesStart.x)){C.isTouched=!1,Z();return}if(!e.isHorizontal()&&(Math.floor(C.minY)===Math.floor(C.startY)&&C.touchesCurrent.y<C.touchesStart.y||Math.floor(C.maxY)===Math.floor(C.startY)&&C.touchesCurrent.y>C.touchesStart.y)){C.isTouched=!1,Z();return}}h.cancelable&&h.preventDefault(),h.stopPropagation(),K(),C.isMoved=!0;const F=(v.scale-u)/(E.maxRatio-e.params.zoom.minRatio),{originX:$,originY:O}=E;C.currentX=C.touchesCurrent.x-C.touchesStart.x+C.startX+F*(C.width-$*2),C.currentY=C.touchesCurrent.y-C.touchesStart.y+C.startY+F*(C.height-O*2),C.currentX<C.minX&&(C.currentX=C.minX+1-(C.minX-C.currentX+1)**.8),C.currentX>C.maxX&&(C.currentX=C.maxX-1+(C.currentX-C.maxX+1)**.8),C.currentY<C.minY&&(C.currentY=C.minY+1-(C.minY-C.currentY+1)**.8),C.currentY>C.maxY&&(C.currentY=C.maxY-1+(C.currentY-C.maxY+1)**.8),T.prevPositionX||(T.prevPositionX=C.touchesCurrent.x),T.prevPositionY||(T.prevPositionY=C.touchesCurrent.y),T.prevTime||(T.prevTime=Date.now()),T.x=(C.touchesCurrent.x-T.prevPositionX)/(Date.now()-T.prevTime)/2,T.y=(C.touchesCurrent.y-T.prevPositionY)/(Date.now()-T.prevTime)/2,Math.abs(C.touchesCurrent.x-T.prevPositionX)<2&&(T.x=0),Math.abs(C.touchesCurrent.y-T.prevPositionY)<2&&(T.y=0),T.prevPositionX=C.touchesCurrent.x,T.prevPositionY=C.touchesCurrent.y,T.prevTime=Date.now(),E.imageWrapEl.style.transform=`translate3d(${C.currentX}px, ${C.currentY}px,0)`}function y(){const h=e.zoom;if(w.length=0,!E.imageEl)return;if(!C.isTouched||!C.isMoved){C.isTouched=!1,C.isMoved=!1;return}C.isTouched=!1,C.isMoved=!1;let f=300,g=300;const v=T.x*f,S=C.currentX+v,R=T.y*g,L=C.currentY+R;T.x!==0&&(f=Math.abs((S-C.currentX)/T.x)),T.y!==0&&(g=Math.abs((L-C.currentY)/T.y));const F=Math.max(f,g);C.currentX=S,C.currentY=L;const $=C.width*h.scale,O=C.height*h.scale;C.minX=Math.min(E.slideWidth/2-$/2,0),C.maxX=-C.minX,C.minY=Math.min(E.slideHeight/2-O/2,0),C.maxY=-C.minY,C.currentX=Math.max(Math.min(C.currentX,C.maxX),C.minX),C.currentY=Math.max(Math.min(C.currentY,C.maxY),C.minY),E.imageWrapEl.style.transitionDuration=`${F}ms`,E.imageWrapEl.style.transform=`translate3d(${C.currentX}px, ${C.currentY}px,0)`}function ee(){const h=e.zoom;E.slideEl&&e.activeIndex!==e.slides.indexOf(E.slideEl)&&(E.imageEl&&(E.imageEl.style.transform="translate3d(0,0,0) scale(1)"),E.imageWrapEl&&(E.imageWrapEl.style.transform="translate3d(0,0,0)"),E.slideEl.classList.remove(`${e.params.zoom.zoomedSlideClass}`),h.scale=1,u=1,E.slideEl=void 0,E.imageEl=void 0,E.imageWrapEl=void 0,E.originX=0,E.originY=0)}function I(h){if(u<=1||!E.imageWrapEl||!G(h)||!U(h))return;const f=l.getComputedStyle(E.imageWrapEl).transform,g=new l.DOMMatrix(f);if(!p){p=!0,m.x=h.clientX,m.y=h.clientY,C.startX=g.e,C.startY=g.f,C.width=E.imageEl.offsetWidth||E.imageEl.clientWidth,C.height=E.imageEl.offsetHeight||E.imageEl.clientHeight,E.slideWidth=E.slideEl.offsetWidth,E.slideHeight=E.slideEl.offsetHeight;return}const v=(h.clientX-m.x)*A,S=(h.clientY-m.y)*A,R=C.width*u,L=C.height*u,F=E.slideWidth,$=E.slideHeight,O=Math.min(F/2-R/2,0),W=-O,Y=Math.min($/2-L/2,0),te=-Y,X=Math.max(Math.min(C.startX+v,W),O),ie=Math.max(Math.min(C.startY+S,te),Y);E.imageWrapEl.style.transitionDuration="0ms",E.imageWrapEl.style.transform=`translate3d(${X}px, ${ie}px, 0)`,m.x=h.clientX,m.y=h.clientY,C.startX=X,C.startY=ie,C.currentX=X,C.currentY=ie}function re(h){const f=e.zoom,g=e.params.zoom;if(!E.slideEl){h&&h.target&&(E.slideEl=h.target.closest(`.${e.params.slideClass}, swiper-slide`)),E.slideEl||(e.params.virtual&&e.params.virtual.enabled&&e.virtual?E.slideEl=Ui(e.slidesEl,`.${e.params.slideActiveClass}`)[0]:E.slideEl=e.slides[e.activeIndex]);let Le=E.slideEl.querySelector(`.${g.containerClass}`);Le&&(Le=Le.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=Le,Le?E.imageWrapEl=Ga(E.imageEl,`.${g.containerClass}`)[0]:E.imageWrapEl=void 0}if(!E.imageEl||!E.imageWrapEl)return;e.params.cssMode&&(e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.touchAction="none"),E.slideEl.classList.add(`${g.zoomedSlideClass}`);let v,S,R,L,F,$,O,W,Y,te,X,ie,de,q,j,ae,ge,fe;typeof C.touchesStart.x>"u"&&h?(v=h.pageX,S=h.pageY):(v=C.touchesStart.x,S=C.touchesStart.y);const ue=u,ve=typeof h=="number"?h:null;u===1&&ve&&(v=void 0,S=void 0,C.touchesStart.x=void 0,C.touchesStart.y=void 0);const Re=M();f.scale=ve||Re,u=ve||Re,h&&!(u===1&&ve)?(ge=E.slideEl.offsetWidth,fe=E.slideEl.offsetHeight,R=Af(E.slideEl).left+l.scrollX,L=Af(E.slideEl).top+l.scrollY,F=R+ge/2-v,$=L+fe/2-S,Y=E.imageEl.offsetWidth||E.imageEl.clientWidth,te=E.imageEl.offsetHeight||E.imageEl.clientHeight,X=Y*f.scale,ie=te*f.scale,de=Math.min(ge/2-X/2,0),q=Math.min(fe/2-ie/2,0),j=-de,ae=-q,ue>0&&ve&&typeof C.currentX=="number"&&typeof C.currentY=="number"?(O=C.currentX*f.scale/ue,W=C.currentY*f.scale/ue):(O=F*f.scale,W=$*f.scale),O<de&&(O=de),O>j&&(O=j),W<q&&(W=q),W>ae&&(W=ae)):(O=0,W=0),ve&&f.scale===1&&(E.originX=0,E.originY=0),C.currentX=O,C.currentY=W,E.imageWrapEl.style.transitionDuration="300ms",E.imageWrapEl.style.transform=`translate3d(${O}px, ${W}px,0)`,E.imageEl.style.transitionDuration="300ms",E.imageEl.style.transform=`translate3d(0,0,0) scale(${f.scale})`}function Ae(){const h=e.zoom,f=e.params.zoom;if(!E.slideEl){e.params.virtual&&e.params.virtual.enabled&&e.virtual?E.slideEl=Ui(e.slidesEl,`.${e.params.slideActiveClass}`)[0]:E.slideEl=e.slides[e.activeIndex];let g=E.slideEl.querySelector(`.${f.containerClass}`);g&&(g=g.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=g,g?E.imageWrapEl=Ga(E.imageEl,`.${f.containerClass}`)[0]:E.imageWrapEl=void 0}!E.imageEl||!E.imageWrapEl||(e.params.cssMode&&(e.wrapperEl.style.overflow="",e.wrapperEl.style.touchAction=""),h.scale=1,u=1,C.currentX=void 0,C.currentY=void 0,C.touchesStart.x=void 0,C.touchesStart.y=void 0,E.imageWrapEl.style.transitionDuration="300ms",E.imageWrapEl.style.transform="translate3d(0,0,0)",E.imageEl.style.transitionDuration="300ms",E.imageEl.style.transform="translate3d(0,0,0) scale(1)",E.slideEl.classList.remove(`${f.zoomedSlideClass}`),E.slideEl=void 0,E.originX=0,E.originY=0,e.params.zoom.panOnMouseMove&&(m={x:0,y:0},p&&(p=!1,C.startX=0,C.startY=0)))}function N(h){const f=e.zoom;f.scale&&f.scale!==1?Ae():re(h)}function n(){const h=e.params.passiveListeners?{passive:!0,capture:!1}:!1,f=e.params.passiveListeners?{passive:!1,capture:!0}:!0;return{passiveListener:h,activeListenerWithCapture:f}}function r(){const h=e.zoom;if(h.enabled)return;h.enabled=!0;const{passiveListener:f,activeListenerWithCapture:g}=n();e.wrapperEl.addEventListener("pointerdown",V,f),e.wrapperEl.addEventListener("pointermove",k,g),["pointerup","pointercancel","pointerout"].forEach(v=>{e.wrapperEl.addEventListener(v,z,f)}),e.wrapperEl.addEventListener("pointermove",H,g)}function c(){const h=e.zoom;if(!h.enabled)return;h.enabled=!1;const{passiveListener:f,activeListenerWithCapture:g}=n();e.wrapperEl.removeEventListener("pointerdown",V,f),e.wrapperEl.removeEventListener("pointermove",k,g),["pointerup","pointercancel","pointerout"].forEach(v=>{e.wrapperEl.removeEventListener(v,z,f)}),e.wrapperEl.removeEventListener("pointermove",H,g)}i("init",()=>{e.params.zoom.enabled&&r()}),i("destroy",()=>{c()}),i("touchStart",(h,f)=>{e.zoom.enabled&&s(f)}),i("touchEnd",(h,f)=>{e.zoom.enabled&&y()}),i("doubleTap",(h,f)=>{!e.animating&&e.params.zoom.enabled&&e.zoom.enabled&&e.params.zoom.toggle&&N(f)}),i("transitionEnd",()=>{e.zoom.enabled&&e.params.zoom.enabled&&ee()}),i("slideChange",()=>{e.zoom.enabled&&e.params.zoom.enabled&&e.params.cssMode&&ee()}),Object.assign(e.zoom,{enable:r,disable:c,in:re,out:Ae,toggle:N})}function vF(o){let{swiper:e,extendParams:t,on:i}=o;t({controller:{control:void 0,inverse:!1,by:"slide"}}),e.controller={control:void 0};function a(m,A){const _=(function(){let C,T,x;return(P,M)=>{for(T=-1,C=P.length;C-T>1;)x=C+T>>1,P[x]<=M?T=x:C=x;return C}})();this.x=m,this.y=A,this.lastIndex=m.length-1;let b,w;return this.interpolate=function(C){return C?(w=_(this.x,C),b=w-1,(C-this.x[b])*(this.y[w]-this.y[b])/(this.x[w]-this.x[b])+this.y[b]):0},this}function l(m){e.controller.spline=e.params.loop?new a(e.slidesGrid,m.slidesGrid):new a(e.snapGrid,m.snapGrid)}function u(m,A){const _=e.controller.control;let b,w;const E=e.constructor;function C(T){if(T.destroyed)return;const x=e.rtlTranslate?-e.translate:e.translate;e.params.controller.by==="slide"&&(l(T),w=-e.controller.spline.interpolate(-x)),(!w||e.params.controller.by==="container")&&(b=(T.maxTranslate()-T.minTranslate())/(e.maxTranslate()-e.minTranslate()),(Number.isNaN(b)||!Number.isFinite(b))&&(b=1),w=(x-e.minTranslate())*b+T.minTranslate()),e.params.controller.inverse&&(w=T.maxTranslate()-w),T.updateProgress(w),T.setTranslate(w,e),T.updateActiveIndex(),T.updateSlidesClasses()}if(Array.isArray(_))for(let T=0;T<_.length;T+=1)_[T]!==A&&_[T]instanceof E&&C(_[T]);else _ instanceof E&&A!==_&&C(_)}function d(m,A){const _=e.constructor,b=e.controller.control;let w;function E(C){C.destroyed||(C.setTransition(m,e),m!==0&&(C.transitionStart(),C.params.autoHeight&&Dl(()=>{C.updateAutoHeight()}),pu(C.wrapperEl,()=>{b&&C.transitionEnd()})))}if(Array.isArray(b))for(w=0;w<b.length;w+=1)b[w]!==A&&b[w]instanceof _&&E(b[w]);else b instanceof _&&A!==b&&E(b)}function p(){e.controller.control&&e.controller.spline&&(e.controller.spline=void 0,delete e.controller.spline)}i("beforeInit",()=>{if(typeof window<"u"&&(typeof e.params.controller.control=="string"||e.params.controller.control instanceof HTMLElement)){(typeof e.params.controller.control=="string"?[...document.querySelectorAll(e.params.controller.control)]:[e.params.controller.control]).forEach(A=>{if(e.controller.control||(e.controller.control=[]),A&&A.swiper)e.controller.control.push(A.swiper);else if(A){const _=`${e.params.eventsPrefix}init`,b=w=>{e.controller.control.push(w.detail[0]),e.update(),A.removeEventListener(_,b)};A.addEventListener(_,b)}});return}e.controller.control=e.params.controller.control}),i("update",()=>{p()}),i("resize",()=>{p()}),i("observerUpdate",()=>{p()}),i("setTranslate",(m,A,_)=>{!e.controller.control||e.controller.control.destroyed||e.controller.setTranslate(A,_)}),i("setTransition",(m,A,_)=>{!e.controller.control||e.controller.control.destroyed||e.controller.setTransition(A,_)}),Object.assign(e.controller,{setTranslate:u,setTransition:d})}function wF(o){let{swiper:e,extendParams:t,on:i}=o;t({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,containerRole:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null,scrollOnFocus:!0}}),e.a11y={clicked:!1};let a=null,l,u,d=new Date().getTime();function p(ee){const I=a;I.length!==0&&Yn(I,ee)}function m(ee){const I=()=>Math.round(16*Math.random()).toString(16);return"x".repeat(ee).replace(/x/g,I)}function A(ee){ee=At(ee),ee.forEach(I=>{I.setAttribute("tabIndex","0")})}function _(ee){ee=At(ee),ee.forEach(I=>{I.setAttribute("tabIndex","-1")})}function b(ee,I){ee=At(ee),ee.forEach(re=>{re.setAttribute("role",I)})}function w(ee,I){ee=At(ee),ee.forEach(re=>{re.setAttribute("aria-roledescription",I)})}function E(ee,I){ee=At(ee),ee.forEach(re=>{re.setAttribute("aria-controls",I)})}function C(ee,I){ee=At(ee),ee.forEach(re=>{re.setAttribute("aria-label",I)})}function T(ee,I){ee=At(ee),ee.forEach(re=>{re.setAttribute("id",I)})}function x(ee,I){ee=At(ee),ee.forEach(re=>{re.setAttribute("aria-live",I)})}function P(ee){ee=At(ee),ee.forEach(I=>{I.setAttribute("aria-disabled",!0)})}function M(ee){ee=At(ee),ee.forEach(I=>{I.setAttribute("aria-disabled",!1)})}function B(ee){if(ee.keyCode!==13&&ee.keyCode!==32)return;const I=e.params.a11y,re=ee.target;if(!(e.pagination&&e.pagination.el&&(re===e.pagination.el||e.pagination.el.contains(ee.target))&&!ee.target.matches(nr(e.params.pagination.bulletClass)))){if(e.navigation&&e.navigation.prevEl&&e.navigation.nextEl){const Ae=At(e.navigation.prevEl);At(e.navigation.nextEl).includes(re)&&(e.isEnd&&!e.params.loop||e.slideNext(),e.isEnd?p(I.lastSlideMessage):p(I.nextSlideMessage)),Ae.includes(re)&&(e.isBeginning&&!e.params.loop||e.slidePrev(),e.isBeginning?p(I.firstSlideMessage):p(I.prevSlideMessage))}e.pagination&&re.matches(nr(e.params.pagination.bulletClass))&&re.click()}}function D(){if(e.params.loop||e.params.rewind||!e.navigation)return;const{nextEl:ee,prevEl:I}=e.navigation;I&&(e.isBeginning?(P(I),_(I)):(M(I),A(I))),ee&&(e.isEnd?(P(ee),_(ee)):(M(ee),A(ee)))}function G(){return e.pagination&&e.pagination.bullets&&e.pagination.bullets.length}function U(){return G()&&e.params.pagination.clickable}function V(){const ee=e.params.a11y;G()&&e.pagination.bullets.forEach(I=>{e.params.pagination.clickable&&(A(I),e.params.pagination.renderBullet||(b(I,"button"),C(I,ee.paginationBulletMessage.replace(/\{\{index\}\}/,Mu(I)+1)))),I.matches(nr(e.params.pagination.bulletActiveClass))?I.setAttribute("aria-current","true"):I.removeAttribute("aria-current")})}const k=(ee,I,re)=>{A(ee),ee.tagName!=="BUTTON"&&(b(ee,"button"),ee.addEventListener("keydown",B)),C(ee,re),E(ee,I)},z=ee=>{u&&u!==ee.target&&!u.contains(ee.target)&&(l=!0),e.a11y.clicked=!0},Q=()=>{l=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.destroyed||(e.a11y.clicked=!1)})})},Z=ee=>{d=new Date().getTime()},K=ee=>{if(e.a11y.clicked||!e.params.a11y.scrollOnFocus||new Date().getTime()-d<100)return;const I=ee.target.closest(`.${e.params.slideClass}, swiper-slide`);if(!I||!e.slides.includes(I))return;u=I;const re=e.slides.indexOf(I)===e.activeIndex,Ae=e.params.watchSlidesProgress&&e.visibleSlides&&e.visibleSlides.includes(I);re||Ae||ee.sourceCapabilities&&ee.sourceCapabilities.firesTouchEvents||(e.isHorizontal()?e.el.scrollLeft=0:e.el.scrollTop=0,requestAnimationFrame(()=>{l||(e.params.loop?e.slideToLoop(e.getSlideIndexWhenGrid(parseInt(I.getAttribute("data-swiper-slide-index"))),0):e.slideTo(e.getSlideIndexWhenGrid(e.slides.indexOf(I)),0),l=!1)}))},s=()=>{const ee=e.params.a11y;ee.itemRoleDescriptionMessage&&w(e.slides,ee.itemRoleDescriptionMessage),ee.slideRole&&b(e.slides,ee.slideRole);const I=e.slides.length;ee.slideLabelMessage&&e.slides.forEach((re,Ae)=>{const N=e.params.loop?parseInt(re.getAttribute("data-swiper-slide-index"),10):Ae,n=ee.slideLabelMessage.replace(/\{\{index\}\}/,N+1).replace(/\{\{slidesLength\}\}/,I);C(re,n)})},H=()=>{const ee=e.params.a11y;e.el.append(a);const I=e.el;ee.containerRoleDescriptionMessage&&w(I,ee.containerRoleDescriptionMessage),ee.containerMessage&&C(I,ee.containerMessage),ee.containerRole&&b(I,ee.containerRole);const re=e.wrapperEl,Ae=ee.id||re.getAttribute("id")||`swiper-wrapper-${m(16)}`,N=e.params.autoplay&&e.params.autoplay.enabled?"off":"polite";T(re,Ae),x(re,N),s();let{nextEl:n,prevEl:r}=e.navigation?e.navigation:{};n=At(n),r=At(r),n&&n.forEach(h=>k(h,Ae,ee.nextSlideMessage)),r&&r.forEach(h=>k(h,Ae,ee.prevSlideMessage)),U()&&At(e.pagination.el).forEach(f=>{f.addEventListener("keydown",B)}),Li().addEventListener("visibilitychange",Z),e.el.addEventListener("focus",K,!0),e.el.addEventListener("focus",K,!0),e.el.addEventListener("pointerdown",z,!0),e.el.addEventListener("pointerup",Q,!0)};function y(){a&&a.remove();let{nextEl:ee,prevEl:I}=e.navigation?e.navigation:{};ee=At(ee),I=At(I),ee&&ee.forEach(Ae=>Ae.removeEventListener("keydown",B)),I&&I.forEach(Ae=>Ae.removeEventListener("keydown",B)),U()&&At(e.pagination.el).forEach(N=>{N.removeEventListener("keydown",B)}),Li().removeEventListener("visibilitychange",Z),e.el&&typeof e.el!="string"&&(e.el.removeEventListener("focus",K,!0),e.el.removeEventListener("pointerdown",z,!0),e.el.removeEventListener("pointerup",Q,!0))}i("beforeInit",()=>{a=Pn("span",e.params.a11y.notificationClass),a.setAttribute("aria-live","assertive"),a.setAttribute("aria-atomic","true")}),i("afterInit",()=>{e.params.a11y.enabled&&H()}),i("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{e.params.a11y.enabled&&s()}),i("fromEdge toEdge afterInit lock unlock",()=>{e.params.a11y.enabled&&D()}),i("paginationUpdate",()=>{e.params.a11y.enabled&&V()}),i("destroy",()=>{e.params.a11y.enabled&&y()})}function EF(o){let{swiper:e,extendParams:t,on:i}=o;t({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let a=!1,l={};const u=w=>w.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),d=w=>{const E=ti();let C;w?C=new URL(w):C=E.location;const T=C.pathname.slice(1).split("/").filter(B=>B!==""),x=T.length,P=T[x-2],M=T[x-1];return{key:P,value:M}},p=(w,E)=>{const C=ti();if(!a||!e.params.history.enabled)return;let T;e.params.url?T=new URL(e.params.url):T=C.location;const x=e.virtual&&e.params.virtual.enabled?e.slidesEl.querySelector(`[data-swiper-slide-index="${E}"]`):e.slides[E];let P=u(x.getAttribute("data-history"));if(e.params.history.root.length>0){let B=e.params.history.root;B[B.length-1]==="/"&&(B=B.slice(0,B.length-1)),P=`${B}/${w?`${w}/`:""}${P}`}else T.pathname.includes(w)||(P=`${w?`${w}/`:""}${P}`);e.params.history.keepQuery&&(P+=T.search);const M=C.history.state;M&&M.value===P||(e.params.history.replaceState?C.history.replaceState({value:P},null,P):C.history.pushState({value:P},null,P))},m=(w,E,C)=>{if(E)for(let T=0,x=e.slides.length;T<x;T+=1){const P=e.slides[T];if(u(P.getAttribute("data-history"))===E){const B=e.getSlideIndex(P);e.slideTo(B,w,C)}}else e.slideTo(0,w,C)},A=()=>{l=d(e.params.url),m(e.params.speed,l.value,!1)},_=()=>{const w=ti();if(e.params.history){if(!w.history||!w.history.pushState){e.params.history.enabled=!1,e.params.hashNavigation.enabled=!0;return}if(a=!0,l=d(e.params.url),!l.key&&!l.value){e.params.history.replaceState||w.addEventListener("popstate",A);return}m(0,l.value,e.params.runCallbacksOnInit),e.params.history.replaceState||w.addEventListener("popstate",A)}},b=()=>{const w=ti();e.params.history.replaceState||w.removeEventListener("popstate",A)};i("init",()=>{e.params.history.enabled&&_()}),i("destroy",()=>{e.params.history.enabled&&b()}),i("transitionEnd _freeModeNoMomentumRelease",()=>{a&&p(e.params.history.key,e.activeIndex)}),i("slideChange",()=>{a&&e.params.cssMode&&p(e.params.history.key,e.activeIndex)})}function xF(o){let{swiper:e,extendParams:t,emit:i,on:a}=o,l=!1;const u=Li(),d=ti();t({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(b,w){if(e.virtual&&e.params.virtual.enabled){const E=e.slides.find(T=>T.getAttribute("data-hash")===w);return E?parseInt(E.getAttribute("data-swiper-slide-index"),10):0}return e.getSlideIndex(Ui(e.slidesEl,`.${e.params.slideClass}[data-hash="${w}"], swiper-slide[data-hash="${w}"]`)[0])}}});const p=()=>{i("hashChange");const b=u.location.hash.replace("#",""),w=e.virtual&&e.params.virtual.enabled?e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`):e.slides[e.activeIndex],E=w?w.getAttribute("data-hash"):"";if(b!==E){const C=e.params.hashNavigation.getSlideIndex(e,b);if(typeof C>"u"||Number.isNaN(C))return;e.slideTo(C)}},m=()=>{if(!l||!e.params.hashNavigation.enabled)return;const b=e.virtual&&e.params.virtual.enabled?e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`):e.slides[e.activeIndex],w=b?b.getAttribute("data-hash")||b.getAttribute("data-history"):"";e.params.hashNavigation.replaceState&&d.history&&d.history.replaceState?(d.history.replaceState(null,null,`#${w}`||""),i("hashSet")):(u.location.hash=w||"",i("hashSet"))},A=()=>{if(!e.params.hashNavigation.enabled||e.params.history&&e.params.history.enabled)return;l=!0;const b=u.location.hash.replace("#","");if(b){const E=e.params.hashNavigation.getSlideIndex(e,b);e.slideTo(E||0,0,e.params.runCallbacksOnInit,!0)}e.params.hashNavigation.watchState&&d.addEventListener("hashchange",p)},_=()=>{e.params.hashNavigation.watchState&&d.removeEventListener("hashchange",p)};a("init",()=>{e.params.hashNavigation.enabled&&A()}),a("destroy",()=>{e.params.hashNavigation.enabled&&_()}),a("transitionEnd _freeModeNoMomentumRelease",()=>{l&&m()}),a("slideChange",()=>{l&&e.params.cssMode&&m()})}function SF(o){let{swiper:e,extendParams:t,on:i,emit:a,params:l}=o;e.autoplay={running:!1,paused:!1,timeLeft:0},t({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let u,d,p=l&&l.autoplay?l.autoplay.delay:3e3,m=l&&l.autoplay?l.autoplay.delay:3e3,A,_=new Date().getTime(),b,w,E,C,T,x,P;function M(I){!e||e.destroyed||!e.wrapperEl||I.target===e.wrapperEl&&(e.wrapperEl.removeEventListener("transitionend",M),!(P||I.detail&&I.detail.bySwiperTouchMove)&&z())}const B=()=>{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?b=!0:b&&(m=A,b=!1);const I=e.autoplay.paused?A:_+m-new Date().getTime();e.autoplay.timeLeft=I,a("autoplayTimeLeft",I,I/p),d=requestAnimationFrame(()=>{B()})},D=()=>{let I;return e.virtual&&e.params.virtual.enabled?I=e.slides.find(Ae=>Ae.classList.contains("swiper-slide-active")):I=e.slides[e.activeIndex],I?parseInt(I.getAttribute("data-swiper-autoplay"),10):void 0},G=I=>{if(e.destroyed||!e.autoplay.running)return;cancelAnimationFrame(d),B();let re=typeof I>"u"?e.params.autoplay.delay:I;p=e.params.autoplay.delay,m=e.params.autoplay.delay;const Ae=D();!Number.isNaN(Ae)&&Ae>0&&typeof I>"u"&&(re=Ae,p=Ae,m=Ae),A=re;const N=e.params.speed,n=()=>{!e||e.destroyed||(e.params.autoplay.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(N,!0,!0),a("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(e.slides.length-1,N,!0,!0),a("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(N,!0,!0),a("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(0,N,!0,!0),a("autoplay")),e.params.cssMode&&(_=new Date().getTime(),requestAnimationFrame(()=>{G()})))};return re>0?(clearTimeout(u),u=setTimeout(()=>{n()},re)):requestAnimationFrame(()=>{n()}),re},U=()=>{_=new Date().getTime(),e.autoplay.running=!0,G(),a("autoplayStart")},V=()=>{e.autoplay.running=!1,clearTimeout(u),cancelAnimationFrame(d),a("autoplayStop")},k=(I,re)=>{if(e.destroyed||!e.autoplay.running)return;clearTimeout(u),I||(x=!0);const Ae=()=>{a("autoplayPause"),e.params.autoplay.waitForTransition?e.wrapperEl.addEventListener("transitionend",M):z()};if(e.autoplay.paused=!0,re){T&&(A=e.params.autoplay.delay),T=!1,Ae();return}A=(A||e.params.autoplay.delay)-(new Date().getTime()-_),!(e.isEnd&&A<0&&!e.params.loop)&&(A<0&&(A=0),Ae())},z=()=>{e.isEnd&&A<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(_=new Date().getTime(),x?(x=!1,G(A)):G(),e.autoplay.paused=!1,a("autoplayResume"))},Q=()=>{if(e.destroyed||!e.autoplay.running)return;const I=Li();I.visibilityState==="hidden"&&(x=!0,k(!0)),I.visibilityState==="visible"&&z()},Z=I=>{I.pointerType==="mouse"&&(x=!0,P=!0,!(e.animating||e.autoplay.paused)&&k(!0))},K=I=>{I.pointerType==="mouse"&&(P=!1,e.autoplay.paused&&z())},s=()=>{e.params.autoplay.pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",Z),e.el.addEventListener("pointerleave",K))},H=()=>{e.el&&typeof e.el!="string"&&(e.el.removeEventListener("pointerenter",Z),e.el.removeEventListener("pointerleave",K))},y=()=>{Li().addEventListener("visibilitychange",Q)},ee=()=>{Li().removeEventListener("visibilitychange",Q)};i("init",()=>{e.params.autoplay.enabled&&(s(),y(),U())}),i("destroy",()=>{H(),ee(),e.autoplay.running&&V()}),i("_freeModeStaticRelease",()=>{(E||x)&&z()}),i("_freeModeNoMomentumRelease",()=>{e.params.autoplay.disableOnInteraction?V():k(!0,!0)}),i("beforeTransitionStart",(I,re,Ae)=>{e.destroyed||!e.autoplay.running||(Ae||!e.params.autoplay.disableOnInteraction?k(!0,!0):V())}),i("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(e.params.autoplay.disableOnInteraction){V();return}w=!0,E=!1,x=!1,C=setTimeout(()=>{x=!0,E=!0,k(!0)},200)}}),i("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!w)){if(clearTimeout(C),clearTimeout(u),e.params.autoplay.disableOnInteraction){E=!1,w=!1;return}E&&e.params.cssMode&&z(),E=!1,w=!1}}),i("slideChange",()=>{e.destroyed||!e.autoplay.running||(T=!0)}),Object.assign(e.autoplay,{start:U,stop:V,pause:k,resume:z})}function CF(o){let{swiper:e,extendParams:t,on:i}=o;t({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let a=!1,l=!1;e.thumbs={swiper:null};function u(){const m=e.thumbs.swiper;if(!m||m.destroyed)return;const A=m.clickedIndex,_=m.clickedSlide;if(_&&_.classList.contains(e.params.thumbs.slideThumbActiveClass)||typeof A>"u"||A===null)return;let b;m.params.loop?b=parseInt(m.clickedSlide.getAttribute("data-swiper-slide-index"),10):b=A,e.params.loop?e.slideToLoop(b):e.slideTo(b)}function d(){const{thumbs:m}=e.params;if(a)return!1;a=!0;const A=e.constructor;if(m.swiper instanceof A){if(m.swiper.destroyed)return a=!1,!1;e.thumbs.swiper=m.swiper,Object.assign(e.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(e.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper.update()}else if(jc(m.swiper)){const _=Object.assign({},m.swiper);Object.assign(_,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper=new A(_),l=!0}return e.thumbs.swiper.el.classList.add(e.params.thumbs.thumbsContainerClass),e.thumbs.swiper.on("tap",u),!0}function p(m){const A=e.thumbs.swiper;if(!A||A.destroyed)return;const _=A.params.slidesPerView==="auto"?A.slidesPerViewDynamic():A.params.slidesPerView;let b=1;const w=e.params.thumbs.slideThumbActiveClass;if(e.params.slidesPerView>1&&!e.params.centeredSlides&&(b=e.params.slidesPerView),e.params.thumbs.multipleActiveThumbs||(b=1),b=Math.floor(b),A.slides.forEach(T=>T.classList.remove(w)),A.params.loop||A.params.virtual&&A.params.virtual.enabled)for(let T=0;T<b;T+=1)Ui(A.slidesEl,`[data-swiper-slide-index="${e.realIndex+T}"]`).forEach(x=>{x.classList.add(w)});else for(let T=0;T<b;T+=1)A.slides[e.realIndex+T]&&A.slides[e.realIndex+T].classList.add(w);const E=e.params.thumbs.autoScrollOffset,C=E&&!A.params.loop;if(e.realIndex!==A.realIndex||C){const T=A.activeIndex;let x,P;if(A.params.loop){const M=A.slides.find(B=>B.getAttribute("data-swiper-slide-index")===`${e.realIndex}`);x=A.slides.indexOf(M),P=e.activeIndex>e.previousIndex?"next":"prev"}else x=e.realIndex,P=x>e.previousIndex?"next":"prev";C&&(x+=P==="next"?E:-1*E),A.visibleSlidesIndexes&&A.visibleSlidesIndexes.indexOf(x)<0&&(A.params.centeredSlides?x>T?x=x-Math.floor(_/2)+1:x=x+Math.floor(_/2)-1:x>T&&A.params.slidesPerGroup,A.slideTo(x,m?0:void 0))}}i("beforeInit",()=>{const{thumbs:m}=e.params;if(!(!m||!m.swiper))if(typeof m.swiper=="string"||m.swiper instanceof HTMLElement){const A=Li(),_=()=>{const w=typeof m.swiper=="string"?A.querySelector(m.swiper):m.swiper;if(w&&w.swiper)m.swiper=w.swiper,d(),p(!0);else if(w){const E=`${e.params.eventsPrefix}init`,C=T=>{m.swiper=T.detail[0],w.removeEventListener(E,C),d(),p(!0),m.swiper.update(),e.update()};w.addEventListener(E,C)}return w},b=()=>{if(e.destroyed)return;_()||requestAnimationFrame(b)};requestAnimationFrame(b)}else d(),p(!0)}),i("slideChange update resize observerUpdate",()=>{p()}),i("setTransition",(m,A)=>{const _=e.thumbs.swiper;!_||_.destroyed||_.setTransition(A)}),i("beforeDestroy",()=>{const m=e.thumbs.swiper;!m||m.destroyed||l&&m.destroy()}),Object.assign(e.thumbs,{init:d,update:p})}function TF(o){let{swiper:e,extendParams:t,emit:i,once:a}=o;t({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}});function l(){if(e.params.cssMode)return;const p=e.getTranslate();e.setTranslate(p),e.setTransition(0),e.touchEventsData.velocities.length=0,e.freeMode.onTouchEnd({currentPos:e.rtl?e.translate:-e.translate})}function u(){if(e.params.cssMode)return;const{touchEventsData:p,touches:m}=e;p.velocities.length===0&&p.velocities.push({position:m[e.isHorizontal()?"startX":"startY"],time:p.touchStartTime}),p.velocities.push({position:m[e.isHorizontal()?"currentX":"currentY"],time:Vn()})}function d(p){let{currentPos:m}=p;if(e.params.cssMode)return;const{params:A,wrapperEl:_,rtlTranslate:b,snapGrid:w,touchEventsData:E}=e,T=Vn()-E.touchStartTime;if(m<-e.minTranslate()){e.slideTo(e.activeIndex);return}if(m>-e.maxTranslate()){e.slides.length<w.length?e.slideTo(w.length-1):e.slideTo(e.slides.length-1);return}if(A.freeMode.momentum){if(E.velocities.length>1){const V=E.velocities.pop(),k=E.velocities.pop(),z=V.position-k.position,Q=V.time-k.time;e.velocity=z/Q,e.velocity/=2,Math.abs(e.velocity)<A.freeMode.minimumVelocity&&(e.velocity=0),(Q>150||Vn()-V.time>300)&&(e.velocity=0)}else e.velocity=0;e.velocity*=A.freeMode.momentumVelocityRatio,E.velocities.length=0;let x=1e3*A.freeMode.momentumRatio;const P=e.velocity*x;let M=e.translate+P;b&&(M=-M);let B=!1,D;const G=Math.abs(e.velocity)*20*A.freeMode.momentumBounceRatio;let U;if(M<e.maxTranslate())A.freeMode.momentumBounce?(M+e.maxTranslate()<-G&&(M=e.maxTranslate()-G),D=e.maxTranslate(),B=!0,E.allowMomentumBounce=!0):M=e.maxTranslate(),A.loop&&A.centeredSlides&&(U=!0);else if(M>e.minTranslate())A.freeMode.momentumBounce?(M-e.minTranslate()>G&&(M=e.minTranslate()+G),D=e.minTranslate(),B=!0,E.allowMomentumBounce=!0):M=e.minTranslate(),A.loop&&A.centeredSlides&&(U=!0);else if(A.freeMode.sticky){let V;for(let k=0;k<w.length;k+=1)if(w[k]>-M){V=k;break}Math.abs(w[V]-M)<Math.abs(w[V-1]-M)||e.swipeDirection==="next"?M=w[V]:M=w[V-1],M=-M}if(U&&a("transitionEnd",()=>{e.loopFix()}),e.velocity!==0){if(b?x=Math.abs((-M-e.translate)/e.velocity):x=Math.abs((M-e.translate)/e.velocity),A.freeMode.sticky){const V=Math.abs((b?-M:M)-e.translate),k=e.slidesSizesGrid[e.activeIndex];V<k?x=A.speed:V<2*k?x=A.speed*1.5:x=A.speed*2.5}}else if(A.freeMode.sticky){e.slideToClosest();return}A.freeMode.momentumBounce&&B?(e.updateProgress(D),e.setTransition(x),e.setTranslate(M),e.transitionStart(!0,e.swipeDirection),e.animating=!0,pu(_,()=>{!e||e.destroyed||!E.allowMomentumBounce||(i("momentumBounce"),e.setTransition(A.speed),setTimeout(()=>{e.setTranslate(D),pu(_,()=>{!e||e.destroyed||e.transitionEnd()})},0))})):e.velocity?(i("_freeModeNoMomentumRelease"),e.updateProgress(M),e.setTransition(x),e.setTranslate(M),e.transitionStart(!0,e.swipeDirection),e.animating||(e.animating=!0,pu(_,()=>{!e||e.destroyed||e.transitionEnd()}))):e.updateProgress(M),e.updateActiveIndex(),e.updateSlidesClasses()}else if(A.freeMode.sticky){e.slideToClosest();return}else A.freeMode&&i("_freeModeNoMomentumRelease");(!A.freeMode.momentum||T>=A.longSwipesMs)&&(i("_freeModeStaticRelease"),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses())}Object.assign(e,{freeMode:{onTouchStart:l,onTouchMove:u,onTouchEnd:d}})}function IF(o){let{swiper:e,extendParams:t,on:i}=o;t({grid:{rows:1,fill:"column"}});let a,l,u,d;const p=()=>{let C=e.params.spaceBetween;return typeof C=="string"&&C.indexOf("%")>=0?C=parseFloat(C.replace("%",""))/100*e.size:typeof C=="string"&&(C=parseFloat(C)),C},m=C=>{const{slidesPerView:T}=e.params,{rows:x,fill:P}=e.params.grid,M=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:C.length;u=Math.floor(M/x),Math.floor(M/x)===M/x?a=M:a=Math.ceil(M/x)*x,T!=="auto"&&P==="row"&&(a=Math.max(a,T*x)),l=a/x},A=()=>{e.slides&&e.slides.forEach(C=>{C.swiperSlideGridSet&&(C.style.height="",C.style[e.getDirectionLabel("margin-top")]="")})},_=(C,T,x)=>{const{slidesPerGroup:P}=e.params,M=p(),{rows:B,fill:D}=e.params.grid,G=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:x.length;let U,V,k;if(D==="row"&&P>1){const z=Math.floor(C/(P*B)),Q=C-B*P*z,Z=z===0?P:Math.min(Math.ceil((G-z*B*P)/B),P);k=Math.floor(Q/Z),V=Q-k*Z+z*P,U=V+k*a/B,T.style.order=U}else D==="column"?(V=Math.floor(C/B),k=C-V*B,(V>u||V===u&&k===B-1)&&(k+=1,k>=B&&(k=0,V+=1))):(k=Math.floor(C/l),V=C-k*l);T.row=k,T.column=V,T.style.height=`calc((100% - ${(B-1)*M}px) / ${B})`,T.style[e.getDirectionLabel("margin-top")]=k!==0?M&&`${M}px`:"",T.swiperSlideGridSet=!0},b=(C,T)=>{const{centeredSlides:x,roundLengths:P}=e.params,M=p(),{rows:B}=e.params.grid;if(e.virtualSize=(C+M)*a,e.virtualSize=Math.ceil(e.virtualSize/B)-M,e.params.cssMode||(e.wrapperEl.style[e.getDirectionLabel("width")]=`${e.virtualSize+M}px`),x){const D=[];for(let G=0;G<T.length;G+=1){let U=T[G];P&&(U=Math.floor(U)),T[G]<e.virtualSize+T[0]&&D.push(U)}T.splice(0,T.length),T.push(...D)}},w=()=>{d=e.params.grid&&e.params.grid.rows>1},E=()=>{const{params:C,el:T}=e,x=C.grid&&C.grid.rows>1;d&&!x?(T.classList.remove(`${C.containerModifierClass}grid`,`${C.containerModifierClass}grid-column`),u=1,e.emitContainerClasses()):!d&&x&&(T.classList.add(`${C.containerModifierClass}grid`),C.grid.fill==="column"&&T.classList.add(`${C.containerModifierClass}grid-column`),e.emitContainerClasses()),d=x};i("init",w),i("update",E),e.grid={initSlides:m,unsetSlides:A,updateSlide:_,updateWrapperSize:b}}function MF(o){const e=this,{params:t,slidesEl:i}=e;t.loop&&e.loopDestroy();const a=l=>{if(typeof l=="string"){const u=document.createElement("div");Yn(u,l),i.append(u.children[0]),Yn(u,"")}else i.append(l)};if(typeof o=="object"&&"length"in o)for(let l=0;l<o.length;l+=1)o[l]&&a(o[l]);else a(o);e.recalcSlides(),t.loop&&e.loopCreate(),(!t.observer||e.isElement)&&e.update()}function RF(o){const e=this,{params:t,activeIndex:i,slidesEl:a}=e;t.loop&&e.loopDestroy();let l=i+1;const u=d=>{if(typeof d=="string"){const p=document.createElement("div");Yn(p,d),a.prepend(p.children[0]),Yn(p,"")}else a.prepend(d)};if(typeof o=="object"&&"length"in o){for(let d=0;d<o.length;d+=1)o[d]&&u(o[d]);l=i+o.length}else u(o);e.recalcSlides(),t.loop&&e.loopCreate(),(!t.observer||e.isElement)&&e.update(),e.slideTo(l,0,!1)}function BF(o,e){const t=this,{params:i,activeIndex:a,slidesEl:l}=t;let u=a;i.loop&&(u-=t.loopedSlides,t.loopDestroy(),t.recalcSlides());const d=t.slides.length;if(o<=0){t.prependSlide(e);return}if(o>=d){t.appendSlide(e);return}let p=u>o?u+1:u;const m=[];for(let A=d-1;A>=o;A-=1){const _=t.slides[A];_.remove(),m.unshift(_)}if(typeof e=="object"&&"length"in e){for(let A=0;A<e.length;A+=1)e[A]&&l.append(e[A]);p=u>o?u+e.length:u}else l.append(e);for(let A=0;A<m.length;A+=1)l.append(m[A]);t.recalcSlides(),i.loop&&t.loopCreate(),(!i.observer||t.isElement)&&t.update(),i.loop?t.slideTo(p+t.loopedSlides,0,!1):t.slideTo(p,0,!1)}function PF(o){const e=this,{params:t,activeIndex:i}=e;let a=i;t.loop&&(a-=e.loopedSlides,e.loopDestroy());let l=a,u;if(typeof o=="object"&&"length"in o){for(let d=0;d<o.length;d+=1)u=o[d],e.slides[u]&&e.slides[u].remove(),u<l&&(l-=1);l=Math.max(l,0)}else u=o,e.slides[u]&&e.slides[u].remove(),u<l&&(l-=1),l=Math.max(l,0);e.recalcSlides(),t.loop&&e.loopCreate(),(!t.observer||e.isElement)&&e.update(),t.loop?e.slideTo(l+e.loopedSlides,0,!1):e.slideTo(l,0,!1)}function LF(){const o=this,e=[];for(let t=0;t<o.slides.length;t+=1)e.push(t);o.removeSlide(e)}function DF(o){let{swiper:e}=o;Object.assign(e,{appendSlide:MF.bind(e),prependSlide:RF.bind(e),addSlide:BF.bind(e),removeSlide:PF.bind(e),removeAllSlides:LF.bind(e)})}function Ql(o){const{effect:e,swiper:t,on:i,setTranslate:a,setTransition:l,overwriteParams:u,perspective:d,recreateShadows:p,getEffectParams:m}=o;i("beforeInit",()=>{if(t.params.effect!==e)return;t.classNames.push(`${t.params.containerModifierClass}${e}`),d&&d()&&t.classNames.push(`${t.params.containerModifierClass}3d`);const _=u?u():{};Object.assign(t.params,_),Object.assign(t.originalParams,_)}),i("setTranslate _virtualUpdated",()=>{t.params.effect===e&&a()}),i("setTransition",(_,b)=>{t.params.effect===e&&l(b)}),i("transitionEnd",()=>{if(t.params.effect===e&&p){if(!m||!m().slideShadows)return;t.slides.forEach(_=>{_.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(b=>b.remove())}),p()}});let A;i("virtualUpdate",()=>{t.params.effect===e&&(t.slides.length||(A=!0),requestAnimationFrame(()=>{A&&t.slides&&t.slides.length&&(a(),A=!1)}))})}function Hu(o,e){const t=to(e);return t!==e&&(t.style.backfaceVisibility="hidden",t.style["-webkit-backface-visibility"]="hidden"),t}function Vf(o){let{swiper:e,duration:t,transformElements:i,allSlides:a}=o;const{activeIndex:l}=e,u=d=>d.parentElement?d.parentElement:e.slides.find(m=>m.shadowRoot&&m.shadowRoot===d.parentNode);if(e.params.virtualTranslate&&t!==0){let d=!1,p;a?p=i:p=i.filter(m=>{const A=m.classList.contains("swiper-slide-transform")?u(m):m;return e.getSlideIndex(A)===l}),p.forEach(m=>{pu(m,()=>{if(d||!e||e.destroyed)return;d=!0,e.animating=!1;const A=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});e.wrapperEl.dispatchEvent(A)})})}}function NF(o){let{swiper:e,extendParams:t,on:i}=o;t({fadeEffect:{crossFade:!1}}),Ql({effect:"fade",swiper:e,on:i,setTranslate:()=>{const{slides:u}=e,d=e.params.fadeEffect;for(let p=0;p<u.length;p+=1){const m=e.slides[p];let _=-m.swiperSlideOffset;e.params.virtualTranslate||(_-=e.translate);let b=0;e.isHorizontal()||(b=_,_=0);const w=e.params.fadeEffect.crossFade?Math.max(1-Math.abs(m.progress),0):1+Math.min(Math.max(m.progress,-1),0),E=Hu(d,m);E.style.opacity=w,E.style.transform=`translate3d(${_}px, ${b}px, 0px)`}},setTransition:u=>{const d=e.slides.map(p=>to(p));d.forEach(p=>{p.style.transitionDuration=`${u}ms`}),Vf({swiper:e,duration:u,transformElements:d,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})}function OF(o){let{swiper:e,extendParams:t,on:i}=o;t({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const a=(p,m,A)=>{let _=A?p.querySelector(".swiper-slide-shadow-left"):p.querySelector(".swiper-slide-shadow-top"),b=A?p.querySelector(".swiper-slide-shadow-right"):p.querySelector(".swiper-slide-shadow-bottom");_||(_=Pn("div",`swiper-slide-shadow-cube swiper-slide-shadow-${A?"left":"top"}`.split(" ")),p.append(_)),b||(b=Pn("div",`swiper-slide-shadow-cube swiper-slide-shadow-${A?"right":"bottom"}`.split(" ")),p.append(b)),_&&(_.style.opacity=Math.max(-m,0)),b&&(b.style.opacity=Math.max(m,0))};Ql({effect:"cube",swiper:e,on:i,setTranslate:()=>{const{el:p,wrapperEl:m,slides:A,width:_,height:b,rtlTranslate:w,size:E,browser:C}=e,T=Hf(e),x=e.params.cubeEffect,P=e.isHorizontal(),M=e.virtual&&e.params.virtual.enabled;let B=0,D;x.shadow&&(P?(D=e.wrapperEl.querySelector(".swiper-cube-shadow"),D||(D=Pn("div","swiper-cube-shadow"),e.wrapperEl.append(D)),D.style.height=`${_}px`):(D=p.querySelector(".swiper-cube-shadow"),D||(D=Pn("div","swiper-cube-shadow"),p.append(D))));for(let U=0;U<A.length;U+=1){const V=A[U];let k=U;M&&(k=parseInt(V.getAttribute("data-swiper-slide-index"),10));let z=k*90,Q=Math.floor(z/360);w&&(z=-z,Q=Math.floor(-z/360));const Z=Math.max(Math.min(V.progress,1),-1);let K=0,s=0,H=0;k%4===0?(K=-Q*4*E,H=0):(k-1)%4===0?(K=0,H=-Q*4*E):(k-2)%4===0?(K=E+Q*4*E,H=E):(k-3)%4===0&&(K=-E,H=3*E+E*4*Q),w&&(K=-K),P||(s=K,K=0);const y=`rotateX(${T(P?0:-z)}deg) rotateY(${T(P?z:0)}deg) translate3d(${K}px, ${s}px, ${H}px)`;Z<=1&&Z>-1&&(B=k*90+Z*90,w&&(B=-k*90-Z*90)),V.style.transform=y,x.slideShadows&&a(V,Z,P)}if(m.style.transformOrigin=`50% 50% -${E/2}px`,m.style["-webkit-transform-origin"]=`50% 50% -${E/2}px`,x.shadow)if(P)D.style.transform=`translate3d(0px, ${_/2+x.shadowOffset}px, ${-_/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${x.shadowScale})`;else{const U=Math.abs(B)-Math.floor(Math.abs(B)/90)*90,V=1.5-(Math.sin(U*2*Math.PI/360)/2+Math.cos(U*2*Math.PI/360)/2),k=x.shadowScale,z=x.shadowScale/V,Q=x.shadowOffset;D.style.transform=`scale3d(${k}, 1, ${z}) translate3d(0px, ${b/2+Q}px, ${-b/2/z}px) rotateX(-89.99deg)`}const G=(C.isSafari||C.isWebView)&&C.needPerspectiveFix?-E/2:0;m.style.transform=`translate3d(0px,0,${G}px) rotateX(${T(e.isHorizontal()?0:B)}deg) rotateY(${T(e.isHorizontal()?-B:0)}deg)`,m.style.setProperty("--swiper-cube-translate-z",`${G}px`)},setTransition:p=>{const{el:m,slides:A}=e;if(A.forEach(_=>{_.style.transitionDuration=`${p}ms`,_.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(b=>{b.style.transitionDuration=`${p}ms`})}),e.params.cubeEffect.shadow&&!e.isHorizontal()){const _=m.querySelector(".swiper-cube-shadow");_&&(_.style.transitionDuration=`${p}ms`)}},recreateShadows:()=>{const p=e.isHorizontal();e.slides.forEach(m=>{const A=Math.max(Math.min(m.progress,1),-1);a(m,A,p)})},getEffectParams:()=>e.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})}function Nl(o,e,t){const i=`swiper-slide-shadow${t?`-${t}`:""}${o?` swiper-slide-shadow-${o}`:""}`,a=to(e);let l=a.querySelector(`.${i.split(" ").join(".")}`);return l||(l=Pn("div",i.split(" ")),a.append(l)),l}function kF(o){let{swiper:e,extendParams:t,on:i}=o;t({flipEffect:{slideShadows:!0,limitRotation:!0}});const a=(p,m)=>{let A=e.isHorizontal()?p.querySelector(".swiper-slide-shadow-left"):p.querySelector(".swiper-slide-shadow-top"),_=e.isHorizontal()?p.querySelector(".swiper-slide-shadow-right"):p.querySelector(".swiper-slide-shadow-bottom");A||(A=Nl("flip",p,e.isHorizontal()?"left":"top")),_||(_=Nl("flip",p,e.isHorizontal()?"right":"bottom")),A&&(A.style.opacity=Math.max(-m,0)),_&&(_.style.opacity=Math.max(m,0))};Ql({effect:"flip",swiper:e,on:i,setTranslate:()=>{const{slides:p,rtlTranslate:m}=e,A=e.params.flipEffect,_=Hf(e);for(let b=0;b<p.length;b+=1){const w=p[b];let E=w.progress;e.params.flipEffect.limitRotation&&(E=Math.max(Math.min(w.progress,1),-1));const C=w.swiperSlideOffset;let x=-180*E,P=0,M=e.params.cssMode?-C-e.translate:-C,B=0;e.isHorizontal()?m&&(x=-x):(B=M,M=0,P=-x,x=0),w.style.zIndex=-Math.abs(Math.round(E))+p.length,A.slideShadows&&a(w,E);const D=`translate3d(${M}px, ${B}px, 0px) rotateX(${_(P)}deg) rotateY(${_(x)}deg)`,G=Hu(A,w);G.style.transform=D}},setTransition:p=>{const m=e.slides.map(A=>to(A));m.forEach(A=>{A.style.transitionDuration=`${p}ms`,A.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(_=>{_.style.transitionDuration=`${p}ms`})}),Vf({swiper:e,duration:p,transformElements:m})},recreateShadows:()=>{e.params.flipEffect,e.slides.forEach(p=>{let m=p.progress;e.params.flipEffect.limitRotation&&(m=Math.max(Math.min(p.progress,1),-1)),a(p,m)})},getEffectParams:()=>e.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})}function UF(o){let{swiper:e,extendParams:t,on:i}=o;t({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),Ql({effect:"coverflow",swiper:e,on:i,setTranslate:()=>{const{width:u,height:d,slides:p,slidesSizesGrid:m}=e,A=e.params.coverflowEffect,_=e.isHorizontal(),b=e.translate,w=_?-b+u/2:-b+d/2,E=_?A.rotate:-A.rotate,C=A.depth,T=Hf(e);for(let x=0,P=p.length;x<P;x+=1){const M=p[x],B=m[x],D=M.swiperSlideOffset,G=(w-D-B/2)/B,U=typeof A.modifier=="function"?A.modifier(G):G*A.modifier;let V=_?E*U:0,k=_?0:E*U,z=-C*Math.abs(U),Q=A.stretch;typeof Q=="string"&&Q.indexOf("%")!==-1&&(Q=parseFloat(A.stretch)/100*B);let Z=_?0:Q*U,K=_?Q*U:0,s=1-(1-A.scale)*Math.abs(U);Math.abs(K)<.001&&(K=0),Math.abs(Z)<.001&&(Z=0),Math.abs(z)<.001&&(z=0),Math.abs(V)<.001&&(V=0),Math.abs(k)<.001&&(k=0),Math.abs(s)<.001&&(s=0);const H=`translate3d(${K}px,${Z}px,${z}px) rotateX(${T(k)}deg) rotateY(${T(V)}deg) scale(${s})`,y=Hu(A,M);if(y.style.transform=H,M.style.zIndex=-Math.abs(Math.round(U))+1,A.slideShadows){let ee=_?M.querySelector(".swiper-slide-shadow-left"):M.querySelector(".swiper-slide-shadow-top"),I=_?M.querySelector(".swiper-slide-shadow-right"):M.querySelector(".swiper-slide-shadow-bottom");ee||(ee=Nl("coverflow",M,_?"left":"top")),I||(I=Nl("coverflow",M,_?"right":"bottom")),ee&&(ee.style.opacity=U>0?U:0),I&&(I.style.opacity=-U>0?-U:0)}}},setTransition:u=>{e.slides.map(p=>to(p)).forEach(p=>{p.style.transitionDuration=`${u}ms`,p.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(m=>{m.style.transitionDuration=`${u}ms`})})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})}function FF(o){let{swiper:e,extendParams:t,on:i}=o;t({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const a=d=>typeof d=="string"?d:`${d}px`;Ql({effect:"creative",swiper:e,on:i,setTranslate:()=>{const{slides:d,wrapperEl:p,slidesSizesGrid:m}=e,A=e.params.creativeEffect,{progressMultiplier:_}=A,b=e.params.centeredSlides,w=Hf(e);if(b){const E=m[0]/2-e.params.slidesOffsetBefore||0;p.style.transform=`translateX(calc(50% - ${E}px))`}for(let E=0;E<d.length;E+=1){const C=d[E],T=C.progress,x=Math.min(Math.max(C.progress,-A.limitProgress),A.limitProgress);let P=x;b||(P=Math.min(Math.max(C.originalProgress,-A.limitProgress),A.limitProgress));const M=C.swiperSlideOffset,B=[e.params.cssMode?-M-e.translate:-M,0,0],D=[0,0,0];let G=!1;e.isHorizontal()||(B[1]=B[0],B[0]=0);let U={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};x<0?(U=A.next,G=!0):x>0&&(U=A.prev,G=!0),B.forEach((s,H)=>{B[H]=`calc(${s}px + (${a(U.translate[H])} * ${Math.abs(x*_)}))`}),D.forEach((s,H)=>{let y=U.rotate[H]*Math.abs(x*_);D[H]=y}),C.style.zIndex=-Math.abs(Math.round(T))+d.length;const V=B.join(", "),k=`rotateX(${w(D[0])}deg) rotateY(${w(D[1])}deg) rotateZ(${w(D[2])}deg)`,z=P<0?`scale(${1+(1-U.scale)*P*_})`:`scale(${1-(1-U.scale)*P*_})`,Q=P<0?1+(1-U.opacity)*P*_:1-(1-U.opacity)*P*_,Z=`translate3d(${V}) ${k} ${z}`;if(G&&U.shadow||!G){let s=C.querySelector(".swiper-slide-shadow");if(!s&&U.shadow&&(s=Nl("creative",C)),s){const H=A.shadowPerProgress?x*(1/A.limitProgress):x;s.style.opacity=Math.min(Math.max(Math.abs(H),0),1)}}const K=Hu(A,C);K.style.transform=Z,K.style.opacity=Q,U.origin&&(K.style.transformOrigin=U.origin)}},setTransition:d=>{const p=e.slides.map(m=>to(m));p.forEach(m=>{m.style.transitionDuration=`${d}ms`,m.querySelectorAll(".swiper-slide-shadow").forEach(A=>{A.style.transitionDuration=`${d}ms`})}),Vf({swiper:e,duration:d,transformElements:p,allSlides:!0})},perspective:()=>e.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!e.params.cssMode})})}function $F(o){let{swiper:e,extendParams:t,on:i}=o;t({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}}),Ql({effect:"cards",swiper:e,on:i,setTranslate:()=>{const{slides:u,activeIndex:d,rtlTranslate:p}=e,m=e.params.cardsEffect,{startTranslate:A,isTouched:_}=e.touchEventsData,b=p?-e.translate:e.translate;for(let w=0;w<u.length;w+=1){const E=u[w],C=E.progress,T=Math.min(Math.max(C,-4),4);let x=E.swiperSlideOffset;e.params.centeredSlides&&!e.params.cssMode&&(e.wrapperEl.style.transform=`translateX(${e.minTranslate()}px)`),e.params.centeredSlides&&e.params.cssMode&&(x-=u[0].swiperSlideOffset);let P=e.params.cssMode?-x-e.translate:-x,M=0;const B=-100*Math.abs(T);let D=1,G=-m.perSlideRotate*T,U=m.perSlideOffset-Math.abs(T)*.75;const V=e.virtual&&e.params.virtual.enabled?e.virtual.from+w:w,k=(V===d||V===d-1)&&T>0&&T<1&&(_||e.params.cssMode)&&b<A,z=(V===d||V===d+1)&&T<0&&T>-1&&(_||e.params.cssMode)&&b>A;if(k||z){const s=(1-Math.abs((Math.abs(T)-.5)/.5))**.5;G+=-28*T*s,D+=-.5*s,U+=96*s,M=`${-25*s*Math.abs(T)}%`}if(T<0?P=`calc(${P}px ${p?"-":"+"} (${U*Math.abs(T)}%))`:T>0?P=`calc(${P}px ${p?"-":"+"} (-${U*Math.abs(T)}%))`:P=`${P}px`,!e.isHorizontal()){const s=M;M=P,P=s}const Q=T<0?`${1+(1-D)*T}`:`${1-(1-D)*T}`,Z=`
|
|
4893
|
+
`}}Vl([he({attribute:za.mediaAlt.name})],eo.prototype,"mediaAlt");Vl([he({attribute:za.mediaSrc.name})],eo.prototype,"mediaSrc");Vl([he({attribute:za.mediaType.name})],eo.prototype,"mediaType");Vl([he({type:Boolean,attribute:za.mediaAutoplay.name})],eo.prototype,"mediaAutoplay");Vl([he({attribute:!1})],eo.prototype,"onClick");Vl([Gi()],eo.prototype,"__isPlaying");window.customElements.get(Cv)||window.customElements.define(Cv,eo);function Mv(o){return o!==null&&typeof o=="object"&&"constructor"in o&&o.constructor===Object}function p_(o,e){o===void 0&&(o={}),e===void 0&&(e={});const t=["__proto__","constructor","prototype"];Object.keys(e).filter(i=>t.indexOf(i)<0).forEach(i=>{typeof o[i]>"u"?o[i]=e[i]:Mv(e[i])&&Mv(o[i])&&Object.keys(e[i]).length>0&&p_(o[i],e[i])})}const oC={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Li(){const o=typeof document<"u"?document:{};return p_(o,oC),o}const XU={document:oC,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(o){return typeof setTimeout>"u"?(o(),null):setTimeout(o,0)},cancelAnimationFrame(o){typeof setTimeout>"u"||clearTimeout(o)}};function ti(){const o=typeof window<"u"?window:{};return p_(o,XU),o}function Sr(o){return o===void 0&&(o=""),o.trim().split(" ").filter(e=>!!e.trim())}function KU(o){const e=o;Object.keys(e).forEach(t=>{try{e[t]=null}catch{}try{delete e[t]}catch{}})}function Dl(o,e){return e===void 0&&(e=0),setTimeout(o,e)}function Vn(){return Date.now()}function JU(o){const e=ti();let t;return e.getComputedStyle&&(t=e.getComputedStyle(o,null)),!t&&o.currentStyle&&(t=o.currentStyle),t||(t=o.style),t}function HA(o,e){e===void 0&&(e="x");const t=ti();let i,a,l;const u=JU(o);return t.WebKitCSSMatrix?(a=u.transform||u.webkitTransform,a.split(",").length>6&&(a=a.split(", ").map(d=>d.replace(",",".")).join(", ")),l=new t.WebKitCSSMatrix(a==="none"?"":a)):(l=u.MozTransform||u.OTransform||u.MsTransform||u.msTransform||u.transform||u.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=l.toString().split(",")),e==="x"&&(t.WebKitCSSMatrix?a=l.m41:i.length===16?a=parseFloat(i[12]):a=parseFloat(i[4])),e==="y"&&(t.WebKitCSSMatrix?a=l.m42:i.length===16?a=parseFloat(i[13]):a=parseFloat(i[5])),a||0}function jc(o){return typeof o=="object"&&o!==null&&o.constructor&&Object.prototype.toString.call(o).slice(8,-1)==="Object"}function ZU(o){return typeof window<"u"&&typeof window.HTMLElement<"u"?o instanceof HTMLElement:o&&(o.nodeType===1||o.nodeType===11)}function In(){const o=Object(arguments.length<=0?void 0:arguments[0]),e=["__proto__","constructor","prototype"];for(let t=1;t<arguments.length;t+=1){const i=t<0||arguments.length<=t?void 0:arguments[t];if(i!=null&&!ZU(i)){const a=Object.keys(Object(i)).filter(l=>e.indexOf(l)<0);for(let l=0,u=a.length;l<u;l+=1){const d=a[l],p=Object.getOwnPropertyDescriptor(i,d);p!==void 0&&p.enumerable&&(jc(o[d])&&jc(i[d])?i[d].__swiper__?o[d]=i[d]:In(o[d],i[d]):!jc(o[d])&&jc(i[d])?(o[d]={},i[d].__swiper__?o[d]=i[d]:In(o[d],i[d])):o[d]=i[d])}}}return o}function qc(o,e,t){o.style.setProperty(e,t)}function lC(o){let{swiper:e,targetPosition:t,side:i}=o;const a=ti(),l=-e.translate;let u=null,d;const p=e.params.speed;e.wrapperEl.style.scrollSnapType="none",a.cancelAnimationFrame(e.cssModeFrameID);const m=t>l?"next":"prev",A=(b,w)=>m==="next"&&b>=w||m==="prev"&&b<=w,_=()=>{d=new Date().getTime(),u===null&&(u=d);const b=Math.max(Math.min((d-u)/p,1),0),w=.5-Math.cos(b*Math.PI)/2;let E=l+w*(t-l);if(A(E,t)&&(E=t),e.wrapperEl.scrollTo({[i]:E}),A(E,t)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[i]:E})}),a.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=a.requestAnimationFrame(_)};_()}function to(o){return o.querySelector(".swiper-slide-transform")||o.shadowRoot&&o.shadowRoot.querySelector(".swiper-slide-transform")||o}function Ui(o,e){e===void 0&&(e="");const t=ti(),i=[...o.children];return t.HTMLSlotElement&&o instanceof HTMLSlotElement&&i.push(...o.assignedElements()),e?i.filter(a=>a.matches(e)):i}function e3(o,e){const t=[e];for(;t.length>0;){const i=t.shift();if(o===i)return!0;t.push(...i.children,...i.shadowRoot?i.shadowRoot.children:[],...i.assignedElements?i.assignedElements():[])}}function t3(o,e){const t=ti();let i=e.contains(o);return!i&&t.HTMLSlotElement&&e instanceof HTMLSlotElement&&(i=[...e.assignedElements()].includes(o),i||(i=e3(o,e))),i}function gf(o){try{console.warn(o);return}catch{}}function Pn(o,e){e===void 0&&(e=[]);const t=document.createElement(o);return t.classList.add(...Array.isArray(e)?e:Sr(e)),t}function Af(o){const e=ti(),t=Li(),i=o.getBoundingClientRect(),a=t.body,l=o.clientTop||a.clientTop||0,u=o.clientLeft||a.clientLeft||0,d=o===e?e.scrollY:o.scrollTop,p=o===e?e.scrollX:o.scrollLeft;return{top:i.top+d-l,left:i.left+p-u}}function i3(o,e){const t=[];for(;o.previousElementSibling;){const i=o.previousElementSibling;e?i.matches(e)&&t.push(i):t.push(i),o=i}return t}function n3(o,e){const t=[];for(;o.nextElementSibling;){const i=o.nextElementSibling;e?i.matches(e)&&t.push(i):t.push(i),o=i}return t}function Fr(o,e){return ti().getComputedStyle(o,null).getPropertyValue(e)}function Mu(o){let e=o,t;if(e){for(t=0;(e=e.previousSibling)!==null;)e.nodeType===1&&(t+=1);return t}}function Ga(o,e){const t=[];let i=o.parentElement;for(;i;)e?i.matches(e)&&t.push(i):t.push(i),i=i.parentElement;return t}function pu(o,e){function t(i){i.target===o&&(e.call(o,i),o.removeEventListener("transitionend",t))}e&&o.addEventListener("transitionend",t)}function VA(o,e,t){const i=ti();return o[e==="width"?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(o,null).getPropertyValue(e==="width"?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(o,null).getPropertyValue(e==="width"?"margin-left":"margin-bottom"))}function _t(o){return(Array.isArray(o)?o:[o]).filter(e=>!!e)}function Hf(o){return e=>Math.abs(e)>0&&o.browser&&o.browser.need3dFix&&Math.abs(e)%90===0?e+.001:e}function Yn(o,e){e===void 0&&(e=""),typeof trustedTypes<"u"?o.innerHTML=trustedTypes.createPolicy("html",{createHTML:t=>t}).createHTML(e):o.innerHTML=e}let ym;function s3(){const o=ti(),e=Li();return{smoothScroll:e.documentElement&&e.documentElement.style&&"scrollBehavior"in e.documentElement.style,touch:!!("ontouchstart"in o||o.DocumentTouch&&e instanceof o.DocumentTouch)}}function cC(){return ym||(ym=s3()),ym}let bm;function r3(o){let{userAgent:e}=o===void 0?{}:o;const t=cC(),i=ti(),a=i.navigator.platform,l=e||i.navigator.userAgent,u={ios:!1,android:!1},d=i.screen.width,p=i.screen.height,m=l.match(/(Android);?[\s\/]+([\d.]+)?/);let A=l.match(/(iPad).*OS\s([\d_]+)/);const _=l.match(/(iPod)(.*OS\s([\d_]+))?/),b=!A&&l.match(/(iPhone\sOS|iOS)\s([\d_]+)/),w=a==="Win32";let E=a==="MacIntel";const C=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!A&&E&&t.touch&&C.indexOf(`${d}x${p}`)>=0&&(A=l.match(/(Version)\/([\d.]+)/),A||(A=[0,1,"13_0_0"]),E=!1),m&&!w&&(u.os="android",u.android=!0),(A||b||_)&&(u.os="ios",u.ios=!0),u}function uC(o){return o===void 0&&(o={}),bm||(bm=r3(o)),bm}let vm;function a3(){const o=ti(),e=uC();let t=!1;function i(){const d=o.navigator.userAgent.toLowerCase();return d.indexOf("safari")>=0&&d.indexOf("chrome")<0&&d.indexOf("android")<0}if(i()){const d=String(o.navigator.userAgent);if(d.includes("Version/")){const[p,m]=d.split("Version/")[1].split(" ")[0].split(".").map(A=>Number(A));t=p<16||p===16&&m<2}}const a=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(o.navigator.userAgent),l=i(),u=l||a&&e.ios;return{isSafari:t||l,needPerspectiveFix:t,need3dFix:u,isWebView:a}}function hC(){return vm||(vm=a3()),vm}function o3(o){let{swiper:e,on:t,emit:i}=o;const a=ti();let l=null,u=null;const d=()=>{!e||e.destroyed||!e.initialized||(i("beforeResize"),i("resize"))},p=()=>{!e||e.destroyed||!e.initialized||(l=new ResizeObserver(_=>{u=a.requestAnimationFrame(()=>{const{width:b,height:w}=e;let E=b,C=w;_.forEach(T=>{let{contentBoxSize:x,contentRect:P,target:M}=T;M&&M!==e.el||(E=P?P.width:(x[0]||x).inlineSize,C=P?P.height:(x[0]||x).blockSize)}),(E!==b||C!==w)&&d()})}),l.observe(e.el))},m=()=>{u&&a.cancelAnimationFrame(u),l&&l.unobserve&&e.el&&(l.unobserve(e.el),l=null)},A=()=>{!e||e.destroyed||!e.initialized||i("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof a.ResizeObserver<"u"){p();return}a.addEventListener("resize",d),a.addEventListener("orientationchange",A)}),t("destroy",()=>{m(),a.removeEventListener("resize",d),a.removeEventListener("orientationchange",A)})}function l3(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=[],u=ti(),d=function(A,_){_===void 0&&(_={});const b=u.MutationObserver||u.WebkitMutationObserver,w=new b(E=>{if(e.__preventObserver__)return;if(E.length===1){a("observerUpdate",E[0]);return}const C=function(){a("observerUpdate",E[0])};u.requestAnimationFrame?u.requestAnimationFrame(C):u.setTimeout(C,0)});w.observe(A,{attributes:typeof _.attributes>"u"?!0:_.attributes,childList:e.isElement||(typeof _.childList>"u"?!0:_).childList,characterData:typeof _.characterData>"u"?!0:_.characterData}),l.push(w)},p=()=>{if(e.params.observer){if(e.params.observeParents){const A=Ga(e.hostEl);for(let _=0;_<A.length;_+=1)d(A[_])}d(e.hostEl,{childList:e.params.observeSlideChildren}),d(e.wrapperEl,{attributes:!1})}},m=()=>{l.forEach(A=>{A.disconnect()}),l.splice(0,l.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),i("init",p),i("destroy",m)}var c3={on(o,e,t){const i=this;if(!i.eventsListeners||i.destroyed||typeof e!="function")return i;const a=t?"unshift":"push";return o.split(" ").forEach(l=>{i.eventsListeners[l]||(i.eventsListeners[l]=[]),i.eventsListeners[l][a](e)}),i},once(o,e,t){const i=this;if(!i.eventsListeners||i.destroyed||typeof e!="function")return i;function a(){i.off(o,a),a.__emitterProxy&&delete a.__emitterProxy;for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];e.apply(i,u)}return a.__emitterProxy=e,i.on(o,a,t)},onAny(o,e){const t=this;if(!t.eventsListeners||t.destroyed||typeof o!="function")return t;const i=e?"unshift":"push";return t.eventsAnyListeners.indexOf(o)<0&&t.eventsAnyListeners[i](o),t},offAny(o){const e=this;if(!e.eventsListeners||e.destroyed||!e.eventsAnyListeners)return e;const t=e.eventsAnyListeners.indexOf(o);return t>=0&&e.eventsAnyListeners.splice(t,1),e},off(o,e){const t=this;return!t.eventsListeners||t.destroyed||!t.eventsListeners||o.split(" ").forEach(i=>{typeof e>"u"?t.eventsListeners[i]=[]:t.eventsListeners[i]&&t.eventsListeners[i].forEach((a,l)=>{(a===e||a.__emitterProxy&&a.__emitterProxy===e)&&t.eventsListeners[i].splice(l,1)})}),t},emit(){const o=this;if(!o.eventsListeners||o.destroyed||!o.eventsListeners)return o;let e,t,i;for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return typeof l[0]=="string"||Array.isArray(l[0])?(e=l[0],t=l.slice(1,l.length),i=o):(e=l[0].events,t=l[0].data,i=l[0].context||o),t.unshift(i),(Array.isArray(e)?e:e.split(" ")).forEach(p=>{o.eventsAnyListeners&&o.eventsAnyListeners.length&&o.eventsAnyListeners.forEach(m=>{m.apply(i,[p,...t])}),o.eventsListeners&&o.eventsListeners[p]&&o.eventsListeners[p].forEach(m=>{m.apply(i,t)})}),o}};function u3(){const o=this;let e,t;const i=o.el;typeof o.params.width<"u"&&o.params.width!==null?e=o.params.width:e=i.clientWidth,typeof o.params.height<"u"&&o.params.height!==null?t=o.params.height:t=i.clientHeight,!(e===0&&o.isHorizontal()||t===0&&o.isVertical())&&(e=e-parseInt(Fr(i,"padding-left")||0,10)-parseInt(Fr(i,"padding-right")||0,10),t=t-parseInt(Fr(i,"padding-top")||0,10)-parseInt(Fr(i,"padding-bottom")||0,10),Number.isNaN(e)&&(e=0),Number.isNaN(t)&&(t=0),Object.assign(o,{width:e,height:t,size:o.isHorizontal()?e:t}))}function h3(){const o=this;function e(z,Q){return parseFloat(z.getPropertyValue(o.getDirectionLabel(Q))||0)}const t=o.params,{wrapperEl:i,slidesEl:a,size:l,rtlTranslate:u,wrongRTL:d}=o,p=o.virtual&&t.virtual.enabled,m=p?o.virtual.slides.length:o.slides.length,A=Ui(a,`.${o.params.slideClass}, swiper-slide`),_=p?o.virtual.slides.length:A.length;let b=[];const w=[],E=[];let C=t.slidesOffsetBefore;typeof C=="function"&&(C=t.slidesOffsetBefore.call(o));let T=t.slidesOffsetAfter;typeof T=="function"&&(T=t.slidesOffsetAfter.call(o));const x=o.snapGrid.length,P=o.slidesGrid.length;let M=t.spaceBetween,B=-C,D=0,G=0;if(typeof l>"u")return;typeof M=="string"&&M.indexOf("%")>=0?M=parseFloat(M.replace("%",""))/100*l:typeof M=="string"&&(M=parseFloat(M)),o.virtualSize=-M,A.forEach(z=>{u?z.style.marginLeft="":z.style.marginRight="",z.style.marginBottom="",z.style.marginTop=""}),t.centeredSlides&&t.cssMode&&(qc(i,"--swiper-centered-offset-before",""),qc(i,"--swiper-centered-offset-after",""));const U=t.grid&&t.grid.rows>1&&o.grid;U?o.grid.initSlides(A):o.grid&&o.grid.unsetSlides();let V;const k=t.slidesPerView==="auto"&&t.breakpoints&&Object.keys(t.breakpoints).filter(z=>typeof t.breakpoints[z].slidesPerView<"u").length>0;for(let z=0;z<_;z+=1){V=0;let Q;if(A[z]&&(Q=A[z]),U&&o.grid.updateSlide(z,Q,A),!(A[z]&&Fr(Q,"display")==="none")){if(t.slidesPerView==="auto"){k&&(A[z].style[o.getDirectionLabel("width")]="");const Z=getComputedStyle(Q),K=Q.style.transform,s=Q.style.webkitTransform;if(K&&(Q.style.transform="none"),s&&(Q.style.webkitTransform="none"),t.roundLengths)V=o.isHorizontal()?VA(Q,"width"):VA(Q,"height");else{const H=e(Z,"width"),y=e(Z,"padding-left"),ee=e(Z,"padding-right"),I=e(Z,"margin-left"),re=e(Z,"margin-right"),Ae=Z.getPropertyValue("box-sizing");if(Ae&&Ae==="border-box")V=H+I+re;else{const{clientWidth:N,offsetWidth:n}=Q;V=H+y+ee+I+re+(n-N)}}K&&(Q.style.transform=K),s&&(Q.style.webkitTransform=s),t.roundLengths&&(V=Math.floor(V))}else V=(l-(t.slidesPerView-1)*M)/t.slidesPerView,t.roundLengths&&(V=Math.floor(V)),A[z]&&(A[z].style[o.getDirectionLabel("width")]=`${V}px`);A[z]&&(A[z].swiperSlideSize=V),E.push(V),t.centeredSlides?(B=B+V/2+D/2+M,D===0&&z!==0&&(B=B-l/2-M),z===0&&(B=B-l/2-M),Math.abs(B)<1/1e3&&(B=0),t.roundLengths&&(B=Math.floor(B)),G%t.slidesPerGroup===0&&b.push(B),w.push(B)):(t.roundLengths&&(B=Math.floor(B)),(G-Math.min(o.params.slidesPerGroupSkip,G))%o.params.slidesPerGroup===0&&b.push(B),w.push(B),B=B+V+M),o.virtualSize+=V+M,D=V,G+=1}}if(o.virtualSize=Math.max(o.virtualSize,l)+T,u&&d&&(t.effect==="slide"||t.effect==="coverflow")&&(i.style.width=`${o.virtualSize+M}px`),t.setWrapperSize&&(i.style[o.getDirectionLabel("width")]=`${o.virtualSize+M}px`),U&&o.grid.updateWrapperSize(V,b),!t.centeredSlides){const z=[];for(let Q=0;Q<b.length;Q+=1){let Z=b[Q];t.roundLengths&&(Z=Math.floor(Z)),b[Q]<=o.virtualSize-l&&z.push(Z)}b=z,Math.floor(o.virtualSize-l)-Math.floor(b[b.length-1])>1&&b.push(o.virtualSize-l)}if(p&&t.loop){const z=E[0]+M;if(t.slidesPerGroup>1){const Q=Math.ceil((o.virtual.slidesBefore+o.virtual.slidesAfter)/t.slidesPerGroup),Z=z*t.slidesPerGroup;for(let K=0;K<Q;K+=1)b.push(b[b.length-1]+Z)}for(let Q=0;Q<o.virtual.slidesBefore+o.virtual.slidesAfter;Q+=1)t.slidesPerGroup===1&&b.push(b[b.length-1]+z),w.push(w[w.length-1]+z),o.virtualSize+=z}if(b.length===0&&(b=[0]),M!==0){const z=o.isHorizontal()&&u?"marginLeft":o.getDirectionLabel("marginRight");A.filter((Q,Z)=>!t.cssMode||t.loop?!0:Z!==A.length-1).forEach(Q=>{Q.style[z]=`${M}px`})}if(t.centeredSlides&&t.centeredSlidesBounds){let z=0;E.forEach(Z=>{z+=Z+(M||0)}),z-=M;const Q=z>l?z-l:0;b=b.map(Z=>Z<=0?-C:Z>Q?Q+T:Z)}if(t.centerInsufficientSlides){let z=0;E.forEach(Z=>{z+=Z+(M||0)}),z-=M;const Q=(t.slidesOffsetBefore||0)+(t.slidesOffsetAfter||0);if(z+Q<l){const Z=(l-z-Q)/2;b.forEach((K,s)=>{b[s]=K-Z}),w.forEach((K,s)=>{w[s]=K+Z})}}if(Object.assign(o,{slides:A,snapGrid:b,slidesGrid:w,slidesSizesGrid:E}),t.centeredSlides&&t.cssMode&&!t.centeredSlidesBounds){qc(i,"--swiper-centered-offset-before",`${-b[0]}px`),qc(i,"--swiper-centered-offset-after",`${o.size/2-E[E.length-1]/2}px`);const z=-o.snapGrid[0],Q=-o.slidesGrid[0];o.snapGrid=o.snapGrid.map(Z=>Z+z),o.slidesGrid=o.slidesGrid.map(Z=>Z+Q)}if(_!==m&&o.emit("slidesLengthChange"),b.length!==x&&(o.params.watchOverflow&&o.checkOverflow(),o.emit("snapGridLengthChange")),w.length!==P&&o.emit("slidesGridLengthChange"),t.watchSlidesProgress&&o.updateSlidesOffset(),o.emit("slidesUpdated"),!p&&!t.cssMode&&(t.effect==="slide"||t.effect==="fade")){const z=`${t.containerModifierClass}backface-hidden`,Q=o.el.classList.contains(z);_<=t.maxBackfaceHiddenSlides?Q||o.el.classList.add(z):Q&&o.el.classList.remove(z)}}function d3(o){const e=this,t=[],i=e.virtual&&e.params.virtual.enabled;let a=0,l;typeof o=="number"?e.setTransition(o):o===!0&&e.setTransition(e.params.speed);const u=d=>i?e.slides[e.getSlideIndexByData(d)]:e.slides[d];if(e.params.slidesPerView!=="auto"&&e.params.slidesPerView>1)if(e.params.centeredSlides)(e.visibleSlides||[]).forEach(d=>{t.push(d)});else for(l=0;l<Math.ceil(e.params.slidesPerView);l+=1){const d=e.activeIndex+l;if(d>e.slides.length&&!i)break;t.push(u(d))}else t.push(u(e.activeIndex));for(l=0;l<t.length;l+=1)if(typeof t[l]<"u"){const d=t[l].offsetHeight;a=d>a?d:a}(a||a===0)&&(e.wrapperEl.style.height=`${a}px`)}function f3(){const o=this,e=o.slides,t=o.isElement?o.isHorizontal()?o.wrapperEl.offsetLeft:o.wrapperEl.offsetTop:0;for(let i=0;i<e.length;i+=1)e[i].swiperSlideOffset=(o.isHorizontal()?e[i].offsetLeft:e[i].offsetTop)-t-o.cssOverflowAdjustment()}const Rv=(o,e,t)=>{e&&!o.classList.contains(t)?o.classList.add(t):!e&&o.classList.contains(t)&&o.classList.remove(t)};function p3(o){o===void 0&&(o=this&&this.translate||0);const e=this,t=e.params,{slides:i,rtlTranslate:a,snapGrid:l}=e;if(i.length===0)return;typeof i[0].swiperSlideOffset>"u"&&e.updateSlidesOffset();let u=-o;a&&(u=o),e.visibleSlidesIndexes=[],e.visibleSlides=[];let d=t.spaceBetween;typeof d=="string"&&d.indexOf("%")>=0?d=parseFloat(d.replace("%",""))/100*e.size:typeof d=="string"&&(d=parseFloat(d));for(let p=0;p<i.length;p+=1){const m=i[p];let A=m.swiperSlideOffset;t.cssMode&&t.centeredSlides&&(A-=i[0].swiperSlideOffset);const _=(u+(t.centeredSlides?e.minTranslate():0)-A)/(m.swiperSlideSize+d),b=(u-l[0]+(t.centeredSlides?e.minTranslate():0)-A)/(m.swiperSlideSize+d),w=-(u-A),E=w+e.slidesSizesGrid[p],C=w>=0&&w<=e.size-e.slidesSizesGrid[p],T=w>=0&&w<e.size-1||E>1&&E<=e.size||w<=0&&E>=e.size;T&&(e.visibleSlides.push(m),e.visibleSlidesIndexes.push(p)),Rv(m,T,t.slideVisibleClass),Rv(m,C,t.slideFullyVisibleClass),m.progress=a?-_:_,m.originalProgress=a?-b:b}}function m3(o){const e=this;if(typeof o>"u"){const A=e.rtlTranslate?-1:1;o=e&&e.translate&&e.translate*A||0}const t=e.params,i=e.maxTranslate()-e.minTranslate();let{progress:a,isBeginning:l,isEnd:u,progressLoop:d}=e;const p=l,m=u;if(i===0)a=0,l=!0,u=!0;else{a=(o-e.minTranslate())/i;const A=Math.abs(o-e.minTranslate())<1,_=Math.abs(o-e.maxTranslate())<1;l=A||a<=0,u=_||a>=1,A&&(a=0),_&&(a=1)}if(t.loop){const A=e.getSlideIndexByData(0),_=e.getSlideIndexByData(e.slides.length-1),b=e.slidesGrid[A],w=e.slidesGrid[_],E=e.slidesGrid[e.slidesGrid.length-1],C=Math.abs(o);C>=b?d=(C-b)/E:d=(C+E-w)/E,d>1&&(d-=1)}Object.assign(e,{progress:a,progressLoop:d,isBeginning:l,isEnd:u}),(t.watchSlidesProgress||t.centeredSlides&&t.autoHeight)&&e.updateSlidesProgress(o),l&&!p&&e.emit("reachBeginning toEdge"),u&&!m&&e.emit("reachEnd toEdge"),(p&&!l||m&&!u)&&e.emit("fromEdge"),e.emit("progress",a)}const wm=(o,e,t)=>{e&&!o.classList.contains(t)?o.classList.add(t):!e&&o.classList.contains(t)&&o.classList.remove(t)};function g3(){const o=this,{slides:e,params:t,slidesEl:i,activeIndex:a}=o,l=o.virtual&&t.virtual.enabled,u=o.grid&&t.grid&&t.grid.rows>1,d=_=>Ui(i,`.${t.slideClass}${_}, swiper-slide${_}`)[0];let p,m,A;if(l)if(t.loop){let _=a-o.virtual.slidesBefore;_<0&&(_=o.virtual.slides.length+_),_>=o.virtual.slides.length&&(_-=o.virtual.slides.length),p=d(`[data-swiper-slide-index="${_}"]`)}else p=d(`[data-swiper-slide-index="${a}"]`);else u?(p=e.find(_=>_.column===a),A=e.find(_=>_.column===a+1),m=e.find(_=>_.column===a-1)):p=e[a];p&&(u||(A=n3(p,`.${t.slideClass}, swiper-slide`)[0],t.loop&&!A&&(A=e[0]),m=i3(p,`.${t.slideClass}, swiper-slide`)[0],t.loop&&!m===0&&(m=e[e.length-1]))),e.forEach(_=>{wm(_,_===p,t.slideActiveClass),wm(_,_===A,t.slideNextClass),wm(_,_===m,t.slidePrevClass)}),o.emitSlidesClasses()}const Td=(o,e)=>{if(!o||o.destroyed||!o.params)return;const t=()=>o.isElement?"swiper-slide":`.${o.params.slideClass}`,i=e.closest(t());if(i){let a=i.querySelector(`.${o.params.lazyPreloaderClass}`);!a&&o.isElement&&(i.shadowRoot?a=i.shadowRoot.querySelector(`.${o.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{i.shadowRoot&&(a=i.shadowRoot.querySelector(`.${o.params.lazyPreloaderClass}`),a&&a.remove())})),a&&a.remove()}},Em=(o,e)=>{if(!o.slides[e])return;const t=o.slides[e].querySelector('[loading="lazy"]');t&&t.removeAttribute("loading")},QA=o=>{if(!o||o.destroyed||!o.params)return;let e=o.params.lazyPreloadPrevNext;const t=o.slides.length;if(!t||!e||e<0)return;e=Math.min(e,t);const i=o.params.slidesPerView==="auto"?o.slidesPerViewDynamic():Math.ceil(o.params.slidesPerView),a=o.activeIndex;if(o.params.grid&&o.params.grid.rows>1){const u=a,d=[u-e];d.push(...Array.from({length:e}).map((p,m)=>u+i+m)),o.slides.forEach((p,m)=>{d.includes(p.column)&&Em(o,m)});return}const l=a+i-1;if(o.params.rewind||o.params.loop)for(let u=a-e;u<=l+e;u+=1){const d=(u%t+t)%t;(d<a||d>l)&&Em(o,d)}else for(let u=Math.max(a-e,0);u<=Math.min(l+e,t-1);u+=1)u!==a&&(u>l||u<a)&&Em(o,u)};function A3(o){const{slidesGrid:e,params:t}=o,i=o.rtlTranslate?o.translate:-o.translate;let a;for(let l=0;l<e.length;l+=1)typeof e[l+1]<"u"?i>=e[l]&&i<e[l+1]-(e[l+1]-e[l])/2?a=l:i>=e[l]&&i<e[l+1]&&(a=l+1):i>=e[l]&&(a=l);return t.normalizeSlideIndex&&(a<0||typeof a>"u")&&(a=0),a}function _3(o){const e=this,t=e.rtlTranslate?e.translate:-e.translate,{snapGrid:i,params:a,activeIndex:l,realIndex:u,snapIndex:d}=e;let p=o,m;const A=w=>{let E=w-e.virtual.slidesBefore;return E<0&&(E=e.virtual.slides.length+E),E>=e.virtual.slides.length&&(E-=e.virtual.slides.length),E};if(typeof p>"u"&&(p=A3(e)),i.indexOf(t)>=0)m=i.indexOf(t);else{const w=Math.min(a.slidesPerGroupSkip,p);m=w+Math.floor((p-w)/a.slidesPerGroup)}if(m>=i.length&&(m=i.length-1),p===l&&!e.params.loop){m!==d&&(e.snapIndex=m,e.emit("snapIndexChange"));return}if(p===l&&e.params.loop&&e.virtual&&e.params.virtual.enabled){e.realIndex=A(p);return}const _=e.grid&&a.grid&&a.grid.rows>1;let b;if(e.virtual&&a.virtual.enabled&&a.loop)b=A(p);else if(_){const w=e.slides.find(C=>C.column===p);let E=parseInt(w.getAttribute("data-swiper-slide-index"),10);Number.isNaN(E)&&(E=Math.max(e.slides.indexOf(w),0)),b=Math.floor(E/a.grid.rows)}else if(e.slides[p]){const w=e.slides[p].getAttribute("data-swiper-slide-index");w?b=parseInt(w,10):b=p}else b=p;Object.assign(e,{previousSnapIndex:d,snapIndex:m,previousRealIndex:u,realIndex:b,previousIndex:l,activeIndex:p}),e.initialized&&QA(e),e.emit("activeIndexChange"),e.emit("snapIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&(u!==b&&e.emit("realIndexChange"),e.emit("slideChange"))}function y3(o,e){const t=this,i=t.params;let a=o.closest(`.${i.slideClass}, swiper-slide`);!a&&t.isElement&&e&&e.length>1&&e.includes(o)&&[...e.slice(e.indexOf(o)+1,e.length)].forEach(d=>{!a&&d.matches&&d.matches(`.${i.slideClass}, swiper-slide`)&&(a=d)});let l=!1,u;if(a){for(let d=0;d<t.slides.length;d+=1)if(t.slides[d]===a){l=!0,u=d;break}}if(a&&l)t.clickedSlide=a,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(a.getAttribute("data-swiper-slide-index"),10):t.clickedIndex=u;else{t.clickedSlide=void 0,t.clickedIndex=void 0;return}i.slideToClickedSlide&&t.clickedIndex!==void 0&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}var b3={updateSize:u3,updateSlides:h3,updateAutoHeight:d3,updateSlidesOffset:f3,updateSlidesProgress:p3,updateProgress:m3,updateSlidesClasses:g3,updateActiveIndex:_3,updateClickedSlide:y3};function v3(o){o===void 0&&(o=this.isHorizontal()?"x":"y");const e=this,{params:t,rtlTranslate:i,translate:a,wrapperEl:l}=e;if(t.virtualTranslate)return i?-a:a;if(t.cssMode)return a;let u=HA(l,o);return u+=e.cssOverflowAdjustment(),i&&(u=-u),u||0}function w3(o,e){const t=this,{rtlTranslate:i,params:a,wrapperEl:l,progress:u}=t;let d=0,p=0;const m=0;t.isHorizontal()?d=i?-o:o:p=o,a.roundLengths&&(d=Math.floor(d),p=Math.floor(p)),t.previousTranslate=t.translate,t.translate=t.isHorizontal()?d:p,a.cssMode?l[t.isHorizontal()?"scrollLeft":"scrollTop"]=t.isHorizontal()?-d:-p:a.virtualTranslate||(t.isHorizontal()?d-=t.cssOverflowAdjustment():p-=t.cssOverflowAdjustment(),l.style.transform=`translate3d(${d}px, ${p}px, ${m}px)`);let A;const _=t.maxTranslate()-t.minTranslate();_===0?A=0:A=(o-t.minTranslate())/_,A!==u&&t.updateProgress(o),t.emit("setTranslate",t.translate,e)}function E3(){return-this.snapGrid[0]}function x3(){return-this.snapGrid[this.snapGrid.length-1]}function S3(o,e,t,i,a){o===void 0&&(o=0),e===void 0&&(e=this.params.speed),t===void 0&&(t=!0),i===void 0&&(i=!0);const l=this,{params:u,wrapperEl:d}=l;if(l.animating&&u.preventInteractionOnTransition)return!1;const p=l.minTranslate(),m=l.maxTranslate();let A;if(i&&o>p?A=p:i&&o<m?A=m:A=o,l.updateProgress(A),u.cssMode){const _=l.isHorizontal();if(e===0)d[_?"scrollLeft":"scrollTop"]=-A;else{if(!l.support.smoothScroll)return lC({swiper:l,targetPosition:-A,side:_?"left":"top"}),!0;d.scrollTo({[_?"left":"top"]:-A,behavior:"smooth"})}return!0}return e===0?(l.setTransition(0),l.setTranslate(A),t&&(l.emit("beforeTransitionStart",e,a),l.emit("transitionEnd"))):(l.setTransition(e),l.setTranslate(A),t&&(l.emit("beforeTransitionStart",e,a),l.emit("transitionStart")),l.animating||(l.animating=!0,l.onTranslateToWrapperTransitionEnd||(l.onTranslateToWrapperTransitionEnd=function(b){!l||l.destroyed||b.target===this&&(l.wrapperEl.removeEventListener("transitionend",l.onTranslateToWrapperTransitionEnd),l.onTranslateToWrapperTransitionEnd=null,delete l.onTranslateToWrapperTransitionEnd,l.animating=!1,t&&l.emit("transitionEnd"))}),l.wrapperEl.addEventListener("transitionend",l.onTranslateToWrapperTransitionEnd))),!0}var C3={getTranslate:v3,setTranslate:w3,minTranslate:E3,maxTranslate:x3,translateTo:S3};function T3(o,e){const t=this;t.params.cssMode||(t.wrapperEl.style.transitionDuration=`${o}ms`,t.wrapperEl.style.transitionDelay=o===0?"0ms":""),t.emit("setTransition",o,e)}function dC(o){let{swiper:e,runCallbacks:t,direction:i,step:a}=o;const{activeIndex:l,previousIndex:u}=e;let d=i;d||(l>u?d="next":l<u?d="prev":d="reset"),e.emit(`transition${a}`),t&&d==="reset"?e.emit(`slideResetTransition${a}`):t&&l!==u&&(e.emit(`slideChangeTransition${a}`),d==="next"?e.emit(`slideNextTransition${a}`):e.emit(`slidePrevTransition${a}`))}function I3(o,e){o===void 0&&(o=!0);const t=this,{params:i}=t;i.cssMode||(i.autoHeight&&t.updateAutoHeight(),dC({swiper:t,runCallbacks:o,direction:e,step:"Start"}))}function M3(o,e){o===void 0&&(o=!0);const t=this,{params:i}=t;t.animating=!1,!i.cssMode&&(t.setTransition(0),dC({swiper:t,runCallbacks:o,direction:e,step:"End"}))}var R3={setTransition:T3,transitionStart:I3,transitionEnd:M3};function B3(o,e,t,i,a){o===void 0&&(o=0),t===void 0&&(t=!0),typeof o=="string"&&(o=parseInt(o,10));const l=this;let u=o;u<0&&(u=0);const{params:d,snapGrid:p,slidesGrid:m,previousIndex:A,activeIndex:_,rtlTranslate:b,wrapperEl:w,enabled:E}=l;if(!E&&!i&&!a||l.destroyed||l.animating&&d.preventInteractionOnTransition)return!1;typeof e>"u"&&(e=l.params.speed);const C=Math.min(l.params.slidesPerGroupSkip,u);let T=C+Math.floor((u-C)/l.params.slidesPerGroup);T>=p.length&&(T=p.length-1);const x=-p[T];if(d.normalizeSlideIndex)for(let U=0;U<m.length;U+=1){const V=-Math.floor(x*100),k=Math.floor(m[U]*100),z=Math.floor(m[U+1]*100);typeof m[U+1]<"u"?V>=k&&V<z-(z-k)/2?u=U:V>=k&&V<z&&(u=U+1):V>=k&&(u=U)}if(l.initialized&&u!==_&&(!l.allowSlideNext&&(b?x>l.translate&&x>l.minTranslate():x<l.translate&&x<l.minTranslate())||!l.allowSlidePrev&&x>l.translate&&x>l.maxTranslate()&&(_||0)!==u))return!1;u!==(A||0)&&t&&l.emit("beforeSlideChangeStart"),l.updateProgress(x);let P;u>_?P="next":u<_?P="prev":P="reset";const M=l.virtual&&l.params.virtual.enabled;if(!(M&&a)&&(b&&-x===l.translate||!b&&x===l.translate))return l.updateActiveIndex(u),d.autoHeight&&l.updateAutoHeight(),l.updateSlidesClasses(),d.effect!=="slide"&&l.setTranslate(x),P!=="reset"&&(l.transitionStart(t,P),l.transitionEnd(t,P)),!1;if(d.cssMode){const U=l.isHorizontal(),V=b?x:-x;if(e===0)M&&(l.wrapperEl.style.scrollSnapType="none",l._immediateVirtual=!0),M&&!l._cssModeVirtualInitialSet&&l.params.initialSlide>0?(l._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{w[U?"scrollLeft":"scrollTop"]=V})):w[U?"scrollLeft":"scrollTop"]=V,M&&requestAnimationFrame(()=>{l.wrapperEl.style.scrollSnapType="",l._immediateVirtual=!1});else{if(!l.support.smoothScroll)return lC({swiper:l,targetPosition:V,side:U?"left":"top"}),!0;w.scrollTo({[U?"left":"top"]:V,behavior:"smooth"})}return!0}const G=hC().isSafari;return M&&!a&&G&&l.isElement&&l.virtual.update(!1,!1,u),l.setTransition(e),l.setTranslate(x),l.updateActiveIndex(u),l.updateSlidesClasses(),l.emit("beforeTransitionStart",e,i),l.transitionStart(t,P),e===0?l.transitionEnd(t,P):l.animating||(l.animating=!0,l.onSlideToWrapperTransitionEnd||(l.onSlideToWrapperTransitionEnd=function(V){!l||l.destroyed||V.target===this&&(l.wrapperEl.removeEventListener("transitionend",l.onSlideToWrapperTransitionEnd),l.onSlideToWrapperTransitionEnd=null,delete l.onSlideToWrapperTransitionEnd,l.transitionEnd(t,P))}),l.wrapperEl.addEventListener("transitionend",l.onSlideToWrapperTransitionEnd)),!0}function P3(o,e,t,i){o===void 0&&(o=0),t===void 0&&(t=!0),typeof o=="string"&&(o=parseInt(o,10));const a=this;if(a.destroyed)return;typeof e>"u"&&(e=a.params.speed);const l=a.grid&&a.params.grid&&a.params.grid.rows>1;let u=o;if(a.params.loop)if(a.virtual&&a.params.virtual.enabled)u=u+a.virtual.slidesBefore;else{let d;if(l){const b=u*a.params.grid.rows;d=a.slides.find(w=>w.getAttribute("data-swiper-slide-index")*1===b).column}else d=a.getSlideIndexByData(u);const p=l?Math.ceil(a.slides.length/a.params.grid.rows):a.slides.length,{centeredSlides:m}=a.params;let A=a.params.slidesPerView;A==="auto"?A=a.slidesPerViewDynamic():(A=Math.ceil(parseFloat(a.params.slidesPerView,10)),m&&A%2===0&&(A=A+1));let _=p-d<A;if(m&&(_=_||d<Math.ceil(A/2)),i&&m&&a.params.slidesPerView!=="auto"&&!l&&(_=!1),_){const b=m?d<a.activeIndex?"prev":"next":d-a.activeIndex-1<a.params.slidesPerView?"next":"prev";a.loopFix({direction:b,slideTo:!0,activeSlideIndex:b==="next"?d+1:d-p+1,slideRealIndex:b==="next"?a.realIndex:void 0})}if(l){const b=u*a.params.grid.rows;u=a.slides.find(w=>w.getAttribute("data-swiper-slide-index")*1===b).column}else u=a.getSlideIndexByData(u)}return requestAnimationFrame(()=>{a.slideTo(u,e,t,i)}),a}function L3(o,e,t){e===void 0&&(e=!0);const i=this,{enabled:a,params:l,animating:u}=i;if(!a||i.destroyed)return i;typeof o>"u"&&(o=i.params.speed);let d=l.slidesPerGroup;l.slidesPerView==="auto"&&l.slidesPerGroup===1&&l.slidesPerGroupAuto&&(d=Math.max(i.slidesPerViewDynamic("current",!0),1));const p=i.activeIndex<l.slidesPerGroupSkip?1:d,m=i.virtual&&l.virtual.enabled;if(l.loop){if(u&&!m&&l.loopPreventsSliding)return!1;if(i.loopFix({direction:"next"}),i._clientLeft=i.wrapperEl.clientLeft,i.activeIndex===i.slides.length-1&&l.cssMode)return requestAnimationFrame(()=>{i.slideTo(i.activeIndex+p,o,e,t)}),!0}return l.rewind&&i.isEnd?i.slideTo(0,o,e,t):i.slideTo(i.activeIndex+p,o,e,t)}function D3(o,e,t){e===void 0&&(e=!0);const i=this,{params:a,snapGrid:l,slidesGrid:u,rtlTranslate:d,enabled:p,animating:m}=i;if(!p||i.destroyed)return i;typeof o>"u"&&(o=i.params.speed);const A=i.virtual&&a.virtual.enabled;if(a.loop){if(m&&!A&&a.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}const _=d?i.translate:-i.translate;function b(P){return P<0?-Math.floor(Math.abs(P)):Math.floor(P)}const w=b(_),E=l.map(P=>b(P)),C=a.freeMode&&a.freeMode.enabled;let T=l[E.indexOf(w)-1];if(typeof T>"u"&&(a.cssMode||C)){let P;l.forEach((M,B)=>{w>=M&&(P=B)}),typeof P<"u"&&(T=C?l[P]:l[P>0?P-1:P])}let x=0;if(typeof T<"u"&&(x=u.indexOf(T),x<0&&(x=i.activeIndex-1),a.slidesPerView==="auto"&&a.slidesPerGroup===1&&a.slidesPerGroupAuto&&(x=x-i.slidesPerViewDynamic("previous",!0)+1,x=Math.max(x,0))),a.rewind&&i.isBeginning){const P=i.params.virtual&&i.params.virtual.enabled&&i.virtual?i.virtual.slides.length-1:i.slides.length-1;return i.slideTo(P,o,e,t)}else if(a.loop&&i.activeIndex===0&&a.cssMode)return requestAnimationFrame(()=>{i.slideTo(x,o,e,t)}),!0;return i.slideTo(x,o,e,t)}function N3(o,e,t){e===void 0&&(e=!0);const i=this;if(!i.destroyed)return typeof o>"u"&&(o=i.params.speed),i.slideTo(i.activeIndex,o,e,t)}function O3(o,e,t,i){e===void 0&&(e=!0),i===void 0&&(i=.5);const a=this;if(a.destroyed)return;typeof o>"u"&&(o=a.params.speed);let l=a.activeIndex;const u=Math.min(a.params.slidesPerGroupSkip,l),d=u+Math.floor((l-u)/a.params.slidesPerGroup),p=a.rtlTranslate?a.translate:-a.translate;if(p>=a.snapGrid[d]){const m=a.snapGrid[d],A=a.snapGrid[d+1];p-m>(A-m)*i&&(l+=a.params.slidesPerGroup)}else{const m=a.snapGrid[d-1],A=a.snapGrid[d];p-m<=(A-m)*i&&(l-=a.params.slidesPerGroup)}return l=Math.max(l,0),l=Math.min(l,a.slidesGrid.length-1),a.slideTo(l,o,e,t)}function k3(){const o=this;if(o.destroyed)return;const{params:e,slidesEl:t}=o,i=e.slidesPerView==="auto"?o.slidesPerViewDynamic():e.slidesPerView;let a=o.getSlideIndexWhenGrid(o.clickedIndex),l;const u=o.isElement?"swiper-slide":`.${e.slideClass}`,d=o.grid&&o.params.grid&&o.params.grid.rows>1;if(e.loop){if(o.animating)return;l=parseInt(o.clickedSlide.getAttribute("data-swiper-slide-index"),10),e.centeredSlides?o.slideToLoop(l):a>(d?(o.slides.length-i)/2-(o.params.grid.rows-1):o.slides.length-i)?(o.loopFix(),a=o.getSlideIndex(Ui(t,`${u}[data-swiper-slide-index="${l}"]`)[0]),Dl(()=>{o.slideTo(a)})):o.slideTo(a)}else o.slideTo(a)}var U3={slideTo:B3,slideToLoop:P3,slideNext:L3,slidePrev:D3,slideReset:N3,slideToClosest:O3,slideToClickedSlide:k3};function F3(o,e){const t=this,{params:i,slidesEl:a}=t;if(!i.loop||t.virtual&&t.params.virtual.enabled)return;const l=()=>{Ui(a,`.${i.slideClass}, swiper-slide`).forEach((w,E)=>{w.setAttribute("data-swiper-slide-index",E)})},u=()=>{const b=Ui(a,`.${i.slideBlankClass}`);b.forEach(w=>{w.remove()}),b.length>0&&(t.recalcSlides(),t.updateSlides())},d=t.grid&&i.grid&&i.grid.rows>1;i.loopAddBlankSlides&&(i.slidesPerGroup>1||d)&&u();const p=i.slidesPerGroup*(d?i.grid.rows:1),m=t.slides.length%p!==0,A=d&&t.slides.length%i.grid.rows!==0,_=b=>{for(let w=0;w<b;w+=1){const E=t.isElement?Pn("swiper-slide",[i.slideBlankClass]):Pn("div",[i.slideClass,i.slideBlankClass]);t.slidesEl.append(E)}};if(m){if(i.loopAddBlankSlides){const b=p-t.slides.length%p;_(b),t.recalcSlides(),t.updateSlides()}else gf("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");l()}else if(A){if(i.loopAddBlankSlides){const b=i.grid.rows-t.slides.length%i.grid.rows;_(b),t.recalcSlides(),t.updateSlides()}else gf("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");l()}else l();t.loopFix({slideRealIndex:o,direction:i.centeredSlides?void 0:"next",initial:e})}function $3(o){let{slideRealIndex:e,slideTo:t=!0,direction:i,setTranslate:a,activeSlideIndex:l,initial:u,byController:d,byMousewheel:p}=o===void 0?{}:o;const m=this;if(!m.params.loop)return;m.emit("beforeLoopFix");const{slides:A,allowSlidePrev:_,allowSlideNext:b,slidesEl:w,params:E}=m,{centeredSlides:C,initialSlide:T}=E;if(m.allowSlidePrev=!0,m.allowSlideNext=!0,m.virtual&&E.virtual.enabled){t&&(!E.centeredSlides&&m.snapIndex===0?m.slideTo(m.virtual.slides.length,0,!1,!0):E.centeredSlides&&m.snapIndex<E.slidesPerView?m.slideTo(m.virtual.slides.length+m.snapIndex,0,!1,!0):m.snapIndex===m.snapGrid.length-1&&m.slideTo(m.virtual.slidesBefore,0,!1,!0)),m.allowSlidePrev=_,m.allowSlideNext=b,m.emit("loopFix");return}let x=E.slidesPerView;x==="auto"?x=m.slidesPerViewDynamic():(x=Math.ceil(parseFloat(E.slidesPerView,10)),C&&x%2===0&&(x=x+1));const P=E.slidesPerGroupAuto?x:E.slidesPerGroup;let M=C?Math.max(P,Math.ceil(x/2)):P;M%P!==0&&(M+=P-M%P),M+=E.loopAdditionalSlides,m.loopedSlides=M;const B=m.grid&&E.grid&&E.grid.rows>1;A.length<x+M||m.params.effect==="cards"&&A.length<x+M*2?gf("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):B&&E.grid.fill==="row"&&gf("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const D=[],G=[],U=B?Math.ceil(A.length/E.grid.rows):A.length,V=u&&U-T<x&&!C;let k=V?T:m.activeIndex;typeof l>"u"?l=m.getSlideIndex(A.find(y=>y.classList.contains(E.slideActiveClass))):k=l;const z=i==="next"||!i,Q=i==="prev"||!i;let Z=0,K=0;const H=(B?A[l].column:l)+(C&&typeof a>"u"?-x/2+.5:0);if(H<M){Z=Math.max(M-H,P);for(let y=0;y<M-H;y+=1){const ee=y-Math.floor(y/U)*U;if(B){const I=U-ee-1;for(let re=A.length-1;re>=0;re-=1)A[re].column===I&&D.push(re)}else D.push(U-ee-1)}}else if(H+x>U-M){K=Math.max(H-(U-M*2),P),V&&(K=Math.max(K,x-U+T+1));for(let y=0;y<K;y+=1){const ee=y-Math.floor(y/U)*U;B?A.forEach((I,re)=>{I.column===ee&&G.push(re)}):G.push(ee)}}if(m.__preventObserver__=!0,requestAnimationFrame(()=>{m.__preventObserver__=!1}),m.params.effect==="cards"&&A.length<x+M*2&&(G.includes(l)&&G.splice(G.indexOf(l),1),D.includes(l)&&D.splice(D.indexOf(l),1)),Q&&D.forEach(y=>{A[y].swiperLoopMoveDOM=!0,w.prepend(A[y]),A[y].swiperLoopMoveDOM=!1}),z&&G.forEach(y=>{A[y].swiperLoopMoveDOM=!0,w.append(A[y]),A[y].swiperLoopMoveDOM=!1}),m.recalcSlides(),E.slidesPerView==="auto"?m.updateSlides():B&&(D.length>0&&Q||G.length>0&&z)&&m.slides.forEach((y,ee)=>{m.grid.updateSlide(ee,y,m.slides)}),E.watchSlidesProgress&&m.updateSlidesOffset(),t){if(D.length>0&&Q){if(typeof e>"u"){const y=m.slidesGrid[k],I=m.slidesGrid[k+Z]-y;p?m.setTranslate(m.translate-I):(m.slideTo(k+Math.ceil(Z),0,!1,!0),a&&(m.touchEventsData.startTranslate=m.touchEventsData.startTranslate-I,m.touchEventsData.currentTranslate=m.touchEventsData.currentTranslate-I))}else if(a){const y=B?D.length/E.grid.rows:D.length;m.slideTo(m.activeIndex+y,0,!1,!0),m.touchEventsData.currentTranslate=m.translate}}else if(G.length>0&&z)if(typeof e>"u"){const y=m.slidesGrid[k],I=m.slidesGrid[k-K]-y;p?m.setTranslate(m.translate-I):(m.slideTo(k-K,0,!1,!0),a&&(m.touchEventsData.startTranslate=m.touchEventsData.startTranslate-I,m.touchEventsData.currentTranslate=m.touchEventsData.currentTranslate-I))}else{const y=B?G.length/E.grid.rows:G.length;m.slideTo(m.activeIndex-y,0,!1,!0)}}if(m.allowSlidePrev=_,m.allowSlideNext=b,m.controller&&m.controller.control&&!d){const y={slideRealIndex:e,direction:i,setTranslate:a,activeSlideIndex:l,byController:!0};Array.isArray(m.controller.control)?m.controller.control.forEach(ee=>{!ee.destroyed&&ee.params.loop&&ee.loopFix({...y,slideTo:ee.params.slidesPerView===E.slidesPerView?t:!1})}):m.controller.control instanceof m.constructor&&m.controller.control.params.loop&&m.controller.control.loopFix({...y,slideTo:m.controller.control.params.slidesPerView===E.slidesPerView?t:!1})}m.emit("loopFix")}function z3(){const o=this,{params:e,slidesEl:t}=o;if(!e.loop||!t||o.virtual&&o.params.virtual.enabled)return;o.recalcSlides();const i=[];o.slides.forEach(a=>{const l=typeof a.swiperSlideIndex>"u"?a.getAttribute("data-swiper-slide-index")*1:a.swiperSlideIndex;i[l]=a}),o.slides.forEach(a=>{a.removeAttribute("data-swiper-slide-index")}),i.forEach(a=>{t.append(a)}),o.recalcSlides(),o.slideTo(o.realIndex,0)}var G3={loopCreate:F3,loopFix:$3,loopDestroy:z3};function H3(o){const e=this;if(!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const t=e.params.touchEventsTarget==="container"?e.el:e.wrapperEl;e.isElement&&(e.__preventObserver__=!0),t.style.cursor="move",t.style.cursor=o?"grabbing":"grab",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1})}function V3(){const o=this;o.params.watchOverflow&&o.isLocked||o.params.cssMode||(o.isElement&&(o.__preventObserver__=!0),o[o.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",o.isElement&&requestAnimationFrame(()=>{o.__preventObserver__=!1}))}var Q3={setGrabCursor:H3,unsetGrabCursor:V3};function j3(o,e){e===void 0&&(e=this);function t(i){if(!i||i===Li()||i===ti())return null;i.assignedSlot&&(i=i.assignedSlot);const a=i.closest(o);return!a&&!i.getRootNode?null:a||t(i.getRootNode().host)}return t(e)}function Bv(o,e,t){const i=ti(),{params:a}=o,l=a.edgeSwipeDetection,u=a.edgeSwipeThreshold;return l&&(t<=u||t>=i.innerWidth-u)?l==="prevent"?(e.preventDefault(),!0):!1:!0}function q3(o){const e=this,t=Li();let i=o;i.originalEvent&&(i=i.originalEvent);const a=e.touchEventsData;if(i.type==="pointerdown"){if(a.pointerId!==null&&a.pointerId!==i.pointerId)return;a.pointerId=i.pointerId}else i.type==="touchstart"&&i.targetTouches.length===1&&(a.touchId=i.targetTouches[0].identifier);if(i.type==="touchstart"){Bv(e,i,i.targetTouches[0].pageX);return}const{params:l,touches:u,enabled:d}=e;if(!d||!l.simulateTouch&&i.pointerType==="mouse"||e.animating&&l.preventInteractionOnTransition)return;!e.animating&&l.cssMode&&l.loop&&e.loopFix();let p=i.target;if(l.touchEventsTarget==="wrapper"&&!t3(p,e.wrapperEl)||"which"in i&&i.which===3||"button"in i&&i.button>0||a.isTouched&&a.isMoved)return;const m=!!l.noSwipingClass&&l.noSwipingClass!=="",A=i.composedPath?i.composedPath():i.path;m&&i.target&&i.target.shadowRoot&&A&&(p=A[0]);const _=l.noSwipingSelector?l.noSwipingSelector:`.${l.noSwipingClass}`,b=!!(i.target&&i.target.shadowRoot);if(l.noSwiping&&(b?j3(_,p):p.closest(_))){e.allowClick=!0;return}if(l.swipeHandler&&!p.closest(l.swipeHandler))return;u.currentX=i.pageX,u.currentY=i.pageY;const w=u.currentX,E=u.currentY;if(!Bv(e,i,w))return;Object.assign(a,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),u.startX=w,u.startY=E,a.touchStartTime=Vn(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,l.threshold>0&&(a.allowThresholdMove=!1);let C=!0;p.matches(a.focusableElements)&&(C=!1,p.nodeName==="SELECT"&&(a.isTouched=!1)),t.activeElement&&t.activeElement.matches(a.focusableElements)&&t.activeElement!==p&&(i.pointerType==="mouse"||i.pointerType!=="mouse"&&!p.matches(a.focusableElements))&&t.activeElement.blur();const T=C&&e.allowTouchMove&&l.touchStartPreventDefault;(l.touchStartForcePreventDefault||T)&&!p.isContentEditable&&i.preventDefault(),l.freeMode&&l.freeMode.enabled&&e.freeMode&&e.animating&&!l.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",i)}function W3(o){const e=Li(),t=this,i=t.touchEventsData,{params:a,touches:l,rtlTranslate:u,enabled:d}=t;if(!d||!a.simulateTouch&&o.pointerType==="mouse")return;let p=o;if(p.originalEvent&&(p=p.originalEvent),p.type==="pointermove"&&(i.touchId!==null||p.pointerId!==i.pointerId))return;let m;if(p.type==="touchmove"){if(m=[...p.changedTouches].find(D=>D.identifier===i.touchId),!m||m.identifier!==i.touchId)return}else m=p;if(!i.isTouched){i.startMoving&&i.isScrolling&&t.emit("touchMoveOpposite",p);return}const A=m.pageX,_=m.pageY;if(p.preventedByNestedSwiper){l.startX=A,l.startY=_;return}if(!t.allowTouchMove){p.target.matches(i.focusableElements)||(t.allowClick=!1),i.isTouched&&(Object.assign(l,{startX:A,startY:_,currentX:A,currentY:_}),i.touchStartTime=Vn());return}if(a.touchReleaseOnEdges&&!a.loop)if(t.isVertical()){if(_<l.startY&&t.translate<=t.maxTranslate()||_>l.startY&&t.translate>=t.minTranslate()){i.isTouched=!1,i.isMoved=!1;return}}else{if(u&&(A>l.startX&&-t.translate<=t.maxTranslate()||A<l.startX&&-t.translate>=t.minTranslate()))return;if(!u&&(A<l.startX&&t.translate<=t.maxTranslate()||A>l.startX&&t.translate>=t.minTranslate()))return}if(e.activeElement&&e.activeElement.matches(i.focusableElements)&&e.activeElement!==p.target&&p.pointerType!=="mouse"&&e.activeElement.blur(),e.activeElement&&p.target===e.activeElement&&p.target.matches(i.focusableElements)){i.isMoved=!0,t.allowClick=!1;return}i.allowTouchCallbacks&&t.emit("touchMove",p),l.previousX=l.currentX,l.previousY=l.currentY,l.currentX=A,l.currentY=_;const b=l.currentX-l.startX,w=l.currentY-l.startY;if(t.params.threshold&&Math.sqrt(b**2+w**2)<t.params.threshold)return;if(typeof i.isScrolling>"u"){let D;t.isHorizontal()&&l.currentY===l.startY||t.isVertical()&&l.currentX===l.startX?i.isScrolling=!1:b*b+w*w>=25&&(D=Math.atan2(Math.abs(w),Math.abs(b))*180/Math.PI,i.isScrolling=t.isHorizontal()?D>a.touchAngle:90-D>a.touchAngle)}if(i.isScrolling&&t.emit("touchMoveOpposite",p),typeof i.startMoving>"u"&&(l.currentX!==l.startX||l.currentY!==l.startY)&&(i.startMoving=!0),i.isScrolling||p.type==="touchmove"&&i.preventTouchMoveFromPointerMove){i.isTouched=!1;return}if(!i.startMoving)return;t.allowClick=!1,!a.cssMode&&p.cancelable&&p.preventDefault(),a.touchMoveStopPropagation&&!a.nested&&p.stopPropagation();let E=t.isHorizontal()?b:w,C=t.isHorizontal()?l.currentX-l.previousX:l.currentY-l.previousY;a.oneWayMovement&&(E=Math.abs(E)*(u?1:-1),C=Math.abs(C)*(u?1:-1)),l.diff=E,E*=a.touchRatio,u&&(E=-E,C=-C);const T=t.touchesDirection;t.swipeDirection=E>0?"prev":"next",t.touchesDirection=C>0?"prev":"next";const x=t.params.loop&&!a.cssMode,P=t.touchesDirection==="next"&&t.allowSlideNext||t.touchesDirection==="prev"&&t.allowSlidePrev;if(!i.isMoved){if(x&&P&&t.loopFix({direction:t.swipeDirection}),i.startTranslate=t.getTranslate(),t.setTransition(0),t.animating){const D=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});t.wrapperEl.dispatchEvent(D)}i.allowMomentumBounce=!1,a.grabCursor&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!0),t.emit("sliderFirstMove",p)}if(new Date().getTime(),a._loopSwapReset!==!1&&i.isMoved&&i.allowThresholdMove&&T!==t.touchesDirection&&x&&P&&Math.abs(E)>=1){Object.assign(l,{startX:A,startY:_,currentX:A,currentY:_,startTranslate:i.currentTranslate}),i.loopSwapReset=!0,i.startTranslate=i.currentTranslate;return}t.emit("sliderMove",p),i.isMoved=!0,i.currentTranslate=E+i.startTranslate;let M=!0,B=a.resistanceRatio;if(a.touchReleaseOnEdges&&(B=0),E>0?(x&&P&&i.allowThresholdMove&&i.currentTranslate>(a.centeredSlides?t.minTranslate()-t.slidesSizesGrid[t.activeIndex+1]-(a.slidesPerView!=="auto"&&t.slides.length-a.slidesPerView>=2?t.slidesSizesGrid[t.activeIndex+1]+t.params.spaceBetween:0)-t.params.spaceBetween:t.minTranslate())&&t.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>t.minTranslate()&&(M=!1,a.resistance&&(i.currentTranslate=t.minTranslate()-1+(-t.minTranslate()+i.startTranslate+E)**B))):E<0&&(x&&P&&i.allowThresholdMove&&i.currentTranslate<(a.centeredSlides?t.maxTranslate()+t.slidesSizesGrid[t.slidesSizesGrid.length-1]+t.params.spaceBetween+(a.slidesPerView!=="auto"&&t.slides.length-a.slidesPerView>=2?t.slidesSizesGrid[t.slidesSizesGrid.length-1]+t.params.spaceBetween:0):t.maxTranslate())&&t.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:t.slides.length-(a.slidesPerView==="auto"?t.slidesPerViewDynamic():Math.ceil(parseFloat(a.slidesPerView,10)))}),i.currentTranslate<t.maxTranslate()&&(M=!1,a.resistance&&(i.currentTranslate=t.maxTranslate()+1-(t.maxTranslate()-i.startTranslate-E)**B))),M&&(p.preventedByNestedSwiper=!0),!t.allowSlideNext&&t.swipeDirection==="next"&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!t.allowSlidePrev&&t.swipeDirection==="prev"&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),!t.allowSlidePrev&&!t.allowSlideNext&&(i.currentTranslate=i.startTranslate),a.threshold>0)if(Math.abs(E)>a.threshold||i.allowThresholdMove){if(!i.allowThresholdMove){i.allowThresholdMove=!0,l.startX=l.currentX,l.startY=l.currentY,i.currentTranslate=i.startTranslate,l.diff=t.isHorizontal()?l.currentX-l.startX:l.currentY-l.startY;return}}else{i.currentTranslate=i.startTranslate;return}!a.followFinger||a.cssMode||((a.freeMode&&a.freeMode.enabled&&t.freeMode||a.watchSlidesProgress)&&(t.updateActiveIndex(),t.updateSlidesClasses()),a.freeMode&&a.freeMode.enabled&&t.freeMode&&t.freeMode.onTouchMove(),t.updateProgress(i.currentTranslate),t.setTranslate(i.currentTranslate))}function Y3(o){const e=this,t=e.touchEventsData;let i=o;i.originalEvent&&(i=i.originalEvent);let a;if(i.type==="touchend"||i.type==="touchcancel"){if(a=[...i.changedTouches].find(D=>D.identifier===t.touchId),!a||a.identifier!==t.touchId)return}else{if(t.touchId!==null||i.pointerId!==t.pointerId)return;a=i}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(i.type)&&!(["pointercancel","contextmenu"].includes(i.type)&&(e.browser.isSafari||e.browser.isWebView)))return;t.pointerId=null,t.touchId=null;const{params:u,touches:d,rtlTranslate:p,slidesGrid:m,enabled:A}=e;if(!A||!u.simulateTouch&&i.pointerType==="mouse")return;if(t.allowTouchCallbacks&&e.emit("touchEnd",i),t.allowTouchCallbacks=!1,!t.isTouched){t.isMoved&&u.grabCursor&&e.setGrabCursor(!1),t.isMoved=!1,t.startMoving=!1;return}u.grabCursor&&t.isMoved&&t.isTouched&&(e.allowSlideNext===!0||e.allowSlidePrev===!0)&&e.setGrabCursor(!1);const _=Vn(),b=_-t.touchStartTime;if(e.allowClick){const D=i.path||i.composedPath&&i.composedPath();e.updateClickedSlide(D&&D[0]||i.target,D),e.emit("tap click",i),b<300&&_-t.lastClickTime<300&&e.emit("doubleTap doubleClick",i)}if(t.lastClickTime=Vn(),Dl(()=>{e.destroyed||(e.allowClick=!0)}),!t.isTouched||!t.isMoved||!e.swipeDirection||d.diff===0&&!t.loopSwapReset||t.currentTranslate===t.startTranslate&&!t.loopSwapReset){t.isTouched=!1,t.isMoved=!1,t.startMoving=!1;return}t.isTouched=!1,t.isMoved=!1,t.startMoving=!1;let w;if(u.followFinger?w=p?e.translate:-e.translate:w=-t.currentTranslate,u.cssMode)return;if(u.freeMode&&u.freeMode.enabled){e.freeMode.onTouchEnd({currentPos:w});return}const E=w>=-e.maxTranslate()&&!e.params.loop;let C=0,T=e.slidesSizesGrid[0];for(let D=0;D<m.length;D+=D<u.slidesPerGroupSkip?1:u.slidesPerGroup){const G=D<u.slidesPerGroupSkip-1?1:u.slidesPerGroup;typeof m[D+G]<"u"?(E||w>=m[D]&&w<m[D+G])&&(C=D,T=m[D+G]-m[D]):(E||w>=m[D])&&(C=D,T=m[m.length-1]-m[m.length-2])}let x=null,P=null;u.rewind&&(e.isBeginning?P=u.virtual&&u.virtual.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(x=0));const M=(w-m[C])/T,B=C<u.slidesPerGroupSkip-1?1:u.slidesPerGroup;if(b>u.longSwipesMs){if(!u.longSwipes){e.slideTo(e.activeIndex);return}e.swipeDirection==="next"&&(M>=u.longSwipesRatio?e.slideTo(u.rewind&&e.isEnd?x:C+B):e.slideTo(C)),e.swipeDirection==="prev"&&(M>1-u.longSwipesRatio?e.slideTo(C+B):P!==null&&M<0&&Math.abs(M)>u.longSwipesRatio?e.slideTo(P):e.slideTo(C))}else{if(!u.shortSwipes){e.slideTo(e.activeIndex);return}e.navigation&&(i.target===e.navigation.nextEl||i.target===e.navigation.prevEl)?i.target===e.navigation.nextEl?e.slideTo(C+B):e.slideTo(C):(e.swipeDirection==="next"&&e.slideTo(x!==null?x:C+B),e.swipeDirection==="prev"&&e.slideTo(P!==null?P:C))}}function Pv(){const o=this,{params:e,el:t}=o;if(t&&t.offsetWidth===0)return;e.breakpoints&&o.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:a,snapGrid:l}=o,u=o.virtual&&o.params.virtual.enabled;o.allowSlideNext=!0,o.allowSlidePrev=!0,o.updateSize(),o.updateSlides(),o.updateSlidesClasses();const d=u&&e.loop;(e.slidesPerView==="auto"||e.slidesPerView>1)&&o.isEnd&&!o.isBeginning&&!o.params.centeredSlides&&!d?o.slideTo(o.slides.length-1,0,!1,!0):o.params.loop&&!u?o.slideToLoop(o.realIndex,0,!1,!0):o.slideTo(o.activeIndex,0,!1,!0),o.autoplay&&o.autoplay.running&&o.autoplay.paused&&(clearTimeout(o.autoplay.resizeTimeout),o.autoplay.resizeTimeout=setTimeout(()=>{o.autoplay&&o.autoplay.running&&o.autoplay.paused&&o.autoplay.resume()},500)),o.allowSlidePrev=a,o.allowSlideNext=i,o.params.watchOverflow&&l!==o.snapGrid&&o.checkOverflow()}function X3(o){const e=this;e.enabled&&(e.allowClick||(e.params.preventClicks&&o.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(o.stopPropagation(),o.stopImmediatePropagation())))}function K3(){const o=this,{wrapperEl:e,rtlTranslate:t,enabled:i}=o;if(!i)return;o.previousTranslate=o.translate,o.isHorizontal()?o.translate=-e.scrollLeft:o.translate=-e.scrollTop,o.translate===0&&(o.translate=0),o.updateActiveIndex(),o.updateSlidesClasses();let a;const l=o.maxTranslate()-o.minTranslate();l===0?a=0:a=(o.translate-o.minTranslate())/l,a!==o.progress&&o.updateProgress(t?-o.translate:o.translate),o.emit("setTranslate",o.translate,!1)}function J3(o){const e=this;Td(e,o.target),!(e.params.cssMode||e.params.slidesPerView!=="auto"&&!e.params.autoHeight)&&e.update()}function Z3(){const o=this;o.documentTouchHandlerProceeded||(o.documentTouchHandlerProceeded=!0,o.params.touchReleaseOnEdges&&(o.el.style.touchAction="auto"))}const fC=(o,e)=>{const t=Li(),{params:i,el:a,wrapperEl:l,device:u}=o,d=!!i.nested,p=e==="on"?"addEventListener":"removeEventListener",m=e;!a||typeof a=="string"||(t[p]("touchstart",o.onDocumentTouchStart,{passive:!1,capture:d}),a[p]("touchstart",o.onTouchStart,{passive:!1}),a[p]("pointerdown",o.onTouchStart,{passive:!1}),t[p]("touchmove",o.onTouchMove,{passive:!1,capture:d}),t[p]("pointermove",o.onTouchMove,{passive:!1,capture:d}),t[p]("touchend",o.onTouchEnd,{passive:!0}),t[p]("pointerup",o.onTouchEnd,{passive:!0}),t[p]("pointercancel",o.onTouchEnd,{passive:!0}),t[p]("touchcancel",o.onTouchEnd,{passive:!0}),t[p]("pointerout",o.onTouchEnd,{passive:!0}),t[p]("pointerleave",o.onTouchEnd,{passive:!0}),t[p]("contextmenu",o.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&a[p]("click",o.onClick,!0),i.cssMode&&l[p]("scroll",o.onScroll),i.updateOnWindowResize?o[m](u.ios||u.android?"resize orientationchange observerUpdate":"resize observerUpdate",Pv,!0):o[m]("observerUpdate",Pv,!0),a[p]("load",o.onLoad,{capture:!0}))};function eF(){const o=this,{params:e}=o;o.onTouchStart=q3.bind(o),o.onTouchMove=W3.bind(o),o.onTouchEnd=Y3.bind(o),o.onDocumentTouchStart=Z3.bind(o),e.cssMode&&(o.onScroll=K3.bind(o)),o.onClick=X3.bind(o),o.onLoad=J3.bind(o),fC(o,"on")}function tF(){fC(this,"off")}var iF={attachEvents:eF,detachEvents:tF};const Lv=(o,e)=>o.grid&&e.grid&&e.grid.rows>1;function nF(){const o=this,{realIndex:e,initialized:t,params:i,el:a}=o,l=i.breakpoints;if(!l||l&&Object.keys(l).length===0)return;const u=Li(),d=i.breakpointsBase==="window"||!i.breakpointsBase?i.breakpointsBase:"container",p=["window","container"].includes(i.breakpointsBase)||!i.breakpointsBase?o.el:u.querySelector(i.breakpointsBase),m=o.getBreakpoint(l,d,p);if(!m||o.currentBreakpoint===m)return;const _=(m in l?l[m]:void 0)||o.originalParams,b=Lv(o,i),w=Lv(o,_),E=o.params.grabCursor,C=_.grabCursor,T=i.enabled;b&&!w?(a.classList.remove(`${i.containerModifierClass}grid`,`${i.containerModifierClass}grid-column`),o.emitContainerClasses()):!b&&w&&(a.classList.add(`${i.containerModifierClass}grid`),(_.grid.fill&&_.grid.fill==="column"||!_.grid.fill&&i.grid.fill==="column")&&a.classList.add(`${i.containerModifierClass}grid-column`),o.emitContainerClasses()),E&&!C?o.unsetGrabCursor():!E&&C&&o.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(G=>{if(typeof _[G]>"u")return;const U=i[G]&&i[G].enabled,V=_[G]&&_[G].enabled;U&&!V&&o[G].disable(),!U&&V&&o[G].enable()});const x=_.direction&&_.direction!==i.direction,P=i.loop&&(_.slidesPerView!==i.slidesPerView||x),M=i.loop;x&&t&&o.changeDirection(),In(o.params,_);const B=o.params.enabled,D=o.params.loop;Object.assign(o,{allowTouchMove:o.params.allowTouchMove,allowSlideNext:o.params.allowSlideNext,allowSlidePrev:o.params.allowSlidePrev}),T&&!B?o.disable():!T&&B&&o.enable(),o.currentBreakpoint=m,o.emit("_beforeBreakpoint",_),t&&(P?(o.loopDestroy(),o.loopCreate(e),o.updateSlides()):!M&&D?(o.loopCreate(e),o.updateSlides()):M&&!D&&o.loopDestroy()),o.emit("breakpoint",_)}function sF(o,e,t){if(e===void 0&&(e="window"),!o||e==="container"&&!t)return;let i=!1;const a=ti(),l=e==="window"?a.innerHeight:t.clientHeight,u=Object.keys(o).map(d=>{if(typeof d=="string"&&d.indexOf("@")===0){const p=parseFloat(d.substr(1));return{value:l*p,point:d}}return{value:d,point:d}});u.sort((d,p)=>parseInt(d.value,10)-parseInt(p.value,10));for(let d=0;d<u.length;d+=1){const{point:p,value:m}=u[d];e==="window"?a.matchMedia(`(min-width: ${m}px)`).matches&&(i=p):m<=t.clientWidth&&(i=p)}return i||"max"}var rF={setBreakpoint:nF,getBreakpoint:sF};function aF(o,e){const t=[];return o.forEach(i=>{typeof i=="object"?Object.keys(i).forEach(a=>{i[a]&&t.push(e+a)}):typeof i=="string"&&t.push(e+i)}),t}function oF(){const o=this,{classNames:e,params:t,rtl:i,el:a,device:l}=o,u=aF(["initialized",t.direction,{"free-mode":o.params.freeMode&&t.freeMode.enabled},{autoheight:t.autoHeight},{rtl:i},{grid:t.grid&&t.grid.rows>1},{"grid-column":t.grid&&t.grid.rows>1&&t.grid.fill==="column"},{android:l.android},{ios:l.ios},{"css-mode":t.cssMode},{centered:t.cssMode&&t.centeredSlides},{"watch-progress":t.watchSlidesProgress}],t.containerModifierClass);e.push(...u),a.classList.add(...e),o.emitContainerClasses()}function lF(){const o=this,{el:e,classNames:t}=o;!e||typeof e=="string"||(e.classList.remove(...t),o.emitContainerClasses())}var cF={addClasses:oF,removeClasses:lF};function uF(){const o=this,{isLocked:e,params:t}=o,{slidesOffsetBefore:i}=t;if(i){const a=o.slides.length-1,l=o.slidesGrid[a]+o.slidesSizesGrid[a]+i*2;o.isLocked=o.size>l}else o.isLocked=o.snapGrid.length===1;t.allowSlideNext===!0&&(o.allowSlideNext=!o.isLocked),t.allowSlidePrev===!0&&(o.allowSlidePrev=!o.isLocked),e&&e!==o.isLocked&&(o.isEnd=!1),e!==o.isLocked&&o.emit(o.isLocked?"lock":"unlock")}var hF={checkOverflow:uF},jA={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function dF(o,e){return function(i){i===void 0&&(i={});const a=Object.keys(i)[0],l=i[a];if(typeof l!="object"||l===null){In(e,i);return}if(o[a]===!0&&(o[a]={enabled:!0}),a==="navigation"&&o[a]&&o[a].enabled&&!o[a].prevEl&&!o[a].nextEl&&(o[a].auto=!0),["pagination","scrollbar"].indexOf(a)>=0&&o[a]&&o[a].enabled&&!o[a].el&&(o[a].auto=!0),!(a in o&&"enabled"in l)){In(e,i);return}typeof o[a]=="object"&&!("enabled"in o[a])&&(o[a].enabled=!0),o[a]||(o[a]={enabled:!1}),In(e,i)}}const xm={eventsEmitter:c3,update:b3,translate:C3,transition:R3,slide:U3,loop:G3,grabCursor:Q3,events:iF,breakpoints:rF,checkOverflow:hF,classes:cF},Sm={};class Tn{constructor(){let e,t;for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length===1&&a[0].constructor&&Object.prototype.toString.call(a[0]).slice(8,-1)==="Object"?t=a[0]:[e,t]=a,t||(t={}),t=In({},t),e&&!t.el&&(t.el=e);const u=Li();if(t.el&&typeof t.el=="string"&&u.querySelectorAll(t.el).length>1){const A=[];return u.querySelectorAll(t.el).forEach(_=>{const b=In({},t,{el:_});A.push(new Tn(b))}),A}const d=this;d.__swiper__=!0,d.support=cC(),d.device=uC({userAgent:t.userAgent}),d.browser=hC(),d.eventsListeners={},d.eventsAnyListeners=[],d.modules=[...d.__modules__],t.modules&&Array.isArray(t.modules)&&d.modules.push(...t.modules);const p={};d.modules.forEach(A=>{A({params:t,swiper:d,extendParams:dF(t,p),on:d.on.bind(d),once:d.once.bind(d),off:d.off.bind(d),emit:d.emit.bind(d)})});const m=In({},jA,p);return d.params=In({},m,Sm,t),d.originalParams=In({},d.params),d.passedParams=In({},t),d.params&&d.params.on&&Object.keys(d.params.on).forEach(A=>{d.on(A,d.params.on[A])}),d.params&&d.params.onAny&&d.onAny(d.params.onAny),Object.assign(d,{enabled:d.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return d.params.direction==="horizontal"},isVertical(){return d.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:d.params.allowSlideNext,allowSlidePrev:d.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:d.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:d.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),d.emit("_swiper"),d.params.init&&d.init(),d}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:i}=this,a=Ui(t,`.${i.slideClass}, swiper-slide`),l=Mu(a[0]);return Mu(e)-l}getSlideIndexByData(e){return this.getSlideIndex(this.slides.find(t=>t.getAttribute("data-swiper-slide-index")*1===e))}getSlideIndexWhenGrid(e){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill==="column"?e=Math.floor(e/this.params.grid.rows):this.params.grid.fill==="row"&&(e=e%Math.ceil(this.slides.length/this.params.grid.rows))),e}recalcSlides(){const e=this,{slidesEl:t,params:i}=e;e.slides=Ui(t,`.${i.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const i=this;e=Math.min(Math.max(e,0),1);const a=i.minTranslate(),u=(i.maxTranslate()-a)*e+a;i.translateTo(u,typeof t>"u"?0:t),i.updateActiveIndex(),i.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter(i=>i.indexOf("swiper")===0||i.indexOf(e.params.containerModifierClass)===0);e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter(i=>i.indexOf("swiper-slide")===0||i.indexOf(t.params.slideClass)===0).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach(i=>{const a=e.getSlideClasses(i);t.push({slideEl:i,classNames:a}),e.emit("_slideClass",i,a)}),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){e===void 0&&(e="current"),t===void 0&&(t=!1);const i=this,{params:a,slides:l,slidesGrid:u,slidesSizesGrid:d,size:p,activeIndex:m}=i;let A=1;if(typeof a.slidesPerView=="number")return a.slidesPerView;if(a.centeredSlides){let _=l[m]?Math.ceil(l[m].swiperSlideSize):0,b;for(let w=m+1;w<l.length;w+=1)l[w]&&!b&&(_+=Math.ceil(l[w].swiperSlideSize),A+=1,_>p&&(b=!0));for(let w=m-1;w>=0;w-=1)l[w]&&!b&&(_+=l[w].swiperSlideSize,A+=1,_>p&&(b=!0))}else if(e==="current")for(let _=m+1;_<l.length;_+=1)(t?u[_]+d[_]-u[m]<p:u[_]-u[m]<p)&&(A+=1);else for(let _=m-1;_>=0;_-=1)u[m]-u[_]<p&&(A+=1);return A}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:i}=e;i.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach(u=>{u.complete&&Td(e,u)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses();function a(){const u=e.rtlTranslate?e.translate*-1:e.translate,d=Math.min(Math.max(u,e.maxTranslate()),e.minTranslate());e.setTranslate(d),e.updateActiveIndex(),e.updateSlidesClasses()}let l;if(i.freeMode&&i.freeMode.enabled&&!i.cssMode)a(),i.autoHeight&&e.updateAutoHeight();else{if((i.slidesPerView==="auto"||i.slidesPerView>1)&&e.isEnd&&!i.centeredSlides){const u=e.virtual&&i.virtual.enabled?e.virtual.slides:e.slides;l=e.slideTo(u.length-1,0,!1,!0)}else l=e.slideTo(e.activeIndex,0,!1,!0);l||a()}i.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){t===void 0&&(t=!0);const i=this,a=i.params.direction;return e||(e=a==="horizontal"?"vertical":"horizontal"),e===a||e!=="horizontal"&&e!=="vertical"||(i.el.classList.remove(`${i.params.containerModifierClass}${a}`),i.el.classList.add(`${i.params.containerModifierClass}${e}`),i.emitContainerClasses(),i.params.direction=e,i.slides.forEach(l=>{e==="vertical"?l.style.width="":l.style.height=""}),i.emit("changeDirection"),t&&i.update()),i}changeLanguageDirection(e){const t=this;t.rtl&&e==="rtl"||!t.rtl&&e==="ltr"||(t.rtl=e==="rtl",t.rtlTranslate=t.params.direction==="horizontal"&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let i=e||t.params.el;if(typeof i=="string"&&(i=document.querySelector(i)),!i)return!1;i.swiper=t,i.parentNode&&i.parentNode.host&&i.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);const a=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let u=i&&i.shadowRoot&&i.shadowRoot.querySelector?i.shadowRoot.querySelector(a()):Ui(i,a())[0];return!u&&t.params.createElements&&(u=Pn("div",t.params.wrapperClass),i.append(u),Ui(i,`.${t.params.slideClass}`).forEach(d=>{u.append(d)})),Object.assign(t,{el:i,wrapperEl:u,slidesEl:t.isElement&&!i.parentNode.host.slideSlots?i.parentNode.host:u,hostEl:t.isElement?i.parentNode.host:i,mounted:!0,rtl:i.dir.toLowerCase()==="rtl"||Fr(i,"direction")==="rtl",rtlTranslate:t.params.direction==="horizontal"&&(i.dir.toLowerCase()==="rtl"||Fr(i,"direction")==="rtl"),wrongRTL:Fr(u,"display")==="-webkit-box"}),!0}init(e){const t=this;if(t.initialized||t.mount(e)===!1)return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(void 0,!0),t.attachEvents();const a=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&a.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),a.forEach(l=>{l.complete?Td(t,l):l.addEventListener("load",u=>{Td(t,u.target)})}),QA(t),t.initialized=!0,QA(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){e===void 0&&(e=!0),t===void 0&&(t=!0);const i=this,{params:a,el:l,wrapperEl:u,slides:d}=i;return typeof i.params>"u"||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),a.loop&&i.loopDestroy(),t&&(i.removeClasses(),l&&typeof l!="string"&&l.removeAttribute("style"),u&&u.removeAttribute("style"),d&&d.length&&d.forEach(p=>{p.classList.remove(a.slideVisibleClass,a.slideFullyVisibleClass,a.slideActiveClass,a.slideNextClass,a.slidePrevClass),p.removeAttribute("style"),p.removeAttribute("data-swiper-slide-index")})),i.emit("destroy"),Object.keys(i.eventsListeners).forEach(p=>{i.off(p)}),e!==!1&&(i.el&&typeof i.el!="string"&&(i.el.swiper=null),KU(i)),i.destroyed=!0),null}static extendDefaults(e){In(Sm,e)}static get extendedDefaults(){return Sm}static get defaults(){return jA}static installModule(e){Tn.prototype.__modules__||(Tn.prototype.__modules__=[]);const t=Tn.prototype.__modules__;typeof e=="function"&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach(t=>Tn.installModule(t)),Tn):(Tn.installModule(e),Tn)}}Object.keys(xm).forEach(o=>{Object.keys(xm[o]).forEach(e=>{Tn.prototype[e]=xm[o][e]})});Tn.use([o3,l3]);function fF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;t({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});let l;const u=Li();e.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const d=u.createElement("div");function p(E,C){const T=e.params.virtual;if(T.cache&&e.virtual.cache[C])return e.virtual.cache[C];let x;return T.renderSlide?(x=T.renderSlide.call(e,E,C),typeof x=="string"&&(Yn(d,x),x=d.children[0])):e.isElement?x=Pn("swiper-slide"):x=Pn("div",e.params.slideClass),x.setAttribute("data-swiper-slide-index",C),T.renderSlide||Yn(x,E),T.cache&&(e.virtual.cache[C]=x),x}function m(E,C,T){const{slidesPerView:x,slidesPerGroup:P,centeredSlides:M,loop:B,initialSlide:D}=e.params;if(C&&!B&&D>0)return;const{addSlidesBefore:G,addSlidesAfter:U}=e.params.virtual,{from:V,to:k,slides:z,slidesGrid:Q,offset:Z}=e.virtual;e.params.cssMode||e.updateActiveIndex();const K=typeof T>"u"?e.activeIndex||0:T;let s;e.rtlTranslate?s="right":s=e.isHorizontal()?"left":"top";let H,y;M?(H=Math.floor(x/2)+P+U,y=Math.floor(x/2)+P+G):(H=x+(P-1)+U,y=(B?x:P)+G);let ee=K-y,I=K+H;B||(ee=Math.max(ee,0),I=Math.min(I,z.length-1));let re=(e.slidesGrid[ee]||0)-(e.slidesGrid[0]||0);B&&K>=y?(ee-=y,M||(re+=e.slidesGrid[0])):B&&K<y&&(ee=-y,M&&(re+=e.slidesGrid[0])),Object.assign(e.virtual,{from:ee,to:I,offset:re,slidesGrid:e.slidesGrid,slidesBefore:y,slidesAfter:H});function Ae(){e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),a("virtualUpdate")}if(V===ee&&k===I&&!E){e.slidesGrid!==Q&&re!==Z&&e.slides.forEach(f=>{f.style[s]=`${re-Math.abs(e.cssOverflowAdjustment())}px`}),e.updateProgress(),a("virtualUpdate");return}if(e.params.virtual.renderExternal){e.params.virtual.renderExternal.call(e,{offset:re,from:ee,to:I,slides:(function(){const g=[];for(let v=ee;v<=I;v+=1)g.push(z[v]);return g})()}),e.params.virtual.renderExternalUpdate?Ae():a("virtualUpdate");return}const N=[],n=[],r=f=>{let g=f;return f<0?g=z.length+f:g>=z.length&&(g=g-z.length),g};if(E)e.slides.filter(f=>f.matches(`.${e.params.slideClass}, swiper-slide`)).forEach(f=>{f.remove()});else for(let f=V;f<=k;f+=1)if(f<ee||f>I){const g=r(f);e.slides.filter(v=>v.matches(`.${e.params.slideClass}[data-swiper-slide-index="${g}"], swiper-slide[data-swiper-slide-index="${g}"]`)).forEach(v=>{v.remove()})}const c=B?-z.length:0,h=B?z.length*2:z.length;for(let f=c;f<h;f+=1)if(f>=ee&&f<=I){const g=r(f);typeof k>"u"||E?n.push(g):(f>k&&n.push(g),f<V&&N.push(g))}if(n.forEach(f=>{e.slidesEl.append(p(z[f],f))}),B)for(let f=N.length-1;f>=0;f-=1){const g=N[f];e.slidesEl.prepend(p(z[g],g))}else N.sort((f,g)=>g-f),N.forEach(f=>{e.slidesEl.prepend(p(z[f],f))});Ui(e.slidesEl,".swiper-slide, swiper-slide").forEach(f=>{f.style[s]=`${re-Math.abs(e.cssOverflowAdjustment())}px`}),Ae()}function A(E){if(typeof E=="object"&&"length"in E)for(let C=0;C<E.length;C+=1)E[C]&&e.virtual.slides.push(E[C]);else e.virtual.slides.push(E);m(!0)}function _(E){const C=e.activeIndex;let T=C+1,x=1;if(Array.isArray(E)){for(let P=0;P<E.length;P+=1)E[P]&&e.virtual.slides.unshift(E[P]);T=C+E.length,x=E.length}else e.virtual.slides.unshift(E);if(e.params.virtual.cache){const P=e.virtual.cache,M={};Object.keys(P).forEach(B=>{const D=P[B],G=D.getAttribute("data-swiper-slide-index");G&&D.setAttribute("data-swiper-slide-index",parseInt(G,10)+x),M[parseInt(B,10)+x]=D}),e.virtual.cache=M}m(!0),e.slideTo(T,0)}function b(E){if(typeof E>"u"||E===null)return;let C=e.activeIndex;if(Array.isArray(E))for(let T=E.length-1;T>=0;T-=1)e.params.virtual.cache&&(delete e.virtual.cache[E[T]],Object.keys(e.virtual.cache).forEach(x=>{x>E&&(e.virtual.cache[x-1]=e.virtual.cache[x],e.virtual.cache[x-1].setAttribute("data-swiper-slide-index",x-1),delete e.virtual.cache[x])})),e.virtual.slides.splice(E[T],1),E[T]<C&&(C-=1),C=Math.max(C,0);else e.params.virtual.cache&&(delete e.virtual.cache[E],Object.keys(e.virtual.cache).forEach(T=>{T>E&&(e.virtual.cache[T-1]=e.virtual.cache[T],e.virtual.cache[T-1].setAttribute("data-swiper-slide-index",T-1),delete e.virtual.cache[T])})),e.virtual.slides.splice(E,1),E<C&&(C-=1),C=Math.max(C,0);m(!0),e.slideTo(C,0)}function w(){e.virtual.slides=[],e.params.virtual.cache&&(e.virtual.cache={}),m(!0),e.slideTo(0,0)}i("beforeInit",()=>{if(!e.params.virtual.enabled)return;let E;if(typeof e.passedParams.virtual.slides>"u"){const C=[...e.slidesEl.children].filter(T=>T.matches(`.${e.params.slideClass}, swiper-slide`));C&&C.length&&(e.virtual.slides=[...C],E=!0,C.forEach((T,x)=>{T.setAttribute("data-swiper-slide-index",x),e.virtual.cache[x]=T,T.remove()}))}E||(e.virtual.slides=e.params.virtual.slides),e.classNames.push(`${e.params.containerModifierClass}virtual`),e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0,m(!1,!0)}),i("setTranslate",()=>{e.params.virtual.enabled&&(e.params.cssMode&&!e._immediateVirtual?(clearTimeout(l),l=setTimeout(()=>{m()},100)):m())}),i("init update resize",()=>{e.params.virtual.enabled&&e.params.cssMode&&qc(e.wrapperEl,"--swiper-virtual-size",`${e.virtualSize}px`)}),Object.assign(e.virtual,{appendSlide:A,prependSlide:_,removeSlide:b,removeAllSlides:w,update:m})}function pF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=Li(),u=ti();e.keyboard={enabled:!1},t({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function d(A){if(!e.enabled)return;const{rtlTranslate:_}=e;let b=A;b.originalEvent&&(b=b.originalEvent);const w=b.keyCode||b.charCode,E=e.params.keyboard.pageUpDown,C=E&&w===33,T=E&&w===34,x=w===37,P=w===39,M=w===38,B=w===40;if(!e.allowSlideNext&&(e.isHorizontal()&&P||e.isVertical()&&B||T)||!e.allowSlidePrev&&(e.isHorizontal()&&x||e.isVertical()&&M||C))return!1;if(!(b.shiftKey||b.altKey||b.ctrlKey||b.metaKey)&&!(l.activeElement&&(l.activeElement.isContentEditable||l.activeElement.nodeName&&(l.activeElement.nodeName.toLowerCase()==="input"||l.activeElement.nodeName.toLowerCase()==="textarea")))){if(e.params.keyboard.onlyInViewport&&(C||T||x||P||M||B)){let D=!1;if(Ga(e.el,`.${e.params.slideClass}, swiper-slide`).length>0&&Ga(e.el,`.${e.params.slideActiveClass}`).length===0)return;const G=e.el,U=G.clientWidth,V=G.clientHeight,k=u.innerWidth,z=u.innerHeight,Q=Af(G);_&&(Q.left-=G.scrollLeft);const Z=[[Q.left,Q.top],[Q.left+U,Q.top],[Q.left,Q.top+V],[Q.left+U,Q.top+V]];for(let K=0;K<Z.length;K+=1){const s=Z[K];if(s[0]>=0&&s[0]<=k&&s[1]>=0&&s[1]<=z){if(s[0]===0&&s[1]===0)continue;D=!0}}if(!D)return}e.isHorizontal()?((C||T||x||P)&&(b.preventDefault?b.preventDefault():b.returnValue=!1),((T||P)&&!_||(C||x)&&_)&&e.slideNext(),((C||x)&&!_||(T||P)&&_)&&e.slidePrev()):((C||T||M||B)&&(b.preventDefault?b.preventDefault():b.returnValue=!1),(T||B)&&e.slideNext(),(C||M)&&e.slidePrev()),a("keyPress",w)}}function p(){e.keyboard.enabled||(l.addEventListener("keydown",d),e.keyboard.enabled=!0)}function m(){e.keyboard.enabled&&(l.removeEventListener("keydown",d),e.keyboard.enabled=!1)}i("init",()=>{e.params.keyboard.enabled&&p()}),i("destroy",()=>{e.keyboard.enabled&&m()}),Object.assign(e.keyboard,{enable:p,disable:m})}function mF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=ti();t({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),e.mousewheel={enabled:!1};let u,d=Vn(),p;const m=[];function A(M){let U=0,V=0,k=0,z=0;return"detail"in M&&(V=M.detail),"wheelDelta"in M&&(V=-M.wheelDelta/120),"wheelDeltaY"in M&&(V=-M.wheelDeltaY/120),"wheelDeltaX"in M&&(U=-M.wheelDeltaX/120),"axis"in M&&M.axis===M.HORIZONTAL_AXIS&&(U=V,V=0),k=U*10,z=V*10,"deltaY"in M&&(z=M.deltaY),"deltaX"in M&&(k=M.deltaX),M.shiftKey&&!k&&(k=z,z=0),(k||z)&&M.deltaMode&&(M.deltaMode===1?(k*=40,z*=40):(k*=800,z*=800)),k&&!U&&(U=k<1?-1:1),z&&!V&&(V=z<1?-1:1),{spinX:U,spinY:V,pixelX:k,pixelY:z}}function _(){e.enabled&&(e.mouseEntered=!0)}function b(){e.enabled&&(e.mouseEntered=!1)}function w(M){return e.params.mousewheel.thresholdDelta&&M.delta<e.params.mousewheel.thresholdDelta||e.params.mousewheel.thresholdTime&&Vn()-d<e.params.mousewheel.thresholdTime?!1:M.delta>=6&&Vn()-d<60?!0:(M.direction<0?(!e.isEnd||e.params.loop)&&!e.animating&&(e.slideNext(),a("scroll",M.raw)):(!e.isBeginning||e.params.loop)&&!e.animating&&(e.slidePrev(),a("scroll",M.raw)),d=new l.Date().getTime(),!1)}function E(M){const B=e.params.mousewheel;if(M.direction<0){if(e.isEnd&&!e.params.loop&&B.releaseOnEdges)return!0}else if(e.isBeginning&&!e.params.loop&&B.releaseOnEdges)return!0;return!1}function C(M){let B=M,D=!0;if(!e.enabled||M.target.closest(`.${e.params.mousewheel.noMousewheelClass}`))return;const G=e.params.mousewheel;e.params.cssMode&&B.preventDefault();let U=e.el;e.params.mousewheel.eventsTarget!=="container"&&(U=document.querySelector(e.params.mousewheel.eventsTarget));const V=U&&U.contains(B.target);if(!e.mouseEntered&&!V&&!G.releaseOnEdges)return!0;B.originalEvent&&(B=B.originalEvent);let k=0;const z=e.rtlTranslate?-1:1,Q=A(B);if(G.forceToAxis)if(e.isHorizontal())if(Math.abs(Q.pixelX)>Math.abs(Q.pixelY))k=-Q.pixelX*z;else return!0;else if(Math.abs(Q.pixelY)>Math.abs(Q.pixelX))k=-Q.pixelY;else return!0;else k=Math.abs(Q.pixelX)>Math.abs(Q.pixelY)?-Q.pixelX*z:-Q.pixelY;if(k===0)return!0;G.invert&&(k=-k);let Z=e.getTranslate()+k*G.sensitivity;if(Z>=e.minTranslate()&&(Z=e.minTranslate()),Z<=e.maxTranslate()&&(Z=e.maxTranslate()),D=e.params.loop?!0:!(Z===e.minTranslate()||Z===e.maxTranslate()),D&&e.params.nested&&B.stopPropagation(),!e.params.freeMode||!e.params.freeMode.enabled){const K={time:Vn(),delta:Math.abs(k),direction:Math.sign(k),raw:M};m.length>=2&&m.shift();const s=m.length?m[m.length-1]:void 0;if(m.push(K),s?(K.direction!==s.direction||K.delta>s.delta||K.time>s.time+150)&&w(K):w(K),E(K))return!0}else{const K={time:Vn(),delta:Math.abs(k),direction:Math.sign(k)},s=p&&K.time<p.time+500&&K.delta<=p.delta&&K.direction===p.direction;if(!s){p=void 0;let H=e.getTranslate()+k*G.sensitivity;const y=e.isBeginning,ee=e.isEnd;if(H>=e.minTranslate()&&(H=e.minTranslate()),H<=e.maxTranslate()&&(H=e.maxTranslate()),e.setTransition(0),e.setTranslate(H),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses(),(!y&&e.isBeginning||!ee&&e.isEnd)&&e.updateSlidesClasses(),e.params.loop&&e.loopFix({direction:K.direction<0?"next":"prev",byMousewheel:!0}),e.params.freeMode.sticky){clearTimeout(u),u=void 0,m.length>=15&&m.shift();const I=m.length?m[m.length-1]:void 0,re=m[0];if(m.push(K),I&&(K.delta>I.delta||K.direction!==I.direction))m.splice(0);else if(m.length>=15&&K.time-re.time<500&&re.delta-K.delta>=1&&K.delta<=6){const Ae=k>0?.8:.2;p=K,m.splice(0),u=Dl(()=>{e.destroyed||!e.params||e.slideToClosest(e.params.speed,!0,void 0,Ae)},0)}u||(u=Dl(()=>{if(e.destroyed||!e.params)return;const Ae=.5;p=K,m.splice(0),e.slideToClosest(e.params.speed,!0,void 0,Ae)},500))}if(s||a("scroll",B),e.params.autoplay&&e.params.autoplay.disableOnInteraction&&e.autoplay.stop(),G.releaseOnEdges&&(H===e.minTranslate()||H===e.maxTranslate()))return!0}}return B.preventDefault?B.preventDefault():B.returnValue=!1,!1}function T(M){let B=e.el;e.params.mousewheel.eventsTarget!=="container"&&(B=document.querySelector(e.params.mousewheel.eventsTarget)),B[M]("mouseenter",_),B[M]("mouseleave",b),B[M]("wheel",C)}function x(){return e.params.cssMode?(e.wrapperEl.removeEventListener("wheel",C),!0):e.mousewheel.enabled?!1:(T("addEventListener"),e.mousewheel.enabled=!0,!0)}function P(){return e.params.cssMode?(e.wrapperEl.addEventListener(event,C),!0):e.mousewheel.enabled?(T("removeEventListener"),e.mousewheel.enabled=!1,!0):!1}i("init",()=>{!e.params.mousewheel.enabled&&e.params.cssMode&&P(),e.params.mousewheel.enabled&&x()}),i("destroy",()=>{e.params.cssMode&&x(),e.mousewheel.enabled&&P()}),Object.assign(e.mousewheel,{enable:x,disable:P})}function m_(o,e,t,i){return o.params.createElements&&Object.keys(i).forEach(a=>{if(!t[a]&&t.auto===!0){let l=Ui(o.el,`.${i[a]}`)[0];l||(l=Pn("div",i[a]),l.className=i[a],o.el.append(l)),t[a]=l,e[a]=l}}),t}function gF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;t({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),e.navigation={nextEl:null,prevEl:null};function l(E){let C;return E&&typeof E=="string"&&e.isElement&&(C=e.el.querySelector(E)||e.hostEl.querySelector(E),C)?C:(E&&(typeof E=="string"&&(C=[...document.querySelectorAll(E)]),e.params.uniqueNavElements&&typeof E=="string"&&C&&C.length>1&&e.el.querySelectorAll(E).length===1?C=e.el.querySelector(E):C&&C.length===1&&(C=C[0])),E&&!C?E:C)}function u(E,C){const T=e.params.navigation;E=_t(E),E.forEach(x=>{x&&(x.classList[C?"add":"remove"](...T.disabledClass.split(" ")),x.tagName==="BUTTON"&&(x.disabled=C),e.params.watchOverflow&&e.enabled&&x.classList[e.isLocked?"add":"remove"](T.lockClass))})}function d(){const{nextEl:E,prevEl:C}=e.navigation;if(e.params.loop){u(C,!1),u(E,!1);return}u(C,e.isBeginning&&!e.params.rewind),u(E,e.isEnd&&!e.params.rewind)}function p(E){E.preventDefault(),!(e.isBeginning&&!e.params.loop&&!e.params.rewind)&&(e.slidePrev(),a("navigationPrev"))}function m(E){E.preventDefault(),!(e.isEnd&&!e.params.loop&&!e.params.rewind)&&(e.slideNext(),a("navigationNext"))}function A(){const E=e.params.navigation;if(e.params.navigation=m_(e,e.originalParams.navigation,e.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(E.nextEl||E.prevEl))return;let C=l(E.nextEl),T=l(E.prevEl);Object.assign(e.navigation,{nextEl:C,prevEl:T}),C=_t(C),T=_t(T);const x=(P,M)=>{P&&P.addEventListener("click",M==="next"?m:p),!e.enabled&&P&&P.classList.add(...E.lockClass.split(" "))};C.forEach(P=>x(P,"next")),T.forEach(P=>x(P,"prev"))}function _(){let{nextEl:E,prevEl:C}=e.navigation;E=_t(E),C=_t(C);const T=(x,P)=>{x.removeEventListener("click",P==="next"?m:p),x.classList.remove(...e.params.navigation.disabledClass.split(" "))};E.forEach(x=>T(x,"next")),C.forEach(x=>T(x,"prev"))}i("init",()=>{e.params.navigation.enabled===!1?w():(A(),d())}),i("toEdge fromEdge lock unlock",()=>{d()}),i("destroy",()=>{_()}),i("enable disable",()=>{let{nextEl:E,prevEl:C}=e.navigation;if(E=_t(E),C=_t(C),e.enabled){d();return}[...E,...C].filter(T=>!!T).forEach(T=>T.classList.add(e.params.navigation.lockClass))}),i("click",(E,C)=>{let{nextEl:T,prevEl:x}=e.navigation;T=_t(T),x=_t(x);const P=C.target;let M=x.includes(P)||T.includes(P);if(e.isElement&&!M){const B=C.path||C.composedPath&&C.composedPath();B&&(M=B.find(D=>T.includes(D)||x.includes(D)))}if(e.params.navigation.hideOnClick&&!M){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===P||e.pagination.el.contains(P)))return;let B;T.length?B=T[0].classList.contains(e.params.navigation.hiddenClass):x.length&&(B=x[0].classList.contains(e.params.navigation.hiddenClass)),a(B===!0?"navigationShow":"navigationHide"),[...T,...x].filter(D=>!!D).forEach(D=>D.classList.toggle(e.params.navigation.hiddenClass))}});const b=()=>{e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")),A(),d()},w=()=>{e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")),_()};Object.assign(e.navigation,{enable:b,disable:w,update:d,init:A,destroy:_})}function nr(o){return o===void 0&&(o=""),`.${o.trim().replace(/([\.:!+\/()[\]])/g,"\\$1").replace(/ /g,".")}`}function AF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l="swiper-pagination";t({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:P=>P,formatFractionTotal:P=>P,bulletClass:`${l}-bullet`,bulletActiveClass:`${l}-bullet-active`,modifierClass:`${l}-`,currentClass:`${l}-current`,totalClass:`${l}-total`,hiddenClass:`${l}-hidden`,progressbarFillClass:`${l}-progressbar-fill`,progressbarOppositeClass:`${l}-progressbar-opposite`,clickableClass:`${l}-clickable`,lockClass:`${l}-lock`,horizontalClass:`${l}-horizontal`,verticalClass:`${l}-vertical`,paginationDisabledClass:`${l}-disabled`}}),e.pagination={el:null,bullets:[]};let u,d=0;function p(){return!e.params.pagination.el||!e.pagination.el||Array.isArray(e.pagination.el)&&e.pagination.el.length===0}function m(P,M){const{bulletActiveClass:B}=e.params.pagination;P&&(P=P[`${M==="prev"?"previous":"next"}ElementSibling`],P&&(P.classList.add(`${B}-${M}`),P=P[`${M==="prev"?"previous":"next"}ElementSibling`],P&&P.classList.add(`${B}-${M}-${M}`)))}function A(P,M,B){if(P=P%B,M=M%B,M===P+1)return"next";if(M===P-1)return"previous"}function _(P){const M=P.target.closest(nr(e.params.pagination.bulletClass));if(!M)return;P.preventDefault();const B=Mu(M)*e.params.slidesPerGroup;if(e.params.loop){if(e.realIndex===B)return;const D=A(e.realIndex,B,e.slides.length);D==="next"?e.slideNext():D==="previous"?e.slidePrev():e.slideToLoop(B)}else e.slideTo(B)}function b(){const P=e.rtl,M=e.params.pagination;if(p())return;let B=e.pagination.el;B=_t(B);let D,G;const U=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,V=e.params.loop?Math.ceil(U/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?(G=e.previousRealIndex||0,D=e.params.slidesPerGroup>1?Math.floor(e.realIndex/e.params.slidesPerGroup):e.realIndex):typeof e.snapIndex<"u"?(D=e.snapIndex,G=e.previousSnapIndex):(G=e.previousIndex||0,D=e.activeIndex||0),M.type==="bullets"&&e.pagination.bullets&&e.pagination.bullets.length>0){const k=e.pagination.bullets;let z,Q,Z;if(M.dynamicBullets&&(u=VA(k[0],e.isHorizontal()?"width":"height"),B.forEach(K=>{K.style[e.isHorizontal()?"width":"height"]=`${u*(M.dynamicMainBullets+4)}px`}),M.dynamicMainBullets>1&&G!==void 0&&(d+=D-(G||0),d>M.dynamicMainBullets-1?d=M.dynamicMainBullets-1:d<0&&(d=0)),z=Math.max(D-d,0),Q=z+(Math.min(k.length,M.dynamicMainBullets)-1),Z=(Q+z)/2),k.forEach(K=>{const s=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(H=>`${M.bulletActiveClass}${H}`)].map(H=>typeof H=="string"&&H.includes(" ")?H.split(" "):H).flat();K.classList.remove(...s)}),B.length>1)k.forEach(K=>{const s=Mu(K);s===D?K.classList.add(...M.bulletActiveClass.split(" ")):e.isElement&&K.setAttribute("part","bullet"),M.dynamicBullets&&(s>=z&&s<=Q&&K.classList.add(...`${M.bulletActiveClass}-main`.split(" ")),s===z&&m(K,"prev"),s===Q&&m(K,"next"))});else{const K=k[D];if(K&&K.classList.add(...M.bulletActiveClass.split(" ")),e.isElement&&k.forEach((s,H)=>{s.setAttribute("part",H===D?"bullet-active":"bullet")}),M.dynamicBullets){const s=k[z],H=k[Q];for(let y=z;y<=Q;y+=1)k[y]&&k[y].classList.add(...`${M.bulletActiveClass}-main`.split(" "));m(s,"prev"),m(H,"next")}}if(M.dynamicBullets){const K=Math.min(k.length,M.dynamicMainBullets+4),s=(u*K-u)/2-Z*u,H=P?"right":"left";k.forEach(y=>{y.style[e.isHorizontal()?H:"top"]=`${s}px`})}}B.forEach((k,z)=>{if(M.type==="fraction"&&(k.querySelectorAll(nr(M.currentClass)).forEach(Q=>{Q.textContent=M.formatFractionCurrent(D+1)}),k.querySelectorAll(nr(M.totalClass)).forEach(Q=>{Q.textContent=M.formatFractionTotal(V)})),M.type==="progressbar"){let Q;M.progressbarOpposite?Q=e.isHorizontal()?"vertical":"horizontal":Q=e.isHorizontal()?"horizontal":"vertical";const Z=(D+1)/V;let K=1,s=1;Q==="horizontal"?K=Z:s=Z,k.querySelectorAll(nr(M.progressbarFillClass)).forEach(H=>{H.style.transform=`translate3d(0,0,0) scaleX(${K}) scaleY(${s})`,H.style.transitionDuration=`${e.params.speed}ms`})}M.type==="custom"&&M.renderCustom?(Yn(k,M.renderCustom(e,D+1,V)),z===0&&a("paginationRender",k)):(z===0&&a("paginationRender",k),a("paginationUpdate",k)),e.params.watchOverflow&&e.enabled&&k.classList[e.isLocked?"add":"remove"](M.lockClass)})}function w(){const P=e.params.pagination;if(p())return;const M=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.grid&&e.params.grid.rows>1?e.slides.length/Math.ceil(e.params.grid.rows):e.slides.length;let B=e.pagination.el;B=_t(B);let D="";if(P.type==="bullets"){let G=e.params.loop?Math.ceil(M/e.params.slidesPerGroup):e.snapGrid.length;e.params.freeMode&&e.params.freeMode.enabled&&G>M&&(G=M);for(let U=0;U<G;U+=1)P.renderBullet?D+=P.renderBullet.call(e,U,P.bulletClass):D+=`<${P.bulletElement} ${e.isElement?'part="bullet"':""} class="${P.bulletClass}"></${P.bulletElement}>`}P.type==="fraction"&&(P.renderFraction?D=P.renderFraction.call(e,P.currentClass,P.totalClass):D=`<span class="${P.currentClass}"></span> / <span class="${P.totalClass}"></span>`),P.type==="progressbar"&&(P.renderProgressbar?D=P.renderProgressbar.call(e,P.progressbarFillClass):D=`<span class="${P.progressbarFillClass}"></span>`),e.pagination.bullets=[],B.forEach(G=>{P.type!=="custom"&&Yn(G,D||""),P.type==="bullets"&&e.pagination.bullets.push(...G.querySelectorAll(nr(P.bulletClass)))}),P.type!=="custom"&&a("paginationRender",B[0])}function E(){e.params.pagination=m_(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const P=e.params.pagination;if(!P.el)return;let M;typeof P.el=="string"&&e.isElement&&(M=e.el.querySelector(P.el)),!M&&typeof P.el=="string"&&(M=[...document.querySelectorAll(P.el)]),M||(M=P.el),!(!M||M.length===0)&&(e.params.uniqueNavElements&&typeof P.el=="string"&&Array.isArray(M)&&M.length>1&&(M=[...e.el.querySelectorAll(P.el)],M.length>1&&(M=M.find(B=>Ga(B,".swiper")[0]===e.el))),Array.isArray(M)&&M.length===1&&(M=M[0]),Object.assign(e.pagination,{el:M}),M=_t(M),M.forEach(B=>{P.type==="bullets"&&P.clickable&&B.classList.add(...(P.clickableClass||"").split(" ")),B.classList.add(P.modifierClass+P.type),B.classList.add(e.isHorizontal()?P.horizontalClass:P.verticalClass),P.type==="bullets"&&P.dynamicBullets&&(B.classList.add(`${P.modifierClass}${P.type}-dynamic`),d=0,P.dynamicMainBullets<1&&(P.dynamicMainBullets=1)),P.type==="progressbar"&&P.progressbarOpposite&&B.classList.add(P.progressbarOppositeClass),P.clickable&&B.addEventListener("click",_),e.enabled||B.classList.add(P.lockClass)}))}function C(){const P=e.params.pagination;if(p())return;let M=e.pagination.el;M&&(M=_t(M),M.forEach(B=>{B.classList.remove(P.hiddenClass),B.classList.remove(P.modifierClass+P.type),B.classList.remove(e.isHorizontal()?P.horizontalClass:P.verticalClass),P.clickable&&(B.classList.remove(...(P.clickableClass||"").split(" ")),B.removeEventListener("click",_))})),e.pagination.bullets&&e.pagination.bullets.forEach(B=>B.classList.remove(...P.bulletActiveClass.split(" ")))}i("changeDirection",()=>{if(!e.pagination||!e.pagination.el)return;const P=e.params.pagination;let{el:M}=e.pagination;M=_t(M),M.forEach(B=>{B.classList.remove(P.horizontalClass,P.verticalClass),B.classList.add(e.isHorizontal()?P.horizontalClass:P.verticalClass)})}),i("init",()=>{e.params.pagination.enabled===!1?x():(E(),w(),b())}),i("activeIndexChange",()=>{typeof e.snapIndex>"u"&&b()}),i("snapIndexChange",()=>{b()}),i("snapGridLengthChange",()=>{w(),b()}),i("destroy",()=>{C()}),i("enable disable",()=>{let{el:P}=e.pagination;P&&(P=_t(P),P.forEach(M=>M.classList[e.enabled?"remove":"add"](e.params.pagination.lockClass)))}),i("lock unlock",()=>{b()}),i("click",(P,M)=>{const B=M.target,D=_t(e.pagination.el);if(e.params.pagination.el&&e.params.pagination.hideOnClick&&D&&D.length>0&&!B.classList.contains(e.params.pagination.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&B===e.navigation.nextEl||e.navigation.prevEl&&B===e.navigation.prevEl))return;const G=D[0].classList.contains(e.params.pagination.hiddenClass);a(G===!0?"paginationShow":"paginationHide"),D.forEach(U=>U.classList.toggle(e.params.pagination.hiddenClass))}});const T=()=>{e.el.classList.remove(e.params.pagination.paginationDisabledClass);let{el:P}=e.pagination;P&&(P=_t(P),P.forEach(M=>M.classList.remove(e.params.pagination.paginationDisabledClass))),E(),w(),b()},x=()=>{e.el.classList.add(e.params.pagination.paginationDisabledClass);let{el:P}=e.pagination;P&&(P=_t(P),P.forEach(M=>M.classList.add(e.params.pagination.paginationDisabledClass))),C()};Object.assign(e.pagination,{enable:T,disable:x,render:w,update:b,init:E,destroy:C})}function _F(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=Li();let u=!1,d=null,p=null,m,A,_,b;t({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),e.scrollbar={el:null,dragEl:null};function w(){if(!e.params.scrollbar.el||!e.scrollbar.el)return;const{scrollbar:Z,rtlTranslate:K}=e,{dragEl:s,el:H}=Z,y=e.params.scrollbar,ee=e.params.loop?e.progressLoop:e.progress;let I=A,re=(_-A)*ee;K?(re=-re,re>0?(I=A-re,re=0):-re+A>_&&(I=_+re)):re<0?(I=A+re,re=0):re+A>_&&(I=_-re),e.isHorizontal()?(s.style.transform=`translate3d(${re}px, 0, 0)`,s.style.width=`${I}px`):(s.style.transform=`translate3d(0px, ${re}px, 0)`,s.style.height=`${I}px`),y.hide&&(clearTimeout(d),H.style.opacity=1,d=setTimeout(()=>{H.style.opacity=0,H.style.transitionDuration="400ms"},1e3))}function E(Z){!e.params.scrollbar.el||!e.scrollbar.el||(e.scrollbar.dragEl.style.transitionDuration=`${Z}ms`)}function C(){if(!e.params.scrollbar.el||!e.scrollbar.el)return;const{scrollbar:Z}=e,{dragEl:K,el:s}=Z;K.style.width="",K.style.height="",_=e.isHorizontal()?s.offsetWidth:s.offsetHeight,b=e.size/(e.virtualSize+e.params.slidesOffsetBefore-(e.params.centeredSlides?e.snapGrid[0]:0)),e.params.scrollbar.dragSize==="auto"?A=_*b:A=parseInt(e.params.scrollbar.dragSize,10),e.isHorizontal()?K.style.width=`${A}px`:K.style.height=`${A}px`,b>=1?s.style.display="none":s.style.display="",e.params.scrollbar.hide&&(s.style.opacity=0),e.params.watchOverflow&&e.enabled&&Z.el.classList[e.isLocked?"add":"remove"](e.params.scrollbar.lockClass)}function T(Z){return e.isHorizontal()?Z.clientX:Z.clientY}function x(Z){const{scrollbar:K,rtlTranslate:s}=e,{el:H}=K;let y;y=(T(Z)-Af(H)[e.isHorizontal()?"left":"top"]-(m!==null?m:A/2))/(_-A),y=Math.max(Math.min(y,1),0),s&&(y=1-y);const ee=e.minTranslate()+(e.maxTranslate()-e.minTranslate())*y;e.updateProgress(ee),e.setTranslate(ee),e.updateActiveIndex(),e.updateSlidesClasses()}function P(Z){const K=e.params.scrollbar,{scrollbar:s,wrapperEl:H}=e,{el:y,dragEl:ee}=s;u=!0,m=Z.target===ee?T(Z)-Z.target.getBoundingClientRect()[e.isHorizontal()?"left":"top"]:null,Z.preventDefault(),Z.stopPropagation(),H.style.transitionDuration="100ms",ee.style.transitionDuration="100ms",x(Z),clearTimeout(p),y.style.transitionDuration="0ms",K.hide&&(y.style.opacity=1),e.params.cssMode&&(e.wrapperEl.style["scroll-snap-type"]="none"),a("scrollbarDragStart",Z)}function M(Z){const{scrollbar:K,wrapperEl:s}=e,{el:H,dragEl:y}=K;u&&(Z.preventDefault&&Z.cancelable?Z.preventDefault():Z.returnValue=!1,x(Z),s.style.transitionDuration="0ms",H.style.transitionDuration="0ms",y.style.transitionDuration="0ms",a("scrollbarDragMove",Z))}function B(Z){const K=e.params.scrollbar,{scrollbar:s,wrapperEl:H}=e,{el:y}=s;u&&(u=!1,e.params.cssMode&&(e.wrapperEl.style["scroll-snap-type"]="",H.style.transitionDuration=""),K.hide&&(clearTimeout(p),p=Dl(()=>{y.style.opacity=0,y.style.transitionDuration="400ms"},1e3)),a("scrollbarDragEnd",Z),K.snapOnRelease&&e.slideToClosest())}function D(Z){const{scrollbar:K,params:s}=e,H=K.el;if(!H)return;const y=H,ee=s.passiveListeners?{passive:!1,capture:!1}:!1,I=s.passiveListeners?{passive:!0,capture:!1}:!1;if(!y)return;const re=Z==="on"?"addEventListener":"removeEventListener";y[re]("pointerdown",P,ee),l[re]("pointermove",M,ee),l[re]("pointerup",B,I)}function G(){!e.params.scrollbar.el||!e.scrollbar.el||D("on")}function U(){!e.params.scrollbar.el||!e.scrollbar.el||D("off")}function V(){const{scrollbar:Z,el:K}=e;e.params.scrollbar=m_(e,e.originalParams.scrollbar,e.params.scrollbar,{el:"swiper-scrollbar"});const s=e.params.scrollbar;if(!s.el)return;let H;if(typeof s.el=="string"&&e.isElement&&(H=e.el.querySelector(s.el)),!H&&typeof s.el=="string"){if(H=l.querySelectorAll(s.el),!H.length)return}else H||(H=s.el);e.params.uniqueNavElements&&typeof s.el=="string"&&H.length>1&&K.querySelectorAll(s.el).length===1&&(H=K.querySelector(s.el)),H.length>0&&(H=H[0]),H.classList.add(e.isHorizontal()?s.horizontalClass:s.verticalClass);let y;H&&(y=H.querySelector(nr(e.params.scrollbar.dragClass)),y||(y=Pn("div",e.params.scrollbar.dragClass),H.append(y))),Object.assign(Z,{el:H,dragEl:y}),s.draggable&&G(),H&&H.classList[e.enabled?"remove":"add"](...Sr(e.params.scrollbar.lockClass))}function k(){const Z=e.params.scrollbar,K=e.scrollbar.el;K&&K.classList.remove(...Sr(e.isHorizontal()?Z.horizontalClass:Z.verticalClass)),U()}i("changeDirection",()=>{if(!e.scrollbar||!e.scrollbar.el)return;const Z=e.params.scrollbar;let{el:K}=e.scrollbar;K=_t(K),K.forEach(s=>{s.classList.remove(Z.horizontalClass,Z.verticalClass),s.classList.add(e.isHorizontal()?Z.horizontalClass:Z.verticalClass)})}),i("init",()=>{e.params.scrollbar.enabled===!1?Q():(V(),C(),w())}),i("update resize observerUpdate lock unlock changeDirection",()=>{C()}),i("setTranslate",()=>{w()}),i("setTransition",(Z,K)=>{E(K)}),i("enable disable",()=>{const{el:Z}=e.scrollbar;Z&&Z.classList[e.enabled?"remove":"add"](...Sr(e.params.scrollbar.lockClass))}),i("destroy",()=>{k()});const z=()=>{e.el.classList.remove(...Sr(e.params.scrollbar.scrollbarDisabledClass)),e.scrollbar.el&&e.scrollbar.el.classList.remove(...Sr(e.params.scrollbar.scrollbarDisabledClass)),V(),C(),w()},Q=()=>{e.el.classList.add(...Sr(e.params.scrollbar.scrollbarDisabledClass)),e.scrollbar.el&&e.scrollbar.el.classList.add(...Sr(e.params.scrollbar.scrollbarDisabledClass)),k()};Object.assign(e.scrollbar,{enable:z,disable:Q,updateSize:C,setTranslate:w,init:V,destroy:k})}function yF(o){let{swiper:e,extendParams:t,on:i}=o;t({parallax:{enabled:!1}});const a="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",l=(p,m)=>{const{rtl:A}=e,_=A?-1:1,b=p.getAttribute("data-swiper-parallax")||"0";let w=p.getAttribute("data-swiper-parallax-x"),E=p.getAttribute("data-swiper-parallax-y");const C=p.getAttribute("data-swiper-parallax-scale"),T=p.getAttribute("data-swiper-parallax-opacity"),x=p.getAttribute("data-swiper-parallax-rotate");if(w||E?(w=w||"0",E=E||"0"):e.isHorizontal()?(w=b,E="0"):(E=b,w="0"),w.indexOf("%")>=0?w=`${parseInt(w,10)*m*_}%`:w=`${w*m*_}px`,E.indexOf("%")>=0?E=`${parseInt(E,10)*m}%`:E=`${E*m}px`,typeof T<"u"&&T!==null){const M=T-(T-1)*(1-Math.abs(m));p.style.opacity=M}let P=`translate3d(${w}, ${E}, 0px)`;if(typeof C<"u"&&C!==null){const M=C-(C-1)*(1-Math.abs(m));P+=` scale(${M})`}if(x&&typeof x<"u"&&x!==null){const M=x*m*-1;P+=` rotate(${M}deg)`}p.style.transform=P},u=()=>{const{el:p,slides:m,progress:A,snapGrid:_,isElement:b}=e,w=Ui(p,a);e.isElement&&w.push(...Ui(e.hostEl,a)),w.forEach(E=>{l(E,A)}),m.forEach((E,C)=>{let T=E.progress;e.params.slidesPerGroup>1&&e.params.slidesPerView!=="auto"&&(T+=Math.ceil(C/2)-A*(_.length-1)),T=Math.min(Math.max(T,-1),1),E.querySelectorAll(`${a}, [data-swiper-parallax-rotate]`).forEach(x=>{l(x,T)})})},d=function(p){p===void 0&&(p=e.params.speed);const{el:m,hostEl:A}=e,_=[...m.querySelectorAll(a)];e.isElement&&_.push(...A.querySelectorAll(a)),_.forEach(b=>{let w=parseInt(b.getAttribute("data-swiper-parallax-duration"),10)||p;p===0&&(w=0),b.style.transitionDuration=`${w}ms`})};i("beforeInit",()=>{e.params.parallax.enabled&&(e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)}),i("init",()=>{e.params.parallax.enabled&&u()}),i("setTranslate",()=>{e.params.parallax.enabled&&u()}),i("setTransition",(p,m)=>{e.params.parallax.enabled&&d(m)})}function bF(o){let{swiper:e,extendParams:t,on:i,emit:a}=o;const l=ti();t({zoom:{enabled:!1,limitToOriginalSize:!1,maxRatio:3,minRatio:1,panOnMouseMove:!1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),e.zoom={enabled:!1};let u=1,d=!1,p=!1,m={x:0,y:0};const A=-3;let _,b;const w=[],E={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},C={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},T={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let x=1;Object.defineProperty(e.zoom,"scale",{get(){return x},set(h){if(x!==h){const f=E.imageEl,g=E.slideEl;a("zoomChange",h,f,g)}x=h}});function P(){if(w.length<2)return 1;const h=w[0].pageX,f=w[0].pageY,g=w[1].pageX,v=w[1].pageY;return Math.sqrt((g-h)**2+(v-f)**2)}function M(){const h=e.params.zoom,f=E.imageWrapEl.getAttribute("data-swiper-zoom")||h.maxRatio;if(h.limitToOriginalSize&&E.imageEl&&E.imageEl.naturalWidth){const g=E.imageEl.naturalWidth/E.imageEl.offsetWidth;return Math.min(g,f)}return f}function B(){if(w.length<2)return{x:null,y:null};const h=E.imageEl.getBoundingClientRect();return[(w[0].pageX+(w[1].pageX-w[0].pageX)/2-h.x-l.scrollX)/u,(w[0].pageY+(w[1].pageY-w[0].pageY)/2-h.y-l.scrollY)/u]}function D(){return e.isElement?"swiper-slide":`.${e.params.slideClass}`}function G(h){const f=D();return!!(h.target.matches(f)||e.slides.filter(g=>g.contains(h.target)).length>0)}function U(h){const f=`.${e.params.zoom.containerClass}`;return!!(h.target.matches(f)||[...e.hostEl.querySelectorAll(f)].filter(g=>g.contains(h.target)).length>0)}function V(h){if(h.pointerType==="mouse"&&w.splice(0,w.length),!G(h))return;const f=e.params.zoom;if(_=!1,b=!1,w.push(h),!(w.length<2)){if(_=!0,E.scaleStart=P(),!E.slideEl){E.slideEl=h.target.closest(`.${e.params.slideClass}, swiper-slide`),E.slideEl||(E.slideEl=e.slides[e.activeIndex]);let g=E.slideEl.querySelector(`.${f.containerClass}`);if(g&&(g=g.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=g,g?E.imageWrapEl=Ga(E.imageEl,`.${f.containerClass}`)[0]:E.imageWrapEl=void 0,!E.imageWrapEl){E.imageEl=void 0;return}E.maxRatio=M()}if(E.imageEl){const[g,v]=B();E.originX=g,E.originY=v,E.imageEl.style.transitionDuration="0ms"}d=!0}}function k(h){if(!G(h))return;const f=e.params.zoom,g=e.zoom,v=w.findIndex(S=>S.pointerId===h.pointerId);v>=0&&(w[v]=h),!(w.length<2)&&(b=!0,E.scaleMove=P(),E.imageEl&&(g.scale=E.scaleMove/E.scaleStart*u,g.scale>E.maxRatio&&(g.scale=E.maxRatio-1+(g.scale-E.maxRatio+1)**.5),g.scale<f.minRatio&&(g.scale=f.minRatio+1-(f.minRatio-g.scale+1)**.5),E.imageEl.style.transform=`translate3d(0,0,0) scale(${g.scale})`))}function z(h){if(!G(h)||h.pointerType==="mouse"&&h.type==="pointerout")return;const f=e.params.zoom,g=e.zoom,v=w.findIndex(S=>S.pointerId===h.pointerId);v>=0&&w.splice(v,1),!(!_||!b)&&(_=!1,b=!1,E.imageEl&&(g.scale=Math.max(Math.min(g.scale,E.maxRatio),f.minRatio),E.imageEl.style.transitionDuration=`${e.params.speed}ms`,E.imageEl.style.transform=`translate3d(0,0,0) scale(${g.scale})`,u=g.scale,d=!1,g.scale>1&&E.slideEl?E.slideEl.classList.add(`${f.zoomedSlideClass}`):g.scale<=1&&E.slideEl&&E.slideEl.classList.remove(`${f.zoomedSlideClass}`),g.scale===1&&(E.originX=0,E.originY=0,E.slideEl=void 0)))}let Q;function Z(){e.touchEventsData.preventTouchMoveFromPointerMove=!1}function K(){clearTimeout(Q),e.touchEventsData.preventTouchMoveFromPointerMove=!0,Q=setTimeout(()=>{e.destroyed||Z()})}function s(h){const f=e.device;if(!E.imageEl||C.isTouched)return;f.android&&h.cancelable&&h.preventDefault(),C.isTouched=!0;const g=w.length>0?w[0]:h;C.touchesStart.x=g.pageX,C.touchesStart.y=g.pageY}function H(h){const g=h.pointerType==="mouse"&&e.params.zoom.panOnMouseMove;if(!G(h)||!U(h))return;const v=e.zoom;if(!E.imageEl)return;if(!C.isTouched||!E.slideEl){g&&I(h);return}if(g){I(h);return}C.isMoved||(C.width=E.imageEl.offsetWidth||E.imageEl.clientWidth,C.height=E.imageEl.offsetHeight||E.imageEl.clientHeight,C.startX=HA(E.imageWrapEl,"x")||0,C.startY=HA(E.imageWrapEl,"y")||0,E.slideWidth=E.slideEl.offsetWidth,E.slideHeight=E.slideEl.offsetHeight,E.imageWrapEl.style.transitionDuration="0ms");const S=C.width*v.scale,R=C.height*v.scale;if(C.minX=Math.min(E.slideWidth/2-S/2,0),C.maxX=-C.minX,C.minY=Math.min(E.slideHeight/2-R/2,0),C.maxY=-C.minY,C.touchesCurrent.x=w.length>0?w[0].pageX:h.pageX,C.touchesCurrent.y=w.length>0?w[0].pageY:h.pageY,Math.max(Math.abs(C.touchesCurrent.x-C.touchesStart.x),Math.abs(C.touchesCurrent.y-C.touchesStart.y))>5&&(e.allowClick=!1),!C.isMoved&&!d){if(e.isHorizontal()&&(Math.floor(C.minX)===Math.floor(C.startX)&&C.touchesCurrent.x<C.touchesStart.x||Math.floor(C.maxX)===Math.floor(C.startX)&&C.touchesCurrent.x>C.touchesStart.x)){C.isTouched=!1,Z();return}if(!e.isHorizontal()&&(Math.floor(C.minY)===Math.floor(C.startY)&&C.touchesCurrent.y<C.touchesStart.y||Math.floor(C.maxY)===Math.floor(C.startY)&&C.touchesCurrent.y>C.touchesStart.y)){C.isTouched=!1,Z();return}}h.cancelable&&h.preventDefault(),h.stopPropagation(),K(),C.isMoved=!0;const F=(v.scale-u)/(E.maxRatio-e.params.zoom.minRatio),{originX:$,originY:O}=E;C.currentX=C.touchesCurrent.x-C.touchesStart.x+C.startX+F*(C.width-$*2),C.currentY=C.touchesCurrent.y-C.touchesStart.y+C.startY+F*(C.height-O*2),C.currentX<C.minX&&(C.currentX=C.minX+1-(C.minX-C.currentX+1)**.8),C.currentX>C.maxX&&(C.currentX=C.maxX-1+(C.currentX-C.maxX+1)**.8),C.currentY<C.minY&&(C.currentY=C.minY+1-(C.minY-C.currentY+1)**.8),C.currentY>C.maxY&&(C.currentY=C.maxY-1+(C.currentY-C.maxY+1)**.8),T.prevPositionX||(T.prevPositionX=C.touchesCurrent.x),T.prevPositionY||(T.prevPositionY=C.touchesCurrent.y),T.prevTime||(T.prevTime=Date.now()),T.x=(C.touchesCurrent.x-T.prevPositionX)/(Date.now()-T.prevTime)/2,T.y=(C.touchesCurrent.y-T.prevPositionY)/(Date.now()-T.prevTime)/2,Math.abs(C.touchesCurrent.x-T.prevPositionX)<2&&(T.x=0),Math.abs(C.touchesCurrent.y-T.prevPositionY)<2&&(T.y=0),T.prevPositionX=C.touchesCurrent.x,T.prevPositionY=C.touchesCurrent.y,T.prevTime=Date.now(),E.imageWrapEl.style.transform=`translate3d(${C.currentX}px, ${C.currentY}px,0)`}function y(){const h=e.zoom;if(w.length=0,!E.imageEl)return;if(!C.isTouched||!C.isMoved){C.isTouched=!1,C.isMoved=!1;return}C.isTouched=!1,C.isMoved=!1;let f=300,g=300;const v=T.x*f,S=C.currentX+v,R=T.y*g,L=C.currentY+R;T.x!==0&&(f=Math.abs((S-C.currentX)/T.x)),T.y!==0&&(g=Math.abs((L-C.currentY)/T.y));const F=Math.max(f,g);C.currentX=S,C.currentY=L;const $=C.width*h.scale,O=C.height*h.scale;C.minX=Math.min(E.slideWidth/2-$/2,0),C.maxX=-C.minX,C.minY=Math.min(E.slideHeight/2-O/2,0),C.maxY=-C.minY,C.currentX=Math.max(Math.min(C.currentX,C.maxX),C.minX),C.currentY=Math.max(Math.min(C.currentY,C.maxY),C.minY),E.imageWrapEl.style.transitionDuration=`${F}ms`,E.imageWrapEl.style.transform=`translate3d(${C.currentX}px, ${C.currentY}px,0)`}function ee(){const h=e.zoom;E.slideEl&&e.activeIndex!==e.slides.indexOf(E.slideEl)&&(E.imageEl&&(E.imageEl.style.transform="translate3d(0,0,0) scale(1)"),E.imageWrapEl&&(E.imageWrapEl.style.transform="translate3d(0,0,0)"),E.slideEl.classList.remove(`${e.params.zoom.zoomedSlideClass}`),h.scale=1,u=1,E.slideEl=void 0,E.imageEl=void 0,E.imageWrapEl=void 0,E.originX=0,E.originY=0)}function I(h){if(u<=1||!E.imageWrapEl||!G(h)||!U(h))return;const f=l.getComputedStyle(E.imageWrapEl).transform,g=new l.DOMMatrix(f);if(!p){p=!0,m.x=h.clientX,m.y=h.clientY,C.startX=g.e,C.startY=g.f,C.width=E.imageEl.offsetWidth||E.imageEl.clientWidth,C.height=E.imageEl.offsetHeight||E.imageEl.clientHeight,E.slideWidth=E.slideEl.offsetWidth,E.slideHeight=E.slideEl.offsetHeight;return}const v=(h.clientX-m.x)*A,S=(h.clientY-m.y)*A,R=C.width*u,L=C.height*u,F=E.slideWidth,$=E.slideHeight,O=Math.min(F/2-R/2,0),W=-O,Y=Math.min($/2-L/2,0),te=-Y,X=Math.max(Math.min(C.startX+v,W),O),ie=Math.max(Math.min(C.startY+S,te),Y);E.imageWrapEl.style.transitionDuration="0ms",E.imageWrapEl.style.transform=`translate3d(${X}px, ${ie}px, 0)`,m.x=h.clientX,m.y=h.clientY,C.startX=X,C.startY=ie,C.currentX=X,C.currentY=ie}function re(h){const f=e.zoom,g=e.params.zoom;if(!E.slideEl){h&&h.target&&(E.slideEl=h.target.closest(`.${e.params.slideClass}, swiper-slide`)),E.slideEl||(e.params.virtual&&e.params.virtual.enabled&&e.virtual?E.slideEl=Ui(e.slidesEl,`.${e.params.slideActiveClass}`)[0]:E.slideEl=e.slides[e.activeIndex]);let Le=E.slideEl.querySelector(`.${g.containerClass}`);Le&&(Le=Le.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=Le,Le?E.imageWrapEl=Ga(E.imageEl,`.${g.containerClass}`)[0]:E.imageWrapEl=void 0}if(!E.imageEl||!E.imageWrapEl)return;e.params.cssMode&&(e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.touchAction="none"),E.slideEl.classList.add(`${g.zoomedSlideClass}`);let v,S,R,L,F,$,O,W,Y,te,X,ie,de,q,j,ae,ge,fe;typeof C.touchesStart.x>"u"&&h?(v=h.pageX,S=h.pageY):(v=C.touchesStart.x,S=C.touchesStart.y);const ue=u,ve=typeof h=="number"?h:null;u===1&&ve&&(v=void 0,S=void 0,C.touchesStart.x=void 0,C.touchesStart.y=void 0);const Re=M();f.scale=ve||Re,u=ve||Re,h&&!(u===1&&ve)?(ge=E.slideEl.offsetWidth,fe=E.slideEl.offsetHeight,R=Af(E.slideEl).left+l.scrollX,L=Af(E.slideEl).top+l.scrollY,F=R+ge/2-v,$=L+fe/2-S,Y=E.imageEl.offsetWidth||E.imageEl.clientWidth,te=E.imageEl.offsetHeight||E.imageEl.clientHeight,X=Y*f.scale,ie=te*f.scale,de=Math.min(ge/2-X/2,0),q=Math.min(fe/2-ie/2,0),j=-de,ae=-q,ue>0&&ve&&typeof C.currentX=="number"&&typeof C.currentY=="number"?(O=C.currentX*f.scale/ue,W=C.currentY*f.scale/ue):(O=F*f.scale,W=$*f.scale),O<de&&(O=de),O>j&&(O=j),W<q&&(W=q),W>ae&&(W=ae)):(O=0,W=0),ve&&f.scale===1&&(E.originX=0,E.originY=0),C.currentX=O,C.currentY=W,E.imageWrapEl.style.transitionDuration="300ms",E.imageWrapEl.style.transform=`translate3d(${O}px, ${W}px,0)`,E.imageEl.style.transitionDuration="300ms",E.imageEl.style.transform=`translate3d(0,0,0) scale(${f.scale})`}function Ae(){const h=e.zoom,f=e.params.zoom;if(!E.slideEl){e.params.virtual&&e.params.virtual.enabled&&e.virtual?E.slideEl=Ui(e.slidesEl,`.${e.params.slideActiveClass}`)[0]:E.slideEl=e.slides[e.activeIndex];let g=E.slideEl.querySelector(`.${f.containerClass}`);g&&(g=g.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=g,g?E.imageWrapEl=Ga(E.imageEl,`.${f.containerClass}`)[0]:E.imageWrapEl=void 0}!E.imageEl||!E.imageWrapEl||(e.params.cssMode&&(e.wrapperEl.style.overflow="",e.wrapperEl.style.touchAction=""),h.scale=1,u=1,C.currentX=void 0,C.currentY=void 0,C.touchesStart.x=void 0,C.touchesStart.y=void 0,E.imageWrapEl.style.transitionDuration="300ms",E.imageWrapEl.style.transform="translate3d(0,0,0)",E.imageEl.style.transitionDuration="300ms",E.imageEl.style.transform="translate3d(0,0,0) scale(1)",E.slideEl.classList.remove(`${f.zoomedSlideClass}`),E.slideEl=void 0,E.originX=0,E.originY=0,e.params.zoom.panOnMouseMove&&(m={x:0,y:0},p&&(p=!1,C.startX=0,C.startY=0)))}function N(h){const f=e.zoom;f.scale&&f.scale!==1?Ae():re(h)}function n(){const h=e.params.passiveListeners?{passive:!0,capture:!1}:!1,f=e.params.passiveListeners?{passive:!1,capture:!0}:!0;return{passiveListener:h,activeListenerWithCapture:f}}function r(){const h=e.zoom;if(h.enabled)return;h.enabled=!0;const{passiveListener:f,activeListenerWithCapture:g}=n();e.wrapperEl.addEventListener("pointerdown",V,f),e.wrapperEl.addEventListener("pointermove",k,g),["pointerup","pointercancel","pointerout"].forEach(v=>{e.wrapperEl.addEventListener(v,z,f)}),e.wrapperEl.addEventListener("pointermove",H,g)}function c(){const h=e.zoom;if(!h.enabled)return;h.enabled=!1;const{passiveListener:f,activeListenerWithCapture:g}=n();e.wrapperEl.removeEventListener("pointerdown",V,f),e.wrapperEl.removeEventListener("pointermove",k,g),["pointerup","pointercancel","pointerout"].forEach(v=>{e.wrapperEl.removeEventListener(v,z,f)}),e.wrapperEl.removeEventListener("pointermove",H,g)}i("init",()=>{e.params.zoom.enabled&&r()}),i("destroy",()=>{c()}),i("touchStart",(h,f)=>{e.zoom.enabled&&s(f)}),i("touchEnd",(h,f)=>{e.zoom.enabled&&y()}),i("doubleTap",(h,f)=>{!e.animating&&e.params.zoom.enabled&&e.zoom.enabled&&e.params.zoom.toggle&&N(f)}),i("transitionEnd",()=>{e.zoom.enabled&&e.params.zoom.enabled&&ee()}),i("slideChange",()=>{e.zoom.enabled&&e.params.zoom.enabled&&e.params.cssMode&&ee()}),Object.assign(e.zoom,{enable:r,disable:c,in:re,out:Ae,toggle:N})}function vF(o){let{swiper:e,extendParams:t,on:i}=o;t({controller:{control:void 0,inverse:!1,by:"slide"}}),e.controller={control:void 0};function a(m,A){const _=(function(){let C,T,x;return(P,M)=>{for(T=-1,C=P.length;C-T>1;)x=C+T>>1,P[x]<=M?T=x:C=x;return C}})();this.x=m,this.y=A,this.lastIndex=m.length-1;let b,w;return this.interpolate=function(C){return C?(w=_(this.x,C),b=w-1,(C-this.x[b])*(this.y[w]-this.y[b])/(this.x[w]-this.x[b])+this.y[b]):0},this}function l(m){e.controller.spline=e.params.loop?new a(e.slidesGrid,m.slidesGrid):new a(e.snapGrid,m.snapGrid)}function u(m,A){const _=e.controller.control;let b,w;const E=e.constructor;function C(T){if(T.destroyed)return;const x=e.rtlTranslate?-e.translate:e.translate;e.params.controller.by==="slide"&&(l(T),w=-e.controller.spline.interpolate(-x)),(!w||e.params.controller.by==="container")&&(b=(T.maxTranslate()-T.minTranslate())/(e.maxTranslate()-e.minTranslate()),(Number.isNaN(b)||!Number.isFinite(b))&&(b=1),w=(x-e.minTranslate())*b+T.minTranslate()),e.params.controller.inverse&&(w=T.maxTranslate()-w),T.updateProgress(w),T.setTranslate(w,e),T.updateActiveIndex(),T.updateSlidesClasses()}if(Array.isArray(_))for(let T=0;T<_.length;T+=1)_[T]!==A&&_[T]instanceof E&&C(_[T]);else _ instanceof E&&A!==_&&C(_)}function d(m,A){const _=e.constructor,b=e.controller.control;let w;function E(C){C.destroyed||(C.setTransition(m,e),m!==0&&(C.transitionStart(),C.params.autoHeight&&Dl(()=>{C.updateAutoHeight()}),pu(C.wrapperEl,()=>{b&&C.transitionEnd()})))}if(Array.isArray(b))for(w=0;w<b.length;w+=1)b[w]!==A&&b[w]instanceof _&&E(b[w]);else b instanceof _&&A!==b&&E(b)}function p(){e.controller.control&&e.controller.spline&&(e.controller.spline=void 0,delete e.controller.spline)}i("beforeInit",()=>{if(typeof window<"u"&&(typeof e.params.controller.control=="string"||e.params.controller.control instanceof HTMLElement)){(typeof e.params.controller.control=="string"?[...document.querySelectorAll(e.params.controller.control)]:[e.params.controller.control]).forEach(A=>{if(e.controller.control||(e.controller.control=[]),A&&A.swiper)e.controller.control.push(A.swiper);else if(A){const _=`${e.params.eventsPrefix}init`,b=w=>{e.controller.control.push(w.detail[0]),e.update(),A.removeEventListener(_,b)};A.addEventListener(_,b)}});return}e.controller.control=e.params.controller.control}),i("update",()=>{p()}),i("resize",()=>{p()}),i("observerUpdate",()=>{p()}),i("setTranslate",(m,A,_)=>{!e.controller.control||e.controller.control.destroyed||e.controller.setTranslate(A,_)}),i("setTransition",(m,A,_)=>{!e.controller.control||e.controller.control.destroyed||e.controller.setTransition(A,_)}),Object.assign(e.controller,{setTranslate:u,setTransition:d})}function wF(o){let{swiper:e,extendParams:t,on:i}=o;t({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,containerRole:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null,scrollOnFocus:!0}}),e.a11y={clicked:!1};let a=null,l,u,d=new Date().getTime();function p(ee){const I=a;I.length!==0&&Yn(I,ee)}function m(ee){const I=()=>Math.round(16*Math.random()).toString(16);return"x".repeat(ee).replace(/x/g,I)}function A(ee){ee=_t(ee),ee.forEach(I=>{I.setAttribute("tabIndex","0")})}function _(ee){ee=_t(ee),ee.forEach(I=>{I.setAttribute("tabIndex","-1")})}function b(ee,I){ee=_t(ee),ee.forEach(re=>{re.setAttribute("role",I)})}function w(ee,I){ee=_t(ee),ee.forEach(re=>{re.setAttribute("aria-roledescription",I)})}function E(ee,I){ee=_t(ee),ee.forEach(re=>{re.setAttribute("aria-controls",I)})}function C(ee,I){ee=_t(ee),ee.forEach(re=>{re.setAttribute("aria-label",I)})}function T(ee,I){ee=_t(ee),ee.forEach(re=>{re.setAttribute("id",I)})}function x(ee,I){ee=_t(ee),ee.forEach(re=>{re.setAttribute("aria-live",I)})}function P(ee){ee=_t(ee),ee.forEach(I=>{I.setAttribute("aria-disabled",!0)})}function M(ee){ee=_t(ee),ee.forEach(I=>{I.setAttribute("aria-disabled",!1)})}function B(ee){if(ee.keyCode!==13&&ee.keyCode!==32)return;const I=e.params.a11y,re=ee.target;if(!(e.pagination&&e.pagination.el&&(re===e.pagination.el||e.pagination.el.contains(ee.target))&&!ee.target.matches(nr(e.params.pagination.bulletClass)))){if(e.navigation&&e.navigation.prevEl&&e.navigation.nextEl){const Ae=_t(e.navigation.prevEl);_t(e.navigation.nextEl).includes(re)&&(e.isEnd&&!e.params.loop||e.slideNext(),e.isEnd?p(I.lastSlideMessage):p(I.nextSlideMessage)),Ae.includes(re)&&(e.isBeginning&&!e.params.loop||e.slidePrev(),e.isBeginning?p(I.firstSlideMessage):p(I.prevSlideMessage))}e.pagination&&re.matches(nr(e.params.pagination.bulletClass))&&re.click()}}function D(){if(e.params.loop||e.params.rewind||!e.navigation)return;const{nextEl:ee,prevEl:I}=e.navigation;I&&(e.isBeginning?(P(I),_(I)):(M(I),A(I))),ee&&(e.isEnd?(P(ee),_(ee)):(M(ee),A(ee)))}function G(){return e.pagination&&e.pagination.bullets&&e.pagination.bullets.length}function U(){return G()&&e.params.pagination.clickable}function V(){const ee=e.params.a11y;G()&&e.pagination.bullets.forEach(I=>{e.params.pagination.clickable&&(A(I),e.params.pagination.renderBullet||(b(I,"button"),C(I,ee.paginationBulletMessage.replace(/\{\{index\}\}/,Mu(I)+1)))),I.matches(nr(e.params.pagination.bulletActiveClass))?I.setAttribute("aria-current","true"):I.removeAttribute("aria-current")})}const k=(ee,I,re)=>{A(ee),ee.tagName!=="BUTTON"&&(b(ee,"button"),ee.addEventListener("keydown",B)),C(ee,re),E(ee,I)},z=ee=>{u&&u!==ee.target&&!u.contains(ee.target)&&(l=!0),e.a11y.clicked=!0},Q=()=>{l=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.destroyed||(e.a11y.clicked=!1)})})},Z=ee=>{d=new Date().getTime()},K=ee=>{if(e.a11y.clicked||!e.params.a11y.scrollOnFocus||new Date().getTime()-d<100)return;const I=ee.target.closest(`.${e.params.slideClass}, swiper-slide`);if(!I||!e.slides.includes(I))return;u=I;const re=e.slides.indexOf(I)===e.activeIndex,Ae=e.params.watchSlidesProgress&&e.visibleSlides&&e.visibleSlides.includes(I);re||Ae||ee.sourceCapabilities&&ee.sourceCapabilities.firesTouchEvents||(e.isHorizontal()?e.el.scrollLeft=0:e.el.scrollTop=0,requestAnimationFrame(()=>{l||(e.params.loop?e.slideToLoop(e.getSlideIndexWhenGrid(parseInt(I.getAttribute("data-swiper-slide-index"))),0):e.slideTo(e.getSlideIndexWhenGrid(e.slides.indexOf(I)),0),l=!1)}))},s=()=>{const ee=e.params.a11y;ee.itemRoleDescriptionMessage&&w(e.slides,ee.itemRoleDescriptionMessage),ee.slideRole&&b(e.slides,ee.slideRole);const I=e.slides.length;ee.slideLabelMessage&&e.slides.forEach((re,Ae)=>{const N=e.params.loop?parseInt(re.getAttribute("data-swiper-slide-index"),10):Ae,n=ee.slideLabelMessage.replace(/\{\{index\}\}/,N+1).replace(/\{\{slidesLength\}\}/,I);C(re,n)})},H=()=>{const ee=e.params.a11y;e.el.append(a);const I=e.el;ee.containerRoleDescriptionMessage&&w(I,ee.containerRoleDescriptionMessage),ee.containerMessage&&C(I,ee.containerMessage),ee.containerRole&&b(I,ee.containerRole);const re=e.wrapperEl,Ae=ee.id||re.getAttribute("id")||`swiper-wrapper-${m(16)}`,N=e.params.autoplay&&e.params.autoplay.enabled?"off":"polite";T(re,Ae),x(re,N),s();let{nextEl:n,prevEl:r}=e.navigation?e.navigation:{};n=_t(n),r=_t(r),n&&n.forEach(h=>k(h,Ae,ee.nextSlideMessage)),r&&r.forEach(h=>k(h,Ae,ee.prevSlideMessage)),U()&&_t(e.pagination.el).forEach(f=>{f.addEventListener("keydown",B)}),Li().addEventListener("visibilitychange",Z),e.el.addEventListener("focus",K,!0),e.el.addEventListener("focus",K,!0),e.el.addEventListener("pointerdown",z,!0),e.el.addEventListener("pointerup",Q,!0)};function y(){a&&a.remove();let{nextEl:ee,prevEl:I}=e.navigation?e.navigation:{};ee=_t(ee),I=_t(I),ee&&ee.forEach(Ae=>Ae.removeEventListener("keydown",B)),I&&I.forEach(Ae=>Ae.removeEventListener("keydown",B)),U()&&_t(e.pagination.el).forEach(N=>{N.removeEventListener("keydown",B)}),Li().removeEventListener("visibilitychange",Z),e.el&&typeof e.el!="string"&&(e.el.removeEventListener("focus",K,!0),e.el.removeEventListener("pointerdown",z,!0),e.el.removeEventListener("pointerup",Q,!0))}i("beforeInit",()=>{a=Pn("span",e.params.a11y.notificationClass),a.setAttribute("aria-live","assertive"),a.setAttribute("aria-atomic","true")}),i("afterInit",()=>{e.params.a11y.enabled&&H()}),i("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{e.params.a11y.enabled&&s()}),i("fromEdge toEdge afterInit lock unlock",()=>{e.params.a11y.enabled&&D()}),i("paginationUpdate",()=>{e.params.a11y.enabled&&V()}),i("destroy",()=>{e.params.a11y.enabled&&y()})}function EF(o){let{swiper:e,extendParams:t,on:i}=o;t({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let a=!1,l={};const u=w=>w.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),d=w=>{const E=ti();let C;w?C=new URL(w):C=E.location;const T=C.pathname.slice(1).split("/").filter(B=>B!==""),x=T.length,P=T[x-2],M=T[x-1];return{key:P,value:M}},p=(w,E)=>{const C=ti();if(!a||!e.params.history.enabled)return;let T;e.params.url?T=new URL(e.params.url):T=C.location;const x=e.virtual&&e.params.virtual.enabled?e.slidesEl.querySelector(`[data-swiper-slide-index="${E}"]`):e.slides[E];let P=u(x.getAttribute("data-history"));if(e.params.history.root.length>0){let B=e.params.history.root;B[B.length-1]==="/"&&(B=B.slice(0,B.length-1)),P=`${B}/${w?`${w}/`:""}${P}`}else T.pathname.includes(w)||(P=`${w?`${w}/`:""}${P}`);e.params.history.keepQuery&&(P+=T.search);const M=C.history.state;M&&M.value===P||(e.params.history.replaceState?C.history.replaceState({value:P},null,P):C.history.pushState({value:P},null,P))},m=(w,E,C)=>{if(E)for(let T=0,x=e.slides.length;T<x;T+=1){const P=e.slides[T];if(u(P.getAttribute("data-history"))===E){const B=e.getSlideIndex(P);e.slideTo(B,w,C)}}else e.slideTo(0,w,C)},A=()=>{l=d(e.params.url),m(e.params.speed,l.value,!1)},_=()=>{const w=ti();if(e.params.history){if(!w.history||!w.history.pushState){e.params.history.enabled=!1,e.params.hashNavigation.enabled=!0;return}if(a=!0,l=d(e.params.url),!l.key&&!l.value){e.params.history.replaceState||w.addEventListener("popstate",A);return}m(0,l.value,e.params.runCallbacksOnInit),e.params.history.replaceState||w.addEventListener("popstate",A)}},b=()=>{const w=ti();e.params.history.replaceState||w.removeEventListener("popstate",A)};i("init",()=>{e.params.history.enabled&&_()}),i("destroy",()=>{e.params.history.enabled&&b()}),i("transitionEnd _freeModeNoMomentumRelease",()=>{a&&p(e.params.history.key,e.activeIndex)}),i("slideChange",()=>{a&&e.params.cssMode&&p(e.params.history.key,e.activeIndex)})}function xF(o){let{swiper:e,extendParams:t,emit:i,on:a}=o,l=!1;const u=Li(),d=ti();t({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(b,w){if(e.virtual&&e.params.virtual.enabled){const E=e.slides.find(T=>T.getAttribute("data-hash")===w);return E?parseInt(E.getAttribute("data-swiper-slide-index"),10):0}return e.getSlideIndex(Ui(e.slidesEl,`.${e.params.slideClass}[data-hash="${w}"], swiper-slide[data-hash="${w}"]`)[0])}}});const p=()=>{i("hashChange");const b=u.location.hash.replace("#",""),w=e.virtual&&e.params.virtual.enabled?e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`):e.slides[e.activeIndex],E=w?w.getAttribute("data-hash"):"";if(b!==E){const C=e.params.hashNavigation.getSlideIndex(e,b);if(typeof C>"u"||Number.isNaN(C))return;e.slideTo(C)}},m=()=>{if(!l||!e.params.hashNavigation.enabled)return;const b=e.virtual&&e.params.virtual.enabled?e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`):e.slides[e.activeIndex],w=b?b.getAttribute("data-hash")||b.getAttribute("data-history"):"";e.params.hashNavigation.replaceState&&d.history&&d.history.replaceState?(d.history.replaceState(null,null,`#${w}`||""),i("hashSet")):(u.location.hash=w||"",i("hashSet"))},A=()=>{if(!e.params.hashNavigation.enabled||e.params.history&&e.params.history.enabled)return;l=!0;const b=u.location.hash.replace("#","");if(b){const E=e.params.hashNavigation.getSlideIndex(e,b);e.slideTo(E||0,0,e.params.runCallbacksOnInit,!0)}e.params.hashNavigation.watchState&&d.addEventListener("hashchange",p)},_=()=>{e.params.hashNavigation.watchState&&d.removeEventListener("hashchange",p)};a("init",()=>{e.params.hashNavigation.enabled&&A()}),a("destroy",()=>{e.params.hashNavigation.enabled&&_()}),a("transitionEnd _freeModeNoMomentumRelease",()=>{l&&m()}),a("slideChange",()=>{l&&e.params.cssMode&&m()})}function SF(o){let{swiper:e,extendParams:t,on:i,emit:a,params:l}=o;e.autoplay={running:!1,paused:!1,timeLeft:0},t({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let u,d,p=l&&l.autoplay?l.autoplay.delay:3e3,m=l&&l.autoplay?l.autoplay.delay:3e3,A,_=new Date().getTime(),b,w,E,C,T,x,P;function M(I){!e||e.destroyed||!e.wrapperEl||I.target===e.wrapperEl&&(e.wrapperEl.removeEventListener("transitionend",M),!(P||I.detail&&I.detail.bySwiperTouchMove)&&z())}const B=()=>{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?b=!0:b&&(m=A,b=!1);const I=e.autoplay.paused?A:_+m-new Date().getTime();e.autoplay.timeLeft=I,a("autoplayTimeLeft",I,I/p),d=requestAnimationFrame(()=>{B()})},D=()=>{let I;return e.virtual&&e.params.virtual.enabled?I=e.slides.find(Ae=>Ae.classList.contains("swiper-slide-active")):I=e.slides[e.activeIndex],I?parseInt(I.getAttribute("data-swiper-autoplay"),10):void 0},G=I=>{if(e.destroyed||!e.autoplay.running)return;cancelAnimationFrame(d),B();let re=typeof I>"u"?e.params.autoplay.delay:I;p=e.params.autoplay.delay,m=e.params.autoplay.delay;const Ae=D();!Number.isNaN(Ae)&&Ae>0&&typeof I>"u"&&(re=Ae,p=Ae,m=Ae),A=re;const N=e.params.speed,n=()=>{!e||e.destroyed||(e.params.autoplay.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(N,!0,!0),a("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(e.slides.length-1,N,!0,!0),a("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(N,!0,!0),a("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(0,N,!0,!0),a("autoplay")),e.params.cssMode&&(_=new Date().getTime(),requestAnimationFrame(()=>{G()})))};return re>0?(clearTimeout(u),u=setTimeout(()=>{n()},re)):requestAnimationFrame(()=>{n()}),re},U=()=>{_=new Date().getTime(),e.autoplay.running=!0,G(),a("autoplayStart")},V=()=>{e.autoplay.running=!1,clearTimeout(u),cancelAnimationFrame(d),a("autoplayStop")},k=(I,re)=>{if(e.destroyed||!e.autoplay.running)return;clearTimeout(u),I||(x=!0);const Ae=()=>{a("autoplayPause"),e.params.autoplay.waitForTransition?e.wrapperEl.addEventListener("transitionend",M):z()};if(e.autoplay.paused=!0,re){T&&(A=e.params.autoplay.delay),T=!1,Ae();return}A=(A||e.params.autoplay.delay)-(new Date().getTime()-_),!(e.isEnd&&A<0&&!e.params.loop)&&(A<0&&(A=0),Ae())},z=()=>{e.isEnd&&A<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(_=new Date().getTime(),x?(x=!1,G(A)):G(),e.autoplay.paused=!1,a("autoplayResume"))},Q=()=>{if(e.destroyed||!e.autoplay.running)return;const I=Li();I.visibilityState==="hidden"&&(x=!0,k(!0)),I.visibilityState==="visible"&&z()},Z=I=>{I.pointerType==="mouse"&&(x=!0,P=!0,!(e.animating||e.autoplay.paused)&&k(!0))},K=I=>{I.pointerType==="mouse"&&(P=!1,e.autoplay.paused&&z())},s=()=>{e.params.autoplay.pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",Z),e.el.addEventListener("pointerleave",K))},H=()=>{e.el&&typeof e.el!="string"&&(e.el.removeEventListener("pointerenter",Z),e.el.removeEventListener("pointerleave",K))},y=()=>{Li().addEventListener("visibilitychange",Q)},ee=()=>{Li().removeEventListener("visibilitychange",Q)};i("init",()=>{e.params.autoplay.enabled&&(s(),y(),U())}),i("destroy",()=>{H(),ee(),e.autoplay.running&&V()}),i("_freeModeStaticRelease",()=>{(E||x)&&z()}),i("_freeModeNoMomentumRelease",()=>{e.params.autoplay.disableOnInteraction?V():k(!0,!0)}),i("beforeTransitionStart",(I,re,Ae)=>{e.destroyed||!e.autoplay.running||(Ae||!e.params.autoplay.disableOnInteraction?k(!0,!0):V())}),i("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(e.params.autoplay.disableOnInteraction){V();return}w=!0,E=!1,x=!1,C=setTimeout(()=>{x=!0,E=!0,k(!0)},200)}}),i("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!w)){if(clearTimeout(C),clearTimeout(u),e.params.autoplay.disableOnInteraction){E=!1,w=!1;return}E&&e.params.cssMode&&z(),E=!1,w=!1}}),i("slideChange",()=>{e.destroyed||!e.autoplay.running||(T=!0)}),Object.assign(e.autoplay,{start:U,stop:V,pause:k,resume:z})}function CF(o){let{swiper:e,extendParams:t,on:i}=o;t({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let a=!1,l=!1;e.thumbs={swiper:null};function u(){const m=e.thumbs.swiper;if(!m||m.destroyed)return;const A=m.clickedIndex,_=m.clickedSlide;if(_&&_.classList.contains(e.params.thumbs.slideThumbActiveClass)||typeof A>"u"||A===null)return;let b;m.params.loop?b=parseInt(m.clickedSlide.getAttribute("data-swiper-slide-index"),10):b=A,e.params.loop?e.slideToLoop(b):e.slideTo(b)}function d(){const{thumbs:m}=e.params;if(a)return!1;a=!0;const A=e.constructor;if(m.swiper instanceof A){if(m.swiper.destroyed)return a=!1,!1;e.thumbs.swiper=m.swiper,Object.assign(e.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(e.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper.update()}else if(jc(m.swiper)){const _=Object.assign({},m.swiper);Object.assign(_,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper=new A(_),l=!0}return e.thumbs.swiper.el.classList.add(e.params.thumbs.thumbsContainerClass),e.thumbs.swiper.on("tap",u),!0}function p(m){const A=e.thumbs.swiper;if(!A||A.destroyed)return;const _=A.params.slidesPerView==="auto"?A.slidesPerViewDynamic():A.params.slidesPerView;let b=1;const w=e.params.thumbs.slideThumbActiveClass;if(e.params.slidesPerView>1&&!e.params.centeredSlides&&(b=e.params.slidesPerView),e.params.thumbs.multipleActiveThumbs||(b=1),b=Math.floor(b),A.slides.forEach(T=>T.classList.remove(w)),A.params.loop||A.params.virtual&&A.params.virtual.enabled)for(let T=0;T<b;T+=1)Ui(A.slidesEl,`[data-swiper-slide-index="${e.realIndex+T}"]`).forEach(x=>{x.classList.add(w)});else for(let T=0;T<b;T+=1)A.slides[e.realIndex+T]&&A.slides[e.realIndex+T].classList.add(w);const E=e.params.thumbs.autoScrollOffset,C=E&&!A.params.loop;if(e.realIndex!==A.realIndex||C){const T=A.activeIndex;let x,P;if(A.params.loop){const M=A.slides.find(B=>B.getAttribute("data-swiper-slide-index")===`${e.realIndex}`);x=A.slides.indexOf(M),P=e.activeIndex>e.previousIndex?"next":"prev"}else x=e.realIndex,P=x>e.previousIndex?"next":"prev";C&&(x+=P==="next"?E:-1*E),A.visibleSlidesIndexes&&A.visibleSlidesIndexes.indexOf(x)<0&&(A.params.centeredSlides?x>T?x=x-Math.floor(_/2)+1:x=x+Math.floor(_/2)-1:x>T&&A.params.slidesPerGroup,A.slideTo(x,m?0:void 0))}}i("beforeInit",()=>{const{thumbs:m}=e.params;if(!(!m||!m.swiper))if(typeof m.swiper=="string"||m.swiper instanceof HTMLElement){const A=Li(),_=()=>{const w=typeof m.swiper=="string"?A.querySelector(m.swiper):m.swiper;if(w&&w.swiper)m.swiper=w.swiper,d(),p(!0);else if(w){const E=`${e.params.eventsPrefix}init`,C=T=>{m.swiper=T.detail[0],w.removeEventListener(E,C),d(),p(!0),m.swiper.update(),e.update()};w.addEventListener(E,C)}return w},b=()=>{if(e.destroyed)return;_()||requestAnimationFrame(b)};requestAnimationFrame(b)}else d(),p(!0)}),i("slideChange update resize observerUpdate",()=>{p()}),i("setTransition",(m,A)=>{const _=e.thumbs.swiper;!_||_.destroyed||_.setTransition(A)}),i("beforeDestroy",()=>{const m=e.thumbs.swiper;!m||m.destroyed||l&&m.destroy()}),Object.assign(e.thumbs,{init:d,update:p})}function TF(o){let{swiper:e,extendParams:t,emit:i,once:a}=o;t({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}});function l(){if(e.params.cssMode)return;const p=e.getTranslate();e.setTranslate(p),e.setTransition(0),e.touchEventsData.velocities.length=0,e.freeMode.onTouchEnd({currentPos:e.rtl?e.translate:-e.translate})}function u(){if(e.params.cssMode)return;const{touchEventsData:p,touches:m}=e;p.velocities.length===0&&p.velocities.push({position:m[e.isHorizontal()?"startX":"startY"],time:p.touchStartTime}),p.velocities.push({position:m[e.isHorizontal()?"currentX":"currentY"],time:Vn()})}function d(p){let{currentPos:m}=p;if(e.params.cssMode)return;const{params:A,wrapperEl:_,rtlTranslate:b,snapGrid:w,touchEventsData:E}=e,T=Vn()-E.touchStartTime;if(m<-e.minTranslate()){e.slideTo(e.activeIndex);return}if(m>-e.maxTranslate()){e.slides.length<w.length?e.slideTo(w.length-1):e.slideTo(e.slides.length-1);return}if(A.freeMode.momentum){if(E.velocities.length>1){const V=E.velocities.pop(),k=E.velocities.pop(),z=V.position-k.position,Q=V.time-k.time;e.velocity=z/Q,e.velocity/=2,Math.abs(e.velocity)<A.freeMode.minimumVelocity&&(e.velocity=0),(Q>150||Vn()-V.time>300)&&(e.velocity=0)}else e.velocity=0;e.velocity*=A.freeMode.momentumVelocityRatio,E.velocities.length=0;let x=1e3*A.freeMode.momentumRatio;const P=e.velocity*x;let M=e.translate+P;b&&(M=-M);let B=!1,D;const G=Math.abs(e.velocity)*20*A.freeMode.momentumBounceRatio;let U;if(M<e.maxTranslate())A.freeMode.momentumBounce?(M+e.maxTranslate()<-G&&(M=e.maxTranslate()-G),D=e.maxTranslate(),B=!0,E.allowMomentumBounce=!0):M=e.maxTranslate(),A.loop&&A.centeredSlides&&(U=!0);else if(M>e.minTranslate())A.freeMode.momentumBounce?(M-e.minTranslate()>G&&(M=e.minTranslate()+G),D=e.minTranslate(),B=!0,E.allowMomentumBounce=!0):M=e.minTranslate(),A.loop&&A.centeredSlides&&(U=!0);else if(A.freeMode.sticky){let V;for(let k=0;k<w.length;k+=1)if(w[k]>-M){V=k;break}Math.abs(w[V]-M)<Math.abs(w[V-1]-M)||e.swipeDirection==="next"?M=w[V]:M=w[V-1],M=-M}if(U&&a("transitionEnd",()=>{e.loopFix()}),e.velocity!==0){if(b?x=Math.abs((-M-e.translate)/e.velocity):x=Math.abs((M-e.translate)/e.velocity),A.freeMode.sticky){const V=Math.abs((b?-M:M)-e.translate),k=e.slidesSizesGrid[e.activeIndex];V<k?x=A.speed:V<2*k?x=A.speed*1.5:x=A.speed*2.5}}else if(A.freeMode.sticky){e.slideToClosest();return}A.freeMode.momentumBounce&&B?(e.updateProgress(D),e.setTransition(x),e.setTranslate(M),e.transitionStart(!0,e.swipeDirection),e.animating=!0,pu(_,()=>{!e||e.destroyed||!E.allowMomentumBounce||(i("momentumBounce"),e.setTransition(A.speed),setTimeout(()=>{e.setTranslate(D),pu(_,()=>{!e||e.destroyed||e.transitionEnd()})},0))})):e.velocity?(i("_freeModeNoMomentumRelease"),e.updateProgress(M),e.setTransition(x),e.setTranslate(M),e.transitionStart(!0,e.swipeDirection),e.animating||(e.animating=!0,pu(_,()=>{!e||e.destroyed||e.transitionEnd()}))):e.updateProgress(M),e.updateActiveIndex(),e.updateSlidesClasses()}else if(A.freeMode.sticky){e.slideToClosest();return}else A.freeMode&&i("_freeModeNoMomentumRelease");(!A.freeMode.momentum||T>=A.longSwipesMs)&&(i("_freeModeStaticRelease"),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses())}Object.assign(e,{freeMode:{onTouchStart:l,onTouchMove:u,onTouchEnd:d}})}function IF(o){let{swiper:e,extendParams:t,on:i}=o;t({grid:{rows:1,fill:"column"}});let a,l,u,d;const p=()=>{let C=e.params.spaceBetween;return typeof C=="string"&&C.indexOf("%")>=0?C=parseFloat(C.replace("%",""))/100*e.size:typeof C=="string"&&(C=parseFloat(C)),C},m=C=>{const{slidesPerView:T}=e.params,{rows:x,fill:P}=e.params.grid,M=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:C.length;u=Math.floor(M/x),Math.floor(M/x)===M/x?a=M:a=Math.ceil(M/x)*x,T!=="auto"&&P==="row"&&(a=Math.max(a,T*x)),l=a/x},A=()=>{e.slides&&e.slides.forEach(C=>{C.swiperSlideGridSet&&(C.style.height="",C.style[e.getDirectionLabel("margin-top")]="")})},_=(C,T,x)=>{const{slidesPerGroup:P}=e.params,M=p(),{rows:B,fill:D}=e.params.grid,G=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:x.length;let U,V,k;if(D==="row"&&P>1){const z=Math.floor(C/(P*B)),Q=C-B*P*z,Z=z===0?P:Math.min(Math.ceil((G-z*B*P)/B),P);k=Math.floor(Q/Z),V=Q-k*Z+z*P,U=V+k*a/B,T.style.order=U}else D==="column"?(V=Math.floor(C/B),k=C-V*B,(V>u||V===u&&k===B-1)&&(k+=1,k>=B&&(k=0,V+=1))):(k=Math.floor(C/l),V=C-k*l);T.row=k,T.column=V,T.style.height=`calc((100% - ${(B-1)*M}px) / ${B})`,T.style[e.getDirectionLabel("margin-top")]=k!==0?M&&`${M}px`:"",T.swiperSlideGridSet=!0},b=(C,T)=>{const{centeredSlides:x,roundLengths:P}=e.params,M=p(),{rows:B}=e.params.grid;if(e.virtualSize=(C+M)*a,e.virtualSize=Math.ceil(e.virtualSize/B)-M,e.params.cssMode||(e.wrapperEl.style[e.getDirectionLabel("width")]=`${e.virtualSize+M}px`),x){const D=[];for(let G=0;G<T.length;G+=1){let U=T[G];P&&(U=Math.floor(U)),T[G]<e.virtualSize+T[0]&&D.push(U)}T.splice(0,T.length),T.push(...D)}},w=()=>{d=e.params.grid&&e.params.grid.rows>1},E=()=>{const{params:C,el:T}=e,x=C.grid&&C.grid.rows>1;d&&!x?(T.classList.remove(`${C.containerModifierClass}grid`,`${C.containerModifierClass}grid-column`),u=1,e.emitContainerClasses()):!d&&x&&(T.classList.add(`${C.containerModifierClass}grid`),C.grid.fill==="column"&&T.classList.add(`${C.containerModifierClass}grid-column`),e.emitContainerClasses()),d=x};i("init",w),i("update",E),e.grid={initSlides:m,unsetSlides:A,updateSlide:_,updateWrapperSize:b}}function MF(o){const e=this,{params:t,slidesEl:i}=e;t.loop&&e.loopDestroy();const a=l=>{if(typeof l=="string"){const u=document.createElement("div");Yn(u,l),i.append(u.children[0]),Yn(u,"")}else i.append(l)};if(typeof o=="object"&&"length"in o)for(let l=0;l<o.length;l+=1)o[l]&&a(o[l]);else a(o);e.recalcSlides(),t.loop&&e.loopCreate(),(!t.observer||e.isElement)&&e.update()}function RF(o){const e=this,{params:t,activeIndex:i,slidesEl:a}=e;t.loop&&e.loopDestroy();let l=i+1;const u=d=>{if(typeof d=="string"){const p=document.createElement("div");Yn(p,d),a.prepend(p.children[0]),Yn(p,"")}else a.prepend(d)};if(typeof o=="object"&&"length"in o){for(let d=0;d<o.length;d+=1)o[d]&&u(o[d]);l=i+o.length}else u(o);e.recalcSlides(),t.loop&&e.loopCreate(),(!t.observer||e.isElement)&&e.update(),e.slideTo(l,0,!1)}function BF(o,e){const t=this,{params:i,activeIndex:a,slidesEl:l}=t;let u=a;i.loop&&(u-=t.loopedSlides,t.loopDestroy(),t.recalcSlides());const d=t.slides.length;if(o<=0){t.prependSlide(e);return}if(o>=d){t.appendSlide(e);return}let p=u>o?u+1:u;const m=[];for(let A=d-1;A>=o;A-=1){const _=t.slides[A];_.remove(),m.unshift(_)}if(typeof e=="object"&&"length"in e){for(let A=0;A<e.length;A+=1)e[A]&&l.append(e[A]);p=u>o?u+e.length:u}else l.append(e);for(let A=0;A<m.length;A+=1)l.append(m[A]);t.recalcSlides(),i.loop&&t.loopCreate(),(!i.observer||t.isElement)&&t.update(),i.loop?t.slideTo(p+t.loopedSlides,0,!1):t.slideTo(p,0,!1)}function PF(o){const e=this,{params:t,activeIndex:i}=e;let a=i;t.loop&&(a-=e.loopedSlides,e.loopDestroy());let l=a,u;if(typeof o=="object"&&"length"in o){for(let d=0;d<o.length;d+=1)u=o[d],e.slides[u]&&e.slides[u].remove(),u<l&&(l-=1);l=Math.max(l,0)}else u=o,e.slides[u]&&e.slides[u].remove(),u<l&&(l-=1),l=Math.max(l,0);e.recalcSlides(),t.loop&&e.loopCreate(),(!t.observer||e.isElement)&&e.update(),t.loop?e.slideTo(l+e.loopedSlides,0,!1):e.slideTo(l,0,!1)}function LF(){const o=this,e=[];for(let t=0;t<o.slides.length;t+=1)e.push(t);o.removeSlide(e)}function DF(o){let{swiper:e}=o;Object.assign(e,{appendSlide:MF.bind(e),prependSlide:RF.bind(e),addSlide:BF.bind(e),removeSlide:PF.bind(e),removeAllSlides:LF.bind(e)})}function Ql(o){const{effect:e,swiper:t,on:i,setTranslate:a,setTransition:l,overwriteParams:u,perspective:d,recreateShadows:p,getEffectParams:m}=o;i("beforeInit",()=>{if(t.params.effect!==e)return;t.classNames.push(`${t.params.containerModifierClass}${e}`),d&&d()&&t.classNames.push(`${t.params.containerModifierClass}3d`);const _=u?u():{};Object.assign(t.params,_),Object.assign(t.originalParams,_)}),i("setTranslate _virtualUpdated",()=>{t.params.effect===e&&a()}),i("setTransition",(_,b)=>{t.params.effect===e&&l(b)}),i("transitionEnd",()=>{if(t.params.effect===e&&p){if(!m||!m().slideShadows)return;t.slides.forEach(_=>{_.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(b=>b.remove())}),p()}});let A;i("virtualUpdate",()=>{t.params.effect===e&&(t.slides.length||(A=!0),requestAnimationFrame(()=>{A&&t.slides&&t.slides.length&&(a(),A=!1)}))})}function Hu(o,e){const t=to(e);return t!==e&&(t.style.backfaceVisibility="hidden",t.style["-webkit-backface-visibility"]="hidden"),t}function Vf(o){let{swiper:e,duration:t,transformElements:i,allSlides:a}=o;const{activeIndex:l}=e,u=d=>d.parentElement?d.parentElement:e.slides.find(m=>m.shadowRoot&&m.shadowRoot===d.parentNode);if(e.params.virtualTranslate&&t!==0){let d=!1,p;a?p=i:p=i.filter(m=>{const A=m.classList.contains("swiper-slide-transform")?u(m):m;return e.getSlideIndex(A)===l}),p.forEach(m=>{pu(m,()=>{if(d||!e||e.destroyed)return;d=!0,e.animating=!1;const A=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});e.wrapperEl.dispatchEvent(A)})})}}function NF(o){let{swiper:e,extendParams:t,on:i}=o;t({fadeEffect:{crossFade:!1}}),Ql({effect:"fade",swiper:e,on:i,setTranslate:()=>{const{slides:u}=e,d=e.params.fadeEffect;for(let p=0;p<u.length;p+=1){const m=e.slides[p];let _=-m.swiperSlideOffset;e.params.virtualTranslate||(_-=e.translate);let b=0;e.isHorizontal()||(b=_,_=0);const w=e.params.fadeEffect.crossFade?Math.max(1-Math.abs(m.progress),0):1+Math.min(Math.max(m.progress,-1),0),E=Hu(d,m);E.style.opacity=w,E.style.transform=`translate3d(${_}px, ${b}px, 0px)`}},setTransition:u=>{const d=e.slides.map(p=>to(p));d.forEach(p=>{p.style.transitionDuration=`${u}ms`}),Vf({swiper:e,duration:u,transformElements:d,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})}function OF(o){let{swiper:e,extendParams:t,on:i}=o;t({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const a=(p,m,A)=>{let _=A?p.querySelector(".swiper-slide-shadow-left"):p.querySelector(".swiper-slide-shadow-top"),b=A?p.querySelector(".swiper-slide-shadow-right"):p.querySelector(".swiper-slide-shadow-bottom");_||(_=Pn("div",`swiper-slide-shadow-cube swiper-slide-shadow-${A?"left":"top"}`.split(" ")),p.append(_)),b||(b=Pn("div",`swiper-slide-shadow-cube swiper-slide-shadow-${A?"right":"bottom"}`.split(" ")),p.append(b)),_&&(_.style.opacity=Math.max(-m,0)),b&&(b.style.opacity=Math.max(m,0))};Ql({effect:"cube",swiper:e,on:i,setTranslate:()=>{const{el:p,wrapperEl:m,slides:A,width:_,height:b,rtlTranslate:w,size:E,browser:C}=e,T=Hf(e),x=e.params.cubeEffect,P=e.isHorizontal(),M=e.virtual&&e.params.virtual.enabled;let B=0,D;x.shadow&&(P?(D=e.wrapperEl.querySelector(".swiper-cube-shadow"),D||(D=Pn("div","swiper-cube-shadow"),e.wrapperEl.append(D)),D.style.height=`${_}px`):(D=p.querySelector(".swiper-cube-shadow"),D||(D=Pn("div","swiper-cube-shadow"),p.append(D))));for(let U=0;U<A.length;U+=1){const V=A[U];let k=U;M&&(k=parseInt(V.getAttribute("data-swiper-slide-index"),10));let z=k*90,Q=Math.floor(z/360);w&&(z=-z,Q=Math.floor(-z/360));const Z=Math.max(Math.min(V.progress,1),-1);let K=0,s=0,H=0;k%4===0?(K=-Q*4*E,H=0):(k-1)%4===0?(K=0,H=-Q*4*E):(k-2)%4===0?(K=E+Q*4*E,H=E):(k-3)%4===0&&(K=-E,H=3*E+E*4*Q),w&&(K=-K),P||(s=K,K=0);const y=`rotateX(${T(P?0:-z)}deg) rotateY(${T(P?z:0)}deg) translate3d(${K}px, ${s}px, ${H}px)`;Z<=1&&Z>-1&&(B=k*90+Z*90,w&&(B=-k*90-Z*90)),V.style.transform=y,x.slideShadows&&a(V,Z,P)}if(m.style.transformOrigin=`50% 50% -${E/2}px`,m.style["-webkit-transform-origin"]=`50% 50% -${E/2}px`,x.shadow)if(P)D.style.transform=`translate3d(0px, ${_/2+x.shadowOffset}px, ${-_/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${x.shadowScale})`;else{const U=Math.abs(B)-Math.floor(Math.abs(B)/90)*90,V=1.5-(Math.sin(U*2*Math.PI/360)/2+Math.cos(U*2*Math.PI/360)/2),k=x.shadowScale,z=x.shadowScale/V,Q=x.shadowOffset;D.style.transform=`scale3d(${k}, 1, ${z}) translate3d(0px, ${b/2+Q}px, ${-b/2/z}px) rotateX(-89.99deg)`}const G=(C.isSafari||C.isWebView)&&C.needPerspectiveFix?-E/2:0;m.style.transform=`translate3d(0px,0,${G}px) rotateX(${T(e.isHorizontal()?0:B)}deg) rotateY(${T(e.isHorizontal()?-B:0)}deg)`,m.style.setProperty("--swiper-cube-translate-z",`${G}px`)},setTransition:p=>{const{el:m,slides:A}=e;if(A.forEach(_=>{_.style.transitionDuration=`${p}ms`,_.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(b=>{b.style.transitionDuration=`${p}ms`})}),e.params.cubeEffect.shadow&&!e.isHorizontal()){const _=m.querySelector(".swiper-cube-shadow");_&&(_.style.transitionDuration=`${p}ms`)}},recreateShadows:()=>{const p=e.isHorizontal();e.slides.forEach(m=>{const A=Math.max(Math.min(m.progress,1),-1);a(m,A,p)})},getEffectParams:()=>e.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})}function Nl(o,e,t){const i=`swiper-slide-shadow${t?`-${t}`:""}${o?` swiper-slide-shadow-${o}`:""}`,a=to(e);let l=a.querySelector(`.${i.split(" ").join(".")}`);return l||(l=Pn("div",i.split(" ")),a.append(l)),l}function kF(o){let{swiper:e,extendParams:t,on:i}=o;t({flipEffect:{slideShadows:!0,limitRotation:!0}});const a=(p,m)=>{let A=e.isHorizontal()?p.querySelector(".swiper-slide-shadow-left"):p.querySelector(".swiper-slide-shadow-top"),_=e.isHorizontal()?p.querySelector(".swiper-slide-shadow-right"):p.querySelector(".swiper-slide-shadow-bottom");A||(A=Nl("flip",p,e.isHorizontal()?"left":"top")),_||(_=Nl("flip",p,e.isHorizontal()?"right":"bottom")),A&&(A.style.opacity=Math.max(-m,0)),_&&(_.style.opacity=Math.max(m,0))};Ql({effect:"flip",swiper:e,on:i,setTranslate:()=>{const{slides:p,rtlTranslate:m}=e,A=e.params.flipEffect,_=Hf(e);for(let b=0;b<p.length;b+=1){const w=p[b];let E=w.progress;e.params.flipEffect.limitRotation&&(E=Math.max(Math.min(w.progress,1),-1));const C=w.swiperSlideOffset;let x=-180*E,P=0,M=e.params.cssMode?-C-e.translate:-C,B=0;e.isHorizontal()?m&&(x=-x):(B=M,M=0,P=-x,x=0),w.style.zIndex=-Math.abs(Math.round(E))+p.length,A.slideShadows&&a(w,E);const D=`translate3d(${M}px, ${B}px, 0px) rotateX(${_(P)}deg) rotateY(${_(x)}deg)`,G=Hu(A,w);G.style.transform=D}},setTransition:p=>{const m=e.slides.map(A=>to(A));m.forEach(A=>{A.style.transitionDuration=`${p}ms`,A.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(_=>{_.style.transitionDuration=`${p}ms`})}),Vf({swiper:e,duration:p,transformElements:m})},recreateShadows:()=>{e.params.flipEffect,e.slides.forEach(p=>{let m=p.progress;e.params.flipEffect.limitRotation&&(m=Math.max(Math.min(p.progress,1),-1)),a(p,m)})},getEffectParams:()=>e.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})}function UF(o){let{swiper:e,extendParams:t,on:i}=o;t({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),Ql({effect:"coverflow",swiper:e,on:i,setTranslate:()=>{const{width:u,height:d,slides:p,slidesSizesGrid:m}=e,A=e.params.coverflowEffect,_=e.isHorizontal(),b=e.translate,w=_?-b+u/2:-b+d/2,E=_?A.rotate:-A.rotate,C=A.depth,T=Hf(e);for(let x=0,P=p.length;x<P;x+=1){const M=p[x],B=m[x],D=M.swiperSlideOffset,G=(w-D-B/2)/B,U=typeof A.modifier=="function"?A.modifier(G):G*A.modifier;let V=_?E*U:0,k=_?0:E*U,z=-C*Math.abs(U),Q=A.stretch;typeof Q=="string"&&Q.indexOf("%")!==-1&&(Q=parseFloat(A.stretch)/100*B);let Z=_?0:Q*U,K=_?Q*U:0,s=1-(1-A.scale)*Math.abs(U);Math.abs(K)<.001&&(K=0),Math.abs(Z)<.001&&(Z=0),Math.abs(z)<.001&&(z=0),Math.abs(V)<.001&&(V=0),Math.abs(k)<.001&&(k=0),Math.abs(s)<.001&&(s=0);const H=`translate3d(${K}px,${Z}px,${z}px) rotateX(${T(k)}deg) rotateY(${T(V)}deg) scale(${s})`,y=Hu(A,M);if(y.style.transform=H,M.style.zIndex=-Math.abs(Math.round(U))+1,A.slideShadows){let ee=_?M.querySelector(".swiper-slide-shadow-left"):M.querySelector(".swiper-slide-shadow-top"),I=_?M.querySelector(".swiper-slide-shadow-right"):M.querySelector(".swiper-slide-shadow-bottom");ee||(ee=Nl("coverflow",M,_?"left":"top")),I||(I=Nl("coverflow",M,_?"right":"bottom")),ee&&(ee.style.opacity=U>0?U:0),I&&(I.style.opacity=-U>0?-U:0)}}},setTransition:u=>{e.slides.map(p=>to(p)).forEach(p=>{p.style.transitionDuration=`${u}ms`,p.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(m=>{m.style.transitionDuration=`${u}ms`})})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})}function FF(o){let{swiper:e,extendParams:t,on:i}=o;t({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const a=d=>typeof d=="string"?d:`${d}px`;Ql({effect:"creative",swiper:e,on:i,setTranslate:()=>{const{slides:d,wrapperEl:p,slidesSizesGrid:m}=e,A=e.params.creativeEffect,{progressMultiplier:_}=A,b=e.params.centeredSlides,w=Hf(e);if(b){const E=m[0]/2-e.params.slidesOffsetBefore||0;p.style.transform=`translateX(calc(50% - ${E}px))`}for(let E=0;E<d.length;E+=1){const C=d[E],T=C.progress,x=Math.min(Math.max(C.progress,-A.limitProgress),A.limitProgress);let P=x;b||(P=Math.min(Math.max(C.originalProgress,-A.limitProgress),A.limitProgress));const M=C.swiperSlideOffset,B=[e.params.cssMode?-M-e.translate:-M,0,0],D=[0,0,0];let G=!1;e.isHorizontal()||(B[1]=B[0],B[0]=0);let U={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};x<0?(U=A.next,G=!0):x>0&&(U=A.prev,G=!0),B.forEach((s,H)=>{B[H]=`calc(${s}px + (${a(U.translate[H])} * ${Math.abs(x*_)}))`}),D.forEach((s,H)=>{let y=U.rotate[H]*Math.abs(x*_);D[H]=y}),C.style.zIndex=-Math.abs(Math.round(T))+d.length;const V=B.join(", "),k=`rotateX(${w(D[0])}deg) rotateY(${w(D[1])}deg) rotateZ(${w(D[2])}deg)`,z=P<0?`scale(${1+(1-U.scale)*P*_})`:`scale(${1-(1-U.scale)*P*_})`,Q=P<0?1+(1-U.opacity)*P*_:1-(1-U.opacity)*P*_,Z=`translate3d(${V}) ${k} ${z}`;if(G&&U.shadow||!G){let s=C.querySelector(".swiper-slide-shadow");if(!s&&U.shadow&&(s=Nl("creative",C)),s){const H=A.shadowPerProgress?x*(1/A.limitProgress):x;s.style.opacity=Math.min(Math.max(Math.abs(H),0),1)}}const K=Hu(A,C);K.style.transform=Z,K.style.opacity=Q,U.origin&&(K.style.transformOrigin=U.origin)}},setTransition:d=>{const p=e.slides.map(m=>to(m));p.forEach(m=>{m.style.transitionDuration=`${d}ms`,m.querySelectorAll(".swiper-slide-shadow").forEach(A=>{A.style.transitionDuration=`${d}ms`})}),Vf({swiper:e,duration:d,transformElements:p,allSlides:!0})},perspective:()=>e.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!e.params.cssMode})})}function $F(o){let{swiper:e,extendParams:t,on:i}=o;t({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}}),Ql({effect:"cards",swiper:e,on:i,setTranslate:()=>{const{slides:u,activeIndex:d,rtlTranslate:p}=e,m=e.params.cardsEffect,{startTranslate:A,isTouched:_}=e.touchEventsData,b=p?-e.translate:e.translate;for(let w=0;w<u.length;w+=1){const E=u[w],C=E.progress,T=Math.min(Math.max(C,-4),4);let x=E.swiperSlideOffset;e.params.centeredSlides&&!e.params.cssMode&&(e.wrapperEl.style.transform=`translateX(${e.minTranslate()}px)`),e.params.centeredSlides&&e.params.cssMode&&(x-=u[0].swiperSlideOffset);let P=e.params.cssMode?-x-e.translate:-x,M=0;const B=-100*Math.abs(T);let D=1,G=-m.perSlideRotate*T,U=m.perSlideOffset-Math.abs(T)*.75;const V=e.virtual&&e.params.virtual.enabled?e.virtual.from+w:w,k=(V===d||V===d-1)&&T>0&&T<1&&(_||e.params.cssMode)&&b<A,z=(V===d||V===d+1)&&T<0&&T>-1&&(_||e.params.cssMode)&&b>A;if(k||z){const s=(1-Math.abs((Math.abs(T)-.5)/.5))**.5;G+=-28*T*s,D+=-.5*s,U+=96*s,M=`${-25*s*Math.abs(T)}%`}if(T<0?P=`calc(${P}px ${p?"-":"+"} (${U*Math.abs(T)}%))`:T>0?P=`calc(${P}px ${p?"-":"+"} (-${U*Math.abs(T)}%))`:P=`${P}px`,!e.isHorizontal()){const s=M;M=P,P=s}const Q=T<0?`${1+(1-D)*T}`:`${1-(1-D)*T}`,Z=`
|
|
4894
4894
|
translate3d(${P}, ${M}, ${B}px)
|
|
4895
4895
|
rotateZ(${m.rotate?p?-G:G:0}deg)
|
|
4896
4896
|
scale(${Q})
|
|
@@ -5214,7 +5214,7 @@ ${l.join(`
|
|
|
5214
5214
|
|
|
5215
5215
|
<slot></slot>
|
|
5216
5216
|
<div class="expand-button">EXPAND</div>
|
|
5217
|
-
`}}g_([he({attribute:Ru.label.name})],Vu.prototype,"label");g_([he({attribute:Ru.imgSrc.name})],Vu.prototype,"imgSrc");g_([he({attribute:Ru.state.name})],Vu.prototype,"state");window.customElements.get($v)||window.customElements.define($v,Vu);/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */const{entries:_C,setPrototypeOf:zv,isFrozen:n$,getPrototypeOf:s$,getOwnPropertyDescriptor:r$}=Object;let{freeze:fn,seal:Xn,create:yC}=Object,{apply:WA,construct:YA}=typeof Reflect<"u"&&Reflect;fn||(fn=function(e){return e});Xn||(Xn=function(e){return e});WA||(WA=function(e,t){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l<i;l++)a[l-2]=arguments[l];return e.apply(t,a)});YA||(YA=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];return new e(...i)});const $h=pn(Array.prototype.forEach),a$=pn(Array.prototype.lastIndexOf),Gv=pn(Array.prototype.pop),Ec=pn(Array.prototype.push),o$=pn(Array.prototype.splice),Md=pn(String.prototype.toLowerCase),Cm=pn(String.prototype.toString),Tm=pn(String.prototype.match),xc=pn(String.prototype.replace),l$=pn(String.prototype.indexOf),c$=pn(String.prototype.trim),rs=pn(Object.prototype.hasOwnProperty),sn=pn(RegExp.prototype.test),Sc=u$(TypeError);function pn(o){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];return WA(o,e,i)}}function u$(o){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return YA(o,t)}}function mt(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Md;zv&&zv(o,null);let i=e.length;for(;i--;){let a=e[i];if(typeof a=="string"){const l=t(a);l!==a&&(n$(e)||(e[i]=l),a=l)}o[a]=!0}return o}function h$(o){for(let e=0;e<o.length;e++)rs(o,e)||(o[e]=null);return o}function Js(o){const e=yC(null);for(const[t,i]of _C(o))rs(o,t)&&(Array.isArray(i)?e[t]=h$(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=Js(i):e[t]=i);return e}function Cc(o,e){for(;o!==null;){const i=r$(o,e);if(i){if(i.get)return pn(i.get);if(typeof i.value=="function")return pn(i.value)}o=s$(o)}function t(){return null}return t}const Hv=fn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Im=fn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mm=fn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),d$=fn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Rm=fn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),f$=fn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vv=fn(["#text"]),Qv=fn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Bm=fn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jv=fn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zh=fn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),p$=Xn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),m$=Xn(/<%[\w\W]*|[\w\W]*%>/gm),g$=Xn(/\$\{[\w\W]*/gm),A$=Xn(/^data-[\-\w.\u00B7-\uFFFF]+$/),_$=Xn(/^aria-[\-\w]+$/),bC=Xn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),y$=Xn(/^(?:\w+script|data):/i),b$=Xn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vC=Xn(/^html$/i),v$=Xn(/^[a-z][.\w]*(-[.\w]+)+$/i);var qv=Object.freeze({__proto__:null,ARIA_ATTR:_$,ATTR_WHITESPACE:b$,CUSTOM_ELEMENT:v$,DATA_ATTR:A$,DOCTYPE_NAME:vC,ERB_EXPR:m$,IS_ALLOWED_URI:bC,IS_SCRIPT_OR_DATA:y$,MUSTACHE_EXPR:p$,TMPLIT_EXPR:g$});const Tc={element:1,text:3,progressingInstruction:7,comment:8,document:9},w$=function(){return typeof window>"u"?null:window},E$=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(i=t.getAttribute(a));const l="dompurify"+(i?"#"+i:"");try{return e.createPolicy(l,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},Wv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function wC(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w$();const e=We=>wC(We);if(e.version="3.2.7",e.removed=[],!o||!o.document||o.document.nodeType!==Tc.document||!o.Element)return e.isSupported=!1,e;let{document:t}=o;const i=t,a=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:u,Node:d,Element:p,NodeFilter:m,NamedNodeMap:A=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:_,DOMParser:b,trustedTypes:w}=o,E=p.prototype,C=Cc(E,"cloneNode"),T=Cc(E,"remove"),x=Cc(E,"nextSibling"),P=Cc(E,"childNodes"),M=Cc(E,"parentNode");if(typeof u=="function"){const We=t.createElement("template");We.content&&We.content.ownerDocument&&(t=We.content.ownerDocument)}let B,D="";const{implementation:G,createNodeIterator:U,createDocumentFragment:V,getElementsByTagName:k}=t,{importNode:z}=i;let Q=Wv();e.isSupported=typeof _C=="function"&&typeof M=="function"&&G&&G.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Z,ERB_EXPR:K,TMPLIT_EXPR:s,DATA_ATTR:H,ARIA_ATTR:y,IS_SCRIPT_OR_DATA:ee,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:re}=qv;let{IS_ALLOWED_URI:Ae}=qv,N=null;const n=mt({},[...Hv,...Im,...Mm,...Rm,...Vv]);let r=null;const c=mt({},[...Qv,...Bm,...jv,...zh]);let h=Object.seal(yC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),f=null,g=null,v=!0,S=!0,R=!1,L=!0,F=!1,$=!0,O=!1,W=!1,Y=!1,te=!1,X=!1,ie=!1,de=!0,q=!1;const j="user-content-";let ae=!0,ge=!1,fe={},ue=null;const ve=mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Re=null;const Le=mt({},["audio","video","img","source","image","track"]);let Xe=null;const xe=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pe="http://www.w3.org/1998/Math/MathML",Ie="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let Ne=Ue,et=!1,Ke=null;const pt=mt({},[Pe,Ie,Ue],Cm);let ne=mt({},["mi","mo","mn","ms","mtext"]),Oe=mt({},["annotation-xml"]);const ye=mt({},["title","style","font","a","script"]);let we=null;const ze=["application/xhtml+xml","text/html"],$e="text/html";let qe=null,Ot=null;const wi=t.createElement("form"),Ct=function(le){return le instanceof RegExp||le instanceof Function},Zi=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ot&&Ot===le)){if((!le||typeof le!="object")&&(le={}),le=Js(le),we=ze.indexOf(le.PARSER_MEDIA_TYPE)===-1?$e:le.PARSER_MEDIA_TYPE,qe=we==="application/xhtml+xml"?Cm:Md,N=rs(le,"ALLOWED_TAGS")?mt({},le.ALLOWED_TAGS,qe):n,r=rs(le,"ALLOWED_ATTR")?mt({},le.ALLOWED_ATTR,qe):c,Ke=rs(le,"ALLOWED_NAMESPACES")?mt({},le.ALLOWED_NAMESPACES,Cm):pt,Xe=rs(le,"ADD_URI_SAFE_ATTR")?mt(Js(xe),le.ADD_URI_SAFE_ATTR,qe):xe,Re=rs(le,"ADD_DATA_URI_TAGS")?mt(Js(Le),le.ADD_DATA_URI_TAGS,qe):Le,ue=rs(le,"FORBID_CONTENTS")?mt({},le.FORBID_CONTENTS,qe):ve,f=rs(le,"FORBID_TAGS")?mt({},le.FORBID_TAGS,qe):Js({}),g=rs(le,"FORBID_ATTR")?mt({},le.FORBID_ATTR,qe):Js({}),fe=rs(le,"USE_PROFILES")?le.USE_PROFILES:!1,v=le.ALLOW_ARIA_ATTR!==!1,S=le.ALLOW_DATA_ATTR!==!1,R=le.ALLOW_UNKNOWN_PROTOCOLS||!1,L=le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=le.SAFE_FOR_TEMPLATES||!1,$=le.SAFE_FOR_XML!==!1,O=le.WHOLE_DOCUMENT||!1,te=le.RETURN_DOM||!1,X=le.RETURN_DOM_FRAGMENT||!1,ie=le.RETURN_TRUSTED_TYPE||!1,Y=le.FORCE_BODY||!1,de=le.SANITIZE_DOM!==!1,q=le.SANITIZE_NAMED_PROPS||!1,ae=le.KEEP_CONTENT!==!1,ge=le.IN_PLACE||!1,Ae=le.ALLOWED_URI_REGEXP||bC,Ne=le.NAMESPACE||Ue,ne=le.MATHML_TEXT_INTEGRATION_POINTS||ne,Oe=le.HTML_INTEGRATION_POINTS||Oe,h=le.CUSTOM_ELEMENT_HANDLING||{},le.CUSTOM_ELEMENT_HANDLING&&Ct(le.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(h.tagNameCheck=le.CUSTOM_ELEMENT_HANDLING.tagNameCheck),le.CUSTOM_ELEMENT_HANDLING&&Ct(le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(h.attributeNameCheck=le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),le.CUSTOM_ELEMENT_HANDLING&&typeof le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(h.allowCustomizedBuiltInElements=le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),F&&(S=!1),X&&(te=!0),fe&&(N=mt({},Vv),r=[],fe.html===!0&&(mt(N,Hv),mt(r,Qv)),fe.svg===!0&&(mt(N,Im),mt(r,Bm),mt(r,zh)),fe.svgFilters===!0&&(mt(N,Mm),mt(r,Bm),mt(r,zh)),fe.mathMl===!0&&(mt(N,Rm),mt(r,jv),mt(r,zh))),le.ADD_TAGS&&(N===n&&(N=Js(N)),mt(N,le.ADD_TAGS,qe)),le.ADD_ATTR&&(r===c&&(r=Js(r)),mt(r,le.ADD_ATTR,qe)),le.ADD_URI_SAFE_ATTR&&mt(Xe,le.ADD_URI_SAFE_ATTR,qe),le.FORBID_CONTENTS&&(ue===ve&&(ue=Js(ue)),mt(ue,le.FORBID_CONTENTS,qe)),ae&&(N["#text"]=!0),O&&mt(N,["html","head","body"]),N.table&&(mt(N,["tbody"]),delete f.tbody),le.TRUSTED_TYPES_POLICY){if(typeof le.TRUSTED_TYPES_POLICY.createHTML!="function")throw Sc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');B=le.TRUSTED_TYPES_POLICY,D=B.createHTML("")}else B===void 0&&(B=E$(w,a)),B!==null&&typeof D=="string"&&(D=B.createHTML(""));fn&&fn(le),Ot=le}},Nn=mt({},[...Im,...Mm,...d$]),Kl=mt({},[...Rm,...f$]),Ku=function(le){let Be=M(le);(!Be||!Be.tagName)&&(Be={namespaceURI:Ne,tagName:"template"});const J=Md(le.tagName),oe=Md(Be.tagName);return Ke[le.namespaceURI]?le.namespaceURI===Ie?Be.namespaceURI===Ue?J==="svg":Be.namespaceURI===Pe?J==="svg"&&(oe==="annotation-xml"||ne[oe]):!!Nn[J]:le.namespaceURI===Pe?Be.namespaceURI===Ue?J==="math":Be.namespaceURI===Ie?J==="math"&&Oe[oe]:!!Kl[J]:le.namespaceURI===Ue?Be.namespaceURI===Ie&&!Oe[oe]||Be.namespaceURI===Pe&&!ne[oe]?!1:!Kl[J]&&(ye[J]||!Nn[J]):!!(we==="application/xhtml+xml"&&Ke[le.namespaceURI]):!1},Ei=function(le){Ec(e.removed,{element:le});try{M(le).removeChild(le)}catch{T(le)}},Jn=function(le,Be){try{Ec(e.removed,{attribute:Be.getAttributeNode(le),from:Be})}catch{Ec(e.removed,{attribute:null,from:Be})}if(Be.removeAttribute(le),le==="is")if(te||X)try{Ei(Be)}catch{}else try{Be.setAttribute(le,"")}catch{}},Jl=function(le){let Be=null,J=null;if(Y)le="<remove></remove>"+le;else{const me=Tm(le,/^[\r\n\t ]+/);J=me&&me[0]}we==="application/xhtml+xml"&&Ne===Ue&&(le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+le+"</body></html>");const oe=B?B.createHTML(le):le;if(Ne===Ue)try{Be=new b().parseFromString(oe,we)}catch{}if(!Be||!Be.documentElement){Be=G.createDocument(Ne,"template",null);try{Be.documentElement.innerHTML=et?D:oe}catch{}}const pe=Be.body||Be.documentElement;return le&&J&&pe.insertBefore(t.createTextNode(J),pe.childNodes[0]||null),Ne===Ue?k.call(Be,O?"html":"body")[0]:O?Be.documentElement:pe},Zl=function(le){return U.call(le.ownerDocument||le,le,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},dr=function(le){return le instanceof _&&(typeof le.nodeName!="string"||typeof le.textContent!="string"||typeof le.removeChild!="function"||!(le.attributes instanceof A)||typeof le.removeAttribute!="function"||typeof le.setAttribute!="function"||typeof le.namespaceURI!="string"||typeof le.insertBefore!="function"||typeof le.hasChildNodes!="function")},ec=function(le){return typeof d=="function"&&le instanceof d};function gn(We,le,Be){$h(We,J=>{J.call(e,le,Be,Ot)})}const tc=function(le){let Be=null;if(gn(Q.beforeSanitizeElements,le,null),dr(le))return Ei(le),!0;const J=qe(le.nodeName);if(gn(Q.uponSanitizeElement,le,{tagName:J,allowedTags:N}),$&&le.hasChildNodes()&&!ec(le.firstElementChild)&&sn(/<[/\w!]/g,le.innerHTML)&&sn(/<[/\w!]/g,le.textContent)||le.nodeType===Tc.progressingInstruction||$&&le.nodeType===Tc.comment&&sn(/<[/\w]/g,le.data))return Ei(le),!0;if(!N[J]||f[J]){if(!f[J]&&Ju(J)&&(h.tagNameCheck instanceof RegExp&&sn(h.tagNameCheck,J)||h.tagNameCheck instanceof Function&&h.tagNameCheck(J)))return!1;if(ae&&!ue[J]){const oe=M(le)||le.parentNode,pe=P(le)||le.childNodes;if(pe&&oe){const me=pe.length;for(let ce=me-1;ce>=0;--ce){const Ce=C(pe[ce],!0);Ce.__removalCount=(le.__removalCount||0)+1,oe.insertBefore(Ce,x(le))}}}return Ei(le),!0}return le instanceof p&&!Ku(le)||(J==="noscript"||J==="noembed"||J==="noframes")&&sn(/<\/no(script|embed|frames)/i,le.innerHTML)?(Ei(le),!0):(F&&le.nodeType===Tc.text&&(Be=le.textContent,$h([Z,K,s],oe=>{Be=xc(Be,oe," ")}),le.textContent!==Be&&(Ec(e.removed,{element:le.cloneNode()}),le.textContent=Be)),gn(Q.afterSanitizeElements,le,null),!1)},ic=function(le,Be,J){if(de&&(Be==="id"||Be==="name")&&(J in t||J in wi))return!1;if(!(S&&!g[Be]&&sn(H,Be))){if(!(v&&sn(y,Be))){if(!r[Be]||g[Be]){if(!(Ju(le)&&(h.tagNameCheck instanceof RegExp&&sn(h.tagNameCheck,le)||h.tagNameCheck instanceof Function&&h.tagNameCheck(le))&&(h.attributeNameCheck instanceof RegExp&&sn(h.attributeNameCheck,Be)||h.attributeNameCheck instanceof Function&&h.attributeNameCheck(Be,le))||Be==="is"&&h.allowCustomizedBuiltInElements&&(h.tagNameCheck instanceof RegExp&&sn(h.tagNameCheck,J)||h.tagNameCheck instanceof Function&&h.tagNameCheck(J))))return!1}else if(!Xe[Be]){if(!sn(Ae,xc(J,I,""))){if(!((Be==="src"||Be==="xlink:href"||Be==="href")&&le!=="script"&&l$(J,"data:")===0&&Re[le])){if(!(R&&!sn(ee,xc(J,I,"")))){if(J)return!1}}}}}}return!0},Ju=function(le){return le!=="annotation-xml"&&Tm(le,re)},Zu=function(le){gn(Q.beforeSanitizeAttributes,le,null);const{attributes:Be}=le;if(!Be||dr(le))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:r,forceKeepAttr:void 0};let oe=Be.length;for(;oe--;){const pe=Be[oe],{name:me,namespaceURI:ce,value:Ce}=pe,ke=qe(me),He=Ce;let De=me==="value"?He:c$(He);if(J.attrName=ke,J.attrValue=De,J.keepAttr=!0,J.forceKeepAttr=void 0,gn(Q.uponSanitizeAttribute,le,J),De=J.attrValue,q&&(ke==="id"||ke==="name")&&(Jn(me,le),De=j+De),$&&sn(/((--!?|])>)|<\/(style|title|textarea)/i,De)){Jn(me,le);continue}if(ke==="attributename"&&Tm(De,"href")){Jn(me,le);continue}if(J.forceKeepAttr)continue;if(!J.keepAttr){Jn(me,le);continue}if(!L&&sn(/\/>/i,De)){Jn(me,le);continue}F&&$h([Z,K,s],st=>{De=xc(De,st," ")});const it=qe(le.nodeName);if(!ic(it,ke,De)){Jn(me,le);continue}if(B&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!ce)switch(w.getAttributeType(it,ke)){case"TrustedHTML":{De=B.createHTML(De);break}case"TrustedScriptURL":{De=B.createScriptURL(De);break}}if(De!==He)try{ce?le.setAttributeNS(ce,me,De):le.setAttribute(me,De),dr(le)?Ei(le):Gv(e.removed)}catch{Jn(me,le)}}gn(Q.afterSanitizeAttributes,le,null)},ep=function We(le){let Be=null;const J=Zl(le);for(gn(Q.beforeSanitizeShadowDOM,le,null);Be=J.nextNode();)gn(Q.uponSanitizeShadowNode,Be,null),tc(Be),Zu(Be),Be.content instanceof l&&We(Be.content);gn(Q.afterSanitizeShadowDOM,le,null)};return e.sanitize=function(We){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=null,J=null,oe=null,pe=null;if(et=!We,et&&(We="<!-->"),typeof We!="string"&&!ec(We))if(typeof We.toString=="function"){if(We=We.toString(),typeof We!="string")throw Sc("dirty is not a string, aborting")}else throw Sc("toString is not a function");if(!e.isSupported)return We;if(W||Zi(le),e.removed=[],typeof We=="string"&&(ge=!1),ge){if(We.nodeName){const Ce=qe(We.nodeName);if(!N[Ce]||f[Ce])throw Sc("root node is forbidden and cannot be sanitized in-place")}}else if(We instanceof d)Be=Jl("<!---->"),J=Be.ownerDocument.importNode(We,!0),J.nodeType===Tc.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?Be=J:Be.appendChild(J);else{if(!te&&!F&&!O&&We.indexOf("<")===-1)return B&&ie?B.createHTML(We):We;if(Be=Jl(We),!Be)return te?null:ie?D:""}Be&&Y&&Ei(Be.firstChild);const me=Zl(ge?We:Be);for(;oe=me.nextNode();)tc(oe),Zu(oe),oe.content instanceof l&&ep(oe.content);if(ge)return We;if(te){if(X)for(pe=V.call(Be.ownerDocument);Be.firstChild;)pe.appendChild(Be.firstChild);else pe=Be;return(r.shadowroot||r.shadowrootmode)&&(pe=z.call(i,pe,!0)),pe}let ce=O?Be.outerHTML:Be.innerHTML;return O&&N["!doctype"]&&Be.ownerDocument&&Be.ownerDocument.doctype&&Be.ownerDocument.doctype.name&&sn(vC,Be.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+Be.ownerDocument.doctype.name+`>
|
|
5217
|
+
`}}g_([he({attribute:Ru.label.name})],Vu.prototype,"label");g_([he({attribute:Ru.imgSrc.name})],Vu.prototype,"imgSrc");g_([he({attribute:Ru.state.name})],Vu.prototype,"state");window.customElements.get($v)||window.customElements.define($v,Vu);/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */const{entries:_C,setPrototypeOf:zv,isFrozen:n$,getPrototypeOf:s$,getOwnPropertyDescriptor:r$}=Object;let{freeze:fn,seal:Xn,create:yC}=Object,{apply:WA,construct:YA}=typeof Reflect<"u"&&Reflect;fn||(fn=function(e){return e});Xn||(Xn=function(e){return e});WA||(WA=function(e,t){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l<i;l++)a[l-2]=arguments[l];return e.apply(t,a)});YA||(YA=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];return new e(...i)});const $h=pn(Array.prototype.forEach),a$=pn(Array.prototype.lastIndexOf),Gv=pn(Array.prototype.pop),Ec=pn(Array.prototype.push),o$=pn(Array.prototype.splice),Md=pn(String.prototype.toLowerCase),Cm=pn(String.prototype.toString),Tm=pn(String.prototype.match),xc=pn(String.prototype.replace),l$=pn(String.prototype.indexOf),c$=pn(String.prototype.trim),rs=pn(Object.prototype.hasOwnProperty),sn=pn(RegExp.prototype.test),Sc=u$(TypeError);function pn(o){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];return WA(o,e,i)}}function u$(o){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return YA(o,t)}}function gt(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Md;zv&&zv(o,null);let i=e.length;for(;i--;){let a=e[i];if(typeof a=="string"){const l=t(a);l!==a&&(n$(e)||(e[i]=l),a=l)}o[a]=!0}return o}function h$(o){for(let e=0;e<o.length;e++)rs(o,e)||(o[e]=null);return o}function Js(o){const e=yC(null);for(const[t,i]of _C(o))rs(o,t)&&(Array.isArray(i)?e[t]=h$(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=Js(i):e[t]=i);return e}function Cc(o,e){for(;o!==null;){const i=r$(o,e);if(i){if(i.get)return pn(i.get);if(typeof i.value=="function")return pn(i.value)}o=s$(o)}function t(){return null}return t}const Hv=fn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Im=fn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mm=fn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),d$=fn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Rm=fn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),f$=fn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vv=fn(["#text"]),Qv=fn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Bm=fn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jv=fn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zh=fn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),p$=Xn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),m$=Xn(/<%[\w\W]*|[\w\W]*%>/gm),g$=Xn(/\$\{[\w\W]*/gm),A$=Xn(/^data-[\-\w.\u00B7-\uFFFF]+$/),_$=Xn(/^aria-[\-\w]+$/),bC=Xn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),y$=Xn(/^(?:\w+script|data):/i),b$=Xn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vC=Xn(/^html$/i),v$=Xn(/^[a-z][.\w]*(-[.\w]+)+$/i);var qv=Object.freeze({__proto__:null,ARIA_ATTR:_$,ATTR_WHITESPACE:b$,CUSTOM_ELEMENT:v$,DATA_ATTR:A$,DOCTYPE_NAME:vC,ERB_EXPR:m$,IS_ALLOWED_URI:bC,IS_SCRIPT_OR_DATA:y$,MUSTACHE_EXPR:p$,TMPLIT_EXPR:g$});const Tc={element:1,text:3,progressingInstruction:7,comment:8,document:9},w$=function(){return typeof window>"u"?null:window},E$=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(i=t.getAttribute(a));const l="dompurify"+(i?"#"+i:"");try{return e.createPolicy(l,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},Wv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function wC(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w$();const e=We=>wC(We);if(e.version="3.2.7",e.removed=[],!o||!o.document||o.document.nodeType!==Tc.document||!o.Element)return e.isSupported=!1,e;let{document:t}=o;const i=t,a=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:u,Node:d,Element:p,NodeFilter:m,NamedNodeMap:A=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:_,DOMParser:b,trustedTypes:w}=o,E=p.prototype,C=Cc(E,"cloneNode"),T=Cc(E,"remove"),x=Cc(E,"nextSibling"),P=Cc(E,"childNodes"),M=Cc(E,"parentNode");if(typeof u=="function"){const We=t.createElement("template");We.content&&We.content.ownerDocument&&(t=We.content.ownerDocument)}let B,D="";const{implementation:G,createNodeIterator:U,createDocumentFragment:V,getElementsByTagName:k}=t,{importNode:z}=i;let Q=Wv();e.isSupported=typeof _C=="function"&&typeof M=="function"&&G&&G.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Z,ERB_EXPR:K,TMPLIT_EXPR:s,DATA_ATTR:H,ARIA_ATTR:y,IS_SCRIPT_OR_DATA:ee,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:re}=qv;let{IS_ALLOWED_URI:Ae}=qv,N=null;const n=gt({},[...Hv,...Im,...Mm,...Rm,...Vv]);let r=null;const c=gt({},[...Qv,...Bm,...jv,...zh]);let h=Object.seal(yC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),f=null,g=null,v=!0,S=!0,R=!1,L=!0,F=!1,$=!0,O=!1,W=!1,Y=!1,te=!1,X=!1,ie=!1,de=!0,q=!1;const j="user-content-";let ae=!0,ge=!1,fe={},ue=null;const ve=gt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Re=null;const Le=gt({},["audio","video","img","source","image","track"]);let Xe=null;const xe=gt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pe="http://www.w3.org/1998/Math/MathML",Ie="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml";let Ne=Ue,et=!1,Ke=null;const pt=gt({},[Pe,Ie,Ue],Cm);let ne=gt({},["mi","mo","mn","ms","mtext"]),Oe=gt({},["annotation-xml"]);const ye=gt({},["title","style","font","a","script"]);let we=null;const ze=["application/xhtml+xml","text/html"],$e="text/html";let qe=null,Ot=null;const wi=t.createElement("form"),Ct=function(le){return le instanceof RegExp||le instanceof Function},Zi=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ot&&Ot===le)){if((!le||typeof le!="object")&&(le={}),le=Js(le),we=ze.indexOf(le.PARSER_MEDIA_TYPE)===-1?$e:le.PARSER_MEDIA_TYPE,qe=we==="application/xhtml+xml"?Cm:Md,N=rs(le,"ALLOWED_TAGS")?gt({},le.ALLOWED_TAGS,qe):n,r=rs(le,"ALLOWED_ATTR")?gt({},le.ALLOWED_ATTR,qe):c,Ke=rs(le,"ALLOWED_NAMESPACES")?gt({},le.ALLOWED_NAMESPACES,Cm):pt,Xe=rs(le,"ADD_URI_SAFE_ATTR")?gt(Js(xe),le.ADD_URI_SAFE_ATTR,qe):xe,Re=rs(le,"ADD_DATA_URI_TAGS")?gt(Js(Le),le.ADD_DATA_URI_TAGS,qe):Le,ue=rs(le,"FORBID_CONTENTS")?gt({},le.FORBID_CONTENTS,qe):ve,f=rs(le,"FORBID_TAGS")?gt({},le.FORBID_TAGS,qe):Js({}),g=rs(le,"FORBID_ATTR")?gt({},le.FORBID_ATTR,qe):Js({}),fe=rs(le,"USE_PROFILES")?le.USE_PROFILES:!1,v=le.ALLOW_ARIA_ATTR!==!1,S=le.ALLOW_DATA_ATTR!==!1,R=le.ALLOW_UNKNOWN_PROTOCOLS||!1,L=le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=le.SAFE_FOR_TEMPLATES||!1,$=le.SAFE_FOR_XML!==!1,O=le.WHOLE_DOCUMENT||!1,te=le.RETURN_DOM||!1,X=le.RETURN_DOM_FRAGMENT||!1,ie=le.RETURN_TRUSTED_TYPE||!1,Y=le.FORCE_BODY||!1,de=le.SANITIZE_DOM!==!1,q=le.SANITIZE_NAMED_PROPS||!1,ae=le.KEEP_CONTENT!==!1,ge=le.IN_PLACE||!1,Ae=le.ALLOWED_URI_REGEXP||bC,Ne=le.NAMESPACE||Ue,ne=le.MATHML_TEXT_INTEGRATION_POINTS||ne,Oe=le.HTML_INTEGRATION_POINTS||Oe,h=le.CUSTOM_ELEMENT_HANDLING||{},le.CUSTOM_ELEMENT_HANDLING&&Ct(le.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(h.tagNameCheck=le.CUSTOM_ELEMENT_HANDLING.tagNameCheck),le.CUSTOM_ELEMENT_HANDLING&&Ct(le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(h.attributeNameCheck=le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),le.CUSTOM_ELEMENT_HANDLING&&typeof le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(h.allowCustomizedBuiltInElements=le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),F&&(S=!1),X&&(te=!0),fe&&(N=gt({},Vv),r=[],fe.html===!0&&(gt(N,Hv),gt(r,Qv)),fe.svg===!0&&(gt(N,Im),gt(r,Bm),gt(r,zh)),fe.svgFilters===!0&&(gt(N,Mm),gt(r,Bm),gt(r,zh)),fe.mathMl===!0&&(gt(N,Rm),gt(r,jv),gt(r,zh))),le.ADD_TAGS&&(N===n&&(N=Js(N)),gt(N,le.ADD_TAGS,qe)),le.ADD_ATTR&&(r===c&&(r=Js(r)),gt(r,le.ADD_ATTR,qe)),le.ADD_URI_SAFE_ATTR&>(Xe,le.ADD_URI_SAFE_ATTR,qe),le.FORBID_CONTENTS&&(ue===ve&&(ue=Js(ue)),gt(ue,le.FORBID_CONTENTS,qe)),ae&&(N["#text"]=!0),O&>(N,["html","head","body"]),N.table&&(gt(N,["tbody"]),delete f.tbody),le.TRUSTED_TYPES_POLICY){if(typeof le.TRUSTED_TYPES_POLICY.createHTML!="function")throw Sc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');B=le.TRUSTED_TYPES_POLICY,D=B.createHTML("")}else B===void 0&&(B=E$(w,a)),B!==null&&typeof D=="string"&&(D=B.createHTML(""));fn&&fn(le),Ot=le}},Nn=gt({},[...Im,...Mm,...d$]),Kl=gt({},[...Rm,...f$]),Ku=function(le){let Be=M(le);(!Be||!Be.tagName)&&(Be={namespaceURI:Ne,tagName:"template"});const J=Md(le.tagName),oe=Md(Be.tagName);return Ke[le.namespaceURI]?le.namespaceURI===Ie?Be.namespaceURI===Ue?J==="svg":Be.namespaceURI===Pe?J==="svg"&&(oe==="annotation-xml"||ne[oe]):!!Nn[J]:le.namespaceURI===Pe?Be.namespaceURI===Ue?J==="math":Be.namespaceURI===Ie?J==="math"&&Oe[oe]:!!Kl[J]:le.namespaceURI===Ue?Be.namespaceURI===Ie&&!Oe[oe]||Be.namespaceURI===Pe&&!ne[oe]?!1:!Kl[J]&&(ye[J]||!Nn[J]):!!(we==="application/xhtml+xml"&&Ke[le.namespaceURI]):!1},Ei=function(le){Ec(e.removed,{element:le});try{M(le).removeChild(le)}catch{T(le)}},Jn=function(le,Be){try{Ec(e.removed,{attribute:Be.getAttributeNode(le),from:Be})}catch{Ec(e.removed,{attribute:null,from:Be})}if(Be.removeAttribute(le),le==="is")if(te||X)try{Ei(Be)}catch{}else try{Be.setAttribute(le,"")}catch{}},Jl=function(le){let Be=null,J=null;if(Y)le="<remove></remove>"+le;else{const me=Tm(le,/^[\r\n\t ]+/);J=me&&me[0]}we==="application/xhtml+xml"&&Ne===Ue&&(le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+le+"</body></html>");const oe=B?B.createHTML(le):le;if(Ne===Ue)try{Be=new b().parseFromString(oe,we)}catch{}if(!Be||!Be.documentElement){Be=G.createDocument(Ne,"template",null);try{Be.documentElement.innerHTML=et?D:oe}catch{}}const pe=Be.body||Be.documentElement;return le&&J&&pe.insertBefore(t.createTextNode(J),pe.childNodes[0]||null),Ne===Ue?k.call(Be,O?"html":"body")[0]:O?Be.documentElement:pe},Zl=function(le){return U.call(le.ownerDocument||le,le,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},dr=function(le){return le instanceof _&&(typeof le.nodeName!="string"||typeof le.textContent!="string"||typeof le.removeChild!="function"||!(le.attributes instanceof A)||typeof le.removeAttribute!="function"||typeof le.setAttribute!="function"||typeof le.namespaceURI!="string"||typeof le.insertBefore!="function"||typeof le.hasChildNodes!="function")},ec=function(le){return typeof d=="function"&&le instanceof d};function gn(We,le,Be){$h(We,J=>{J.call(e,le,Be,Ot)})}const tc=function(le){let Be=null;if(gn(Q.beforeSanitizeElements,le,null),dr(le))return Ei(le),!0;const J=qe(le.nodeName);if(gn(Q.uponSanitizeElement,le,{tagName:J,allowedTags:N}),$&&le.hasChildNodes()&&!ec(le.firstElementChild)&&sn(/<[/\w!]/g,le.innerHTML)&&sn(/<[/\w!]/g,le.textContent)||le.nodeType===Tc.progressingInstruction||$&&le.nodeType===Tc.comment&&sn(/<[/\w]/g,le.data))return Ei(le),!0;if(!N[J]||f[J]){if(!f[J]&&Ju(J)&&(h.tagNameCheck instanceof RegExp&&sn(h.tagNameCheck,J)||h.tagNameCheck instanceof Function&&h.tagNameCheck(J)))return!1;if(ae&&!ue[J]){const oe=M(le)||le.parentNode,pe=P(le)||le.childNodes;if(pe&&oe){const me=pe.length;for(let ce=me-1;ce>=0;--ce){const Ce=C(pe[ce],!0);Ce.__removalCount=(le.__removalCount||0)+1,oe.insertBefore(Ce,x(le))}}}return Ei(le),!0}return le instanceof p&&!Ku(le)||(J==="noscript"||J==="noembed"||J==="noframes")&&sn(/<\/no(script|embed|frames)/i,le.innerHTML)?(Ei(le),!0):(F&&le.nodeType===Tc.text&&(Be=le.textContent,$h([Z,K,s],oe=>{Be=xc(Be,oe," ")}),le.textContent!==Be&&(Ec(e.removed,{element:le.cloneNode()}),le.textContent=Be)),gn(Q.afterSanitizeElements,le,null),!1)},ic=function(le,Be,J){if(de&&(Be==="id"||Be==="name")&&(J in t||J in wi))return!1;if(!(S&&!g[Be]&&sn(H,Be))){if(!(v&&sn(y,Be))){if(!r[Be]||g[Be]){if(!(Ju(le)&&(h.tagNameCheck instanceof RegExp&&sn(h.tagNameCheck,le)||h.tagNameCheck instanceof Function&&h.tagNameCheck(le))&&(h.attributeNameCheck instanceof RegExp&&sn(h.attributeNameCheck,Be)||h.attributeNameCheck instanceof Function&&h.attributeNameCheck(Be,le))||Be==="is"&&h.allowCustomizedBuiltInElements&&(h.tagNameCheck instanceof RegExp&&sn(h.tagNameCheck,J)||h.tagNameCheck instanceof Function&&h.tagNameCheck(J))))return!1}else if(!Xe[Be]){if(!sn(Ae,xc(J,I,""))){if(!((Be==="src"||Be==="xlink:href"||Be==="href")&&le!=="script"&&l$(J,"data:")===0&&Re[le])){if(!(R&&!sn(ee,xc(J,I,"")))){if(J)return!1}}}}}}return!0},Ju=function(le){return le!=="annotation-xml"&&Tm(le,re)},Zu=function(le){gn(Q.beforeSanitizeAttributes,le,null);const{attributes:Be}=le;if(!Be||dr(le))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:r,forceKeepAttr:void 0};let oe=Be.length;for(;oe--;){const pe=Be[oe],{name:me,namespaceURI:ce,value:Ce}=pe,ke=qe(me),He=Ce;let De=me==="value"?He:c$(He);if(J.attrName=ke,J.attrValue=De,J.keepAttr=!0,J.forceKeepAttr=void 0,gn(Q.uponSanitizeAttribute,le,J),De=J.attrValue,q&&(ke==="id"||ke==="name")&&(Jn(me,le),De=j+De),$&&sn(/((--!?|])>)|<\/(style|title|textarea)/i,De)){Jn(me,le);continue}if(ke==="attributename"&&Tm(De,"href")){Jn(me,le);continue}if(J.forceKeepAttr)continue;if(!J.keepAttr){Jn(me,le);continue}if(!L&&sn(/\/>/i,De)){Jn(me,le);continue}F&&$h([Z,K,s],st=>{De=xc(De,st," ")});const it=qe(le.nodeName);if(!ic(it,ke,De)){Jn(me,le);continue}if(B&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!ce)switch(w.getAttributeType(it,ke)){case"TrustedHTML":{De=B.createHTML(De);break}case"TrustedScriptURL":{De=B.createScriptURL(De);break}}if(De!==He)try{ce?le.setAttributeNS(ce,me,De):le.setAttribute(me,De),dr(le)?Ei(le):Gv(e.removed)}catch{Jn(me,le)}}gn(Q.afterSanitizeAttributes,le,null)},ep=function We(le){let Be=null;const J=Zl(le);for(gn(Q.beforeSanitizeShadowDOM,le,null);Be=J.nextNode();)gn(Q.uponSanitizeShadowNode,Be,null),tc(Be),Zu(Be),Be.content instanceof l&&We(Be.content);gn(Q.afterSanitizeShadowDOM,le,null)};return e.sanitize=function(We){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=null,J=null,oe=null,pe=null;if(et=!We,et&&(We="<!-->"),typeof We!="string"&&!ec(We))if(typeof We.toString=="function"){if(We=We.toString(),typeof We!="string")throw Sc("dirty is not a string, aborting")}else throw Sc("toString is not a function");if(!e.isSupported)return We;if(W||Zi(le),e.removed=[],typeof We=="string"&&(ge=!1),ge){if(We.nodeName){const Ce=qe(We.nodeName);if(!N[Ce]||f[Ce])throw Sc("root node is forbidden and cannot be sanitized in-place")}}else if(We instanceof d)Be=Jl("<!---->"),J=Be.ownerDocument.importNode(We,!0),J.nodeType===Tc.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?Be=J:Be.appendChild(J);else{if(!te&&!F&&!O&&We.indexOf("<")===-1)return B&&ie?B.createHTML(We):We;if(Be=Jl(We),!Be)return te?null:ie?D:""}Be&&Y&&Ei(Be.firstChild);const me=Zl(ge?We:Be);for(;oe=me.nextNode();)tc(oe),Zu(oe),oe.content instanceof l&&ep(oe.content);if(ge)return We;if(te){if(X)for(pe=V.call(Be.ownerDocument);Be.firstChild;)pe.appendChild(Be.firstChild);else pe=Be;return(r.shadowroot||r.shadowrootmode)&&(pe=z.call(i,pe,!0)),pe}let ce=O?Be.outerHTML:Be.innerHTML;return O&&N["!doctype"]&&Be.ownerDocument&&Be.ownerDocument.doctype&&Be.ownerDocument.doctype.name&&sn(vC,Be.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+Be.ownerDocument.doctype.name+`>
|
|
5218
5218
|
`+ce),F&&$h([Z,K,s],Ce=>{ce=xc(ce,Ce," ")}),B&&ie?B.createHTML(ce):ce},e.setConfig=function(){let We=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zi(We),W=!0},e.clearConfig=function(){Ot=null,W=!1},e.isValidAttribute=function(We,le,Be){Ot||Zi({});const J=qe(We),oe=qe(le);return ic(J,oe,Be)},e.addHook=function(We,le){typeof le=="function"&&Ec(Q[We],le)},e.removeHook=function(We,le){if(le!==void 0){const Be=a$(Q[We],le);return Be===-1?void 0:o$(Q[We],Be,1)[0]}return Gv(Q[We])},e.removeHooks=function(We){Q[We]=[]},e.removeAllHooks=function(){Q=Wv()},e}var x$=wC();/**
|
|
5219
5219
|
* @license
|
|
5220
5220
|
* Copyright 2017 Google LLC
|
|
@@ -5395,7 +5395,7 @@ ${l.join(`
|
|
|
5395
5395
|
position: absolute;
|
|
5396
5396
|
top: 12px;
|
|
5397
5397
|
right: 12px;
|
|
5398
|
-
z-index:
|
|
5398
|
+
z-index: 2;
|
|
5399
5399
|
gap:4px;
|
|
5400
5400
|
padding:8px;
|
|
5401
5401
|
border-radius: 8px;
|
|
@@ -7860,7 +7860,7 @@ canvas {
|
|
|
7860
7860
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7861
7861
|
* See the License for the specific language governing permissions and
|
|
7862
7862
|
* limitations under the License.
|
|
7863
|
-
*/const Dc=Symbol("correlatedSceneGraph");class T4 extends S4{static[wf](e){const t=super[wf](e);t[Dc]==null&&(t[Dc]=Bu.from(t));const{scene:i}=t,a=new bn(void 0,1/0);return i.traverse(l=>{l.renderOrder=1e3,l.frustumCulled=!1,l.name||(l.name=l.uuid);const u=l;if(u.material){const{geometry:d}=u;u.castShadow=!0,u.isSkinnedMesh&&(d.boundingSphere=a,d.boundingBox=null);const p=u.material;if(p.isMeshBasicMaterial===!0&&(p.toneMapped=!1),p.shadowSide=hs,p.aoMap){const{gltf:m,threeObjectMap:A}=t[Dc],_=A.get(p);if(m.materials!=null&&_!=null&&_.materials!=null){const b=m.materials[_.materials];b.occlusionTexture&&b.occlusionTexture.texCoord===0&&d.attributes.uv!=null&&d.setAttribute("uv2",d.attributes.uv)}}}}),t}get correlatedSceneGraph(){return this[As][Dc]}[Ef](){const e=super[Ef](),t=new Map;return e.scene.traverse(i=>{const a=i;if(a.material){const u=a.material;if(u!=null){if(t.has(u.uuid)){a.material=t.get(u.uuid);return}a.material=u.clone(),t.set(u.uuid,a.material)}}const l=i;l.target!==void 0&&l.add(l.target)}),e[Dc]=Bu.from(e,this.correlatedSceneGraph),e}}const ZC=(o,e,t)=>{let i;switch(o){case ui:i=new Uint8ClampedArray(e*t*4);break;case hi:i=new Uint16Array(e*t*4);break;case qr:i=new Uint32Array(e*t*4);break;case C0:i=new Int8Array(e*t*4);break;case T0:i=new Int16Array(e*t*4);break;case Lf:i=new Int32Array(e*t*4);break;case oi:i=new Float32Array(e*t*4);break;default:throw new Error("Unsupported data type")}return i};let id;const I4=(o,e,t,i)=>{if(id!==void 0)return id;const a=new dn(1,1,i);e.setRenderTarget(a);const l=new lt(new Ms,new Pi({color:16777215}));e.render(l,t),e.setRenderTarget(null);const u=ZC(o,a.width,a.height);return e.readRenderTargetPixels(a,0,0,a.width,a.height,u),a.dispose(),l.geometry.dispose(),l.material.dispose(),id=u[0]!==0,id};class y_{constructor(e){var t,i,a,l,u,d,p,m,A,_,b,w,E,C,T,x;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(M){throw this._renderer.setRenderTarget(null),M}this._renderer.setRenderTarget(null)},this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const P={format:Xt,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((t=e.renderTargetOptions)===null||t===void 0?void 0:t.anisotropy)!==void 0?(i=e.renderTargetOptions)===null||i===void 0?void 0:i.anisotropy:1,generateMipmaps:((a=e.renderTargetOptions)===null||a===void 0?void 0:a.generateMipmaps)!==void 0?(l=e.renderTargetOptions)===null||l===void 0?void 0:l.generateMipmaps:!1,magFilter:((u=e.renderTargetOptions)===null||u===void 0?void 0:u.magFilter)!==void 0?(d=e.renderTargetOptions)===null||d===void 0?void 0:d.magFilter:
|
|
7863
|
+
*/const Dc=Symbol("correlatedSceneGraph");class T4 extends S4{static[wf](e){const t=super[wf](e);t[Dc]==null&&(t[Dc]=Bu.from(t));const{scene:i}=t,a=new bn(void 0,1/0);return i.traverse(l=>{l.renderOrder=1e3,l.frustumCulled=!1,l.name||(l.name=l.uuid);const u=l;if(u.material){const{geometry:d}=u;u.castShadow=!0,u.isSkinnedMesh&&(d.boundingSphere=a,d.boundingBox=null);const p=u.material;if(p.isMeshBasicMaterial===!0&&(p.toneMapped=!1),p.shadowSide=hs,p.aoMap){const{gltf:m,threeObjectMap:A}=t[Dc],_=A.get(p);if(m.materials!=null&&_!=null&&_.materials!=null){const b=m.materials[_.materials];b.occlusionTexture&&b.occlusionTexture.texCoord===0&&d.attributes.uv!=null&&d.setAttribute("uv2",d.attributes.uv)}}}}),t}get correlatedSceneGraph(){return this[As][Dc]}[Ef](){const e=super[Ef](),t=new Map;return e.scene.traverse(i=>{const a=i;if(a.material){const u=a.material;if(u!=null){if(t.has(u.uuid)){a.material=t.get(u.uuid);return}a.material=u.clone(),t.set(u.uuid,a.material)}}const l=i;l.target!==void 0&&l.add(l.target)}),e[Dc]=Bu.from(e,this.correlatedSceneGraph),e}}const ZC=(o,e,t)=>{let i;switch(o){case ui:i=new Uint8ClampedArray(e*t*4);break;case hi:i=new Uint16Array(e*t*4);break;case qr:i=new Uint32Array(e*t*4);break;case C0:i=new Int8Array(e*t*4);break;case T0:i=new Int16Array(e*t*4);break;case Lf:i=new Int32Array(e*t*4);break;case oi:i=new Float32Array(e*t*4);break;default:throw new Error("Unsupported data type")}return i};let id;const I4=(o,e,t,i)=>{if(id!==void 0)return id;const a=new dn(1,1,i);e.setRenderTarget(a);const l=new lt(new Ms,new Pi({color:16777215}));e.render(l,t),e.setRenderTarget(null);const u=ZC(o,a.width,a.height);return e.readRenderTargetPixels(a,0,0,a.width,a.height,u),a.dispose(),l.geometry.dispose(),l.material.dispose(),id=u[0]!==0,id};class y_{constructor(e){var t,i,a,l,u,d,p,m,A,_,b,w,E,C,T,x;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(M){throw this._renderer.setRenderTarget(null),M}this._renderer.setRenderTarget(null)},this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const P={format:Xt,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((t=e.renderTargetOptions)===null||t===void 0?void 0:t.anisotropy)!==void 0?(i=e.renderTargetOptions)===null||i===void 0?void 0:i.anisotropy:1,generateMipmaps:((a=e.renderTargetOptions)===null||a===void 0?void 0:a.generateMipmaps)!==void 0?(l=e.renderTargetOptions)===null||l===void 0?void 0:l.generateMipmaps:!1,magFilter:((u=e.renderTargetOptions)===null||u===void 0?void 0:u.magFilter)!==void 0?(d=e.renderTargetOptions)===null||d===void 0?void 0:d.magFilter:Et,minFilter:((p=e.renderTargetOptions)===null||p===void 0?void 0:p.minFilter)!==void 0?(m=e.renderTargetOptions)===null||m===void 0?void 0:m.minFilter:Et,samples:((A=e.renderTargetOptions)===null||A===void 0?void 0:A.samples)!==void 0?(_=e.renderTargetOptions)===null||_===void 0?void 0:_.samples:void 0,wrapS:((b=e.renderTargetOptions)===null||b===void 0?void 0:b.wrapS)!==void 0?(w=e.renderTargetOptions)===null||w===void 0?void 0:w.wrapS:ai,wrapT:((E=e.renderTargetOptions)===null||E===void 0?void 0:E.wrapT)!==void 0?(C=e.renderTargetOptions)===null||C===void 0?void 0:C.wrapT:ai};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=y_.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Wr,this._camera=new Kr,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!I4(this._type,this._renderer,this._camera,P)){let M;switch(this._type){case hi:M=this._renderer.extensions.has("EXT_color_buffer_float")?oi:void 0;break}M!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${oi}`),this._type=M):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new lt(new Ms,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new dn(this.width,this.height,P),this._renderTarget.texture.mapping=((T=e.renderTargetOptions)===null||T===void 0?void 0:T.mapping)!==void 0?(x=e.renderTargetOptions)===null||x===void 0?void 0:x.mapping:gl}static instantiateRenderer(){const e=new tf;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=ZC(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const t=new Nu(this.toArray(),this.width,this.height,Xt,this._type,e?.mapping||gl,e?.wrapS||ai,e?.wrapT||ai,e?.magFilter||Et,e?.minFilter||Et,e?.anisotropy||1,qt);return t.generateMipmaps=e?.generateMipmaps!==void 0?e?.generateMipmaps:!1,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof zi&&Object.values(this.material.uniforms).forEach(t=>{t.value instanceof Kt&&t.value.dispose()}),Object.values(this.material).forEach(t=>{t instanceof Kt&&t.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}const M4=`
|
|
7864
7864
|
varying vec2 vUv;
|
|
7865
7865
|
|
|
7866
7866
|
void main() {
|
|
@@ -7893,7 +7893,7 @@ void main() {
|
|
|
7893
7893
|
vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
|
|
7894
7894
|
gl_FragColor = vec4( clampedHdrColor , 1.0 );
|
|
7895
7895
|
}
|
|
7896
|
-
`;class B4 extends zi{constructor({gamma:e,offsetHdr:t,offsetSdr:i,gainMapMin:a,gainMapMax:l,maxDisplayBoost:u,hdrCapacityMin:d,hdrCapacityMax:p,sdr:m,gainMap:A}){super({name:"GainMapDecoderMaterial",vertexShader:M4,fragmentShader:R4,uniforms:{sdr:{value:m},gainMap:{value:A},gamma:{value:new se(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new se().fromArray(t)},offsetSdr:{value:new se().fromArray(i)},gainMapMin:{value:new se().fromArray(a)},gainMapMax:{value:new se().fromArray(l)},weightFactor:{value:(Math.log2(u)-d)/(p-d)}},blending:cs,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=u,this._hdrCapacityMin=d,this._hdrCapacityMax=p,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class eT extends Error{}class tT extends Error{}const Nc=(o,e,t)=>{const i=new RegExp(`${e}="([^"]*)"`,"i").exec(o);if(i)return i[1];const a=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(o);if(a){const l=a[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return l&&l.length===3?l.map(u=>u.replace(/<\/?rdf:li>/g,"")):a[1].trim()}if(t!==void 0)return t;throw new Error(`Can't find ${e} in gainmap metadata`)},P4=o=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(o):e=o.toString();let t=e.indexOf("<x:xmpmeta");for(;t!==-1;){const i=e.indexOf("x:xmpmeta>",t),a=e.slice(t,i+10);try{const l=Nc(a,"hdrgm:GainMapMin","0"),u=Nc(a,"hdrgm:GainMapMax"),d=Nc(a,"hdrgm:Gamma","1"),p=Nc(a,"hdrgm:OffsetSDR","0.015625"),m=Nc(a,"hdrgm:OffsetHDR","0.015625"),A=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(a),_=A?A[1]:"0",b=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(a);if(!b)throw new Error("Incomplete gainmap metadata");const w=b[1];return{gainMapMin:Array.isArray(l)?l.map(E=>parseFloat(E)):[parseFloat(l),parseFloat(l),parseFloat(l)],gainMapMax:Array.isArray(u)?u.map(E=>parseFloat(E)):[parseFloat(u),parseFloat(u),parseFloat(u)],gamma:Array.isArray(d)?d.map(E=>parseFloat(E)):[parseFloat(d),parseFloat(d),parseFloat(d)],offsetSdr:Array.isArray(p)?p.map(E=>parseFloat(E)):[parseFloat(p),parseFloat(p),parseFloat(p)],offsetHdr:Array.isArray(m)?m.map(E=>parseFloat(E)):[parseFloat(m),parseFloat(m),parseFloat(m)],hdrCapacityMin:parseFloat(_),hdrCapacityMax:parseFloat(w)}}catch{}t=e.indexOf("<x:xmpmeta",i)}};class L4{constructor(e){this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((t,i)=>{const a=this.options.debug,l=new DataView(e.buffer);if(l.getUint16(0)!==65496){i(new Error("Not a valid jpeg"));return}const u=l.byteLength;let d=2,p=0,m;for(;d<u;){if(++p>250){i(new Error(`Found no marker after ${p} loops 😵`));return}if(l.getUint8(d)!==255){i(new Error(`Not a valid marker at offset 0x${d.toString(16)}, found: 0x${l.getUint8(d).toString(16)}`));return}if(m=l.getUint8(d+1),a&&console.log(`Marker: ${m.toString(16)}`),m===226){a&&console.log("Found APP2 marker (0xffe2)");const A=d+4;if(l.getUint32(A)===1297106432){const _=A+4;let b;if(l.getUint16(_)===18761)b=!1;else if(l.getUint16(_)===19789)b=!0;else{i(new Error("No valid endianness marker found in TIFF header"));return}if(l.getUint16(_+2,!b)!==42){i(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const w=l.getUint32(_+4,!b);if(w<8){i(new Error("Not valid TIFF data! (First offset less than 8)"));return}const E=_+w,C=l.getUint16(E,!b),T=E+2;let x=0;for(let D=T;D<T+12*C;D+=12)l.getUint16(D,!b)===45057&&(x=l.getUint32(D+8,!b));const M=E+2+C*12+4,B=[];for(let D=M;D<M+x*16;D+=16){const G={MPType:l.getUint32(D,!b),size:l.getUint32(D+4,!b),dataOffset:l.getUint32(D+8,!b),dependantImages:l.getUint32(D+12,!b),start:-1,end:-1,isFII:!1};G.dataOffset?(G.start=_+G.dataOffset,G.isFII=!1):(G.start=0,G.isFII=!0),G.end=G.start+G.size,B.push(G)}if(this.options.extractNonFII&&B.length){const D=new Blob([l]),G=[];for(const U of B){if(U.isFII&&!this.options.extractFII)continue;const V=D.slice(U.start,U.end+1,"image/jpeg");G.push(V)}t(G)}}}d+=2+l.getUint16(d+2)}})}}const D4=async o=>{const e=P4(o);if(!e)throw new tT("Gain map XMP metadata not found");const i=await new L4({extractFII:!0,extractNonFII:!0}).extract(o);if(i.length!==2)throw new eT("Gain map recovery image not found");return{sdr:new Uint8Array(await i[0].arrayBuffer()),gainMap:new Uint8Array(await i[1].arrayBuffer()),metadata:e}},AE=o=>new Promise((e,t)=>{const i=document.createElement("img");i.onload=()=>{e(i)},i.onerror=a=>{t(a)},i.src=URL.createObjectURL(o)});class N4 extends Ps{constructor(e,t){super(t),e&&(this._renderer=e),this._internalLoadingManager=new kS}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=new B4({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new Kt,sdr:new Kt});return new y_({width:16,height:16,type:hi,colorSpace:qt,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(e,t,i,a){const l=a?new Blob([a],{type:"image/jpeg"}):void 0,u=new Blob([i],{type:"image/jpeg"});let d,p,m=!1;if(typeof createImageBitmap>"u"){const b=await Promise.all([l?AE(l):Promise.resolve(void 0),AE(u)]);p=b[0],d=b[1],m=!0}else{const b=await Promise.all([l?createImageBitmap(l,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(u,{imageOrientation:"flipY"})]);p=b[0],d=b[1]}const A=new Kt(p||new ImageData(2,2),gl,ai,ai,
|
|
7896
|
+
`;class B4 extends zi{constructor({gamma:e,offsetHdr:t,offsetSdr:i,gainMapMin:a,gainMapMax:l,maxDisplayBoost:u,hdrCapacityMin:d,hdrCapacityMax:p,sdr:m,gainMap:A}){super({name:"GainMapDecoderMaterial",vertexShader:M4,fragmentShader:R4,uniforms:{sdr:{value:m},gainMap:{value:A},gamma:{value:new se(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new se().fromArray(t)},offsetSdr:{value:new se().fromArray(i)},gainMapMin:{value:new se().fromArray(a)},gainMapMax:{value:new se().fromArray(l)},weightFactor:{value:(Math.log2(u)-d)/(p-d)}},blending:cs,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=u,this._hdrCapacityMin=d,this._hdrCapacityMax=p,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class eT extends Error{}class tT extends Error{}const Nc=(o,e,t)=>{const i=new RegExp(`${e}="([^"]*)"`,"i").exec(o);if(i)return i[1];const a=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(o);if(a){const l=a[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return l&&l.length===3?l.map(u=>u.replace(/<\/?rdf:li>/g,"")):a[1].trim()}if(t!==void 0)return t;throw new Error(`Can't find ${e} in gainmap metadata`)},P4=o=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(o):e=o.toString();let t=e.indexOf("<x:xmpmeta");for(;t!==-1;){const i=e.indexOf("x:xmpmeta>",t),a=e.slice(t,i+10);try{const l=Nc(a,"hdrgm:GainMapMin","0"),u=Nc(a,"hdrgm:GainMapMax"),d=Nc(a,"hdrgm:Gamma","1"),p=Nc(a,"hdrgm:OffsetSDR","0.015625"),m=Nc(a,"hdrgm:OffsetHDR","0.015625"),A=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(a),_=A?A[1]:"0",b=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(a);if(!b)throw new Error("Incomplete gainmap metadata");const w=b[1];return{gainMapMin:Array.isArray(l)?l.map(E=>parseFloat(E)):[parseFloat(l),parseFloat(l),parseFloat(l)],gainMapMax:Array.isArray(u)?u.map(E=>parseFloat(E)):[parseFloat(u),parseFloat(u),parseFloat(u)],gamma:Array.isArray(d)?d.map(E=>parseFloat(E)):[parseFloat(d),parseFloat(d),parseFloat(d)],offsetSdr:Array.isArray(p)?p.map(E=>parseFloat(E)):[parseFloat(p),parseFloat(p),parseFloat(p)],offsetHdr:Array.isArray(m)?m.map(E=>parseFloat(E)):[parseFloat(m),parseFloat(m),parseFloat(m)],hdrCapacityMin:parseFloat(_),hdrCapacityMax:parseFloat(w)}}catch{}t=e.indexOf("<x:xmpmeta",i)}};class L4{constructor(e){this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((t,i)=>{const a=this.options.debug,l=new DataView(e.buffer);if(l.getUint16(0)!==65496){i(new Error("Not a valid jpeg"));return}const u=l.byteLength;let d=2,p=0,m;for(;d<u;){if(++p>250){i(new Error(`Found no marker after ${p} loops 😵`));return}if(l.getUint8(d)!==255){i(new Error(`Not a valid marker at offset 0x${d.toString(16)}, found: 0x${l.getUint8(d).toString(16)}`));return}if(m=l.getUint8(d+1),a&&console.log(`Marker: ${m.toString(16)}`),m===226){a&&console.log("Found APP2 marker (0xffe2)");const A=d+4;if(l.getUint32(A)===1297106432){const _=A+4;let b;if(l.getUint16(_)===18761)b=!1;else if(l.getUint16(_)===19789)b=!0;else{i(new Error("No valid endianness marker found in TIFF header"));return}if(l.getUint16(_+2,!b)!==42){i(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const w=l.getUint32(_+4,!b);if(w<8){i(new Error("Not valid TIFF data! (First offset less than 8)"));return}const E=_+w,C=l.getUint16(E,!b),T=E+2;let x=0;for(let D=T;D<T+12*C;D+=12)l.getUint16(D,!b)===45057&&(x=l.getUint32(D+8,!b));const M=E+2+C*12+4,B=[];for(let D=M;D<M+x*16;D+=16){const G={MPType:l.getUint32(D,!b),size:l.getUint32(D+4,!b),dataOffset:l.getUint32(D+8,!b),dependantImages:l.getUint32(D+12,!b),start:-1,end:-1,isFII:!1};G.dataOffset?(G.start=_+G.dataOffset,G.isFII=!1):(G.start=0,G.isFII=!0),G.end=G.start+G.size,B.push(G)}if(this.options.extractNonFII&&B.length){const D=new Blob([l]),G=[];for(const U of B){if(U.isFII&&!this.options.extractFII)continue;const V=D.slice(U.start,U.end+1,"image/jpeg");G.push(V)}t(G)}}}d+=2+l.getUint16(d+2)}})}}const D4=async o=>{const e=P4(o);if(!e)throw new tT("Gain map XMP metadata not found");const i=await new L4({extractFII:!0,extractNonFII:!0}).extract(o);if(i.length!==2)throw new eT("Gain map recovery image not found");return{sdr:new Uint8Array(await i[0].arrayBuffer()),gainMap:new Uint8Array(await i[1].arrayBuffer()),metadata:e}},AE=o=>new Promise((e,t)=>{const i=document.createElement("img");i.onload=()=>{e(i)},i.onerror=a=>{t(a)},i.src=URL.createObjectURL(o)});class N4 extends Ps{constructor(e,t){super(t),e&&(this._renderer=e),this._internalLoadingManager=new kS}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=new B4({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new Kt,sdr:new Kt});return new y_({width:16,height:16,type:hi,colorSpace:qt,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(e,t,i,a){const l=a?new Blob([a],{type:"image/jpeg"}):void 0,u=new Blob([i],{type:"image/jpeg"});let d,p,m=!1;if(typeof createImageBitmap>"u"){const b=await Promise.all([l?AE(l):Promise.resolve(void 0),AE(u)]);p=b[0],d=b[1],m=!0}else{const b=await Promise.all([l?createImageBitmap(l,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(u,{imageOrientation:"flipY"})]);p=b[0],d=b[1]}const A=new Kt(p||new ImageData(2,2),gl,ai,ai,Et,K_,Xt,ui,1,qt);A.flipY=m,A.needsUpdate=!0;const _=new Kt(d,gl,ai,ai,Et,K_,Xt,ui,1,Ht);_.flipY=m,_.needsUpdate=!0,e.width=d.width,e.height=d.height,e.material.gainMap=A,e.material.sdr=_,e.material.gainMapMin=t.gainMapMin,e.material.gainMapMax=t.gainMapMax,e.material.offsetHdr=t.offsetHdr,e.material.offsetSdr=t.offsetSdr,e.material.gamma=t.gamma,e.material.hdrCapacityMin=t.hdrCapacityMin,e.material.hdrCapacityMax=t.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,t.hdrCapacityMax),e.material.needsUpdate=!0,e.render()}}class O4 extends N4{load(e,t,i,a){const l=this.prepareQuadRenderer(),u=new lr(this._internalLoadingManager);return u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setPath(this.path),u.setWithCredentials(this.withCredentials),this.manager.itemStart(e),u.load(e,async d=>{if(typeof d=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const p=new Uint8Array(d);let m,A,_;try{const b=await D4(p);m=b.sdr,A=b.gainMap,_=b.metadata}catch(b){if(b instanceof tT||b instanceof eT)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),_={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},m=p;else throw b}try{await this.render(l,_,m,A)}catch(b){this.manager.itemError(e),typeof a=="function"&&a(b),l.disposeOnDemandRenderer();return}typeof t=="function"&&t(l),this.manager.itemEnd(e),l.disposeOnDemandRenderer()},i,d=>{this.manager.itemError(e),typeof a=="function"&&a(d)}),l}}/* @license
|
|
7897
7897
|
* Copyright 2021 Google LLC. All Rights Reserved.
|
|
7898
7898
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
|
7899
7899
|
* you may not use this file except in compliance with the License.
|
|
@@ -8032,7 +8032,7 @@ void main() {
|
|
|
8032
8032
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8033
8033
|
* See the License for the specific language governing permissions and
|
|
8034
8034
|
* limitations under the License.
|
|
8035
|
-
*/const xE=new Map([[Qr.Repeat,ds],[Qr.ClampToEdge,ai],[Qr.MirroredRepeat,qa]]),e0=new Map([[ds,Qr.Repeat],[ai,Qr.ClampToEdge],[qa,Qr.MirroredRepeat]]),q4=new Map([[Mi.Nearest,gi],[Mi.Linear,
|
|
8035
|
+
*/const xE=new Map([[Qr.Repeat,ds],[Qr.ClampToEdge,ai],[Qr.MirroredRepeat,qa]]),e0=new Map([[ds,Qr.Repeat],[ai,Qr.ClampToEdge],[qa,Qr.MirroredRepeat]]),q4=new Map([[Mi.Nearest,gi],[Mi.Linear,Et],[Mi.NearestMipmapNearest,Lu],[Mi.LinearMipmapNearest,Oa],[Mi.NearestMipmapLinear,Nr],[Mi.LinearMipmapLinear,hn]]),iT=new Map([[gi,Mi.Nearest],[Et,Mi.Linear],[Lu,Mi.NearestMipmapNearest],[Oa,Mi.LinearMipmapNearest],[Nr,Mi.NearestMipmapLinear],[hn,Mi.LinearMipmapLinear]]),W4=new Map([[Mi.Nearest,gi],[Mi.Linear,Et]]),nT=new Map([[gi,Mi.Nearest],[Et,Mi.Linear]]),Y4=o=>iT.has(o),X4=o=>nT.has(o),K4=o=>e0.has(o),J4=(o,e)=>{switch(o){case"minFilter":return Y4(e);case"magFilter":return X4(e);case"wrapS":case"wrapT":return K4(e);case"rotation":case"repeat":case"offset":return!0;default:throw new Error(`Cannot configure property "${o}" on Sampler`)}},qs=Symbol("threeTexture"),SE=Symbol("threeTextures"),Er=Symbol("setProperty");class Z4 extends Yu{get[qs](){var e;return(e=this[dt])===null||e===void 0?void 0:e.values().next().value}get[SE](){return this[dt]}constructor(e,t){super(e,new Set(t?[t]:[]))}get name(){return this[qs].name||""}get minFilter(){return iT.get(this[qs].minFilter)}get magFilter(){return nT.get(this[qs].magFilter)}get wrapS(){return e0.get(this[qs].wrapS)}get wrapT(){return e0.get(this[qs].wrapT)}get rotation(){return this[qs].rotation}get scale(){return a0(this[qs].repeat)}get offset(){return a0(this[qs].offset)}setMinFilter(e){this[Er]("minFilter",q4.get(e))}setMagFilter(e){this[Er]("magFilter",W4.get(e))}setWrapS(e){this[Er]("wrapS",xE.get(e))}setWrapT(e){this[Er]("wrapT",xE.get(e))}setRotation(e){e==null&&(e=0),this[Er]("rotation",e)}setScale(e){e==null&&(e={u:1,v:1}),this[Er]("repeat",new Ve(e.u,e.v))}setOffset(e){e==null&&(e={u:0,v:0}),this[Er]("offset",new Ve(e.u,e.v))}[Er](e,t){if(J4(e,t))for(const i of this[SE])i[e]=t,i.needsUpdate=!0;this[Nt]()}}/* @license
|
|
8036
8036
|
* Copyright 2020 Google LLC. All Rights Reserved.
|
|
8037
8037
|
* Licensed under the Apache License, Version 2.0 (the 'License');
|
|
8038
8038
|
* you may not use this file except in compliance with the License.
|
|
@@ -8315,7 +8315,7 @@ void main() {
|
|
|
8315
8315
|
`:Ee`
|
|
8316
8316
|
${super.render()}
|
|
8317
8317
|
${this.__renderQrModal()}
|
|
8318
|
-
`}};ea([zt("#modelViewer")],hr.prototype,"modelViewerElem");ea([zt("#arModal")],hr.prototype,"arModalElem");ea([zt("#qrModal")],hr.prototype,"qrModalElem");ea([he({attribute:!1})],hr.prototype,"appWcRef");ea([he({type:String,attribute:"glb-src"})],hr.prototype,"glbSrc");ea([he({type:String,attribute:"variant-name"})],hr.prototype,"variantName");ea([he({type:String,attribute:"usdz-src"})],hr.prototype,"usdzSrc");ea([he({type:Boolean,attribute:"debug"})],hr.prototype,"debug");let FG=hr;var $G=Object.defineProperty,
|
|
8318
|
+
`}};ea([zt("#modelViewer")],hr.prototype,"modelViewerElem");ea([zt("#arModal")],hr.prototype,"arModalElem");ea([zt("#qrModal")],hr.prototype,"qrModalElem");ea([he({attribute:!1})],hr.prototype,"appWcRef");ea([he({type:String,attribute:"glb-src"})],hr.prototype,"glbSrc");ea([he({type:String,attribute:"variant-name"})],hr.prototype,"variantName");ea([he({type:String,attribute:"usdz-src"})],hr.prototype,"usdzSrc");ea([he({type:Boolean,attribute:"debug"})],hr.prototype,"debug");let FG=hr;var $G=Object.defineProperty,bt=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&$G(e,t,a),a};const mt=class eu extends gI{constructor(){super(window.__APP_VERSION__,iu.DEVELOPMENT),this.sku=Ai.sku.defaultValue.toString(),this.shopify_variant_id=Ai.shopifyVariantId.defaultValue.toString(),this.upc=Ai.upc.defaultValue.toString(),this.asin=Ai.asin.defaultValue.toString(),this.experience_id=Ai.experienceId.defaultValue.toString(),this.gaMeasurementId="",this.isLoading=!0,this.apiMode="production",this.debug=!1,this.dimensionsUnit=Ai.dimensionsUnit.defaultValue.toString(),this.dimensionsUnitSymbol=Ai.dimensionsUnitSymbol.defaultValue.toString(),this.areDimensionsActive=!1,this.areHotspotsActive=!1,this.isHelpVisible=!1,this.baseUrlOverride=Ai.baseUrlOverride.defaultValue.toString(),this.isPortraitOrientation=!1,this.didARAutoLaunch=!1,this.transparentBackground=!1,this.shadowIntensity=1,this.shadowSoftness=4,this.playInteractionPrompt=!1,this.featuresToEnable={viewer:!0,hotspots:!0,dimensions:!0,viewInYourSpace:!0,help:!0,sceneManager:!0},this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us",modal:"https://www.epigraph.us"},this.pickerState=!1,this._loadTimeBegin=performance.now(),this._loggerContext="EPIGRAPH THREED CODE",this._epigraphAnalytics=new SI(null,null),this._identifier="",this._identifierType="",this._isDevEnv=!1,this._boundingSphereCenter=new se,this._activeAnimations=new Map,this._animationFadeDurationInMiliseconds=1e3,this._isSceneInteractedWith=!1,this._isActiveHotspot=!1,this._isToolsetLargerThanTheLeftBottomQuadrant=!1,this._loadingProgress=0,this.__glbBlobUrl="",this.__usdzBlobUrl="",this.__hasSceneChanged=!1,this.__canvasSize={width:0,height:0}}static{this.webComponentName="epigraph-threed-core"}static{this.styles=[ut`
|
|
8319
8319
|
:host {
|
|
8320
8320
|
all: initial;
|
|
8321
8321
|
display: flex;
|
|
@@ -8595,7 +8595,7 @@ void main() {
|
|
|
8595
8595
|
class="splash-screen"
|
|
8596
8596
|
current-progress=${this._loadingProgress}
|
|
8597
8597
|
></epg-loader-scene>
|
|
8598
|
-
`}async _resetSession(){await this.renderEngine.emptyScene(),this.assetManager.assets.clear(),this._autoGeneratedProxyMesh.scale.set(1,1,1),this._autoGeneratedProxyMesh.position.set(0,0,0),this._autoGeneratedProxyMesh.updateMatrixWorld()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.appEvents.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.appEvents.cameraControlsStart.name,(e=>{switch(e.detail.type){case"rotate":this.style.cursor="grabbing";break;case"pan":this.style.cursor="move",this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.pickerState===!1&&this.hotspotsManager.closeActiveHotspot()})),this.addEventListener(this.appEvents.inputEnd.name,()=>{this.style.cursor="grab",this.hideCameraAim()}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.appEvents.assetLoadProgress.name,(e=>{this._loadingProgress=e.detail.progress})),this.addEventListener(this.appEvents.hotspotOpenEvent.name,(e=>{this._isActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotNextEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotPreviousEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotClosedEvent.name,(e=>{this._isActiveHotspot=!1;const i=this.hotspotsManager.hotspots.get(e.detail.hotspotId)?.animation;if(i)for(const a of i){const l=a.loop,u=a.exit;l&&this.stopAnimationByName(l);let d;u?d=this.playAnimationByName({animationName:u}):d=this.playAnimationByName({animationName:a.entry,reverse:!0}),setTimeout(()=>{d?.targetAnimationAction.reset(),this._activeAnimations.delete(d?.animationName??"")},this._animationFadeDurationInMiliseconds)}})),this.appCanvasContainerElemRef.onpointerdown=e=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp(),this.appEvents.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.appEvents.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.appEvents.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.appEvents.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this)),this.hotspotsManager?.addEventListener("pointerdown",()=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp()})}_onCameraPositionUpdate(){this.dimensionsManager?.enabled&&this._repopulateDimensions(),this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new Wn,t=new Pi({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new lt(e,t)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._appEvents=new Ux(this),this._assetManager=new pU(this),this._cameraManager=new _U({appWcRef:this}),this._sceneManager=new nz(this),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners()}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();for(const t of e)this._activeAnimations.get(t.entry)||this.playAnimationByName({animationName:t.entry,clampWhenFinished:!0}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByName({animationName:t.loop,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=Ge;return this.featuresToEnable.dimensions&&(IU.setupWebComponent(),e=Ee`
|
|
8598
|
+
`}async _resetSession(){await this.renderEngine.emptyScene(),this.assetManager.assets.clear(),this._autoGeneratedProxyMesh.scale.set(1,1,1),this._autoGeneratedProxyMesh.position.set(0,0,0),this._autoGeneratedProxyMesh.updateMatrixWorld()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.appEvents.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.appEvents.cameraControlsStart.name,(e=>{switch(e.detail.type){case"rotate":this.style.cursor="grabbing";break;case"pan":this.style.cursor="move",this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.pickerState===!1&&this.hotspotsManager.closeActiveHotspot()})),this.addEventListener(this.appEvents.inputEnd.name,()=>{this.style.cursor="grab",this.hideCameraAim()}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.appEvents.assetLoadProgress.name,(e=>{this._loadingProgress=e.detail.progress})),this.addEventListener(this.appEvents.hotspotOpenEvent.name,(e=>{this._isActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotNextEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotPreviousEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.appEvents.hotspotClosedEvent.name,(e=>{this._isActiveHotspot=!1;const i=this.hotspotsManager.hotspots.get(e.detail.hotspotId)?.animation;if(i)for(const a of i){const l=a.loop,u=a.exit;l&&this.stopAnimationByName(l);let d;u?d=this.playAnimationByName({animationName:u}):d=this.playAnimationByName({animationName:a.entry,reverse:!0}),setTimeout(()=>{d?.targetAnimationAction.reset(),this._activeAnimations.delete(d?.animationName??"")},this._animationFadeDurationInMiliseconds)}})),this.appCanvasContainerElemRef.onpointerdown=e=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp(),this.appEvents.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.appEvents.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.appEvents.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.appEvents.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this)),this.hotspotsManager?.addEventListener("pointerdown",()=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp()})}_onCameraPositionUpdate(){this.dimensionsManager?.enabled&&this._repopulateDimensions(),this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new Wn,t=new Pi({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new lt(e,t)}setShadowIntensity(e){this.renderEngine.contactShadows?.updateShadowIntensity(e)}setShadowSoftness(e){this.renderEngine.contactShadows?.updateShadowSoftness(e)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._appEvents=new Ux(this),this._assetManager=new pU(this),this._cameraManager=new _U({appWcRef:this}),this._sceneManager=new nz(this),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners()}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();for(const t of e)this._activeAnimations.get(t.entry)||this.playAnimationByName({animationName:t.entry,clampWhenFinished:!0}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByName({animationName:t.loop,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=Ge;return this.featuresToEnable.dimensions&&(IU.setupWebComponent(),e=Ee`
|
|
8599
8599
|
<dimensions-manager
|
|
8600
8600
|
id="dimensionsManager"
|
|
8601
8601
|
.appWcRef=${this}
|
|
@@ -8620,7 +8620,7 @@ void main() {
|
|
|
8620
8620
|
<div class="view-in-your-space-button ${this._isActiveHotspot?"hide":""}">
|
|
8621
8621
|
<slot name=${KA.slotCustomViewInYourSpaceButton.name} @click=${this.launchAR}></slot>
|
|
8622
8622
|
</div>
|
|
8623
|
-
`}_repopulateDimensions(){this.dimensionsManager.recalculateBoundsAndDimensions(),this.dimensionsManager.repopulateDimensionIndicators()}_repopulateHotspots(){window.epigraph.logger.info({title:"Override to repopulate hotspots in scene on identifier changes"})}__onWebComponentResize(){const{width:e,height:t}=this.getBoundingClientRect();if(this.__canvasSize.width=e,this.__canvasSize.height=t,this.renderEngine.mainRenderer.setSize(e,t),this.renderEngine.effectsComposer.setSize(e,t),this.cameraManager){const i=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.cameras.main.aspect=i,this.cameraManager.cameras.main.updateProjectionMatrix(),this.cameraManager.cameras.screenshot.aspect=i,this.cameraManager.cameras.screenshot.updateProjectionMatrix()}this.dimensionsManager&&!this.hotspotsManager?.activeHotspot&&this.cameraManager.fitCameraToObject({objectToFocus:this.getSceneSphericalBoundsForCameraFocus(),enableTransition:!1}),this.isPortraitOrientation=this.getBoundingClientRect().width<700,this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta())}__onDimensionsPositionChanged(){this.renderEngine.updateDimensionLines(this.dimensionsManager.getCurrentDimensionsIndicatorState())}showSplashScreen(){this.splashScreenElem?.show()}hideSplashScreen(){this.splashScreenElem?.hide()}_setupResizeObservers(){new ResizeObserver(t=>{for(const i of t){const{width:a,height:l}=i.target.getBoundingClientRect(),u=a*.5,d=l*.5;if(u>230)this._isToolsetLargerThanTheLeftBottomQuadrant=!1;else{const p=this.toolsetElem.getBoundingClientRect(),m=p.width>u,A=p.height>d;this._isToolsetLargerThanTheLeftBottomQuadrant=m||A}}}).observe(this)}firstUpdated(){this._setup(),this.featuresToEnable.viewer===!0&&(this._setupResizeObservers(),this.hideSplashScreen()),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}async _onIdentifierOrTypeChange(){window.epigraph.logger.info({title:`IDENTIFIER CHANGED TO: "${this._identifierType}" -- "${this._identifier}"`})}_onDebugChange(){this.dimensionsManager&&(this.dimensionsManager.visualizeBounds=this.debug),this.featuresToEnable.viewer&&(this.debug?this.renderEngine.showSceneDebuggers():this.renderEngine.hideSceneDebuggers())}showCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef.style.opacity="1"}hideCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef.style.opacity="0"}_onPlayInteractionPromptChange(){this.playInteractionPrompt?this.__onPlayInteractionPrompt():(this.hideCameraInteractionPromptIndicator(),this._cameraManager?.mainCameraControls?.stop&&this._cameraManager?.mainCameraControls?.stop())}updated(e){(e.has("sku")||e.has("shopify_variant_id")||e.has("upc")||e.has("asin")||e.has("experience_id"))&&this._onIdentifierOrTypeChange(),e.has("debug")&&this._onDebugChange(),e.has("playInteractionPrompt")&&this._onPlayInteractionPromptChange(),e.has("_isActiveHotspot")&&(this._isActiveHotspot?this._hideCustomViewInYourSpaceButton():this._showCustomViewInYourSpaceButton())}_getSlottedElements(e){const t=e.assignedElements();return[...t.length>0?t:e.children]}getWebComponentName(){return eu.webComponentName}_setupAnalytics(){this._nexusAnalyticsPlugin=new bI({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),sessionId:window.epigraph.epigraphSessionId,xPath:this.xPath,verboseLogging:!1,sendToStaging:!1}),this._epigraphAnalytics.addEventPlugin(this._nexusAnalyticsPlugin),this.gaMeasurementId&&(this._ga4AnalyticsPlugin=new yI({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),verboseLogging:!1}),this._epigraphAnalytics.addEventPlugin(this._ga4AnalyticsPlugin))}connectedCallback(){super.connectedCallback(),this._loadTimeBegin=performance.now(),this._setupAnalytics(),this.parsedUrlParams=Ft.parseUrlForEpigraphParams(this.baseUrlOverride)}disconnectedCallback(){super.disconnectedCallback()}render(){return Ee`
|
|
8623
|
+
`}_repopulateDimensions(){this.dimensionsManager.recalculateBoundsAndDimensions(),this.dimensionsManager.repopulateDimensionIndicators()}_repopulateHotspots(){window.epigraph.logger.info({title:"Override to repopulate hotspots in scene on identifier changes"})}__onWebComponentResize(){const{width:e,height:t}=this.getBoundingClientRect();if(this.__canvasSize.width=e,this.__canvasSize.height=t,this.renderEngine.mainRenderer.setSize(e,t),this.renderEngine.effectsComposer.setSize(e,t),this.cameraManager){const i=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.cameras.main.aspect=i,this.cameraManager.cameras.main.updateProjectionMatrix(),this.cameraManager.cameras.screenshot.aspect=i,this.cameraManager.cameras.screenshot.updateProjectionMatrix()}this.dimensionsManager&&!this.hotspotsManager?.activeHotspot&&this.cameraManager.fitCameraToObject({objectToFocus:this.getSceneSphericalBoundsForCameraFocus(),enableTransition:!1}),this.isPortraitOrientation=this.getBoundingClientRect().width<700,this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta())}__onDimensionsPositionChanged(){this.renderEngine.updateDimensionLines(this.dimensionsManager.getCurrentDimensionsIndicatorState())}showSplashScreen(){this.splashScreenElem?.show()}hideSplashScreen(){this.splashScreenElem?.hide()}_setupResizeObservers(){new ResizeObserver(t=>{for(const i of t){const{width:a,height:l}=i.target.getBoundingClientRect(),u=a*.5,d=l*.5;if(u>230)this._isToolsetLargerThanTheLeftBottomQuadrant=!1;else{const p=this.toolsetElem.getBoundingClientRect(),m=p.width>u,A=p.height>d;this._isToolsetLargerThanTheLeftBottomQuadrant=m||A}}}).observe(this)}firstUpdated(){this._setup(),this.featuresToEnable.viewer===!0&&(this._setupResizeObservers(),this.hideSplashScreen()),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}async _onIdentifierOrTypeChange(){window.epigraph.logger.info({title:`IDENTIFIER CHANGED TO: "${this._identifierType}" -- "${this._identifier}"`})}_onDebugChange(){this.dimensionsManager&&(this.dimensionsManager.visualizeBounds=this.debug),this.featuresToEnable.viewer&&(this.debug?this.renderEngine.showSceneDebuggers():this.renderEngine.hideSceneDebuggers())}showCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef.style.opacity="1"}hideCameraInteractionPromptIndicator(){this.cameraInteractionPromptIndicatorElemRef.style.opacity="0"}_onPlayInteractionPromptChange(){this.playInteractionPrompt?this.__onPlayInteractionPrompt():(this.hideCameraInteractionPromptIndicator(),this._cameraManager?.mainCameraControls?.stop&&this._cameraManager?.mainCameraControls?.stop())}updated(e){(e.has("sku")||e.has("shopify_variant_id")||e.has("upc")||e.has("asin")||e.has("experience_id"))&&this._onIdentifierOrTypeChange(),e.has("debug")&&this._onDebugChange(),e.has("playInteractionPrompt")&&this._onPlayInteractionPromptChange(),e.has("_isActiveHotspot")&&(this._isActiveHotspot?this._hideCustomViewInYourSpaceButton():this._showCustomViewInYourSpaceButton()),e.has("shadowIntensity")&&this.setShadowIntensity(this.shadowIntensity),e.has("shadowSoftness")&&this.setShadowSoftness(this.shadowSoftness)}_getSlottedElements(e){const t=e.assignedElements();return[...t.length>0?t:e.children]}getWebComponentName(){return eu.webComponentName}_setupAnalytics(){this._nexusAnalyticsPlugin=new bI({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),sessionId:window.epigraph.epigraphSessionId,xPath:this.xPath,verboseLogging:!1,sendToStaging:!1}),this._epigraphAnalytics.addEventPlugin(this._nexusAnalyticsPlugin),this.gaMeasurementId&&(this._ga4AnalyticsPlugin=new yI({trackingID:this.gaMeasurementId,experienceID:this.experience_id,solution:this.getWebComponentName(),verboseLogging:!1}),this._epigraphAnalytics.addEventPlugin(this._ga4AnalyticsPlugin))}connectedCallback(){super.connectedCallback(),this._loadTimeBegin=performance.now(),this._setupAnalytics(),this.parsedUrlParams=Ft.parseUrlForEpigraphParams(this.baseUrlOverride)}disconnectedCallback(){super.disconnectedCallback()}render(){return Ee`
|
|
8624
8624
|
${Ft.getCustomStylesTemplate()}
|
|
8625
8625
|
${this._renderAppCanvasContainer()}
|
|
8626
8626
|
${this._renderAppManagers()}
|
|
@@ -8628,7 +8628,7 @@ void main() {
|
|
|
8628
8628
|
${this._renderAppUiElemChildren()}
|
|
8629
8629
|
</div>
|
|
8630
8630
|
${this._renderSplashScreen()}
|
|
8631
|
-
`}};
|
|
8631
|
+
`}};bt([he({type:String,attribute:Ai.sku.name})],mt.prototype,"sku");bt([he({type:String,attribute:Ai.shopifyVariantId.name})],mt.prototype,"shopify_variant_id");bt([he({type:String,attribute:Ai.upc.name})],mt.prototype,"upc");bt([he({type:String,attribute:Ai.asin.name})],mt.prototype,"asin");bt([he({type:String,attribute:Ai.experienceId.name})],mt.prototype,"experience_id");bt([he({type:String,attribute:Ai.gaMeasurementId.name})],mt.prototype,"gaMeasurementId");bt([he({type:Boolean,attribute:!1})],mt.prototype,"isLoading");bt([he({type:String,attribute:Ai.apiMode.name})],mt.prototype,"apiMode");bt([he({type:Boolean,attribute:Ai.debug.name})],mt.prototype,"debug");bt([he({type:String,attribute:Ai.dimensionsUnit.name})],mt.prototype,"dimensionsUnit");bt([he({type:String,attribute:Ai.dimensionsUnitSymbol.name})],mt.prototype,"dimensionsUnitSymbol");bt([he({type:Boolean,attribute:!1})],mt.prototype,"areDimensionsActive");bt([he({type:Boolean,attribute:!1})],mt.prototype,"areHotspotsActive");bt([he({type:Boolean,attribute:!1})],mt.prototype,"isHelpVisible");bt([he({type:String,attribute:Ai.baseUrlOverride.name})],mt.prototype,"baseUrlOverride");bt([he({attribute:!1})],mt.prototype,"isPortraitOrientation");bt([he({attribute:!1})],mt.prototype,"didARAutoLaunch");bt([he({type:Boolean,attribute:"transparent-background"})],mt.prototype,"transparentBackground");bt([he({type:Number,attribute:"shadow-intensity"})],mt.prototype,"shadowIntensity");bt([he({type:Number,attribute:"shadow-softness"})],mt.prototype,"shadowSoftness");bt([zt("#appUiContainer")],mt.prototype,"appUiContainerElemRef");bt([zt("#appCanvasContainer")],mt.prototype,"appCanvasContainerElemRef");bt([zt("#cameraInteractionPromptIndicator")],mt.prototype,"cameraInteractionPromptIndicatorElemRef");bt([zt("#cameraAimIndicator")],mt.prototype,"cameraAimElemRef");bt([zt("#qrCodeGenerator")],mt.prototype,"qrCodeGenerator");bt([zt("#splashScreen")],mt.prototype,"splashScreenElem");bt([zt("#toolset")],mt.prototype,"toolsetElem");bt([zt("#customViewInYourSpaceButtonSlotElem")],mt.prototype,"customViewInYourSpaceButtonSlotElem");bt([zt("#viewInYourSpaceManager")],mt.prototype,"viewInYourSpaceManager");bt([zt("#dimensionsManager")],mt.prototype,"dimensionsManager");bt([zt("#helpOverlay")],mt.prototype,"helpOverlayElem");bt([zt("#hotspotsManager")],mt.prototype,"hotspotsManager");bt([he({attribute:!1})],mt.prototype,"playInteractionPrompt");bt([he({attribute:!1})],mt.prototype,"featuresToEnable");bt([Gi()],mt.prototype,"_isActiveHotspot");bt([Gi()],mt.prototype,"_isToolsetLargerThanTheLeftBottomQuadrant");bt([Gi()],mt.prototype,"_loadingProgress");let b_=mt;class zG{constructor({nexusApiResultPayload:e}){window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this.__data=e}getData(){return this.__data}getExperienceDataSettings(){return{}}getArGlbUrl(){return this.__data.product_variant.assets.ar_assets.glb.url}getArUsdzUrl(){return this.__data.product_variant.assets.ar_assets.usdz.url}getProductVariantIdentifier(){return this.__data.product_variant.variant_identifier}}const pT={label:{name:"label",defaultValue:"View In Your Space"}},GG={...KA};class HG{constructor(e){this.__appWcRef=e}async viewInYourSpace(){return await this.launchAR()}async launchAR(){return await this.__appWcRef.viewInYourSpaceManager.launchAR()}async getViewInYourSpaceUrl(){return""}async getViewInYourSpaceQR(){return""}canLaunchAR(){return this.__appWcRef.viewInYourSpaceManager.canLaunchAr()}isARSessionActive(){return this.__appWcRef.viewInYourSpaceManager.isARSessionActive()}getMinimumRequirementsString(){return this.__appWcRef.viewInYourSpaceManager.getMinimumRequirementsString()}}var VG=Object.defineProperty,QG=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&VG(e,t,a),a};const mT=class Qo extends b_{constructor(){super(),this._loggerContext="EPIGRAPH BUTTON",this.featuresToEnable={viewer:!1,hotspots:!1,dimensions:!1,viewInYourSpace:!0,help:!1,sceneManager:!1},this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-icon&utm_content=button",modal:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-modal&utm_content=button"},this.label=pT.label.defaultValue.toString(),window.epigraph.logger.info({title:`Initializing ${Qo.webComponentName}...`,contextOverride:this._loggerContext}),this.api=new HG(this)}static{this.webComponentName="epigraph-button"}static{this.styles=[super.styles,ut`
|
|
8632
8632
|
:host {
|
|
8633
8633
|
--ar-button-display: none;
|
|
8634
8634
|
position: relative;
|
|
@@ -8655,7 +8655,7 @@ void main() {
|
|
|
8655
8655
|
></epg-button-view-in-your-space>
|
|
8656
8656
|
</slot>`}_renderAppUiElemChildren(){return Ee`
|
|
8657
8657
|
${this._renderCustomViewInYourSpaceButtonSlot()}
|
|
8658
|
-
`}async _setup(){window.epigraph.logger.table({title:"Setting up...",contextOverride:this._loggerContext}),this._appEvents=new Ux(this),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}};QG([he({type:String,attribute:pT.label.name})],mT.prototype,"label");let jG=mT;class gT{constructor(e,t){this.__id=e.id,this.__name=e.name,this.__product=t,this.__renderAsset=e.renderAsset??this.__product.renderAsset,this.__proxyAsset=e.proxyAsset??this.__product.proxyAsset}get id(){return this.__id}get name(){return this.__name}get renderAsset(){return this.__renderAsset}get proxyAsset(){return this.__proxyAsset}}class qG{constructor(e,t){this.__variants=new Map,this.__product=t;for(const a of e){const l=new gT({id:a.id,name:a.name,renderAsset:a.renderAsset,proxyAsset:a.proxyAsset},this.__product);l&&this.__variants.set(l.id,l)}const i=this.__variants.values().next().value;i&&(this.__activeVariant=i)}get activeVariant(){return this.__activeVariant}set activeVariant(e){this.__activeVariant=e}get activeVariantId(){return this.__activeVariant?.id}async setActiveVariantById(e,t){const i=this.__variants.get(e);i&&(this.__activeVariant=i,await this.selectVariantInRenderAsset(this.__activeVariant.id,t))}async selectVariantInRenderAsset(e,t){window.epigraph.logger.info({title:`Switching to variant: ${e}`});const i=new $u(!1),a=this.__activeVariant.renderAsset;if(!this.activeVariant?.renderAsset||!a)return Promise.reject(i);const l=a.variantsExtension,u=a.variantsExtensionName;if(!l?.variants||u===void 0)return i.success=!0,Promise.resolve(i);const d=l.variants.findIndex(p=>p.name===e);return t.traverse(async p=>{if(!(p instanceof lt)||!p.isMesh||!p.userData.gltfExtensions)return;const m=p.userData.gltfExtensions[u];if(!m)return Promise.reject(i);p.userData.originalMaterial||(p.userData.originalMaterial=p.material);const A=m.mappings.find(_=>_.variants.includes(d));if(A){const _=a.resource.parser;p.material=await _.getDependency("material",A.material),_.assignFinalMaterial(p)}else p.material=p.userData.originalMaterial;i.success=!0}),Promise.resolve(i)}addProductVariant(e){this.__variants.set(e.id,e)}removeProductVariant(e){this.__variants.delete(e.id)}hasProductVariantId(e){return this.__variants.get(e)}getProductVariant(e){return this.__variants.get(e)}getAllProductVariants(){return Array.from(this.__variants.values())}getAllProductVariantIds(){return Array.from(this.__variants.keys())}getAllProductVariantNames(){const e=[];for(const t of this.__variants.values())e.push(t.name);return e}}class WG{constructor(e){this.__id=e.id,this.__name=e.name,this.__renderAsset=e.renderAsset,this.__proxyAsset=e.proxyAsset,this.__productVariantCollection=new qG(e.productVariantsConfig,this)}get id(){return this.__id}get name(){return this.__name}get renderAsset(){return this.__renderAsset}get proxyAsset(){return this.__proxyAsset}get productVariantCollection(){return this.__productVariantCollection}async loadProxy(){this.__proxyAsset&&!this.__proxyAsset?.isLoaded&&await this.__proxyAsset.load()}async loadRenderGeo(e){this.__renderAsset.isLoaded||await this.__renderAsset.load(),e&&this.__addVariantsFromRenderAsset()}async load(e=!1){await this.loadRenderGeo(e),await this.loadProxy()}__addVariantsFromRenderAsset(){if(!(!this.renderAsset?.variantsExtension||this.renderAsset?.variantsExtension?.variants.length===0))for(const e of this.renderAsset.variantsExtension.variants)try{const t=new gT({id:e.name,name:e.name.toUpperCase()},this);this.productVariantCollection.addProductVariant(t)}catch(t){window.epigraph.logger.error({title:`Could add variant: ${e.name} to product: ${this.__name}`,details:t});continue}}}class AT{constructor({nexusApiResultPayload:e,appWcRef:t}){this._products=new Map,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this.parseProducts()}getFirstProduct(){return this._products.values().next().value}parseProducts(){const e=new Y1({id:String(this._data.product_variant.id),uri:this._data.product_variant.assets.render_assets.glb.url,preload:!1,appWcRef:this._appWcRef}),t=new WG({id:this._data.product_variant.id,name:this._data.product_variant.title,renderAsset:e,productVariantsConfig:[{id:this._data.product_variant.variant_identifier,name:this._data.product_variant.title}]});this._products.set(t.id,t)}get products(){return this._products}getExperienceDataSettings(){return{}}getProductVariant(){return this._data.product_variant}getProductVariantIdentifier(){return this._data.product_variant.variant_identifier}getAllProductsAndVariants(){const e={};for(const t of this._products.values()){e[t.id]={name:t.name,variants:[]};for(const i of t.productVariantCollection.getAllProductVariantIds())e[t.id].variants.push(i)}return e}getArGlbUrl(){return this._data.product_variant.assets.ar_assets.glb.url}getArUsdzUrl(){return this._data.product_variant.assets.ar_assets.usdz.url}getRenderGeoUrl(){return this._data.product_variant.assets.render_assets.glb.url}}class _T{constructor(e){this._appWcRef=e}async viewInYourSpace(){return await this._appWcRef.launchAR()}async launchAR(){return await this._appWcRef.launchAR()}async getViewInYourSpaceUrl(){return""}async getViewInYourSpaceQR(){return""}canLaunchAR(){return this._appWcRef.viewInYourSpaceManager.canLaunchAr()}isARSessionActive(){return this._appWcRef.viewInYourSpaceManager.isARSessionActive()}getMinimumRequirementsString(){return this._appWcRef.viewInYourSpaceManager.getMinimumRequirementsString()}setCameraZoomLimits({minDistance:e,maxDistance:t}){this._appWcRef.cameraManager.setCameraZoomLimits({minDistance:e,maxDistance:t})}disableCameraZoomLimits(){this._appWcRef.cameraManager.disableCameraZoomLimits()}getCameraTransforms(){return this._appWcRef.cameraManager.getCurrentCameraTransforms()}setCameraTransforms(e){const t=new K1(e);return void this._appWcRef.cameraManager.moveCameraToLocation({newCameraTransforms:t})}getCameraRotation(){return this._appWcRef.cameraManager.getCurrentCameraRotation()}async setCameraRotation(e,t){const{azimuthAngle:i,polarAngle:a,distance:l}=e;return await this._appWcRef.cameraManager.rotateCameraToLocation({azimuthAngle:i,polarAngle:a,distance:l,transition:t})}getCameraFocalLength(){return this._appWcRef.cameraManager.getCameraFocalLength()}setCameraFocalLength(e){this._appWcRef.cameraManager.setCameraFocalLength(e)}getPositionOnMeshFromPoint(e,t){return this._appWcRef.getPositionOnMeshFromPoint(e,t)}showDimensions(){this._appWcRef.showDimensions()}hideDimensions(){this._appWcRef.hideDimensions()}areDimensionsVisible(){return this._appWcRef.areDimensionsActive}getDimensions(){return this._appWcRef.getDimensions()}toggleDimensions(){}getAllAnimations(){return this._appWcRef.getAllAnimations()}getAllAnimationNames(){return this._appWcRef.getAllAnimationNames()}playAnimationByName({animationName:e,clampWhenFinished:t=!1,loop:i=!1,repetitions:a=1/0,reverse:l=!1}){this._appWcRef.playAnimationByName({animationName:e,clampWhenFinished:t,loop:i,repetitions:a,reverse:l})}stopAnimationByName(e){this._appWcRef.stopAnimationByName(e)}pauseActiveAnimations(e){this._appWcRef.pauseActiveAnimations(e)}resumeActiveAnimations(){this._appWcRef.resumeActiveAnimations()}stopAllAnimations(){this._appWcRef.stopAllAnimations()}showHelp(){this._appWcRef.showHelp()}hideHelp(){this._appWcRef.hideHelp()}toggleHelp(){this._appWcRef.toggleHelp()}isHelpVisible(){return this._appWcRef.isHelpVisible}}var YG=Object.defineProperty,XG=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&YG(e,t,a),a};const yT=class Ca extends b_{constructor(){super(),this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-icon&utm_content=viewer",modal:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-modal&utm_content=viewer"},this.featuresToEnable={viewer:!0,hotspots:!1,dimensions:!0,viewInYourSpace:!0,help:!0,sceneManager:!0},this._loggerContext=Ca.webComponentName.toUpperCase(),window.epigraph.logger.info({title:`Initializing ${Ca.webComponentName}...`,contextOverride:this._loggerContext}),this.api=new _T(this)}static{this.webComponentName="epigraph-viewer"}static{this.styles=[super.styles,ut`
|
|
8658
|
+
`}async _setup(){window.epigraph.logger.table({title:"Setting up...",contextOverride:this._loggerContext}),this._appEvents=new Ux(this),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}};QG([he({type:String,attribute:pT.label.name})],mT.prototype,"label");let jG=mT;class gT{constructor(e,t){this.__id=e.id,this.__name=e.name,this.__product=t,this.__renderAsset=e.renderAsset??this.__product.renderAsset,this.__proxyAsset=e.proxyAsset??this.__product.proxyAsset}get id(){return this.__id}get name(){return this.__name}get renderAsset(){return this.__renderAsset}get proxyAsset(){return this.__proxyAsset}}class qG{constructor(e,t){this.__variants=new Map,this.__product=t;for(const a of e){const l=new gT({id:a.id,name:a.name,renderAsset:a.renderAsset,proxyAsset:a.proxyAsset},this.__product);l&&this.__variants.set(l.id,l)}const i=this.__variants.values().next().value;i&&(this.__activeVariant=i)}get activeVariant(){return this.__activeVariant}set activeVariant(e){this.__activeVariant=e}get activeVariantId(){return this.__activeVariant?.id}async setActiveVariantById(e,t){const i=this.__variants.get(e);i&&(this.__activeVariant=i,await this.selectVariantInRenderAsset(this.__activeVariant.id,t))}async selectVariantInRenderAsset(e,t){window.epigraph.logger.info({title:`Switching to variant: ${e}`});const i=new $u(!1),a=this.__activeVariant.renderAsset;if(!this.activeVariant?.renderAsset||!a)return Promise.reject(i);const l=a.variantsExtension,u=a.variantsExtensionName;if(!l?.variants||u===void 0)return i.success=!0,Promise.resolve(i);const d=l.variants.findIndex(p=>p.name===e);return t.traverse(async p=>{if(!(p instanceof lt)||!p.isMesh||!p.userData.gltfExtensions)return;const m=p.userData.gltfExtensions[u];if(!m)return Promise.reject(i);p.userData.originalMaterial||(p.userData.originalMaterial=p.material);const A=m.mappings.find(_=>_.variants.includes(d));if(A){const _=a.resource.parser;p.material=await _.getDependency("material",A.material),_.assignFinalMaterial(p)}else p.material=p.userData.originalMaterial;i.success=!0}),Promise.resolve(i)}addProductVariant(e){this.__variants.set(e.id,e)}removeProductVariant(e){this.__variants.delete(e.id)}hasProductVariantId(e){return this.__variants.get(e)}getProductVariant(e){return this.__variants.get(e)}getAllProductVariants(){return Array.from(this.__variants.values())}getAllProductVariantIds(){return Array.from(this.__variants.keys())}getAllProductVariantNames(){const e=[];for(const t of this.__variants.values())e.push(t.name);return e}}class WG{constructor(e){this.__id=e.id,this.__name=e.name,this.__renderAsset=e.renderAsset,this.__proxyAsset=e.proxyAsset,this.__productVariantCollection=new qG(e.productVariantsConfig,this)}get id(){return this.__id}get name(){return this.__name}get renderAsset(){return this.__renderAsset}get proxyAsset(){return this.__proxyAsset}get productVariantCollection(){return this.__productVariantCollection}async loadProxy(){this.__proxyAsset&&!this.__proxyAsset?.isLoaded&&await this.__proxyAsset.load()}async loadRenderGeo(e){this.__renderAsset.isLoaded||await this.__renderAsset.load(),e&&this.__addVariantsFromRenderAsset()}async load(e=!1){await this.loadRenderGeo(e),await this.loadProxy()}__addVariantsFromRenderAsset(){if(!(!this.renderAsset?.variantsExtension||this.renderAsset?.variantsExtension?.variants.length===0))for(const e of this.renderAsset.variantsExtension.variants)try{const t=new gT({id:e.name,name:e.name.toUpperCase()},this);this.productVariantCollection.addProductVariant(t)}catch(t){window.epigraph.logger.error({title:`Could add variant: ${e.name} to product: ${this.__name}`,details:t});continue}}}class AT{constructor({nexusApiResultPayload:e,appWcRef:t}){this._products=new Map,window.epigraph.logger.info({title:"nexusApiPayload",details:e}),this._appWcRef=t,this._data=e,this.parseProducts()}getFirstProduct(){return this._products.values().next().value}parseProducts(){const e=new Y1({id:String(this._data.product_variant.id),uri:this._data.product_variant.assets.render_assets.glb.url,preload:!1,appWcRef:this._appWcRef}),t=new WG({id:this._data.product_variant.id,name:this._data.product_variant.title,renderAsset:e,productVariantsConfig:[{id:this._data.product_variant.variant_identifier,name:this._data.product_variant.title}]});this._products.set(t.id,t)}get products(){return this._products}getExperienceDataSettings(){return{}}getProductVariant(){return this._data.product_variant}getProductVariantIdentifier(){return this._data.product_variant.variant_identifier}getAllProductsAndVariants(){const e={};for(const t of this._products.values()){e[t.id]={name:t.name,variants:[]};for(const i of t.productVariantCollection.getAllProductVariantIds())e[t.id].variants.push(i)}return e}getArGlbUrl(){return this._data.product_variant.assets.ar_assets.glb.url}getArUsdzUrl(){return this._data.product_variant.assets.ar_assets.usdz.url}getRenderGeoUrl(){return this._data.product_variant.assets.render_assets.glb.url}}class _T{constructor(e){this._appWcRef=e}async viewInYourSpace(){return await this._appWcRef.launchAR()}async launchAR(){return await this._appWcRef.launchAR()}async getViewInYourSpaceUrl(){return""}async getViewInYourSpaceQR(){return""}canLaunchAR(){return this._appWcRef.viewInYourSpaceManager.canLaunchAr()}isARSessionActive(){return this._appWcRef.viewInYourSpaceManager.isARSessionActive()}getMinimumRequirementsString(){return this._appWcRef.viewInYourSpaceManager.getMinimumRequirementsString()}setCameraZoomLimits({minDistance:e,maxDistance:t}){this._appWcRef.cameraManager.setCameraZoomLimits({minDistance:e,maxDistance:t})}disableCameraZoomLimits(){this._appWcRef.cameraManager.disableCameraZoomLimits()}getCameraTransforms(){return this._appWcRef.cameraManager.getCurrentCameraTransforms()}setCameraTransforms(e){const t=new K1(e);return void this._appWcRef.cameraManager.moveCameraToLocation({newCameraTransforms:t})}getCameraRotation(){return this._appWcRef.cameraManager.getCurrentCameraRotation()}async setCameraRotation(e,t){const{azimuthAngle:i,polarAngle:a,distance:l}=e;return await this._appWcRef.cameraManager.rotateCameraToLocation({azimuthAngle:i,polarAngle:a,distance:l,transition:t})}getCameraFocalLength(){return this._appWcRef.cameraManager.getCameraFocalLength()}setCameraFocalLength(e){this._appWcRef.cameraManager.setCameraFocalLength(e)}getPositionOnMeshFromPoint(e,t){return this._appWcRef.getPositionOnMeshFromPoint(e,t)}setShadowIntensity(e){this._appWcRef.setShadowIntensity(e)}setShadowSoftness(e){this._appWcRef.setShadowSoftness(e)}showDimensions(){this._appWcRef.showDimensions()}hideDimensions(){this._appWcRef.hideDimensions()}areDimensionsVisible(){return this._appWcRef.areDimensionsActive}getDimensions(){return this._appWcRef.getDimensions()}toggleDimensions(){}getAllAnimations(){return this._appWcRef.getAllAnimations()}getAllAnimationNames(){return this._appWcRef.getAllAnimationNames()}playAnimationByName({animationName:e,clampWhenFinished:t=!1,loop:i=!1,repetitions:a=1/0,reverse:l=!1}){this._appWcRef.playAnimationByName({animationName:e,clampWhenFinished:t,loop:i,repetitions:a,reverse:l})}stopAnimationByName(e){this._appWcRef.stopAnimationByName(e)}pauseActiveAnimations(e){this._appWcRef.pauseActiveAnimations(e)}resumeActiveAnimations(){this._appWcRef.resumeActiveAnimations()}stopAllAnimations(){this._appWcRef.stopAllAnimations()}showHelp(){this._appWcRef.showHelp()}hideHelp(){this._appWcRef.hideHelp()}toggleHelp(){this._appWcRef.toggleHelp()}isHelpVisible(){return this._appWcRef.isHelpVisible}}var YG=Object.defineProperty,XG=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&YG(e,t,a),a};const yT=class Ca extends b_{constructor(){super(),this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-icon&utm_content=viewer",modal:"https://www.epigraph.us/?utm_source=epigraph&utm_medium=experience&utm_campaign=powered-by&utm_id=powered-by-modal&utm_content=viewer"},this.featuresToEnable={viewer:!0,hotspots:!1,dimensions:!0,viewInYourSpace:!0,help:!0,sceneManager:!0},this._loggerContext=Ca.webComponentName.toUpperCase(),window.epigraph.logger.info({title:`Initializing ${Ca.webComponentName}...`,contextOverride:this._loggerContext}),this.api=new _T(this)}static{this.webComponentName="epigraph-viewer"}static{this.styles=[super.styles,ut`
|
|
8659
8659
|
:host {
|
|
8660
8660
|
position: relative;
|
|
8661
8661
|
}
|