define(["./AxisAlignedBoundingBox-37250ed6","./Transforms-98ffa11d","./Matrix2-e3fb4559","./Cartesian3-7e9cc2ff","./defaultValue-81eec7ed","./TerrainEncoding-2e2628a7","./Math-5f585871","./Matrix4-d34187af","./OrientedBoundingBox-3db45505","./RuntimeError-26acdd3b","./WebMercatorProjection-f5706bbf","./createTaskProcessorWorker","./Check-741c5f3c","./_commonjsHelpers-3aae1032-26891ab7","./combine-3c023bda","./AttributeCompression-e2e3f0dd","./ComponentDatatype-aaeec80f","./WebGLConstants-508b9636","./EllipsoidTangentPlane-fa1337e1","./IntersectionTests-73b87d72","./Plane-4f75b3df"],(function(t,e,n,i,o,a,r,s,c,u,h,d,l,g,m,p,f,I,E,T,C){"use strict";const M=Uint16Array.BYTES_PER_ELEMENT,x=Int32Array.BYTES_PER_ELEMENT,N=Uint32Array.BYTES_PER_ELEMENT,b=Float32Array.BYTES_PER_ELEMENT,S=Float64Array.BYTES_PER_ELEMENT;function w(t,e,n){n=o.defaultValue(n,r.CesiumMath);const i=t.length;for(let o=0;o0&&c.push(c[C]),u.length>0&&u.push(u[C]),s.Matrix4.multiplyByPoint(d.toENU,S,P);const w=d.minimum,A=d.maximum;i.Cartesian3.minimumByComponent(P,w,w),i.Cartesian3.maximumByComponent(P,A,A);const y=d.lastBorderPoint;if(o.defined(y)){const t=y.index;h.push(t,M-1,M,M,C,t)}d.lastBorderPoint=E}}return d((function(d,l){d.ellipsoid=n.Ellipsoid.clone(d.ellipsoid),d.rectangle=n.Rectangle.clone(d.rectangle);const g=function(d,l,g,m,p,f,I,E,T,C,W){let v,F,O,V,Y,k;o.defined(m)?(v=m.west,F=m.south,O=m.east,V=m.north,Y=m.width,k=m.height):(v=r.CesiumMath.toRadians(p.west),F=r.CesiumMath.toRadians(p.south),O=r.CesiumMath.toRadians(p.east),V=r.CesiumMath.toRadians(p.north),Y=r.CesiumMath.toRadians(m.width),k=r.CesiumMath.toRadians(m.height));const H=[F,V],U=[v,O],L=e.Transforms.eastNorthUpToFixedFrame(l,g),j=s.Matrix4.inverseTransformation(L,R);let D,G;T&&(D=h.WebMercatorProjection.geodeticLatitudeToMercatorAngle(F),G=1/(h.WebMercatorProjection.geodeticLatitudeToMercatorAngle(V)-D));const z=1!==f,q=new DataView(d);let J=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY;const Q=A;Q.x=Number.POSITIVE_INFINITY,Q.y=Number.POSITIVE_INFINITY,Q.z=Number.POSITIVE_INFINITY;const X=y;X.x=Number.NEGATIVE_INFINITY,X.y=Number.NEGATIVE_INFINITY,X.z=Number.NEGATIVE_INFINITY;let Z,$,tt=0,et=0,nt=0;for($=0;$<4;++$){let t=tt;Z=q.getUint32(t,!0),t+=N;const e=r.CesiumMath.toRadians(180*q.getFloat64(t,!0));t+=S,-1===w(U,e)&&U.push(e);const n=r.CesiumMath.toRadians(180*q.getFloat64(t,!0));t+=S,-1===w(H,n)&&H.push(n),t+=2*S;let i=q.getInt32(t,!0);t+=x,et+=i,i=q.getInt32(t,!0),nt+=3*i,tt+=Z+N}const it=[],ot=[],at=new Array(et),rt=new Array(et),st=new Array(et),ct=T?new Array(et):[],ut=z?new Array(et):[],ht=new Array(nt),dt=[],lt=[],gt=[],mt=[];let pt=0,ft=0;for(tt=0,$=0;$<4;++$){Z=q.getUint32(tt,!0),tt+=N;const t=tt,e=r.CesiumMath.toRadians(180*q.getFloat64(tt,!0));tt+=S;const o=r.CesiumMath.toRadians(180*q.getFloat64(tt,!0));tt+=S;const a=r.CesiumMath.toRadians(180*q.getFloat64(tt,!0)),c=.5*a;tt+=S;const d=r.CesiumMath.toRadians(180*q.getFloat64(tt,!0)),l=.5*d;tt+=S;const m=q.getInt32(tt,!0);tt+=x;const p=q.getInt32(tt,!0);tt+=x,tt+=x;const f=new Array(m);for(let t=0;t0&&mt.length>0){const t=dt[0].index,e=It,n=mt[mt.length-1].index,i=at.length-1;ht.push(n,i,e,e,t,n)}et=at.length;const Mt=e.BoundingSphere.fromPoints(at);let xt;o.defined(m)&&(xt=c.OrientedBoundingBox.fromRectangle(m,J,K,g));const Nt=new a.EllipsoidalOccluder(g).computeHorizonCullingPointPossiblyUnderEllipsoid(l,at,J),bt=new t.AxisAlignedBoundingBox(Q,X,l),St=new a.TerrainEncoding(l,bt,Tt.hMin,K,L,!1,T,z,f,I),wt=new Float32Array(et*St.stride);let Bt=0;for(let t=0;t