import{aasE}from"./chunk-6VK5R74O.js";import{aasQ}from"./chunk-SACP225T.js";import{aasae}from"./chunk-NT26NNVH.js";import{basoe,casre,dasJ}from"./chunk-NW2YE576.js";import{basA,dasie}from"./chunk-2NIQ5ECB.js";import{aasb,basF,fasN}from"./chunk-7YEOLR2L.js";import{aasH}from"./chunk-QHHYYTCM.js";import{aasr,easG}from"./chunk-RH3GFHG2.js";import{aasP}from"./chunk-FRWNWNYJ.js";import{aasm}from"./chunk-TA3RE4KQ.js";import{aasw,basO}from"./chunk-RTY3VPG6.js";import{easa}from"./chunk-LRNH5AEO.js";functionT(e){this.planes=m(e,[])}varX=[newr,newr,newr];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);varV=newr,_e=newr,fe=newQ(newr(1,0,0),0);T.fromBoundingSphere=function(e,t){if(!a(e))throwneww("boundingSphere is required.");a(t)||(t=newT);letn=X.length,f=t.planes;f.length=2*n;letp=e.center,d=e.radius,s=0;for(lety=0;y<n;++y){leti=X[y],c=f[s],_=f[s+1];a(c)||(c=f[s]=newb),a(_)||(_=f[s+1]=newb),r.multiplyByScalar(i,-d,V),r.add(p,V,V),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,V),r.multiplyByScalar(i,d,V),r.add(p,V,V),_.x=-i.x,_.y=-i.y,_.z=-i.z,_.w=-r.dot(r.negate(i,_e),V),s+=2}returnt};T.prototype.computeVisibility=function(e){if(!a(e))throwneww("boundingVolume is required.");lett=this.planes,n=!1;for(letf=0,p=t.length;f<p;++f){letd=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(d===A.OUTSIDE)returnA.OUTSIDE;d===A.INTERSECTING&&(n=!0)}returnn?A.INTERSECTING:A.INSIDE};T.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throwneww("boundingVolume is required.");if(!a(t))throwneww("parentPlaneMask is required.");if(t===T.MASK_OUTSIDE||t===T.MASK_INSIDE)returnt;letn=T.MASK_INSIDE,f=this.planes;for(letp=0,d=f.length;p<d;++p){lets=p<31?1<<p:0;if(p<31&&!(t&s))continue;lety=e.intersectPlane(Q.fromCartesian4(f[p],fe));if(y===A.OUTSIDE)returnT.MASK_OUTSIDE;y===A.INTERSECTING&&(n|=s)}returnn};T.MASK_OUTSIDE=4294967295;T.MASK_INSIDE=0;T.MASK_INDETERMINATE=2147483647;var$=T;functionk(e){e=m(e,m.EMPTY_OBJECT),this.left=e.left,this._left=void0,this.right=e.right,this._right=void0,this.top=e.top,this._top=void0,this.bottom=e.bottom,this._bottom=void0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this._cullingVolume=new$,this._orthographicMatrix=newF}functionce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throwneww("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throwneww("right must be greater than left.");if(e.bottom>e.top)throwneww("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throwneww("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){returnce(this),this._orthographicMatrix}}});varme=newr,ye=newr,ge=newr,ee=newr;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throwneww("position is required.");if(!a(t))throwneww("direction is required.");if(!a(n))throwneww("up is required.");letf=this._cullingVolume.planes,p=this.top,d=this.bottom,s=this.right,y=this.left,i=this.near,c=this.far,_=r.cross(t,n,me);r.normalize(_,_);letg=ye;r.multiplyByScalar(t,i,g),r.add(e,g,g);letl=ge;r.multiplyByScalar(_,y,l),r.add(g,l,l);leto=f[0];returna(o)||(o=f[0]=newb),o.x=_.x,o.y=_.y,o.z=_.z,o.w=-r.dot(_,l),r.multiplyByScalar(_,s,l),r.add(g,l,l),o=f[1],a(o)||(o=f[1]=newb),o.x=-_.x,o.y=-_.y,o.z=-_.z,o.w=-r.dot(r.negate(_,ee),l),r.multiplyByScalar(n,d,l),r.add(g,l,l),o=f[2],a(o)||(o=f[2]=newb),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,p,l),r.add(g,l,l),o=f[3],a(o)||(o=f[3]=newb),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=newb),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t