define(["./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6","./ArcType-0cf52f8c","./arrayRemoveDuplicates-06991c15","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./EncodedCartesian3-d3e254ea","./GeometryAttribute-a441ff32","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./WebMercatorProjection-843df830","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96"],(function(e,t,a,n,i,r,s,o,l,c,u,C,d,p,h,g,f){"use strict";functionm(a){a=n.defaultValue(a,n.defaultValue.EMPTY_OBJECT),this._ellipsoid=n.defaultValue(a.ellipsoid,t.Ellipsoid.WGS84),this._rectangle=n.defaultValue(a.rectangle,t.Rectangle.MAX_VALUE),this._projection=newe.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=n.defaultValue(a.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=n.defaultValue(a.numberOfLevelZeroTilesY,1)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},rectangle:{get:function(){returnthis._rectangle}},projection:{get:function(){returnthis._projection}}}),m.prototype.getNumberOfXTilesAtLevel=function(e){returnthis._numberOfLevelZeroTilesX<<e},m.prototype.getNumberOfYTilesAtLevel=function(e){returnthis._numberOfLevelZeroTilesY<<e},m.prototype.rectangleToNativeRectangle=function(e,r){a.Check.defined("rectangle",e);consts=i.CesiumMath.toDegrees(e.west),o=i.CesiumMath.toDegrees(e.south),l=i.CesiumMath.toDegrees(e.east),c=i.CesiumMath.toDegrees(e.north);returnn.defined(r)?(r.west=s,r.south=o,r.east=l,r.north=c,r):newt.Rectangle(s,o,l,c)},m.prototype.tileXYToNativeRectangle=function(e,t,a,n){constr=this.tileXYToRectangle(e,t,a,n);returnr.west=i.CesiumMath.toDegrees(r.west),r.south=i.CesiumMath.toDegrees(r.south),r.east=i.CesiumMath.toDegrees(r.east),r.north=i.CesiumMath.toDegrees(r.north),r},m.prototype.tileXYToRectangle=function(e,a,i,r){consts=this._rectangle,o=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),c=s.width/o,u=e*c+s.west,C=(e+1)*c+s.west,d=s.height/l,p=s.north-a*d,h=s.north-(a+1)*d;returnn.defined(r)||(r=newt.Rectangle(u,h,C,p)),r.west=u,r.south=h,r.east=C,r.north=p,r},m.prototype.positionToTileXY=function(e,a,r){consts=this._rectangle;if(!t.Rectangle.contains(s,e))return;consto=this.getNumberOfXTilesAtLevel(a),l=this.getNumberOfYTilesAtLevel(a),c=s.width/o,u=s.height/l;letC=e.longitude;s.east<s.west&&(C+=i.CesiumMath.TWO_PI);letd=(C-s.west)/c|0;d>=o&&(d=o-1);letp=(s.north-e.latitude)/u|0;returnp>=l&&(p=l-1),n.defined(r)?(r.x=d,r.y=p,r):newt.Cartesian2(d,p)};constw=newt.Cartesian3,y=newt.Cartesian3,T=newt.Cartographic,E=newt.Cartesian3,M=newt.Cartesian3,_=newe.BoundingSphere,O=newm,b=[newt.Cartographic,newt.Cartographic,newt.Cartographic,newt.Cartographic],A=newt.Cartesian2,k={};functionP(e){t.Cartographic.fromRadians(e.east,e.north,0,b[0]),t.Cartographic.fromRadians(e.west,e.north,0,b[1]),t.Cartographic.fromRadians(e.east,e.south,0,b[2]),t.Cartographic.fromRadians(e.west,e.south,0,b[3]);leta=0,n=0,i=0,r=0;consts=k._terrainHeightsMaxLevel;leto;for(o=0;o<=s;++o){lete=!1;for(lett=0;t<4;++t){consta=b[t];if(O.positionToTileXY(a,o,A),0===t)i=A.x,r=A.y;elseif(i!==A.x||r!==A.y){e=!0;break}}if(e)break;a=i,n=r}if(0!==o)return{x:a,y:n,level:o>s?s:o-1}}k.initialize=function(){lett=k._initPromise;returnn.defined(t)||(t=e.Resource.fetchJson(e.buildModuleUrl("Assets/approximateTerrainHeights.json")).then((function(e){k._terrainHeights=e})),k._initPromise=t),t},k.getMinimumMaximumHeights=function(e,i){if(a.Check.defined("rectangle",e),!n.defined(k._terrainHeights))thrownewa.DeveloperError("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=n.defaultValue(i,t.Ellipsoid.WGS84);constr=P(e);lets=k._defaultMinTerrainHeight,o=k._defaultMaxTerrainHeight;if(n.defined(r)){consta=`${r.level}-${r.x}-${r.y}`,l=k._terrainHeights[a];n.defined(l)&&(s=l[0],o=l[1]),i.cartographicToCartesian(t.Rectangle.northeast(e,T),w),i.cartographicToCartesian(t.Rectangle.southwest(e,T),y),t.Cartesian3.midpoint(y,w,E);constc=i.scaleToGeodeticSurface(E,M);if(n.defined(c)){conste=t.Cartesian3.distance(E,c);s=Math.min(s,-e)}elses=k._defaultMinTerrainHeight}returns=Math.max(k._defaultMinTerrainHeight,s),{minimumTerrainHeight:s,maximumTerrainHeight:o}},k.getBoundingSphere=function(i,r){if(a.Check.defined("rectangle",i),!n.defined(k._terrainHeights))thrownewa.DeveloperError("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");r=n.defaultValue(r,t.Ellipsoid.WGS84);consts=P(i);leto=k._defaultMaxTerrainHeight;if(n.defined(s)){conste=`${s.level}-${s.x}-${s.y}`,t=k._terrainHeights[e];n.defined(t)&&(o=t[1])}constl=e.BoundingSphere.fromRectangle3D(i,r,0);returne.BoundingSphere.fromRectangle3D(i,r,o,_),e.BoundingSphere.union(l,_,l)},k._terrainHeightsMaxLevel=6,k._defaultMaxTerrainHeight=9e3,k._defaultMinTerrainHeight=-1e5,k._terrainHeights=void0,k._initPromise=void0,Object.defineProperties(k,{initialized:{get:function(){returnn.defined(k._terrainHeights)}}});constS=[e.GeographicProjection,p.WebMercatorProjection],L=S.length,x=Math.cos(i.CesiumMath.toRadians(30)),I=Math.cos(i.CesiumMath.toRadians(150)),D=0,N=1e3;functionR(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);consti=e.positions;if(!n.defined(i)||i.length<2)thrownewa.DeveloperError("At least two positions are required.");if(n.defined(e.arcType)&&e.arcType!==r.ArcType.GEODESIC&&e.arcType!==r.ArcType.RHUMB)thrownewa.DeveloperError("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=n.defaultValue(e.width,1),this._positions=i,this.granularity=n.defaultValue(e.granularity,9999),this.loop=n.defaultValue(e.loop,!1),this.arcType=n.defaultValue(e.arcType,r.ArcType.GEODESIC),this._ellipsoid=t.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(R.prototype,{packedLength:{get:function(){return1+3*this._positions.length+1+1+1+t.Ellipsoid.packedLength+1+1}}}),R.setProjectionAndEllipsoid=function(e,t){leta=0;for(letn=0;n<L;n++)if(tinstanceofS[n]){a=n;break}e._projectionIndex=a,e._ellipsoid=t.ellipsoid};constv=newt.Cartesian3,H=newt.Cartesian3,z=newt.Cartesian3;functionB(e,a,n,i,r){consts=X(i,e,0,v),o=X(i,e,n,H),l=X(i,a,0,z),c=U(o,s,H),u=U(l,s,z);returnt.Cartesian3.cross(u,c,r),t.Cartesian3.normalize(r,r)}constj=newt.Cartographic,G=newt.Cartesian3,V=newt.Cartesian3,Y=newt.Cartesian3;functionq(e,a,n,i,s,c,u,C,d,p,h){if(0===s)return;letg;c===r.ArcType.GEODESIC?g=newo.EllipsoidGeodesic(e,a,u):c===r.ArcType.RHUMB&&(g=newl.EllipsoidRhumbLine(e,a,u));constf=g.surfaceDistance;if(f<s)return;constm=B(e,a,i,u,Y),w=Math.ceil(f/s),y=f/w;letT=y;constE=w-1;letM=C.length;for(letr=0;r<E;r++){conste=g.interpolateUsingSurfaceDistance(T,j),a=X(u,e,n,G),r=X(u,e,i,V);t.Cartesian3.pack(m,C,M),t.Cartesian3.pack(a,d,M),t.Cartesian3.pack(r,p,M),h.push(e.latitude),h.push(e.longitude),M+=3,T+=y}}constF=newt.Cartographic;functionX(e,a,n,i){returnt.Cartographic.clone(a,F),F.height=n,t.Cartographic.toCartesian(F,e,i)}functionU(e,a,n){returnt.Cartesian3.subtract(e,a,n),t.Cartesian3.normalize(n,n),n}functionW(e,a,n,i){returni=U(e,a,i),i=t.Cartesian3.cross(i,n,i),i=t.Cartesian3.normalize(i,i),i=t.Cartesian3.cross(n,i,i),i}R.pack=function(e,i,r){a.Check.typeOf.object("value",e),a.Check.defined("array",i);lets=n.defaultValue(r,0);consto=e._positions,l=o.length;i[s++]=l;for(leta=0;a<l;++a){conste=o[a];t.Cartesian3.pack(e,i,s),s+=3}returni[s++]=e.granularity,i[s++]=e.loop?1:0,i[s++]=e.arcType,t.Ellipsoid.pack(e._ellipsoid,i,s),s+=t.Ellipsoid.packedLength,i[s++]=e._projectionIndex,i[s++]=e._scene3DOnly?1:0,i},R.unpack=function(e,i,r){a.Check.defined("array",e);lets=n.defaultValue(i,0);consto=e[s++],l=newArray(o);for(leta=0;a<o;a++)l[a]=t.Cartesian3.unpack(e,s),s+=3;constc=e[s++],u=1===e[s++],C=e[s++],d=t.Ellipsoid.unpack(e,s);s+=t.Ellipsoid.packedLength;constp=e[s++],h=1===e[s++];returnn.defined(r)||(r=newR({positions:l})),r._positions=l,r.granularity=c,r.loop=u,r.arcType=C,r._ellipsoid=d,r._projectionIndex=p,r._scene3DOnly=h,r};constZ=newt.Cartesian3,$=newt.Cartesian3,J=newt.Cartesian3,Q=newt.Cartesian3,K=0,ee=-1;functionte(e,a,n,r,s){consto=U(n,a,Q),l=W(e,a,o,Z),c=W(r,a,o,$);if(i.CesiumMath.equalsEpsilon(t.Cartesian3.dot(l,c),ee,i.CesiumMath.EPSILON5))returns=t.Cartesian3.cross(o,l,s),s=t.Cartesian3.normalize(s,s),s;s=t.Cartesian3.add(c,l,s),s=t.Cartesian3.normalize(s,s);constu=t.Cartesian3.cross(o,s,J);returnt.Cartesian3.dot(c,u)<K&&(s=t.Cartesian3.negate(s,s)),s}constae=d.Plane.fromPointNormal(t.Cartesian3.ZERO,t.Cartesian3.UNIT_Y),ne=newt.Cartesian3,ie=newt.Cartesian3,re=newt.Cartesian3,se=newt.Cartesian3,oe=newt.Cartesian3,le=newt.Cartesian3,ce=newt.Cartographic,ue=newt.Cartographic,Ce=newt.Cartographic;R.createGeometry=function(e){consta=!e._scene3DOnly;leto=e.loop;constc=e._ellipsoid,u=e.granularity,d=e.arcType,p=newS[e._projectionIndex](c),h=D,g=N;letf,m;constw=e._positions,y=w.length;letT,E,M,_;2===y&&(o=!1);constO=newl.EllipsoidRhumbLine(void0,void0,c);letb,A,k;constP=[w[0]];for(m=0;m<y-1;m++)T=w[m],E=w[m+1],b=C.IntersectionTests.lineSegmentPlane(T,E,ae,le),!n.defined(b)||t.Cartesian3.equalsEpsilon(b,T,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(b,E,i.CesiumMath.EPSILON7)||(e.arcType===r.ArcType.GEODESIC?P.push(t.Cartesian3.clone(b)):e.arcType===r.ArcType.RHUMB&&(k=c.cartesianToCartographic(b,ce).longitude,M=c.cartesianToCartographic(T,ce),_=c.cartesianToCartographic(E,ue),O.setEndPoints(M,_),A=O.findIntersectionWithLongitude(k,Ce),b=c.cartographicToCartesian(A,le),!n.defined(b)||t.Cartesian3.equalsEpsilon(b,T,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(b,E,i.CesiumMath.EPSILON7)||P.push(t.Cartesian3.clone(b)))),P.push(E);o&&(T=w[y-1],E=w[0],b=C.IntersectionTests.lineSegmentPlane(T,E,ae,le),!n.defined(b)||t.Cartesian3.equalsEpsilon(b,T,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(b,E,i.CesiumMath.EPSILON7)||(e.arcType===r.ArcType.GEODESIC?P.push(t.Cartesian3.clone(b)):e.arcType===r.ArcType.RHUMB&&(k=c.cartesianToCartographic(b,ce).longitude,M=c.cartesianToCartographic(T,ce),_=c.cartesianToCartographic(E,ue),O.setEndPoints(M,_),A=O.findIntersectionWithLongitude(k,Ce),b=c.cartographicToCartesian(A,le),!n.defined(b)||t.Cartesian3.equalsEpsilon(b,T,i.CesiumMath.EPSILON7)||t.Cartesian3.equalsEpsilon(b,E,i.CesiumMath.EPSILON7)||P.push(t.Cartesian3.clone(b)))));letL=P.length,x=newArray(L);for(m=0;m<L;m++){conste=t.Cartographic.fromCartesian(P[m],c);e.height=0,x[m]=e}if(x=s.arrayRemoveDuplicates(x,t.Cartographic.equalsEpsilon),L=x.length,L<2)return;constI=[],R=[],v=[],H=[];letz=ne,j=ie,G=re,V=se,Y=oe;constF=x[0],U=x[1],W=x[L-1];for(z=X(c,W,h,z),V=X(c,U,h,V),j=X(c,F,h,j),G=X(c,F,g,G),Y=o?te(z,j,G,V,Y):B(F,U,g,c,Y),t.Cartesian3.pack(Y,R,0),t.Cartesian3.pack(j,v,0),t.Cartesian3.pack(G,H,0),I.push(F.latitude),I.push(F.longitude),q(F,U,h,g,u,d,c,R,v,H,I),m=1;m<L-1;++m){z=t.Cartesian3.clone(j,z),j=t.Cartesian3.clone(V,j);conste=x[m];X(c,e,g,G),X(c,x[m+1],h,V),te(z,j,G,V,Y),f=R.length,t.Cartesian3.pack(Y,R,f),t.Cartesian3.pack(j,v,f),t.Cartesian3.pack(G,H,f),I.push(e.latitude),I.push(e.longitude),q(x[m],x[m+1],h,g,u,d,c,R,v,H,I)}constZ=x[L-1],$=x[L-2];if(j=X(c,Z,h,j),G=X(c,Z,g,G),o){conste=x[0];z=X(c,$,h,z),V=X(c,e,h,V),Y=te(z,j,G,V,Y)}elseY=B($,Z,g,c,Y);if(f=R.length,t.Cartesian3.pack(Y,R,f),t.Cartesian3.pack(j,v,f),t.Cartesian3.pack(G,H,f),I.push(Z.latitude),I.push(Z.longitude),o){for(q(Z,F,h,g,u,d,c,R,v,H,I),f=R.length,m=0;m<3;++m)R[f+m]=R[m],v[f+m]=v[m],H[f+m]=H[m];I.push(F.latitude),I.push(F.longitude)}returnit(o,p,v,H,R,I,a)};constde=newt.Cartesian3,pe=newt.Matrix3,he=newe.Quaternion;functionge(a,n,r,s){consto=U(r,n,de),l=t.Cartesian3.dot(o,a);if(l>x||l<I){constn=U(s,r,Q),o=l<I?i.CesiumMath.PI_OVER_TWO:-i.CesiumMath.PI_OVER_TWO,c=e.Quaternion.fromAxisAngle(n,o,he),u=t.Matrix3.fromQuaternion(c,pe);returnt.Matrix3.multiplyByVector(u,a,a),!0}return!1}constfe=newt.Cartographic,me=newt.Cartesian3,we=newt.Cartesian3;functionye(e,a,n,r,s){consto=t.Cartographic.toCartesian(a,e._ellipsoid,me);letl=t.Cartesian3.add(o,n,we),c=!1;constu=e._ellipsoid;letC=u.cartesianToCartographic(l,fe);Math.abs(a.longitude-C.longitude)>i.CesiumMath.PI_OVER_TWO&&(c=!0,l=t.Cartesian3.subtract(o,n,we),C=u.cartesianToCartographic(l,fe)),C.height=0;constd=e.project(C,s);returns=t.Cartesian3.subtract(d,r,s),s.z=0,s=t.Cartesian3.normalize(s,s),c&&t.Cartesian3.negate(s,s),s}constTe=newt.Cartesian3,Ee=newt.Cartesian3;functionMe(e,a,n,i,r,s){consto=t.Cartesian3.subtract(a,e,Te);t.Cartesian3.normalize(o,o);constl=n-D;letc=t.Cartesian3.multiplyByScalar(o,l,Ee);t.Cartesian3.add(e,c,r);constu=i-N;c=t.Cartesian3.multiplyByScalar(o,u,Ee),t.Cartesian3.add(a,c,s)}const_e=newt.Cartesian3;functionOe(e,a){constn=d.Plane.getPointDistance(ae,e),r=d.Plane.getPointDistance(ae,a);lets=_e;i.CesiumMath.equalsEpsilon(n,0,i.CesiumMath.EPSILON2)?(s=U(a,e,s),t.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),t.Cartesian3.add(e,s,e)):i.CesiumMath.equalsEpsilon(r,0,i.CesiumMath.EPSILON2)&&(s=U(e,a,s),t.Cartesian3.multiplyByScalar(s,i.CesiumMath.EPSILON2,s),t.Cartesian3.add(a,s,a))}functionbe(e,t){consta=Math.abs(e.longitude),n=Math.abs(t.longitude);if(i.CesiumMath.equalsEpsilon(a,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){constn=i.CesiumMath.sign(t.longitude);returne.longitude=n*(a-i.CesiumMath.EPSILON11),1}if(i.CesiumMath.equalsEpsilon(n,i.CesiumMath.PI,i.CesiumMath.EPSILON11)){consta=i.CesiumMath.sign(e.longitude);returnt.longitude=a*(n-i.CesiumMath.EPSILON11),2}return0}constAe=newt.Cartographic,ke=newt.Cartographic,Pe=newt.Cartesian3,Se=newt.Cartesian3,Le=newt.Cartesian3,xe=newt.Cartesian3,Ie=newt.Cartesian3,De=newt.Cartesian3,Ne=[Ae,ke],Re=newt.Rectangle,ve=newt.Cartesian3,He=newt.Cartesian3,ze=newt.Cartesian3,Be=newt.Cartesian3,je=newt.Cartesian3,Ge=newt.Cartesian3,Ve=newt.Cartesian3,Ye=newt.Cartesian3,qe=newt.Cartesian3,Fe=newt.Cartesian3,Xe=newt.Cartesian3,Ue=newt.Cartesian3,We=newt.Cartesian3,Ze=newt.Cartesian3,$e=newc.EncodedCartesian3,Je=newc.EncodedCartesian3,Qe=newt.Cartesian3,Ke=newt.Cartesian3,et=newt.Cartesian3,tt=[newe.BoundingSphere,newe.BoundingSphere],at=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],nt=at.length;functionit(a,n,r,s,o,l,C){letd,p;consth=n._ellipsoid,g=r.length/3-1,f=8*g,m=4*f,w=36*g,y=f>65535?newUint32Array(w):newUint16Array(w),T=newFloat64Array(3*f),E=newFloat32Array(m),M=newFloat32Array(m),_=newFloat32Array(m),O=newFloat32Array(m),b=newFloat32Array(m);letA,P,S,L;C&&(A=newFloat32Array(m),P=newFloat32Array(m),S=newFloat32Array(m),L=newFloat32Array(2*f));constI=l.length/2;letD=0;constN=Ae;N.height=0;constR=ke;R.height=0;letv=Pe,H=Se;if(C)for(p=0,d=1;d<I;d++)N.latitude=l[p],N.longitude=l[p+1],R.latitude=l[p+2],R.longitude=l[p+3],v=n.project(N,v),H=n.project(R,H),D+=t.Cartesian3.distance(v,H),p+=2;constz=s.length/3;H=t.Cartesian3.unpack(s,0,H);letB,j=0;for(p=3,d=1;d<z;d++)v=t.Cartesian3.clone(H,v),H=t.Cartesian3.unpack(s,p,H),j+=t.Cartesian3.distance(v,H),p+=3;p=3;letG=0,V=0,Y=0,q=0,F=!1,X=t.Cartesian3.unpack(r,0,xe),W=t.Cartesian3.unpack(s,0,Se),Z=t.Cartesian3.unpack(o,0,De);if(a){conste=t.Cartesian3.unpack(r,r.length-6,Le);ge(Z,e,X,W)&&(Z=t.Cartesian3.negate(Z,Z))}let$=0,J=0,Q=0;for(d=0;d<g;d++){conste=t.Cartesian3.clone(X,Le),a=t.Cartesian3.clone(W,Pe);letu,d,g,f,m=t.Cartesian3.clone(Z,Ie);if(F&&(m=t.Cartesian3.negate(m,m)),X=t.Cartesian3.unpack(r,p,xe),W=t.Cartesian3.unpack(s,p,Se),Z=t.Cartesian3.unpack(o,p,De),F=ge(Z,e,X,W),N.latitude=l[G],N.longitude=l[G+1],R.latitude=l[G+2],R.longitude=l[G+3],C){conste=be(N,R);u=n.project(N,je),d=n.project(R,Ge);consta=U(d,u,Qe);a.y=Math.abs(a.y),g=Ve,f=Ye,0===e||t.Cartesian3.dot(a,t.Cartesian3.UNIT_Y)>x?(g=ye(n,N,m,u,Ve),f=ye(n,R,Z,d,Ye)):1===e?(f=ye(n,R,Z,d,Ye),g.x=0,g.y=i.CesiumMath.sign(N.longitude-Math.abs(R.longitude)),g.z=0):(g=ye(n,N,m,u,Ve),f.x=0,f.y=i.CesiumMath.sign(N.longitude-R.longitude),f.z=0)}constw=t.Cartesian3.distance(a,W),y=c.EncodedCartesian3.fromCartesian(e,$e),I=t.Cartesian3.subtract(X,e,qe),v=t.Cartesian3.normalize(I,Ue);letH=t.Cartesian3.subtract(a,e,Fe);H=t.Cartesian3.normalize(H,H);letz=t.Cartesian3.cross(v,H,Ue);z=t.Cartesian3.normalize(z,z);letK=t.Cartesian3.cross(H,m,We);K=t.Cartesian3.normalize(K,K);letee=t.Cartesian3.subtract(W,X,Xe);ee=t.Cartesian3.normalize(ee,ee);lette=t.Cartesian3.cross(Z,ee,Ze);te=t.Cartesian3.normalize(te,te);constae=w/j,ne=$/j;letie,re,se,oe=0,le=0,ce=0;if(C){oe=t.Cartesian3.distance(u,d),ie=c.EncodedCartesian3.fromCartesian(u,Je),re=t.Cartesian3.subtract(d,u,Qe),se=t.Cartesian3.normalize(re,Ke);conste=se.x;se.x=se.y,se.y=-e,le=oe/D,ce=J/D}for(B=0;B<8;B++){conste=q+4*B,a=V+2*B,n=e+3,i=B<4?1:-1,r=2===B||3===B||6===B||7===B?1:-1;t.Cartesian3.pack(y.high,E,e),E[n]=I.x,t.Cartesian3.pack(y.low,M,e),M[n]=I.y,t.Cartesian3.pack(K,_,e),_[n]=I.z,t.Cartesian3.pack(te,O,e),O[n]=ae*i,t.Cartesian3.pack(z,b,e);lets=ne*r;0===s&&r<0&&(s=9),b[n]=s,C&&(A[e]=ie.high.x,A[e+1]=ie.high.y,A[e+2]=ie.low.x,A[e+3]=ie.low.y,S[e]=-g.y,S[e+1]=g.x,S[e+2]=f.y,S[e+3]=-f.x,P[e]=re.x,P[e+1]=re.y,P[e+2]=se.x,P[e+3]=se.y,L[a]=le*i,s=ce*r,0===s&&r<0&&(s=9),L[a+1]=s)}constue=ze,Ce=Be,de=ve,pe=He,he=t.Rectangle.fromCartographicArray(Ne,Re),fe=k.getMinimumMaximumHeights(he,h),me=fe.minimumTerrainHeight,we=fe.maximumTerrainHeight;Q+=me,Q+=we,Me(e,a,me,we,ue,de),Me(X,W,me,we,Ce,pe);letTe=t.Cartesian3.multiplyByScalar(z,i.CesiumMath.EPSILON5,et);t.Cartesian3.add(ue,Te,ue),t.Cartesian3.add(Ce,Te,Ce),t.Cartesian3.add(de,Te,de),t.Cartesian3.add(pe,Te,pe),Oe(ue,Ce),Oe(de,pe),t.Cartesian3.pack(ue,T,Y),t.Cartesian3.pack(Ce,T,Y+3),t.Cartesian3.pack(pe,T,Y+6),t.Cartesian3.pack(de,T,Y+9),Te=t.Cartesian3.multiplyByScalar(z,-2*i.CesiumMath.EPSILON5,et),t.Cartesian3.add(ue,Te,ue),t.Cartesian3.add(Ce,Te,Ce),t.Cartesian3.add(de,Te,de),t.Cartesian3.add(pe,Te,pe),Oe(ue,Ce),Oe(de,pe),t.Cartesian3.pack(ue,T,Y+12),t.Cartesian3.pack(Ce,T,Y+15),t.Cartesian3.pack(pe,T,Y+18),t.Cartesian3.pack(de,T,Y+21),G+=2,p+=3,V+=16,Y+=24,q+=32,$+=w,J+=oe}p=0;letK=0;for(d=0;d<g;d++){for(B=0;B<nt;B++)y[p+B]=at[B]+K;K+=8,p+=nt}constee=tt;e.BoundingSphere.fromVertices(r,t.Cartesian3.ZERO,3,ee[0]),e.BoundingSphere.fromVertices(s,t.Cartesian3.ZERO,3,ee[1]);constte=e.BoundingSphere.fromBoundingSpheres(ee);te.radius+=Q/(2*g);constae={position:newu.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:T}),startHiAndForwardOffsetX:rt(E),startLoAndForwardOffsetY:rt(M),startNormalAndForwardOffsetZ:rt(_),endNormalAndTextureCoordinateNormalizationX:rt(O),rightNormalAndTextureCoordinateNormalizationY:rt(b)};returnC&&(ae.startHiLo2D=rt(A),ae.offsetAndRight2D=rt(P),ae.startEndNormals2D=rt(S),ae.texcoordNormalization2D=newu.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:L})),newu.Geometry({attributes:ae,indices:y,boundingSphere:te})}functionrt(e){returnnewu.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}functionst(e,t){returnk.initialize().then((function(){returnn.defined(t)&&(e=R.unpack(e,t)),R.createGeometry(e)}))}returnR._projectNormal=ye,st}));
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./ArcType-0cf52f8c","./BoundingRectangle-d5f7d679","./Transforms-3ac41eb6","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./EllipsoidGeodesic-dc94f381","./EllipsoidTangentPlane-53e32153","./GeometryAttribute-a441ff32","./GeometryInstance-97bd792f","./GeometryOffsetAttribute-ec11b721","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonGeometryLibrary-5dd81ed2","./PolygonPipeline-113e3161","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea","./arrayRemoveDuplicates-06991c15","./EllipsoidRhumbLine-daebc75b","./GeometryAttributes-7df9bef6"],(function(e,t,o,r,i,n,a,s,l,c,u,p,d,y,g,m,h,f,b,_,C,P,x,T,w,A,I,E){"use strict";constv=newt.Cartographic,G=newt.Cartographic;functionO(e,t,o,r){consti=r.cartesianToCartographic(e,v),n=i.height,a=r.cartesianToCartographic(t,G);a.height=n,r.cartographicToCartesian(a,t);consts=r.cartesianToCartographic(o,G);s.height=n-100,r.cartographicToCartesian(s,o)}constH=newr.BoundingRectangle,D=newt.Cartesian3,V=newt.Cartesian3,L=newt.Cartesian3,N=newt.Cartesian3,F=newt.Cartesian3,R=newt.Cartesian3;letM=newt.Cartesian3,k=newt.Cartesian3,S=newt.Cartesian3;constB=newt.Cartesian2,z=newt.Cartesian2,U=newt.Cartesian3,W=newi.Quaternion,Y=newt.Matrix3,j=newt.Matrix3;functionQ(o){constr=o.vertexFormat,n=o.geometry,s=o.shadowVolume,l=n.attributes.position.values,u=e.defined(n.attributes.st)?n.attributes.st.values:void0;letd=l.length;consty=o.wall,g=o.top||y,m=o.bottom||y;if(r.st||r.normal||r.tangent||r.bitangent||s){constp=o.boundingRectangle,h=o.tangentPlane,f=o.ellipsoid,b=o.stRotation,_=o.perPositionHeight,C=B;C.x=p.x,C.y=p.y;constP=r.st?newFloat32Array(d/3*2):void0;letx;r.normal&&(x=_&&g&&!y?n.attributes.normal.values:newFloat32Array(d));constT=r.tangent?newFloat32Array(d):void0,w=r.bitangent?newFloat32Array(d):void0,A=s?newFloat32Array(d):void0;letI=0,E=0,v=V,G=L,H=N,Q=!0,q=Y,K=j;if(0!==b){lete=i.Quaternion.fromAxisAngle(h._plane.normal,b,W);q=t.Matrix3.fromQuaternion(e,q),e=i.Quaternion.fromAxisAngle(h._plane.normal,-b,W),K=t.Matrix3.fromQuaternion(e,K)}elseq=t.Matrix3.clone(t.Matrix3.IDENTITY,q),K=t.Matrix3.clone(t.Matrix3.IDENTITY,K);letZ=0,J=0;g&&m&&(Z=d/2,J=d/3,d/=2);for(leti=0;i<d;i+=3){constn=t.Cartesian3.fromArray(l,i,U);if(r.st&&!e.defined(u)){lete=t.Matrix3.multiplyByVector(q,n,D);e=f.scaleToGeodeticSurface(e,e);consto=h.projectPointOntoPlane(e,z);t.Cartesian2.subtract(o,C,o);constr=a.CesiumMath.clamp(o.x/p.width,0,1),i=a.CesiumMath.clamp(o.y/p.height,0,1);m&&(P[I+J]=r,P[I+1+J]=i),g&&(P[I]=r,P[I+1]=i),I+=2}if(r.normal||r.tangent||r.bitangent||s){conste=E+1,c=E+2;if(y){if(i+3<d){conste=t.Cartesian3.fromArray(l,i+3,F);if(Q){consto=t.Cartesian3.fromArray(l,i+d,R);_&&O(n,e,o,f),t.Cartesian3.subtract(e,n,e),t.Cartesian3.subtract(o,n,o),v=t.Cartesian3.normalize(t.Cartesian3.cross(o,e,v),v),Q=!1}t.Cartesian3.equalsEpsilon(e,n,a.CesiumMath.EPSILON10)&&(Q=!0)}(r.tangent||r.bitangent)&&(H=f.geodeticSurfaceNormal(n,H),r.tangent&&(G=t.Cartesian3.normalize(t.Cartesian3.cross(H,v,G),G)))}elsev=f.geodeticSurfaceNormal(n,v),(r.tangent||r.bitangent)&&(_&&(M=t.Cartesian3.fromArray(x,E,M),k=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,M,k),k=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(K,k,k),k),r.bitangent&&(S=t.Cartesian3.normalize(t.Cartesian3.cross(M,k,S),S))),G=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,v,G),G=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(K,G,G),G),r.bitangent&&(H=t.Cartesian3.normalize(t.Cartesian3.cross(v,G,H),H)));r.normal&&(o.wall?(x[E+Z]=v.x,x[e+Z]=v.y,x[c+Z]=v.z):m&&(x[E+Z]=-v.x,x[e+Z]=-v.y,x[c+Z]=-v.z),(g&&!_||y)&&(x[E]=v.x,x[e]=v.y,x[c]=v.z)),s&&(y&&(v=f.geodeticSurfaceNormal(n,v)),A[E+Z]=-v.x,A[e+Z]=-v.y,A[c+Z]=-v.z),r.tangent&&(o.wall?(T[E+Z]=G.x,T[e+Z]=G.y,T[c+Z]=G.z):m&&(T[E+Z]=-G.x,T[e+Z]=-G.y,T[c+Z]=-G.z),g&&(_?(T[E]=k.x,T[e]=k.y,T[c]=k.z):(T[E]=G.x,T[e]=G.y,T[c]=G.z))),r.bitangent&&(m&&(w[E+Z]=H.x,w[e+Z]=H.y,w[c+Z]=H.z),g&&(_?(w[E]=S.x,w[e]=S.y,w[c]=S.z):(w[E]=H.x,w[e]=H.y,w[c]=H.z))),E+=3}}r.st&&!e.defined(u)&&(n.attributes.st=newc.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:P})),r.normal&&(n.attributes.normal=newc.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:x})),r.tangent&&(n.attributes.tangent=newc.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T})),r.bitangent&&(n.attributes.bitangent=newc.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:w})),s&&(n.attributes.extrudeDirection=newc.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A}))}if(o.extrude&&e.defined(o.offsetAttribute)){conste=l.length/3;lett=newUint8Array(e);if(o.offsetAttribute===p.GeometryOffsetAttribute.TOP)g&&m||y?t=t.fill(1,0,e/2):g&&(t=t.fill(1));else{conste=o.offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}n.attributes.applyOffset=newc.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}returnn}constq=newt.Cartographic,K=newt.Cartographic,Z={westOverIDL:0,eastOverIDL:0};letJ=news.EllipsoidGeodesic;functionX(r,i,n,l,c){if(c=e.defaultValue(c,newt.Rectangle),!e.defined(r)||r.length<3)returnc.west=0,c.north=0,c.south=0,c.east=0,c;if(n===o.ArcType.RHUMB)returnt.Rectangle.fromCartesianArray(r,i,c);J.ellipsoid.equals(i)||(J=news.EllipsoidGeodesic(void0,void0,i)),c.west=Number.POSITIVE_INFINITY,c.east=Number.NEGATIVE_INFINITY,c.south=Number.POSITIVE_INFINITY,c.north=Number.NEGATIVE_INFINITY,Z.westOverIDL=Number.POSITIVE_INFINITY,Z.eastOverIDL=Number.NEGATIVE_INFINITY;constu=1/a.CesiumMath.chordLength(l,i.maximumRadius),p=r.length;letd,y=i.cartesianToCartographic(r[0],K),g=q;for(lete=1;e<p;e++)d=g,g=y,y=i.cartesianToCartographic(r[e],d),J.setEndPoints(g,y),ee(J,u,c,Z);returnd=g,g=y,y=i.cartesianToCartographic(r[0],d),J.setEndPoints(g,y),ee(J,u,c,Z),c.east-c.west>Z.eastOverIDL-Z.westOverIDL&&(c.west=Z.westOverIDL,c.east=Z.eastOverIDL,c.east>a.CesiumMath.PI&&(c.east=c.east-a.CesiumMath.TWO_PI),c.west>a.CesiumMath.PI&&(c.west=c.west-a.CesiumMath.TWO_PI)),c}const$=newt.Cartographic;functionee(e,t,o,r){consti=e.surfaceDistance,n=Math.ceil(i*t),s=n>0?i/(n-1):Number.POSITIVE_INFINITY;letl=0;for(letc=0;c<n;c++){constt=e.interpolateUsingSurfaceDistance(l,$);l+=s;consti=t.longitude,n=t.latitude;o.west=Math.min(o.west,i),o.east=Math.max(o.east,i),o.south=Math.min(o.south,n),o.north=Math.max(o.north,n);constc=i>=0?i:i+a.CesiumMath.TWO_PI;r.westOverIDL=Math.min(r.westOverIDL,c),r.eastOverIDL=Math.max(r.eastOverIDL,c)}}constte=[];functionoe(t,o,r,i,n,a,s,c,p,d){consth={walls:[]};letf;if(s||c){constn=g.PolygonGeometryLibrary.createGeometryFromPositions(t,o,r,i,a,p,d),l=n.attributes.position.values,m=n.indices;letb,_;if(s&&c){constt=l.concat(l);b=t.length/3,_=y.IndexDatatype.createTypedArray(b,2*m.length),_.set(m);consto=m.length,i=b/2;for(f=0;f<o;f+=3){conste=_[f]+i,t=_[f+1]+i,r=_[f+2]+i;_[f+o]=r,_[f+1+o]=t,_[f+2+o]=e}if(n.attributes.position.values=t,a&&p.normal){conste=n.attributes.normal.values;n.attributes.normal.values=newFloat32Array(t.length),n.attributes.normal.values.set(e)}if(p.st&&e.defined(r)){conste=n.attributes.st.values;n.attributes.st.values=newFloat32Array(2*b),n.attributes.st.values=e.concat(e)}n.indices=_}elseif(c){for(b=l.length/3,_=y.IndexDatatype.createTypedArray(b,m.length),f=0;f<m.length;f+=3)_[f]=m[f+2],_[f+1]=m[f+1],_[f+2]=m[f];n.indices=_}h.topAndBottom=newu.GeometryInstance({geometry:n})}letb=n.outerRing,_=l.EllipsoidTangentPlane.fromPoints(b,t),C=_.projectPointsOntoPlane(b,te),P=m.PolygonPipeline.computeWindingOrder2D(C);P===m.WindingOrder.CLOCKWISE&&(b=b.slice().reverse());letx=g.PolygonGeometryLibrary.computeWallGeometry(b,r,t,i,a,d);h.walls.push(newu.GeometryInstance({geometry:x}));constT=n.holes;for(f=0;f<T.length;f++){lete=T[f];_=l.EllipsoidTangentPlane.fromPoints(e,t),C=_.projectPointsOntoPlane(e,te),P=m.PolygonPipeline.computeWindingOrder2D(C),P===m.WindingOrder.COUNTER_CLOCKWISE&&(e=e.slice().reverse()),x=g.PolygonGeometryLibrary.computeWallGeometry(e,r,t,i,a,d),h.walls.push(newu.GeometryInstance({geometry:x}))}returnh}functionre(r){if(n.Check.typeOf.object("options",r),n.Check.typeOf.object("options.polygonHierarchy",r.polygonHierarchy),e.defined(r.perPositionHeight)&&r.perPositionHeight&&e.defined(r.height))thrownewn.DeveloperError("Cannot use both options.perPositionHeight and options.height");if(e.defined(r.arcType)&&r.arcType!==o.ArcType.GEODESIC&&r.arcType!==o.ArcType.RHUMB)thrownewn.DeveloperError("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");consti=r.polygonHierarchy,s=e.defaultValue(r.vertexFormat,h.VertexFormat.DEFAULT),l=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84),c=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),u=e.defaultValue(r.stRotation,0),p=r.textureCoordinates,d=e.defaultValue(r.perPositionHeight,!1),y=d&&e.defined(r.extrudedHeight);letm=e.defaultValue(r.height,0),f=e.defaultValue(r.extrudedHeight,m);if(!y){conste=Math.max(m,f);f=Math.min(m,f),m=e}this._vertexFormat=h.VertexFormat.clone(s),this._ellipsoid=t.Ellipsoid.clone(l),this._granularity=c,this._stRotation=u,this._height=m,this._extrudedHeight=f,this._closeTop=e.defaultValue(r.closeTop,!0),this._closeBottom=e.defaultValue(r.closeBottom,!0),this._polygonHierarchy=i,this._perPositionHeight=d,this._perPositionHeightExtrude=y,this._shadowVolume=e.defaultValue(r.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=r.offsetAttribute,this._arcType=e.defaultValue(r.arcType,o.ArcType.GEODESIC),this._rectangle=void0,this._textureCoordinateRotationPoints=void0,this._textureCoordinates=p,this.packedLength=g.PolygonGeometryLibrary.computeHierarchyPackedLength(i,t.Cartesian3)+t.Ellipsoid.packedLength+h.VertexFormat.packedLength+(p?g.PolygonGeometryLibrary.computeHierarchyPackedLength(p,t.Cartesian2):1)+12}re.fromPositions=function(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT),n.Check.defined("options.positions",t.positions);consto={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates};returnnewre(o)},re.pack=function(o,r,i){returnn.Check.typeOf.object("value",o),n.Check.defined("array",r),i=e.defaultValue(i,0),i=g.PolygonGeometryLibrary.packPolygonHierarchy(o._polygonHierarchy,r,i,t.Cartesian3),t.Ellipsoid.pack(o._ellipsoid,r,i),i+=t.Ellipsoid.packedLength,h.VertexFormat.pack(o._vertexFormat,r,i),i+=h.VertexFormat.packedLength,r[i++]=o._height,r[i++]=o._extrudedHeight,r[i++]=o._granularity,r[i++]=o._stRotation,r[i++]=o._perPositionHeightExtrude?1:0,r[i++]=o._perPositionHeight?1:0,r[i++]=o._closeTop?1:0,r[i++]=o._closeBottom?1:0,r[i++]=o._shadowVolume?1:0,r[i++]=e.defaultValue(o._offsetAttribute,-1),r[i++]=o._arcType,e.defined(o._textureCoordinates)?i=g.PolygonGeometryLibrary.packPolygonHierarchy(o._textureCoordinates,r,i,t.Cartesian2):r[i++]=-1,r[i++]=o.packedLength,r};constie=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),ne=newh.VertexFormat,ae={polygonHierarchy:{}};functionse(e){constt=-e._stRotation;if(0===t)return[0,0,0,1,1,0];consto=e._ellipsoid,r=e._polygonHierarchy.positions,i=e.rectangle;returnc.Geometry._textureCoordinateRotationPoints(r,t,o,i)}functionle(o,r){returne.defined(r)&&(o=re.unpack(o,r)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),re.createGeometry(o)}returnre.unpack=function(o,r,i){n.Check.defined("array",o),r=e.defaultValue(r,0);consta=g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,r,t.Cartesian3);r=a.startingIndex,deletea.startingIndex;consts=t.Ellipsoid.unpack(o,r,ie);r+=t.Ellipsoid.packedLength;constl=h.VertexFormat.unpack(o,r,ne);r+=h.VertexFormat.packedLength;constc=o[r++],u=o[r++],p=o[r++],d=o[r++],y=1===o[r++],m=1===o[r++],f=1===o[r++],b=1===o[r++],_=1===o[r++],C=o[r++],P=o[r++],x=-1===o[r]?void0:g.PolygonGeometryLibrary.unpackPolygonHierarchy(o,r,t.Cartesian2);e.defined(x)?(r=x.startingIndex,deletex.startingIndex):r++;constT=o[r++];returne.defined(i)||(i=newre(ae)),i._polygonHierarchy=a,i._ellipsoid=t.Ellipsoid.clone(s,i._ellipsoid),i._vertexFormat=h.VertexFormat.clone(l,i._vertexFormat),i._height=c,i._extrudedHeight=u,i._granularity=p,i._stRotation=d,i._perPositionHeightExtrude=y,i._perPositionHeight=m,i._closeTop=f,i._closeBottom=b,i._shadowVolume=_,i._offsetAttribute=-1===C?void0:C,i._arcType=P,i._textureCoordinates=x,i.packedLength=T,i},re.computeRectangle=function(r,i){n.Check.typeOf.object("options",r),n.Check.typeOf.object("options.polygonHierarchy",r.polygonHierarchy);consts=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(r.arcType,o.ArcType.GEODESIC);if(l!==o.ArcType.GEODESIC&&l!==o.ArcType.RHUMB)thrownewn.DeveloperError("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");constc=r.polygonHierarchy,u=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84);returnX(c.positions,u,l,s,i)},re.createGeometry=function(t){consto=t._vertexFormat,r=t._ellipsoid,n=t._granularity,s=t._stRotation,h=t._polygonHierarchy,f=t._perPositionHeight,b=t._closeTop,_=t._closeBottom,C=t._arcType,P=t._textureCoordinates,x=e.defined(P);letT=h.positions;if(T.length<3)return;constw=l.EllipsoidTangentPlane.fromPoints(T,r),A=g.PolygonGeometryLibrary.polygonsFromHierarchy(h,x,w.projectPointsOntoPlane.bind(w),!f,r),I=A.hierarchy,E=A.polygons,v=function(e){returne},G=x?g.PolygonGeometryLibrary.polygonsFromHierarchy(P,!0,v,!1).polygons:void0;if(0===I.length)return;T=I[0].outerRing;constO=g.PolygonGeometryLibrary.computeBoundingRectangle(w.plane.normal,w.projectPointOntoPlane.bind(w),T,s,H),D=[],V=t._height,L=t._extrudedHeight,N=t._perPositionHeightExtrude||!a.CesiumMath.equalsEpsilon(V,L,0,a.CesiumMath.EPSILON2),F={perPositionHeight:f,vertexFormat:o,geometry:void0,tangentPlane:w,boundingRectangle:O,ellipsoid:r,stRotation:s,textureCoordinates:void0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:C};letR;if(N)for(F.extrude=!0,F.top=b,F.bottom=_,F.shadowVolume=t._shadowVolume,F.offsetAttribute=t._offsetAttribute,R=0;R<E.length;R++){conste=oe(r,E[R],x?G[R]:void0,n,I[R],f,b,_,o,C);lett;b&&_?(t=e.topAndBottom,F.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(t.geometry,V,L,r,f)):b?(t=e.topAndBottom,t.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,V,r,!f),F.geometry=t.geometry):_&&(t=e.topAndBottom,t.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(t.geometry.attributes.position.values,L,r,!0),F.geometry=t.geometry),(b||_)&&(F.wall=!1,t.geometry=Q(F),D.push(t));consti=e.walls;F.wall=!0;for(leto=0;o<i.length;o++){conste=i[o];F.geometry=g.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(e.geometry,V,L,r,f),e.geometry=Q(F),D.push(e)}}elsefor(R=0;R<E.length;R++){consti=newu.GeometryInstance({geometry:g.PolygonGeometryLibrary.createGeometryFromPositions(r,E[R],x?G[R]:void0,n,f,o,C)});if(i.geometry.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(i.geometry.attributes.position.values,V,r,!f),F.geometry=i.geometry,i.geometry=Q(F),e.defined(t._offsetAttribute)){conste=i.geometry.attributes.position.values.length,o=t._offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1,r=newUint8Array(e/3).fill(o);i.geometry.attributes.applyOffset=newc.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}D.push(i)}constM=d.GeometryPipeline.combineInstances(D)[0];M.attributes.position.values=newFloat64Array(M.attributes.position.values),M.indices=y.IndexDatatype.createTypedArray(M.attributes.position.values.length/3,M.indices);constk=M.attributes,S=i.BoundingSphere.fromVertices(k.position.values);returno.position||deletek.position,newc.Geometry({attributes:k,indices:M.indices,primitiveType:M.primitiveType,boundingSphere:S,offsetAttribute:t._offsetAttribute})},re.createShadowVolume=function(e,t,o){constr=e._granularity,i=e._ellipsoid,n=t(r,i),a=o(r,i);returnnewre({polygonHierarchy:e._polygonHierarchy,ellipsoid:i,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:n,height:a,vertexFormat:h.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(re.prototype,{rectangle:{get:function(){if(!e.defined(this._rectangle)){conste=this._polygonHierarchy.positions;this._rectangle=X(e,this._ellipsoid,this._arcType,this._granularity)}returnthis._rectangle}},textureCoordinateRotationPoints:{get:function(){returne.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=se(this)),this._textureCoordinateRotationPoints}}}),le}));
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./ArcType-0cf52f8c","./Transforms-3ac41eb6","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./EllipsoidTangentPlane-53e32153","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryInstance-97bd792f","./GeometryOffsetAttribute-ec11b721","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonGeometryLibrary-5dd81ed2","./PolygonPipeline-113e3161","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea","./arrayRemoveDuplicates-06991c15","./EllipsoidRhumbLine-daebc75b"],(function(e,t,i,o,r,n,a,s,l,y,p,c,u,d,f,g,h,m,b,P,E,A,_,G,T){"use strict";constH=[],L=[];functionC(e,t,o,r,p){constc=a.EllipsoidTangentPlane.fromPoints(t,e),g=c.projectPointsOntoPlane(t,H),h=f.PolygonPipeline.computeWindingOrder2D(g);letm,b;h===f.WindingOrder.CLOCKWISE&&(g.reverse(),t=t.slice().reverse());letP=t.length,E=0;if(r)for(m=newFloat64Array(2*P*3),b=0;b<P;b++){conste=t[b],i=t[(b+1)%P];m[E++]=e.x,m[E++]=e.y,m[E++]=e.z,m[E++]=i.x,m[E++]=i.y,m[E++]=i.z}else{letr=0;if(p===i.ArcType.GEODESIC)for(b=0;b<P;b++)r+=d.PolygonGeometryLibrary.subdivideLineCount(t[b],t[(b+1)%P],o);elseif(p===i.ArcType.RHUMB)for(b=0;b<P;b++)r+=d.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[b],t[(b+1)%P],o);for(m=newFloat64Array(3*r),b=0;b<P;b++){letr;p===i.ArcType.GEODESIC?r=d.PolygonGeometryLibrary.subdivideLine(t[b],t[(b+1)%P],o,L):p===i.ArcType.RHUMB&&(r=d.PolygonGeometryLibrary.subdivideRhumbLine(e,t[b],t[(b+1)%P],o,L));constn=r.length;for(lete=0;e<n;++e)m[E++]=r[e]}}P=m.length/3;constA=2*P,_=u.IndexDatatype.createTypedArray(P,A);for(E=0,b=0;b<P-1;b++)_[E++]=b,_[E++]=b+1;return_[E++]=P-1,_[E++]=0,newy.GeometryInstance({geometry:news.Geometry({attributes:newl.GeometryAttributes({position:news.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})}),indices:_,primitiveType:s.PrimitiveType.LINES})})}functionv(e,t,o,r,p){constc=a.EllipsoidTangentPlane.fromPoints(t,e),g=c.projectPointsOntoPlane(t,H),h=f.PolygonPipeline.computeWindingOrder2D(g);letm,b;h===f.WindingOrder.CLOCKWISE&&(g.reverse(),t=t.slice().reverse());letP=t.length;constE=newArray(P);letA=0;if(r)for(m=newFloat64Array(2*P*3*2),b=0;b<P;++b){E[b]=A/3;conste=t[b],i=t[(b+1)%P];m[A++]=e.x,m[A++]=e.y,m[A++]=e.z,m[A++]=i.x,m[A++]=i.y,m[A++]=i.z}else{letr=0;if(p===i.ArcType.GEODESIC)for(b=0;b<P;b++)r+=d.PolygonGeometryLibrary.subdivideLineCount(t[b],t[(b+1)%P],o);elseif(p===i.ArcType.RHUMB)for(b=0;b<P;b++)r+=d.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[b],t[(b+1)%P],o);for(m=newFloat64Array(3*r*2),b=0;b<P;++b){letr;E[b]=A/3,p===i.ArcType.GEODESIC?r=d.PolygonGeometryLibrary.subdivideLine(t[b],t[(b+1)%P],o,L):p===i.ArcType.RHUMB&&(r=d.PolygonGeometryLibrary.subdivideRhumbLine(e,t[b],t[(b+1)%P],o,L));constn=r.length;for(lete=0;e<n;++e)m[A++]=r[e]}}P=m.length/6;const_=E.length,G=2*(2*P+_),T=u.IndexDatatype.createTypedArray(P+_,G);for(A=0,b=0;b<P;++b)T[A++]=b,T[A++]=(b+1)%P,T[A++]=b+P,T[A++]=(b+1)%P+P;for(b=0;b<_;b++){conste=E[b];T[A++]=e,T[A++]=e+P}returnnewy.GeometryInstance({geometry:news.Geometry({attributes:newl.GeometryAttributes({position:news.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})}),indices:T,primitiveType:s.PrimitiveType.LINES})})}functionO(o){if(r.Check.typeOf.object("options",o),r.Check.typeOf.object("options.polygonHierarchy",o.polygonHierarchy),o.perPositionHeight&&e.defined(o.height))thrownewr.DeveloperError("Cannot use both options.perPositionHeight and options.height");if(e.defined(o.arcType)&&o.arcType!==i.ArcType.GEODESIC&&o.arcType!==i.ArcType.RHUMB)thrownewr.DeveloperError("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");consta=o.polygonHierarchy,s=e.defaultValue(o.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(o.granularity,n.CesiumMath.RADIANS_PER_DEGREE),y=e.defaultValue(o.perPositionHeight,!1),p=y&&e.defined(o.extrudedHeight),c=e.defaultValue(o.arcType,i.ArcType.GEODESIC);letu=e.defaultValue(o.height,0),f=e.defaultValue(o.extrudedHeight,u);if(!p){conste=Math.max(u,f);f=Math.min(u,f),u=e}this._ellipsoid=t.Ellipsoid.clone(s),this._granularity=l,this._height=u,this._extrudedHeight=f,this._arcType=c,this._polygonHierarchy=a,this._perPositionHeight=y,this._perPositionHeightExtrude=p,this._offsetAttribute=o.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=d.PolygonGeometryLibrary.computeHierarchyPackedLength(a,t.Cartesian3)+t.Ellipsoid.packedLength+8}O.pack=function(i,o,n){returnr.Check.typeOf.object("value",i),r.Check.defined("array",o),n=e.defaultValue(n,0),n=d.PolygonGeometryLibrary.packPolygonHierarchy(i._polygonHierarchy,o,n,t.Cartesian3),t.Ellipsoid.pack(i._ellipsoid,o,n),n+=t.Ellipsoid.packedLength,o[n++]=i._height,o[n++]=i._extrudedHeight,o[n++]=i._granularity,o[n++]=i._perPositionHeightExtrude?1:0,o[n++]=i._perPositionHeight?1:0,o[n++]=i._arcType,o[n++]=e.defaultValue(i._offsetAttribute,-1),o[n]=i.packedLength,o};constD=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),x={polygonHierarchy:{}};functionI(i,o){returne.defined(o)&&(i=O.unpack(i,o)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),O.createGeometry(i)}returnO.unpack=function(i,o,n){r.Check.defined("array",i),o=e.defaultValue(o,0);consta=d.PolygonGeometryLibrary.unpackPolygonHierarchy(i,o,t.Cartesian3);o=a.startingIndex,deletea.startingIndex;consts=t.Ellipsoid.unpack(i,o,D);o+=t.Ellipsoid.packedLength;constl=i[o++],y=i[o++],p=i[o++],c=1===i[o++],u=1===i[o++],f=i[o++],g=i[o++],h=i[o];returne.defined(n)||(n=newO(x)),n._polygonHierarchy=a,n._ellipsoid=t.Ellipsoid.clone(s,n._ellipsoid),n._height=l,n._extrudedHeight=y,n._granularity=p,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=-1===g?void0:g,n.packedLength=h,n},O.fromPositions=function(t){t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT),r.Check.defined("options.positions",t.positions);consti={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,arcType:t.arcType,offsetAttribute:t.offsetAttribute};returnnewO(i)},O.createGeometry=function(t){consti=t._ellipsoid,r=t._granularity,a=t._polygonHierarchy,l=t._perPositionHeight,y=t._arcType,u=d.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(a,!l,i);if(0===u.length)return;letg;consth=[],m=n.CesiumMath.chordLength(r,i.maximumRadius),b=t._height,P=t._extrudedHeight,E=t._perPositionHeightExtrude||!n.CesiumMath.equalsEpsilon(b,P,0,n.CesiumMath.EPSILON2);letA,_;if(E)for(_=0;_<u.length;_++){if(g=v(i,u[_],m,l,y),g.geometry=d.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(g.geometry,b,P,i,l),e.defined(t._offsetAttribute)){conste=g.geometry.attributes.position.values.length/3;leti=newUint8Array(e);t._offsetAttribute===p.GeometryOffsetAttribute.TOP?i=i.fill(1,0,e/2):(A=t._offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1,i=i.fill(A)),g.geometry.attributes.applyOffset=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}h.push(g)}elsefor(_=0;_<u.length;_++){if(g=C(i,u[_],m,l,y),g.geometry.attributes.position.values=f.PolygonPipeline.scaleToGeodeticHeight(g.geometry.attributes.position.values,b,i,!l),e.defined(t._offsetAttribute)){conste=g.geometry.attributes.position.values.length;A=t._offsetAttribute===p.GeometryOffsetAttribute.NONE?0:1;consti=newUint8Array(e/3).fill(A);g.geometry.attributes.applyOffset=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}h.push(g)}constG=c.GeometryPipeline.combineInstances(h)[0],T=o.BoundingSphere.fromVertices(G.attributes.position.values);returnnews.Geometry({attributes:G.attributes,indices:G.indices,primitiveType:G.primitiveType,boundingSphere:T,offsetAttribute:t._offsetAttribute})},I}));
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./ArcType-0cf52f8c","./arrayRemoveDuplicates-06991c15","./Transforms-3ac41eb6","./Color-305ce16b","./ComponentDatatype-4a60b8d6","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./IndexDatatype-db156785","./PolylinePipeline-0e310844","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./IntersectionTests-68fbc42d","./Plane-e20fba8c"],(function(e,t,o,r,n,i,a,l,s,c,p,d,u,f,y,m,h,C,g,w){"use strict";constE=[];function_(e,t,o,r,n){consta=E;letl;a.length=n;consts=o.red,c=o.green,p=o.blue,d=o.alpha,u=r.red,f=r.green,y=r.blue,m=r.alpha;if(i.Color.equals(o,r)){for(l=0;l<n;l++)a[l]=i.Color.clone(o);returna}consth=(u-s)/n,C=(f-c)/n,g=(y-p)/n,w=(m-d)/n;for(l=0;l<n;l++)a[l]=newi.Color(s+l*h,c+l*C,p+l*g,d+l*w);returna}functionb(r){r=e.defaultValue(r,e.defaultValue.EMPTY_OBJECT);constn=r.positions,s=r.colors,c=e.defaultValue(r.width,1),p=e.defaultValue(r.colorsPerVertex,!1);if(!e.defined(n)||n.length<2)thrownewl.DeveloperError("At least two positions are required.");if("number"!==typeofc)thrownewl.DeveloperError("width must be a number");if(e.defined(s)&&(p&&s.length<n.length||!p&&s.length<n.length-1))thrownewl.DeveloperError("colors has an invalid length.");this._positions=n,this._colors=s,this._width=c,this._colorsPerVertex=p,this._vertexFormat=u.VertexFormat.clone(e.defaultValue(r.vertexFormat,u.VertexFormat.DEFAULT)),this._arcType=e.defaultValue(r.arcType,o.ArcType.GEODESIC),this._granularity=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";letd=1+n.length*t.Cartesian3.packedLength;d+=e.defined(s)?1+s.length*i.Color.packedLength:1,this.packedLength=d+t.Ellipsoid.packedLength+u.VertexFormat.packedLength+4}b.pack=function(o,r,n){if(!e.defined(o))thrownewl.DeveloperError("value is required");if(!e.defined(r))thrownewl.DeveloperError("array is required");leta;n=e.defaultValue(n,0);consts=o._positions;letc=s.length;for(r[n++]=c,a=0;a<c;++a,n+=t.Cartesian3.packedLength)t.Cartesian3.pack(s[a],r,n);constp=o._colors;for(c=e.defined(p)?p.length:0,r[n++]=c,a=0;a<c;++a,n+=i.Color.packedLength)i.Color.pack(p[a],r,n);returnt.Ellipsoid.pack(o._ellipsoid,r,n),n+=t.Ellipsoid.packedLength,u.VertexFormat.pack(o._vertexFormat,r,n),n+=u.VertexFormat.packedLength,r[n++]=o._width,r[n++]=o._colorsPerVertex?1:0,r[n++]=o._arcType,r[n]=o._granularity,r};constA=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),P=newu.VertexFormat,v={positions:void0,colors:void0,ellipsoid:A,vertexFormat:P,width:void0,colorsPerVertex:void0,arcType:void0,granularity:void0};b.unpack=function(o,r,n){if(!e.defined(o))thrownewl.DeveloperError("array is required");leta;r=e.defaultValue(r,0);lets=o[r++];constc=newArray(s);for(a=0;a<s;++a,r+=t.Cartesian3.packedLength)c[a]=t.Cartesian3.unpack(o,r);s=o[r++];constp=s>0?newArray(s):void0;for(a=0;a<s;++a,r+=i.Color.packedLength)p[a]=i.Color.unpack(o,r);constd=t.Ellipsoid.unpack(o,r,A);r+=t.Ellipsoid.packedLength;constf=u.VertexFormat.unpack(o,r,P);r+=u.VertexFormat.packedLength;consty=o[r++],m=1===o[r++],h=o[r++],C=o[r];returne.defined(n)?(n._positions=c,n._colors=p,n._ellipsoid=t.Ellipsoid.clone(d,n._ellipsoid),n._vertexFormat=u.VertexFormat.clone(f,n._vertexFormat),n._width=y,n._colorsPerVertex=m,n._arcType=h,n._granularity=C,n):(v.positions=c,v.colors=p,v.width=y,v.colorsPerVertex=m,v.arcType=h,v.granularity=C,newb(v))};constD=newt.Cartesian3,x=newt.Cartesian3,T=newt.Cartesian3,k=newt.Cartesian3;functionV(o,r){returne.defined(r)&&(o=b.unpack(o,r)),o._ellipsoid=t.Ellipsoid.clone(o._ellipsoid),b.createGeometry(o)}returnb.createGeometry=function(l){constu=l._width,f=l._vertexFormat;lety=l._colors;constm=l._colorsPerVertex,h=l._arcType,C=l._granularity,g=l._ellipsoid;letw,b,A;constP=[];letv=r.arrayRemoveDuplicates(l._positions,t.Cartesian3.equalsEpsilon,!1,P);if(e.defined(y)&&P.length>0){lete=0,t=P[0];y=y.filter((function(o,r){letn=!1;returnn=m?r===t||0===r&&1===t:r+1===t,!n||(e++,t=P[e],!1)}))}letV=v.length;if(V<2||u<=0)return;if(h===o.ArcType.GEODESIC||h===o.ArcType.RHUMB){lett,r;h===o.ArcType.GEODESIC?(t=a.CesiumMath.chordLength(C,g.maximumRadius),r=d.PolylinePipeline.numberOfPoints):(t=C,r=d.PolylinePipeline.numberOfPointsRhumbLine);constn=d.PolylinePipeline.extractHeights(v,g);if(e.defined(y)){lete=1;for(w=0;w<V-1;++w)e+=r(v[w],v[w+1],t);consto=newArray(e);letn=0;for(w=0;w<V-1;++w){consta=v[w],l=v[w+1],s=y[w],c=r(a,l,t);if(m&&w<e){conste=y[w+1],t=_(a,l,s,e,c),r=t.length;for(b=0;b<r;++b)o[n++]=t[b]}elsefor(b=0;b<c;++b)o[n++]=i.Color.clone(s)}o[n]=i.Color.clone(y[y.length-1]),y=o,E.length=0}v=h===o.ArcType.GEODESIC?d.PolylinePipeline.generateCartesianArc({positions:v,minDistance:t,ellipsoid:g,height:n}):d.PolylinePipeline.generateCartesianRhumbArc({positions:v,granularity:t,ellipsoid:g,height:n})}V=v.length;constL=4*V-4,F=newFloat64Array(3*L),G=newFloat64Array(3*L),O=newFloat64Array(3*L),R=newFloat32Array(2*L),I=f.st?newFloat32Array(2*L):void0,S=e.defined(y)?newUint8Array(4*L):void0;letB,U=0,N=0,q=0,M=0;for(b=0;b<V;++b){leto,r;0===b?(B=D,t.Cartesian3.subtract(v[0],v[1],B),t.Cartesian3.add(v[0],B,B)):B=v[b-1],t.Cartesian3.clone(B,T),t.Cartesian3.clone(v[b],x),b===V-1?(B=D,t.Cartesian3.subtract(v[V-1],v[V-2],B),t.Cartesian3.add(v[V-1],B,B)):B=v[b+1],t.Cartesian3.clone(B,k),e.defined(S)&&(o=0===b||m?y[b]:y[b-1],b!==V-1&&(r=y[b]));constn=0===b?2:0,a=b===V-1?2:4;for(A=n;A<a;++A){t.Cartesian3.pack(x,F,U),t.Cartesian3.pack(T,G,U),t.Cartesian3.pack(k,O,U),U+=3;constn=A-2<0?-1:1;if(R[N++]=A%2*2-1,R[N++]=n*u,f.st&&(I[q++]=b/(V-1),I[q++]=Math.max(R[N-2],0)),e.defined(S)){conste=A<2?o:r;S[M++]=i.Color.floatToByte(e.red),S[M++]=i.Color.floatToByte(e.green),S[M++]=i.Color.floatToByte(e.blue),S[M++]=i.Color.floatToByte(e.alpha)}}}constH=newc.GeometryAttributes;H.position=news.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F}),H.prevPosition=news.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:G}),H.nextPosition=news.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:O}),H.expandAndWidth=news.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:R}),f.st&&(H.st=news.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:I})),e.defined(S)&&(H.color=news.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));constW=p.IndexDatatype.createTypedArray(L,6*V-6);letY=0,j=0;constz=V-1;for(b=0;b<z;++b)W[j++]=Y,W[j++]=Y+2,W[j++]=Y+1,W[j++]=Y+1,W[j++]=Y+2,W[j++]=Y+3,Y+=4;returnnews.Geometry({attributes:H,indices:W,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:n.BoundingSphere.fromPoints(v),geometryType:s.GeometryType.POLYLINES})},V}));
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./arrayRemoveDuplicates-06991c15","./BoundingRectangle-d5f7d679","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6","./PolylineVolumeGeometryLibrary-5ddfb558","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidTangentPlane-53e32153","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./PolylinePipeline-0e310844","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea"],(function(e,t,n,o,i,r,a,l,s,p,c,d,u,m,y,g,f,h,b,E,P,_,v,k,V,L){"use strict";functionw(e,t,n,o){constl=newp.GeometryAttributes;o.position&&(l.position=news.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));constm=t.length,y=e.length/3,g=(y-2*m)/(2*m),f=u.PolygonPipeline.triangulate(t),h=(g-1)*m*6+2*f.length,b=d.IndexDatatype.createTypedArray(y,h);letE,P,_,v,k,V;constL=2*m;letw=0;for(E=0;E<g-1;E++){for(P=0;P<m-1;P++)_=2*P+E*m*2,V=_+L,v=_+1,k=v+L,b[w++]=v,b[w++]=_,b[w++]=k,b[w++]=k,b[w++]=_,b[w++]=V;_=2*m-2+E*m*2,v=_+1,k=v+L,V=_+L,b[w++]=v,b[w++]=_,b[w++]=k,b[w++]=k,b[w++]=_,b[w++]=V}if(o.st||o.tangent||o.bitangent){conste=newFloat32Array(2*y),o=1/(g-1),i=1/n.height,a=n.height/2;letp,c,d=0;for(E=0;E<g;E++){for(p=E*o,c=i*(t[0].y+a),e[d++]=p,e[d++]=c,P=1;P<m;P++)c=i*(t[P].y+a),e[d++]=p,e[d++]=c,e[d++]=p,e[d++]=c;c=i*(t[0].y+a),e[d++]=p,e[d++]=c}for(P=0;P<m;P++)p=0,c=i*(t[P].y+a),e[d++]=p,e[d++]=c;for(P=0;P<m;P++)p=(g-1)*o,c=i*(t[P].y+a),e[d++]=p,e[d++]=c;l.st=news.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:newFloat32Array(e)})}constx=y-2*m;for(E=0;E<f.length;E+=3){conste=f[E]+x,t=f[E+1]+x,n=f[E+2]+x;b[w++]=e,b[w++]=t,b[w++]=n,b[w++]=n+m,b[w++]=t+m,b[w++]=e+m}letC=news.Geometry({attributes:l,indices:b,boundingSphere:i.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.TRIANGLES});if(o.normal&&(C=c.GeometryPipeline.computeNormal(C)),o.tangent||o.bitangent){try{C=c.GeometryPipeline.computeTangentAndBitangent(C)}catch(D){a.oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(C.attributes.tangent=void0),o.bitangent||(C.attributes.bitangent=void0),o.st||(C.attributes.st=void0)}returnC}functionx(n){n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT);consto=n.polylinePositions,i=n.shapePositions;if(!e.defined(o))thrownewl.DeveloperError("options.polylinePositions is required.");if(!e.defined(i))thrownewl.DeveloperError("options.shapePositions is required.");this._positions=o,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,a.CornerType.ROUNDED),this._vertexFormat=m.VertexFormat.clone(e.defaultValue(n.vertexFormat,m.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";lets=1+o.length*t.Cartesian3.packedLength;s+=1+i.length*t.Cartesian2.packedLength,this.packedLength=s+t.Ellipsoid.packedLength+m.VertexFormat.packedLength+2}x.pack=function(n,o,i){if(!e.defined(n))thrownewl.DeveloperError("value is required");if(!e.defined(o))thrownewl.DeveloperError("array is required");letr;i=e.defaultValue(i,0);consta=n._positions;lets=a.length;for(o[i++]=s,r=0;r<s;++r,i+=t.Cartesian3.packedLength)t.Cartesian3.pack(a[r],o,i);constp=n._shape;for(s=p.length,o[i++]=s,r=0;r<s;++r,i+=t.Cartesian2.packedLength)t.Cartesian2.pack(p[r],o,i);returnt.Ellipsoid.pack(n._ellipsoid,o,i),i+=t.Ellipsoid.packedLength,m.VertexFormat.pack(n._vertexFormat,o,i),i+=m.VertexFormat.packedLength,o[i++]=n._cornerType,o[i]=n._granularity,o};constC=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),D=newm.VertexFormat,F={polylinePositions:void0,shapePositions:void0,ellipsoid:C,vertexFormat:D,cornerType:void0,granularity:void0};x.unpack=function(n,o,i){if(!e.defined(n))thrownewl.DeveloperError("array is required");letr;o=e.defaultValue(o,0);leta=n[o++];consts=newArray(a);for(r=0;r<a;++r,o+=t.Cartesian3.packedLength)s[r]=t.Cartesian3.unpack(n,o);a=n[o++];constp=newArray(a);for(r=0;r<a;++r,o+=t.Cartesian2.packedLength)p[r]=t.Cartesian2.unpack(n,o);constc=t.Ellipsoid.unpack(n,o,C);o+=t.Ellipsoid.packedLength;constd=m.VertexFormat.unpack(n,o,D);o+=m.VertexFormat.packedLength;constu=n[o++],y=n[o];returne.defined(i)?(i._positions=s,i._shape=p,i._ellipsoid=t.Ellipsoid.clone(c,i._ellipsoid),i._vertexFormat=m.VertexFormat.clone(d,i._vertexFormat),i._cornerType=u,i._granularity=y,i):(F.polylinePositions=s,F.shapePositions=p,F.cornerType=u,F.granularity=y,newx(F))};constA=newo.BoundingRectangle;functionT(n,o){returne.defined(o)&&(n=x.unpack(n,o)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),x.createGeometry(n)}returnx.createGeometry=function(e){consti=e._positions,r=n.arrayRemoveDuplicates(i,t.Cartesian3.equalsEpsilon);letl=e._shape;if(l=a.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(l),r.length<2||l.length<3)return;u.PolygonPipeline.computeWindingOrder2D(l)===u.WindingOrder.CLOCKWISE&&l.reverse();consts=o.BoundingRectangle.fromPoints(l,A),p=a.PolylineVolumeGeometryLibrary.computePositions(r,l,s,e,!0);returnw(p,l,s,e._vertexFormat)},T}));
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./arrayRemoveDuplicates-06991c15","./BoundingRectangle-d5f7d679","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6","./PolylineVolumeGeometryLibrary-5ddfb558","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidTangentPlane-53e32153","./AxisAlignedBoundingBox-7a3018c0","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./PolylinePipeline-0e310844","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b"],(function(e,i,n,t,o,r,a,l,s,p,d,c,u,y,f,h,g,m,E,P,_,b){"use strict";functionk(e,i){constn=newp.GeometryAttributes;n.position=news.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});constt=i.length,a=n.position.values.length/3,l=e.length/3,c=l/t,u=d.IndexDatatype.createTypedArray(a,2*t*(c+1));lety,f,h=0;y=0;letg=y*t;for(f=0;f<t-1;f++)u[h++]=f+g,u[h++]=f+g+1;for(u[h++]=t-1+g,u[h++]=g,y=c-1,g=y*t,f=0;f<t-1;f++)u[h++]=f+g,u[h++]=f+g+1;for(u[h++]=t-1+g,u[h++]=g,y=0;y<c-1;y++){conste=t*y,i=e+t;for(f=0;f<t;f++)u[h++]=f+e,u[h++]=f+i}constm=news.Geometry({attributes:n,indices:d.IndexDatatype.createTypedArray(a,u),boundingSphere:o.BoundingSphere.fromVertices(e),primitiveType:s.PrimitiveType.LINES});returnm}functionD(n){n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT);constt=n.polylinePositions,o=n.shapePositions;if(!e.defined(t))thrownewl.DeveloperError("options.polylinePositions is required.");if(!e.defined(o))thrownewl.DeveloperError("options.shapePositions is required.");this._positions=t,this._shape=o,this._ellipsoid=i.Ellipsoid.clone(e.defaultValue(n.ellipsoid,i.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,a.CornerType.ROUNDED),this._granularity=e.defaultValue(n.granularity,r.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";lets=1+t.length*i.Cartesian3.packedLength;s+=1+o.length*i.Cartesian2.packedLength,this.packedLength=s+i.Ellipsoid.packedLength+2}D.pack=function(n,t,o){if(!e.defined(n))thrownewl.DeveloperError("value is required");if(!e.defined(t))thrownewl.DeveloperError("array is required");letr;o=e.defaultValue(o,0);consta=n._positions;lets=a.length;for(t[o++]=s,r=0;r<s;++r,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(a[r],t,o);constp=n._shape;for(s=p.length,t[o++]=s,r=0;r<s;++r,o+=i.Cartesian2.packedLength)i.Cartesian2.pack(p[r],t,o);returni.Ellipsoid.pack(n._ellipsoid,t,o),o+=i.Ellipsoid.packedLength,t[o++]=n._cornerType,t[o]=n._granularity,t};constv=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),C={polylinePositions:void0,shapePositions:void0,ellipsoid:v,height:void0,cornerType:void0,granularity:void0};D.unpack=function(n,t,o){if(!e.defined(n))thrownewl.DeveloperError("array is required");letr;t=e.defaultValue(t,0);leta=n[t++];consts=newArray(a);for(r=0;r<a;++r,t+=i.Cartesian3.packedLength)s[r]=i.Cartesian3.unpack(n,t);a=n[t++];constp=newArray(a);for(r=0;r<a;++r,t+=i.Cartesian2.packedLength)p[r]=i.Cartesian2.unpack(n,t);constd=i.Ellipsoid.unpack(n,t,v);t+=i.Ellipsoid.packedLength;constc=n[t++],u=n[t];returne.defined(o)?(o._positions=s,o._shape=p,o._ellipsoid=i.Ellipsoid.clone(d,o._ellipsoid),o._cornerType=c,o._granularity=u,o):(C.polylinePositions=s,C.shapePositions=p,C.cornerType=c,C.granularity=u,newD(C))};constw=newt.BoundingRectangle;functionL(n,t){returne.defined(t)&&(n=D.unpack(n,t)),n._ellipsoid=i.Ellipsoid.clone(n._ellipsoid),D.createGeometry(n)}returnD.createGeometry=function(e){consto=e._positions,r=n.arrayRemoveDuplicates(o,i.Cartesian3.equalsEpsilon);letl=e._shape;if(l=a.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(l),r.length<2||l.length<3)return;c.PolygonPipeline.computeWindingOrder2D(l)===c.WindingOrder.CLOCKWISE&&l.reverse();consts=t.BoundingRectangle.fromPoints(l,w),p=a.PolylineVolumeGeometryLibrary.computePositions(r,l,s,e,!1);returnk(p,l)},L}));
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./Transforms-3ac41eb6","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryInstance-97bd792f","./GeometryOffsetAttribute-ec11b721","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./RectangleGeometryLibrary-1cc211f1","./VertexFormat-e46f29d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./AttributeCompression-4d18cc04","./EncodedCartesian3-d3e254ea","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./EllipsoidRhumbLine-daebc75b"],(function(t,e,n,a,o,r,i,s,l,c,u,m,p,d,g,y,f,h,b,_,A,w){"use strict";constx=newe.Cartesian3,C=newe.Cartesian3,v=newe.Cartesian3,R=newe.Cartesian3,E=newe.Rectangle,G=newe.Cartesian2,F=newn.BoundingSphere,P=newn.BoundingSphere;functionV(t,e){constn=newr.Geometry({attributes:newi.GeometryAttributes,primitiveType:r.PrimitiveType.TRIANGLES});returnn.attributes.position=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}functionD(t,n,a,o){constr=t.length,i=n.normal?newFloat32Array(r):void0,s=n.tangent?newFloat32Array(r):void0,l=n.bitangent?newFloat32Array(r):void0;letc=0;constu=R,m=v;letp=C;if(n.normal||n.tangent||n.bitangent)for(letd=0;d<r;d+=3){constr=e.Cartesian3.fromArray(t,d,x),g=c+1,y=c+2;p=a.geodeticSurfaceNormal(r,p),(n.tangent||n.bitangent)&&(e.Cartesian3.cross(e.Cartesian3.UNIT_Z,p,m),e.Matrix3.multiplyByVector(o,m,m),e.Cartesian3.normalize(m,m),n.bitangent&&e.Cartesian3.normalize(e.Cartesian3.cross(p,m,u),u)),n.normal&&(i[c]=p.x,i[g]=p.y,i[y]=p.z),n.tangent&&(s[c]=m.x,s[g]=m.y,s[y]=m.z),n.bitangent&&(l[c]=u.x,l[g]=u.y,l[y]=u.z),c+=3}returnV(n,{positions:t,normals:i,tangents:s,bitangents:l})}constL=newe.Cartesian3,M=newe.Cartesian3;functionO(t,n,a){constr=t.length,i=n.normal?newFloat32Array(r):void0,s=n.tangent?newFloat32Array(r):void0,l=n.bitangent?newFloat32Array(r):void0;letc=0,u=0,m=0,p=!0,d=R,g=v,y=C;if(n.normal||n.tangent||n.bitangent)for(letf=0;f<r;f+=6){consth=e.Cartesian3.fromArray(t,f,x),b=e.Cartesian3.fromArray(t,(f+6)%r,L);if(p){constn=e.Cartesian3.fromArray(t,(f+3)%r,M);e.Cartesian3.subtract(b,h,b),e.Cartesian3.subtract(n,h,n),y=e.Cartesian3.normalize(e.Cartesian3.cross(n,b,y),y),p=!1}e.Cartesian3.equalsEpsilon(b,h,o.CesiumMath.EPSILON10)&&(p=!0),(n.tangent||n.bitangent)&&(d=a.geodeticSurfaceNormal(h,d),n.tangent&&(g=e.Cartesian3.normalize(e.Cartesian3.cross(d,y,g),g))),n.normal&&(i[c++]=y.x,i[c++]=y.y,i[c++]=y.z,i[c++]=y.x,i[c++]=y.y,i[c++]=y.z),n.tangent&&(s[u++]=g.x,s[u++]=g.y,s[u++]=g.z,s[u++]=g.x,s[u++]=g.y,s[u++]=g.z),n.bitangent&&(l[m++]=d.x,l[m++]=d.y,l[m++]=d.z,l[m++]=d.x,l[m++]=d.y,l[m++]=d.z)}returnV(n,{positions:t,normals:i,tangents:s,bitangents:l})}functionT(t,e){constn=t._vertexFormat,a=t._ellipsoid,i=e.height,s=e.width,l=e.northCap,c=e.southCap;letm=0,d=i,g=i,y=0;l&&(m=1,g-=1,y+=1),c&&(d-=1,g-=1,y+=1),y+=s*g;constf=n.position?newFloat64Array(3*y):void0,h=n.st?newFloat32Array(2*y):void0;letb=0,_=0;constA=x,w=G;letC=Number.MAX_VALUE,v=Number.MAX_VALUE,R=-Number.MAX_VALUE,E=-Number.MAX_VALUE;for(leto=m;o<d;++o)for(lett=0;t<s;++t)p.RectangleGeometryLibrary.computePosition(e,a,n.st,o,t,A,w),f[b++]=A.x,f[b++]=A.y,f[b++]=A.z,n.st&&(h[_++]=w.x,h[_++]=w.y,C=Math.min(C,w.x),v=Math.min(v,w.y),R=Math.max(R,w.x),E=Math.max(E,w.y));if(l&&(p.RectangleGeometryLibrary.computePosition(e,a,n.st,0,0,A,w),f[b++]=A.x,f[b++]=A.y,f[b++]=A.z,n.st&&(h[_++]=w.x,h[_++]=w.y,C=w.x,v=w.y,R=w.x,E=w.y)),c&&(p.RectangleGeometryLibrary.computePosition(e,a,n.st,i-1,0,A,w),f[b++]=A.x,f[b++]=A.y,f[b]=A.z,n.st&&(h[_++]=w.x,h[_]=w.y,C=Math.min(C,w.x),v=Math.min(v,w.y),R=Math.max(R,w.x),E=Math.max(E,w.y))),n.st&&(C<0||v<0||R>1||E>1))for(leto=0;o<h.length;o+=2)h[o]=(h[o]-C)/(R-C),h[o+1]=(h[o+1]-v)/(E-v);constF=D(f,n,a,e.tangentRotationMatrix);letP=6*(s-1)*(g-1);l&&(P+=3*(s-1)),c&&(P+=3*(s-1));constV=u.IndexDatatype.createTypedArray(y,P);letL,M=0,O=0;for(L=0;L<g-1;++L){for(lett=0;t<s-1;++t){constt=M,e=t+s,n=e+1,a=t+1;V[O++]=t,V[O++]=e,V[O++]=a,V[O++]=a,V[O++]=e,V[O++]=n,++M}++M}if(l||c){lett=y-1;conste=y-1;letn,a;if(l&&c&&(t=y-2),M=0,l)for(L=0;L<s-1;L++)n=M,a=n+1,V[O++]=t,V[O++]=n,V[O++]=a,++M;if(c)for(M=(g-1)*s,L=0;L<s-1;L++)n=M,a=n+1,V[O++]=n,V[O++]=e,V[O++]=a,++M}returnF.indices=V,n.st&&(F.attributes.st=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:h})),F}functionN(t,e,n,a,o){returnt[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n+2],t[e++]=o[n],t[e++]=o[n+1],t[e]=o[n+2],t}functionk(t,e,n,a){returnt[e++]=a[n],t[e++]=a[n+1],t[e++]=a[n],t[e]=a[n+1],t}constS=newd.VertexFormat;functionI(n,a){consti=n._shadowVolume,p=n._offsetAttribute,g=n._vertexFormat,y=n._extrudedHeight,f=n._surfaceHeight,h=n._ellipsoid,b=a.height,_=a.width;letA;if(i){constt=d.VertexFormat.clone(g,S);t.normal=!0,n._vertexFormat=t}constw=T(n,a);i&&(n._vertexFormat=g);letx=m.PolygonPipeline.scaleToGeodeticHeight(w.attributes.position.values,f,h,!1);x=newFloat64Array(x);letC=x.length;constv=2*C,R=newFloat64Array(v);R.set(x);constE=m.PolygonPipeline.scaleToGeodeticHeight(w.attributes.position.values,y,h);R.set(E,C),w.attributes.position.values=R;constG=g.normal?newFloat32Array(v):void0,F=g.tangent?newFloat32Array(v):void0,P=g.bitangent?newFloat32Array(v):void0,V=g.st?newFloat32Array(v/3*2):void0;letD,I,H;if(g.normal){for(I=w.attributes.normal.values,G.set(I),A=0;A<C;A++)I[A]=-I[A];G.set(I,C),w.attributes.normal.values=G}if(i){I=w.attributes.normal.values,g.normal||(w.attributes.normal=void0);constt=newFloat32Array(v);for(A=0;A<C;A++)I[A]=-I[A];t.set(I,C),w.attributes.extrudeDirection=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})}constz=t.defined(p);if(z){constt=C/3*2;lete=newUint8Array(t);p===l.GeometryOffsetAttribute.TOP?e=e.fill(1,0,t/2):(H=p===l.GeometryOffsetAttribute.NONE?0:1,e=e.fill(H)),w.attributes.applyOffset=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}if(g.tangent){constt=w.attributes.tangent.values;for(F.set(t),A=0;A<C;A++)t[A]=-t[A];F.set(t,C),w.attributes.tangent.values=F}if(g.bitangent){constt=w.attributes.bitangent.values;P.set(t),P.set(t,C),w.attributes.bitangent.values=P}g.st&&(D=w.attributes.st.values,V.set(D),V.set(D,C/3*2),w.attributes.st.values=V);constB=w.indices,U=B.length,q=C/3,Y=u.IndexDatatype.createTypedArray(v/3,2*U);for(Y.set(B),A=0;A<U;A+=3)Y[A+U]=B[A+2]+q,Y[A+1+U]=B[A+1]+q,Y[A+2+U]=B[A]+q;w.indices=Y;constj=a.northCap,X=a.southCap;letQ=b,W=2,J=0,Z=4,K=4;j&&(W-=1,Q-=1,J+=1,Z-=2,K-=1),X&&(W-=1,Q-=1,J+=1,Z-=2,K-=1),J+=W*_+2*Q-Z;const$=2*(J+K);lettt=newFloat64Array(3*$);constet=i?newFloat32Array(3*$):void0;letnt=z?newUint8Array($):void0,at=g.st?newFloat32Array(2*$):void0;constot=p===l.GeometryOffsetAttribute.TOP;z&&!ot&&(H=p===l.GeometryOffsetAttribute.ALL?1:0,nt=nt.fill(H));letrt=0,it=0,st=0,lt=0;constct=_*Q;letut;for(A=0;A<ct;A+=_)ut=3*A,tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*A,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1);if(X){constt=j?ct+1:ct;for(ut=3*t,A=0;A<2;A++)tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*t,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1)}elsefor(A=ct-_;A<ct;A++)ut=3*A,tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*A,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1);for(A=ct-1;A>0;A-=_)ut=3*A,tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*A,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1);if(j){constt=ct;for(ut=3*t,A=0;A<2;A++)tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*t,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1)}elsefor(A=_-1;A>=0;A--)ut=3*A,tt=N(tt,rt,ut,x,E),rt+=6,g.st&&(at=k(at,it,2*A,D),it+=4),i&&(st+=3,et[st++]=I[ut],et[st++]=I[ut+1],et[st++]=I[ut+2]),ot&&(nt[lt++]=1,lt+=1);letmt=O(tt,g,h);g.st&&(mt.attributes.st=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:at})),i&&(mt.attributes.extrudeDirection=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:et})),z&&(mt.attributes.applyOffset=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:nt}));constpt=u.IndexDatatype.createTypedArray($,6*J);letdt,gt,yt,ft;C=tt.length/3;letht=0;for(A=0;A<C-1;A+=2){dt=A,ft=(dt+2)%C;constt=e.Cartesian3.fromArray(tt,3*dt,L),n=e.Cartesian3.fromArray(tt,3*ft,M);e.Cartesian3.equalsEpsilon(t,n,o.CesiumMath.EPSILON10)||(gt=(dt+1)%C,yt=(gt+2)%C,pt[ht++]=dt,pt[ht++]=gt,pt[ht++]=ft,pt[ht++]=ft,pt[ht++]=gt,pt[ht++]=yt)}returnmt.indices=pt,mt=c.GeometryPipeline.combineInstances([news.GeometryInstance({geometry:w}),news.GeometryInstance({geometry:mt})]),mt[0]}constH=[newe.Cartesian3,newe.Cartesian3,newe.Cartesian3,newe.Cartesian3],z=newe.Cartographic,B=newe.Cartographic;functionU(t,n,a,o,r){if(0===a)returne.Rectangle.clone(t,r);consti=p.RectangleGeometryLibrary.computeOptions(t,n,a,0,E,z),s=i.height,l=i.width,c=H;returnp.RectangleGeometryLibrary.computePosition(i,o,!1,0,0,c[0]),p.RectangleGeometryLibrary.computePosition(i,o,!1,0,l-1,c[1]),p.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,0,c[2]),p.RectangleGeometryLibrary.computePosition(i,o,!1,s-1,l-1,c[3]),e.Rectangle.fromCartesianArray(c,o,r)}functionq(n){n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT);constr=n.rectangle;if(a.Check.typeOf.object("rectangle",r),e.Rectangle.validate(r),r.north<r.south)thrownewa.DeveloperError("options.rectangle.north must be greater than or equal to options.rectangle.south");consti=t.defaultValue(n.height,0),s=t.defaultValue(n.extrudedHeight,i);this._rectangle=e.Rectangle.clone(r),this._granularity=t.defaultValue(n.granularity,o.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.Ellipsoid.clone(t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(i,s),this._rotation=t.defaultValue(n.rotation,0),this._stRotation=t.defaultValue(n.stRotation,0),this._vertexFormat=d.VertexFormat.clone(t.defaultValue(n.vertexFormat,d.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(i,s),this._shadowVolume=t.defaultValue(n.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=n.offsetAttribute,this._rotatedRectangle=void0,this._textureCoordinateRotationPoints=void0}q.packedLength=e.Rectangle.packedLength+e.Ellipsoid.packedLength+d.VertexFormat.packedLength+7,q.pack=function(n,o,r){returna.Check.typeOf.object("value",n),a.Check.defined("array",o),r=t.defaultValue(r,0),e.Rectangle.pack(n._rectangle,o,r),r+=e.Rectangle.packedLength,e.Ellipsoid.pack(n._ellipsoid,o,r),r+=e.Ellipsoid.packedLength,d.VertexFormat.pack(n._vertexFormat,o,r),r+=d.VertexFormat.packedLength,o[r++]=n._granularity,o[r++]=n._surfaceHeight,o[r++]=n._rotation,o[r++]=n._stRotation,o[r++]=n._extrudedHeight,o[r++]=n._shadowVolume?1:0,o[r]=t.defaultValue(n._offsetAttribute,-1),o};constY=newe.Rectangle,j=e.Ellipsoid.clone(e.Ellipsoid.UNIT_SPHERE),X={rectangle:Y,ellipsoid:j,vertexFormat:S,granularity:void0,height:void0,rotation:void0,stRotation:void0,extrudedHeight:void0,shadowVolume:void0,offsetAttribute:void0};q.unpack=function(n,o,r){a.Check.defined("array",n),o=t.defaultValue(o,0);consti=e.Rectangle.unpack(n,o,Y);o+=e.Rectangle.packedLength;consts=e.Ellipsoid.unpack(n,o,j);o+=e.Ellipsoid.packedLength;constl=d.VertexFormat.unpack(n,o,S);o+=d.VertexFormat.packedLength;constc=n[o++],u=n[o++],m=n[o++],p=n[o++],g=n[o++],y=1===n[o++],f=n[o];returnt.defined(r)?(r._rectangle=e.Rectangle.clone(i,r._rectangle),r._ellipsoid=e.Ellipsoid.clone(s,r._ellipsoid),r._vertexFormat=d.VertexFormat.clone(l,r._vertexFormat),r._granularity=c,r._surfaceHeight=u,r._rotation=m,r._stRotation=p,r._extrudedHeight=g,r._shadowVolume=y,r._offsetAttribute=-1===f?void0:f,r):(X.granularity=c,X.height=u,X.rotation=m,X.stRotation=p,X.extrudedHeight=g,X.shadowVolume=y,X.offsetAttribute=-1===f?void0:f,newq(X))},q.computeRectangle=function(n,r){n=t.defaultValue(n,t.defaultValue.EMPTY_OBJECT);consti=n.rectangle;if(a.Check.typeOf.object("rectangle",i),e.Rectangle.validate(i),i.north<i.south)thrownewa.DeveloperError("options.rectangle.north must be greater than or equal to options.rectangle.south");consts=t.defaultValue(n.granularity,o.CesiumMath.RADIANS_PER_DEGREE),l=t.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84),c=t.defaultValue(n.rotation,0);returnU(i,s,c,l,r)};constQ=newe.Matrix3,W=newn.Quaternion,J=newe.Cartographic;q.createGeometry=function(a){if(o.CesiumMath.equalsEpsilon(a._rectangle.north,a._rectangle.south,o.CesiumMath.EPSILON10)||o.CesiumMath.equalsEpsilon(a._rectangle.east,a._rectangle.west,o.CesiumMath.EPSILON10))return;leti=a._rectangle;consts=a._ellipsoid,c=a._rotation,u=a._stRotation,d=a._vertexFormat,g=p.RectangleGeometryLibrary.computeOptions(i,a._granularity,c,u,E,z,B),y=Q;if(0!==u||0!==c){constt=e.Rectangle.center(i,J),a=s.geodeticSurfaceNormalCartographic(t,L);n.Quaternion.fromAxisAngle(a,-u,W),e.Matrix3.fromQuaternion(W,y)}elsee.Matrix3.clone(e.Matrix3.IDENTITY,y);constf=a._surfaceHeight,h=a._extrudedHeight,b=!o.CesiumMath.equalsEpsilon(f,h,0,o.CesiumMath.EPSILON2);let_,A;if(g.lonScalar=1/a._rectangle.width,g.latScalar=1/a._rectangle.height,g.tangentRotationMatrix=y,i=a._rectangle,b){_=I(a,g);constt=n.BoundingSphere.fromRectangle3D(i,s,f,P),e=n.BoundingSphere.fromRectangle3D(i,s,h,F);A=n.BoundingSphere.union(t,e)}else{if(_=T(a,g),_.attributes.position.values=m.PolygonPipeline.scaleToGeodeticHeight(_.attributes.position.values,f,s,!1),t.defined(a._offsetAttribute)){constt=_.attributes.position.values.length,e=a._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,n=newUint8Array(t/3).fill(e);_.attributes.applyOffset=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}A=n.BoundingSphere.fromRectangle3D(i,s,f)}returnd.position||delete_.attributes.position,newr.Geometry({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:A,offsetAttribute:a._offsetAttribute})},q.createShadowVolume=function(t,e,n){consta=t._granularity,o=t._ellipsoid,r=e(a,o),i=n(a,o);returnnewq({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:o,stRotation:t._stRotation,granularity:a,extrudedHeight:i,height:r,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})};constZ=newe.Rectangle,K=[newe.Cartesian2,newe.Cartesian2,newe.Cartesian2],$=newe.Matrix2,tt=newe.Cartographic;functionet(t){if(0===t._stRotation)return[0,0,0,1,1,0];constn=e.Rectangle.clone(t._rectangle,Z),a=t._granularity,o=t._ellipsoid,r=t._rotation-t._stRotation,i=U(n,a,r,o,Z),s=K;s[0].x=i.west,s[0].y=i.south,s[1].x=i.west,s[1].y=i.north,s[2].x=i.east,s[2].y=i.south;constl=t.rectangle,c=e.Matrix2.fromRotation(t._stRotation,$),u=e.Rectangle.center(l,tt);for(lety=0;y<3;++y){constt=s[y];t.x-=u.longitude,t.y-=u.latitude,e.Matrix2.multiplyByVector(c,t,t),t.x+=u.longitude,t.y+=u.latitude,t.x=(t.x-l.west)/l.width,t.y=(t.y-l.south)/l.height}constm=s[0],p=s[1],d=s[2],g=newArray(6);returne.Cartesian2.pack(m,g),e.Cartesian2.pack(p,g,2),e.Cartesian2.pack(d,g,4),g}functionnt(n,a){returnt.defined(a)&&(n=q.unpack(n,a)),n._ellipsoid=e.Ellipsoid.clone(n._ellipsoid),n._rectangle=e.Rectangle.clone(n._rectangle),q.createGeometry(n)}returnObject.defineProperties(q.prototype,{rectangle:{get:function(){returnt.defined(this._rotatedRectangle)||(this._rotatedRectangle=U(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){returnt.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=et(this)),this._textureCoordinateRotationPoints}}}),nt}));
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785","./PolygonPipeline-113e3161","./RectangleGeometryLibrary-1cc211f1","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidRhumbLine-daebc75b"],(function(e,t,i,o,n,r,a,l,s,u,c,d,p,f,g){"use strict";consth=newi.BoundingSphere,y=newi.BoundingSphere,m=newt.Cartesian3,b=newt.Rectangle;function_(e,t){consti=e._ellipsoid,n=t.height,l=t.width,u=t.northCap,d=t.southCap;letp=n,f=2,g=0,h=4;u&&(f-=1,p-=1,g+=1,h-=2),d&&(f-=1,p-=1,g+=1,h-=2),g+=f*l+2*p-h;consty=newFloat64Array(3*g);letb,_=0,E=0;constA=m;if(u)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,0,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;elsefor(b=0;b<l;b++)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;for(b=l-1,E=1;E<n;E++)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;if(E=n-1,!d)for(b=l-2;b>=0;b--)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;for(b=0,E=n-2;E>0;E--)c.RectangleGeometryLibrary.computePosition(t,i,!1,E,b,A),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z;constw=y.length/3*2,G=s.IndexDatatype.createTypedArray(y.length/3,w);letv=0;for(leto=0;o<y.length/3-1;o++)G[v++]=o,G[v++]=o+1;G[v++]=y.length/3-1,G[v++]=0;constR=newr.Geometry({attributes:newa.GeometryAttributes,primitiveType:r.PrimitiveType.LINES});returnR.attributes.position=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y}),R.indices=G,R}functionE(e,t){consti=e._surfaceHeight,o=e._extrudedHeight,n=e._ellipsoid,r=o,a=i,l=_(e,t),c=t.height,d=t.width,p=u.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,a,n,!1);letf=p.length;constg=newFloat64Array(2*f);g.set(p);consth=u.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,r,n);g.set(h,f),l.attributes.position.values=g;consty=t.northCap,m=t.southCap;letb=4;y&&(b-=1),m&&(b-=1);constE=2*(g.length/3+b),A=s.IndexDatatype.createTypedArray(g.length/3,E);f=g.length/6;letw,G=0;for(lets=0;s<f-1;s++)A[G++]=s,A[G++]=s+1,A[G++]=s+f,A[G++]=s+f+1;if(A[G++]=f-1,A[G++]=0,A[G++]=f+f-1,A[G++]=f,A[G++]=0,A[G++]=f,y)w=c-1;else{conste=d-1;A[G++]=e,A[G++]=e+f,w=d+c-2}if(A[G++]=w,A[G++]=w+f,!m){conste=d+w-1;A[G++]=e,A[G]=e+f}returnl.indices=A,l}functionA(i){i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT);constr=i.rectangle,a=e.defaultValue(i.granularity,o.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(i.ellipsoid,t.Ellipsoid.WGS84),s=e.defaultValue(i.rotation,0);if(!e.defined(r))thrownewn.DeveloperError("rectangle is required.");if(t.Rectangle.validate(r),r.north<r.south)thrownewn.DeveloperError("options.rectangle.north must be greater than options.rectangle.south");constu=e.defaultValue(i.height,0),c=e.defaultValue(i.extrudedHeight,u);this._rectangle=t.Rectangle.clone(r),this._granularity=a,this._ellipsoid=l,this._surfaceHeight=Math.max(u,c),this._rotation=s,this._extrudedHeight=Math.min(u,c),this._offsetAttribute=i.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}A.packedLength=t.Rectangle.packedLength+t.Ellipsoid.packedLength+5,A.pack=function(i,o,r){if(!e.defined(i))thrownewn.DeveloperError("value is required");if(!e.defined(o))thrownewn.DeveloperError("array is required");returnr=e.defaultValue(r,0),t.Rectangle.pack(i._rectangle,o,r),r+=t.Rectangle.packedLength,t.Ellipsoid.pack(i._ellipsoid,o,r),r+=t.Ellipsoid.packedLength,o[r++]=i._granularity,o[r++]=i._surfaceHeight,o[r++]=i._rotation,o[r++]=i._extrudedHeight,o[r]=e.defaultValue(i._offsetAttribute,-1),o};constw=newt.Rectangle,G=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),v={rectangle:w,ellipsoid:G,granularity:void0,height:void0,rotation:void0,extrudedHeight:void0,offsetAttribute:void0};A.unpack=function(i,o,r){if(!e.defined(i))thrownewn.DeveloperError("array is required");o=e.defaultValue(o,0);consta=t.Rectangle.unpack(i,o,w);o+=t.Rectangle.packedLength;constl=t.Ellipsoid.unpack(i,o,G);o+=t.Ellipsoid.packedLength;consts=i[o++],u=i[o++],c=i[o++],d=i[o++],p=i[o];returne.defined(r)?(r._rectangle=t.Rectangle.clone(a,r._rectangle),r._ellipsoid=t.Ellipsoid.clone(l,r._ellipsoid),r._surfaceHeight=u,r._rotation=c,r._extrudedHeight=d,r._offsetAttribute=-1===p?void0:p,r):(v.granularity=s,v.height=u,v.rotation=c,v.extrudedHeight=d,v.offsetAttribute=-1===p?void0:p,newA(v))};constR=newt.Cartographic;functionP(i,o){returne.defined(o)&&(i=A.unpack(i,o)),i._ellipsoid=t.Ellipsoid.clone(i._ellipsoid),i._rectangle=t.Rectangle.clone(i._rectangle),A.createGeometry(i)}returnA.createGeometry=function(t){constn=t._rectangle,a=t._ellipsoid,s=c.RectangleGeometryLibrary.computeOptions(n,t._granularity,t._rotation,0,b,R);letd,p;if(o.CesiumMath.equalsEpsilon(n.north,n.south,o.CesiumMath.EPSILON10)||o.CesiumMath.equalsEpsilon(n.east,n.west,o.CesiumMath.EPSILON10))return;constf=t._surfaceHeight,g=t._extrudedHeight,m=!o.CesiumMath.equalsEpsilon(f,g,0,o.CesiumMath.EPSILON2);letA;if(m){if(d=E(t,s),e.defined(t._offsetAttribute)){conste=d.attributes.position.values.length/3;leti=newUint8Array(e);t._offsetAttribute===l.GeometryOffsetAttribute.TOP?i=i.fill(1,0,e/2):(A=t._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1,i=i.fill(A)),d.attributes.applyOffset=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}constu=i.BoundingSphere.fromRectangle3D(n,a,f,y),c=i.BoundingSphere.fromRectangle3D(n,a,g,h);p=i.BoundingSphere.union(u,c)}else{if(d=_(t,s),d.attributes.position.values=u.PolygonPipeline.scaleToGeodeticHeight(d.attributes.position.values,f,a,!1),e.defined(t._offsetAttribute)){conste=d.attributes.position.values.length;A=t._offsetAttribute===l.GeometryOffsetAttribute.NONE?0:1;consti=newUint8Array(e/3).fill(A);d.attributes.applyOffset=newr.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}p=i.BoundingSphere.fromRectangle3D(n,a,f)}returnnewr.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:r.PrimitiveType.LINES,boundingSphere:p,offsetAttribute:t._offsetAttribute})},P}));
define(["./defaultValue-94c3e563","./Matrix2-fc7e9822","./ArcType-0cf52f8c","./Transforms-3ac41eb6","./Color-305ce16b","./ComponentDatatype-4a60b8d6","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./IndexDatatype-db156785","./PolylinePipeline-0e310844","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f","./WebGLConstants-7dccdc96","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./IntersectionTests-68fbc42d","./Plane-e20fba8c"],(function(e,o,t,r,l,n,i,a,s,c,d,p,f,u,y,h,C,g){"use strict";functionm(e,o,t,r,n,i,a){consts=d.PolylinePipeline.numberOfPoints(e,o,n);letc;constp=t.red,f=t.green,u=t.blue,y=t.alpha,h=r.red,C=r.green,g=r.blue,m=r.alpha;if(l.Color.equals(t,r)){for(c=0;c<s;c++)i[a++]=l.Color.floatToByte(p),i[a++]=l.Color.floatToByte(f),i[a++]=l.Color.floatToByte(u),i[a++]=l.Color.floatToByte(y);returna}constT=(h-p)/s,b=(C-f)/s,E=(g-u)/s,_=(m-y)/s;letP=a;for(c=0;c<s;c++)i[P++]=l.Color.floatToByte(p+c*T),i[P++]=l.Color.floatToByte(f+c*b),i[P++]=l.Color.floatToByte(u+c*E),i[P++]=l.Color.floatToByte(y+c*_);returnP}functionT(r){r=e.defaultValue(r,e.defaultValue.EMPTY_OBJECT);consta=r.positions,s=r.colors,c=e.defaultValue(r.colorsPerVertex,!1);if(!e.defined(a)||a.length<2)thrownewi.DeveloperError("At least two positions are required.");if(e.defined(s)&&(c&&s.length<a.length||!c&&s.length<a.length-1))thrownewi.DeveloperError("colors has an invalid length.");this._positions=a,this._colors=s,this._colorsPerVertex=c,this._arcType=e.defaultValue(r.arcType,t.ArcType.GEODESIC),this._granularity=e.defaultValue(r.granularity,n.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=e.defaultValue(r.ellipsoid,o.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";letd=1+a.length*o.Cartesian3.packedLength;d+=e.defined(s)?1+s.length*l.Color.packedLength:1,this.packedLength=d+o.Ellipsoid.packedLength+3}T.pack=function(t,r,n){if(!e.defined(t))thrownewi.DeveloperError("value is required");if(!e.defined(r))thrownewi.DeveloperError("array is required");leta;n=e.defaultValue(n,0);consts=t._positions;letc=s.length;for(r[n++]=c,a=0;a<c;++a,n+=o.Cartesian3.packedLength)o.Cartesian3.pack(s[a],r,n);constd=t._colors;for(c=e.defined(d)?d.length:0,r[n++]=c,a=0;a<c;++a,n+=l.Color.packedLength)l.Color.pack(d[a],r,n);returno.Ellipsoid.pack(t._ellipsoid,r,n),n+=o.Ellipsoid.packedLength,r[n++]=t._colorsPerVertex?1:0,r[n++]=t._arcType,r[n]=t._granularity,r},T.unpack=function(t,r,n){if(!e.defined(t))thrownewi.DeveloperError("array is required");leta;r=e.defaultValue(r,0);lets=t[r++];constc=newArray(s);for(a=0;a<s;++a,r+=o.Cartesian3.packedLength)c[a]=o.Cartesian3.unpack(t,r);s=t[r++];constd=s>0?newArray(s):void0;for(a=0;a<s;++a,r+=l.Color.packedLength)d[a]=l.Color.unpack(t,r);constp=o.Ellipsoid.unpack(t,r);r+=o.Ellipsoid.packedLength;constf=1===t[r++],u=t[r++],y=t[r];returne.defined(n)?(n._positions=c,n._colors=d,n._ellipsoid=p,n._colorsPerVertex=f,n._arcType=u,n._granularity=y,n):newT({positions:c,colors:d,ellipsoid:p,colorsPerVertex:f,arcType:u,granularity:y})};constb=newArray(2),E=newArray(2),_={positions:b,height:E,ellipsoid:void0,minDistance:void0,granularity:void0};functionP(t,r){returne.defined(r)&&(t=T.unpack(t,r)),t._ellipsoid=o.Ellipsoid.clone(t._ellipsoid),T.createGeometry(t)}returnT.createGeometry=function(i){constp=i._positions,f=i._colors,u=i._colorsPerVertex,y=i._arcType,h=i._granularity,C=i._ellipsoid,g=n.CesiumMath.chordLength(h,C.maximumRadius),T=e.defined(f)&&!u;letP;constA=p.length;letB,w,k,D,G=0;if(y===t.ArcType.GEODESIC||y===t.ArcType.RHUMB){leto,r,i;y===t.ArcType.GEODESIC?(o=n.CesiumMath.chordLength(h,C.maximumRadius),r=d.PolylinePipeline.numberOfPoints,i=d.PolylinePipeline.generateArc):(o=h,r=d.PolylinePipeline.numberOfPointsRhumbLine,i=d.PolylinePipeline.generateRhumbArc);consta=d.PolylinePipeline.extractHeights(p,C),s=_;if(y===t.ArcType.GEODESIC?s.minDistance=g:s.granularity=h,s.ellipsoid=C,T){lett=0;for(P=0;P<A-1;P++)t+=r(p[P],p[P+1],o)+1;B=newFloat64Array(3*t),k=newUint8Array(4*t),s.positions=b,s.height=E;letn=0;for(P=0;P<A-1;++P){b[0]=p[P],b[1]=p[P+1],E[0]=a[P],E[1]=a[P+1];consto=i(s);if(e.defined(f)){conste=o.length/3;D=f[P];for(leto=0;o<e;++o)k[n++]=l.Color.floatToByte(D.red),k[n++]=l.Color.floatToByte(D.green),k[n++]=l.Color.floatToByte(D.blue),k[n++]=l.Color.floatToByte(D.alpha)}B.set(o,G),G+=o.length}}elseif(s.positions=p,s.height=a,B=newFloat64Array(i(s)),e.defined(f)){for(k=newUint8Array(B.length/3*4),P=0;P<A-1;++P){conste=p[P],o=p[P+1],t=f[P],r=f[P+1];G=m(e,o,t,r,g,k,G)}conste=f[A-1];k[G++]=l.Color.floatToByte(e.red),k[G++]=l.Color.floatToByte(e.green),k[G++]=l.Color.floatToByte(e.blue),k[G++]=l.Color.floatToByte(e.alpha)}}else{w=T?2*A-2:A,B=newFloat64Array(3*w),k=e.defined(f)?newUint8Array(4*w):void0;lett=0,r=0;for(P=0;P<A;++P){constn=p[P];if(T&&P>0&&(o.Cartesian3.pack(n,B,t),t+=3,D=f[P-1],k[r++]=l.Color.floatToByte(D.red),k[r++]=l.Color.floatToByte(D.green),k[r++]=l.Color.floatToByte(D.blue),k[r++]=l.Color.floatToByte(D.alpha)),T&&P===A-1)break;o.Cartesian3.pack(n,B,t),t+=3,e.defined(f)&&(D=f[P],k[r++]=l.Color.floatToByte(D.red),k[r++]=l.Color.floatToByte(D.green),k[r++]=l.Color.floatToByte(D.blue),k[r++]=l.Color.floatToByte(D.alpha))}}constL=news.GeometryAttributes;L.position=newa.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:B}),e.defined(f)&&(L.color=newa.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:k,normalize:!0})),w=B.length/3;constv=2*(w-1),V=c.IndexDatatype.createTypedArray(w,v);letx=0;for(P=0;P<w-1;++P)V[x++]=P,V[x++]=P+1;returnnewa.Geometry({attributes:L,indices:V,primitiveType:a.PrimitiveType.LINES,boundingSphere:r.BoundingSphere.fromPoints(p)})},P}));
define(["./defaultValue-94c3e563"],(function(e){"use strict";functionr(r){lett;constn=r.name,s=r.message;t=e.defined(n)&&e.defined(s)?`${n}: ${s}`:r.toString();consta=r.stack;returne.defined(a)&&(t+=`\n${a}`),t}functiont(e,r,t){letn;try{returnn=e(r,t),n}catch(s){returnPromise.reject(s)}}functionn(n){lets;returnfunction(a){consti=a.data,o=[],c={id:i.id,result:void0,error:void0};returnPromise.resolve(t(n,i.parameters,o)).then((function(e){c.result=e})).catch((function(e){einstanceofError?c.error={name:e.name,message:e.message,stack:e.stack}:c.error=e})).finally((function(){e.defined(s)||(s=e.defaultValue(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(o.length=0);try{s(c,o)}catch(t){c.result=void0,c.error=`postMessage failed with error: ${r(t)}\n with responseMessage: ${JSON.stringify(c)}`,s(c)}}))}}returnn}));