define(["exports","./AttributeCompression-4d18cc04","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6","./Transforms-3ac41eb6","./EncodedCartesian3-d3e254ea","./GeometryAttribute-a441ff32","./IndexDatatype-db156785","./IntersectionTests-68fbc42d","./Plane-e20fba8c"],(function(e,t,r,n,i,a,o,s,u,l,p,c){"use strict";constd=newr.Cartesian3,f=newr.Cartesian3,m=newr.Cartesian3;functiony(e,t,o,s,u){letl,p,c,y,h,v,C,b;if(n.Check.defined("point",e),n.Check.defined("p0",t),n.Check.defined("p1",o),n.Check.defined("p2",s),i.defined(u)||(u=newr.Cartesian3),i.defined(t.z)){if(r.Cartesian3.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))returnr.Cartesian3.clone(r.Cartesian3.UNIT_X,u);if(r.Cartesian3.equalsEpsilon(e,o,a.CesiumMath.EPSILON14))returnr.Cartesian3.clone(r.Cartesian3.UNIT_Y,u);if(r.Cartesian3.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))returnr.Cartesian3.clone(r.Cartesian3.UNIT_Z,u);l=r.Cartesian3.subtract(o,t,d),p=r.Cartesian3.subtract(s,t,f),c=r.Cartesian3.subtract(e,t,m),y=r.Cartesian3.dot(l,l),h=r.Cartesian3.dot(l,p),v=r.Cartesian3.dot(l,c),C=r.Cartesian3.dot(p,p),b=r.Cartesian3.dot(p,c)}else{if(r.Cartesian2.equalsEpsilon(e,t,a.CesiumMath.EPSILON14))returnr.Cartesian3.clone(r.Cartesian3.UNIT_X,u);if(r.Cartesian2.equalsEpsilon(e,o,a.CesiumMath.EPSILON14))returnr.Cartesian3.clone(r.Cartesian3.UNIT_Y,u);if(r.Cartesian2.equalsEpsilon(e,s,a.CesiumMath.EPSILON14))returnr.Cartesian3.clone(r.Cartesian3.UNIT_Z,u);l=r.Cartesian2.subtract(o,t,d),p=r.Cartesian2.subtract(s,t,f),c=r.Cartesian2.subtract(e,t,m),y=r.Cartesian2.dot(l,l),h=r.Cartesian2.dot(l,p),v=r.Cartesian2.dot(l,c),C=r.Cartesian2.dot(p,p),b=r.Cartesian2.dot(p,c)}u.y=C*v-h*b,u.z=y*b-h*v;constw=y*C-h*h;if(0!==w)returnu.y/=w,u.z/=w,u.x=1-u.y-u.z,u}consth={calculateACMR:function(e){e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT);constt=e.indices;letr=e.maximumIndex;consta=i.defaultValue(e.cacheSize,24);if(!i.defined(t))thrownewn.DeveloperError("indices is required.");consto=t.length;if(o<3||o%3!==0)thrownewn.DeveloperError("indices length must be a multiple of three.");if(r<=0)thrownewn.DeveloperError("maximumIndex must be greater than zero.");if(a<3)thrownewn.DeveloperError("cacheSize must be greater than two.");if(!i.defined(r)){r=0;lete=0,n=t[e];while(e<o)n>r&&(r=n),++e,n=t[e]}consts=[];for(letn=0;n<r+1;n++)s[n]=0;letu=a+1;for(letn=0;n<o;++n)u-s[t[n]]>a&&(s[t[n]]=u,++u);return(u-a+1)/(o/3)},tipsify:function(e){e=i.defaultValue(e,i.defaultValue.EMPTY_OBJECT);constt=e.indices,r=e.maximumIndex,a=i.defaultValue(e.cacheSize,24);leto;functions(e,t,r,n){while(t.length>=1){constr=t[t.length-1];if(t.splice(t.length-1,1),e[r].numLiveTriangles>0)returnr}while(o<n){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}functionu(e,t,r,n,i,a,o){letu,l=-1,p=-1,c=0;while(c<r.length){conste=r[c];n[e].numLiveTriangles&&(u=0,i-n[e].timeStamp+2*n[e].numLiveTriangles<=t&&(u=i-n[e].timeStamp),(u>p||-1===p)&&(p=u,l=e)),++c}return-1===l?s(n,a,e,o):l}if(!i.defined(t))thrownewn.DeveloperError("indices is required.");constl=t.length;if(l<3||l%3!==0)thrownewn.DeveloperError("indices length must be a multiple of three.");if(r<=0)thrownewn.DeveloperError("maximumIndex must be greater than zero.");if(a<3)thrownewn.DeveloperError("cacheSize must be greater than two.");letp=0,c=0,d=t[c];constf=l;if(i.defined(r))p=r+1;else{while(c<f)d>p&&(p=d),++c,d=t[c];if(-1===p)return0;++p}constm=[];lety;for(y=0;y<p;y++)m[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;leth=0;while(c<f)m[t[c]].vertexTriangles.push(h),++m[t[c]].numLiveTriangles,m[t[c+1]].vertexTriangles.push(h),++m[t[c+1]].numLiveTriangles,m[t[c+2]].vertexTriangles.push(h),++m[t[c+2]].numLiveTriangles,++h,c+=3;letv=0,C=a+1;o=1;letb=[];constw=[];letg,T,A=0;constE=[],D=l/3,x=[];for(y=0;y<D;y++)x[y]=!1;letP,I;while(-1!==v){b=[],T=m[v],I=T.vertexTriangles.length;for(lete=0;e<I;++e)if(h=T.vertexTriangles[e],!x[h]){x[h]=!0,c=h+h+h;for(lete=0;e<3;++e)P=t[c],b.push(P),w.push(P),E[A]=P,++A,g=m[P],--g.numLiveTriangles,C-g.timeStamp>a&&(g.timeStamp=C,++C),++c}v=u(t,a,b,m,C,w,p)}returnE}},v={};functionC(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}functionb(e){constt=e.length,r=t/3*6,n=l.IndexDatatype.createTypedArray(t,r);leti=0;for(leta=0;a<t;a+=3,i+=6)C(n,i,e[a],e[a+1],e[a+2]);returnn}functionw(e){constt=e.length;if(t>=3){constr=6*(t-2),n=l.IndexDatatype.createTypedArray(t,r);C(n,0,e[0],e[1],e[2]);leti=6;for(leta=3;a<t;++a,i+=6)C(n,i,e[a-1],e[a],e[a-2]);returnn}returnnewUint16Array}functiong(e){if(e.length>0){constt=e.length-1,r=6*(t-1),n=l.IndexDatatype.createTypedArray(t,r),i=e[0];leta=0;for(leto=1;o<t;++o,a+=6)C(n,a,i,e[o],e[o+1]);returnn}returnnewUint16Array}functionT(e){constt={};for(constrine)if(e.hasOwnProperty(r)&&i.defined(e[r])&&i.defined(e[r].values)){constn=e[r];t[r]=newu.GeometryAttribute({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}returnt}functionA(e,t,r){for(constnint)if(t.hasOwnProperty(n)&&i.defined(t[n])&&i.defined(t[n].values)){consti=t[n];for(lett=0;t<i.componentsPerAttribute;++t)e[n].values.push(i.values[r*i.componentsPerAttribute+t])}}v.toWireframe=function(e){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");constt=e.indices;if(i.defined(t)){switch(e.primitiveType){caseu.PrimitiveType.TRIANGLES:e.indices=b(t);break;caseu.PrimitiveType.TRIANGLE_STRIP:e.indices=w(t);break;caseu.PrimitiveType.TRIANGLE_FAN:e.indices=g(t);break;default:thrownewn.DeveloperError("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=u.PrimitiveType.LINES}returne},v.createLineSegmentsForVectors=function(e,t,r){if(t=i.defaultValue(t,"normal"),!i.defined(e))thrownewn.DeveloperError("geometry is required.");if(!i.defined(e.attributes.position))thrownewn.DeveloperError("geometry.attributes.position is required.");if(!i.defined(e.attributes[t]))thrownewn.DeveloperError(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);r=i.defaultValue(r,1e4);consts=e.attributes.position.values,l=e.attributes[t].values,p=s.length,c=newFloat64Array(2*p);letd,f=0;for(letn=0;n<p;n+=3)c[f++]=s[n],c[f++]=s[n+1],c[f++]=s[n+2],c[f++]=s[n]+l[n]*r,c[f++]=s[n+1]+l[n+1]*r,c[f++]=s[n+2]+l[n+2]*r;constm=e.boundingSphere;returni.defined(m)&&(d=newo.BoundingSphere(m.center,m.radius+r)),newu.Geometry({attributes:{position:newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:u.PrimitiveType.LINES,boundingSphere:d})},v.createAttributeLocations=function(e){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");constt=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={};leto,s=0;constu=t.length;for(o=0;o<u;++o){conste=t[o];i.defined(r[e])&&(a[e]=s++)}for(constninr)r.hasOwnProperty(n)&&!i.defined(a[n])&&(a[n]=s++);returna},v.reorderForPreVertexCache=function(e){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");constt=u.Geometry.computeNumberOfVertices(e),r=e.indices;if(i.defined(r)){constn=newInt32Array(t);for(lete=0;e<t;e++)n[e]=-1;consto=r,s=o.length,u=l.IndexDatatype.createTypedArray(t,s);letp,c=0,d=0,f=0;while(c<s)p=n[o[c]],-1!==p?u[d]=p:(p=o[c],n[p]=f,u[d]=f,++f),++c,++d;e.indices=u;constm=e.attributes;for(consteinm)if(m.hasOwnProperty(e)&&i.defined(m[e])&&i.defined(m[e].values)){constr=m[e],i=r.values;leto=0;consts=r.componentsPerAttribute,u=a.ComponentDatatype.createTypedArray(r.componentDatatype,f*s);while(o<t){conste=n[o];if(-1!==e)for(lett=0;t<s;t++)u[s*e+t]=i[s*o+t];++o}r.values=u}}returne},v.reorderForPostVertexCache=function(e,t){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");constr=e.indices;if(e.primitiveType===u.PrimitiveType.TRIANGLES&&i.defined(r)){constn=r.length;leti=0;for(lete=0;e<n;e++)r[e]>i&&(i=r[e]);e.indices=h.tipsify({indices:r,maximumIndex:i,cacheSize:t})}returne},v.fitToUnsignedShortIndices=function(e){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");if(i.defined(e.indices)&&e.primitiveType!==u.PrimitiveType.TRIANGLES&&e.primitiveType!==u.PrimitiveType.LINES&&e.primitiveType!==u.PrimitiveType.POINTS)thrownewn.DeveloperError("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");constt=[],r=u.Geometry.computeNumberOfVertices(e);if(i.defined(e.indices)&&r>=a.CesiumMath.SIXTY_FOUR_KILOBYTES){letr=[],n=[],o=0,s=T(e.attributes);constl=e.indices,p=l.length;letc;e.primitiveType===u.PrimitiveType.TRIANGLES?c=3:e.primitiveType===u.PrimitiveType.LINES?c=2:e.primitiveType===u.PrimitiveType.POINTS&&(c=1);for(letd=0;d<p;d+=c){for(lett=0;t<c;++t){consta=l[d+t];letu=r[a];i.defined(u)||(u=o++,r[a]=u,A(s,e.attributes,a)),n.push(u)}o+c>=a.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(newu.Geometry({attributes:s,indices:n,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),r=[],n=[],o=0,s=T(e.attributes))}0!==n.length&&t.push(newu.Geometry({attributes:s,indices:n,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}elset.push(e);returnt};constE=newr.Cartesian3,D=newr.Cartographic;v.projectTo2D=function(e,t,s,l,p){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");if(!i.defined(t))thrownewn.DeveloperError("attributeName is required.");if(!i.defined(s))thrownewn.DeveloperError("attributeName3D is required.");if(!i.defined(l))thrownewn.DeveloperError("attributeName2D is required.");if(!i.defined(e.attributes[t]))thrownewn.DeveloperError(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==a.ComponentDatatype.DOUBLE)thrownewn.DeveloperError("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");constc=e.attributes[t];p=i.defined(p)?p:newo.GeographicProjection;constd=p.ellipsoid,f=c.values,m=newFloat64Array(f.length);lety=0;for(leta=0;a<f.length;a+=3){conste=r.Cartesian3.fromArray(f,a,E),t=d.cartesianToCartographic(e,D);if(!i.defined(t))thrownewn.DeveloperError(`Could not project point (${e.x}, ${e.y}, ${e.z}) to 2D.`);consto=p.project(t,E);m[y++]=o.x,m[y++]=o.y,m[y++]=o.z}returne.attributes[s]=c,e.attributes[l]=newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m}),deletee.attributes[t],e};constx={high:0,low:0};v.encodeAttribute=function(e,t,r,o){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");if(!i.defined(t))thrownewn.DeveloperError("attributeName is required.");if(!i.defined(r))thrownewn.DeveloperError("attributeHighName is required.");if(!i.defined(o))thrownewn.DeveloperError("attributeLowName is required.");if(!i.defined(e.attributes[t]))thrownewn.DeveloperError(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==a.ComponentDatatype.DOUBLE)thrownewn.DeveloperError("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");constl=e.attributes[t],p=l.values,c=p.length,d=newFloat32Array(c),f=newFloat32Array(c);for(letn=0;n<c;++n)s.EncodedCartesian3.encode(p[n],x),d[n]=x.high,f[n]=x.low;constm=l.componentsPerAttribute;returne.attributes[r]=newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:m,values:d}),e.attributes[o]=newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:m,values:f}),deletee.attributes[t],e};letP=newr.Cartesian3;functionI(e,t){if(i.defined(t)){constn=t.values,i=n.length;for(lett=0;t<i;t+=3)r.Cartesian3.unpack(n,t,P),r.Matrix4.multiplyByPoint(e,P,P),r.Cartesian3.pack(P,n,t)}}functionS(e,t){if(i.defined(t)){constn=t.values,i=n.length;for(lett=0;t<i;t+=3)r.Cartesian3.unpack(n,t,P),r.Matrix3.multiplyByVector(e,P,P),P=r.Cartesian3.normalize(P,P),r.Cartesian3.pack(P,n,t)}}constN=newr.Matrix4,O=newr.Matrix3;functionL(e,t){constr=e.length,n={},o=e[0][t].attributes;lets;for(sino)if(o.hasOwnProperty(s)&&i.defined(o[s])&&i.defined(o[s].values)){constl=o[s];letp=l.values.length,c=!0;for(letn=1;n<r;++n){constr=e[n][t].attributes[s];if(!i.defined(r)||l.componentDatatype!==r.componentDatatype||l.componentsPerAttribute!==r.componentsPerAttribute||l.normalize!==r.normalize){c=!1;break}p+=r.values.length}c&&(n[s]=newu.GeometryAttribute({componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,values:a.ComponentDatatype.createTypedArray(l.componentDatatype,p)}))}returnn}v.transformToWorldCoordinates=function(e){if(!i.defined(e))thrownewn.DeveloperError("instance is required.");constt=e.modelMatrix;if(r.Matrix4.equals(t,r.Matrix4.IDENTITY))returne;consta=e.geometry.attributes;I(t,a.position),I(t,a.prevPosition),I(t,a.nextPosition),(i.defined(a.normal)||i.defined(a.tangent)||i.defined(a.bitangent))&&(r.Matrix4.inverse(t,N),r.Matrix4.transpose(N,N),r.Matrix4.getMatrix3(N,O),S(O,a.normal),S(O,a.tangent),S(O,a.bitangent));consts=e.geometry.boundingSphere;returni.defined(s)&&(e.geometry.boundingSphere=o.BoundingSphere.transform(s,t,s)),e.modelMatrix=r.Matrix4.clone(r.Matrix4.IDENTITY),e};constz=newr.Cartesian3;functionG(e,t){consta=e.length;lets,p,c,d;constf=e[0].modelMatrix,m=i.defined(e[0][t].indices),y=e[0][t].primitiveType;for(p=1;p<a;++p){if(!r.Matrix4.equals(e[p].modelMatrix,f))thrownewn.DeveloperError("All instances must have the same modelMatrix.");if(i.defined(e[p][t].indices)!==m)thrownewn.DeveloperError("All instance geometries must have an indices or not have one.");if(e[p][t].primitiveType!==y)thrownewn.DeveloperError("All instance geometries must have the same primitiveType.")}consth=L(e,t);letv,C,b,w;for(sinh)if(h.hasOwnProperty(s))for(v=h[s].values,d=0,p=0;p<a;++p)for(C=e[p][t].attributes[s].values,b=C.length,c=0;c<b;++c)v[d++]=C[c];if(m){letr=0;for(p=0;p<a;++p)r+=e[p][t].indices.length;constn=u.Geometry.computeNumberOfVertices(newu.Geometry({attributes:h,primitiveType:u.PrimitiveType.POINTS})),i=l.IndexDatatype.createTypedArray(n,r);leto=0,s=0;for(p=0;p<a;++p){constr=e[p][t].indices,n=r.length;for(d=0;d<n;++d)i[o++]=s+r[d];s+=u.Geometry.computeNumberOfVertices(e[p][t])}w=i}letg,T=newr.Cartesian3,A=0;for(p=0;p<a;++p){if(g=e[p][t].boundingSphere,!i.defined(g)){T=void0;break}r.Cartesian3.add(g.center,T,T)}if(i.defined(T))for(r.Cartesian3.divideByScalar(T,a,T),p=0;p<a;++p){g=e[p][t].boundingSphere;constn=r.Cartesian3.magnitude(r.Cartesian3.subtract(g.center,T,z))+g.radius;n>A&&(A=n)}returnnewu.Geometry({attributes:h,indices:w,primitiveType:y,boundingSphere:i.defined(T)?newo.BoundingSphere(T,A):void0})}v.combineInstances=function(e){if(!i.defined(e)||e.length<1)thrownewn.DeveloperError("instances is required and must have length greater than zero.");constt=[],r=[],a=e.length;for(letn=0;n<a;++n){consta=e[n];i.defined(a.geometry)?t.push(a):i.defined(a.westHemisphereGeometry)&&i.defined(a.eastHemisphereGeometry)&&r.push(a)}consto=[];returnt.length>0&&o.push(G(t,"geometry")),r.length>0&&(o.push(G(r,"westHemisphereGeometry")),o.push(G(r,"eastHemisphereGeometry"))),o};constM=newr.Cartesian3,q=newr.Cartesian3,R=newr.Cartesian3,V=newr.Cartesian3;v.computeNormal=function(e){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");if(!i.defined(e.attributes.position)||!i.defined(e.attributes.position.values))thrownewn.DeveloperError("geometry.attributes.position.values is required.");if(!i.defined(e.indices))thrownewn.DeveloperError("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)thrownewn.DeveloperError("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==u.PrimitiveType.TRIANGLES)thrownewn.DeveloperError("geometry.primitiveType must be PrimitiveType.TRIANGLES.");constt=e.indices,o=e.attributes,s=o.position.values,l=o.position.values.length/3,p=t.length,c=newArray(l),d=newArray(p/3),f=newArray(p);letm;for(m=0;m<l;m++)c[m]={indexOffset:0,count:0,currentCount:0};lety=0;for(m=0;m<p;m+=3){conste=t[m],n=t[m+1],i=t[m+2],a=3*e,o=3*n,u=3*i;q.x=s[a],q.y=s[a+1],q.z=s[a+2],R.x=s[o],R.y=s[o+1],R.z=s[o+2],V.x=s[u],V.y=s[u+1],V.z=s[u+2],c[e].count++,c[n].count++,c[i].count++,r.Cartesian3.subtract(R,q,R),r.Cartesian3.subtract(V,q,V),d[y]=r.Cartesian3.cross(R,V,newr.Cartesian3),y++}leth,v=0;for(m=0;m<l;m++)c[m].indexOffset+=v,v+=c[m].count;for(y=0,m=0;m<p;m+=3){h=c[t[m]];lete=h.indexOffset+h.currentCount;f[e]=y,h.currentCount++,h=c[t[m+1]],e=h.indexOffset+h.currentCount,f[e]=y,h.currentCount++,h=c[t[m+2]],e=h.indexOffset+h.currentCount,f[e]=y,h.currentCount++,y++}constC=newFloat32Array(3*l);for(m=0;m<l;m++){conste=3*m;if(h=c[m],r.Cartesian3.clone(r.Cartesian3.ZERO,M),h.count>0){for(y=0;y<h.count;y++)r.Cartesian3.add(M,d[f[h.indexOffset+y]],M);r.Cartesian3.equalsEpsilon(r.Cartesian3.ZERO,M,a.CesiumMath.EPSILON10)&&r.Cartesian3.clone(d[f[h.indexOffset]],M)}r.Cartesian3.equalsEpsilon(r.Cartesian3.ZERO,M,a.CesiumMath.EPSILON10)&&(M.z=1),r.Cartesian3.normalize(M,M),C[e]=M.x,C[e+1]=M.y,C[e+2]=M.z}returne.attributes.normal=newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e};constB=newr.Cartesian3,k=newr.Cartesian3,F=newr.Cartesian3;v.computeTangentAndBitangent=function(e){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");constt=e.attributes,o=e.indices;if(!i.defined(t.position)||!i.defined(t.position.values))thrownewn.DeveloperError("geometry.attributes.position.values is required.");if(!i.defined(t.normal)||!i.defined(t.normal.values))thrownewn.DeveloperError("geometry.attributes.normal.values is required.");if(!i.defined(t.st)||!i.defined(t.st.values))thrownewn.DeveloperError("geometry.attributes.st.values is required.");if(!i.defined(o))thrownewn.DeveloperError("geometry.indices is required.");if(o.length<2||o.length%3!==0)thrownewn.DeveloperError("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==u.PrimitiveType.TRIANGLES)thrownewn.DeveloperError("geometry.primitiveType must be PrimitiveType.TRIANGLES.");consts=e.attributes.position.values,l=e.attributes.normal.values,p=e.attributes.st.values,c=e.attributes.position.values.length/3,d=o.length,f=newArray(3*c);letm,y,h,v;for(m=0;m<f.length;m++)f[m]=0;for(m=0;m<d;m+=3){conste=o[m],t=o[m+1],r=o[m+2];y=3*e,h=3*t,v=3*r;constn=2*e,i=2*t,a=2*r,u=s[y],l=s[y+1],c=s[y+2],d=p[n],C=p[n+1],b=p[i+1]-C,w=p[a+1]-C,g=1/((p[i]-d)*w-(p[a]-d)*b),T=(w*(s[h]-u)-b*(s[v]-u))*g,A=(w*(s[h+1]-l)-b*(s[v+1]-l))*g,E=(w*(s[h+2]-c)-b*(s[v+2]-c))*g;f[y]+=T,f[y+1]+=A,f[y+2]+=E,f[h]+=T,f[h+1]+=A,f[h+2]+=E,f[v]+=T,f[v+1]+=A,f[v+2]+=E}constC=newFloat32Array(3*c),b=newFloat32Array(3*c);for(m=0;m<c;m++){y=3*m,h=y+1,v=y+2;conste=r.Cartesian3.fromArray(l,y,B),t=r.Cartesian3.fromArray(f,y,F),n=r.Cartesian3.dot(e,t);r.Cartesian3.multiplyByScalar(e,n,k),r.Cartesian3.normalize(r.Cartesian3.subtract(t,k,t),t),C[y]=t.x,C[h]=t.y,C[v]=t.z,r.Cartesian3.normalize(r.Cartesian3.cross(e,t,t),t),b[y]=t.x,b[h]=t.y,b[v]=t.z}returne.attributes.tangent=newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C}),e.attributes.bitangent=newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:b}),e};const_=newr.Cartesian2,U=newr.Cartesian3,Y=newr.Cartesian3,Z=newr.Cartesian3;letH=newr.Cartesian2;functionW(e){if(i.defined(e.indices))returne;constt=u.Geometry.computeNumberOfVertices(e);if(t<3)thrownewn.DeveloperError("The number of vertices must be at least three.");if(t%3!==0)thrownewn.DeveloperError("The number of vertices must be a multiple of three.");constr=l.IndexDatatype.createTypedArray(t,t);for(letn=0;n<t;++n)r[n]=n;returne.indices=r,e}function$(e){constt=u.Geometry.computeNumberOfVertices(e);if(t<3)thrownewn.DeveloperError("The number of vertices must be at least three.");constr=l.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;leti=3;for(letn=3;n<t;++n)r[i++]=n-1,r[i++]=0,r[i++]=n;returne.indices=r,e.primitiveType=u.PrimitiveType.TRIANGLES,e}functionX(e){constt=u.Geometry.computeNumberOfVertices(e);if(t<3)thrownewn.DeveloperError("The number of vertices must be at least 3.");constr=l.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);leti=6;for(letn=3;n<t-1;n+=2)r[i++]=n,r[i++]=n-1,r[i++]=n+1,n+2<t&&(r[i++]=n,r[i++]=n+1,r[i++]=n+2);returne.indices=r,e.primitiveType=u.PrimitiveType.TRIANGLES,e}functionj(e){if(i.defined(e.indices))returne;constt=u.Geometry.computeNumberOfVertices(e);if(t<2)thrownewn.DeveloperError("The number of vertices must be at least two.");if(t%2!==0)thrownewn.DeveloperError("The number of vertices must be a multiple of 2.");constr=l.IndexDatatype.createTypedArray(t,t);for(letn=0;n<t;++n)r[n]=n;returne.indices=r,e}functionJ(e){constt=u.Geometry.computeNumberOfVertices(e);if(t<2)thrownewn.DeveloperError("The number of vertices must be at least two.");constr=l.IndexDatatype.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;leti=2;for(letn=2;n<t;++n)r[i++]=n-1,r[i++]=n;returne.indices=r,e.primitiveType=u.PrimitiveType.LINES,e}functionK(e){constt=u.Geometry.computeNumberOfVertices(e);if(t<2)thrownewn.DeveloperError("The number of vertices must be at least two.");constr=l.IndexDatatype.createTypedArray(t,2*t);r[0]=0,r[1]=1;leti=2;for(letn=2;n<t;++n)r[i++]=n-1,r[i++]=n;returnr[i++]=t-1,r[i]=0,e.indices=r,e.primitiveType=u.PrimitiveType.LINES,e}functionQ(e){switch(e.primitiveType){caseu.PrimitiveType.TRIANGLE_FAN:return$(e);caseu.PrimitiveType.TRIANGLE_STRIP:returnX(e);caseu.PrimitiveType.TRIANGLES:returnW(e);caseu.PrimitiveType.LINE_STRIP:returnJ(e);caseu.PrimitiveType.LINE_LOOP:returnK(e);caseu.PrimitiveType.LINES:returnj(e)}returne}functionee(e,t){Math.abs(e.y)<a.CesiumMath.EPSILON6&&(e.y=t?-a.CesiumMath.EPSILON6:a.CesiumMath.EPSILON6)}functionte(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)returnee(e,e.y<0),ee(t,t.y<0),voidee(r,r.y<0);constn=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);lets;s=n>i?n>o?a.CesiumMath.sign(e.y):a.CesiumMath.sign(r.y):i>o?a.CesiumMath.sign(t.y):a.CesiumMath.sign(r.y);constu=s<0;ee(e,u),ee(t,u),ee(r,u)}v.compressVertices=function(e){if(!i.defined(e))thrownewn.DeveloperError("geometry is required.");consto=e.attributes.extrudeDirection;lets,l;if(i.defined(o)){constn=o.values;l=n.length/3;consti=newFloat32Array(2*l);letp=0;for(s=0;s<l;++s)r.Cartesian3.fromArray(n,3*s,U),r.Cartesian3.equals(U,r.Cartesian3.ZERO)?p+=2:(H=t.AttributeCompression.octEncodeInRange(U,65535,H),i[p++]=H.x,i[p++]=H.y);returne.attributes.compressedAttributes=newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i}),deletee.attributes.extrudeDirection,e}constp=e.attributes.normal,c=e.attributes.st,d=i.defined(p),f=i.defined(c);if(!d&&!f)returne;constm=e.attributes.tangent,y=e.attributes.bitangent,h=i.defined(m),v=i.defined(y);letC,b,w,g;d&&(C=p.values),f&&(b=c.values),h&&(w=m.values),v&&(g=y.values);constT=d?C.length:b.length,A=d?3:2;l=T/A;letE=l,D=f&&d?2:1;D+=h||v?1:0,E*=D;constx=newFloat32Array(E);letP=0;for(s=0;s<l;++s){f&&(r.Cartesian2.fromArray(b,2*s,_),x[P++]=t.AttributeCompression.compressTextureCoordinates(_));conste=3*s;d&&i.defined(w)&&i.defined(g)?(r.Cartesian3.fromArray(C,e,U),r.Cartesian3.fromArray(w,e,Y),r.Cartesian3.fromArray(g,e,Z),t.AttributeCompression.octPack(U,Y,Z,_),x[P++]=_.x,x[P++]=_.y):(d&&(r.Cartesian3.fromArray(C,e,U),x[P++]=t.AttributeCompression.octEncodeFloat(U)),h&&(r.Cartesian3.fromArray(w,e,U),x[P++]=t.AttributeCompression.octEncodeFloat(U)),v&&(r.Cartesian3.fromArray(g,e,U),x[P++]=t.AttributeCompression.octEncodeFloat(U)))}returne.attributes.compressedAttributes=newu.GeometryAttribute({componentDatatype:a.ComponentDatatype.FLOAT,componentsPerAttribute:D,values:x}),d&&deletee.attributes.normal,f&&deletee.attributes.st,v&&deletee.attributes.bitangent,h&&deletee.attributes.tangent,e};constre=newr.Cartesian3;functionne(e,t,n,i){r.Cartesian3.add(e,r.Cartesian3.multiplyByScalar(r.Cartesian3.subtract(t,e,re),e.y/(e.y-t.y),re),n),r.Cartesian3.clone(n,i),ee(n,!0),ee(i,!1)}constie=newr.Cartesian3,ae=newr.Cartesian3,oe=newr.Cartesian3,se=newr.Cartesian3,ue={positions:newArray(7),indices:newArray(9)};functionle(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return;te(e,t,r);constn=e.y<0,i=t.y<0,a=r.y<0;leto=0;o+=n?1:0,o+=i?1:0,o+=a?1:0;consts=ue.indices;1===o?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,n?(ne(e,t,ie,oe),ne(e,r,ae,se),s[0]=0,s[3]=1,s[4]=2,s[6]=1):i?(ne(t,r,ie,oe),ne(t,e,ae,se),s[0]=1,s[3]=2,s[4]=0,s[6]=2):a&&(ne(r,e,ie,oe),ne(r,t,ae,se),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===o&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,n?i?a||(ne(r,e,ie,oe),ne(r,t,ae,se),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(ne(t,r,ie,oe),ne(t,e,ae,se),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(ne(e,t,ie,oe),ne(e,r,ae,se),s[0]=1,s[1]=2,s[3]=1,s[6]=0));constu=ue.positions;returnu[0]=e,u[1]=t,u[2]=r,u.length=3,1!==o&&2!==o||(u[3]=ie,u[4]=ae,u[5]=oe,u[6]=se,u.length=7),ue}functionpe(e,t){constr=e.attributes;if(0===r.position.values.length)return;for(constoinr)if(r.hasOwnProperty(o)&&i.defined(r[o])&&i.defined(r[o].values)){conste=r[o];e.values=a.ComponentDatatype.createTypedArray(e.componentDatatype,e.values)}constn=u.Geometry.computeNumberOfVertices(e);returne.indices=l.IndexDatatype.createTypedArray(n,e.indices),t&&(e.boundingSphere=o.BoundingSphere.fromVertices(r.position.values)),e}functionce(e){constt=e.attributes,r={};for(constnint)if(t.hasOwnProperty(n)&&i.defined(t[n])&&i.defined(t[n].values)){conste=t[n];r[n]=newu.GeometryAttribute({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:[]})}returnnewu.Geometry({attributes:r,indices:[],primitiveType:e.primitiveType})}functionde(e,t,r){constn=i.defined(e.geometry.boundingSphere);t=pe(t,n),r=pe(r,n),i.defined(r)&&!i.defined(t)?e.geometry=r:!i.defined(r)&&i.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void0)}functionfe(e,t){constr=newe,n=newe,i=newe;returnfunction(a,o,s,u,l,p,c,d){constf=e.fromArray(l,a*t,r),m=e.fromArray(l,o*t,n),y=e.fromArray(l,s*t,i);e.multiplyByScalar(f,u.x,f),e.multiplyByScalar(m,u.y,m),e.multiplyByScalar(y,u.z,y);consth=e.add(f,m,f);e.add(h,y,h),d&&e.normalize(h,h),e.pack(h,p,c*t)}}constme=fe(r.Cartesian4,4),ye=fe(r.Cartesian3,3),he=fe(r.Cartesian2,2),ve=function(e,t,r,n,i,o,s){constu=i[e]*n.x,l=i[t]*n.y,p=i[r]*n.z;o[s]=u+l+p>a.CesiumMath.EPSILON6?1:0},Ce=newr.Cartesian3,be=newr.Cartesian3,we=newr.Cartesian3,ge=newr.Cartesian3;functionTe(e,t,n,a,o,s,u,l,p,c,d,f,m,h,v,C){if(!i.defined(s)&&!i.defined(u)&&!i.defined(l)&&!i.defined(p)&&!i.defined(c)&&0===h)return;constb=r.Cartesian3.fromArray(o,3*e,Ce),w=r.Cartesian3.fromArray(o,3*t,be),g=r.Cartesian3.fromArray(o,3*n,we),T=y(a,b,w,g,ge);if(i.defined(T)){if(i.defined(s)&&ye(e,t,n,T,s,f.normal.values,C,!0),i.defined(c)){consti=r.Cartesian3.fromArray(c,3*e,Ce),a=r.Cartesian3.fromArray(c,3*t,be),o=r.Cartesian3.fromArray(c,3*n,we);lets;r.Cartesian3.multiplyByScalar(i,T.x,i),r.Cartesian3.multiplyByScalar(a,T.y,a),r.Cartesian3.multiplyByScalar(o,T.z,o),r.Cartesian3.equals(i,r.Cartesian3.ZERO)&&r.Cartesian3.equals(a,r.Cartesian3.ZERO)&&r.Cartesian3.equals(o,r.Cartesian3.ZERO)?(s=Ce,s.x=0,s.y=0,s.z=0):(s=r.Cartesian3.add(i,a,i),r.Cartesian3.add(s,o,s),r.Cartesian3.normalize(s,s)),r.Cartesian3.pack(s,f.extrudeDirection.values,3*C)}if(i.defined(d)&&ve(e,t,n,T,d,f.applyOffset.values,C),i.defined(u)&&ye(e,t,n,T,u,f.tangent.values,C,!0),i.defined(l)&&ye(e,t,n,T,l,f.bitangent.values,C,!0),i.defined(p)&&he(e,t,n,T,p,f.st.values,C),h>0)for(letr=0;r<h;r++){consti=m[r];Ae(e,t,n,T,C,v[i],f[i])}}}functionAe(e,t,r,n,i,a,o){consts=a.componentsPerAttribute,u=a.values,l=o.values;switch(s){case4:me(e,t,r,n,u,l,i,!1);break;case3:ye(e,t,r,n,u,l,i,!1);break;case2:he(e,t,r,n,u,l,i,!1);break;default:l[i]=u[e]*n.x+u[t]*n.y+u[r]*n.z}}functionEe(e,t,r,n,i,a){consto=e.position.values.length/3;if(-1!==i){consts=n[i],u=r[s];return-1===u?(r[s]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(u),u)}returne.position.values.push(a.x,a.y,a.z),t.push(o),o}constDe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};functionxe(e){constt=e.geometry,n=t.attributes,a=n.position.values,o=i.defined(n.normal)?n.normal.values:void0,s=i.defined(n.bitangent)?n.bitangent.values:void0,u=i.defined(n.tangent)?n.tangent.values:void0,l=i.defined(n.st)?n.st.values:void0,p=i.defined(n.extrudeDirection)?n.extrudeDirection.values:void0,c=i.defined(n.applyOffset)?n.applyOffset.values:void0,d=t.indices,f=[];for(constrinn)n.hasOwnProperty(r)&&!De[r]&&i.defined(n[r])&&f.push(r);constm=f.length,y=ce(t),h=ce(t);letv,C,b,w,g;constT=[];T.length=a.length/3;constA=[];for(A.length=a.length/3,g=0;g<T.length;++g)T[g]=-1,A[g]=-1;constE=d.length;for(g=0;g<E;g+=3){conste=d[g],t=d[g+1],E=d[g+2];letD=r.Cartesian3.fromArray(a,3*e),x=r.Cartesian3.fromArray(a,3*t),P=r.Cartesian3.fromArray(a,3*E);constI=le(D,x,P);if(i.defined(I)&&I.positions.length>3){constr=I.positions,i=I.indices,D=i.length;for(letx=0;x<D;++x){constD=i[x],P=r[D];P.y<0?(v=h.attributes,C=h.indices,b=T):(v=y.attributes,C=y.indices,b=A),w=Ee(v,C,b,d,D<3?g+D:-1,P),Te(e,t,E,P,a,o,u,s,l,p,c,v,f,m,n,w)}}elsei.defined(I)&&(D=I.positions[0],x=I.positions[1],P=I.positions[2]),D.y<0?(v=h.attributes,C=h.indices,b=T):(v=y.attributes,C=y.indices,b=A),w=Ee(v,C,b,d,g,D),Te(e,t,E,D,a,o,u,s,l,p,c,v,f,m,n,w),w=Ee(v,C,b,d,g+1,x),Te(e,t,E,x,a,o,u,s,l,p,c,v,f,m,n,w),w=Ee(v,C,b,d,g+2,P),Te(e,t,E,P,a,o,u,s,l,p,c,v,f,m,n,w)}de(e,h,y)}constPe=c.Plane.fromPointNormal(r.Cartesian3.ZERO,r.Cartesian3.UNIT_Y),Ie=newr.Cartesian3,Se=newr.Cartesian3;functionNe(e,t,n,o,s,u,l){if(!i.defined(l))return;constp=r.Cartesian3.fromArray(o,3*e,Ce);r.Cartesian3.equalsEpsilon(p,n,a.CesiumMath.EPSILON10)?u.applyOffset.values[s]=l[e]:u.applyOffset.values[s]=l[t]}functionOe(e){constt=e.geometry,n=t.attributes,o=n.position.values,s=i.defined(n.applyOffset)?n.applyOffset.values:void0,u=t.indices,l=ce(t),c=ce(t);letd;constf=u.length,m=[];m.length=o.length/3;consty=[];for(y.length=o.length/3,d=0;d<m.length;++d)m[d]=-1,y[d]=-1;for(d=0;d<f;d+=2){conste=u[d],t=u[d+1],n=r.Cartesian3.fromArray(o,3*e,Ce),f=r.Cartesian3.fromArray(o,3*t,be);leth;Math.abs(n.y)<a.CesiumMath.EPSILON6&&(n.y<0?n.y=-a.CesiumMath.EPSILON6:n.y=a.CesiumMath.EPSILON6),Math.abs(f.y)<a.CesiumMath.EPSILON6&&(f.y<0?f.y=-a.CesiumMath.EPSILON6:f.y=a.CesiumMath.EPSILON6);letv=l.attributes,C=l.indices,b=y,w=c.attributes,g=c.indices,T=m;constA=p.IntersectionTests.lineSegmentPlane(n,f,Pe,we);if(i.defined(A)){consti=r.Cartesian3.multiplyByScalar(r.Cartesian3.UNIT_Y,5*a.CesiumMath.EPSILON9,Ie);n.y<0&&(r.Cartesian3.negate(i,i),v=c.attributes,C=c.indices,b=m,w=l.attributes,g=l.indices,T=y);constp=r.Cartesian3.add(A,i,Se);h=Ee(v,C,b,u,d,n),Ne(e,t,n,o,h,v,s),h=Ee(v,C,b,u,-1,p),Ne(e,t,p,o,h,v,s),r.Cartesian3.negate(i,i),r.Cartesian3.add(A,i,p),h=Ee(w,g,T,u,-1,p),Ne(e,t,p,o,h,w,s),h=Ee(w,g,T,u,d+1,f),Ne(e,t,f,o,h,w,s)}else{letr,i,a;n.y<0?(r=c.attributes,i=c.indices,a=m):(r=l.attributes,i=l.indices,a=y),h=Ee(r,i,a,u,d,n),Ne(e,t,n,o,h,r,s),h=Ee(r,i,a,u,d+1,f),Ne(e,t,f,o,h,r,s)}}de(e,c,l)}constLe=newr.Cartesian2,ze=newr.Cartesian2,Ge=newr.Cartesian3,Me=newr.Cartesian3,qe=newr.Cartesian3,Re=newr.Cartesian3,Ve=newr.Cartesian3,Be=newr.Cartesian3,ke=newr.Cartesian4;functionFe(e){constt=e.attributes,n=t.position.values,i=t.prevPosition.values,a=t.nextPosition.values,o=n.length;for(lets=0;s<o;s+=3){conste=r.Cartesian3.unpack(n,s,Ge);if(e.x>0)continue;constt=r.Cartesian3.unpack(i,s,Me);(e.y<0&&t.y>0||e.y>0&&t.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):r.Cartesian3.pack(e,i,s));constu=r.Cartesian3.unpack(a,s,qe);(e.y<0&&u.y>0||e.y>0&&u.y<0)&&(s+3<o?(a[s]=n[s+3],a[s+1]=n[s+4],a[s+2]=n[s+5]):r.Cartesian3.pack(e,a,s))}}const_e=5*a.CesiumMath.EPSILON9,Ue=a.CesiumMath.EPSILON6;functionYe(e){constt=e.geometry,n=t.attributes,o=n.position.values,s=n.prevPosition.values,u=n.nextPosition.values,l=n.expandAndWidth.values,c=i.defined(n.st)?n.st.values:void0,d=i.defined(n.color)?n.color.values:void0,f=ce(t),m=ce(t);lety,h,v,C=!1;constb=o.length/3;for(y=0;y<b;y+=4){conste=y,t=y+2,n=r.Cartesian3.fromArray(o,3*e,Ge),b=r.Cartesian3.fromArray(o,3*t,Me);if(Math.abs(n.y)<Ue)for(n.y=Ue*(b.y<0?-1:1),o[3*y+1]=n.y,o[3*(y+1)+1]=n.y,h=3*e;h<3*e+12;h+=3)s[h]=o[3*y],s[h+1]=o[3*y+1],s[h+2]=o[3*y+2];if(Math.abs(b.y)<Ue)for(b.y=Ue*(n.y<0?-1:1),o[3*(y+2)+1]=b.y,o[3*(y+3)+1]=b.y,h=3*e;h<3*e+12;h+=3)u[h]=o[3*(y+2)],u[h+1]=o[3*(y+2)+1],u[h+2]=o[3*(y+2)+2];letw=f.attributes,g=f.indices,T=m.attributes,A=m.indices;constE=p.IntersectionTests.lineSegmentPlane(n,b,Pe,Re);if(i.defined(E)){C=!0;consto=r.Cartesian3.multiplyByScalar(r.Cartesian3.UNIT_Y,_e,Ve);n.y<0&&(r.Cartesian3.negate(o,o),w=m.attributes,g=m.indices,T=f.attributes,A=f.indices);constp=r.Cartesian3.add(E,o,Be);w.position.values.push(n.x,n.y,n.z,n.x,n.y,n.z),w.position.values.push(p.x,p.y,p.z),w.position.values.push(p.x,p.y,p.z),w.prevPosition.values.push(s[3*e],s[3*e+1],s[3*e+2]),w.prevPosition.values.push(s[3*e+3],s[3*e+4],s[3*e+5]),w.prevPosition.values.push(n.x,n.y,n.z,n.x,n.y,n.z),w.nextPosition.values.push(p.x,p.y,p.z),w.nextPosition.values.push(p.x,p.y,p.z),w.nextPosition.values.push(p.x,p.y,p.z),w.nextPosition.values.push(p.x,p.y,p.z),r.Cartesian3.negate(o,o),r.Cartesian3.add(E,o,p),T.position.values.push(p.x,p.y,p.z),T.position.values.push(p.x,p.y,p.z),T.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.prevPosition.values.push(p.x,p.y,p.z),T.prevPosition.values.push(p.x,p.y,p.z),T.prevPosition.values.push(p.x,p.y,p.z),T.prevPosition.values.push(p.x,p.y,p.z),T.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),T.nextPosition.values.push(u[3*t],u[3*t+1],u[3*t+2]),T.nextPosition.values.push(u[3*t+3],u[3*t+4],u[3*t+5]);constD=r.Cartesian2.fromArray(l,2*e,Le),x=Math.abs(D.y);w.expandAndWidth.values.push(-1,x,1,x),w.expandAndWidth.values.push(-1,-x,1,-x),T.expandAndWidth.values.push(-1,x,1,x),T.expandAndWidth.values.push(-1,-x,1,-x);letP=r.Cartesian3.magnitudeSquared(r.Cartesian3.subtract(E,n,qe));if(P/=r.Cartesian3.magnitudeSquared(r.Cartesian3.subtract(b,n,qe)),i.defined(d)){constn=r.Cartesian4.fromArray(d,4*e,ke),i=r.Cartesian4.fromArray(d,4*t,ke),o=a.CesiumMath.lerp(n.x,i.x,P),s=a.CesiumMath.lerp(n.y,i.y,P),u=a.CesiumMath.lerp(n.z,i.z,P),l=a.CesiumMath.lerp(n.w,i.w,P);for(h=4*e;h<4*e+8;++h)w.color.values.push(d[h]);for(w.color.values.push(o,s,u,l),w.color.values.push(o,s,u,l),T.color.values.push(o,s,u,l),T.color.values.push(o,s,u,l),h=4*t;h<4*t+8;++h)T.color.values.push(d[h])}if(i.defined(c)){constn=r.Cartesian2.fromArray(c,2*e,Le),i=r.Cartesian2.fromArray(c,2*(y+3),ze),o=a.CesiumMath.lerp(n.x,i.x,P);for(h=2*e;h<2*e+4;++h)w.st.values.push(c[h]);for(w.st.values.push(o,n.y),w.st.values.push(o,i.y),T.st.values.push(o,n.y),T.st.values.push(o,i.y),h=2*t;h<2*t+4;++h)T.st.values.push(c[h])}v=w.position.values.length/3-4,g.push(v,v+2,v+1),g.push(v+1,v+2,v+3),v=T.position.values.length/3-4,A.push(v,v+2,v+1),A.push(v+1,v+2,v+3)}else{lete,t;for(n.y<0?(e=m.attributes,t=m.indices):(e=f.attributes,t=f.indices),e.position.values.push(n.x,n.y,n.z),e.position.values.push(n.x,n.y,n.z),e.position.values.push(b.x,b.y,b.z),e.position.values.push(b.x,b.y,b.z),h=3*y;h<3*y+12;++h)e.prevPosition.values.push(s[h]),e.nextPosition.values.push(u[h]);for(h=2*y;h<2*y+8;++h)e.expandAndWidth.values.push(l[h]),i.defined(c)&&e.st.values.push(c[h]);if(i.defined(d))for(h=4*y;h<4*y+16;++h)e.color.values.push(d[h]);v=e.position.values.length/3-4,t.push(v,v+2,v+1),t.push(v+1,v+2,v+3)}}C&&(Fe(m),Fe(f)),de(e,m,f)}v.splitLongitude=function(e){if(!i.defined(e))thrownewn.DeveloperError("instance is required.");constt=e.geometry,r=t.boundingSphere;if(i.defined(r)){constt=r.center.x-r.radius;if(t>0||o.BoundingSphere.intersectPlane(r,c.Plane.ORIGIN_ZX_PLANE)!==o.Intersect.INTERSECTING)returne}if(t.geometryType!==u.GeometryType.NONE)switch(t.geometryType){caseu.GeometryType.POLYLINES:Ye(e);break;caseu.GeometryType.TRIANGLES:xe(e);break;caseu.GeometryType.LINES:Oe(e);break}elseQ(t),t.primitiveType===u.PrimitiveType.TRIANGLES?xe(e):t.primitiveType===u.PrimitiveType.LINES&&Oe(e);returne},e.GeometryPipeline=v}));
define(["exports","./defaultValue-94c3e563","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./WebGLConstants-7dccdc96"],(function(e,r,t,n,a){"use strict";consti={UNSIGNED_BYTE:a.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:a.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:a.WebGLConstants.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){casei.UNSIGNED_BYTE:returnUint8Array.BYTES_PER_ELEMENT;casei.UNSIGNED_SHORT:returnUint16Array.BYTES_PER_ELEMENT;casei.UNSIGNED_INT:returnUint32Array.BYTES_PER_ELEMENT}thrownewt.DeveloperError("indexDatatype is required and must be a valid IndexDatatype constant.")},fromSizeInBytes:function(e){switch(e){case2:returni.UNSIGNED_SHORT;case4:returni.UNSIGNED_INT;case1:returni.UNSIGNED_BYTE;default:thrownewt.DeveloperError("Size in bytes cannot be mapped to an IndexDatatype")}},validate:function(e){returnr.defined(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},createTypedArray:function(e,a){if(!r.defined(e))thrownewt.DeveloperError("numberOfVertices is required.");returne>=n.CesiumMath.SIXTY_FOUR_KILOBYTES?newUint32Array(a):newUint16Array(a)},createTypedArrayFromArrayBuffer:function(e,a,i,E){if(!r.defined(e))thrownewt.DeveloperError("numberOfVertices is required.");if(!r.defined(a))thrownewt.DeveloperError("sourceArray is required.");if(!r.defined(i))thrownewt.DeveloperError("byteOffset is required.");returne>=n.CesiumMath.SIXTY_FOUR_KILOBYTES?newUint32Array(a,i,E):newUint16Array(a,i,E)},fromTypedArray:function(e){if(einstanceofUint8Array)returni.UNSIGNED_BYTE;if(einstanceofUint16Array)returni.UNSIGNED_SHORT;if(einstanceofUint32Array)returni.UNSIGNED_INT;thrownewt.DeveloperError("array must be a Uint8Array, Uint16Array, or Uint32Array.")}};varE=Object.freeze(i);e.IndexDatatype=E}));
define(["exports","./Matrix2-fc7e9822","./defaultValue-94c3e563","./RuntimeError-c581ca93","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6"],(function(e,r,t,n,i,a){"use strict";consto={};functions(e,r,t){constn=e+r;returna.CesiumMath.sign(e)!==a.CesiumMath.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))<t?0:n}o.computeDiscriminant=function(e,r,t){if("number"!==typeofe)thrownewn.DeveloperError("a is a required number.");if("number"!==typeofr)thrownewn.DeveloperError("b is a required number.");if("number"!==typeoft)thrownewn.DeveloperError("c is a required number.");consti=r*r-4*e*t;returni},o.computeRealRoots=function(e,r,t){if("number"!==typeofe)thrownewn.DeveloperError("a is a required number.");if("number"!==typeofr)thrownewn.DeveloperError("b is a required number.");if("number"!==typeoft)thrownewn.DeveloperError("c is a required number.");leti;if(0===e)return0===r?[]:[-t/r];if(0===r){if(0===t)return[0,0];constr=Math.abs(t),n=Math.abs(e);if(r<n&&r/n<a.CesiumMath.EPSILON14)return[0,0];if(r>n&&n/r<a.CesiumMath.EPSILON14)return[];if(i=-t/e,i<0)return[];consto=Math.sqrt(i);return[-o,o]}if(0===t)returni=-r/e,i<0?[i,0]:[0,i];consto=r*r,u=4*e*t,c=s(o,-u,a.CesiumMath.EPSILON14);if(c<0)return[];constd=-.5*s(r,a.CesiumMath.sign(r)*Math.sqrt(c),a.CesiumMath.EPSILON14);returnr>0?[d/e,t/d]:[t/d,d/e]};constu={};functionc(e,r,t,n){consti=e,a=r/3,o=t/3,s=n,u=i*o,c=a*s,d=a*a,l=o*o,f=i*o-d,h=i*s-a*o,m=a*s-l,p=4*f*m-h*h;letC,w;if(p<0){lete,r,t;d*c>=u*l?(e=i,r=f,t=-2*a*f+i*h):(e=s,r=m,t=-s*h+2*o*m);constn=t<0?-1:1,M=-n*Math.abs(e)*Math.sqrt(-p);w=-t+M;constb=w/2,g=b<0?-Math.pow(-b,1/3):Math.pow(b,1/3),q=w===M?-g:-r/g;returnC=r<=0?g+q:-t/(g*g+q*q+r),d*c>=u*l?[(C-a)/i]:[-s/(C+o)]}constM=f,b=-2*a*f+i*h,g=m,q=-s*h+2*o*m,E=Math.sqrt(p),y=Math.sqrt(3)/2;letv=Math.abs(Math.atan2(i*E,-b)/3);C=2*Math.sqrt(-M);letD=Math.cos(v);w=C*D;letR=C*(-D/2-y*Math.sin(v));constS=w+R>2*a?w-a:R-a,O=i,x=S/O;v=Math.abs(Math.atan2(s*E,-q)/3),C=2*Math.sqrt(-g),D=Math.cos(v),w=C*D,R=C*(-D/2-y*Math.sin(v));constP=-s,N=w+R<2*o?w+o:R+o,L=P/N,I=O*N,z=-S*N-O*P,T=S*P,U=(o*z-a*T)/(-a*z+o*I);returnx<=U?x<=L?U<=L?[x,U,L]:[x,L,U]:[L,x,U]:x<=L?[U,x,L]:U<=L?[U,L,x]:[L,U,x]}u.computeDiscriminant=function(e,r,t,i){if("number"!==typeofe)thrownewn.DeveloperError("a is a required number.");if("number"!==typeofr)thrownewn.DeveloperError("b is a required number.");if("number"!==typeoft)thrownewn.DeveloperError("c is a required number.");if("number"!==typeofi)thrownewn.DeveloperError("d is a required number.");consta=e*e,o=r*r,s=t*t,u=i*i,c=18*e*r*t*i+o*s-27*a*u-4*(e*s*t+o*r*i);returnc},u.computeRealRoots=function(e,r,t,i){if("number"!==typeofe)thrownewn.DeveloperError("a is a required number.");if("number"!==typeofr)thrownewn.DeveloperError("b is a required number.");if("number"!==typeoft)thrownewn.DeveloperError("c is a required number.");if("number"!==typeofi)thrownewn.DeveloperError("d is a required number.");leta,s;if(0===e)returno.computeRealRoots(r,t,i);if(0===r){if(0===t){if(0===i)return[0,0,0];s=-i/e;constr=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[r,r,r]}return0===i?(a=o.computeRealRoots(e,0,t),0===a.Length?[0]:[a[0],0,a[1]]):c(e,0,t,i)}return0===t?0===i?(s=-r/e,s<0?[s,0,0]:[0,0,s]):c(e,r,0,i):0===i?(a=o.computeRealRoots(e,r,t),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):c(e,r,t,i)};constd={};functionl(e,r,t,n){consti=e*e,s=r-3*i/8,c=t-r*e/2+i*e/8,d=n-t*e/4+r*i/16-3*i*i/256,l=u.computeRealRoots(1,2*s,s*s-4*d,-c*c);if(l.length>0){constr=-e/4,t=l[l.length-1];if(Math.abs(t)<a.CesiumMath.EPSILON14){conste=o.computeRealRoots(1,s,d);if(2===e.length){constt=e[0],n=e[1];leti;if(t>=0&&n>=0){conste=Math.sqrt(t),i=Math.sqrt(n);return[r-i,r-e,r+e,r+i]}if(t>=0&&n<0)returni=Math.sqrt(t),[r-i,r+i];if(t<0&&n>=0)returni=Math.sqrt(n),[r-i,r+i]}return[]}if(t>0){conste=Math.sqrt(t),n=(s+t-c/e)/2,i=(s+t+c/e)/2,a=o.computeRealRoots(1,e,n),u=o.computeRealRoots(1,-e,i);return0!==a.length?(a[0]+=r,a[1]+=r,0!==u.length?(u[0]+=r,u[1]+=r,a[1]<=u[0]?[a[0],a[1],u[0],u[1]]:u[1]<=a[0]?[u[0],u[1],a[0],a[1]]:a[0]>=u[0]&&a[1]<=u[1]?[u[0],a[0],a[1],u[1]]:u[0]>=a[0]&&u[1]<=a[1]?[a[0],u[0],u[1],a[1]]:a[0]>u[0]&&a[0]<u[1]?[u[0],a[0],u[1],a[1]]:[a[0],u[0],a[1],u[1]]):a):0!==u.length?(u[0]+=r,u[1]+=r,u):[]}}return[]}functionf(e,r,t,n){consti=t*t,s=r*r,c=e*e,d=-2*r,l=t*e+s-4*n,f=c*n-t*r*e+i,h=u.computeRealRoots(1,d,l,f);if(h.length>0){consti=h[0],s=r-i,u=s*s,d=e/2,l=s/2,f=u-4*n,m=u+4*Math.abs(n),p=c-4*i,C=c+4*Math.abs(i);letw,M,b,g,q,E;if(i<0||f*C<p*m){constr=Math.sqrt(p);w=r/2,M=0===r?0:(e*l-t)/r}else{constr=Math.sqrt(f);w=0===r?0:(e*l-t)/r,M=r/2}0===d&&0===w?(b=0,g=0):a.CesiumMath.sign(d)===a.CesiumMath.sign(w)?(b=d+w,g=i/b):(g=d-w,b=i/g),0===l&&0===M?(q=0,E=0):a.CesiumMath.sign(l)===a.CesiumMath.sign(M)?(q=l+M,E=n/q):(E=l-M,q=n/E);consty=o.computeRealRoots(1,b,q),v=o.computeRealRoots(1,g,E);if(0!==y.length)return0!==v.length?y[1]<=v[0]?[y[0],y[1],v[0],v[1]]:v[1]<=y[0]?[v[0],v[1],y[0],y[1]]:y[0]>=v[0]&&y[1]<=v[1]?[v[0],y[0],y[1],v[1]]:v[0]>=y[0]&&v[1]<=y[1]?[y[0],v[0],v[1],y[1]]:y[0]>v[0]&&y[0]<v[1]?[v[0],y[0],v[1],y[1]]:[y[0],v[0],y[1],v[1]]:y;if(0!==v.length)returnv}return[]}functionh(e,n){n=r.Cartesian3.clone(t.defaultValue(n,r.Cartesian3.ZERO)),r.Cartesian3.equals(n,r.Cartesian3.ZERO)||r.Cartesian3.normalize(n,n),this.origin=r.Cartesian3.clone(t.defaultValue(e,r.Cartesian3.ZERO)),this.direction=n}d.computeDiscriminant=function(e,r,t,i,a){if("number"!==typeofe)thrownewn.DeveloperError("a is a required number.");if("number"!==typeofr)thrownewn.DeveloperError("b is a required number.");if("number"!==typeoft)thrownewn.DeveloperError("c is a required number.");if("number"!==typeofi)thrownewn.DeveloperError("d is a required number.");if("number"!==typeofa)thrownewn.DeveloperError("e is a required number.");consto=e*e,s=o*e,u=r*r,c=u*r,d=t*t,l=d*t,f=i*i,h=f*i,m=a*a,p=m*a,C=u*d*f-4*c*h-4*e*l*f+18*e*r*t*h-27*o*f*f+256*s*p+a*(18*c*t*i-4*u*l+16*e*d*d-80*e*r*d*i-6*e*u*f+144*o*t*f)+m*(144*e*u*t-27*u*u-128*o*d-192*o*r*i);returnC},d.computeRealRoots=function(e,r,t,i,o){if("number"!==typeofe)thrownewn.DeveloperError("a is a required number.");if("number"!==typeofr)thrownewn.DeveloperError("b is a required number.");if("number"!==typeoft)thrownewn.DeveloperError("c is a required number.");if("number"!==typeofi)thrownewn.DeveloperError("d is a required number.");if("number"!==typeofo)thrownewn.DeveloperError("e is a required number.");if(Math.abs(e)<a.CesiumMath.EPSILON15)returnu.computeRealRoots(r,t,i,o);consts=r/e,c=t/e,d=i/e,h=o/e;letm=s<0?1:0;switch(m+=c<0?m+1:m,m+=d<0?m+1:m,m+=h<0?m+1:m,m){case0:returnl(s,c,d,h);case1:returnf(s,c,d,h);case2:returnf(s,c,d,h);case3:returnl(s,c,d,h);case4:returnl(s,c,d,h);case5:returnf(s,c,d,h);case6:returnl(s,c,d,h);case7:returnl(s,c,d,h);case8:returnf(s,c,d,h);case9:returnl(s,c,d,h);case10:returnl(s,c,d,h);case11:returnf(s,c,d,h);case12:returnl(s,c,d,h);case13:returnl(s,c,d,h);case14:returnl(s,c,d,h);case15:returnl(s,c,d,h);default:return}},h.clone=function(e,n){if(t.defined(e))returnt.defined(n)?(n.origin=r.Cartesian3.clone(e.origin),n.direction=r.Cartesian3.clone(e.direction),n):newh(e.origin,e.direction)},h.getPoint=function(e,i,a){returnn.Check.typeOf.object("ray",e),n.Check.typeOf.number("t",i),t.defined(a)||(a=newr.Cartesian3),a=r.Cartesian3.multiplyByScalar(e.direction,i,a),r.Cartesian3.add(e.origin,a,a)};constm={rayPlane:function(e,i,o){if(!t.defined(e))thrownewn.DeveloperError("ray is required.");if(!t.defined(i))thrownewn.DeveloperError("plane is required.");t.defined(o)||(o=newr.Cartesian3);consts=e.origin,u=e.direction,c=i.normal,d=r.Cartesian3.dot(c,u);if(Math.abs(d)<a.CesiumMath.EPSILON15)return;constl=(-i.distance-r.Cartesian3.dot(c,s))/d;returnl<0?void0:(o=r.Cartesian3.multiplyByScalar(u,l,o),r.Cartesian3.add(s,o,o))}},p=newr.Cartesian3,C=newr.Cartesian3,w=newr.Cartesian3,M=newr.Cartesian3,b=newr.Cartesian3;m.rayTriangleParametric=function(e,i,o,s,u){if(!t.defined(e))thrownewn.DeveloperError("ray is required.");if(!t.defined(i))thrownewn.DeveloperError("p0 is required.");if(!t.defined(o))thrownewn.DeveloperError("p1 is required.");if(!t.defined(s))thrownewn.DeveloperError("p2 is required.");u=t.defaultValue(u,!1);constc=e.origin,d=e.direction,l=r.Cartesian3.subtract(o,i,p),f=r.Cartesian3.subtract(s,i,C),h=r.Cartesian3.cross(d,f,w),m=r.Cartesian3.dot(l,h);letg,q,E,y,v;if(u){if(m<a.CesiumMath.EPSILON6)return;if(g=r.Cartesian3.subtract(c,i,M),E=r.Cartesian3.dot(g,h),E<0||E>m)return;if(q=r.Cartesian3.cross(g,l,b),y=r.Cartesian3.dot(d,q),y<0||E+y>m)return;v=r.Cartesian3.dot(f,q)/m}else{if(Math.abs(m)<a.CesiumMath.EPSILON6)return;conste=1/m;if(g=r.Cartesian3.subtract(c,i,M),E=r.Cartesian3.dot(g,h)*e,E<0||E>1)return;if(q=r.Cartesian3.cross(g,l,b),y=r.Cartesian3.dot(d,q)*e,y<0||E+y>1)return;v=r.Cartesian3.dot(f,q)*e}returnv},m.rayTriangle=function(e,n,i,a,o,s){constu=m.rayTriangleParametric(e,n,i,a,o);if(t.defined(u)&&!(u<0))returnt.defined(s)||(s=newr.Cartesian3),r.Cartesian3.multiplyByScalar(e.direction,u,s),r.Cartesian3.add(e.origin,s,s)};constg=newh;functionq(e,r,t,n){consti=r*r-4*e*t;if(i<0)return;if(i>0){constt=1/(2*e),a=Math.sqrt(i),o=(-r+a)*t,s=(-r-a)*t;returno<s?(n.root0=o,n.root1=s):(n.root0=s,n.root1=o),n}consta=-r/(2*e);return0!==a?(n.root0=n.root1=a,n):void0}m.lineSegmentTriangle=function(e,i,a,o,s,u,c){if(!t.defined(e))thrownewn.DeveloperError("v0 is required.");if(!t.defined(i))thrownewn.DeveloperError("v1 is required.");if(!t.defined(a))thrownewn.DeveloperError("p0 is required.");if(!t.defined(o))thrownewn.DeveloperError("p1 is required.");if(!t.defined(s))thrownewn.DeveloperError("p2 is required.");constd=g;r.Cartesian3.clone(e,d.origin),r.Cartesian3.subtract(i,e,d.direction),r.Cartesian3.normalize(d.direction,d.direction);constl=m.rayTriangleParametric(d,a,o,s,u);if(!(!t.defined(l)||l<0||l>r.Cartesian3.distance(e,i)))returnt.defined(c)||(c=newr.Cartesian3),r.Cartesian3.multiplyByScalar(d.direction,l,c),r.Cartesian3.add(d.origin,c,c)};constE={root0:0,root1:0};functiony(e,n,a){t.defined(a)||(a=newi.Interval);consto=e.origin,s=e.direction,u=n.center,c=n.radius*n.radius,d=r.Cartesian3.subtract(o,u,w),l=r.Cartesian3.dot(s,s),f=2*r.Cartesian3.dot(s,d),h=r.Cartesian3.magnitudeSquared(d)-c,m=q(l,f,h,E);if(t.defined(m))returna.start=m.root0,a.stop=m.root1,a}m.raySphere=function(e,r,i){if(!t.defined(e))thrownewn.DeveloperError("ray is required.");if(!t.defined(r))thrownewn.DeveloperError("sphere is required.");if(i=y(e,r,i),t.defined(i)&&!(i.stop<0))returni.start=Math.max(i.start,0),i};constv=newh;m.lineSegmentSphere=function(e,i,a,o){if(!t.defined(e))thrownewn.DeveloperError("p0 is required.");if(!t.defined(i))thrownewn.DeveloperError("p1 is required.");if(!t.defined(a))thrownewn.DeveloperError("sphere is required.");consts=v;r.Cartesian3.clone(e,s.origin);constu=r.Cartesian3.subtract(i,e,s.direction),c=r.Cartesian3.magnitude(u);if(r.Cartesian3.normalize(u,u),o=y(s,a,o),!(!t.defined(o)||o.stop<0||o.start>c))returno.start=Math.max(o.start,0),o.stop=Math.min(o.stop,c),o};constD=newr.Cartesian3,R=newr.Cartesian3;functionS(e,r,t){constn=e+r;returna.CesiumMath.sign(e)!==a.CesiumMath.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))<t?0:n}functionO(e,t,n,i,s){constu=i*i,c=s*s,l=(e[r.Matrix3.COLUMN1ROW1]-e[r.Matrix3.COLUMN2ROW2])*c,f=s*(i*S(e[r.Matrix3.COLUMN1ROW0],e[r.Matrix3.COLUMN0ROW1],a.CesiumMath.EPSILON15)+t.y),h=e[r.Matrix3.COLUMN0ROW0]*u+e[r.Matrix3.COLUMN2ROW2]*c+i*t.x+n,m=c*S(e[r.Matrix3.COLUMN2ROW1],e[r.Matrix3.COLUMN1ROW2],a.CesiumMath.EPSILON15),p=s*(i*S(e[r.Matrix3.COLUMN2ROW0],e[r.Matrix3.COLUMN0ROW2])+t.z);letC;constw=[];if(0===p&&0===m){if(C=o.computeRealRoots(l,f,h),0===C.length)returnw;conste=C[0],t=Math.sqrt(Math.max(1-e*e,0));if(w.push(newr.Cartesian3(i,s*e,s*-t)),w.push(newr.Cartesian3(i,s*e,s*t)),2===C.length){conste=C[1],t=Math.sqrt(Math.max(1-e*e,0));w.push(newr.Cartesian3(i,s*e,s*-t)),w.push(newr.Cartesian3(i,s*e,s*t))}returnw}constM=p*p,b=m*m,g=l*l,q=p*m,E=g+b,y=2*(f*l+q),v=2*h*l+f*f-b+M,D=2*(h*f-q),R=h*h-M;if(0===E&&0===y&&0===v&&0===D)returnw;C=d.computeRealRoots(E,y,v,D,R);constO=C.length;if(0===O)returnw;for(leto=0;o<O;++o){conste=C[o],t=e*e,n=Math.max(1-t,0),u=Math.sqrt(n);letc;c=a.CesiumMath.sign(l)===a.CesiumMath.sign(h)?S(l*t+h,f*e,a.CesiumMath.EPSILON12):a.CesiumMath.sign(h)===a.CesiumMath.sign(f*e)?S(l*t,f*e+h,a.CesiumMath.EPSILON12):S(l*t+f*e,h,a.CesiumMath.EPSILON12);constd=S(m*e,p,a.CesiumMath.EPSILON15),M=c*d;M<0?w.push(newr.Cartesian3(i,s*e,s*u)):M>0?w.push(newr.Cartesian3(i,s*e,s*-u)):0!==u?(w.push(newr.Cartesian3(i,s*e,s*-u)),w.push(newr.Cartesian3(i,s*e,s*u)),++o):w.push(newr.Cartesian3(i,s*e,s*u))}returnw}m.rayEllipsoid=function(e,a){if(!t.defined(e))thrownewn.DeveloperError("ray is required.");if(!t.defined(a))thrownewn.DeveloperError("ellipsoid is required.");consto=a.oneOverRadii,s=r.Cartesian3.multiplyComponents(o,e.origin,D),u=r.Cartesian3.multiplyComponents(o,e.direction,R),c=r.Cartesian3.magnitudeSquared(s),d=r.Cartesian3.dot(s,u);letl,f,h,m,p;if(c>1){if(d>=0)return;conste=d*d;if(l=c-1,f=r.Cartesian3.magnitudeSquared(u),h=f*l,e<h)return;if(e>h){m=d*d-h,p=-d+Math.sqrt(m);conste=p/f,r=l/p;returne<r?newi.Interval(e,r):{start:r,stop:e}}constt=Math.sqrt(l/f);returnnewi.Interval(t,t)}returnc<1?(l=c-1,f=r.Cartesian3.magnitudeSquared(u),h=f*l,m=d*d-h,p=-d+Math.sqrt(m),newi.Interval(0,p/f)):d<0?(f=r.Cartesian3.magnitudeSquared(u),newi.Interval(0,-d/f)):void0};constx=newr.Cartesian3,P=newr.Cartesian3,N=newr.Cartesian3,L=newr.Cartesian3,I=newr.Cartesian3,z=newr.Matrix3,T=newr.Matrix3,U=newr.Matrix3,W=newr.Matrix3,B=newr.Matrix3,V=newr.Matrix3,Z=newr.Matrix3,A=newr.Cartesian3,k=newr.Cartesian3,j=newr.Cartographic;m.grazingAltitudeLocation=function(e,i){if(!t.defined(e))thrownewn.DeveloperError("ray is required.");if(!t.defined(i))thrownewn.DeveloperError("ellipsoid is required.");consto=e.origin,s=e.direction;if(!r.Cartesian3.equals(o,r.Cartesian3.ZERO)){conste=i.geodeticSurfaceNormal(o,x);if(r.Cartesian3.dot(s,e)>=0)returno}constu=t.defined(this.rayEllipsoid(e,i)),c=i.transformPositionToScaledSpace(s,x),d=r.Cartesian3.normalize(c,c),l=r.Cartesian3.mostOrthogonalAxis(c,L),f=r.Cartesian3.normalize(r.Cartesian3.cross(l,d,P),P),h=r.Cartesian3.normalize(r.Cartesian3.cross(d,f,N),N),m=z;m[0]=d.x,m[1]=d.y,m[2]=d.z,m[3]=f.x,m[4]=f.y,m[5]=f.z,m[6]=h.x,m[7]=h.y,m[8]=h.z;constp=r.Matrix3.transpose(m,T),C=r.Matrix3.fromScale(i.radii,U),w=r.Matrix3.fromScale(i.oneOverRadii,W),M=B;M[0]=0,M[1]=-s.z,M[2]=s.y,M[3]=s.z,M[4]=0,M[5]=-s.x,M[6]=-s.y,M[7]=s.x,M[8]=0;constb=r.Matrix3.multiply(r.Matrix3.multiply(p,w,V),M,V),g=r.Matrix3.multiply(r.Matrix3.multiply(b,C,Z),m,Z),q=r.Matrix3.multiplyByVector(b,o,I),E=O(g,r.Cartesian3.negate(q,x),0,0,1);lety,v;constD=E.length;if(D>0){lete=r.Cartesian3.clone(r.Cartesian3.ZERO,k),t=Number.NEGATIVE_INFINITY;for(leti=0;i<D;++i){y=r.Matrix3.multiplyByVector(C,r.Matrix3.multiplyByVector(m,E[i],A),A);constn=r.Cartesian3.normalize(r.Cartesian3.subtract(y,o,L),L),a=r.Cartesian3.dot(n,s);a>t&&(t=a,e=r.Cartesian3.clone(y,e))}constn=i.cartesianToCartographic(e,j);returnt=a.CesiumMath.clamp(t,0,1),v=r.Cartesian3.magnitude(r.Cartesian3.subtract(e,o,L))*Math.sqrt(1-t*t),v=u?-v:v,n.height=v,i.cartographicToCartesian(n,newr.Cartesian3)}};constF=newr.Cartesian3;m.lineSegmentPlane=function(e,i,o,s){if(!t.defined(e))thrownewn.DeveloperError("endPoint0 is required.");if(!t.defined(i))thrownewn.DeveloperError("endPoint1 is required.");if(!t.defined(o))thrownewn.DeveloperError("plane is required.");t.defined(s)||(s=newr.Cartesian3);constu=r.Cartesian3.subtract(i,e,F),c=o.normal,d=r.Cartesian3.dot(c,u);if(Math.abs(d)<a.CesiumMath.EPSILON6)return;constl=r.Cartesian3.dot(c,e),f=-(o.distance+l)/d;returnf<0||f>1?void0:(r.Cartesian3.multiplyByScalar(u,f,s),r.Cartesian3.add(e,s,s),s)},m.trianglePlaneIntersection=function(e,i,a,o){if(!t.defined(e)||!t.defined(i)||!t.defined(a)||!t.defined(o))thrownewn.DeveloperError("p0, p1, p2, and plane are required.");consts=o.normal,u=o.distance,c=r.Cartesian3.dot(s,e)+u<0,d=r.Cartesian3.dot(s,i)+u<0,l=r.Cartesian3.dot(s,a)+u<0;letf,h,p=0;if(p+=c?1:0,p+=d?1:0,p+=l?1:0,1!==p&&2!==p||(f=newr.Cartesian3,h=newr.Cartesian3),1===p){if(c)returnm.lineSegmentPlane(e,i,o,f),m.lineSegmentPlane(e,a,o,h),{positions:[e,i,a,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(d)returnm.lineSegmentPlane(i,a,o,f),m.lineSegmentPlane(i,e,o,h),{positions:[e,i,a,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(l)returnm.lineSegmentPlane(a,e,o,f),m.lineSegmentPlane(a,i,o,h),{positions:[e,i,a,f,h],indices:[2,3,4,0,1,4,0,4,3]}}elseif(2===p){if(!c)returnm.lineSegmentPlane(i,e,o,f),m.lineSegmentPlane(a,e,o,h),{positions:[e,i,a,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!d)returnm.lineSegmentPlane(a,i,o,f),m.lineSegmentPlane(e,i,o,h),{positions:[e,i,a,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!l)returnm.lineSegmentPlane(e,a,o,f),m.lineSegmentPlane(i,a,o,h),{positions:[e,i,a,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},e.IntersectionTests=m,e.Ray=h}));
define(["exports","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6"],(function(e,t,n,r){"use strict";functiona(e,t,r){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0)}a.fromSpherical=function(e,r){t.Check.typeOf.object("spherical",e),n.defined(r)||(r=newa);constc=e.clock,o=e.cone,i=n.defaultValue(e.magnitude,1),u=i*Math.sin(o);returnr.x=u*Math.cos(c),r.y=u*Math.sin(c),r.z=i*Math.cos(o),r},a.fromElements=function(e,t,r,c){returnn.defined(c)?(c.x=e,c.y=t,c.z=r,c):newa(e,t,r)},a.clone=function(e,t){if(n.defined(e))returnn.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):newa(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,r,a){returnt.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a++]=e.y,r[a]=e.z,r},a.unpack=function(e,r,c){returnt.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(c)||(c=newa),c.x=e[r++],c.y=e[r++],c.z=e[r],c},a.packArray=function(e,r){t.Check.defined("array",e);constc=e.length,o=3*c;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==o)thrownewt.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");r.length!==o&&(r.length=o)}elser=newArray(o);for(lett=0;t<c;++t)a.pack(e[t],r,3*t);returnr},a.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)thrownewt.DeveloperError("array length must be a multiple of 3.");constc=e.length;n.defined(r)?r.length=c/3:r=newArray(c/3);for(lett=0;t<c;t+=3){constn=t/3;r[n]=a.unpack(e,t,r[n])}returnr},a.fromArray=a.unpack,a.maximumComponent=function(e){returnt.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){returnt.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,n,r){returnt.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.z=Math.min(e.z,n.z),r},a.maximumByComponent=function(e,n,r){returnt.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r.z=Math.max(e.z,n.z),r},a.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);consto=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y),u=r.CesiumMath.clamp(e.z,n.z,a.z);returnc.x=o,c.y=i,c.z=u,c},a.magnitudeSquared=function(e){returnt.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){returnMath.sqrt(a.magnitudeSquared(e))};constc=newa;a.distance=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.subtract(e,n,c),a.magnitude(c)},a.distanceSquared=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.subtract(e,n,c),a.magnitudeSquared(c)},a.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);constr=a.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,n.z=e.z/r,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))thrownewt.DeveloperError("normalized result is not a number");returnn},a.dot=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z},a.multiplyComponents=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r.z=e.z*n.z,r},a.divideComponents=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r.z=e.z/n.z,r},a.add=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r.z=e.z+n.z,r},a.subtract=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r.z=e.z-n.z,r},a.multiplyByScalar=function(e,n,r){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r.z=e.z*n,r},a.divideByScalar=function(e,n,r){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r.z=e.z/n,r},a.negate=function(e,n){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n},a.abs=function(e,n){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n};consto=newa;a.lerp=function(e,n,r,c){returnt.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",c),a.multiplyByScalar(n,r,o),c=a.multiplyByScalar(e,1-r,c),a.add(o,c,c)};consti=newa,u=newa;a.angleBetween=function(e,n){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.normalize(e,i),a.normalize(n,u);constr=a.dot(i,u),c=a.magnitude(a.cross(i,u,i));returnMath.atan2(c,r)};consts=newa;a.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);constr=a.normalize(e,s);returna.abs(r,r),n=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,n):a.clone(a.UNIT_Z,n):r.y<=r.z?a.clone(a.UNIT_Y,n):a.clone(a.UNIT_Z,n),n},a.projectVector=function(e,n,r){t.Check.defined("a",e),t.Check.defined("b",n),t.Check.defined("result",r);constc=a.dot(e,n)/a.dot(n,n);returna.multiplyByScalar(n,c,r)},a.equals=function(e,t){returne===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,n){returne.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},a.equalsEpsilon=function(e,t,a,c){returne===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)&&r.CesiumMath.equalsEpsilon(e.z,t.z,a,c)},a.cross=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);consta=e.x,c=e.y,o=e.z,i=n.x,u=n.y,s=n.z,f=c*s-o*u,h=o*i-a*s,l=a*u-c*i;returnr.x=f,r.y=h,r.z=l,r},a.midpoint=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=.5*(e.x+n.x),r.y=.5*(e.y+n.y),r.z=.5*(e.z+n.z),r},a.fromDegrees=function(e,n,c,o,i){returnt.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",n),e=r.CesiumMath.toRadians(e),n=r.CesiumMath.toRadians(n),a.fromRadians(e,n,c,o,i)};letf=newa,h=newa;constl=newa(40680631590769,40680631590769,40408299984661.445);a.fromRadians=function(e,r,c,o,i){t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",r),c=n.defaultValue(c,0);constu=n.defined(o)?o.radiiSquared:l,s=Math.cos(r);f.x=s*Math.cos(e),f.y=s*Math.sin(e),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(u,f,h);consty=Math.sqrt(a.dot(f,h));returnh=a.divideByScalar(h,y,h),f=a.multiplyByScalar(f,c,f),n.defined(i)||(i=newa),a.add(h,f,i)},a.fromDegreesArray=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<2||e.length%2!==0)thrownewt.DeveloperError("the number of coordinates must be a multiple of 2 and at least 2");consto=e.length;n.defined(c)?c.length=o/2:c=newArray(o/2);for(lett=0;t<o;t+=2){constn=e[t],o=e[t+1],i=t/2;c[i]=a.fromDegrees(n,o,0,r,c[i])}returnc},a.fromRadiansArray=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<2||e.length%2!==0)thrownewt.DeveloperError("the number of coordinates must be a multiple of 2 and at least 2");consto=e.length;n.defined(c)?c.length=o/2:c=newArray(o/2);for(lett=0;t<o;t+=2){constn=e[t],o=e[t+1],i=t/2;c[i]=a.fromRadians(n,o,0,r,c[i])}returnc},a.fromDegreesArrayHeights=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<3||e.length%3!==0)thrownewt.DeveloperError("the number of coordinates must be a multiple of 3 and at least 3");consto=e.length;n.defined(c)?c.length=o/3:c=newArray(o/3);for(lett=0;t<o;t+=3){constn=e[t],o=e[t+1],i=e[t+2],u=t/3;c[u]=a.fromDegrees(n,o,i,r,c[u])}returnc},a.fromRadiansArrayHeights=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<3||e.length%3!==0)thrownewt.DeveloperError("the number of coordinates must be a multiple of 3 and at least 3");consto=e.length;n.defined(c)?c.length=o/3:c=newArray(o/3);for(lett=0;t<o;t+=3){constn=e[t],o=e[t+1],i=e[t+2],u=t/3;c[u]=a.fromRadians(n,o,i,r,c[u])}returnc},a.ZERO=Object.freeze(newa(0,0,0)),a.ONE=Object.freeze(newa(1,1,1)),a.UNIT_X=Object.freeze(newa(1,0,0)),a.UNIT_Y=Object.freeze(newa(0,1,0)),a.UNIT_Z=Object.freeze(newa(0,0,1)),a.prototype.clone=function(e){returna.clone(this,e)},a.prototype.equals=function(e){returna.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){returna.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};consty=newa,p=newa;functiond(e,c,o,i,u){if(!n.defined(e))thrownewt.DeveloperError("cartesian is required.");if(!n.defined(c))thrownewt.DeveloperError("oneOverRadii is required.");if(!n.defined(o))thrownewt.DeveloperError("oneOverRadiiSquared is required.");if(!n.defined(i))thrownewt.DeveloperError("centerToleranceSquared is required.");consts=e.x,f=e.y,h=e.z,l=c.x,d=c.y,m=c.z,O=s*s*l*l,C=f*f*d*d,b=h*h*m*m,k=O+C+b,x=Math.sqrt(1/k),g=a.multiplyByScalar(e,x,y);if(k<i)returnisFinite(x)?a.clone(g,u):void0;constj=o.x,w=o.y,M=o.z,z=p;z.x=g.x*j*2,z.y=g.y*w*2,z.z=g.z*M*2;letE,q,T,S,R,_,V,v,A,N,I,U=(1-x)*a.magnitude(e)/(.5*a.magnitude(z)),P=0;do{U-=P,T=1/(1+U*j),S=1/(1+U*w),R=1/(1+U*M),_=T*T,V=S*S,v=R*R,A=_*T,N=V*S,I=v*R,E=O*_+C*V+b*v-1,q=O*A*j+C*N*w+b*I*M;conste=-2*q;P=E/e}while(Math.abs(E)>r.CesiumMath.EPSILON12);returnn.defined(u)?(u.x=s*T,u.y=f*S,u.z=h*R,u):newa(s*T,f*S,h*R)}functionm(e,t,r){this.longitude=n.defaultValue(e,0),this.latitude=n.defaultValue(t,0),this.height=n.defaultValue(r,0)}m.fromRadians=function(e,r,a,c){returnt.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",r),a=n.defaultValue(a,0),n.defined(c)?(c.longitude=e,c.latitude=r,c.height=a,c):newm(e,r,a)},m.fromDegrees=function(e,n,a,c){returnt.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",n),e=r.CesiumMath.toRadians(e),n=r.CesiumMath.toRadians(n),m.fromRadians(e,n,a,c)};constO=newa,C=newa,b=newa,k=newa(1/6378137,1/6378137,1/6356752.314245179),x=newa(1/40680631590769,1/40680631590769,1/40408299984661.445),g=r.CesiumMath.EPSILON1;functionj(e,c,o,i){c=n.defaultValue(c,0),o=n.defaultValue(o,0),i=n.defaultValue(i,0),t.Check.typeOf.number.greaterThanOrEquals("x",c,0),t.Check.typeOf.number.greaterThanOrEquals("y",o,0),t.Check.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=newa(c,o,i),e._radiiSquared=newa(c*c,o*o,i*i),e._radiiToTheFourth=newa(c*c*c*c,o*o*o*o,i*i*i*i),e._oneOverRadii=newa(0===c?0:1/c,0===o?0:1/o,0===i?0:1/i),e._oneOverRadiiSquared=newa(0===c?0:1/(c*c),0===o?0:1/(o*o),0===i?0:1/(i*i)),e._minimumRadius=Math.min(c,o,i),e._maximumRadius=Math.max(c,o,i),e._centerToleranceSquared=r.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}functionw(e,t,n){this._radii=void0,this._radiiSquared=void0,this._radiiToTheFourth=void0,this._oneOverRadii=void0,this._oneOverRadiiSquared=void0,this._minimumRadius=void0,this._maximumRadius=void0,this._centerToleranceSquared=void0,this._squaredXOverSquaredZ=void0,j(this,e,t,n)}m.fromCartesian=function(e,t,c){consto=n.defined(t)?t.oneOverRadii:k,i=n.defined(t)?t.oneOverRadiiSquared:x,u=n.defined(t)?t._centerToleranceSquared:g,s=d(e,o,i,u,C);if(!n.defined(s))return;letf=a.multiplyComponents(s,i,O);f=a.normalize(f,f);consth=a.subtract(e,s,b),l=Math.atan2(f.y,f.x),y=Math.asin(f.z),p=r.CesiumMath.sign(a.dot(h,e))*a.magnitude(h);returnn.defined(c)?(c.longitude=l,c.latitude=y,c.height=p,c):newm(l,y,p)},m.toCartesian=function(e,n,r){returnt.Check.defined("cartographic",e),a.fromRadians(e.longitude,e.latitude,e.height,n,r)},m.clone=function(e,t){if(n.defined(e))returnn.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):newm(e.longitude,e.latitude,e.height)},m.equals=function(e,t){returne===t||n.defined(e)&&n.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},m.equalsEpsilon=function(e,t,r){returnr=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},m.ZERO=Object.freeze(newm(0,0,0)),m.prototype.clone=function(e){returnm.clone(this,e)},m.prototype.equals=function(e){returnm.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){returnm.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(w.prototype,{radii:{get:function(){returnthis._radii}},radiiSquared:{get:function(){returnthis._radiiSquared}},radiiToTheFourth:{get:function(){returnthis._radiiToTheFourth}},oneOverRadii:{get:function(){returnthis._oneOverRadii}},oneOverRadiiSquared:{get:function(){returnthis._oneOverRadiiSquared}},minimumRadius:{get:function(){returnthis._minimumRadius}},maximumRadius:{get:function(){returnthis._maximumRadius}}}),w.clone=function(e,t){if(!n.defined(e))return;constr=e._radii;returnn.defined(t)?(a.clone(r,t._radii),a.clone(e._radiiSquared,t._radiiSquared),a.clone(e._radiiToTheFourth,t._radiiToTheFourth),a.clone(e._oneOverRadii,t._oneOverRadii),a.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):neww(r.x,r.y,r.z)},w.fromCartesian3=function(e,t){returnn.defined(t)||(t=neww),n.defined(e)?(j(t,e.x,e.y,e.z),t):t},w.WGS84=Object.freeze(neww(6378137,6378137,6356752.314245179)),w.UNIT_SPHERE=Object.freeze(neww(1,1,1)),w.MOON=Object.freeze(neww(r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS)),w.prototype.clone=function(e){returnw.clone(this,e)},w.packedLength=a.packedLength,w.pack=function(e,r,c){returnt.Check.typeOf.object("value",e),t.Check.defined("array",r),c=n.defaultValue(c,0),a.pack(e._radii,r,c),r},w.unpack=function(e,r,c){t.Check.defined("array",e),r=n.defaultValue(r,0);consto=a.unpack(e,r);returnw.fromCartesian3(o,c)},w.prototype.geocentricSurfaceNormal=a.normalize,w.prototype.geodeticSurfaceNormalCartographic=function(e,r){t.Check.typeOf.object("cartographic",e);constc=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(c),s=i*Math.sin(c),f=Math.sin(o);returnn.defined(r)||(r=newa),r.x=u,r.y=s,r.z=f,a.normalize(r,r)},w.prototype.geodeticSurfaceNormal=function(e,t){if(!a.equalsEpsilon(e,a.ZERO,r.CesiumMath.EPSILON14))returnn.defined(t)||(t=newa),t=a.multiplyComponents(e,this._oneOverRadiiSquared,t),a.normalize(t,t)};constM=newa,z=newa;w.prototype.cartographicToCartesian=function(e,t){constr=M,c=z;this.geodeticSurfaceNormalCartographic(e,r),a.multiplyComponents(this._radiiSquared,r,c);consto=Math.sqrt(a.dot(r,c));returna.divideByScalar(c,o,c),a.multiplyByScalar(r,e.height,r),n.defined(t)||(t=newa),a.add(c,r,t)},w.prototype.cartographicArrayToCartesianArray=function(e,r){t.Check.defined("cartographics",e);consta=e.length;n.defined(r)?r.length=a:r=newArray(a);for(lett=0;t<a;t++)r[t]=this.cartographicToCartesian(e[t],r[t]);returnr};constE=newa,q=newa,T=newa;w.prototype.cartesianToCartographic=function(e,t){constc=this.scaleToGeodeticSurface(e,q);if(!n.defined(c))return;consto=this.geodeticSurfaceNormal(c,E),i=a.subtract(e,c,T),u=Math.atan2(o.y,o.x),s=Math.asin(o.z),f=r.CesiumMath.sign(a.dot(i,e))*a.magnitude(i);returnn.defined(t)?(t.longitude=u,t.latitude=s,t.height=f,t):newm(u,s,f)},w.prototype.cartesianArrayToCartographicArray=function(e,r){t.Check.defined("cartesians",e);consta=e.length;n.defined(r)?r.length=a:r=newArray(a);for(lett=0;t<a;++t)r[t]=this.cartesianToCartographic(e[t],r[t]);returnr},w.prototype.scaleToGeodeticSurface=function(e,t){returnd(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},w.prototype.scaleToGeocentricSurface=function(e,r){t.Check.typeOf.object("cartesian",e),n.defined(r)||(r=newa);constc=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(c*c*u.x+o*o*u.y+i*i*u.z);returna.multiplyByScalar(e,s,r)},w.prototype.transformPositionToScaledSpace=function(e,t){returnn.defined(t)||(t=newa),a.multiplyComponents(e,this._oneOverRadii,t)},w.prototype.transformPositionFromScaledSpace=function(e,t){returnn.defined(t)||(t=newa),a.multiplyComponents(e,this._radii,t)},w.prototype.equals=function(e){returnthis===e||n.defined(e)&&a.equals(this._radii,e._radii)},w.prototype.toString=function(){returnthis._radii.toString()},w.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,c,o){if(t.Check.typeOf.object("position",e),!r.CesiumMath.equalsEpsilon(this._radii.x,this._radii.y,r.CesiumMath.EPSILON15))thrownewt.DeveloperError("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t.Check.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),c=n.defaultValue(c,0);consti=this._squaredXOverSquaredZ;if(n.defined(o)||(o=newa),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-c))returno};constS=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],R=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function_(e,n,r){t.Check.typeOf.number("a",e),t.Check.typeOf.number("b",n),t.Check.typeOf.func("func",r);consta=.5*(n+e),c=.5*(n-e);leto=0;for(lett=0;t<5;t++){conste=c*S[t];o+=R[t]*(r(a+e)+r(a-e))}returno*=c,o}functionV(e,t,r,a,c,o,i,u,s){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(a,0),this[2]=n.defaultValue(i,0),this[3]=n.defaultValue(t,0),this[4]=n.defaultValue(c,0),this[5]=n.defaultValue(u,0),this[6]=n.defaultValue(r,0),this[7]=n.defaultValue(o,0),this[8]=n.defaultValue(s,0)}w.prototype.surfaceArea=function(e){t.Check.typeOf.object("rectangle",e);constn=e.west;leta=e.east;constc=e.south,o=e.north;while(a<n)a+=r.CesiumMath.TWO_PI;consti=this._radiiSquared,u=i.x,s=i.y,f=i.z,h=u*s;return_(c,o,(function(e){constt=Math.cos(e),r=Math.sin(e);returnMath.cos(e)*_(n,a,(function(e){constn=Math.cos(e),a=Math.sin(e);returnMath.sqrt(h*r*r+f*(s*n*n+u*a*a)*t*t)}))}))},V.packedLength=9,V.pack=function(e,r,a){returnt.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r[a++]=e[4],r[a++]=e[5],r[a++]=e[6],r[a++]=e[7],r[a++]=e[8],r},V.unpack=function(e,r,a){returnt.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=newV),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},V.packArray=function(e,r){t.Check.defined("array",e);consta=e.length,c=9*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)thrownewt.DeveloperError("If result is a typed array, it must have exactly array.length * 9 elements");r.length!==c&&(r.length=c)}elser=newArray(c);for(lett=0;t<a;++t)V.pack(e[t],r,9*t);returnr},V.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)thrownewt.DeveloperError("array length must be a multiple of 9.");consta=e.length;n.defined(r)?r.length=a/9:r=newArray(a/9);for(lett=0;t<a;t+=9){constn=t/9;r[n]=V.unpack(e,t,r[n])}returnr},V.clone=function(e,t){if(n.defined(e))returnn.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):newV(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},V.fromArray=V.unpack,V.fromColumnMajorArray=function(e,n){returnt.Check.defined("values",e),V.clone(e,n)},V.fromRowMajorArray=function(e,r){returnt.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],r):newV(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},V.fromQuaternion=function(e,r){t.Check.typeOf.object("quaternion",e);consta=e.x*e.x,c=e.x*e.y,o=e.x*e.z,i=e.x*e.w,u=e.y*e.y,s=e.y*e.z,f=e.y*e.w,h=e.z*e.z,l=e.z*e.w,y=e.w*e.w,p=a-u-h+y,d=2*(c-l),m=2*(o+f),O=2*(c+l),C=-a+u-h+y,b=2*(s-i),k=2*(o-f),x=2*(s+i),g=-a-u+h+y;returnn.defined(r)?(r[0]=p,r[1]=O,r[2]=k,r[3]=d,r[4]=C,r[5]=x,r[6]=m,r[7]=b,r[8]=g,r):newV(p,d,m,O,C,b,k,x,g)},V.fromHeadingPitchRoll=function(e,r){t.Check.typeOf.object("headingPitchRoll",e);consta=Math.cos(-e.pitch),c=Math.cos(-e.heading),o=Math.cos(e.roll),i=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),f=a*c,h=-o*u+s*i*c,l=s*u+o*i*c,y=a*u,p=o*c+s*i*u,d=-s*c+o*i*u,m=-i,O=s*a,C=o*a;returnn.defined(r)?(r[0]=f,r[1]=y,r[2]=m,r[3]=h,r[4]=p,r[5]=O,r[6]=l,r[7]=d,r[8]=C,r):newV(f,h,l,y,p,d,m,O,C)},V.fromScale=function(e,r){returnt.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=e.y,r[5]=0,r[6]=0,r[7]=0,r[8]=e.z,r):newV(e.x,0,0,0,e.y,0,0,0,e.z)},V.fromUniformScale=function(e,r){returnt.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=e,r[5]=0,r[6]=0,r[7]=0,r[8]=e,r):newV(e,0,0,0,e,0,0,0,e)},V.fromCrossProduct=function(e,r){returnt.Check.typeOf.object("vector",e),n.defined(r)?(r[0]=0,r[1]=e.z,r[2]=-e.y,r[3]=-e.z,r[4]=0,r[5]=e.x,r[6]=e.y,r[7]=-e.x,r[8]=0,r):newV(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},V.fromRotationX=function(e,r){t.Check.typeOf.number("angle",e);consta=Math.cos(e),c=Math.sin(e);returnn.defined(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=a,r[5]=c,r[6]=0,r[7]=-c,r[8]=a,r):newV(1,0,0,0,a,-c,0,c,a)},V.fromRotationY=function(e,r){t.Check.typeOf.number("angle",e);consta=Math.cos(e),c=Math.sin(e);returnn.defined(r)?(r[0]=a,r[1]=0,r[2]=-c,r[3]=0,r[4]=1,r[5]=0,r[6]=c,r[7]=0,r[8]=a,r):newV(a,0,c,0,1,0,-c,0,a)},V.fromRotationZ=function(e,r){t.Check.typeOf.number("angle",e);consta=Math.cos(e),c=Math.sin(e);returnn.defined(r)?(r[0]=a,r[1]=c,r[2]=0,r[3]=-c,r[4]=a,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):newV(a,-c,0,c,a,0,0,0,1)},V.toArray=function(e,r){returnt.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},V.getElementIndex=function(e,n){returnt.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,2),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,2),3*e+n},V.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("result",r);consta=3*n,c=e[a],o=e[a+1],i=e[a+2];returnr.x=c,r.y=o,r.z=i,r},V.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=V.clone(e,a);constc=3*n;returna[c]=r.x,a[c+1]=r.y,a[c+2]=r.z,a},V.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("result",r);consta=e[n],c=e[n+3],o=e[n+6];returnr.x=a,r.y=c,r.z=o,r},V.setRow=function(e,n,r,a){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=V.clone(e,a),a[n]=r.x,a[n+3]=r.y,a[n+6]=r.z,a};constv=newa;V.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);consta=V.getScale(e,v),c=n.x/a.x,o=n.y/a.y,i=n.z/a.z;returnr[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3]*o,r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*i,r};constA=newa;V.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);consta=V.getScale(e,A),c=n/a.x,o=n/a.y,i=n/a.z;returnr[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3]*o,r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*i,r};constN=newa;V.getScale=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=a.magnitude(a.fromElements(e[0],e[1],e[2],N)),n.y=a.magnitude(a.fromElements(e[3],e[4],e[5],N)),n.z=a.magnitude(a.fromElements(e[6],e[7],e[8],N)),n};constI=newa;V.getMaximumScale=function(e){returnV.getScale(e,I),a.maximumComponent(I)};constU=newa;V.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);consta=V.getScale(e,U);returnr[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.x,r[3]=n[3]*a.y,r[4]=n[4]*a.y,r[5]=n[5]*a.y,r[6]=n[6]*a.z,r[7]=n[7]*a.z,r[8]=n[8]*a.z,r};constP=newa;functionL(e){lett=0;for(letn=0;n<9;++n){constr=e[n];t+=r*r}returnMath.sqrt(t)}V.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);constr=V.getScale(e,P);returnn[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.x,n[3]=e[3]/r.y,n[4]=e[4]/r.y,n[5]=e[5]/r.y,n[6]=e[6]/r.z,n[7]=e[7]/r.z,n[8]=e[8]/r.z,n},V.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);consta=e[0]*n[0]+e[3]*n[1]+e[6]*n[2],c=e[1]*n[0]+e[4]*n[1]+e[7]*n[2],o=e[2]*n[0]+e[5]*n[1]+e[8]*n[2],i=e[0]*n[3]+e[3]*n[4]+e[6]*n[5],u=e[1]*n[3]+e[4]*n[4]+e[7]*n[5],s=e[2]*n[3]+e[5]*n[4]+e[8]*n[5],f=e[0]*n[6]+e[3]*n[7]+e[6]*n[8],h=e[1]*n[6]+e[4]*n[7]+e[7]*n[8],l=e[2]*n[6]+e[5]*n[7]+e[8]*n[8];returnr[0]=a,r[1]=c,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=f,r[7]=h,r[8]=l,r},V.add=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r[4]=e[4]+n[4],r[5]=e[5]+n[5],r[6]=e[6]+n[6],r[7]=e[7]+n[7],r[8]=e[8]+n[8],r},V.subtract=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r[4]=e[4]-n[4],r[5]=e[5]-n[5],r[6]=e[6]-n[6],r[7]=e[7]-n[7],r[8]=e[8]-n[8],r},V.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);consta=n.x,c=n.y,o=n.z,i=e[0]*a+e[3]*c+e[6]*o,u=e[1]*a+e[4]*c+e[7]*o,s=e[2]*a+e[5]*c+e[8]*o;returnr.x=i,r.y=u,r.z=s,r},V.multiplyByScalar=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r},V.multiplyByScale=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.x,r[3]=e[3]*n.y,r[4]=e[4]*n.y,r[5]=e[5]*n.y,r[6]=e[6]*n.z,r[7]=e[7]*n.z,r[8]=e[8]*n.z,r},V.multiplyByUniformScale=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r},V.negate=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=-e[7],n[8]=-e[8],n},V.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);constr=e[0],a=e[3],c=e[6],o=e[1],i=e[4],u=e[7],s=e[2],f=e[5],h=e[8];returnn[0]=r,n[1]=a,n[2]=c,n[3]=o,n[4]=i,n[5]=u,n[6]=s,n[7]=f,n[8]=h,n};constW=[1,0,0],B=[2,2,1];functionD(e){lett=0;for(letn=0;n<3;++n){constr=e[V.getElementIndex(B[n],W[n])];t+=2*r*r}returnMath.sqrt(t)}function$(e,t){constn=r.CesiumMath.EPSILON15;leta=0,c=1;for(letr=0;r<3;++r){constt=Math.abs(e[V.getElementIndex(B[r],W[r])]);t>a&&(c=r,a=t)}leto=1,i=0;constu=W[c],s=B[c];if(Math.abs(e[V.getElementIndex(s,u)])>n){constt=e[V.getElementIndex(s,s)],n=e[V.getElementIndex(u,u)],r=e[V.getElementIndex(s,u)],a=(t-n)/2/r;letc;c=a<0?-1/(-a+Math.sqrt(1+a*a)):1/(a+Math.sqrt(1+a*a)),o=1/Math.sqrt(1+c*c),i=c*o}returnt=V.clone(V.IDENTITY,t),t[V.getElementIndex(u,u)]=t[V.getElementIndex(s,s)]=o,t[V.getElementIndex(s,u)]=i,t[V.getElementIndex(u,s)]=-i,t}constX=newV,Z=newV;V.computeEigenDecomposition=function(e,a){t.Check.typeOf.object("matrix",e);constc=r.CesiumMath.EPSILON20,o=10;leti=0,u=0;n.defined(a)||(a={});consts=a.unitary=V.clone(V.IDENTITY,a.unitary),f=a.diagonal=V.clone(e,a.diagonal),h=c*L(f);while(u<o&&D(f)>h)$(f,X),V.transpose(X,Z),V.multiply(f,X,f),V.multiply(Z,f,f),V.multiply(s,X,s),++i>2&&(++u,i=0);returna},V.abs=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n},V.determinant=function(e){t.Check.typeOf.object("matrix",e);constn=e[0],r=e[3],a=e[6],c=e[1],o=e[4],i=e[7],u=e[2],s=e[5],f=e[8];returnn*(o*f-s*i)+c*(s*a-r*f)+u*(r*i-o*a)},V.inverse=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);consta=e[0],c=e[1],o=e[2],i=e[3],u=e[4],s=e[5],f=e[6],h=e[7],l=e[8],y=V.determinant(e);if(Math.abs(y)<=r.CesiumMath.EPSILON15)thrownewt.DeveloperError("matrix is not invertible");n[0]=u*l-h*s,n[1]=h*o-c*l,n[2]=c*s-u*o,n[3]=f*s-i*l,n[4]=a*l-f*o,n[5]=i*o-a*s,n[6]=i*h-f*u,n[7]=f*c-a*h,n[8]=a*u-i*c;constp=1/y;returnV.multiplyByScalar(n,p,n)};constY=newV;functionF(e,t,r,a){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0),this.w=n.defaultValue(a,0)}V.inverseTranspose=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),V.inverse(V.transpose(e,Y),n)},V.equals=function(e,t){returne===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},V.equalsEpsilon=function(e,t,r){returnr=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},V.IDENTITY=Object.freeze(newV(1,0,0,0,1,0,0,0,1)),V.ZERO=Object.freeze(newV(0,0,0,0,0,0,0,0,0)),V.COLUMN0ROW0=0,V.COLUMN0ROW1=1,V.COLUMN0ROW2=2,V.COLUMN1ROW0=3,V.COLUMN1ROW1=4,V.COLUMN1ROW2=5,V.COLUMN2ROW0=6,V.COLUMN2ROW1=7,V.COLUMN2ROW2=8,Object.defineProperties(V.prototype,{length:{get:function(){returnV.packedLength}}}),V.prototype.clone=function(e){returnV.clone(this,e)},V.prototype.equals=function(e){returnV.equals(this,e)},V.equalsArray=function(e,t,n){returne[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},V.prototype.equalsEpsilon=function(e,t){returnV.equalsEpsilon(this,e,t)},V.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`},F.fromElements=function(e,t,r,a,c){returnn.defined(c)?(c.x=e,c.y=t,c.z=r,c.w=a,c):newF(e,t,r,a)},F.fromColor=function(e,r){returnt.Check.typeOf.object("color",e),n.defined(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):newF(e.red,e.green,e.blue,e.alpha)},F.clone=function(e,t){if(n.defined(e))returnn.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):newF(e.x,e.y,e.z,e.w)},F.packedLength=4,F.pack=function(e,r,a){returnt.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a++]=e.y,r[a++]=e.z,r[a]=e.w,r},F.unpack=function(e,r,a){returnt.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=newF),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},F.packArray=function(e,r){t.Check.defined("array",e);consta=e.length,c=4*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)thrownewt.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");r.length!==c&&(r.length=c)}elser=newArray(c);for(lett=0;t<a;++t)F.pack(e[t],r,4*t);returnr},F.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)thrownewt.DeveloperError("array length must be a multiple of 4.");consta=e.length;n.defined(r)?r.length=a/4:r=newArray(a/4);for(lett=0;t<a;t+=4){constn=t/4;r[n]=F.unpack(e,t,r[n])}returnr},F.fromArray=F.unpack,F.maximumComponent=function(e){returnt.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},F.minimumComponent=function(e){returnt.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},F.minimumByComponent=function(e,n,r){returnt.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.z=Math.min(e.z,n.z),r.w=Math.min(e.w,n.w),r},F.maximumByComponent=function(e,n,r){returnt.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r.z=Math.max(e.z,n.z),r.w=Math.max(e.w,n.w),r},F.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);consto=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y),u=r.CesiumMath.clamp(e.z,n.z,a.z),s=r.CesiumMath.clamp(e.w,n.w,a.w);returnc.x=o,c.y=i,c.z=u,c.w=s,c},F.magnitudeSquared=function(e){returnt.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},F.magnitude=function(e){returnMath.sqrt(F.magnitudeSquared(e))};constG=newF;F.distance=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),F.subtract(e,n,G),F.magnitude(G)},F.distanceSquared=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),F.subtract(e,n,G),F.magnitudeSquared(G)},F.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);constr=F.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,n.z=e.z/r,n.w=e.w/r,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))thrownewt.DeveloperError("normalized result is not a number");returnn},F.dot=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w},F.multiplyComponents=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r.z=e.z*n.z,r.w=e.w*n.w,r},F.divideComponents=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r.z=e.z/n.z,r.w=e.w/n.w,r},F.add=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r.z=e.z+n.z,r.w=e.w+n.w,r},F.subtract=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r.z=e.z-n.z,r.w=e.w-n.w,r},F.multiplyByScalar=function(e,n,r){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r.z=e.z*n,r.w=e.w*n,r},F.divideByScalar=function(e,n,r){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r.z=e.z/n,r.w=e.w/n,r},F.negate=function(e,n){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n},F.abs=function(e,n){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n.w=Math.abs(e.w),n};constH=newF;F.lerp=function(e,n,r,a){returnt.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",a),F.multiplyByScalar(n,r,H),a=F.multiplyByScalar(e,1-r,a),F.add(H,a,a)};constQ=newF;F.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);constr=F.normalize(e,Q);returnF.abs(r,r),n=r.x<=r.y?r.x<=r.z?r.x<=r.w?F.clone(F.UNIT_X,n):F.clone(F.UNIT_W,n):r.z<=r.w?F.clone(F.UNIT_Z,n):F.clone(F.UNIT_W,n):r.y<=r.z?r.y<=r.w?F.clone(F.UNIT_Y,n):F.clone(F.UNIT_W,n):r.z<=r.w?F.clone(F.UNIT_Z,n):F.clone(F.UNIT_W,n),n},F.equals=function(e,t){returne===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},F.equalsArray=function(e,t,n){returne.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},F.equalsEpsilon=function(e,t,a,c){returne===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)&&r.CesiumMath.equalsEpsilon(e.z,t.z,a,c)&&r.CesiumMath.equalsEpsilon(e.w,t.w,a,c)},F.ZERO=Object.freeze(newF(0,0,0,0)),F.ONE=Object.freeze(newF(1,1,1,1)),F.UNIT_X=Object.freeze(newF(1,0,0,0)),F.UNIT_Y=Object.freeze(newF(0,1,0,0)),F.UNIT_Z=Object.freeze(newF(0,0,1,0)),F.UNIT_W=Object.freeze(newF(0,0,0,1)),F.prototype.clone=function(e){returnF.clone(this,e)},F.prototype.equals=function(e){returnF.equals(this,e)},F.prototype.equalsEpsilon=function(e,t,n){returnF.equalsEpsilon(this,e,t,n)},F.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};constJ=newFloat32Array(1),K=newUint8Array(J.buffer),ee=newUint32Array([287454020]),te=newUint8Array(ee.buffer),ne=68===te[0];functionre(e,t,r,a,c,o,i,u,s,f,h,l,y,p,d,m){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(c,0),this[2]=n.defaultValue(s,0),this[3]=n.defaultValue(y,0),this[4]=n.defaultValue(t,0),this[5]=n.defaultValue(o,0),this[6]=n.defaultValue(f,0),this[7]=n.defaultValue(p,0),this[8]=n.defaultValue(r,0),this[9]=n.defaultValue(i,0),this[10]=n.defaultValue(h,0),this[11]=n.defaultValue(d,0),this[12]=n.defaultValue(a,0),this[13]=n.defaultValue(u,0),this[14]=n.defaultValue(l,0),this[15]=n.defaultValue(m,0)}F.packFloat=function(e,r){returnt.Check.typeOf.number("value",e),n.defined(r)||(r=newF),J[0]=e,ne?(r.x=K[0],r.y=K[1],r.z=K[2],r.w=K[3]):(r.x=K[3],r.y=K[2],r.z=K[1],r.w=K[0]),r},F.unpackFloat=function(e){returnt.Check.typeOf.object("packedFloat",e),ne?(K[0]=e.x,K[1]=e.y,K[2]=e.z,K[3]=e.w):(K[0]=e.w,K[1]=e.z,K[2]=e.y,K[3]=e.x),J[0]},re.packedLength=16,re.pack=function(e,r,a){returnt.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r[a++]=e[4],r[a++]=e[5],r[a++]=e[6],r[a++]=e[7],r[a++]=e[8],r[a++]=e[9],r[a++]=e[10],r[a++]=e[11],r[a++]=e[12],r[a++]=e[13],r[a++]=e[14],r[a]=e[15],r},re.unpack=function(e,r,a){returnt.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=newre),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a[9]=e[r++],a[10]=e[r++],a[11]=e[r++],a[12]=e[r++],a[13]=e[r++],a[14]=e[r++],a[15]=e[r],a},re.packArray=function(e,r){t.Check.defined("array",e);consta=e.length,c=16*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)thrownewt.DeveloperError("If result is a typed array, it must have exactly array.length * 16 elements");r.length!==c&&(r.length=c)}elser=newArray(c);for(lett=0;t<a;++t)re.pack(e[t],r,16*t);returnr},re.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)thrownewt.DeveloperError("array length must be a multiple of 16.");consta=e.length;n.defined(r)?r.length=a/16:r=newArray(a/16);for(lett=0;t<a;t+=16){constn=t/16;r[n]=re.unpack(e,t,r[n])}returnr},re.clone=function(e,t){if(n.defined(e))returnn.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):newre(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},re.fromArray=re.unpack,re.fromColumnMajorArray=function(e,n){returnt.Check.defined("values",e),re.clone(e,n)},re.fromRowMajorArray=function(e,r){returnt.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15],r):newre(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},re.fromRotationTranslation=function(e,r,c){returnt.Check.typeOf.object("rotation",e),r=n.defaultValue(r,a.ZERO),n.defined(c)?(c[0]=e[0],c[1]=e[1],c[2]=e[2],c[3]=0,c[4]=e[3],c[5]=e[4],c[6]=e[5],c[7]=0,c[8]=e[6],c[9]=e[7],c[10]=e[8],c[11]=0,c[12]=r.x,c[13]=r.y,c[14]=r.z,c[15]=1,c):newre(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},re.fromTranslationQuaternionRotationScale=function(e,r,a,c){t.Check.typeOf.object("translation",e),t.Check.typeOf.object("rotation",r),t.Check.typeOf.object("scale",a),n.defined(c)||(c=newre);consto=a.x,i=a.y,u=a.z,s=r.x*r.x,f=r.x*r.y,h=r.x*r.z,l=r.x*r.w,y=r.y*r.y,p=r.y*r.z,d=r.y*r.w,m=r.z*r.z,O=r.z*r.w,C=r.w*r.w,b=s-y-m+C,k=2*(f-O),x=2*(h+d),g=2*(f+O),j=-s+y-m+C,w=2*(p-l),M=2*(h-d),z=2*(p+l),E=-s-y+m+C;returnc[0]=b*o,c[1]=g*o,c[2]=M*o,c[3]=0,c[4]=k*i,c[5]=j*i,c[6]=z*i,c[7]=0,c[8]=x*u,c[9]=w*u,c[10]=E*u,c[11]=0,c[12]=e.x,c[13]=e.y,c[14]=e.z,c[15]=1,c},re.fromTranslationRotationScale=function(e,n){returnt.Check.typeOf.object("translationRotationScale",e),re.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,n)},re.fromTranslation=function(e,n){returnt.Check.typeOf.object("translation",e),re.fromRotationTranslation(V.IDENTITY,e,n)},re.fromScale=function(e,r){returnt.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e.y,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e.z,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):newre(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},re.fromUniformScale=function(e,r){returnt.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):newre(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},re.fromRotation=function(e,r){returnt.Check.typeOf.object("rotation",e),n.defined(r)||(r=newre),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=0,r[4]=e[3],r[5]=e[4],r[6]=e[5],r[7]=0,r[8]=e[6],r[9]=e[7],r[10]=e[8],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r};constae=newa,ce=newa,oe=newa;re.fromCamera=function(e,r){t.Check.typeOf.object("camera",e);constc=e.position,o=e.direction,i=e.up;t.Check.typeOf.object("camera.position",c),t.Check.typeOf.object("camera.direction",o),t.Check.typeOf.object("camera.up",i),a.normalize(o,ae),a.normalize(a.cross(ae,i,ce),ce),a.normalize(a.cross(ce,ae,oe),oe);constu=ce.x,s=ce.y,f=ce.z,h=ae.x,l=ae.y,y=ae.z,p=oe.x,d=oe.y,m=oe.z,O=c.x,C=c.y,b=c.z,k=u*-O+s*-C+f*-b,x=p*-O+d*-C+m*-b,g=h*O+l*C+y*b;returnn.defined(r)?(r[0]=u,r[1]=p,r[2]=-h,r[3]=0,r[4]=s,r[5]=d,r[6]=-l,r[7]=0,r[8]=f,r[9]=m,r[10]=-y,r[11]=0,r[12]=k,r[13]=x,r[14]=g,r[15]=1,r):newre(u,s,f,k,p,d,m,x,-h,-l,-y,g,0,0,0,1)},re.computePerspectiveFieldOfView=function(e,n,r,a,c){t.Check.typeOf.number.greaterThan("fovY",e,0),t.Check.typeOf.number.lessThan("fovY",e,Math.PI),t.Check.typeOf.number.greaterThan("near",r,0),t.Check.typeOf.number.greaterThan("far",a,0),t.Check.typeOf.object("result",c);consto=Math.tan(.5*e),i=1/o,u=i/n,s=(a+r)/(r-a),f=2*a*r/(r-a);returnc[0]=u,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=i,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=s,c[11]=-1,c[12]=0,c[13]=0,c[14]=f,c[15]=0,c},re.computeOrthographicOffCenter=function(e,n,r,a,c,o,i){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.number("far",o),t.Check.typeOf.object("result",i);letu=1/(n-e),s=1/(a-r),f=1/(o-c);consth=-(n+e)*u,l=-(a+r)*s,y=-(o+c)*f;returnu*=2,s*=2,f*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=f,i[11]=0,i[12]=h,i[13]=l,i[14]=y,i[15]=1,i},re.computePerspectiveOffCenter=function(e,n,r,a,c,o,i){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.number("far",o),t.Check.typeOf.object("result",i);constu=2*c/(n-e),s=2*c/(a-r),f=(n+e)/(n-e),h=(a+r)/(a-r),l=-(o+c)/(o-c),y=-1,p=-2*o*c/(o-c);returni[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=f,i[9]=h,i[10]=l,i[11]=y,i[12]=0,i[13]=0,i[14]=p,i[15]=0,i},re.computeInfinitePerspectiveOffCenter=function(e,n,r,a,c,o){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.object("result",o);consti=2*c/(n-e),u=2*c/(a-r),s=(n+e)/(n-e),f=(a+r)/(a-r),h=-1,l=-1,y=-2*c;returno[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=f,o[10]=h,o[11]=l,o[12]=0,o[13]=0,o[14]=y,o[15]=0,o},re.computeViewportTransformation=function(e,t,r,a){n.defined(a)||(a=newre),e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);constc=n.defaultValue(e.x,0),o=n.defaultValue(e.y,0),i=n.defaultValue(e.width,0),u=n.defaultValue(e.height,0);t=n.defaultValue(t,0),r=n.defaultValue(r,1);consts=.5*i,f=.5*u,h=.5*(r-t),l=s,y=f,p=h,d=c+s,m=o+f,O=t+h,C=1;returna[0]=l,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=y,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=d,a[13]=m,a[14]=O,a[15]=C,a},re.computeView=function(e,n,r,c,o){returnt.Check.typeOf.object("position",e),t.Check.typeOf.object("direction",n),t.Check.typeOf.object("up",r),t.Check.typeOf.object("right",c),t.Check.typeOf.object("result",o),o[0]=c.x,o[1]=r.x,o[2]=-n.x,o[3]=0,o[4]=c.y,o[5]=r.y,o[6]=-n.y,o[7]=0,o[8]=c.z,o[9]=r.z,o[10]=-n.z,o[11]=0,o[12]=-a.dot(c,e),o[13]=-a.dot(r,e),o[14]=a.dot(n,e),o[15]=1,o},re.toArray=function(e,r){returnt.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},re.getElementIndex=function(e,n){returnt.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,3),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,3),4*e+n},re.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("result",r);consta=4*n,c=e[a],o=e[a+1],i=e[a+2],u=e[a+3];returnr.x=c,r.y=o,r.z=i,r.w=u,r},re.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=re.clone(e,a);constc=4*n;returna[c]=r.x,a[c+1]=r.y,a[c+2]=r.z,a[c+3]=r.w,a},re.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("result",r);consta=e[n],c=e[n+4],o=e[n+8],i=e[n+12];returnr.x=a,r.y=c,r.z=o,r.w=i,r},re.setRow=function(e,n,r,a){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=re.clone(e,a),a[n]=r.x,a[n+4]=r.y,a[n+8]=r.z,a[n+12]=r.w,a},re.setTranslation=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("translation",n),t.Check.typeOf.object("result",r),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=n.x,r[13]=n.y,r[14]=n.z,r[15]=e[15],r};constie=newa;re.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);consta=re.getScale(e,ie),c=n.x/a.x,o=n.y/a.y,i=n.z/a.z;returnr[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3],r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*o,r[7]=e[7],r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};constue=newa;re.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);consta=re.getScale(e,ue),c=n/a.x,o=n/a.y,i=n/a.z;returnr[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3],r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*o,r[7]=e[7],r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};constse=newa;re.getScale=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=a.magnitude(a.fromElements(e[0],e[1],e[2],se)),n.y=a.magnitude(a.fromElements(e[4],e[5],e[6],se)),n.z=a.magnitude(a.fromElements(e[8],e[9],e[10],se)),n};constfe=newa;re.getMaximumScale=function(e){returnre.getScale(e,fe),a.maximumComponent(fe)};consthe=newa;re.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);consta=re.getScale(e,he);returnr[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.x,r[3]=e[3],r[4]=n[3]*a.y,r[5]=n[4]*a.y,r[6]=n[5]*a.y,r[7]=e[7],r[8]=n[6]*a.z,r[9]=n[7]*a.z,r[10]=n[8]*a.z,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};constle=newa;re.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);constr=re.getScale(e,le);returnn[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.x,n[3]=e[4]/r.y,n[4]=e[5]/r.y,n[5]=e[6]/r.y,n[6]=e[8]/r.z,n[7]=e[9]/r.z,n[8]=e[10]/r.z,n},re.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);consta=e[0],c=e[1],o=e[2],i=e[3],u=e[4],s=e[5],f=e[6],h=e[7],l=e[8],y=e[9],p=e[10],d=e[11],m=e[12],O=e[13],C=e[14],b=e[15],k=n[0],x=n[1],g=n[2],j=n[3],w=n[4],M=n[5],z=n[6],E=n[7],q=n[8],T=n[9],S=n[10],R=n[11],_=n[12],V=n[13],v=n[14],A=n[15],N=a*k+u*x+l*g+m*j,I=c*k+s*x+y*g+O*j,U=o*k+f*x+p*g+C*j,P=i*k+h*x+d*g+b*j,L=a*w+u*M+l*z+m*E,W=c*w+s*M+y*z+O*E,B=o*w+f*M+p*z+C*E,D=i*w+h*M+d*z+b*E,$=a*q+u*T+l*S+m*R,X=c*q+s*T+y*S+O*R,Z=o*q+f*T+p*S+C*R,Y=i*q+h*T+d*S+b*R,F=a*_+u*V+l*v+m*A,G=c*_+s*V+y*v+O*A,H=o*_+f*V+p*v+C*A,Q=i*_+h*V+d*v+b*A;returnr[0]=N,r[1]=I,r[2]=U,r[3]=P,r[4]=L,r[5]=W,r[6]=B,r[7]=D,r[8]=$,r[9]=X,r[10]=Z,r[11]=Y,r[12]=F,r[13]=G,r[14]=H,r[15]=Q,r},re.add=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r[4]=e[4]+n[4],r[5]=e[5]+n[5],r[6]=e[6]+n[6],r[7]=e[7]+n[7],r[8]=e[8]+n[8],r[9]=e[9]+n[9],r[10]=e[10]+n[10],r[11]=e[11]+n[11],r[12]=e[12]+n[12],r[13]=e[13]+n[13],r[14]=e[14]+n[14],r[15]=e[15]+n[15],r},re.subtract=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r[4]=e[4]-n[4],r[5]=e[5]-n[5],r[6]=e[6]-n[6],r[7]=e[7]-n[7],r[8]=e[8]-n[8],r[9]=e[9]-n[9],r[10]=e[10]-n[10],r[11]=e[11]-n[11],r[12]=e[12]-n[12],r[13]=e[13]-n[13],r[14]=e[14]-n[14],r[15]=e[15]-n[15],r},re.multiplyTransformation=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);consta=e[0],c=e[1],o=e[2],i=e[4],u=e[5],s=e[6],f=e[8],h=e[9],l=e[10],y=e[12],p=e[13],d=e[14],m=n[0],O=n[1],C=n[2],b=n[4],k=n[5],x=n[6],g=n[8],j=n[9],w=n[10],M=n[12],z=n[13],E=n[14],q=a*m+i*O+f*C,T=c*m+u*O+h*C,S=o*m+s*O+l*C,R=a*b+i*k+f*x,_=c*b+u*k+h*x,V=o*b+s*k+l*x,v=a*g+i*j+f*w,A=c*g+u*j+h*w,N=o*g+s*j+l*w,I=a*M+i*z+f*E+y,U=c*M+u*z+h*E+p,P=o*M+s*z+l*E+d;returnr[0]=q,r[1]=T,r[2]=S,r[3]=0,r[4]=R,r[5]=_,r[6]=V,r[7]=0,r[8]=v,r[9]=A,r[10]=N,r[11]=0,r[12]=I,r[13]=U,r[14]=P,r[15]=1,r},re.multiplyByMatrix3=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("rotation",n),t.Check.typeOf.object("result",r);consta=e[0],c=e[1],o=e[2],i=e[4],u=e[5],s=e[6],f=e[8],h=e[9],l=e[10],y=n[0],p=n[1],d=n[2],m=n[3],O=n[4],C=n[5],b=n[6],k=n[7],x=n[8],g=a*y+i*p+f*d,j=c*y+u*p+h*d,w=o*y+s*p+l*d,M=a*m+i*O+f*C,z=c*m+u*O+h*C,E=o*m+s*O+l*C,q=a*b+i*k+f*x,T=c*b+u*k+h*x,S=o*b+s*k+l*x;returnr[0]=g,r[1]=j,r[2]=w,r[3]=0,r[4]=M,r[5]=z,r[6]=E,r[7]=0,r[8]=q,r[9]=T,r[10]=S,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},re.multiplyByTranslation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("translation",n),t.Check.typeOf.object("result",r);consta=n.x,c=n.y,o=n.z,i=a*e[0]+c*e[4]+o*e[8]+e[12],u=a*e[1]+c*e[5]+o*e[9]+e[13],s=a*e[2]+c*e[6]+o*e[10]+e[14];returnr[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=i,r[13]=u,r[14]=s,r[15]=e[15],r},re.multiplyByScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);consta=n.x,c=n.y,o=n.z;return1===a&&1===c&&1===o?re.clone(e,r):(r[0]=a*e[0],r[1]=a*e[1],r[2]=a*e[2],r[3]=e[3],r[4]=c*e[4],r[5]=c*e[5],r[6]=c*e[6],r[7]=e[7],r[8]=o*e[8],r[9]=o*e[9],r[10]=o*e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r)},re.multiplyByUniformScale=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3],r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7],r[8]=e[8]*n,r[9]=e[9]*n,r[10]=e[10]*n,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},re.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);consta=n.x,c=n.y,o=n.z,i=n.w,u=e[0]*a+e[4]*c+e[8]*o+e[12]*i,s=e[1]*a+e[5]*c+e[9]*o+e[13]*i,f=e[2]*a+e[6]*c+e[10]*o+e[14]*i,h=e[3]*a+e[7]*c+e[11]*o+e[15]*i;returnr.x=u,r.y=s,r.z=f,r.w=h,r},re.multiplyByPointAsVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);consta=n.x,c=n.y,o=n.z,i=e[0]*a+e[4]*c+e[8]*o,u=e[1]*a+e[5]*c+e[9]*o,s=e[2]*a+e[6]*c+e[10]*o;returnr.x=i,r.y=u,r.z=s,r},re.multiplyByPoint=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);consta=n.x,c=n.y,o=n.z,i=e[0]*a+e[4]*c+e[8]*o+e[12],u=e[1]*a+e[5]*c+e[9]*o+e[13],s=e[2]*a+e[6]*c+e[10]*o+e[14];returnr.x=i,r.y=u,r.z=s,r},re.multiplyByScalar=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r[9]=e[9]*n,r[10]=e[10]*n,r[11]=e[11]*n,r[12]=e[12]*n,r[13]=e[13]*n,r[14]=e[14]*n,r[15]=e[15]*n,r},re.negate=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=-e[7],n[8]=-e[8],n[9]=-e[9],n[10]=-e[10],n[11]=-e[11],n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=-e[15],n},re.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);constr=e[1],a=e[2],c=e[3],o=e[6],i=e[7],u=e[11];returnn[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=r,n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=a,n[9]=o,n[10]=e[10],n[11]=e[14],n[12]=c,n[13]=i,n[14]=u,n[15]=e[15],n},re.abs=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n[9]=Math.abs(e[9]),n[10]=Math.abs(e[10]),n[11]=Math.abs(e[11]),n[12]=Math.abs(e[12]),n[13]=Math.abs(e[13]),n[14]=Math.abs(e[14]),n[15]=Math.abs(e[15]),n},re.equals=function(e,t){returne===t||n.defined(e)&&n.defined(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},re.equalsEpsilon=function(e,t,r){returnr=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},re.getTranslation=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=e[12],n.y=e[13],n.z=e[14],n},re.getMatrix3=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],n};constye=newV,pe=newV,de=newF,me=newF(0,0,0,1);re.inverse=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);consta=e[0],c=e[4],o=e[8],i=e[12],u=e[1],s=e[5],f=e[9],h=e[13],l=e[2],y=e[6],p=e[10],d=e[14],m=e[3],O=e[7],C=e[11],b=e[15];letk=p*b,x=d*C,g=y*b,j=d*O,w=y*C,M=p*O,z=l*b,E=d*m,q=l*C,T=p*m,S=l*O,R=y*m;const_=k*s+j*f+w*h-(x*s+g*f+M*h),v=x*u+z*f+T*h-(k*u+E*f+q*h),A=g*u+E*s+S*h-(j*u+z*s+R*h),N=M*u+q*s+R*f-(w*u+T*s+S*f),I=x*c+g*o+M*i-(k*c+j*o+w*i),U=k*a+E*o+q*i-(x*a+z*o+T*i),P=j*a+z*c+R*i-(g*a+E*c+S*i),L=w*a+T*c+S*o-(M*a+q*c+R*o);k=o*h,x=i*f,g=c*h,j=i*s,w=c*f,M=o*s,z=a*h,E=i*u,q=a*f,T=o*u,S=a*s,R=c*u;constW=k*O+j*C+w*b-(x*O+g*C+M*b),B=x*m+z*C+T*b-(k*m+E*C+q*b),D=g*m+E*O+S*b-(j*m+z*O+R*b),$=M*m+q*O+R*C-(w*m+T*O+S*C),X=g*p+M*d+x*y-(w*d+k*y+j*p),Z=q*d+k*l+E*p-(z*p+T*d+x*l),Y=z*y+R*d+j*l-(S*d+g*l+E*y),G=S*p+w*l+T*y-(q*y+R*p+M*l);letH=a*_+c*v+o*A+i*N;if(Math.abs(H)<r.CesiumMath.EPSILON21){if(V.equalsEpsilon(re.getMatrix3(e,ye),pe,r.CesiumMath.EPSILON7)&&F.equals(re.getRow(e,3,de),me))returnn[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;thrownewt.RuntimeError("matrix is not invertible because its determinate is zero.")}returnH=1/H,n[0]=_*H,n[1]=v*H,n[2]=A*H,n[3]=N*H,n[4]=I*H,n[5]=U*H,n[6]=P*H,n[7]=L*H,n[8]=W*H,n[9]=B*H,n[10]=D*H,n[11]=$*H,n[12]=X*H,n[13]=Z*H,n[14]=Y*H,n[15]=G*H,n},re.inverseTransformation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);constr=e[0],a=e[1],c=e[2],o=e[4],i=e[5],u=e[6],s=e[8],f=e[9],h=e[10],l=e[12],y=e[13],p=e[14],d=-r*l-a*y-c*p,m=-o*l-i*y-u*p,O=-s*l-f*y-h*p;returnn[0]=r,n[1]=o,n[2]=s,n[3]=0,n[4]=a,n[5]=i,n[6]=f,n[7]=0,n[8]=c,n[9]=u,n[10]=h,n[11]=0,n[12]=d,n[13]=m,n[14]=O,n[15]=1,n};constOe=newre;functionCe(e,t,r,a){this.west=n.defaultValue(e,0),this.south=n.defaultValue(t,0),this.east=n.defaultValue(r,0),this.north=n.defaultValue(a,0)}re.inverseTranspose=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),re.inverse(re.transpose(e,Oe),n)},re.IDENTITY=Object.freeze(newre(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),re.ZERO=Object.freeze(newre(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),re.COLUMN0ROW0=0,re.COLUMN0ROW1=1,re.COLUMN0ROW2=2,re.COLUMN0ROW3=3,re.COLUMN1ROW0=4,re.COLUMN1ROW1=5,re.COLUMN1ROW2=6,re.COLUMN1ROW3=7,re.COLUMN2ROW0=8,re.COLUMN2ROW1=9,re.COLUMN2ROW2=10,re.COLUMN2ROW3=11,re.COLUMN3ROW0=12,re.COLUMN3ROW1=13,re.COLUMN3ROW2=14,re.COLUMN3ROW3=15,Object.defineProperties(re.prototype,{length:{get:function(){returnre.packedLength}}}),re.prototype.clone=function(e){returnre.clone(this,e)},re.prototype.equals=function(e){returnre.equals(this,e)},re.equalsArray=function(e,t,n){returne[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},re.prototype.equalsEpsilon=function(e,t){returnre.equalsEpsilon(this,e,t)},re.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\n(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\n(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\n(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`},Object.defineProperties(Ce.prototype,{width:{get:function(){returnCe.computeWidth(this)}},height:{get:function(){returnCe.computeHeight(this)}}}),Ce.packedLength=4,Ce.pack=function(e,r,a){returnt.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.west,r[a++]=e.south,r[a++]=e.east,r[a]=e.north,r},Ce.unpack=function(e,r,a){returnt.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=newCe),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},Ce.computeWidth=function(e){t.Check.typeOf.object("rectangle",e);letn=e.east;consta=e.west;returnn<a&&(n+=r.CesiumMath.TWO_PI),n-a},Ce.computeHeight=function(e){returnt.Check.typeOf.object("rectangle",e),e.north-e.south},Ce.fromDegrees=function(e,t,a,c,o){returne=r.CesiumMath.toRadians(n.defaultValue(e,0)),t=r.CesiumMath.toRadians(n.defaultValue(t,0)),a=r.CesiumMath.toRadians(n.defaultValue(a,0)),c=r.CesiumMath.toRadians(n.defaultValue(c,0)),n.defined(o)?(o.west=e,o.south=t,o.east=a,o.north=c,o):newCe(e,t,a,c)},Ce.fromRadians=function(e,t,r,a,c){returnn.defined(c)?(c.west=n.defaultValue(e,0),c.south=n.defaultValue(t,0),c.east=n.defaultValue(r,0),c.north=n.defaultValue(a,0),c):newCe(e,t,r,a)},Ce.fromCartographicArray=function(e,a){t.Check.defined("cartographics",e);letc=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,u=-Number.MAX_VALUE,s=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(lett=0,n=e.length;t<n;t++){constn=e[t];c=Math.min(c,n.longitude),o=Math.max(o,n.longitude),s=Math.min(s,n.latitude),f=Math.max(f,n.latitude);consta=n.longitude>=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;i=Math.min(i,a),u=Math.max(u,a)}returno-c>u-i&&(c=i,o=u,o>r.CesiumMath.PI&&(o-=r.CesiumMath.TWO_PI),c>r.CesiumMath.PI&&(c-=r.CesiumMath.TWO_PI)),n.defined(a)?(a.west=c,a.south=s,a.east=o,a.north=f,a):newCe(c,s,o,f)},Ce.fromCartesianArray=function(e,a,c){t.Check.defined("cartesians",e),a=n.defaultValue(a,w.WGS84);leto=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,s=-Number.MAX_VALUE,f=Number.MAX_VALUE,h=-Number.MAX_VALUE;for(lett=0,n=e.length;t<n;t++){constn=a.cartesianToCartographic(e[t]);o=Math.min(o,n.longitude),i=Math.max(i,n.longitude),f=Math.min(f,n.latitude),h=Math.max(h,n.latitude);constc=n.longitude>=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;u=Math.min(u,c),s=Math.max(s,c)}returni-o>s-u&&(o=u,i=s,i>r.CesiumMath.PI&&(i-=r.CesiumMath.TWO_PI),o>r.CesiumMath.PI&&(o-=r.CesiumMath.TWO_PI)),n.defined(c)?(c.west=o,c.south=f,c.east=i,c.north=h,c):newCe(o,f,i,h)},Ce.clone=function(e,t){if(n.defined(e))returnn.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):newCe(e.west,e.south,e.east,e.north)},Ce.equalsEpsilon=function(e,t,r){returnr=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.west-t.west)<=r&&Math.abs(e.south-t.south)<=r&&Math.abs(e.east-t.east)<=r&&Math.abs(e.north-t.north)<=r},Ce.prototype.clone=function(e){returnCe.clone(this,e)},Ce.prototype.equals=function(e){returnCe.equals(this,e)},Ce.equals=function(e,t){returne===t||n.defined(e)&&n.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Ce.prototype.equalsEpsilon=function(e,t){returnCe.equalsEpsilon(this,e,t)},Ce.validate=function(e){t.Check.typeOf.object("rectangle",e);constn=e.north;t.Check.typeOf.number.greaterThanOrEquals("north",n,-r.CesiumMath.PI_OVER_TWO),t.Check.typeOf.number.lessThanOrEquals("north",n,r.CesiumMath.PI_OVER_TWO);consta=e.south;t.Check.typeOf.number.greaterThanOrEquals("south",a,-r.CesiumMath.PI_OVER_TWO),t.Check.typeOf.number.lessThanOrEquals("south",a,r.CesiumMath.PI_OVER_TWO);constc=e.west;t.Check.typeOf.number.greaterThanOrEquals("west",c,-Math.PI),t.Check.typeOf.number.lessThanOrEquals("west",c,Math.PI);consto=e.east;t.Check.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),t.Check.typeOf.number.lessThanOrEquals("east",o,Math.PI)},Ce.southwest=function(e,r){returnt.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):newm(e.west,e.south)},Ce.northwest=function(e,r){returnt.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):newm(e.west,e.north)},Ce.northeast=function(e,r){returnt.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):newm(e.east,e.north)},Ce.southeast=function(e,r){returnt.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):newm(e.east,e.south)},Ce.center=function(e,a){t.Check.typeOf.object("rectangle",e);letc=e.east;consto=e.west;c<o&&(c+=r.CesiumMath.TWO_PI);consti=r.CesiumMath.negativePiToPi(.5*(o+c)),u=.5*(e.south+e.north);returnn.defined(a)?(a.longitude=i,a.latitude=u,a.height=0,a):newm(i,u)},Ce.intersection=function(e,a,c){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",a);leto=e.east,i=e.west,u=a.east,s=a.west;o<i&&u>0?o+=r.CesiumMath.TWO_PI:u<s&&o>0&&(u+=r.CesiumMath.TWO_PI),o<i&&s<0?s+=r.CesiumMath.TWO_PI:u<s&&i<0&&(i+=r.CesiumMath.TWO_PI);constf=r.CesiumMath.negativePiToPi(Math.max(i,s)),h=r.CesiumMath.negativePiToPi(Math.min(o,u));if((e.west<e.east||a.west<a.east)&&h<=f)return;constl=Math.max(e.south,a.south),y=Math.min(e.north,a.north);returnl>=y?void0:n.defined(c)?(c.west=f,c.south=l,c.east=h,c.north=y,c):newCe(f,l,h,y)},Ce.simpleIntersection=function(e,r,a){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",r);constc=Math.max(e.west,r.west),o=Math.max(e.south,r.south),i=Math.min(e.east,r.east),u=Math.min(e.north,r.north);if(!(o>=u||c>=i))returnn.defined(a)?(a.west=c,a.south=o,a.east=i,a.north=u,a):newCe(c,o,i,u)},Ce.union=function(e,a,c){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",a),n.defined(c)||(c=newCe);leto=e.east,i=e.west,u=a.east,s=a.west;o<i&&u>0?o+=r.CesiumMath.TWO_PI:u<s&&o>0&&(u+=r.CesiumMath.TWO_PI),o<i&&s<0?s+=r.CesiumMath.TWO_PI:u<s&&i<0&&(i+=r.CesiumMath.TWO_PI);constf=r.CesiumMath.negativePiToPi(Math.min(i,s)),h=r.CesiumMath.negativePiToPi(Math.max(o,u));returnc.west=f,c.south=Math.min(e.south,a.south),c.east=h,c.north=Math.max(e.north,a.north),c},Ce.expand=function(e,r,a){returnt.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("cartographic",r),n.defined(a)||(a=newCe),a.west=Math.min(e.west,r.longitude),a.south=Math.min(e.south,r.latitude),a.east=Math.max(e.east,r.longitude),a.north=Math.max(e.north,r.latitude),a},Ce.contains=function(e,n){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("cartographic",n);leta=n.longitude;constc=n.latitude,o=e.west;leti=e.east;returni<o&&(i+=r.CesiumMath.TWO_PI,a<0&&(a+=r.CesiumMath.TWO_PI)),(a>o||r.CesiumMath.equalsEpsilon(a,o,r.CesiumMath.EPSILON14))&&(a<i||r.CesiumMath.equalsEpsilon(a,i,r.CesiumMath.EPSILON14))&&c>=e.south&&c<=e.north};constbe=newm;functionke(e,t){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0)}Ce.subsample=function(e,a,c,o){t.Check.typeOf.object("rectangle",e),a=n.defaultValue(a,w.WGS84),c=n.defaultValue(c,0),n.defined(o)||(o=[]);leti=0;constu=e.north,s=e.south,f=e.east,h=e.west,l=be;l.height=c,l.longitude=h,l.latitude=u,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=f,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.latitude=s,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=h,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.latitude=u<0?u:s>0?s:0;for(lett=1;t<8;++t)l.longitude=-Math.PI+t*r.CesiumMath.PI_OVER_TWO,Ce.contains(e,l)&&(o[i]=a.cartographicToCartesian(l,o[i]),i++);return0===l.latitude&&(l.longitude=h,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=f,o[i]=a.cartographicToCartesian(l,o[i]),i++),o.length=i,o},Ce.subsection=function(e,a,c,o,i,u){if(t.Check.typeOf.object("rectangle",e),t.Check.typeOf.number.greaterThanOrEquals("westLerp",a,0),t.Check.typeOf.number.lessThanOrEquals("westLerp",a,1),t.Check.typeOf.number.greaterThanOrEquals("southLerp",c,0),t.Check.typeOf.number.lessThanOrEquals("southLerp",c,1),t.Check.typeOf.number.greaterThanOrEquals("eastLerp",o,0),t.Check.typeOf.number.lessThanOrEquals("eastLerp",o,1),t.Check.typeOf.number.greaterThanOrEquals("northLerp",i,0),t.Check.typeOf.number.lessThanOrEquals("northLerp",i,1),t.Check.typeOf.number.lessThanOrEquals("westLerp",a,o),t.Check.typeOf.number.lessThanOrEquals("southLerp",c,i),n.defined(u)||(u=newCe),e.west<=e.east){constt=e.east-e.west;u.west=e.west+a*t,u.east=e.west+o*t}else{constt=r.CesiumMath.TWO_PI+e.east-e.west;u.west=r.CesiumMath.negativePiToPi(e.west+a*t),u.east=r.CesiumMath.negativePiToPi(e.west+o*t)}consts=e.north-e.south;returnu.south=e.south+c*s,u.north=e.south+i*s,1===a&&(u.west=e.east),1===o&&(u.east=e.east),1===c&&(u.south=e.north),1===i&&(u.north=e.north),u},Ce.MAX_VALUE=Object.freeze(newCe(-Math.PI,-r.CesiumMath.PI_OVER_TWO,Math.PI,r.CesiumMath.PI_OVER_TWO)),ke.fromElements=function(e,t,r){returnn.defined(r)?(r.x=e,r.y=t,r):newke(e,t)},ke.clone=function(e,t){if(n.defined(e))returnn.defined(t)?(t.x=e.x,t.y=e.y,t):newke(e.x,e.y)},ke.fromCartesian3=ke.clone,ke.fromCartesian4=ke.clone,ke.packedLength=2,ke.pack=function(e,r,a){returnt.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a]=e.y,r},ke.unpack=function(e,r,a){returnt.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=newke),a.x=e[r++],a.y=e[r],a},ke.packArray=function(e,r){t.Check.defined("array",e);consta=e.length,c=2*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)thrownewt.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");r.length!==c&&(r.length=c)}elser=newArray(c);for(lett=0;t<a;++t)ke.pack(e[t],r,2*t);returnr},ke.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)thrownewt.DeveloperError("array length must be a multiple of 2.");consta=e.length;n.defined(r)?r.length=a/2:r=newArray(a/2);for(lett=0;t<a;t+=2){constn=t/2;r[n]=ke.unpack(e,t,r[n])}returnr},ke.fromArray=ke.unpack,ke.maximumComponent=function(e){returnt.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y)},ke.minimumComponent=function(e){returnt.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y)},ke.minimumByComponent=function(e,n,r){returnt.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r},ke.maximumByComponent=function(e,n,r){returnt.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r},ke.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);consto=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y);returnc.x=o,c.y=i,c},ke.magnitudeSquared=function(e){returnt.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},ke.magnitude=function(e){returnMath.sqrt(ke.magnitudeSquared(e))};constxe=newke;ke.distance=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),ke.subtract(e,n,xe),ke.magnitude(xe)},ke.distanceSquared=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),ke.subtract(e,n,xe),ke.magnitudeSquared(xe)},ke.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);constr=ke.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,isNaN(n.x)||isNaN(n.y))thrownewt.DeveloperError("normalized result is not a number");returnn},ke.dot=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y},ke.cross=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.y-e.y*n.x},ke.multiplyComponents=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r},ke.divideComponents=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r},ke.add=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r},ke.subtract=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r},ke.multiplyByScalar=function(e,n,r){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r},ke.divideByScalar=function(e,n,r){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r},ke.negate=function(e,n){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n},ke.abs=function(e,n){returnt.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n};constge=newke;ke.lerp=function(e,n,r,a){returnt.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",a),ke.multiplyByScalar(n,r,ge),a=ke.multiplyByScalar(e,1-r,a),ke.add(ge,a,a)};constje=newke,we=newke;ke.angleBetween=function(e,n){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),ke.normalize(e,je),ke.normalize(n,we),r.CesiumMath.acosClamped(ke.dot(je,we))};constMe=newke;functionze(e,t,r,a){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(r,0),this[2]=n.defaultValue(t,0),this[3]=n.defaultValue(a,0)}ke.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);constr=ke.normalize(e,Me);returnke.abs(r,r),n=r.x<=r.y?ke.clone(ke.UNIT_X,n):ke.clone(ke.UNIT_Y,n),n},ke.equals=function(e,t){returne===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y},ke.equalsArray=function(e,t,n){returne.x===t[n]&&e.y===t[n+1]},ke.equalsEpsilon=function(e,t,a,c){returne===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)},ke.ZERO=Object.freeze(newke(0,0)),ke.ONE=Object.freeze(newke(1,1)),ke.UNIT_X=Object.freeze(newke(1,0)),ke.UNIT_Y=Object.freeze(newke(0,1)),ke.prototype.clone=function(e){returnke.clone(this,e)},ke.prototype.equals=function(e){returnke.equals(this,e)},ke.prototype.equalsEpsilon=function(e,t,n){returnke.equalsEpsilon(this,e,t,n)},ke.prototype.toString=function(){return`(${this.x}, ${this.y})`},ze.packedLength=4,ze.pack=function(e,r,a){returnt.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r},ze.unpack=function(e,r,a){returnt.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=newze),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a},ze.packArray=function(e,r){t.Check.defined("array",e);consta=e.length,c=4*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)thrownewt.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");r.length!==c&&(r.length=c)}elser=newArray(c);for(lett=0;t<a;++t)ze.pack(e[t],r,4*t);returnr},ze.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)thrownewt.DeveloperError("array length must be a multiple of 4.");consta=e.length;n.defined(r)?r.length=a/4:r=newArray(a/4);for(lett=0;t<a;t+=4){constn=t/4;r[n]=ze.unpack(e,t,r[n])}returnr},ze.clone=function(e,t){if(n.defined(e))returnn.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):newze(e[0],e[2],e[1],e[3])},ze.fromArray=ze.unpack,ze.fromColumnMajorArray=function(e,n){returnt.Check.defined("values",e),ze.clone(e,n)},ze.fromRowMajorArray=function(e,r){returnt.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[2],r[2]=e[1],r[3]=e[3],r):newze(e[0],e[1],e[2],e[3])},ze.fromScale=function(e,r){returnt.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=e.y,r):newze(e.x,0,0,e.y)},ze.fromUniformScale=function(e,r){returnt.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=e,r):newze(e,0,0,e)},ze.fromRotation=function(e,r){t.Check.typeOf.number("angle",e);consta=Math.cos(e),c=Math.sin(e);returnn.defined(r)?(r[0]=a,r[1]=c,r[2]=-c,r[3]=a,r):newze(a,-c,c,a)},ze.toArray=function(e,r){returnt.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r):[e[0],e[1],e[2],e[3]]},ze.getElementIndex=function(e,n){returnt.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,1),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,1),2*e+n},ze.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("result",r);consta=2*n,c=e[a],o=e[a+1];returnr.x=c,r.y=o,r},ze.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=ze.clone(e,a);constc=2*n;returna[c]=r.x,a[c+1]=r.y,a},ze.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("result",r);consta=e[n],c=e[n+2];returnr.x=a,r.y=c,r},ze.setRow=function(e,n,r,a){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=ze.clone(e,a),a[n]=r.x,a[n+2]=r.y,a};constEe=newke;ze.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);consta=ze.getScale(e,Ee),c=n.x/a.x,o=n.y/a.y;returnr[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*o,r[3]=e[3]*o,r};constqe=newke;ze.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);consta=ze.getScale(e,qe),c=n/a.x,o=n/a.y;returnr[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*o,r[3]=e[3]*o,r};constTe=newke;ze.getScale=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=ke.magnitude(ke.fromElements(e[0],e[1],Te)),n.y=ke.magnitude(ke.fromElements(e[2],e[3],Te)),n};constSe=newke;ze.getMaximumScale=function(e){returnze.getScale(e,Se),ke.maximumComponent(Se)};constRe=newke;ze.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);consta=ze.getScale(e,Re);returnr[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.y,r[3]=n[3]*a.y,r};const_e=newke;ze.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);constr=ze.getScale(e,_e);returnn[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.y,n[3]=e[3]/r.y,n},ze.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);consta=e[0]*n[0]+e[2]*n[1],c=e[0]*n[2]+e[2]*n[3],o=e[1]*n[0]+e[3]*n[1],i=e[1]*n[2]+e[3]*n[3];returnr[0]=a,r[1]=o,r[2]=c,r[3]=i,r},ze.add=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r},ze.subtract=function(e,n,r){returnt.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r},ze.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);consta=e[0]*n.x+e[2]*n.y,c=e[1]*n.x+e[3]*n.y;returnr.x=a,r.y=c,r},ze.multiplyByScalar=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r},ze.multiplyByScale=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.y,r[3]=e[3]*n.y,r},ze.multiplyByUniformScale=function(e,n,r){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r},ze.negate=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n},ze.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);constr=e[0],a=e[2],c=e[1],o=e[3];returnn[0]=r,n[1]=a,n[2]=c,n[3]=o,n},ze.abs=function(e,n){returnt.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n},ze.equals=function(e,t){returne===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ze.equalsArray=function(e,t,n){returne[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},ze.equalsEpsilon=function(e,t,r){returnr=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},ze.IDENTITY=Object.freeze(newze(1,0,0,1)),ze.ZERO=Object.freeze(newze(0,0,0,0)),ze.COLUMN0ROW0=0,ze.COLUMN0ROW1=1,ze.COLUMN1ROW0=2,ze.COLUMN1ROW1=3,Object.defineProperties(ze.prototype,{length:{get:function(){returnze.packedLength}}}),ze.prototype.clone=function(e){returnze.clone(this,e)},ze.prototype.equals=function(e){returnze.equals(this,e)},ze.prototype.equalsEpsilon=function(e,t){returnze.equalsEpsilon(this,e,t)},ze.prototype.toString=function(){return`(${this[0]}, ${this[2]})\n(${this[1]}, ${this[3]})`},e.Cartesian2=ke,e.Cartesian3=a,e.Cartesian4=F,e.Cartographic=m,e.Ellipsoid=w,e.Matrix2=ze,e.Matrix3=V,e.Matrix4=re,e.Rectangle=Ce}));
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./EllipsoidTangentPlane-53e32153","./ComponentDatatype-4a60b8d6","./Plane-e20fba8c"],(function(a,e,t,n,r,i,s,o){"use strict";functionc(a,e){this.center=t.Cartesian3.clone(r.defaultValue(a,t.Cartesian3.ZERO)),this.halfAxes=t.Matrix3.clone(r.defaultValue(e,t.Matrix3.ZERO))}c.packedLength=t.Cartesian3.packedLength+t.Matrix3.packedLength,c.pack=function(a,e,i){returnn.Check.typeOf.object("value",a),n.Check.defined("array",e),i=r.defaultValue(i,0),t.Cartesian3.pack(a.center,e,i),t.Matrix3.pack(a.halfAxes,e,i+t.Cartesian3.packedLength),e},c.unpack=function(a,e,i){returnn.Check.defined("array",a),e=r.defaultValue(e,0),r.defined(i)||(i=newc),t.Cartesian3.unpack(a,e,i.center),t.Matrix3.unpack(a,e+t.Cartesian3.packedLength,i.halfAxes),i};constC=newt.Cartesian3,d=newt.Cartesian3,u=newt.Cartesian3,l=newt.Cartesian3,h=newt.Cartesian3,f=newt.Cartesian3,m=newt.Matrix3,x={unitary:newt.Matrix3,diagonal:newt.Matrix3};c.fromPoints=function(a,e){if(r.defined(e)||(e=newc),!r.defined(a)||0===a.length)returne.halfAxes=t.Matrix3.ZERO,e.center=t.Cartesian3.ZERO,e;letn;consti=a.length,s=t.Cartesian3.clone(a[0],C);for(n=1;n<i;n++)t.Cartesian3.add(s,a[n],s);consto=1/i;t.Cartesian3.multiplyByScalar(s,o,s);letp,M=0,w=0,g=0,b=0,y=0,O=0;for(n=0;n<i;n++)p=t.Cartesian3.subtract(a[n],s,d),M+=p.x*p.x,w+=p.x*p.y,g+=p.x*p.z,b+=p.y*p.y,y+=p.y*p.z,O+=p.z*p.z;M*=o,w*=o,g*=o,b*=o,y*=o,O*=o;constE=m;E[0]=M,E[1]=w,E[2]=g,E[3]=w,E[4]=b,E[5]=y,E[6]=g,E[7]=y,E[8]=O;constN=t.Matrix3.computeEigenDecomposition(E,x),T=t.Matrix3.clone(N.unitary,e.halfAxes);letP=t.Matrix3.getColumn(T,0,l),A=t.Matrix3.getColumn(T,1,h),I=t.Matrix3.getColumn(T,2,f),R=-Number.MAX_VALUE,S=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,L=Number.MAX_VALUE,q=Number.MAX_VALUE;for(n=0;n<i;n++)p=a[n],R=Math.max(t.Cartesian3.dot(P,p),R),S=Math.max(t.Cartesian3.dot(A,p),S),U=Math.max(t.Cartesian3.dot(I,p),U),D=Math.min(t.Cartesian3.dot(P,p),D),L=Math.min(t.Cartesian3.dot(A,p),L),q=Math.min(t.Cartesian3.dot(I,p),q);P=t.Cartesian3.multiplyByScalar(P,.5*(D+R),P),A=t.Cartesian3.multiplyByScalar(A,.5*(L+S),A),I=t.Cartesian3.multiplyByScalar(I,.5*(q+U),I);constv=t.Cartesian3.add(P,A,e.center);t.Cartesian3.add(v,I,v);constz=u;returnz.x=R-D,z.y=S-L,z.z=U-q,t.Cartesian3.multiplyByScalar(z,.5,z),t.Matrix3.multiplyByScale(e.halfAxes,z,e.halfAxes),e};constp=newt.Cartesian3,M=newt.Cartesian3;functionw(a,e,i,s,o,C,d,u,l,h,f){if(!r.defined(o)||!r.defined(C)||!r.defined(d)||!r.defined(u)||!r.defined(l)||!r.defined(h))thrownewn.DeveloperError("all extents (minimum/maximum X/Y/Z) are required.");r.defined(f)||(f=newc);constm=f.halfAxes;t.Matrix3.setColumn(m,0,e,m),t.Matrix3.setColumn(m,1,i,m),t.Matrix3.setColumn(m,2,s,m);letx=p;x.x=(o+C)/2,x.y=(d+u)/2,x.z=(l+h)/2;constw=M;w.x=(C-o)/2,w.y=(u-d)/2,w.z=(h-l)/2;constg=f.center;returnx=t.Matrix3.multiplyByVector(m,x,x),t.Cartesian3.add(a,x,g),t.Matrix3.multiplyByScale(m,w,m),f}constg=newt.Cartographic,b=newt.Cartesian3,y=newt.Cartographic,O=newt.Cartographic,E=newt.Cartographic,N=newt.Cartographic,T=newt.Cartographic,P=newt.Cartesian3,A=newt.Cartesian3,I=newt.Cartesian3,R=newt.Cartesian3,S=newt.Cartesian3,U=newt.Cartesian2,D=newt.Cartesian2,L=newt.Cartesian2,q=newt.Cartesian2,v=newt.Cartesian2,z=newt.Cartesian3,B=newt.Cartesian3,V=newt.Cartesian3,_=newt.Cartesian3,k=newt.Cartesian2,W=newt.Cartesian3,X=newt.Cartesian3,j=newt.Cartesian3,Z=newo.Plane(t.Cartesian3.UNIT_X,0);c.fromRectangle=function(a,e,c,C,d){if(!r.defined(a))thrownewn.DeveloperError("rectangle is required");if(a.width<0||a.width>s.CesiumMath.TWO_PI)thrownewn.DeveloperError("Rectangle width must be between 0 and 2*pi");if(a.height<0||a.height>s.CesiumMath.PI)thrownewn.DeveloperError("Rectangle height must be between 0 and pi");if(r.defined(C)&&!s.CesiumMath.equalsEpsilon(C.radii.x,C.radii.y,s.CesiumMath.EPSILON15))thrownewn.DeveloperError("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");letu,l,h,f,m,x,p;if(e=r.defaultValue(e,0),c=r.defaultValue(c,0),C=r.defaultValue(C,t.Ellipsoid.WGS84),a.width<=s.CesiumMath.PI){constn=t.Rectangle.center(a,g),r=C.cartographicToCartesian(n,b),s=newi.EllipsoidTangentPlane(r,C);p=s.plane;constM=n.longitude,z=a.south<0&&a.north>0?0:n.latitude,B=t.Cartographic.fromRadians(M,a.north,c,y),V=t.Cartographic.fromRadians(a.west,a.north,c,O),_=t.Cartographic.fromRadians(a.west,z,c,E),k=t.Cartographic.fromRadians(a.west,a.south,c,N),W=t.Cartographic.fromRadians(M,a.south,c,T),X=C.cartographicToCartesian(B,P);letj=C.cartographicToCartesian(V,A);constZ=C.cartographicToCartesian(_,I);letY=C.cartographicToCartesian(k,R);constG=C.cartographicToCartesian(W,S),F=s.projectPointToNearestOnPlane(X,U),H=s.projectPointToNearestOnPlane(j,D),J=s.projectPointToNearestOnPlane(Z,L),K=s.projectPointToNearestOnPlane(Y,q),Q=s.projectPointToNearestOnPlane(G,v);returnu=Math.min(H.x,J.x,K.x),l=-u,f=Math.max(H.y,F.y),h=Math.min(K.y,Q.y),V.height=k.height=e,j=C.cartographicToCartesian(V,A),Y=C.cartographicToCartesian(k,R),m=Math.min(o.Plane.getPointDistance(p,j),o.Plane.getPointDistance(p,Y)),x=c,w(s.origin,s.xAxis,s.yAxis,s.zAxis,u,l,h,f,m,x,d)}constM=a.south>0,Y=a.north<0,G=M?a.south:Y?a.north:0,F=t.Rectangle.center(a,g).longitude,H=t.Cartesian3.fromRadians(F,G,c,C,z);H.z=0;constJ=Math.abs(H.x)<s.CesiumMath.EPSILON10&&Math.abs(H.y)<s.CesiumMath.EPSILON10,K=J?t.Cartesian3.UNIT_X:t.Cartesian3.normalize(H,B),Q=t.Cartesian3.UNIT_Z,$=t.Cartesian3.cross(K,Q,V);p=o.Plane.fromPointNormal(H,K,Z);constaa=t.Cartesian3.fromRadians(F+s.CesiumMath.PI_OVER_TWO,G,c,C,_);l=t.Cartesian3.dot(o.Plane.projectPointOntoPlane(p,aa,k),$),u=-l,f=t.Cartesian3.fromRadians(0,a.north,Y?e:c,C,W).z,h=t.Cartesian3.fromRadians(0,a.south,M?e:c,C,X).z;constea=t.Cartesian3.fromRadians(a.east,G,c,C,j);returnm=o.Plane.getPointDistance(p,ea),x=0,w(H,$,Q,K,u,l,h,f,m,x,d)},c.fromTransformation=function(a,e){returnn.Check.typeOf.object("transformation",a),r.defined(e)||(e=newc),e.center=t.Matrix4.getTranslation(a,e.center),e.halfAxes=t.Matrix4.getMatrix3(a,e.halfAxes),e.halfAxes=t.Matrix3.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e},c.clone=function(a,e){if(r.defined(a))returnr.defined(e)?(t.Cartesian3.clone(a.center,e.center),t.Matrix3.clone(a.halfAxes,e.halfAxes),e):newc(a.center,a.halfAxes)},c.intersectPlane=function(a,i){if(!r.defined(a))thrownewn.DeveloperError("box is required.");if(!r.defined(i))thrownewn.DeveloperError("plane is required.");consts=a.center,o=i.normal,c=a.halfAxes,C=o.x,d=o.y,u=o.z,l=Math.abs(C*c[t.Matrix3.COLUMN0ROW0]+d*c[t.Matrix3.COLUMN0ROW1]+u*c[t.Matrix3.COLUMN0ROW2])+Math.abs(C*c[t.Matrix3.COLUMN1ROW0]+d*c[t.Matrix3.COLUMN1ROW1]+u*c[t.Matrix3.COLUMN1ROW2])+Math.abs(C*c[t.Matrix3.COLUMN2ROW0]+d*c[t.Matrix3.COLUMN2ROW1]+u*c[t.Matrix3.COLUMN2ROW2]),h=t.Cartesian3.dot(o,s)+i.distance;returnh<=-l?e.Intersect.OUTSIDE:h>=l?e.Intersect.INSIDE:e.Intersect.INTERSECTING};constY=newt.Cartesian3,G=newt.Cartesian3,F=newt.Cartesian3,H=newt.Cartesian3,J=newt.Cartesian3,K=newt.Cartesian3;c.distanceSquaredTo=function(a,e){if(!r.defined(a))thrownewn.DeveloperError("box is required.");if(!r.defined(e))thrownewn.DeveloperError("cartesian is required.");consti=t.Cartesian3.subtract(e,a.center,p),o=a.halfAxes;letc=t.Matrix3.getColumn(o,0,Y),C=t.Matrix3.getColumn(o,1,G),d=t.Matrix3.getColumn(o,2,F);constu=t.Cartesian3.magnitude(c),l=t.Cartesian3.magnitude(C),h=t.Cartesian3.magnitude(d);letf=!0,m=!0,x=!0;u>0?t.Cartesian3.divideByScalar(c,u,c):f=!1,l>0?t.Cartesian3.divideByScalar(C,l,C):m=!1,h>0?t.Cartesian3.divideByScalar(d,h,d):x=!1;constM=!f+!m+!x;letw,g,b;if(1===M){leta=c;w=C,g=d,m?x||(a=d,g=c):(a=C,w=c),b=t.Cartesian3.cross(w,g,J),a===c?c=b:a===C?C=b:a===d&&(d=b)}elseif(2===M){w=c,m?w=C:x&&(w=d);leta=t.Cartesian3.UNIT_Y;a.equalsEpsilon(w,s.CesiumMath.EPSILON3)&&(a=t.Cartesian3.UNIT_X),g=t.Cartesian3.cross(w,a,H),t.Cartesian3.normalize(g,g),b=t.Cartesian3.cross(w,g,J),t.Cartesian3.normalize(b,b),w===c?(C=g,d=b):w===C?(d=g,c=b):w===d&&(c=g,C=b)}else3===M&&(c=t.Cartesian3.UNIT_X,C=t.Cartesian3.UNIT_Y,d=t.Cartesian3.UNIT_Z);consty=K;y.x=t.Cartesian3.dot(i,c),y.y=t.Cartesian3.dot(i,C),y.z=t.Cartesian3.dot(i,d);letO,E=0;returny.x<-u?(O=y.x+u,E+=O*O):y.x>u&&(O=y.x-u,E+=O*O),y.y<-l?(O=y.y+l,E+=O*O):y.y>l&&(O=y.y-l,E+=O*O),y.z<-h?(O=y.z+h,E+=O*O):y.z>h&&(O=y.z-h,E+=O*O),E};constQ=newt.Cartesian3,$=newt.Cartesian3;c.computePlaneDistances=function(a,i,s,o){if(!r.defined(a))thrownewn.DeveloperError("box is required.");if(!r.defined(i))thrownewn.DeveloperError("position is required.");if(!r.defined(s))thrownewn.DeveloperError("direction is required.");r.defined(o)||(o=newe.Interval);letc=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY;constd=a.center,u=a.halfAxes,l=t.Matrix3.getColumn(u,0,Y),h=t.Matrix3.getColumn(u,1,G),f=t.Matrix3.getColumn(u,2,F),m=t.Cartesian3.add(l,h,Q);t.Cartesian3.add(m,f,m),t.Cartesian3.add(m,d,m);constx=t.Cartesian3.subtract(m,i,$);letp=t.Cartesian3.dot(s,x);returnc=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.add(d,l,m),t.Cartesian3.add(m,h,m),t.Cartesian3.subtract(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.add(d,l,m),t.Cartesian3.subtract(m,h,m),t.Cartesian3.add(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.add(d,l,m),t.Cartesian3.subtract(m,h,m),t.Cartesian3.subtract(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.subtract(d,l,m),t.Cartesian3.add(m,h,m),t.Cartesian3.add(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.subtract(d,l,m),t.Cartesian3.add(m,h,m),t.Cartesian3.subtract(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.subtract(d,l,m),t.Cartesian3.subtract(m,h,m),t.Cartesian3.add(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),t.Cartesian3.subtract(d,l,m),t.Cartesian3.subtract(m,h,m),t.Cartesian3.subtract(m,f,m),t.Cartesian3.subtract(m,i,x),p=t.Cartesian3.dot(s,x),c=Math.min(p,c),C=Math.max(p,C),o.start=c,o.stop=C,o};constaa=newt.Cartesian3,ea=newt.Cartesian3,ta=newt.Cartesian3;c.computeCorners=function(a,e){n.Check.typeOf.object("box",a),r.defined(e)||(e=[newt.Cartesian3,newt.Cartesian3,newt.Cartesian3,newt.Cartesian3,newt.Cartesian3,newt.Cartesian3,newt.Cartesian3,newt.Cartesian3]);consti=a.center,s=a.halfAxes,o=t.Matrix3.getColumn(s,0,aa),c=t.Matrix3.getColumn(s,1,ea),C=t.Matrix3.getColumn(s,2,ta);returnt.Cartesian3.clone(i,e[0]),t.Cartesian3.subtract(e[0],o,e[0]),t.Cartesian3.subtract(e[0],c,e[0]),t.Cartesian3.subtract(e[0],C,e[0]),t.Cartesian3.clone(i,e[1]),t.Cartesian3.subtract(e[1],o,e[1]),t.Cartesian3.subtract(e[1],c,e[1]),t.Cartesian3.add(e[1],C,e[1]),t.Cartesian3.clone(i,e[2]),t.Cartesian3.subtract(e[2],o,e[2]),t.Cartesian3.add(e[2],c,e[2]),t.Cartesian3.subtract(e[2],C,e[2]),t.Cartesian3.clone(i,e[3]),t.Cartesian3.subtract(e[3],o,e[3]),t.Cartesian3.add(e[3],c,e[3]),t.Cartesian3.add(e[3],C,e[3]),t.Cartesian3.clone(i,e[4]),t.Cartesian3.add(e[4],o,e[4]),t.Cartesian3.subtract(e[4],c,e[4]),t.Cartesian3.subtract(e[4],C,e[4]),t.Cartesian3.clone(i,e[5]),t.Cartesian3.add(e[5],o,e[5]),t.Cartesian3.subtract(e[5],c,e[5]),t.Cartesian3.add(e[5],C,e[5]),t.Cartesian3.clone(i,e[6]),t.Cartesian3.add(e[6],o,e[6]),t.Cartesian3.add(e[6],c,e[6]),t.Cartesian3.subtract(e[6],C,e[6]),t.Cartesian3.clone(i,e[7]),t.Cartesian3.add(e[7],o,e[7]),t.Cartesian3.add(e[7],c,e[7]),t.Cartesian3.add(e[7],C,e[7]),e};constna=newt.Matrix3;c.computeTransformation=function(a,e){n.Check.typeOf.object("box",a),r.defined(e)||(e=newt.Matrix4);consti=a.center,s=t.Matrix3.multiplyByUniformScale(a.halfAxes,2,na);returnt.Matrix4.fromRotationTranslation(s,i,e)};constra=newe.BoundingSphere;c.isOccluded=function(a,t){if(!r.defined(a))thrownewn.DeveloperError("box is required.");if(!r.defined(t))thrownewn.DeveloperError("occluder is required.");consti=e.BoundingSphere.fromOrientedBoundingBox(a,ra);return!t.isBoundingSphereVisible(i)},c.prototype.intersectPlane=function(a){returnc.intersectPlane(this,a)},c.prototype.distanceSquaredTo=function(a){returnc.distanceSquaredTo(this,a)},c.prototype.computePlaneDistances=function(a,e,t){returnc.computePlaneDistances(this,a,e,t)},c.prototype.computeCorners=function(a){returnc.computeCorners(this,a)},c.prototype.computeTransformation=function(a){returnc.computeTransformation(this,a)},c.prototype.isOccluded=function(a){returnc.isOccluded(this,a)},c.equals=function(a,e){returna===e||r.defined(a)&&r.defined(e)&&t.Cartesian3.equals(a.center,e.center)&&t.Matrix3.equals(a.halfAxes,e.halfAxes)},c.prototype.clone=function(a){returnc.clone(this,a)},c.prototype.equals=function(a){returnc.equals(this,a)},a.OrientedBoundingBox=c}));
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6"],(function(e,t,n,a,r){"use strict";functioni(e,a){if(n.Check.typeOf.object("normal",e),!r.CesiumMath.equalsEpsilon(t.Cartesian3.magnitude(e),1,r.CesiumMath.EPSILON6))thrownewn.DeveloperError("normal must be normalized.");n.Check.typeOf.number("distance",a),this.normal=t.Cartesian3.clone(e),this.distance=a}i.fromPointNormal=function(e,o,s){if(n.Check.typeOf.object("point",e),n.Check.typeOf.object("normal",o),!r.CesiumMath.equalsEpsilon(t.Cartesian3.magnitude(o),1,r.CesiumMath.EPSILON6))thrownewn.DeveloperError("normal must be normalized.");constc=-t.Cartesian3.dot(o,e);returna.defined(s)?(t.Cartesian3.clone(o,s.normal),s.distance=c,s):newi(o,c)};consto=newt.Cartesian3;i.fromCartesian4=function(e,s){n.Check.typeOf.object("coefficients",e);constc=t.Cartesian3.fromCartesian4(e,o),l=e.w;if(!r.CesiumMath.equalsEpsilon(t.Cartesian3.magnitude(c),1,r.CesiumMath.EPSILON6))thrownewn.DeveloperError("normal must be normalized.");returna.defined(s)?(t.Cartesian3.clone(c,s.normal),s.distance=l,s):newi(c,l)},i.getPointDistance=function(e,a){returnn.Check.typeOf.object("plane",e),n.Check.typeOf.object("point",a),t.Cartesian3.dot(e.normal,a)+e.distance};consts=newt.Cartesian3;i.projectPointOntoPlane=function(e,r,o){n.Check.typeOf.object("plane",e),n.Check.typeOf.object("point",r),a.defined(o)||(o=newt.Cartesian3);constc=i.getPointDistance(e,r),l=t.Cartesian3.multiplyByScalar(e.normal,c,s);returnt.Cartesian3.subtract(r,l,o)};constc=newt.Matrix4,l=newt.Cartesian4,C=newt.Cartesian3;i.transform=function(e,a,r){n.Check.typeOf.object("plane",e),n.Check.typeOf.object("transform",a);consto=e.normal,s=e.distance,f=t.Matrix4.inverseTranspose(a,c);letm=t.Cartesian4.fromElements(o.x,o.y,o.z,s,l);m=t.Matrix4.multiplyByVector(f,m,m);constu=t.Cartesian3.fromCartesian4(m,C);returnm=t.Cartesian4.divideByScalar(m,t.Cartesian3.magnitude(u),m),i.fromCartesian4(m,r)},i.clone=function(e,r){returnn.Check.typeOf.object("plane",e),a.defined(r)?(t.Cartesian3.clone(e.normal,r.normal),r.distance=e.distance,r):newi(e.normal,e.distance)},i.equals=function(e,a){returnn.Check.typeOf.object("left",e),n.Check.typeOf.object("right",a),e.distance===a.distance&&t.Cartesian3.equals(e.normal,a.normal)},i.ORIGIN_XY_PLANE=Object.freeze(newi(t.Cartesian3.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=Object.freeze(newi(t.Cartesian3.UNIT_X,0)),i.ORIGIN_ZX_PLANE=Object.freeze(newi(t.Cartesian3.UNIT_Y,0)),e.Plane=i}));
define(["exports","./Matrix2-fc7e9822","./defaultValue-94c3e563","./RuntimeError-c581ca93","./EllipsoidGeodesic-dc94f381","./EllipsoidRhumbLine-daebc75b","./IntersectionTests-68fbc42d","./ComponentDatatype-4a60b8d6","./Plane-e20fba8c"],(function(e,t,n,a,i,r,o,s,c){"use strict";constl={numberOfPoints:function(e,n,a){consti=t.Cartesian3.distance(e,n);returnMath.ceil(i/a)},numberOfPointsRhumbLine:function(e,t,n){consta=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);returnMath.max(1,Math.ceil(Math.sqrt(a/(n*n))))}},u=newt.Cartographic;l.extractHeights=function(e,t){constn=e.length,a=newArray(n);for(leti=0;i<n;i++){constn=e[i];a[i]=t.cartesianToCartographic(n,u).height}returna};consth=newt.Matrix4,f=newt.Cartesian3,p=newt.Cartesian3,d=newc.Plane(t.Cartesian3.UNIT_X,0),g=newt.Cartesian3,C=newc.Plane(t.Cartesian3.UNIT_X,0),m=newt.Cartesian3,w=newt.Cartesian3,P=[];functionT(e,t,n){consta=P;leti;if(a.length=e,t===n){for(i=0;i<e;i++)a[i]=t;returna}constr=n-t,o=r/e;for(i=0;i<e;i++){conste=t+i*o;a[i]=e}returna}consty=newt.Cartographic,E=newt.Cartographic,A=newt.Cartesian3,b=newt.Cartesian3,R=newt.Cartesian3,D=newi.EllipsoidGeodesic;letM=newr.EllipsoidRhumbLine;functionS(e,n,a,i,r,o,s,c){constu=i.scaleToGeodeticSurface(e,b),h=i.scaleToGeodeticSurface(n,R),f=l.numberOfPoints(e,n,a),p=i.cartesianToCartographic(u,y),d=i.cartesianToCartographic(h,E),g=T(f,r,o);D.setEndPoints(p,d);constC=D.surfaceDistance/f;letm=c;p.height=r;letw=i.cartographicToCartesian(p,A);t.Cartesian3.pack(w,s,m),m+=3;for(letl=1;l<f;l++){conste=D.interpolateUsingSurfaceDistance(l*C,E);e.height=g[l],w=i.cartographicToCartesian(e,A),t.Cartesian3.pack(w,s,m),m+=3}returnm}functionx(e,n,a,i,o,s,c,u){consth=i.cartesianToCartographic(e,y),f=i.cartesianToCartographic(n,E),p=l.numberOfPointsRhumbLine(h,f,a);h.height=0,f.height=0;constd=T(p,o,s);M.ellipsoid.equals(i)||(M=newr.EllipsoidRhumbLine(void0,void0,i)),M.setEndPoints(h,f);constg=M.surfaceDistance/p;letC=u;h.height=o;letm=i.cartographicToCartesian(h,A);t.Cartesian3.pack(m,c,C),C+=3;for(letr=1;r<p;r++){conste=M.interpolateUsingSurfaceDistance(r*g,E);e.height=d[r],m=i.cartographicToCartesian(e,A),t.Cartesian3.pack(m,c,C),C+=3}returnC}l.wrapLongitude=function(e,a){consti=[],r=[];if(n.defined(e)&&e.length>0){a=n.defaultValue(a,t.Matrix4.IDENTITY);consts=t.Matrix4.inverseTransformation(a,h),l=t.Matrix4.multiplyByPoint(s,t.Cartesian3.ZERO,f),u=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(s,t.Cartesian3.UNIT_Y,p),p),P=c.Plane.fromPointNormal(l,u,d),T=t.Cartesian3.normalize(t.Matrix4.multiplyByPointAsVector(s,t.Cartesian3.UNIT_X,g),g),y=c.Plane.fromPointNormal(l,T,C);letE=1;i.push(t.Cartesian3.clone(e[0]));letA=i[0];constb=e.length;for(leta=1;a<b;++a){consts=e[a];if(c.Plane.getPointDistance(y,A)<0||c.Plane.getPointDistance(y,s)<0){conste=o.IntersectionTests.lineSegmentPlane(A,s,P,m);if(n.defined(e)){constn=t.Cartesian3.multiplyByScalar(u,5e-9,w);c.Plane.getPointDistance(P,A)<0&&t.Cartesian3.negate(n,n),i.push(t.Cartesian3.add(e,n,newt.Cartesian3)),r.push(E+1),t.Cartesian3.negate(n,n),i.push(t.Cartesian3.add(e,n,newt.Cartesian3)),E=1}}i.push(t.Cartesian3.clone(e[a])),E++,A=s}r.push(E)}return{positions:i,lengths:r}},l.generateArc=function(e){n.defined(e)||(e={});consti=e.positions;if(!n.defined(i))thrownewa.DeveloperError("options.positions is required.");constr=i.length,o=n.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);letc=n.defaultValue(e.height,0);constu=Array.isArray(c);if(r<1)return[];if(1===r){conste=o.scaleToGeodeticSurface(i[0],b);if(c=u?c[0]:c,0!==c){constn=o.geodeticSurfaceNormal(e,A);t.Cartesian3.multiplyByScalar(n,c,n),t.Cartesian3.add(e,n,e)}return[e.x,e.y,e.z]}leth=e.minDistance;if(!n.defined(h)){constt=n.defaultValue(e.granularity,s.CesiumMath.RADIANS_PER_DEGREE);h=s.CesiumMath.chordLength(t,o.maximumRadius)}letf,p=0;for(f=0;f<r-1;f++)p+=l.numberOfPoints(i[f],i[f+1],h);constd=3*(p+1),g=newArray(d);letC=0;for(f=0;f<r-1;f++){conste=i[f],t=i[f+1],n=u?c[f]:c,a=u?c[f+1]:c;C=S(e,t,h,o,n,a,g,C)}P.length=0;constm=i[r-1],w=o.cartesianToCartographic(m,y);w.height=u?c[r-1]:c;constT=o.cartographicToCartesian(w,A);returnt.Cartesian3.pack(T,g,d-3),g};constN=newt.Cartographic,G=newt.Cartographic;l.generateRhumbArc=function(e){n.defined(e)||(e={});consti=e.positions;if(!n.defined(i))thrownewa.DeveloperError("options.positions is required.");constr=i.length,o=n.defaultValue(e.ellipsoid,t.Ellipsoid.WGS84);letc=n.defaultValue(e.height,0);constu=Array.isArray(c);if(r<1)return[];if(1===r){conste=o.scaleToGeodeticSurface(i[0],b);if(c=u?c[0]:c,0!==c){constn=o.geodeticSurfaceNormal(e,A);t.Cartesian3.multiplyByScalar(n,c,n),t.Cartesian3.add(e,n,e)}return[e.x,e.y,e.z]}consth=n.defaultValue(e.granularity,s.CesiumMath.RADIANS_PER_DEGREE);letf,p,d=0,g=o.cartesianToCartographic(i[0],N);for(f=0;f<r-1;f++)p=o.cartesianToCartographic(i[f+1],G),d+=l.numberOfPointsRhumbLine(g,p,h),g=t.Cartographic.clone(p,N);constC=3*(d+1),m=newArray(C);letw=0;for(f=0;f<r-1;f++){conste=i[f],t=i[f+1],n=u?c[f]:c,a=u?c[f+1]:c;w=x(e,t,h,o,n,a,m,w)}P.length=0;constT=i[r-1],E=o.cartesianToCartographic(T,y);E.height=u?c[r-1]:c;constR=o.cartographicToCartesian(E,A);returnt.Cartesian3.pack(R,m,C-3),m},l.generateCartesianArc=function(e){constn=l.generateArc(e),a=n.length/3,i=newArray(a);for(letr=0;r<a;r++)i[r]=t.Cartesian3.unpack(n,3*r);returni},l.generateCartesianRhumbArc=function(e){constn=l.generateRhumbArc(e),a=n.length/3,i=newArray(a);for(letr=0;r<a;r++)i[r]=t.Cartesian3.unpack(n,3*r);returni},e.PolylinePipeline=l}));
define(["exports","./Matrix2-fc7e9822","./EllipsoidTangentPlane-53e32153","./ComponentDatatype-4a60b8d6","./PolylinePipeline-0e310844","./Transforms-3ac41eb6","./defaultValue-94c3e563","./RuntimeError-c581ca93"],(function(e,t,a,n,r,i,o,s){"use strict";constl={ROUNDED:0,MITERED:1,BEVELED:2};varc=Object.freeze(l);constC={};functionu(e,t){if(!o.defined(e))thrownews.DeveloperError("identifier is required.");o.defined(C[e])||(C[e]=!0,console.warn(o.defaultValue(t,e)))}u.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",u.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",u.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",u.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";constd=[newt.Cartesian3,newt.Cartesian3],g=newt.Cartesian3,y=newt.Cartesian3,f=newt.Cartesian3,m=newt.Cartesian3,h=newt.Cartesian3,p=newt.Cartesian3,w=newt.Cartesian3,x=newt.Cartesian3,E=newt.Cartesian3,P=newt.Cartesian3,M=newt.Cartesian3,b={};letT=newt.Cartographic;functionB(e,t){consta=newArray(e.length);for(letn=0;n<e.length;n++){constr=e[n];T=t.cartesianToCartographic(r,T),a[n]=T.height,e[n]=t.scaleToGeodeticSurface(r,r)}returna}functionz(e,a,n,r){consti=e[0],o=e[1],s=t.Cartesian3.angleBetween(i,o),l=Math.ceil(s/r),c=newArray(l);letC;if(a===n){for(C=0;C<l;C++)c[C]=a;returnc.push(n),c}constu=n-a,d=u/l;for(C=1;C<l;C++){conste=a+C*d;c[C]=e}returnc[0]=a,c.push(n),c}constS=newt.Cartesian3,A=newt.Cartesian3;functionD(e,n,r,i){consto=newa.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(t.Cartesian3.add(r,e,S),S),l=o.projectPointOntoPlane(t.Cartesian3.add(r,n,A),A),c=t.Cartesian2.angleBetween(s,l);returnl.x*s.y-l.y*s.x>=0?-c:c}constR=newt.Cartesian3(-1,0,0);letO=newt.Matrix4;constV=newt.Matrix4;letI=newt.Matrix3;constv=t.Matrix3.IDENTITY.clone(),N=newt.Cartesian3,G=newt.Cartesian4,H=newt.Cartesian3;functionL(e,a,n,r,o,s,l,c){letC=N,u=G;O=i.Transforms.eastNorthUpToFixedFrame(e,o,O),C=t.Matrix4.multiplyByPointAsVector(O,R,C),C=t.Cartesian3.normalize(C,C);constd=D(C,a,e,o);I=t.Matrix3.fromRotationZ(d,I),H.z=s,O=t.Matrix4.multiplyTransformation(O,t.Matrix4.fromRotationTranslation(I,H,V),O);constg=v;g[0]=l;for(leti=0;i<c;i++)for(lete=0;e<n.length;e+=3)u=t.Cartesian3.fromArray(n,e,u),u=t.Matrix3.multiplyByVector(g,u,u),u=t.Matrix4.multiplyByPoint(O,u,u),r.push(u.x,u.y,u.z);returnr}constj=newt.Cartesian3;functionq(e,a,n,r,i,o,s){for(letl=0;l<e.length;l+=3){constc=t.Cartesian3.fromArray(e,l,j);r=L(c,a,n,r,i,o[l/3],s,1)}returnr}functionQ(e,t){consta=e.length,n=newArray(6*a);letr=0;consti=t.x+t.width/2,o=t.y+t.height/2;lets=e[0];n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o;for(letl=1;l<a;l++){s=e[l];constt=s.x-i,a=s.y-o;n[r++]=t,n[r++]=0,n[r++]=a,n[r++]=t,n[r++]=0,n[r++]=a}returns=e[0],n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o,n}functionF(e,t){consta=e.length,n=newArray(3*a);letr=0;consti=t.x+t.width/2,o=t.y+t.height/2;for(lets=0;s<a;s++)n[r++]=e[s].x-i,n[r++]=0,n[r++]=e[s].y-o;returnn}constU=newi.Quaternion,_=newt.Cartesian3,Z=newt.Matrix3;functionW(e,a,r,o,s,l,C,u,d,g){consty=t.Cartesian3.angleBetween(t.Cartesian3.subtract(a,e,P),t.Cartesian3.subtract(r,e,M)),f=o===c.BEVELED?0:Math.ceil(y/n.CesiumMath.toRadians(5));letm,h,p;if(m=s?t.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(t.Cartesian3.negate(e,P),y/(f+1),U),Z):t.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(e,y/(f+1),U),Z),a=t.Cartesian3.clone(a,_),f>0){constn=g?2:1;for(letr=0;r<f;r++)a=t.Matrix3.multiplyByVector(m,a,a),h=t.Cartesian3.subtract(a,e,P),h=t.Cartesian3.normalize(h,h),s||(h=t.Cartesian3.negate(h,h)),p=l.scaleToGeodeticSurface(a,M),C=L(p,h,u,C,l,d,1,n)}elseh=t.Cartesian3.subtract(a,e,P),h=t.Cartesian3.normalize(h,h),s||(h=t.Cartesian3.negate(h,h)),p=l.scaleToGeodeticSurface(a,M),C=L(p,h,u,C,l,d,1,1),r=t.Cartesian3.clone(r,_),h=t.Cartesian3.subtract(r,e,P),h=t.Cartesian3.normalize(h,h),s||(h=t.Cartesian3.negate(h,h)),p=l.scaleToGeodeticSurface(r,M),C=L(p,h,u,C,l,d,1,1);returnC}b.removeDuplicatesFromShape=function(e){consta=e.length,n=[];for(letr=a-1,i=0;i<a;r=i++){consta=e[r],o=e[i];t.Cartesian2.equals(a,o)||n.push(o)}returnn},b.angleIsGreaterThanPi=function(e,n,r,i){consto=newa.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(t.Cartesian3.add(r,e,S),S),l=o.projectPointOntoPlane(t.Cartesian3.add(r,n,A),A);returnl.x*s.y-l.y*s.x>=0};constY=newt.Cartesian3,k=newt.Cartesian3;b.computePositions=function(e,a,i,o,s){constl=o._ellipsoid,C=B(e,l),M=o._granularity,T=o._cornerType,S=s?Q(a,i):F(a,i),A=s?F(a,i):void0,D=i.height/2,R=i.width/2;letO=e.length,V=[],I=s?[]:void0,v=g,N=y,G=f,H=m,j=h,U=p,_=w,Z=x,J=E,K=e[0],X=e[1];H=l.geodeticSurfaceNormal(K,H),v=t.Cartesian3.subtract(X,K,v),v=t.Cartesian3.normalize(v,v),Z=t.Cartesian3.cross(H,v,Z),Z=t.Cartesian3.normalize(Z,Z);let$,ee,te=C[0],ae=C[1];s&&(I=L(K,Z,A,I,l,te+D,1,1)),J=t.Cartesian3.clone(K,J),K=X,N=t.Cartesian3.negate(v,N);for(letg=1;g<O-1;g++){consta=s?2:1;if(X=e[g+1],K.equals(X)){u("Positions are too close and are considered equivalent with rounding error.");continue}v=t.Cartesian3.subtract(X,K,v),v=t.Cartesian3.normalize(v,v),G=t.Cartesian3.add(v,N,G),G=t.Cartesian3.normalize(G,G),H=l.geodeticSurfaceNormal(K,H);consti=t.Cartesian3.multiplyByScalar(H,t.Cartesian3.dot(v,H),Y);t.Cartesian3.subtract(v,i,i),t.Cartesian3.normalize(i,i);consto=t.Cartesian3.multiplyByScalar(H,t.Cartesian3.dot(N,H),k);t.Cartesian3.subtract(N,o,o),t.Cartesian3.normalize(o,o);consty=!n.CesiumMath.equalsEpsilon(Math.abs(t.Cartesian3.dot(i,o)),1,n.CesiumMath.EPSILON7);if(y){G=t.Cartesian3.cross(G,H,G),G=t.Cartesian3.cross(H,G,G),G=t.Cartesian3.normalize(G,G);conste=1/Math.max(.25,t.Cartesian3.magnitude(t.Cartesian3.cross(G,N,P))),n=b.angleIsGreaterThanPi(v,N,K,l);n?(j=t.Cartesian3.add(K,t.Cartesian3.multiplyByScalar(G,e*R,G),j),U=t.Cartesian3.add(j,t.Cartesian3.multiplyByScalar(Z,R,U),U),d[0]=t.Cartesian3.clone(J,d[0]),d[1]=t.Cartesian3.clone(U,d[1]),$=z(d,te+D,ae+D,M),ee=r.PolylinePipeline.generateArc({positions:d,granularity:M,ellipsoid:l}),V=q(ee,Z,S,V,l,$,1),Z=t.Cartesian3.cross(H,v,Z),Z=t.Cartesian3.normalize(Z,Z),_=t.Cartesian3.add(j,t.Cartesian3.multiplyByScalar(Z,R,_),_),T===c.ROUNDED||T===c.BEVELED?W(j,U,_,T,n,l,V,S,ae+D,s):(G=t.Cartesian3.negate(G,G),V=L(K,G,S,V,l,ae+D,e,a)),J=t.Cartesian3.clone(_,J)):(j=t.Cartesian3.add(K,t.Cartesian3.multiplyByScalar(G,e*R,G),j),U=t.Cartesian3.add(j,t.Cartesian3.multiplyByScalar(Z,-R,U),U),d[0]=t.Cartesian3.clone(J,d[0]),d[1]=t.Cartesian3.clone(U,d[1]),$=z(d,te+D,ae+D,M),ee=r.PolylinePipeline.generateArc({positions:d,granularity:M,ellipsoid:l}),V=q(ee,Z,S,V,l,$,1),Z=t.Cartesian3.cross(H,v,Z),Z=t.Cartesian3.normalize(Z,Z),_=t.Cartesian3.add(j,t.Cartesian3.multiplyByScalar(Z,-R,_),_),T===c.ROUNDED||T===c.BEVELED?W(j,U,_,T,n,l,V,S,ae+D,s):V=L(K,G,S,V,l,ae+D,e,a),J=t.Cartesian3.clone(_,J)),N=t.Cartesian3.negate(v,N)}elseV=L(J,Z,S,V,l,te+D,1,1),J=K;te=ae,ae=C[g+1],K=X}d[0]=t.Cartesian3.clone(J,d[0]),d[1]=t.Cartesian3.clone(K,d[1]),$=z(d,te+D,ae+D,M),ee=r.PolylinePipeline.generateArc({positions:d,granularity:M,ellipsoid:l}),V=q(ee,Z,S,V,l,$,1),s&&(I=L(K,Z,A,I,l,ae+D,1,1)),O=V.length;constne=s?O+I.length:O,re=newFloat64Array(ne);returnre.set(V),s&&re.set(I,O),re},e.CornerType=c,e.PolylineVolumeGeometryLibrary=b,e.oneTimeWarning=u}));
define(["exports","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./RuntimeError-c581ca93","./Matrix2-fc7e9822","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./WebMercatorProjection-843df830"],(function(e,t,n,o,r,i,s,c,a,d,p){"use strict";functionf(e,t,n){e=o.defaultValue(e,0),t=o.defaultValue(t,0),n=o.defaultValue(n,0),this.value=newFloat32Array([e,t,n])}functionu(e,t,n){letr=!n;consts=e.length;letc;if(!r&&s>1){constt=e[0].modelMatrix;for(c=1;c<s;++c)if(!i.Matrix4.equals(t,e[c].modelMatrix)){r=!0;break}}if(r)for(c=0;c<s;++c)o.defined(e[c].geometry)&&a.GeometryPipeline.transformToWorldCoordinates(e[c]);elsei.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}functionl(e,t){consto=e.attributes,r=o.position,i=r.values.length/r.componentsPerAttribute;o.batchId=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:newFloat32Array(i)});constc=o.batchId.values;for(letn=0;n<i;++n)c[n]=t}functionm(e){constt=e.length;for(letn=0;n<t;++n){constt=e[n];o.defined(t.geometry)?l(t.geometry,n):o.defined(t.westHemisphereGeometry)&&o.defined(t.eastHemisphereGeometry)&&(l(t.westHemisphereGeometry,n),l(t.eastHemisphereGeometry,n))}}functionh(e){consti=e.instances,s=e.projection,c=e.elementIndexUintSupported,d=e.scene3DOnly,p=e.vertexCacheOptimize,f=e.compressVertices,l=e.modelMatrix;leth,g,y,b=i.length;for(h=0;h<b;++h)if(o.defined(i[h].geometry)){y=i[h].geometry.primitiveType;break}for(h=1;h<b;++h)if(o.defined(i[h].geometry)&&i[h].geometry.primitiveType!==y)thrownewr.DeveloperError("All instance geometries must have the same primitiveType.");if(u(i,l,d),!d)for(h=0;h<b;++h)o.defined(i[h].geometry)&&a.GeometryPipeline.splitLongitude(i[h]);if(m(i),p)for(h=0;h<b;++h){conste=i[h];o.defined(e.geometry)?(a.GeometryPipeline.reorderForPostVertexCache(e.geometry),a.GeometryPipeline.reorderForPreVertexCache(e.geometry)):o.defined(e.westHemisphereGeometry)&&o.defined(e.eastHemisphereGeometry)&&(a.GeometryPipeline.reorderForPostVertexCache(e.westHemisphereGeometry),a.GeometryPipeline.reorderForPreVertexCache(e.westHemisphereGeometry),a.GeometryPipeline.reorderForPostVertexCache(e.eastHemisphereGeometry),a.GeometryPipeline.reorderForPreVertexCache(e.eastHemisphereGeometry))}letx=a.GeometryPipeline.combineInstances(i);for(b=x.length,h=0;h<b;++h){g=x[h];conste=g.attributes;if(d)for(consttine)e.hasOwnProperty(t)&&e[t].componentDatatype===n.ComponentDatatype.DOUBLE&&a.GeometryPipeline.encodeAttribute(g,t,`${t}3DHigh`,`${t}3DLow`);elsefor(constrine)if(e.hasOwnProperty(r)&&e[r].componentDatatype===n.ComponentDatatype.DOUBLE){conste=`${r}3D`,n=`${r}2D`;a.GeometryPipeline.projectTo2D(g,r,e,n,s),o.defined(g.boundingSphere)&&"position"===r&&(g.boundingSphereCV=t.BoundingSphere.fromVertices(g.attributes.position2D.values)),a.GeometryPipeline.encodeAttribute(g,e,`${e}High`,`${e}Low`),a.GeometryPipeline.encodeAttribute(g,n,`${n}High`,`${n}Low`)}f&&a.GeometryPipeline.compressVertices(g)}if(!c){lete=[];for(b=x.length,h=0;h<b;++h)g=x[h],e=e.concat(a.GeometryPipeline.fitToUnsignedShortIndices(g));x=e}returnx}functiong(e,t,n,r){leti,s,c;consta=r.length-1;if(a>=0){conste=r[a];i=e.offset+e.count,c=e.index,s=n[c].indices.length}elsei=0,c=0,s=n[c].indices.length;constd=e.length;for(letp=0;p<d;++p){consta=e[p],d=a[t];if(!o.defined(d))continue;constf=d.indices.length;i+f>s&&(i=0,s=n[++c].indices.length),r.push({index:c,offset:i,count:f}),i+=f}}functiony(e,t){constn=[];returng(e,"geometry",t,n),g(e,"westHemisphereGeometry",t,n),g(e,"eastHemisphereGeometry",t,n),n}Object.defineProperties(f.prototype,{componentDatatype:{get:function(){returnn.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return3}},normalize:{get:function(){return!1}}}),f.fromCartesian3=function(e){returnr.Check.defined("offset",e),newf(e.x,e.y,e.z)},f.toValue=function(e,t){returnr.Check.defined("offset",e),o.defined(t)||(t=newFloat32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};constb={};functionx(e,t){constn=e.attributes;for(constrinn)if(n.hasOwnProperty(r)){conste=n[r];o.defined(e)&&o.defined(e.values)&&t.push(e.values.buffer)}o.defined(e.indices)&&t.push(e.indices.buffer)}functionG(e,t){constn=e.length;for(leto=0;o<n;++o)x(e[o],t)}functionS(e){letn=1;constr=e.length;for(leti=0;i<r;i++){constr=e[i];if(++n,!o.defined(r))continue;consts=r.attributes;n+=7+2*t.BoundingSphere.packedLength+(o.defined(r.indices)?r.indices.length:0);for(consteins)if(s.hasOwnProperty(e)&&o.defined(s[e])){constt=s[e];n+=5+t.values.length}}returnn}functionP(e,t){constn=e.length,r=newFloat64Array(1+19*n);lets=0;r[s++]=n;for(letc=0;c<n;c++){constt=e[c];if(i.Matrix4.pack(t.modelMatrix,r,s),s+=i.Matrix4.packedLength,o.defined(t.attributes)&&o.defined(t.attributes.offset)){conste=t.attributes.offset.value;r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2]}s+=3}returnt.push(r.buffer),r}functionk(e){constt=e,n=newArray(t[0]);letr=0,s=1;while(s<t.length){conste=i.Matrix4.unpack(t,s);letc;s+=i.Matrix4.packedLength,o.defined(t[s])&&(c={offset:newf(t[s],t[s+1],t[s+2])}),s+=3,n[r++]={modelMatrix:e,attributes:c}}returnn}functionC(e){constn=e.length,r=1+(t.BoundingSphere.packedLength+1)*n,i=newFloat32Array(r);lets=0;i[s++]=n;for(letc=0;c<n;++c){constn=e[c];o.defined(n)?(i[s++]=1,t.BoundingSphere.pack(e[c],i,s)):i[s++]=0,s+=t.BoundingSphere.packedLength}returni}functionw(e){constn=newArray(e[0]);leto=0,r=1;while(r<e.length)1===e[r++]&&(n[o]=t.BoundingSphere.unpack(e,r)),++o,r+=t.BoundingSphere.packedLength;returnn}b.combineGeometry=function(e){letn,r;consti=e.instances,s=i.length;letc,d,p=!1;s>0&&(n=h(e),n.length>0&&(r=a.GeometryPipeline.createAttributeLocations(n[0]),e.createPickOffsets&&(c=y(i,n))),o.defined(i[0].attributes)&&o.defined(i[0].attributes.offset)&&(d=newArray(s),p=!0));constf=newArray(s),u=newArray(s);for(leta=0;a<s;++a){conste=i[a],n=e.geometry;o.defined(n)&&(f[a]=n.boundingSphere,u[a]=n.boundingSphereCV,p&&(d[a]=e.geometry.offsetAttribute));constr=e.eastHemisphereGeometry,s=e.westHemisphereGeometry;o.defined(r)&&o.defined(s)&&(o.defined(r.boundingSphere)&&o.defined(s.boundingSphere)&&(f[a]=t.BoundingSphere.union(r.boundingSphere,s.boundingSphere)),o.defined(r.boundingSphereCV)&&o.defined(s.boundingSphereCV)&&(u[a]=t.BoundingSphere.union(r.boundingSphereCV,s.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:r,pickOffsets:c,offsetInstanceExtend:d,boundingSpheres:f,boundingSpheresCV:u}},b.packCreateGeometryResults=function(e,n){constr=newFloat64Array(S(e)),i=[],s={},c=e.length;leta=0;r[a++]=c;for(letd=0;d<c;d++){constn=e[d],c=o.defined(n);if(r[a++]=c?1:0,!c)continue;r[a++]=n.primitiveType,r[a++]=n.geometryType,r[a++]=o.defaultValue(n.offsetAttribute,-1);constp=o.defined(n.boundingSphere)?1:0;r[a++]=p,p&&t.BoundingSphere.pack(n.boundingSphere,r,a),a+=t.BoundingSphere.packedLength;constf=o.defined(n.boundingSphereCV)?1:0;r[a++]=f,f&&t.BoundingSphere.pack(n.boundingSphereCV,r,a),a+=t.BoundingSphere.packedLength;constu=n.attributes,l=[];for(consteinu)u.hasOwnProperty(e)&&o.defined(u[e])&&(l.push(e),o.defined(s[e])||(s[e]=i.length,i.push(e)));r[a++]=l.length;for(lete=0;e<l.length;e++){constt=l[e],n=u[t];r[a++]=s[t],r[a++]=n.componentDatatype,r[a++]=n.componentsPerAttribute,r[a++]=n.normalize?1:0,r[a++]=n.values.length,r.set(n.values,a),a+=n.values.length}constm=o.defined(n.indices)?n.indices.length:0;r[a++]=m,m>0&&(r.set(n.indices,a),a+=m)}returnn.push(r.buffer),{stringTable:i,packedData:r}},b.unpackCreateGeometryResults=function(e){consto=e.stringTable,r=e.packedData;leti;consta=newArray(r[0]);letp=0,f=1;while(f<r.length){conste=1===r[f++];if(!e){a[p++]=void0;continue}constu=r[f++],l=r[f++];letm,h,g=r[f++];-1===g&&(g=void0);consty=1===r[f++];y&&(m=t.BoundingSphere.unpack(r,f)),f+=t.BoundingSphere.packedLength;constb=1===r[f++];letx,G,S;b&&(h=t.BoundingSphere.unpack(r,f)),f+=t.BoundingSphere.packedLength;constP=newc.GeometryAttributes,k=r[f++];for(i=0;i<k;i++){conste=o[r[f++]],t=r[f++];S=r[f++];consti=0!==r[f++];x=r[f++],G=n.ComponentDatatype.createTypedArray(t,x);for(letn=0;n<x;n++)G[n]=r[f++];P[e]=news.GeometryAttribute({componentDatatype:t,componentsPerAttribute:S,normalize:i,values:G})}letC;if(x=r[f++],x>0){conste=G.length/S;for(C=d.IndexDatatype.createTypedArray(e,x),i=0;i<x;i++)C[i]=r[f++]}a[p++]=news.Geometry({primitiveType:u,geometryType:l,boundingSphere:m,boundingSphereCV:h,indices:C,attributes:P,offsetAttribute:g})}returna},b.packCombineGeometryParameters=function(e,n){consto=e.createGeometryResults,r=o.length;for(lett=0;t<r;t++)n.push(o[t].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:P(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projectioninstanceoft.GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},b.unpackCombineGeometryParameters=function(e){constn=k(e.packedInstances),o=e.createGeometryResults,r=o.length;lets=0;for(lett=0;t<r;t++){conste=b.unpackCreateGeometryResults(o[t]),r=e.length;for(lett=0;t<r;t++){consto=e[t],r=n[s];r.geometry=o,++s}}constc=i.Ellipsoid.clone(e.ellipsoid),a=e.isGeographic?newt.GeographicProjection(c):newp.WebMercatorProjection(c);return{instances:n,ellipsoid:c,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:i.Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},b.packCombineGeometryResults=function(e,t){o.defined(e.geometries)&&G(e.geometries,t);constn=C(e.boundingSpheres),r=C(e.boundingSpheresCV);returnt.push(n.buffer,r.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:r}},b.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:w(e.boundingSpheres),boundingSpheresCV:w(e.boundingSpheresCV)}},e.PrimitivePipeline=b}));
define(["exports","./Matrix2-fc7e9822","./defaultValue-94c3e563","./RuntimeError-c581ca93","./Transforms-3ac41eb6","./ComponentDatatype-4a60b8d6"],(function(t,n,a,e,o,r){"use strict";consts=Math.cos,i=Math.sin,c=Math.sqrt,h={computePosition:function(t,n,e,o,r,h,u){constg=n.radiiSquared,l=t.nwCorner,C=t.boundingRectangle;letd=l.latitude-t.granYCos*o+r*t.granXSin;constM=s(d),S=i(d),w=g.z*S;letm=l.longitude+o*t.granYSin+r*t.granXCos;constp=M*s(m),R=M*i(m),X=g.x*p,Y=g.y*R,O=c(X*p+Y*R+w*S);if(h.x=X/O,h.y=Y/O,h.z=w/O,e){constn=t.stNwCorner;a.defined(n)?(d=n.latitude-t.stGranYCos*o+r*t.stGranXSin,m=n.longitude+o*t.stGranYSin+r*t.stGranXCos,u.x=(m-t.stWest)*t.lonScalar,u.y=(d-t.stSouth)*t.latScalar):(u.x=(m-C.west)*t.lonScalar,u.y=(d-C.south)*t.latScalar)}}},u=newn.Matrix2;letg=newn.Cartesian3;constl=newn.Cartographic;letC=newn.Cartesian3;constd=newo.GeographicProjection;functionM(t,a,e,o,r,s,i){constc=Math.cos(a),h=o*c,l=e*c,M=Math.sin(a),S=o*M,w=e*M;g=d.project(t,g),g=n.Cartesian3.subtract(g,C,g);constm=n.Matrix2.fromRotation(a,u);g=n.Matrix2.multiplyByVector(m,g,g),g=n.Cartesian3.add(g,C,g),t=d.unproject(g,t),s-=1,i-=1;constp=t.latitude,R=p+s*w,X=p-h*i,Y=p-h*i+s*w,O=Math.max(p,R,X,Y),f=Math.min(p,R,X,Y),_=t.longitude,x=_+s*l,G=_+i*S,P=_+i*S+s*l,W=Math.max(_,x,G,P),y=Math.min(_,x,G,P);return{north:O,south:f,east:W,west:y,granYCos:h,granYSin:S,granXCos:l,granXSin:w,nwCorner:t}}h.computeOptions=function(t,a,o,s,i,c,h){letu,g=t.east,S=t.west,w=t.north,m=t.south,p=!1,R=!1;w===r.CesiumMath.PI_OVER_TWO&&(p=!0),m===-r.CesiumMath.PI_OVER_TWO&&(R=!0);constX=w-m;u=S>g?r.CesiumMath.TWO_PI-S+g:g-S;constY=Math.ceil(u/a)+1,O=Math.ceil(X/a)+1,f=u/(Y-1),_=X/(O-1),x=n.Rectangle.northwest(t,c),G=n.Rectangle.center(t,l);0===o&&0===s||(G.longitude<x.longitude&&(G.longitude+=r.CesiumMath.TWO_PI),C=d.project(G,C));constP=_,W=f,y=0,I=0,T=n.Rectangle.clone(t,i),E={granYCos:P,granYSin:y,granXCos:W,granXSin:I,nwCorner:x,boundingRectangle:T,width:Y,height:O,northCap:p,southCap:R};if(0!==o){constt=M(x,o,f,_,G,Y,O);if(w=t.north,m=t.south,g=t.east,S=t.west,w<-r.CesiumMath.PI_OVER_TWO||w>r.CesiumMath.PI_OVER_TWO||m<-r.CesiumMath.PI_OVER_TWO||m>r.CesiumMath.PI_OVER_TWO)thrownewe.DeveloperError("Rotated rectangle is invalid. It crosses over either the north or south pole.");E.granYCos=t.granYCos,E.granYSin=t.granYSin,E.granXCos=t.granXCos,E.granXSin=t.granXSin,T.north=w,T.south=m,T.east=g,T.west=S}if(0!==s){o-=s;constt=n.Rectangle.northwest(T,h),a=M(t,o,f,_,G,Y,O);E.stGranYCos=a.granYCos,E.stGranXCos=a.granXCos,E.stGranYSin=a.granYSin,E.stGranXSin=a.granXSin,E.stNwCorner=t,E.stWest=a.west,E.stSouth=a.south}returnE},t.RectangleGeometryLibrary=h}));
define(["exports","./defaultValue-94c3e563"],(function(t,e){"use strict";functionn(t){lete;this.name="DeveloperError",this.message=t;try{thrownewError}catch(n){e=n.stack}this.stack=e}e.defined(Object.create)&&(n.prototype=Object.create(Error.prototype),n.prototype.constructor=n),n.prototype.toString=function(){lett=`${this.name}: ${this.message}`;returne.defined(this.stack)&&(t+=`\n${this.stack.toString()}`),t},n.throwInstantiationError=function(){thrownewn("This function defines an interface and should not be called directly.")};consto={};functionr(t){return`${t} is required, actual value was undefined`}functioni(t,e,n){return`Expected ${n} to be typeof ${e}, actual typeof was ${t}`}functionf(t){lete;this.name="RuntimeError",this.message=t;try{thrownewError}catch(n){e=n.stack}this.stack=e}o.typeOf={},o.defined=function(t,o){if(!e.defined(o))thrownewn(r(t))},o.typeOf.func=function(t,e){if("function"!==typeofe)thrownewn(i(typeofe,"function",t))},o.typeOf.string=function(t,e){if("string"!==typeofe)thrownewn(i(typeofe,"string",t))},o.typeOf.number=function(t,e){if("number"!==typeofe)thrownewn(i(typeofe,"number",t))},o.typeOf.number.lessThan=function(t,e,r){if(o.typeOf.number(t,e),e>=r)thrownewn(`Expected ${t} to be less than ${r}, actual value was ${e}`)},o.typeOf.number.lessThanOrEquals=function(t,e,r){if(o.typeOf.number(t,e),e>r)thrownewn(`Expected ${t} to be less than or equal to ${r}, actual value was ${e}`)},o.typeOf.number.greaterThan=function(t,e,r){if(o.typeOf.number(t,e),e<=r)thrownewn(`Expected ${t} to be greater than ${r}, actual value was ${e}`)},o.typeOf.number.greaterThanOrEquals=function(t,e,r){if(o.typeOf.number(t,e),e<r)thrownewn(`Expected ${t} to be greater than or equal to ${r}, actual value was ${e}`)},o.typeOf.object=function(t,e){if("object"!==typeofe)thrownewn(i(typeofe,"object",t))},o.typeOf.bool=function(t,e){if("boolean"!==typeofe)thrownewn(i(typeofe,"boolean",t))},o.typeOf.bigint=function(t,e){if("bigint"!==typeofe)thrownewn(i(typeofe,"bigint",t))},o.typeOf.number.equals=function(t,e,r,i){if(o.typeOf.number(t,r),o.typeOf.number(e,i),r!==i)thrownewn(`${t} must be equal to ${e}, the actual values are ${r} and ${i}`)},e.defined(Object.create)&&(f.prototype=Object.create(Error.prototype),f.prototype.constructor=f),f.prototype.toString=function(){lett=`${this.name}: ${this.message}`;returne.defined(this.stack)&&(t+=`\n${this.stack.toString()}`),t},t.Check=o,t.DeveloperError=n,t.RuntimeError=f}));
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f"],(function(e,t,n,r,o,i,s){"use strict";functiona(e){this._ellipsoid=r.defaultValue(e,t.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(a.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}}}),a.prototype.project=function(e,n){consto=this._semimajorAxis,i=e.longitude*o,s=e.latitude*o,a=e.height;returnr.defined(n)?(n.x=i,n.y=s,n.z=a,n):newt.Cartesian3(i,s,a)},a.prototype.unproject=function(e,o){if(!r.defined(e))thrownewn.DeveloperError("cartesian is required");consti=this._oneOverSemimajorAxis,s=e.x*i,a=e.y*i,u=e.z;returnr.defined(o)?(o.longitude=s,o.latitude=a,o.height=u,o):newt.Cartographic(s,a,u)};constu={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};varc=Object.freeze(u);functionl(e,t){this.start=r.defaultValue(e,0),this.stop=r.defaultValue(t,0)}functiond(e,n){this.center=t.Cartesian3.clone(r.defaultValue(e,t.Cartesian3.ZERO)),this.radius=r.defaultValue(n,0)}constf=newt.Cartesian3,p=newt.Cartesian3,h=newt.Cartesian3,m=newt.Cartesian3,g=newt.Cartesian3,y=newt.Cartesian3,v=newt.Cartesian3,w=newt.Cartesian3,C=newt.Cartesian3,b=newt.Cartesian3,_=newt.Cartesian3,x=newt.Cartesian3,E=4/3*o.CesiumMath.PI;d.fromPoints=function(e,n){if(r.defined(n)||(n=newd),!r.defined(e)||0===e.length)returnn.center=t.Cartesian3.clone(t.Cartesian3.ZERO,n.center),n.radius=0,n;consto=t.Cartesian3.clone(e[0],v),i=t.Cartesian3.clone(o,f),s=t.Cartesian3.clone(o,p),a=t.Cartesian3.clone(o,h),u=t.Cartesian3.clone(o,m),c=t.Cartesian3.clone(o,g),l=t.Cartesian3.clone(o,y),E=e.length;letO;for(O=1;O<E;O++){t.Cartesian3.clone(e[O],o);constn=o.x,r=o.y,d=o.z;n<i.x&&t.Cartesian3.clone(o,i),n>u.x&&t.Cartesian3.clone(o,u),r<s.y&&t.Cartesian3.clone(o,s),r>c.y&&t.Cartesian3.clone(o,c),d<a.z&&t.Cartesian3.clone(o,a),d>l.z&&t.Cartesian3.clone(o,l)}constS=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(u,i,w)),A=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(c,s,w)),q=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,a,w));letk=i,D=u,I=S;A>I&&(I=A,k=s,D=c),q>I&&(I=q,k=a,D=l);constP=C;P.x=.5*(k.x+D.x),P.y=.5*(k.y+D.y),P.z=.5*(k.z+D.z);letR=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(D,P,w)),T=Math.sqrt(R);constz=b;z.x=i.x,z.y=s.y,z.z=a.z;constM=_;M.x=u.x,M.y=c.y,M.z=l.z;constU=t.Cartesian3.midpoint(z,M,x);letj=0;for(O=0;O<E;O++){t.Cartesian3.clone(e[O],o);constn=t.Cartesian3.magnitude(t.Cartesian3.subtract(o,U,w));n>j&&(j=n);constr=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(o,P,w));if(r>R){conste=Math.sqrt(r);T=.5*(T+e),R=T*T;constt=e-T;P.x=(T*P.x+t*o.x)/e,P.y=(T*P.y+t*o.y)/e,P.z=(T*P.z+t*o.z)/e}}returnT<j?(t.Cartesian3.clone(P,n.center),n.radius=T):(t.Cartesian3.clone(U,n.center),n.radius=j),n};constO=newa,S=newt.Cartesian3,A=newt.Cartesian3,q=newt.Cartographic,k=newt.Cartographic;d.fromRectangle2D=function(e,t,n){returnd.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(e,n,o,i,s){if(r.defined(s)||(s=newd),!r.defined(e))returns.center=t.Cartesian3.clone(t.Cartesian3.ZERO,s.center),s.radius=0,s;n=r.defaultValue(n,O),t.Rectangle.southwest(e,q),q.height=o,t.Rectangle.northeast(e,k),k.height=i;consta=n.project(q,S),u=n.project(k,A),c=u.x-a.x,l=u.y-a.y,f=u.z-a.z;s.radius=.5*Math.sqrt(c*c+l*l+f*f);constp=s.center;returnp.x=a.x+.5*c,p.y=a.y+.5*l,p.z=a.z+.5*f,s};constD=[];d.fromRectangle3D=function(e,n,o,i){if(n=r.defaultValue(n,t.Ellipsoid.WGS84),o=r.defaultValue(o,0),r.defined(i)||(i=newd),!r.defined(e))returni.center=t.Cartesian3.clone(t.Cartesian3.ZERO,i.center),i.radius=0,i;consts=t.Rectangle.subsample(e,n,o,D);returnd.fromPoints(s,i)},d.fromVertices=function(e,o,i,s){if(r.defined(s)||(s=newd),!r.defined(e)||0===e.length)returns.center=t.Cartesian3.clone(t.Cartesian3.ZERO,s.center),s.radius=0,s;o=r.defaultValue(o,t.Cartesian3.ZERO),i=r.defaultValue(i,3),n.Check.typeOf.number.greaterThanOrEquals("stride",i,3);consta=v;a.x=e[0]+o.x,a.y=e[1]+o.y,a.z=e[2]+o.z;constu=t.Cartesian3.clone(a,f),c=t.Cartesian3.clone(a,p),l=t.Cartesian3.clone(a,h),E=t.Cartesian3.clone(a,m),O=t.Cartesian3.clone(a,g),S=t.Cartesian3.clone(a,y),A=e.length;letq;for(q=0;q<A;q+=i){constn=e[q]+o.x,r=e[q+1]+o.y,i=e[q+2]+o.z;a.x=n,a.y=r,a.z=i,n<u.x&&t.Cartesian3.clone(a,u),n>E.x&&t.Cartesian3.clone(a,E),r<c.y&&t.Cartesian3.clone(a,c),r>O.y&&t.Cartesian3.clone(a,O),i<l.z&&t.Cartesian3.clone(a,l),i>S.z&&t.Cartesian3.clone(a,S)}constk=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(E,u,w)),D=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(O,c,w)),I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(S,l,w));letP=u,R=E,T=k;D>T&&(T=D,P=c,R=O),I>T&&(T=I,P=l,R=S);constz=C;z.x=.5*(P.x+R.x),z.y=.5*(P.y+R.y),z.z=.5*(P.z+R.z);letM=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(R,z,w)),U=Math.sqrt(M);constj=b;j.x=u.x,j.y=c.y,j.z=l.z;constF=_;F.x=E.x,F.y=O.y,F.z=S.z;constN=t.Cartesian3.midpoint(j,F,x);letB=0;for(q=0;q<A;q+=i){a.x=e[q]+o.x,a.y=e[q+1]+o.y,a.z=e[q+2]+o.z;constn=t.Cartesian3.magnitude(t.Cartesian3.subtract(a,N,w));n>B&&(B=n);constr=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(a,z,w));if(r>M){conste=Math.sqrt(r);U=.5*(U+e),M=U*U;constt=e-U;z.x=(U*z.x+t*a.x)/e,z.y=(U*z.y+t*a.y)/e,z.z=(U*z.z+t*a.z)/e}}returnU<B?(t.Cartesian3.clone(z,s.center),s.radius=U):(t.Cartesian3.clone(N,s.center),s.radius=B),s},d.fromEncodedCartesianVertices=function(e,n,o){if(r.defined(o)||(o=newd),!r.defined(e)||!r.defined(n)||e.length!==n.length||0===e.length)returno.center=t.Cartesian3.clone(t.Cartesian3.ZERO,o.center),o.radius=0,o;consti=v;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];consts=t.Cartesian3.clone(i,f),a=t.Cartesian3.clone(i,p),u=t.Cartesian3.clone(i,h),c=t.Cartesian3.clone(i,m),l=t.Cartesian3.clone(i,g),E=t.Cartesian3.clone(i,y),O=e.length;letS;for(S=0;S<O;S+=3){constr=e[S]+n[S],o=e[S+1]+n[S+1],d=e[S+2]+n[S+2];i.x=r,i.y=o,i.z=d,r<s.x&&t.Cartesian3.clone(i,s),r>c.x&&t.Cartesian3.clone(i,c),o<a.y&&t.Cartesian3.clone(i,a),o>l.y&&t.Cartesian3.clone(i,l),d<u.z&&t.Cartesian3.clone(i,u),d>E.z&&t.Cartesian3.clone(i,E)}constA=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(c,s,w)),q=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,a,w)),k=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(E,u,w));letD=s,I=c,P=A;q>P&&(P=q,D=a,I=l),k>P&&(P=k,D=u,I=E);constR=C;R.x=.5*(D.x+I.x),R.y=.5*(D.y+I.y),R.z=.5*(D.z+I.z);letT=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(I,R,w)),z=Math.sqrt(T);constM=b;M.x=s.x,M.y=a.y,M.z=u.z;constU=_;U.x=c.x,U.y=l.y,U.z=E.z;constj=t.Cartesian3.midpoint(M,U,x);letF=0;for(S=0;S<O;S+=3){i.x=e[S]+n[S],i.y=e[S+1]+n[S+1],i.z=e[S+2]+n[S+2];constr=t.Cartesian3.magnitude(t.Cartesian3.subtract(i,j,w));r>F&&(F=r);consto=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,R,w));if(o>T){conste=Math.sqrt(o);z=.5*(z+e),T=z*z;constt=e-z;R.x=(z*R.x+t*i.x)/e,R.y=(z*R.y+t*i.y)/e,R.z=(z*R.z+t*i.z)/e}}returnz<F?(t.Cartesian3.clone(R,o.center),o.radius=z):(t.Cartesian3.clone(j,o.center),o.radius=F),o},d.fromCornerPoints=function(e,o,i){n.Check.typeOf.object("corner",e),n.Check.typeOf.object("oppositeCorner",o),r.defined(i)||(i=newd);consts=t.Cartesian3.midpoint(e,o,i.center);returni.radius=t.Cartesian3.distance(s,o),i},d.fromEllipsoid=function(e,o){returnn.Check.typeOf.object("ellipsoid",e),r.defined(o)||(o=newd),t.Cartesian3.clone(t.Cartesian3.ZERO,o.center),o.radius=e.maximumRadius,o};constI=newt.Cartesian3;d.fromBoundingSpheres=function(e,n){if(r.defined(n)||(n=newd),!r.defined(e)||0===e.length)returnn.center=t.Cartesian3.clone(t.Cartesian3.ZERO,n.center),n.radius=0,n;consto=e.length;if(1===o)returnd.clone(e[0],n);if(2===o)returnd.union(e[0],e[1],n);consti=[];lets;for(s=0;s<o;s++)i.push(e[s].center);n=d.fromPoints(i,n);consta=n.center;letu=n.radius;for(s=0;s<o;s++){constn=e[s];u=Math.max(u,t.Cartesian3.distance(a,n.center,I)+n.radius)}returnn.radius=u,n};constP=newt.Cartesian3,R=newt.Cartesian3,T=newt.Cartesian3;d.fromOrientedBoundingBox=function(e,o){n.Check.defined("orientedBoundingBox",e),r.defined(o)||(o=newd);consti=e.halfAxes,s=t.Matrix3.getColumn(i,0,P),a=t.Matrix3.getColumn(i,1,R),u=t.Matrix3.getColumn(i,2,T);returnt.Cartesian3.add(s,a,s),t.Cartesian3.add(s,u,s),o.center=t.Cartesian3.clone(e.center,o.center),o.radius=t.Cartesian3.magnitude(s),o};constz=newt.Cartesian3,M=newt.Cartesian3;d.fromTransformation=function(e,o){n.Check.typeOf.object("transformation",e),r.defined(o)||(o=newd);consti=t.Matrix4.getTranslation(e,z),s=t.Matrix4.getScale(e,M),a=.5*t.Cartesian3.magnitude(s);returno.center=t.Cartesian3.clone(i,o.center),o.radius=a,o},d.clone=function(e,n){if(r.defined(e))returnr.defined(n)?(n.center=t.Cartesian3.clone(e.center,n.center),n.radius=e.radius,n):newd(e.center,e.radius)},d.packedLength=4,d.pack=function(e,t,o){n.Check.typeOf.object("value",e),n.Check.defined("array",t),o=r.defaultValue(o,0);consti=e.center;returnt[o++]=i.x,t[o++]=i.y,t[o++]=i.z,t[o]=e.radius,t},d.unpack=function(e,t,o){n.Check.defined("array",e),t=r.defaultValue(t,0),r.defined(o)||(o=newd);consti=o.center;returni.x=e[t++],i.y=e[t++],i.z=e[t++],o.radius=e[t],o};constU=newt.Cartesian3,j=newt.Cartesian3;d.union=function(e,o,i){n.Check.typeOf.object("left",e),n.Check.typeOf.object("right",o),r.defined(i)||(i=newd);consts=e.center,a=e.radius,u=o.center,c=o.radius,l=t.Cartesian3.subtract(u,s,U),f=t.Cartesian3.magnitude(l);if(a>=f+c)returne.clone(i),i;if(c>=f+a)returno.clone(i),i;constp=.5*(a+f+c),h=t.Cartesian3.multiplyByScalar(l,(-a+p)/f,j);returnt.Cartesian3.add(h,s,h),t.Cartesian3.clone(h,i.center),i.radius=p,i};constF=newt.Cartesian3;d.expand=function(e,r,o){n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("point",r),o=d.clone(e,o);consti=t.Cartesian3.magnitude(t.Cartesian3.subtract(r,o.center,F));returni>o.radius&&(o.radius=i),o},d.intersectPlane=function(e,r){n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("plane",r);consto=e.center,i=e.radius,s=r.normal,a=t.Cartesian3.dot(s,o)+r.distance;returna<-i?c.OUTSIDE:a<i?c.INTERSECTING:c.INSIDE},d.transform=function(e,o,i){returnn.Check.typeOf.object("sphere",e),n.Check.typeOf.object("transform",o),r.defined(i)||(i=newd),i.center=t.Matrix4.multiplyByPoint(o,e.center,i.center),i.radius=t.Matrix4.getMaximumScale(o)*e.radius,i};constN=newt.Cartesian3;d.distanceSquaredTo=function(e,r){n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("cartesian",r);consto=t.Cartesian3.subtract(e.center,r,N),i=t.Cartesian3.magnitude(o)-e.radius;returni<=0?0:i*i},d.transformWithoutScale=function(e,o,i){returnn.Check.typeOf.object("sphere",e),n.Check.typeOf.object("transform",o),r.defined(i)||(i=newd),i.center=t.Matrix4.multiplyByPoint(o,e.center,i.center),i.radius=e.radius,i};constB=newt.Cartesian3;d.computePlaneDistances=function(e,o,i,s){n.Check.typeOf.object("sphere",e),n.Check.typeOf.object("position",o),n.Check.typeOf.object("direction",i),r.defined(s)||(s=newl);consta=t.Cartesian3.subtract(e.center,o,B),u=t.Cartesian3.dot(i,a);returns.start=u-e.radius,s.stop=u+e.radius,s};constV=newt.Cartesian3,L=newt.Cartesian3,Q=newt.Cartesian3,$=newt.Cartesian3,W=newt.Cartesian3,H=newt.Cartographic,Y=newArray(8);for(letmo=0;mo<8;++mo)Y[mo]=newt.Cartesian3;constZ=newa;functionG(){lete,t;constn=newPromise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}}letJ;d.projectTo2D=function(e,o,i){n.Check.typeOf.object("sphere",e),o=r.defaultValue(o,Z);consts=o.ellipsoid;leta=e.center;constu=e.radius;letc;c=t.Cartesian3.equals(a,t.Cartesian3.ZERO)?t.Cartesian3.clone(t.Cartesian3.UNIT_X,V):s.geodeticSurfaceNormal(a,V);constl=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,c,L);t.Cartesian3.normalize(l,l);constf=t.Cartesian3.cross(c,l,Q);t.Cartesian3.normalize(f,f),t.Cartesian3.multiplyByScalar(c,u,c),t.Cartesian3.multiplyByScalar(f,u,f),t.Cartesian3.multiplyByScalar(l,u,l);constp=t.Cartesian3.negate(f,W),h=t.Cartesian3.negate(l,$),m=Y;letg=m[0];t.Cartesian3.add(c,f,g),t.Cartesian3.add(g,l,g),g=m[1],t.Cartesian3.add(c,f,g),t.Cartesian3.add(g,h,g),g=m[2],t.Cartesian3.add(c,p,g),t.Cartesian3.add(g,h,g),g=m[3],t.Cartesian3.add(c,p,g),t.Cartesian3.add(g,l,g),t.Cartesian3.negate(c,c),g=m[4],t.Cartesian3.add(c,f,g),t.Cartesian3.add(g,l,g),g=m[5],t.Cartesian3.add(c,f,g),t.Cartesian3.add(g,h,g),g=m[6],t.Cartesian3.add(c,p,g),t.Cartesian3.add(g,h,g),g=m[7],t.Cartesian3.add(c,p,g),t.Cartesian3.add(g,l,g);consty=m.length;for(letn=0;n<y;++n){conste=m[n];t.Cartesian3.add(a,e,e);constr=s.cartesianToCartographic(e,H);o.project(r,e)}i=d.fromPoints(m,i),a=i.center;constv=a.x,w=a.y,C=a.z;returna.x=C,a.y=v,a.z=w,i},d.isOccluded=function(e,t){returnn.Check.typeOf.object("sphere",e),n.Check.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},d.equals=function(e,n){returne===n||r.defined(e)&&r.defined(n)&&t.Cartesian3.equals(e.center,n.center)&&e.radius===n.radius},d.prototype.intersectPlane=function(e){returnd.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){returnd.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){returnd.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){returnd.isOccluded(this,e)},d.prototype.equals=function(e){returnd.equals(this,e)},d.prototype.clone=function(e){returnd.clone(this,e)},d.prototype.volume=function(){conste=this.radius;returnE*e*e*e};constX={requestFullscreen:void0,exitFullscreen:void0,fullscreenEnabled:void0,fullscreenElement:void0,fullscreenchange:void0,fullscreenerror:void0},K={};letee,te,ne,re,oe,ie,se,ae,ue,ce,le,de,fe,pe,he,me,ge,ye;functionve(e){constt=e.split(".");for(letn=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);returnt}functionwe(){if(!r.defined(te)&&(te=!1,!Ae())){conste=/ Chrome\/([\.0-9]+)/.exec(ee.userAgent);null!==e&&(te=!0,ne=ve(e[1]))}returnte}functionCe(){returnwe()&&ne}functionbe(){if(!r.defined(re)&&(re=!1,!we()&&!Ae()&&/ Safari\/[\.0-9]+/.test(ee.userAgent))){conste=/ Version\/([\.0-9]+)/.exec(ee.userAgent);null!==e&&(re=!0,oe=ve(e[1]))}returnre}function_e(){returnbe()&&oe}functionxe(){if(!r.defined(ie)){ie=!1;conste=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(ee.userAgent);null!==e&&(ie=!0,se=ve(e[1]),se.isNightly=!!e[2])}returnie}functionEe(){returnxe()&&se}functionOe(){if(!r.defined(ae)){lete;ae=!1,"Microsoft Internet Explorer"===ee.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(ee.userAgent),null!==e&&(ae=!0,ue=ve(e[1]))):"Netscape"===ee.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(ee.userAgent),null!==e&&(ae=!0,ue=ve(e[1])))}returnae}functionSe(){returnOe()&&ue}functionAe(){if(!r.defined(ce)){ce=!1;conste=/ Edg\/([\.0-9]+)/.exec(ee.userAgent);null!==e&&(ce=!0,le=ve(e[1]))}returnce}functionqe(){returnAe()&&le}functionke(){if(!r.defined(de)){de=!1;conste=/Firefox\/([\.0-9]+)/.exec(ee.userAgent);null!==e&&(de=!0,fe=ve(e[1]))}returnde}functionDe(){returnr.defined(pe)||(pe=/Windows/i.test(ee.appVersion)),pe}functionIe(){returnr.defined(he)||(he="iPhone"===navigator.platform||"iPod"===navigator.platform||"iPad"===navigator.platform),he}functionPe(){returnke()&&fe}functionRe(){returnr.defined(me)||(me=!ke()&&"undefined"!==typeofPointerEvent&&(!r.defined(ee.pointerEnabled)||ee.pointerEnabled)),me}functionTe(){if(!r.defined(ye)){conste=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");constt=e.style.imageRendering;ye=r.defined(t)&&""!==t,ye&&(ge=t)}returnye}functionze(){returnTe()?ge:void0}functionMe(){if(!Me.initialized)thrownewn.DeveloperError("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");returnMe._result}Object.defineProperties(K,{element:{get:function(){if(K.supportsFullscreen())returndocument[X.fullscreenElement]}},changeEventName:{get:function(){if(K.supportsFullscreen())returnX.fullscreenchange}},errorEventName:{get:function(){if(K.supportsFullscreen())returnX.fullscreenerror}},enabled:{get:function(){if(K.supportsFullscreen())returndocument[X.fullscreenEnabled]}},fullscreen:{get:function(){if(K.supportsFullscreen())returnnull!==K.element}}}),K.supportsFullscreen=function(){if(r.defined(J))returnJ;J=!1;conste=document.body;if("function"===typeofe.requestFullscreen)returnX.requestFullscreen="requestFullscreen",X.exitFullscreen="exitFullscreen",X.fullscreenEnabled="fullscreenEnabled",X.fullscreenElement="fullscreenElement",X.fullscreenchange="fullscreenchange",X.fullscreenerror="fullscreenerror",J=!0,J;constt=["webkit","moz","o","ms","khtml"];letn;for(letr=0,o=t.length;r<o;++r){consto=t[r];n=`${o}RequestFullscreen`,"function"===typeofe[n]?(X.requestFullscreen=n,J=!0):(n=`${o}RequestFullScreen`,"function"===typeofe[n]&&(X.requestFullscreen=n,J=!0)),n=`${o}ExitFullscreen`,"function"===typeofdocument[n]?X.exitFullscreen=n:(n=`${o}CancelFullScreen`,"function"===typeofdocument[n]&&(X.exitFullscreen=n)),n=`${o}FullscreenEnabled`,void0!==document[n]?X.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,void0!==document[n]&&(X.fullscreenEnabled=n)),n=`${o}FullscreenElement`,void0!==document[n]?X.fullscreenElement=n:(n=`${o}FullScreenElement`,void0!==document[n]&&(X.fullscreenElement=n)),n=`${o}fullscreenchange`,void0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenChange"),X.fullscreenchange=n),n=`${o}fullscreenerror`,void0!==document[`on${n}`]&&("ms"===o&&(n="MSFullscreenError"),X.fullscreenerror=n)}returnJ},K.requestFullscreen=function(e,t){K.supportsFullscreen()&&e[X.requestFullscreen]({vrDisplay:t})},K.exitFullscreen=function(){K.supportsFullscreen()&&document[X.exitFullscreen]()},K._names=X,ee="undefined"!==typeofnavigator?navigator:{},Me._promise=void0,Me._result=void0,Me.initialize=function(){if(r.defined(Me._promise))returnMe._promise;conste=G();if(Me._promise=e.promise,Ae())returnMe._result=!1,e.resolve(Me._result),e.promise;constt=newImage;returnt.onload=function(){Me._result=t.width>0&&t.height>0,e.resolve(Me._result)},t.onerror=function(){Me._result=!1,e.resolve(Me._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},Object.defineProperties(Me,{initialized:{get:function(){returnr.defined(Me._result)}}});constUe=[];"undefined"!==typeofArrayBuffer&&(Ue.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!==typeofUint8ClampedArray&&Ue.push(Uint8ClampedArray),"undefined"!==typeofUint8ClampedArray&&Ue.push(Uint8ClampedArray),"undefined"!==typeofBigInt64Array&&Ue.push(BigInt64Array),"undefined"!==typeofBigUint64Array&&Ue.push(BigUint64Array));constje={isChrome:we,chromeVersion:Ce,isSafari:be,safariVersion:_e,isWebkit:xe,webkitVersion:Ee,isInternetExplorer:Oe,internetExplorerVersion:Se,isEdge:Ae,edgeVersion:qe,isFirefox:ke,firefoxVersion:Pe,isWindows:De,isIPadOrIOS:Ie,hardwareConcurrency:r.defaultValue(ee.hardwareConcurrency,3),supportsPointerEvents:Re,supportsImageRenderingPixelated:Te,supportsWebP:Me,imageRenderingValue:ze,typedArrayTypes:Ue};functionFe(e,t,n,o){this.x=r.defaultValue(e,0),this.y=r.defaultValue(t,0),this.z=r.defaultValue(n,0),this.w=r.defaultValue(o,0)}je.supportsBasis=function(e){returnje.supportsWebAssembly()&&e.context.supportsBasis},je.supportsFullscreen=function(){returnK.supportsFullscreen()},je.supportsTypedArrays=function(){return"undefined"!==typeofArrayBuffer},je.supportsBigInt64Array=function(){return"undefined"!==typeofBigInt64Array},je.supportsBigUint64Array=function(){return"undefined"!==typeofBigUint64Array},je.supportsBigInt=function(){return"undefined"!==typeofBigInt},je.supportsWebWorkers=function(){return"undefined"!==typeofWorker},je.supportsWebAssembly=function(){return"undefined"!==typeofWebAssembly};letNe=newt.Cartesian3;Fe.fromAxisAngle=function(e,o,i){n.Check.typeOf.object("axis",e),n.Check.typeOf.number("angle",o);consts=o/2,a=Math.sin(s);Ne=t.Cartesian3.normalize(e,Ne);constu=Ne.x*a,c=Ne.y*a,l=Ne.z*a,d=Math.cos(s);returnr.defined(i)?(i.x=u,i.y=c,i.z=l,i.w=d,i):newFe(u,c,l,d)};constBe=[1,2,0],Ve=newArray(3);Fe.fromRotationMatrix=function(e,o){leti,s,a,u,c;n.Check.typeOf.object("matrix",e);constl=e[t.Matrix3.COLUMN0ROW0],d=e[t.Matrix3.COLUMN1ROW1],f=e[t.Matrix3.COLUMN2ROW2],p=l+d+f;if(p>0)i=Math.sqrt(p+1),c=.5*i,i=.5/i,s=(e[t.Matrix3.COLUMN1ROW2]-e[t.Matrix3.COLUMN2ROW1])*i,a=(e[t.Matrix3.COLUMN2ROW0]-e[t.Matrix3.COLUMN0ROW2])*i,u=(e[t.Matrix3.COLUMN0ROW1]-e[t.Matrix3.COLUMN1ROW0])*i;else{constn=Be;letr=0;d>l&&(r=1),f>l&&f>d&&(r=2);consto=n[r],p=n[o];i=Math.sqrt(e[t.Matrix3.getElementIndex(r,r)]-e[t.Matrix3.getElementIndex(o,o)]-e[t.Matrix3.getElementIndex(p,p)]+1);consth=Ve;h[r]=.5*i,i=.5/i,c=(e[t.Matrix3.getElementIndex(p,o)]-e[t.Matrix3.getElementIndex(o,p)])*i,h[o]=(e[t.Matrix3.getElementIndex(o,r)]+e[t.Matrix3.getElementIndex(r,o)])*i,h[p]=(e[t.Matrix3.getElementIndex(p,r)]+e[t.Matrix3.getElementIndex(r,p)])*i,s=-h[0],a=-h[1],u=-h[2]}returnr.defined(o)?(o.x=s,o.y=a,o.z=u,o.w=c,o):newFe(s,a,u,c)};constLe=newFe;letQe=newFe,$e=newFe,We=newFe;Fe.fromHeadingPitchRoll=function(e,r){returnn.Check.typeOf.object("headingPitchRoll",e),We=Fe.fromAxisAngle(t.Cartesian3.UNIT_X,e.roll,Le),$e=Fe.fromAxisAngle(t.Cartesian3.UNIT_Y,-e.pitch,r),r=Fe.multiply($e,We,$e),Qe=Fe.fromAxisAngle(t.Cartesian3.UNIT_Z,-e.heading,Le),Fe.multiply(Qe,r,r)};constHe=newt.Cartesian3,Ye=newt.Cartesian3,Ze=newFe,Ge=newFe,Je=newFe;Fe.packedLength=4,Fe.pack=function(e,t,o){returnn.Check.typeOf.object("value",e),n.Check.defined("array",t),o=r.defaultValue(o,0),t[o++]=e.x,t[o++]=e.y,t[o++]=e.z,t[o]=e.w,t},Fe.unpack=function(e,t,o){returnn.Check.defined("array",e),t=r.defaultValue(t,0),r.defined(o)||(o=newFe),o.x=e[t],o.y=e[t+1],o.z=e[t+2],o.w=e[t+3],o},Fe.packedInterpolationLength=3,Fe.convertPackedArrayForInterpolation=function(e,t,n,o){Fe.unpack(e,4*n,Je),Fe.conjugate(Je,Je);for(leti=0,s=n-t+1;i<s;i++){constn=3*i;Fe.unpack(e,4*(t+i),Ze),Fe.multiply(Ze,Je,Ze),Ze.w<0&&Fe.negate(Ze,Ze),Fe.computeAxis(Ze,He);consts=Fe.computeAngle(Ze);r.defined(o)||(o=[]),o[n]=He.x*s,o[n+1]=He.y*s,o[n+2]=He.z*s}},Fe.unpackInterpolationResult=function(e,n,o,i,s){r.defined(s)||(s=newFe),t.Cartesian3.fromArray(e,0,Ye);consta=t.Cartesian3.magnitude(Ye);returnFe.unpack(n,4*i,Ge),0===a?Fe.clone(Fe.IDENTITY,Ze):Fe.fromAxisAngle(Ye,a,Ze),Fe.multiply(Ze,Ge,s)},Fe.clone=function(e,t){if(r.defined(e))returnr.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):newFe(e.x,e.y,e.z,e.w)},Fe.conjugate=function(e,t){returnn.Check.typeOf.object("quaternion",e),n.Check.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},Fe.magnitudeSquared=function(e){returnn.Check.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Fe.magnitude=function(e){returnMath.sqrt(Fe.magnitudeSquared(e))},Fe.normalize=function(e,t){n.Check.typeOf.object("result",t);constr=1/Fe.magnitude(e),o=e.x*r,i=e.y*r,s=e.z*r,a=e.w*r;returnt.x=o,t.y=i,t.z=s,t.w=a,t},Fe.inverse=function(e,t){n.Check.typeOf.object("result",t);constr=Fe.magnitudeSquared(e);returnt=Fe.conjugate(e,t),Fe.multiplyByScalar(t,1/r,t)},Fe.add=function(e,t,r){returnn.Check.typeOf.object("left",e),n.Check.typeOf.object("right",t),n.Check.typeOf.object("result",r),r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},Fe.subtract=function(e,t,r){returnn.Check.typeOf.object("left",e),n.Check.typeOf.object("right",t),n.Check.typeOf.object("result",r),r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},Fe.negate=function(e,t){returnn.Check.typeOf.object("quaternion",e),n.Check.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Fe.dot=function(e,t){returnn.Check.typeOf.object("left",e),n.Check.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Fe.multiply=function(e,t,r){n.Check.typeOf.object("left",e),n.Check.typeOf.object("right",t),n.Check.typeOf.object("result",r);consto=e.x,i=e.y,s=e.z,a=e.w,u=t.x,c=t.y,l=t.z,d=t.w,f=a*u+o*d+i*l-s*c,p=a*c-o*l+i*d+s*u,h=a*l+o*c-i*u+s*d,m=a*d-o*u-i*c-s*l;returnr.x=f,r.y=p,r.z=h,r.w=m,r},Fe.multiplyByScalar=function(e,t,r){returnn.Check.typeOf.object("quaternion",e),n.Check.typeOf.number("scalar",t),n.Check.typeOf.object("result",r),r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},Fe.divideByScalar=function(e,t,r){returnn.Check.typeOf.object("quaternion",e),n.Check.typeOf.number("scalar",t),n.Check.typeOf.object("result",r),r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},Fe.computeAxis=function(e,t){n.Check.typeOf.object("quaternion",e),n.Check.typeOf.object("result",t);constr=e.w;if(Math.abs(r-1)<o.CesiumMath.EPSILON6)returnt.x=t.y=t.z=0,t;consti=1/Math.sqrt(1-r*r);returnt.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},Fe.computeAngle=function(e){returnn.Check.typeOf.object("quaternion",e),Math.abs(e.w-1)<o.CesiumMath.EPSILON6?0:2*Math.acos(e.w)};letXe=newFe;Fe.lerp=function(e,t,r,o){returnn.Check.typeOf.object("start",e),n.Check.typeOf.object("end",t),n.Check.typeOf.number("t",r),n.Check.typeOf.object("result",o),Xe=Fe.multiplyByScalar(t,r,Xe),o=Fe.multiplyByScalar(e,1-r,o),Fe.add(Xe,o,o)};letKe=newFe,et=newFe,tt=newFe;Fe.slerp=function(e,t,r,i){n.Check.typeOf.object("start",e),n.Check.typeOf.object("end",t),n.Check.typeOf.number("t",r),n.Check.typeOf.object("result",i);lets=Fe.dot(e,t),a=t;if(s<0&&(s=-s,a=Ke=Fe.negate(t,Ke)),1-s<o.CesiumMath.EPSILON6)returnFe.lerp(e,a,r,i);constu=Math.acos(s);returnet=Fe.multiplyByScalar(e,Math.sin((1-r)*u),et),tt=Fe.multiplyByScalar(a,Math.sin(r*u),tt),i=Fe.add(et,tt,i),Fe.multiplyByScalar(i,1/Math.sin(u),i)},Fe.log=function(e,r){n.Check.typeOf.object("quaternion",e),n.Check.typeOf.object("result",r);consti=o.CesiumMath.acosClamped(e.w);lets=0;return0!==i&&(s=i/Math.sin(i)),t.Cartesian3.multiplyByScalar(e,s,r)},Fe.exp=function(e,r){n.Check.typeOf.object("cartesian",e),n.Check.typeOf.object("result",r);consto=t.Cartesian3.magnitude(e);leti=0;return0!==o&&(i=Math.sin(o)/o),r.x=e.x*i,r.y=e.y*i,r.z=e.z*i,r.w=Math.cos(o),r};constnt=newt.Cartesian3,rt=newt.Cartesian3,ot=newFe,it=newFe;Fe.computeInnerQuadrangle=function(e,r,o,i){n.Check.typeOf.object("q0",e),n.Check.typeOf.object("q1",r),n.Check.typeOf.object("q2",o),n.Check.typeOf.object("result",i);consts=Fe.conjugate(r,ot);Fe.multiply(s,o,it);consta=Fe.log(it,nt);Fe.multiply(s,e,it);constu=Fe.log(it,rt);returnt.Cartesian3.add(a,u,a),t.Cartesian3.multiplyByScalar(a,.25,a),t.Cartesian3.negate(a,a),Fe.exp(a,ot),Fe.multiply(r,ot,i)},Fe.squad=function(e,t,r,o,i,s){n.Check.typeOf.object("q0",e),n.Check.typeOf.object("q1",t),n.Check.typeOf.object("s0",r),n.Check.typeOf.object("s1",o),n.Check.typeOf.number("t",i),n.Check.typeOf.object("result",s);consta=Fe.slerp(e,t,i,ot),u=Fe.slerp(r,o,i,it);returnFe.slerp(a,u,2*i*(1-i),s)};constst=newFe,at=1.9011074535173003,ut=je.supportsTypedArrays()?newFloat32Array(8):[],ct=je.supportsTypedArrays()?newFloat32Array(8):[],lt=je.supportsTypedArrays()?newFloat32Array(8):[],dt=je.supportsTypedArrays()?newFloat32Array(8):[];for(letmo=0;mo<7;++mo){conste=mo+1,t=2*e+1;ut[mo]=1/(e*t),ct[mo]=e/t}functionft(e,t,r){n.Check.defined("array",e),n.Check.defined("itemToFind",t),n.Check.defined("comparator",r);leto,i,s=0,a=e.length-1;while(s<=a)if(o=~~((s+a)/2),i=r(e[o],t),i<0)s=o+1;else{if(!(i>0))returno;a=o-1}return~(a+1)}functionpt(e,t,n,r,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=o}functionht(e,t,n,r,o,i,s,a){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=o,this.second=i,this.millisecond=s,this.isLeapSecond=a}functionmt(e){if(null===e||isNaN(e))thrownewn.DeveloperError("year is required and must be a number.");returne%4===0&&e%100!==0||e%400===0}functiongt(e,t){this.julianDate=e,this.offset=t}ut[7]=at/136,ct[7]=8*at/17,Fe.fastSlerp=function(e,t,r,o){n.Check.typeOf.object("start",e),n.Check.typeOf.object("end",t),n.Check.typeOf.number("t",r),n.Check.typeOf.object("result",o);leti,s=Fe.dot(e,t);s>=0?i=1:(i=-1,s=-s);consta=s-1,u=1-r,c=r*r,l=u*u;for(letn=7;n>=0;--n)lt[n]=(ut[n]*c-ct[n])*a,dt[n]=(ut[n]*l-ct[n])*a;constd=i*r*(1+lt[0]*(1+lt[1]*(1+lt[2]*(1+lt[3]*(1+lt[4]*(1+lt[5]*(1+lt[6]*(1+lt[7])))))))),f=u*(1+dt[0]*(1+dt[1]*(1+dt[2]*(1+dt[3]*(1+dt[4]*(1+dt[5]*(1+dt[6]*(1+dt[7])))))))),p=Fe.multiplyByScalar(e,f,st);returnFe.multiplyByScalar(t,d,o),Fe.add(p,o,o)},Fe.fastSquad=function(e,t,r,o,i,s){n.Check.typeOf.object("q0",e),n.Check.typeOf.object("q1",t),n.Check.typeOf.object("s0",r),n.Check.typeOf.object("s1",o),n.Check.typeOf.number("t",i),n.Check.typeOf.object("result",s);consta=Fe.fastSlerp(e,t,i,ot),u=Fe.fastSlerp(r,o,i,it);returnFe.fastSlerp(a,u,2*i*(1-i),s)},Fe.equals=function(e,t){returne===t||r.defined(e)&&r.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Fe.equalsEpsilon=function(e,t,n){returnn=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},Fe.ZERO=Object.freeze(newFe(0,0,0,0)),Fe.IDENTITY=Object.freeze(newFe(0,0,0,1)),Fe.prototype.clone=function(e){returnFe.clone(this,e)},Fe.prototype.equals=function(e){returnFe.equals(this,e)},Fe.prototype.equalsEpsilon=function(e,t){returnFe.equalsEpsilon(this,e,t)},Fe.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};constyt={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};varvt=Object.freeze(yt);constwt={UTC:0,TAI:1};varCt=Object.freeze(wt);constbt=newht,_t=[31,28,31,30,31,30,31,31,30,31,30,31],xt=29;functionEt(e,t){returnNt.compare(e.julianDate,t.julianDate)}constOt=newgt;functionSt(e){Ot.julianDate=e;constt=Nt.leapSeconds;letn=ft(t,Ot,Et);n<0&&(n=~n),n>=t.length&&(n=t.length-1);letr=t[n].offset;if(n>0){consto=Nt.secondsDifference(t[n].julianDate,e);o>r&&(n--,r=t[n].offset)}Nt.addSeconds(e,r,e)}functionAt(e,t){Ot.julianDate=e;constn=Nt.leapSeconds;letr=ft(n,Ot,Et);if(r<0&&(r=~r),0===r)returnNt.addSeconds(e,-n[0].offset,t);if(r>=n.length)returnNt.addSeconds(e,-n[r-1].offset,t);consto=Nt.secondsDifference(n[r].julianDate,e);return0===o?Nt.addSeconds(e,-n[r].offset,t):o<=1?void0:Nt.addSeconds(e,-n[--r].offset,t)}functionqt(e,t,n){constr=t/vt.SECONDS_PER_DAY|0;returne+=r,t-=vt.SECONDS_PER_DAY*r,t<0&&(e--,t+=vt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}functionkt(e,t,n,r,o,i,s){consta=(t-14)/12|0,u=e+4800+a;letc=(1461*u/4|0)+(367*(t-2-12*a)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);constl=i+(r*vt.SECONDS_PER_HOUR+o*vt.SECONDS_PER_MINUTE+s*vt.SECONDS_PER_MILLISECOND);returnl>=43200&&(c-=1),[c,l]}constDt=/^(\d{4})$/,It=/^(\d{4})-(\d{2})$/,Pt=/^(\d{4})-?(\d{3})$/,Rt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Tt=/^(\d{4})-?(\d{2})-?(\d{2})$/,zt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Mt=/^(\d{2})(\.\d+)?/.source+zt.source,Ut=/^(\d{2}):?(\d{2})(\.\d+)?/.source+zt.source,jt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+zt.source,Ft="Invalid ISO 8601 date.";functionNt(e,t,n){this.dayNumber=void0,this.secondsOfDay=void0,e=r.defaultValue(e,0),t=r.defaultValue(t,0),n=r.defaultValue(n,Ct.UTC);consto=0|e;t+=(e-o)*vt.SECONDS_PER_DAY,qt(o,t,this),n===Ct.UTC&&St(this)}Nt.fromGregorianDate=function(e,t){if(!(einstanceofht))thrownewn.DeveloperError("date must be a valid GregorianDate.");consto=kt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);returnr.defined(t)?(qt(o[0],o[1],t),St(t),t):newNt(o[0],o[1],Ct.UTC)},Nt.fromDate=function(e,t){if(!(einstanceofDate)||isNaN(e.getTime()))thrownewn.DeveloperError("date must be a valid JavaScript Date.");consto=kt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());returnr.defined(t)?(qt(o[0],o[1],t),St(t),t):newNt(o[0],o[1],Ct.UTC)},Nt.fromIso8601=function(e,t){if("string"!==typeofe)thrownewn.DeveloperError(Ft);e=e.replace(",",".");leto,i=e.split("T"),s=1,a=1,u=0,c=0,l=0,d=0;constf=i[0],p=i[1];leth,m,g,y;if(!r.defined(f))thrownewn.DeveloperError(Ft);if(i=f.match(Tt),null!==i){if(g=f.split("-").length-1,g>0&&2!==g)thrownewn.DeveloperError(Ft);o=+i[1],s=+i[2],a=+i[3]}elseif(i=f.match(It),null!==i)o=+i[1],s=+i[2];elseif(i=f.match(Dt),null!==i)o=+i[1];else{lete;if(i=f.match(Pt),null!==i){if(o=+i[1],e=+i[2],m=mt(o),e<1||m&&e>366||!m&&e>365)thrownewn.DeveloperError(Ft)}else{if(i=f.match(Rt),null===i)thrownewn.DeveloperError(Ft);{o=+i[1];constt=+i[2],s=+i[3]||0;if(g=f.split("-").length-1,g>0&&(!r.defined(i[3])&&1!==g||r.defined(i[3])&&2!==g))thrownewn.DeveloperError(Ft);consta=newDate(Date.UTC(o,0,4));e=7*t+s-a.getUTCDay()-3}}h=newDate(Date.UTC(o,0,1)),h.setUTCDate(e),s=h.getUTCMonth()+1,a=h.getUTCDate()}if(m=mt(o),s<1||s>12||a<1||(2!==s||!m)&&a>_t[s-1]||m&&2===s&&a>xt)thrownewn.DeveloperError(Ft);if(r.defined(p)){if(i=p.match(jt),null!==i){if(g=p.split(":").length-1,g>0&&2!==g&&3!==g)thrownewn.DeveloperError(Ft);u=+i[1],c=+i[2],l=+i[3],d=1e3*+(i[4]||0),y=5}elseif(i=p.match(Ut),null!==i){if(g=p.split(":").length-1,g>2)thrownewn.DeveloperError(Ft);u=+i[1],c=+i[2],l=60*+(i[3]||0),y=4}else{if(i=p.match(Mt),null===i)thrownewn.DeveloperError(Ft);u=+i[1],c=60*+(i[2]||0),y=3}if(c>=60||l>=61||u>24||24===u&&(c>0||l>0||d>0))thrownewn.DeveloperError(Ft);conste=i[y],t=+i[y+1],r=+(i[y+2]||0);switch(e){case"+":u-=t,c-=r;break;case"-":u+=t,c+=r;break;case"Z":break;default:c+=newDate(Date.UTC(o,s-1,a,u,c)).getTimezoneOffset();break}}constv=60===l;v&&l--;while(c>=60)c-=60,u++;while(u>=24)u-=24,a++;h=m&&2===s?xt:_t[s-1];while(a>h)a-=h,s++,s>12&&(s-=12,o++),h=m&&2===s?xt:_t[s-1];while(c<0)c+=60,u--;while(u<0)u+=24,a--;while(a<1)s--,s<1&&(s+=12,o--),h=m&&2===s?xt:_t[s-1],a+=h;constw=kt(o,s,a,u,c,l,d);returnr.defined(t)?(qt(w[0],w[1],t),St(t)):t=newNt(w[0],w[1],Ct.UTC),v&&Nt.addSeconds(t,1,t),t},Nt.now=function(e){returnNt.fromDate(newDate,e)};constBt=newNt(0,0,Ct.TAI);Nt.toGregorianDate=function(e,t){if(!r.defined(e))thrownewn.DeveloperError("julianDate is required.");leto=!1,i=At(e,Bt);r.defined(i)||(Nt.addSeconds(e,-1,Bt),i=At(Bt,Bt),o=!0);lets=i.dayNumber;consta=i.secondsOfDay;a>=43200&&(s+=1);letu=s+68569|0;constc=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;constl=4e3*(u+1)/1461001|0;u=u-(1461*l/4|0)+31|0;constd=80*u/2447|0,f=u-(2447*d/80|0)|0;u=d/11|0;constp=d+2-12*u|0,h=100*(c-49)+l+u|0;letm=a/vt.SECONDS_PER_HOUR|0,g=a-m*vt.SECONDS_PER_HOUR;consty=g/vt.SECONDS_PER_MINUTE|0;g-=y*vt.SECONDS_PER_MINUTE;letv=0|g;constw=(g-v)/vt.SECONDS_PER_MILLISECOND;returnm+=12,m>23&&(m-=24),o&&(v+=1),r.defined(t)?(t.year=h,t.month=p,t.day=f,t.hour=m,t.minute=y,t.second=v,t.millisecond=w,t.isLeapSecond=o,t):newht(h,p,f,m,y,v,w,o)},Nt.toDate=function(e){if(!r.defined(e))thrownewn.DeveloperError("julianDate is required.");constt=Nt.toGregorianDate(e,bt);leto=t.second;returnt.isLeapSecond&&(o-=1),newDate(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,o,t.millisecond))},Nt.toIso8601=function(e,t){if(!r.defined(e))thrownewn.DeveloperError("julianDate is required.");consto=Nt.toGregorianDate(e,bt);leti=o.year,s=o.month,a=o.day,u=o.hour;constc=o.minute,l=o.second,d=o.millisecond;letf;return1e4===i&&1===s&&1===a&&0===u&&0===c&&0===l&&0===d&&(i=9999,s=12,a=31,u=24),r.defined(t)||0===d?r.defined(t)&&0!==t?(f=(.01*d).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${f}Z`):`${i.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(f=(.01*d).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${f}Z`)},Nt.clone=function(e,t){if(r.defined(e))returnr.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):newNt(e.dayNumber,e.secondsOfDay,Ct.TAI)},Nt.compare=function(e,t){if(!r.defined(e))thrownewn.DeveloperError("left is required.");if(!r.defined(t))thrownewn.DeveloperError("right is required.");consto=e.dayNumber-t.dayNumber;return0!==o?o:e.secondsOfDay-t.secondsOfDay},Nt.equals=function(e,t){returne===t||r.defined(e)&&r.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},Nt.equalsEpsilon=function(e,t,n){returnn=r.defaultValue(n,0),e===t||r.defined(e)&&r.defined(t)&&Math.abs(Nt.secondsDifference(e,t))<=n},Nt.totalDays=function(e){if(!r.defined(e))thrownewn.DeveloperError("julianDate is required.");returne.dayNumber+e.secondsOfDay/vt.SECONDS_PER_DAY},Nt.secondsDifference=function(e,t){if(!r.defined(e))thrownewn.DeveloperError("left is required.");if(!r.defined(t))thrownewn.DeveloperError("right is required.");consto=(e.dayNumber-t.dayNumber)*vt.SECONDS_PER_DAY;returno+(e.secondsOfDay-t.secondsOfDay)},Nt.daysDifference=function(e,t){if(!r.defined(e))thrownewn.DeveloperError("left is required.");if(!r.defined(t))thrownewn.DeveloperError("right is required.");consto=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/vt.SECONDS_PER_DAY;returno+i},Nt.computeTaiMinusUtc=function(e){Ot.julianDate=e;constt=Nt.leapSeconds;letn=ft(t,Ot,Et);returnn<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},Nt.addSeconds=function(e,t,o){if(!r.defined(e))thrownewn.DeveloperError("julianDate is required.");if(!r.defined(t))thrownewn.DeveloperError("seconds is required.");if(!r.defined(o))thrownewn.DeveloperError("result is required.");returnqt(e.dayNumber,e.secondsOfDay+t,o)},Nt.addMinutes=function(e,t,o){if(!r.defined(e))thrownewn.DeveloperError("julianDate is required.");if(!r.defined(t))thrownewn.DeveloperError("minutes is required.");if(!r.defined(o))thrownewn.DeveloperError("result is required.");consti=e.secondsOfDay+t*vt.SECONDS_PER_MINUTE;returnqt(e.dayNumber,i,o)},Nt.addHours=function(e,t,o){if(!r.defined(e))thrownewn.DeveloperError("julianDate is required.");if(!r.defined(t))thrownewn.DeveloperError("hours is required.");if(!r.defined(o))thrownewn.DeveloperError("result is required.");consti=e.secondsOfDay+t*vt.SECONDS_PER_HOUR;returnqt(e.dayNumber,i,o)},Nt.addDays=function(e,t,o){if(!r.defined(e))thrownewn.DeveloperError("julianDate is required.");if(!r.defined(t))thrownewn.DeveloperError("days is required.");if(!r.defined(o))thrownewn.DeveloperError("result is required.");consti=e.dayNumber+t;returnqt(i,e.secondsOfDay,o)},Nt.lessThan=function(e,t){returnNt.compare(e,t)<0},Nt.lessThanOrEquals=function(e,t){returnNt.compare(e,t)<=0},Nt.greaterThan=function(e,t){returnNt.compare(e,t)>0},Nt.greaterThanOrEquals=function(e,t){returnNt.compare(e,t)>=0},Nt.prototype.clone=function(e){returnNt.clone(this,e)},Nt.prototype.equals=function(e){returnNt.equals(this,e)},Nt.prototype.equalsEpsilon=function(e,t){returnNt.equalsEpsilon(this,e,t)},Nt.prototype.toString=function(){returnNt.toIso8601(this)},Nt.leapSeconds=[newgt(newNt(2441317,43210,Ct.TAI),10),newgt(newNt(2441499,43211,Ct.TAI),11),newgt(newNt(2441683,43212,Ct.TAI),12),newgt(newNt(2442048,43213,Ct.TAI),13),newgt(newNt(2442413,43214,Ct.TAI),14),newgt(newNt(2442778,43215,Ct.TAI),15),newgt(newNt(2443144,43216,Ct.TAI),16),newgt(newNt(2443509,43217,Ct.TAI),17),newgt(newNt(2443874,43218,Ct.TAI),18),newgt(newNt(2444239,43219,Ct.TAI),19),newgt(newNt(2444786,43220,Ct.TAI),20),newgt(newNt(2445151,43221,Ct.TAI),21),newgt(newNt(2445516,43222,Ct.TAI),22),newgt(newNt(2446247,43223,Ct.TAI),23),newgt(newNt(2447161,43224,Ct.TAI),24),newgt(newNt(2447892,43225,Ct.TAI),25),newgt(newNt(2448257,43226,Ct.TAI),26),newgt(newNt(2448804,43227,Ct.TAI),27),newgt(newNt(2449169,43228,Ct.TAI),28),newgt(newNt(2449534,43229,Ct.TAI),29),newgt(newNt(2450083,43230,Ct.TAI),30),newgt(newNt(2450630,43231,Ct.TAI),31),newgt(newNt(2451179,43232,Ct.TAI),32),newgt(newNt(2453736,43233,Ct.TAI),33),newgt(newNt(2454832,43234,Ct.TAI),34),newgt(newNt(2456109,43235,Ct.TAI),35),newgt(newNt(2457204,43236,Ct.TAI),36),newgt(newNt(2457754,43237,Ct.TAI),37)];varVt=i.createCommonjsModule((function(e,t){(function(n){varr=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,s="object"==typeofi.commonjsGlobal&&i.commonjsGlobal;s.global!==s&&s.window!==s&&s.self!==s||(n=s);vara,u,c=2147483647,l=36,d=1,f=26,p=38,h=700,m=72,g=128,y="-",v=/^xn--/,w=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=l-d,x=Math.floor,E=String.fromCharCode;functionO(e){thrownewRangeError(b[e])}functionS(e,t){varn=e.length,r=[];while(n--)r[n]=t(e[n]);returnr}functionA(e,t){varn=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(C,".");varo=e.split("."),i=S(o,t).join(".");returnr+i}functionq(e){vart,n,r=[],o=0,i=e.length;while(o<i)t=e.charCodeAt(o++),t>=55296&&t<=56319&&o<i?(n=e.charCodeAt(o++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--)):r.push(t);returnr}functionk(e){returnS(e,(function(e){vart="";returne>65535&&(e-=65536,t+=E(e>>>10&1023|55296),e=56320|1023&e),t+=E(e),t})).join("")}functionD(e){returne-48<10?e-22:e-65<26?e-65:e-97<26?e-97:l}functionI(e,t){returne+22+75*(e<26)-((0!=t)<<5)}functionP(e,t,n){varr=0;for(e=n?x(e/h):e>>1,e+=x(e/t);e>_*f>>1;r+=l)e=x(e/_);returnx(r+(_+1)*e/(e+p))}functionR(e){vart,n,r,o,i,s,a,u,p,h,v=[],w=e.length,C=0,b=g,_=m;for(n=e.lastIndexOf(y),n<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&O("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<w;){for(i=C,s=1,a=l;;a+=l){if(o>=w&&O("invalid-input"),u=D(e.charCodeAt(o++)),(u>=l||u>x((c-C)/s))&&O("overflow"),C+=u*s,p=a<=_?d:a>=_+f?f:a-_,u<p)break;h=l-p,s>x(c/h)&&O("overflow"),s*=h}t=v.length+1,_=P(C-i,t,0==i),x(C/t)>c-b&&O("overflow"),b+=x(C/t),C%=t,v.splice(C++,0,b)}returnk(v)}functionT(e){vart,n,r,o,i,s,a,u,p,h,v,w,C,b,_,S=[];for(e=q(e),w=e.length,t=g,n=0,i=m,s=0;s<w;++s)v=e[s],v<128&&S.push(E(v));r=o=S.length,o&&S.push(y);while(r<w){for(a=c,s=0;s<w;++s)v=e[s],v>=t&&v<a&&(a=v);for(C=r+1,a-t>x((c-n)/C)&&O("overflow"),n+=(a-t)*C,t=a,s=0;s<w;++s)if(v=e[s],v<t&&++n>c&&O("overflow"),v==t){for(u=n,p=l;;p+=l){if(h=p<=i?d:p>=i+f?f:p-i,u<h)break;_=u-h,b=l-h,S.push(E(I(h+_%b,0))),u=x(_/b)}S.push(E(I(u,0))),i=P(n,C,r==o),n=0,++r}++n,++t}returnS.join("")}functionz(e){returnA(e,(function(e){returnv.test(e)?R(e.slice(4).toLowerCase()):e}))}functionM(e){returnA(e,(function(e){returnw.test(e)?"xn--"+T(e):e}))}if(a={version:"1.3.2",ucs2:{decode:q,encode:k},decode:R,encode:T,toASCII:M,toUnicode:z},r&&o)if(e.exports==r)o.exports=a;elsefor(uina)a.hasOwnProperty(u)&&(r[u]=a[u]);elsen.punycode=a})(i.commonjsGlobal)})),Lt=i.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
* IPv6 Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
(function(t,n){e.exports?e.exports=n():t.SecondLevelDomains=n(t)})(i.commonjsGlobal,(function(e){vart=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){vart=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;varr=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;varo=n.list[e.slice(t+1)];return!!o&&o.indexOf(""+e.slice(r+1,t)+"")>=0},is:function(e){vart=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;varr=e.lastIndexOf(".",t-1);if(r>=0)return!1;varo=n.list[e.slice(t+1)];return!!o&&o.indexOf(""+e.slice(0,t)+"")>=0},get:function(e){vart=e.lastIndexOf(".");if(t<=0||t>=e.length-1)returnnull;varr=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)returnnull;varo=n.list[e.slice(t+1)];returno?o.indexOf(""+e.slice(r+1,t)+"")<0?null:e.slice(r+1):null},noConflict:function(){returne.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};returnn}))})),$t=i.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
(function(t,n){e.exports?e.exports=n(Vt,Lt,Qt):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(i.commonjsGlobal,(function(e,t,n,r){varo=r&&r.URI;functioni(e,t){varn=arguments.length>=1,r=arguments.length>=2;if(!(thisinstanceofi))returnn?r?newi(e,t):newi(e):newi;if(void0===e){if(n)thrownewTypeError("undefined is not a valid argument for URI");e="undefined"!==typeoflocation?location.href+"":""}if(null===e&&n)thrownewTypeError("null is not a valid argument for URI");returnthis.href(e),void0!==t?this.absoluteTo(t):this}functions(e){return/^[0-9]+$/.test(e)}i.version="1.19.11";vara=i.prototype,u=Object.prototype.hasOwnProperty;functionc(e){returne.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}functionl(e){returnvoid0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}functiond(e){return"Array"===l(e)}functionf(e,t){varn,r,o={};if("RegExp"===l(t))o=null;elseif(d(t))for(n=0,r=t.length;n<r;n++)o[t[n]]=!0;elseo[t]=!0;for(n=0,r=e.length;n<r;n++){vari=o&&void0!==o[e[n]]||!o&&t.test(e[n]);i&&(e.splice(n,1),r--,n--)}returne}functionp(e,t){varn,r;if(d(t)){for(n=0,r=t.length;n<r;n++)if(!p(e,t[n]))return!1;return!0}varo=l(t);for(n=0,r=e.length;n<r;n++)if("RegExp"===o){if("string"===typeofe[n]&&e[n].match(t))return!0}elseif(e[n]===t)return!0;return!1}functionh(e,t){if(!d(e)||!d(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(varn=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}functionm(e){vart=/^\/+|\/+$/g;returne.replace(t,"")}functiong(e){returnescape(e)}functiony(e){returnencodeURIComponent(e).replace(/[!'()*]/g,g).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){vart=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)returni.domAttributes[t]}},i.encode=y,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=y,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){varn=i.encode(e+"");returnvoid0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void0===t&&(t=i.escapeQuerySpace);try{returni.decode(t?e.replace(/\+/g,"%20"):e)}catch(n){returne}};varv,w={encode:"encode",decode:"decode"},C=function(e,t){returnfunction(n){try{returni[t](n+"").replace(i.characters[e][t].expression,(function(n){returni.characters[e][t].map[n]}))}catch(r){returnn}}};for(vinw)i[v+"PathSegment"]=C("pathname",w[v]),i[v+"UrnPathSegment"]=C("urnpath",w[v]);varb=function(e,t,n){returnfunction(r){varo;o=n?function(e){returni[t](i[n](e))}:i[t];for(vars=(r+"").split(e),a=0,u=s.length;a<u;a++)s[a]=o(s[a]);returns.join(e)}};function_(e){returnfunction(t,n){returnvoid0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!n),this)}}functionx(e,t){returnfunction(n,r){returnvoid0===n?this._parts[e]||"":(null!==n&&(n+="",n.charAt(0)===t&&(n=n.substring(1))),this._parts[e]=n,this.build(!r),this)}}i.decodePath=b("/","decodePathSegment"),i.decodeUrnPath=b(":","decodeUrnPathSegment"),i.recodePath=b("/","encodePathSegment","decode"),i.recodeUrnPath=b(":","encodeUrnPathSegment","decode"),i.encodeReserved=C("reserved","encode"),i.parse=function(e,t){varn;returnt||(t={preventInvalidHostname:i.preventInvalidHostname}),e=e.replace(i.leading_whitespace_expression,""),e=e.replace(i.ascii_tab_whitespace,""),n=e.indexOf("#"),n>-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),n=e.indexOf("?"),n>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),e=e.replace(/^[/\\]{2,}/i,"//"),"//"===e.substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(":"),n>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void0:"//"===e.substring(n+1,n+3).replace(/\\/g,"/")?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0))),t.path=e,t},i.parseHost=function(e,t){e||(e=""),e=e.replace(/\\/g,"/");varn,r,o=e.indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,o)||null,"/"===t.port&&(t.port=null);else{vars=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",s+1);-1!==u&&(-1===a||u<a)?(t.hostname=e.substring(0,o)||null,t.port=null):(r=e.substring(0,o).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)}returnt.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){returne=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){varn=e,r=e.indexOf("\\");-1!==r&&(e=e.replace(/\\/g,"/"));varo,s=e.indexOf("/"),a=e.lastIndexOf("@",s>-1?s:e.length-1);returna>-1&&(-1===s||a<s)?(o=e.substring(0,a).split(":"),t.username=o[0]?i.decode(o[0]):null,o.shift(),t.password=o[0]?i.decode(o.join(":")):null,e=n.substring(a+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!e)return{};for(varn,r,o,s={},a=e.split("&"),c=a.length,l=0;l<c;l++)n=a[l].split("="),r=i.decodeQuery(n.shift(),t),o=n.length?i.decodeQuery(n.join("="),t):null,"__proto__"!==r&&(u.call(s,r)?("string"!==typeofs[r]&&null!==s[r]||(s[r]=[s[r]]),s[r].push(o)):s[r]=o);returns},i.build=function(e){vart="",n=!1;returne.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",n=!0),t+=i.buildAuthority(e)||"","string"===typeofe.path&&("/"!==e.path.charAt(0)&&n&&(t+="/"),t+=e.path),"string"===typeofe.query&&e.query&&(t+="?"+e.query),"string"===typeofe.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){vart="";returne.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){returni.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){vart="";returne.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,n){varr,o,s,a,c="";for(oine)if("__proto__"!==o&&u.call(e,o))if(d(e[o]))for(r={},s=0,a=e[o].length;s<a;s++)void0!==e[o][s]&&void0===r[e[o][s]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][s],n),!0!==t&&(r[e[o][s]+""]=!0));elsevoid0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],n));returnc.substring(1)},i.buildQueryParameter=function(e,t,n){returni.encodeQuery(e,n)+(null!==t?"="+i.encodeQuery(t,n):"")},i.addQuery=function(e,t,n){if("object"===typeoft)for(varrint)u.call(t,r)&&i.addQuery(e,r,t[r]);else{if("string"!==typeoft)thrownewTypeError("URI.addQuery() accepts an object, string as the name parameter");if(void0===e[t])returnvoid(e[t]=n);"string"===typeofe[t]&&(e[t]=[e[t]]),d(n)||(n=[n]),e[t]=(e[t]||[]).concat(n)}},i.setQuery=function(e,t,n){if("object"===typeoft)for(varrint)u.call(t,r)&&i.setQuery(e,r,t[r]);else{if("string"!==typeoft)thrownewTypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void0===n?null:n}},i.removeQuery=function(e,t,n){varr,o,s;if(d(t))for(r=0,o=t.length;r<o;r++)e[t[r]]=void0;elseif("RegExp"===l(t))for(sine)t.test(s)&&(e[s]=void0);elseif("object"===typeoft)for(sint)u.call(t,s)&&i.removeQuery(e,s,t[s]);else{if("string"!==typeoft)thrownewTypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void0!==n?"RegExp"===l(n)?!d(e[t])&&n.test(e[t])?e[t]=void0:e[t]=f(e[t],n):e[t]!==String(n)||d(n)&&1!==n.length?d(e[t])&&(e[t]=f(e[t],n)):e[t]=void0:e[t]=void0}},i.hasQuery=function(e,t,n,r){switch(l(t)){case"String":break;case"RegExp":for(varoine)if(u.call(e,o)&&t.test(o)&&(void0===n||i.hasQuery(e,o,n)))return!0;return!1;case"Object":for(varsint)if(u.call(t,s)&&!i.hasQuery(e,s,t[s]))return!1;return!0;default:thrownewTypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(n)){case"Undefined":returntine;case"Boolean":vara=Boolean(d(e[t])?e[t].length:e[t]);returnn===a;case"Function":return!!n(e[t],t,e);case"Array":if(!d(e[t]))return!1;varc=r?p:h;returnc(e[t],n);case"RegExp":returnd(e[t])?!!r&&p(e[t],n):Boolean(e[t]&&e[t].match(n));case"Number":n=String(n);case"String":returnd(e[t])?!!r&&p(e[t],n):e[t]===n;default:thrownewTypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(vare=[],t=[],n=0,r=0;r<arguments.length;r++){varo=newi(arguments[r]);e.push(o);for(vars=o.segment(),a=0;a<s.length;a++)"string"===typeofs[a]&&t.push(s[a]),s[a]&&n++}if(!t.length||!n)returnnewi("");varu=newi("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){varn,r=Math.min(e.length,t.length);for(n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n)){n--;break}returnn<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(n)&&"/"===t.charAt(n)||(n=e.substring(0,n).lastIndexOf("/")),e.substring(0,n+1))},i.withinString=function(e,t,n){n||(n={});varr=n.start||i.findUri.start,o=n.end||i.findUri.end,s=n.trim||i.findUri.trim,a=n.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;r.lastIndex=0;while(1){varc=r.exec(e);if(!c)break;varl=c.index;if(n.ignoreHtml){vard=e.slice(Math.max(l-3,0),l);if(d&&u.test(d))continue}varf=l+e.slice(l).search(o),p=e.slice(l,f),h=-1;while(1){varm=a.exec(p);if(!m)break;varg=m.index+m[0].length;h=Math.max(h,g)}if(p=h>-1?p.slice(0,h)+p.slice(h).replace(s,""):p.replace(s,""),!(p.length<=c[0].length)&&(!n.ignore||!n.ignore.test(p))){f=l+p.length;vary=t(p,l,f,e);void0!==y?(y=String(y),e=e.slice(0,l)+y+e.slice(f),r.lastIndex=l+y.length):r.lastIndex=f}}returnr.lastIndex=0,e},i.ensureValidHostname=function(t,n){varr=!!t,o=!!n,s=!1;if(o&&(s=p(i.hostProtocols,n)),s&&!r)thrownewTypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)thrownewTypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))thrownewTypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){vart=Number(e);if(!(s(t)&&t>0&&t<65536))thrownewTypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){vart={URI:this.noConflict()};returnr.URITemplate&&"function"===typeofr.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"===typeofr.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"===typeofr.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}returnr.URI===this&&(r.URI=o),this},a.build=function(e){return!0===e?this._deferred_build=!0:(void0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},a.clone=function(){returnnewi(this)},a.valueOf=a.toString=function(){returnthis.build(!1)._string},a.protocol=_("protocol"),a.username=_("username"),a.password=_("password"),a.hostname=_("hostname"),a.port=_("port"),a.query=x("query","?"),a.fragment=x("fragment","#"),a.search=function(e,t){varn=this.query(e,t);return"string"===typeofn&&n.length?"?"+n:n},a.hash=function(e,t){varn=this.fragment(e,t);return"string"===typeofn&&n.length?"#"+n:n},a.pathname=function(e,t){if(void0===e||!0===e){varn=this._parts.path||(this._parts.hostname?"/":"");returne?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}returnthis._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},a.path=a.pathname,a.href=function(e,t){varn;if(void0===e)returnthis.toString();this._string="",this._parts=i._parts();varr=einstanceofi,o="object"===typeofe&&(e.hostname||e.path||e.pathname);if(e.nodeName){vars=i.getDomAttribute(e);e=e[s]||"",o=!1}if(!r&&o&&void0!==e.pathname&&(e=e.toString()),"string"===typeofe||einstanceofString)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)thrownewTypeError("invalid input");vara=r?e._parts:e;for(nina)"query"!==n&&u.call(this._parts,n)&&(this._parts[n]=a[n]);a.query&&this.query(a.query,!1)}returnthis.build(!t),this},a.is=function(e){vart=!1,r=!1,o=!1,s=!1,a=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,r=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),t=r||o,s=!t,a=s&&n&&n.has(this._parts.hostname),u=s&&i.idn_expression.test(this._parts.hostname),c=s&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":returnl;case"absolute":return!l;case"domain":case"name":returns;case"sld":returna;case"ip":returnt;case"ip4":case"ipv4":case"inet4":returnr;case"ip6":case"ipv6":case"inet6":returno;case"idn":returnu;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":returnc}returnnull};varE=a.protocol,O=a.port,S=a.hostname;a.protocol=function(e,t){if(e&&(e=e.replace(/:(\/\/)?$/,""),!e.match(i.protocol_expression)))thrownewTypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");returnE.call(this,e,t)},a.scheme=a.protocol,a.port=function(e,t){returnthis._parts.urn?void0===e?"":this:(void0!==e&&(0===e&&(e=null),e&&(e+="",":"===e.charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),O.call(this,e,t))},a.hostname=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0!==e){varn={preventInvalidHostname:this._parts.preventInvalidHostname},r=i.parseHost(e,n);if("/"!==r)thrownewTypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}returnS.call(this,e,t)},a.origin=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e){varn=this.protocol(),r=this.authority();returnr?(n?n+"://":"")+this.authority():""}varo=i(e);returnthis.protocol(o.protocol()).authority(o.authority()).build(!t),this},a.host=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e)returnthis._parts.hostname?i.buildHost(this._parts):"";varn=i.parseHost(e,this._parts);if("/"!==n)thrownewTypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');returnthis.build(!t),this},a.authority=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e)returnthis._parts.hostname?i.buildAuthority(this._parts):"";varn=i.parseAuthority(e,this._parts);if("/"!==n)thrownewTypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');returnthis.build(!t),this},a.userinfo=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e){varn=i.buildUserinfo(this._parts);returnn?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},a.resource=function(e,t){varn;returnvoid0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},a.subdomain=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e){if(!this._parts.hostname||this.is("IP"))return"";varn=this._parts.hostname.length-this.domain().length-1;returnthis._parts.hostname.substring(0,n)||""}varr=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),s=newRegExp("^"+c(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))thrownewTypeError("Domains cannot contain colons");returne&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(s,e),this.build(!t),this},a.domain=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if("boolean"===typeofe&&(t=e,e=void0),void0===e){if(!this._parts.hostname||this.is("IP"))return"";varn=this._parts.hostname.match(/\./g);if(n&&n.length<2)returnthis._parts.hostname;varr=this._parts.hostname.length-this.tld(t).length-1;returnr=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)thrownewTypeError("cannot set domain empty");if(-1!==e.indexOf(":"))thrownewTypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{varo=newRegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}returnthis.build(!t),this},a.tld=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if("boolean"===typeofe&&(t=e,e=void0),void0===e){if(!this._parts.hostname||this.is("IP"))return"";varr=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}vari;if(!e)thrownewTypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))thrownewTypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=newRegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))thrownewReferenceError("cannot set TLD on non-domain host");i=newRegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}returnthis.build(!t),this},a.directory=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";varn=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");returne?i.decodePath(r):r}varo=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,o),a=newRegExp("^"+c(s));returnthis.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},a.filename=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if("string"!==typeofe){if(!this._parts.path||"/"===this._parts.path)return"";varn=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);returne?i.decodePathSegment(r):r}varo=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);vars=newRegExp(c(this.filename())+"$");returne=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),o?this.normalizePath(t):this.build(!t),this},a.suffix=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";varn,r,o=this.filename(),s=o.lastIndexOf(".");return-1===s?"":(n=o.substring(s+1),r=/^[a-z0-9%]+$/i.test(n)?n:"",e?i.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));vara,u=this.suffix();if(u)a=e?newRegExp(c(u)+"$"):newRegExp(c("."+u)+"$");else{if(!e)returnthis;this._parts.path+="."+i.recodePath(e)}returna&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},a.segment=function(e,t,n){varr=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),s=o.split(r);if(void0!==e&&"number"!==typeofe&&(n=t,t=e,e=void0),void0!==e&&"number"!==typeofe)thrownewError('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void0===t)returnvoid0===e?s:s[e];if(null===e||void0===s[e])if(d(t)){s=[];for(vara=0,u=t.length;a<u;a++)(t[a].length||s.length&&s[s.length-1].length)&&(s.length&&!s[s.length-1].length&&s.pop(),s.push(m(t[a])))}else(t||"string"===typeoft)&&(t=m(t),""===s[s.length-1]?s[s.length-1]=t:s.push(t));elset?s[e]=m(t):s.splice(e,1);returni&&s.unshift(""),this.path(s.join(r),n)},a.segmentCoded=function(e,t,n){varr,o,s;if("number"!==typeofe&&(n=t,t=e,e=void0),void0===t){if(r=this.segment(e,t,n),d(r))for(o=0,s=r.length;o<s;o++)r[o]=i.decode(r[o]);elser=void0!==r?i.decode(r):void0;returnr}if(d(t))for(o=0,s=t.length;o<s;o++)t[o]=i.encode(t[o]);elset="string"===typeoft||tinstanceofString?i.encode(t):t;returnthis.segment(e,t,n)};varA=a.query;returna.query=function(e,t){if(!0===e)returni.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"===typeofe){varn=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=e.call(this,n);returnthis._parts.query=i.buildQuery(r||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}returnvoid0!==e&&"string"!==typeofe?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):A.call(this,e,t)},a.setQuery=function(e,t,n){varr=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"===typeofe||einstanceofString)r[e]=void0!==t?t:null;else{if("object"!==typeofe)thrownewTypeError("URI.addQuery() accepts an object, string as the name parameter");for(varoine)u.call(e,o)&&(r[o]=e[o])}returnthis._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!==typeofe&&(n=t),this.build(!n),this},a.addQuery=function(e,t,n){varr=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returni.addQuery(r,e,void0===t?null:t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!==typeofe&&(n=t),this.build(!n),this},a.removeQuery=function(e,t,n){varr=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returni.removeQuery(r,e,t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!==typeofe&&(n=t),this.build(!n),this},a.hasQuery=function(e,t,n){varr=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returni.hasQuery(r,e,t,n)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){returnthis._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(e){return"string"===typeofthis._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},a.normalizeHostname=function(n){returnthis._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!n)),this},a.normalizePort=function(e){return"string"===typeofthis._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},a.normalizePath=function(e){vart,n=this._parts.path;if(!n)returnthis;if(this._parts.urn)returnthis._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)returnthis;n=i.recodePath(n);varr,o,s="";"/"!==n.charAt(0)&&(t=!0,n="/"+n),"/.."!==n.slice(-3)&&"/."!==n.slice(-2)||(n+="/"),n=n.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(s=n.substring(1).match(/^(\.\.\/)+/)||"",s&&(s=s[0]));while(1){if(r=n.search(/\/\.\.(\/|$)/),-1===r)break;0!==r?(o=n.substring(0,r).lastIndexOf("/"),-1===o&&(o=r),n=n.substring(0,o)+n.substring(r+3)):n=n.substring(3)}returnt&&this.is("relative")&&(n=s+n.substring(1)),this._parts.path=n,this.build(!e),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(e){return"string"===typeofthis._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},a.normalizeFragment=function(e){returnthis._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){vare=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}returnthis},a.unicode=function(){vare=i.encode,t=i.decode;i.encode=y,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}returnthis},a.readable=function(){vart=this.clone();t.username("").password("").normalize();varn="";if(t._parts.protocol&&(n+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(n+=e.toUnicode(t._parts.hostname),t._parts.port&&(n+=":"+t._parts.port)):n+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(n+="/"),n+=t.path(!0),t._parts.query){for(varr="",o=0,s=t._parts.query.split("&"),a=s.length;o<a;o++){varu=(s[o]||"").split("=");r+="&"+i.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void0!==u[1]&&(r+="="+i.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}n+="?"+r.substring(1)}returnn+=i.decodeQuery(t.hash(),!0),n},a.absoluteTo=function(e){vart,n,r,o=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)thrownewError("URNs do not have any generally defined hierarchical components");if(einstanceofi||(e=newi(e)),o._parts.protocol)returno;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)returno;for(n=0;r=s[n];n++)o._parts[r]=e._parts[r];returno._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=e.directory(),t=t||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},a.relativeTo=function(e){vart,n,r,o,s,a=this.clone().normalize();if(a._parts.urn)thrownewError("URNs do not have any generally defined hierarchical components");if(e=newi(e).normalize(),t=a._parts,n=e._parts,o=a.path(),s=e.path(),"/"!==o.charAt(0))thrownewError("URI is already relative");if("/"!==s.charAt(0))thrownewError("Cannot calculate a URI relative to another relative URI");if(t.protocol===n.protocol&&(t.protocol=null),t.username!==n.username||t.password!==n.password)returna.build();if(null!==t.protocol||null!==t.username||null!==t.password)returna.build();if(t.hostname!==n.hostname||t.port!==n.port)returna.build();if(t.hostname=null,t.port=null,o===s)returnt.path="",a.build();if(r=i.commonPath(o,s),!r)returna.build();varu=n.path.substring(r.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");returnt.path=u+t.path.substring(r.length)||"./",a.build()},a.equals=function(e){vart,n,r,o=this.clone(),s=newi(e),a={},c={},l={};if(o.normalize(),s.normalize(),o.toString()===s.toString())return!0;if(t=o.query(),n=s.query(),o.query(""),s.query(""),o.toString()!==s.toString())return!1;if(t.length!==n.length)return!1;for(rina=i.parseQuery(t,this._parts.escapeQuerySpace),c=i.parseQuery(n,this._parts.escapeQuerySpace),a)if(u.call(a,r)){if(d(a[r])){if(!h(a[r],c[r]))return!1}elseif(a[r]!==c[r])return!1;l[r]=!0}for(rinc)if(u.call(c,r)&&!l[r])return!1;return!0},a.preventInvalidHostname=function(e){returnthis._parts.preventInvalidHostname=!!e,this},a.duplicateQueryParameters=function(e){returnthis._parts.duplicateQueryParameters=!!e,this},a.escapeQuerySpace=function(e){returnthis._parts.escapeQuerySpace=!!e,this},i}))}));functionWt(e){return0!==e.length&&"/"===e[e.length-1]||(e=`${e}/`),e}functionHt(e,t){if(null===e||"object"!==typeofe)returne;t=r.defaultValue(t,!1);constn=newe.constructor;for(constrine)if(e.hasOwnProperty(r)){leto=e[r];t&&(o=Ht(o,t)),n[r]=o}returnn}functionYt(e,t){letn;return"undefined"!==typeofdocument&&(n=document),Yt._implementation(e,t,n)}functionZt(e,t){if(!r.defined(e))thrownewn.DeveloperError("uri is required.");leto="";consti=e.lastIndexOf("/");return-1!==i&&(o=e.substring(0,i+1)),t?(e=new$t(e),0!==e.query().length&&(o+=`?${e.query()}`),0!==e.fragment().length&&(o+=`#${e.fragment()}`),o):o}functionGt(e){if(!r.defined(e))thrownewn.DeveloperError("uri is required.");constt=new$t(e);t.normalize();leto=t.path(),i=o.lastIndexOf("/");return-1!==i&&(o=o.substr(i+1)),i=o.lastIndexOf("."),o=-1===i?"":o.substr(i+1),o}Yt._implementation=function(e,t,o){if(!r.defined(e))thrownewn.DeveloperError("relative uri is required.");if(!r.defined(t)){if("undefined"===typeofo)returne;t=r.defaultValue(o.baseURI,o.location.href)}consti=new$t(e);return""!==i.scheme()?i.toString():i.absoluteTo(t).toString()};constJt={};functionXt(e,t,n){r.defined(t)||(t=e.width),r.defined(n)||(n=e.height);leto=Jt[t];r.defined(o)||(o={},Jt[t]=o);leti=o[n];if(!r.defined(i)){conste=document.createElement("canvas");e.width=t,e.height=n,i=e.getContext("2d"),i.globalCompositeOperation="copy",o[n]=i}returni.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}constKt=/^blob:/i;functionen(e){returnn.Check.typeOf.string("uri",e),Kt.test(e)}lettn;functionnn(e){r.defined(tn)||(tn=document.createElement("a")),tn.href=window.location.href;constt=tn.host,n=tn.protocol;returntn.href=e,tn.href=tn.href,n!==tn.protocol||t!==tn.host}constrn=/^data:/i;functionon(e){returnn.Check.typeOf.string("uri",e),rn.test(e)}functionsn(e){constt=G(),n=document.createElement("script");n.async=!0,n.src=e;constr=document.getElementsByTagName("head")[0];returnn.onload=function(){n.onload=void0,r.removeChild(n),t.resolve()},n.onerror=function(e){t.reject(e)},r.appendChild(n),t.promise}functionan(e){if(!r.defined(e))thrownewn.DeveloperError("obj is required.");lett="";for(constnine)if(e.hasOwnProperty(n)){constr=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(r))for(lete=0,n=r.length;e<n;++e)t+=`${o+encodeURIComponent(r[e])}&`;elset+=`${o+encodeURIComponent(r)}&`}returnt=t.slice(0,-1),t}functionun(e){if(!r.defined(e))thrownewn.DeveloperError("queryString is required.");constt={};if(""===e)returnt;consto=e.replace(/\+/g,"%20").split(/[&;]/);for(letn=0,i=o.length;n<i;++n){conste=o[n].split("="),i=decodeURIComponent(e[0]);lets=e[1];s=r.defined(s)?decodeURIComponent(s):"";consta=t[i];"string"===typeofa?t[i]=[a,s]:Array.isArray(a)?a.push(s):t[i]=s}returnt}constcn={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};varln=Object.freeze(cn);constdn={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};varfn=Object.freeze(dn);functionpn(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);constt=r.defaultValue(e.throttleByServer,!1),n=r.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=r.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=r.defaultValue(e.type,fn.OTHER),this.serverKey=void0,this.state=ln.UNISSUED,this.deferred=void0,this.cancelled=!1}functionhn(e){constt={};if(!e)returnt;constn=e.split("\r\n");for(letr=0;r<n.length;++r){conste=n[r],o=e.indexOf(": ");if(o>0){constn=e.substring(0,o),r=e.substring(o+2);t[n]=r}}returnt}functionmn(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"===typeofthis.responseHeaders&&(this.responseHeaders=hn(this.responseHeaders))}functiongn(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}functionyn(e,t){returnt-e}functionvn(e){n.Check.typeOf.object("options",e),n.Check.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void0}functionwn(e,t,n){constr=e[t];e[t]=e[n],e[n]=r}functionCn(e,t){returne.priority-t.priority}pn.prototype.cancel=function(){this.cancelled=!0},pn.prototype.clone=function(e){returnr.defined(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void0,e.cancelled=!1,e):newpn(this)},mn.prototype.toString=function(){lete="Request has failed.";returnr.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(gn.prototype,{numberOfListeners:{get:function(){returnthis._listeners.length-this._toRemove.length}}}),gn.prototype.addEventListener=function(e,t){n.Check.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);constr=this;returnfunction(){r.removeEventListener(e,t)}},gn.prototype.removeEventListener=function(e,t){n.Check.typeOf.func("listener",e);constr=this._listeners,o=this._scopes;leti=-1;for(letn=0;n<r.length;n++)if(r[n]===e&&o[n]===t){i=n;break}return-1!==i&&(this._insideRaiseEvent?(this._toRemove.push(i),r[i]=void0,o[i]=void0):(r.splice(i,1),o.splice(i,1)),!0)},gn.prototype.raiseEvent=function(){lete;this._insideRaiseEvent=!0;constt=this._listeners,n=this._scopes;leto=t.length;for(e=0;e<o;e++){consto=t[e];r.defined(o)&&t[e].apply(n[e],arguments)}consti=this._toRemove;if(o=i.length,o>0){for(i.sort(yn),e=0;e<o;e++){constr=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(vn.prototype,{length:{get:function(){returnthis._length}},internalArray:{get:function(){returnthis._array}},maximumLength:{get:function(){returnthis._maximumLength},set:function(e){n.Check.typeOf.number.greaterThanOrEquals("maximumLength",e,0);constt=this._length;if(e<t){constn=this._array;for(letr=e;r<t;++r)n[r]=void0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){returnthis._comparator}}}),vn.prototype.reserve=function(e){e=r.defaultValue(e,this._length),this._array.length=e},vn.prototype.heapify=function(e){e=r.defaultValue(e,0);constt=this._length,n=this._comparator,o=this._array;leti=-1,s=!0;while(s){constr=2*(e+1),a=r-1;i=a<t&&n(o[a],o[e])<0?a:e,r<t&&n(o[r],o[i])<0&&(i=r),i!==e?(wn(o,i,e),e=i):s=!1}},vn.prototype.resort=function(){conste=this._length;for(lett=Math.ceil(e/2);t>=0;--t)this.heapify(t)},vn.prototype.insert=function(e){n.Check.defined("element",e);constt=this._array,o=this._comparator,i=this._maximumLength;lets,a=this._length++;a<t.length?t[a]=e:t.push(e);while(0!==a){conste=Math.floor((a-1)/2);if(!(o(t[a],t[e])<0))break;wn(t,a,e),a=e}returnr.defined(i)&&this._length>i&&(s=t[i],this._length=i),s},vn.prototype.pop=function(e){if(e=r.defaultValue(e,0),0===this._length)return;n.Check.typeOf.number.lessThan("index",e,this._length);constt=this._array,o=t[e];returnwn(t,e,--this._length),this.heapify(e),t[this._length]=void0,o};constbn={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let_n=20;constxn=newvn({comparator:Cn});xn.maximumLength=_n,xn.reserve(_n);constEn=[];letOn={};constSn="undefined"!==typeofdocument?new$t(document.location.href):new$t,An=newgn;functionqn(){}functionkn(e){r.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}functionDn(e){returne.state===ln.UNISSUED&&(e.state=ln.ISSUED,e.deferred=G()),e.deferred.promise}functionIn(e){returnfunction(t){if(e.state===ln.CANCELLED)return;constn=e.deferred;--bn.numberOfActiveRequests,--On[e.serverKey],An.raiseEvent(),e.state=ln.RECEIVED,e.deferred=void0,n.resolve(t)}}functionPn(e){returnfunction(t){e.state!==ln.CANCELLED&&(++bn.numberOfFailedRequests,--bn.numberOfActiveRequests,--On[e.serverKey],An.raiseEvent(t),e.state=ln.FAILED,e.deferred.reject(t))}}functionRn(e){constt=Dn(e);returne.state=ln.ACTIVE,En.push(e),++bn.numberOfActiveRequests,++bn.numberOfActiveRequestsEver,++On[e.serverKey],e.requestFunction().then(In(e)).catch(Pn(e)),t}functionTn(e){constt=e.state===ln.ACTIVE;if(e.state=ln.CANCELLED,++bn.numberOfCancelledRequests,r.defined(e.deferred)){constt=e.deferred;e.deferred=void0,t.reject()}t&&(--bn.numberOfActiveRequests,--On[e.serverKey],++bn.numberOfCancelledActiveRequests),r.defined(e.cancelFunction)&&e.cancelFunction()}functionzn(){qn.debugShowStatistics&&(0===bn.numberOfActiveRequests&&bn.lastNumberOfActiveRequests>0&&(bn.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${bn.numberOfAttemptedRequests}`),bn.numberOfAttemptedRequests=0),bn.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${bn.numberOfCancelledRequests}`),bn.numberOfCancelledRequests=0),bn.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${bn.numberOfCancelledActiveRequests}`),bn.numberOfCancelledActiveRequests=0),bn.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${bn.numberOfFailedRequests}`),bn.numberOfFailedRequests=0)),bn.lastNumberOfActiveRequests=bn.numberOfActiveRequests)}qn.maximumRequests=50,qn.maximumRequestsPerServer=6,qn.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},qn.throttleRequests=!0,qn.debugShowStatistics=!1,qn.requestCompletedEvent=An,Object.defineProperties(qn,{statistics:{get:function(){returnbn}},priorityHeapLength:{get:function(){return_n},set:function(e){if(e<_n)while(xn.length>e){conste=xn.pop();Tn(e)}_n=e,xn.maximumLength=e,xn.reserve(e)}}}),qn.serverHasOpenSlots=function(e,t){t=r.defaultValue(t,1);constn=r.defaultValue(qn.requestsByServer[e],qn.maximumRequestsPerServer),o=On[e]+t<=n;returno},qn.heapHasOpenSlots=function(e){constt=xn.length+e<=_n;returnt},qn.update=function(){lete,t,n=0;constr=En.length;for(e=0;e<r;++e)t=En[e],t.cancelled&&Tn(t),t.state===ln.ACTIVE?n>0&&(En[e-n]=t):++n;En.length-=n;consto=xn.internalArray,i=xn.length;for(e=0;e<i;++e)kn(o[e]);xn.resort();consts=Math.max(qn.maximumRequests-En.length,0);leta=0;while(a<s&&xn.length>0)t=xn.pop(),t.cancelled?Tn(t):!t.throttleByServer||qn.serverHasOpenSlots(t.serverKey)?(Rn(t),++a):Tn(t);zn()},qn.getServerKey=function(e){n.Check.typeOf.string("url",e);lett=new$t(e);""===t.scheme()&&(t=new$t(e).absoluteTo(Sn),t.normalize());leto=t.authority();/:/.test(o)||(o=`${o}:${"https"===t.scheme()?"443":"80"}`);consti=On[o];returnr.defined(i)||(On[o]=0),o},qn.request=function(e){if(n.Check.typeOf.object("request",e),n.Check.typeOf.string("request.url",e.url),n.Check.typeOf.func("request.requestFunction",e.requestFunction),on(e.url)||en(e.url))returnAn.raiseEvent(),e.state=ln.RECEIVED,e.requestFunction();if(++bn.numberOfAttemptedRequests,r.defined(e.serverKey)||(e.serverKey=qn.getServerKey(e.url)),qn.throttleRequests&&e.throttleByServer&&!qn.serverHasOpenSlots(e.serverKey))return;if(!qn.throttleRequests||!e.throttle)returnRn(e);if(En.length>=qn.maximumRequests)return;kn(e);constt=xn.insert(e);if(r.defined(t)){if(t===e)return;Tn(t)}returnDn(e)},qn.clearForSpecs=function(){while(xn.length>0){conste=xn.pop();Tn(e)}conste=En.length;for(lett=0;t<e;++t)Tn(En[t]);En.length=0,On={},bn.numberOfAttemptedRequests=0,bn.numberOfActiveRequests=0,bn.numberOfCancelledRequests=0,bn.numberOfCancelledActiveRequests=0,bn.numberOfFailedRequests=0,bn.numberOfActiveRequestsEver=0,bn.lastNumberOfActiveRequests=0},qn.numberOfActiveRequestsByServer=function(e){returnOn[e]},qn.requestHeap=xn;constMn={};letUn={};functionjn(e){constt=new$t(e);t.normalize();letn=t.authority();if(0!==n.length){if(t.authority(n),-1!==n.indexOf("@")){conste=n.split("@");n=e[1]}if(-1===n.indexOf(":")){lete=t.scheme();if(0===e.length&&(e=window.location.protocol,e=e.substring(0,e.length-1)),"http"===e)n+=":80";else{if("https"!==e)return;n+=":443"}}returnn}}Mn.add=function(e,t){if(!r.defined(e))thrownewn.DeveloperError("host is required.");if(!r.defined(t)||t<=0)thrownewn.DeveloperError("port is required to be greater than 0.");consto=`${e.toLowerCase()}:${t}`;r.defined(Un[o])||(Un[o]=!0)},Mn.remove=function(e,t){if(!r.defined(e))thrownewn.DeveloperError("host is required.");if(!r.defined(t)||t<=0)thrownewn.DeveloperError("port is required to be greater than 0.");consto=`${e.toLowerCase()}:${t}`;r.defined(Un[o])&&deleteUn[o]},Mn.contains=function(e){if(!r.defined(e))thrownewn.DeveloperError("url is required.");constt=jn(e);return!(!r.defined(t)||!r.defined(Un[t]))},Mn.clear=function(){Un={}};constFn=function(){try{conste=newXMLHttpRequest;returne.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();functionNn(e,t,n,r){consto=e.query();if(0===o.length)return{};leti;if(-1===o.indexOf("=")){conste={};e[o]=void0,i=e}elsei=un(o);t._queryParameters=n?Qn(i,t._queryParameters,r):i,e.search("")}functionBn(e,t){constn=t._queryParameters,o=Object.keys(n);1!==o.length||r.defined(n[o[0]])?e.search(an(n)):e.search(o[0])}functionVn(e,t){returnr.defined(e)?r.defined(e.clone)?e.clone():Ht(e):t}functionLn(e){if(e.state===ln.ISSUED||e.state===ln.ACTIVE)thrownewn.RuntimeError("The Resource is already being fetched.");e.state=ln.UNISSUED,e.deferred=void0}functionQn(e,t,n){if(!n)returns.combine(e,t);consto=Ht(e,!0);for(constiint)if(t.hasOwnProperty(i)){lete=o[i];constn=t[i];r.defined(e)?(Array.isArray(e)||(e=o[i]=[e]),o[i]=e.concat(n)):o[i]=Array.isArray(n)?n.slice():n}returno}function$n(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),"string"===typeofe&&(e={url:e}),n.Check.typeOf.string("options.url",e.url),this._url=void0,this._templateValues=Vn(e.templateValues,{}),this._queryParameters=Vn(e.queryParameters,{}),this.headers=Vn(e.headers,{}),this.request=r.defaultValue(e.request,newpn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=r.defaultValue(e.retryAttempts,0),this._retryCount=0;constt=new$t(e.url);Nn(t,this,!0,!0),t.fragment(""),this._url=t.toString()}letWn;functionHn(e){constt=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){lete=!1;t.isDataUri||t.isBlobUri||(e=t.isCrossOriginUrl);constr=G();return$n._Implementations.createImage(s,e,r,n,o,i),r.promise};consta=qn.request(s);if(r.defined(a))returna.catch((function(e){returns.state!==ln.FAILED?Promise.reject(e):t.retryOnError(e).then((function(r){returnr?(s.state=ln.UNISSUED,s.deferred=void0,Hn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(e)}))}))}functionYn(e,t,n){consto={};o[t]=n,e.setQueryParameters(o);consti=e.request;i.url=e.url,i.requestFunction=function(){constt=G();returnwindow[n]=function(e){t.resolve(e);try{deletewindow[n]}catch(r){window[n]=void0}},$n._Implementations.loadAndExecuteScript(e.url,n,t),t.promise};consts=qn.request(i);if(r.defined(s))returns.catch((function(r){returni.state!==ln.FAILED?Promise.reject(r):e.retryOnError(r).then((function(o){returno?(i.state=ln.UNISSUED,i.deferred=void0,Yn(e,t,n)):Promise.reject(r)}))}))}$n.createIfNeeded=function(e){returneinstanceof$n?e.getDerivedResource({request:e.request}):"string"!==typeofe?e:new$n({url:e})},$n.supportsImageBitmapOptions=function(){if(r.defined(Wn))returnWn;if("function"!==typeofcreateImageBitmap)returnWn=Promise.resolve(!1),Wn;conste="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";returnWn=$n.fetchBlob({url:e}).then((function(e){constt={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};returnPromise.all([createImageBitmap(e,t),createImageBitmap(e)])})).then((function(e){constt=Xt(e[0]),n=Xt(e[1]);returnt[1]!==n[1]})).catch((function(){return!1})),Wn},Object.defineProperties($n,{isBlobSupported:{get:function(){returnFn}}}),Object.defineProperties($n.prototype,{queryParameters:{get:function(){returnthis._queryParameters}},templateValues:{get:function(){returnthis._templateValues}},url:{get:function(){returnthis.getUrlComponent(!0,!0)},set:function(e){constt=new$t(e);Nn(t,this,!1),t.fragment(""),this._url=t.toString()}},extension:{get:function(){returnGt(this._url)}},isDataUri:{get:function(){returnon(this._url)}},isBlobUri:{get:function(){returnen(this._url)}},isCrossOriginUrl:{get:function(){returnnn(this._url)}},hasHeaders:{get:function(){returnObject.keys(this.headers).length>0}}}),$n.prototype.toString=function(){returnthis.getUrlComponent(!0,!0)},$n.prototype.getUrlComponent=function(e,t){if(this.isDataUri)returnthis._url;constn=new$t(this._url);e&&Bn(n,this);leto=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");consti=this._templateValues;returno=o.replace(/{(.*?)}/g,(function(e,t){constn=i[t];returnr.defined(n)?encodeURIComponent(n):e})),t&&r.defined(this.proxy)&&(o=this.proxy.getURL(o)),o},$n.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Qn(this._queryParameters,e,!1):Qn(e,this._queryParameters,!1)},$n.prototype.appendQueryParameters=function(e){this._queryParameters=Qn(e,this._queryParameters,!0)},$n.prototype.setTemplateValues=function(e,t){this._templateValues=t?s.combine(this._templateValues,e):s.combine(e,this._templateValues)},$n.prototype.getDerivedResource=function(e){constt=this.clone();if(t._retryCount=0,r.defined(e.url)){constn=new$t(e.url),o=r.defaultValue(e.preserveQueryParameters,!1);Nn(n,t,!0,o),n.fragment(""),""!==n.scheme()?t._url=n.toString():t._url=n.absoluteTo(new$t(Yt(this._url))).toString()}returnr.defined(e.queryParameters)&&(t._queryParameters=s.combine(e.queryParameters,t._queryParameters)),r.defined(e.templateValues)&&(t._templateValues=s.combine(e.templateValues,t.templateValues)),r.defined(e.headers)&&(t.headers=s.combine(e.headers,t.headers)),r.defined(e.proxy)&&(t.proxy=e.proxy),r.defined(e.request)&&(t.request=e.request),r.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),r.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},$n.prototype.retryOnError=function(e){constt=this.retryCallback;if("function"!==typeoft||this._retryCount>=this.retryAttempts)returnPromise.resolve(!1);constn=this;returnPromise.resolve(t(this,e)).then((function(e){return++n._retryCount,e}))},$n.prototype.clone=function(e){returnr.defined(e)||(e=new$n({url:this._url})),e._url=this._url,e._queryParameters=Ht(this._queryParameters),e._templateValues=Ht(this._templateValues),e.headers=Ht(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},$n.prototype.getBaseUri=function(e){returnZt(this.getUrlComponent(e),e)},$n.prototype.appendForwardSlash=function(){this._url=Wt(this._url)},$n.prototype.fetchArrayBuffer=function(){returnthis.fetch({responseType:"arraybuffer"})},$n.fetchArrayBuffer=function(e){constt=new$n(e);returnt.fetchArrayBuffer()},$n.prototype.fetchBlob=function(){returnthis.fetch({responseType:"blob"})},$n.fetchBlob=function(e){constt=new$n(e);returnt.fetchBlob()},$n.prototype.fetchImage=function(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);constt=r.defaultValue(e.preferImageBitmap,!1),n=r.defaultValue(e.preferBlob,!1),o=r.defaultValue(e.flipY,!1),i=r.defaultValue(e.skipColorSpaceConversion,!1);if(Ln(this.request),!Fn||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)returnHn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});consts=this.fetchBlob();if(!r.defined(s))return;leta,u,c,l;return$n.supportsImageBitmapOptions().then((function(e){returna=e,u=a&&t,s})).then((function(e){if(!r.defined(e))return;if(l=e,u)return$n.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});constt=window.URL.createObjectURL(e);returnc=new$n({url:t}),Hn({resource:c,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(r.defined(e))returne.blob=l,u||window.URL.revokeObjectURL(c.url),e})).catch((function(e){returnr.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,Promise.reject(e)}))},$n.fetchImage=function(e){constt=new$n(e);returnt.fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},$n.prototype.fetchText=function(){returnthis.fetch({responseType:"text"})},$n.fetchText=function(e){constt=new$n(e);returnt.fetchText()},$n.prototype.fetchJson=function(){conste=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(r.defined(e))returne.then((function(e){if(r.defined(e))returnJSON.parse(e)}))},$n.fetchJson=function(e){constt=new$n(e);returnt.fetchJson()},$n.prototype.fetchXML=function(){returnthis.fetch({responseType:"document",overrideMimeType:"text/xml"})},$n.fetchXML=function(e){constt=new$n(e);returnt.fetchXML()},$n.prototype.fetchJsonp=function(e){lett;e=r.defaultValue(e,"callback"),Ln(this.request);do{t=`loadJsonp${o.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(r.defined(window[t]));returnYn(this,e,t)},$n.fetchJsonp=function(e){constt=new$n(e);returnt.fetchJsonp(e.callbackParameterName)},$n.prototype._makeRequest=function(e){constt=this;Ln(t.request);constn=t.request;n.url=t.url,n.requestFunction=function(){consto=e.responseType,i=s.combine(e.headers,t.headers),a=e.overrideMimeType,u=e.method,c=e.data,l=G(),d=$n._Implementations.loadWithXhr(t.url,o,u,c,i,l,a);returnr.defined(d)&&r.defined(d.abort)&&(n.cancelFunction=function(){d.abort()}),l.promise};consto=qn.request(n);if(r.defined(o))returno.then((function(e){returnn.cancelFunction=void0,e})).catch((function(r){returnn.cancelFunction=void0,n.state!==ln.FAILED?Promise.reject(r):t.retryOnError(r).then((function(o){returno?(n.state=ln.UNISSUED,n.deferred=void0,t.fetch(e)):Promise.reject(r)}))}))};constZn=/^data:(.*?)(;base64)?,(.*)$/;functionGn(e,t){constn=decodeURIComponent(t);returne?atob(n):n}functionJn(e,t){constn=Gn(e,t),r=newArrayBuffer(n.length),o=newUint8Array(r);for(leti=0;i<n.length;i++)o[i]=n.charCodeAt(i);returnr}functionXn(e,t){t=r.defaultValue(t,"");consto=e[1],i=!!e[2],s=e[3];leta,u;switch(t){case"":case"text":returnGn(i,s);case"arraybuffer":returnJn(i,s);case"blob":returna=Jn(i,s),newBlob([a],{type:o});case"document":returnu=newDOMParser,u.parseFromString(Gn(i,s),o);case"json":returnJSON.parse(Gn(i,s));default:thrownewn.DeveloperError(`Unhandled responseType: ${t}`)}}functionKn(e,t){switch(t){case"text":returne.toString("utf8");case"json":returnJSON.parse(e.toString("utf8"));default:returnnewUint8Array(e).buffer}}functioner(e,t,r,o,i,s,a){constu=require("url").parse(e),c="https:"===u.protocol?require("https"):require("http"),l=require("zlib"),d={protocol:u.protocol,hostname:u.hostname,port:u.port,path:u.path,query:u.query,method:r,headers:i};c.request(d).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)returnvoids.reject(newmn(e.statusCode,e,e.headers));constr=[];e.on("data",(function(e){r.push(e)})),e.on("end",(function(){consto=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?l.gunzip(o,(function(e,r){e?s.reject(newn.RuntimeError("Error decompressing response.")):s.resolve(Kn(r,t))})):s.resolve(Kn(o,t))}))})).on("error",(function(e){s.reject(newmn)})).end()}$n.prototype.fetch=function(e){returne=Vn(e,{}),e.method="GET",this._makeRequest(e)},$n.fetch=function(e){constt=new$n(e);returnt.fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.delete=function(e){returne=Vn(e,{}),e.method="DELETE",this._makeRequest(e)},$n.delete=function(e){constt=new$n(e);returnt.delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},$n.prototype.head=function(e){returne=Vn(e,{}),e.method="HEAD",this._makeRequest(e)},$n.head=function(e){constt=new$n(e);returnt.head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.options=function(e){returne=Vn(e,{}),e.method="OPTIONS",this._makeRequest(e)},$n.options=function(e){constt=new$n(e);returnt.options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.post=function(e,t){returnn.Check.defined("data",e),t=Vn(t,{}),t.method="POST",t.data=e,this._makeRequest(t)},$n.post=function(e){constt=new$n(e);returnt.post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.put=function(e,t){returnn.Check.defined("data",e),t=Vn(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)},$n.put=function(e){constt=new$n(e);returnt.put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n.prototype.patch=function(e,t){returnn.Check.defined("data",e),t=Vn(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)},$n.patch=function(e){constt=new$n(e);returnt.patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},$n._Implementations={},$n._Implementations.loadImageElement=function(e,t,n){constr=newImage;r.onload=function(){0===r.naturalWidth&&0===r.naturalHeight&&0===r.width&&0===r.height&&(r.width=300,r.height=150),n.resolve(r)},r.onerror=function(e){n.reject(e)},t&&(Mn.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},$n._Implementations.createImage=function(e,t,o,i,s,a){constu=e.url;$n.supportsImageBitmapOptions().then((function(c){if(!c||!a)returnvoid$n._Implementations.loadImageElement(u,t,o);constl="blob",d="GET",f=G(),p=$n._Implementations.loadWithXhr(u,l,d,void0,void0,f,void0,void0,void0);returnr.defined(p)&&r.defined(p.abort)&&(e.cancelFunction=function(){p.abort()}),f.promise.then((function(e){if(r.defined(e))return$n.createImageBitmapFromBlob(e,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:s});o.reject(newn.RuntimeError(`Successfully retrieved ${u} but it contained no content.`))})).then((function(e){o.resolve(e)}))})).catch((function(e){o.reject(e)}))},$n.createImageBitmapFromBlob=function(e,t){returnn.Check.defined("options",t),n.Check.typeOf.bool("options.flipY",t.flipY),n.Check.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),n.Check.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};consttr="undefined"===typeofXMLHttpRequest;functionnr(e){if(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._dates=void0,this._samples=void0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void0,this._dataError=void0,this._addNewLeapSeconds=r.defaultValue(e.addNewLeapSeconds,!0),r.defined(e.data))or(this,e.data);elseif(r.defined(e.url)){constt=$n.createIfNeeded(e.url),n=this;this._downloadPromise=t.fetchJson().then((function(e){or(n,e)})).catch((function(){n._dataError=`An error occurred while retrieving the EOP data from the URL ${t.url}.`}))}elseor(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}functionrr(e,t){returnNt.compare(e.julianDate,t)}functionor(e,t){if(!r.defined(t.columnNames))returnvoid(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r.defined(t.samples))returnvoid(e._dataError="Error in loaded EOP data: The samples property is required.");constn=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||s<0||a<0||u<0||c<0)returnvoid(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");constl=e._samples=t.samples,d=e._dates=[];letf;e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void0;constp=e._addNewLeapSeconds;for(leth=0,m=l.length;h<m;h+=e._columnCount){conste=l[h+n],t=l[h+c],o=e+vt.MODIFIED_JULIAN_DATE_DIFFERENCE,i=newNt(o,t,Ct.TAI);if(d.push(i),p){if(t!==f&&r.defined(f)){conste=Nt.leapSeconds,n=ft(e,i,rr);if(n<0){constr=newgt(i,t);e.splice(~n,0,r)}}f=t}}}functionir(e,t,n,r,o){consti=n*r;o.xPoleWander=t[i+e._xPoleWanderRadiansColumn],o.yPoleWander=t[i+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}functionsr(e,t,n){returnt+e*(n-t)}functionar(e,t,n,r,o,i,s){consta=e._columnCount;if(i>t.length-1)returns.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;constu=t[o],c=t[i];if(u.equals(c)||r.equals(u))returnir(e,n,o,a,s),s;if(r.equals(c))returnir(e,n,i,a,s),s;constl=Nt.secondsDifference(r,u)/Nt.secondsDifference(c,u),d=o*a,f=i*a;letp=n[d+e._ut1MinusUtcSecondsColumn],h=n[f+e._ut1MinusUtcSecondsColumn];constm=h-p;if(m>.5||m<-.5){constt=n[d+e._taiMinusUtcSecondsColumn],o=n[f+e._taiMinusUtcSecondsColumn];t!==o&&(c.equals(r)?p=h:h-=o-t)}returns.xPoleWander=sr(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=sr(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=sr(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=sr(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=sr(l,p,h),s}functionur(e,t,n){this.heading=r.defaultValue(e,0),this.pitch=r.defaultValue(t,0),this.roll=r.defaultValue(n,0)}$n._Implementations.loadWithXhr=function(e,t,o,i,s,a,u){constc=Zn.exec(e);if(null!==c)returnvoida.resolve(Xn(c,t));if(tr)returnvoider(e,t,o,i,s,a);constl=newXMLHttpRequest;if(Mn.contains(e)&&(l.withCredentials=!0),l.open(o,e,!0),r.defined(u)&&r.defined(l.overrideMimeType)&&l.overrideMimeType(u),r.defined(s))for(constnins)s.hasOwnProperty(n)&&l.setRequestHeader(n,s[n]);r.defined(t)&&(l.responseType=t);letd=!1;return"string"===typeofe&&(d=0===e.indexOf("file://")||"undefined"!==typeofwindow&&"file://"===window.location.origin),l.onload=function(){if((l.status<200||l.status>=300)&&(!d||0!==l.status))returnvoida.reject(newmn(l.status,l.response,l.getAllResponseHeaders()));conste=l.response,i=l.responseType;if("HEAD"===o||"OPTIONS"===o){conste=l.getAllResponseHeaders(),t=e.trim().split(/[\r\n]+/),n={};returnt.forEach((function(e){constt=e.split(": "),r=t.shift();n[r]=t.join(": ")})),voida.resolve(n)}if(204===l.status)a.resolve();elseif(!r.defined(e)||r.defined(t)&&i!==t)if("json"===t&&"string"===typeofe)try{a.resolve(JSON.parse(e))}catch(s){a.reject(s)}else(""===i||"document"===i)&&r.defined(l.responseXML)&&l.responseXML.hasChildNodes()?a.resolve(l.responseXML):""!==i&&"text"!==i||!r.defined(l.responseText)?a.reject(newn.RuntimeError("Invalid XMLHttpRequest response type.")):a.resolve(l.responseText);elsea.resolve(e)},l.onerror=function(e){a.reject(newmn)},l.send(i),l},$n._Implementations.loadAndExecuteScript=function(e,t,n){returnsn(e).catch((function(e){n.reject(e)}))},$n._DefaultImplementations={},$n._DefaultImplementations.createImage=$n._Implementations.createImage,$n._DefaultImplementations.loadWithXhr=$n._Implementations.loadWithXhr,$n._DefaultImplementations.loadAndExecuteScript=$n._Implementations.loadAndExecuteScript,$n.DEFAULT=Object.freeze(new$n({url:"undefined"===typeofdocument?"":document.location.href.split("?")[0]})),nr.NONE=Object.freeze({getPromiseToLoad:function(){returnPromise.resolve()},compute:function(e,t){returnr.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=newpt(0,0,0,0,0),t}}),nr.prototype.getPromiseToLoad=function(){returnPromise.resolve(this._downloadPromise)},nr.prototype.compute=function(e,t){if(!r.defined(this._samples)){if(r.defined(this._dataError))thrownewn.RuntimeError(this._dataError);return}if(r.defined(t)||(t=newpt(0,0,0,0,0)),0===this._samples.length)returnt.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;consto=this._dates,i=this._lastIndex;lets=0,a=0;if(r.defined(i)){constn=o[i],u=o[i+1],c=Nt.lessThanOrEquals(n,e),l=!r.defined(u),d=l||Nt.greaterThanOrEquals(u,e);if(c&&d)returns=i,!l&&u.equals(e)&&++s,a=s+1,ar(this,o,this._samples,e,s,a,t),t}letu=ft(o,e,Nt.compare,this._dateColumn);returnu>=0?(u<o.length-1&&o[u+1].equals(e)&&++u,s=u,a=u):(a=~u,s=a-1,s<0&&(s=0)),this._lastIndex=s,ar(this,o,this._samples,e,s,a,t),t},ur.fromQuaternion=function(e,t){if(!r.defined(e))thrownewn.DeveloperError("quaternion is required");r.defined(t)||(t=newur);consti=2*(e.w*e.y-e.z*e.x),s=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),c=2*(e.w*e.z+e.x*e.y);returnt.heading=-Math.atan2(c,u),t.roll=Math.atan2(a,s),t.pitch=-o.CesiumMath.asinClamped(i),t},ur.fromDegrees=function(e,t,i,s){if(!r.defined(e))thrownewn.DeveloperError("heading is required");if(!r.defined(t))thrownewn.DeveloperError("pitch is required");if(!r.defined(i))thrownewn.DeveloperError("roll is required");returnr.defined(s)||(s=newur),s.heading=e*o.CesiumMath.RADIANS_PER_DEGREE,s.pitch=t*o.CesiumMath.RADIANS_PER_DEGREE,s.roll=i*o.CesiumMath.RADIANS_PER_DEGREE,s},ur.clone=function(e,t){if(r.defined(e))returnr.defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):newur(e.heading,e.pitch,e.roll)},ur.equals=function(e,t){returne===t||r.defined(e)&&r.defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},ur.equalsEpsilon=function(e,t,n,i){returne===t||r.defined(e)&&r.defined(t)&&o.CesiumMath.equalsEpsilon(e.heading,t.heading,n,i)&&o.CesiumMath.equalsEpsilon(e.pitch,t.pitch,n,i)&&o.CesiumMath.equalsEpsilon(e.roll,t.roll,n,i)},ur.prototype.clone=function(e){returnur.clone(this,e)},ur.prototype.equals=function(e){returnur.equals(this,e)},ur.prototype.equalsEpsilon=function(e,t,n){returnur.equalsEpsilon(this,e,t,n)},ur.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};constcr=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;functionlr(){conste=document.getElementsByTagName("script");for(lett=0,n=e.length;t<n;++t){constn=e[t].getAttribute("src"),r=cr.exec(n);if(null!==r)returnr[1]}}letdr,fr,pr;functionhr(e){return"undefined"===typeofdocument?e:(r.defined(dr)||(dr=document.createElement("a")),dr.href=e,dr.href=dr.href,dr.href)}functionmr(){if(r.defined(fr))returnfr;lete;if(e="undefined"!==typeofCESIUM_BASE_URL?CESIUM_BASE_URL:"object"===typeofdefine&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(require.toUrl)?Yt("..",vr("Core/buildModuleUrl.js")):lr(),!r.defined(e))thrownewn.DeveloperError("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");returnfr=new$n({url:hr(e)}),fr.appendForwardSlash(),fr}functiongr(e){returnhr(require.toUrl(`../${e}`))}functionyr(e){constt=mr().getDerivedResource({url:e});returnt.url}functionvr(e){r.defined(pr)||(pr="object"===typeofdefine&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(require.toUrl)?gr:yr);constt=pr(e);returnt}functionwr(e,t,n){this.x=e,this.y=t,this.s=n}functionCr(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=$n.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=r.defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r.defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=newNt(this._sampleZeroJulianEphemerisDate,0,Ct.TAI),this._stepSizeDays=r.defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=r.defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=r.defaultValue(e.totalSamples,27426),this._samples=newArray(3*this._totalSamples),this._chunkDownloadsInProgress=[];constt=this._interpolationOrder,n=this._denominators=newArray(t+1),o=this._xTable=newArray(t+1),i=Math.pow(this._stepSizeDays,t);for(letr=0;r<=t;++r){n[r]=i,o[r]=r*this._stepSizeDays;for(lete=0;e<=t;++e)e!==r&&(n[r]*=r-e);n[r]=1/n[r]}this._work=newArray(t+1),this._coef=newArray(t+1)}vr._cesiumScriptRegex=cr,vr._buildModuleUrlFromBaseUrl=yr,vr._clearBaseResource=function(){fr=void0},vr.setBaseUrl=function(e){fr=$n.DEFAULT.getDerivedResource({url:e})},vr.getCesiumBaseUrl=mr;constbr=newNt(0,0,Ct.TAI);function_r(e,t,n){constr=br;returnr.dayNumber=t,r.secondsOfDay=n,Nt.daysDifference(r,e._sampleZeroDateTT)}functionxr(e,t){if(e._chunkDownloadsInProgress[t])returne._chunkDownloadsInProgress[t];constn=G();leto;e._chunkDownloadsInProgress[t]=n;consti=e._xysFileUrlTemplate;returno=r.defined(i)?i.getDerivedResource({templateValues:{0:t}}):new$n({url:vr(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)}),o.fetchJson().then((function(r){e._chunkDownloadsInProgress[t]=!1;consto=e._samples,i=r.samples,s=t*e._samplesPerXysFile*3;for(lete=0,t=i.length;e<t;++e)o[s+e]=i[e];n.resolve()})),n.promise}Cr.prototype.preload=function(e,t,n,r){consto=_r(this,e,t),i=_r(this,n,r);lets=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);leta=i/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);constu=s/this._samplesPerXysFile|0,c=a/this._samplesPerXysFile|0,l=[];for(letd=u;d<=c;++d)l.push(xr(this,d));returnPromise.all(l)},Cr.prototype.computeXysRadians=function(e,t,n){consto=_r(this,e,t);if(o<0)return;consti=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;consts=this._interpolationOrder;leta=i-(s/2|0);a<0&&(a=0);letu=a+s;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-s,a<0&&(a=0));letc=!1;constl=this._samples;if(r.defined(l[3*a])||(xr(this,a/this._samplesPerXysFile|0),c=!0),r.defined(l[3*u])||(xr(this,u/this._samplesPerXysFile|0),c=!0),c)return;r.defined(n)?(n.x=0,n.y=0,n.s=0):n=newwr(0,0,0);constd=o-a*this._stepSizeDays,f=this._work,p=this._denominators,h=this._coef,m=this._xTable;letg,y;for(g=0;g<=s;++g)f[g]=d-m[g];for(g=0;g<=s;++g){for(h[g]=1,y=0;y<=s;++y)y!==g&&(h[g]*=f[y]);h[g]*=p[g];lete=3*(a+g);n.x+=h[g]*l[e++],n.y+=h[g]*l[e++],n.s+=h[g]*l[e]}returnn};constEr={},Or={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Sr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Ar={},qr={east:newt.Cartesian3,north:newt.Cartesian3,up:newt.Cartesian3,west:newt.Cartesian3,south:newt.Cartesian3,down:newt.Cartesian3};letkr=newt.Cartesian3,Dr=newt.Cartesian3,Ir=newt.Cartesian3;Er.localFrameToFixedFrameGenerator=function(e,i){if(!Or.hasOwnProperty(e)||!Or[e].hasOwnProperty(i))thrownewn.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");consts=Or[e][i];leta;constu=e+i;returnr.defined(Ar[u])?a=Ar[u]:(a=function(a,u,c){if(!r.defined(a))thrownewn.DeveloperError("origin is required.");if(r.defined(c)||(c=newt.Matrix4),t.Cartesian3.equalsEpsilon(a,t.Cartesian3.ZERO,o.CesiumMath.EPSILON14))t.Cartesian3.unpack(Sr[e],0,kr),t.Cartesian3.unpack(Sr[i],0,Dr),t.Cartesian3.unpack(Sr[s],0,Ir);elseif(o.CesiumMath.equalsEpsilon(a.x,0,o.CesiumMath.EPSILON14)&&o.CesiumMath.equalsEpsilon(a.y,0,o.CesiumMath.EPSILON14)){constn=o.CesiumMath.sign(a.z);t.Cartesian3.unpack(Sr[e],0,kr),"east"!==e&&"west"!==e&&t.Cartesian3.multiplyByScalar(kr,n,kr),t.Cartesian3.unpack(Sr[i],0,Dr),"east"!==i&&"west"!==i&&t.Cartesian3.multiplyByScalar(Dr,n,Dr),t.Cartesian3.unpack(Sr[s],0,Ir),"east"!==s&&"west"!==s&&t.Cartesian3.multiplyByScalar(Ir,n,Ir)}else{u=r.defaultValue(u,t.Ellipsoid.WGS84),u.geodeticSurfaceNormal(a,qr.up);constn=qr.up,o=qr.east;o.x=-a.y,o.y=a.x,o.z=0,t.Cartesian3.normalize(o,qr.east),t.Cartesian3.cross(n,o,qr.north),t.Cartesian3.multiplyByScalar(qr.up,-1,qr.down),t.Cartesian3.multiplyByScalar(qr.east,-1,qr.west),t.Cartesian3.multiplyByScalar(qr.north,-1,qr.south),kr=qr[e],Dr=qr[i],Ir=qr[s]}returnc[0]=kr.x,c[1]=kr.y,c[2]=kr.z,c[3]=0,c[4]=Dr.x,c[5]=Dr.y,c[6]=Dr.z,c[7]=0,c[8]=Ir.x,c[9]=Ir.y,c[10]=Ir.z,c[11]=0,c[12]=a.x,c[13]=a.y,c[14]=a.z,c[15]=1,c},Ar[u]=a),a},Er.eastNorthUpToFixedFrame=Er.localFrameToFixedFrameGenerator("east","north"),Er.northEastDownToFixedFrame=Er.localFrameToFixedFrameGenerator("north","east"),Er.northUpEastToFixedFrame=Er.localFrameToFixedFrameGenerator("north","up"),Er.northWestUpToFixedFrame=Er.localFrameToFixedFrameGenerator("north","west");constPr=newFe,Rr=newt.Cartesian3(1,1,1),Tr=newt.Matrix4;Er.headingPitchRollToFixedFrame=function(e,o,i,s,a){n.Check.typeOf.object("HeadingPitchRoll",o),s=r.defaultValue(s,Er.eastNorthUpToFixedFrame);constu=Fe.fromHeadingPitchRoll(o,Pr),c=t.Matrix4.fromTranslationQuaternionRotationScale(t.Cartesian3.ZERO,u,Rr,Tr);returna=s(e,i,a),t.Matrix4.multiply(a,c,a)};constzr=newt.Matrix4,Mr=newt.Matrix3;Er.headingPitchRollQuaternion=function(e,r,o,i,s){n.Check.typeOf.object("HeadingPitchRoll",r);consta=Er.headingPitchRollToFixedFrame(e,r,o,i,zr),u=t.Matrix4.getMatrix3(a,Mr);returnFe.fromRotationMatrix(u,s)};constUr=newt.Cartesian3(1,1,1),jr=newt.Cartesian3,Fr=newt.Matrix4,Nr=newt.Matrix4,Br=newt.Matrix3,Vr=newFe;Er.fixedFrameToHeadingPitchRoll=function(e,o,i,s){n.Check.defined("transform",e),o=r.defaultValue(o,t.Ellipsoid.WGS84),i=r.defaultValue(i,Er.eastNorthUpToFixedFrame),r.defined(s)||(s=newur);consta=t.Matrix4.getTranslation(e,jr);if(t.Cartesian3.equals(a,t.Cartesian3.ZERO))returns.heading=0,s.pitch=0,s.roll=0,s;letu=t.Matrix4.inverseTransformation(i(a,o,Fr),Fr),c=t.Matrix4.setScale(e,Ur,Nr);c=t.Matrix4.setTranslation(c,t.Cartesian3.ZERO,c),u=t.Matrix4.multiply(u,c,u);letl=Fe.fromRotationMatrix(t.Matrix4.getMatrix3(u,Br),Vr);returnl=Fe.normalize(l,l),ur.fromQuaternion(l,s)};constLr=24110.54841,Qr=8640184.812866,$r=.093104,Wr=-62e-7,Hr=11772758384668e-32,Yr=72921158553e-15,Zr=o.CesiumMath.TWO_PI/86400;letGr=newNt;Er.computeTemeToPseudoFixedMatrix=function(e,i){if(!r.defined(e))thrownewn.DeveloperError("date is required.");Gr=Nt.addSeconds(e,-Nt.computeTaiMinusUtc(e),Gr);consts=Gr.dayNumber,a=Gr.secondsOfDay;letu;constc=s-2451545;u=a>=43200?(c+.5)/vt.DAYS_PER_JULIAN_CENTURY:(c-.5)/vt.DAYS_PER_JULIAN_CENTURY;constl=Lr+u*(Qr+u*($r+u*Wr)),d=l*Zr%o.CesiumMath.TWO_PI,f=Yr+Hr*(s-2451545.5),p=(a+.5*vt.SECONDS_PER_DAY)%vt.SECONDS_PER_DAY,h=d+f*p,m=Math.cos(h),g=Math.sin(h);returnr.defined(i)?(i[0]=m,i[1]=-g,i[2]=0,i[3]=g,i[4]=m,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):newt.Matrix3(m,g,0,-g,m,0,0,0,1)},Er.iau2006XysData=newCr,Er.earthOrientationParameters=nr.NONE;constJr=32.184,Xr=2451545;Er.preloadIcrfFixed=function(e){constt=e.start.dayNumber,n=e.start.secondsOfDay+Jr,r=e.stop.dayNumber,o=e.stop.secondsOfDay+Jr,i=Er.iau2006XysData.preload(t,n,r,o),s=Er.earthOrientationParameters.getPromiseToLoad();returnPromise.all([i,s])},Er.computeIcrfToFixedMatrix=function(e,o){if(!r.defined(e))thrownewn.DeveloperError("date is required.");r.defined(o)||(o=newt.Matrix3);consti=Er.computeFixedToIcrfMatrix(e,o);if(r.defined(i))returnt.Matrix3.transpose(i,o)};constKr=newwr(0,0,0),eo=newpt(0,0,0,0,0),to=newt.Matrix3,no=newt.Matrix3;Er.computeFixedToIcrfMatrix=function(e,i){if(!r.defined(e))thrownewn.DeveloperError("date is required.");r.defined(i)||(i=newt.Matrix3);consts=Er.earthOrientationParameters.compute(e,eo);if(!r.defined(s))return;consta=e.dayNumber,u=e.secondsOfDay+Jr,c=Er.iau2006XysData.computeXysRadians(a,u,Kr);if(!r.defined(c))return;constl=c.x+s.xPoleOffset,d=c.y+s.yPoleOffset,f=1/(1+Math.sqrt(1-l*l-d*d)),p=to;p[0]=1-f*l*l,p[3]=-f*l*d,p[6]=l,p[1]=-f*l*d,p[4]=1-f*d*d,p[7]=d,p[2]=-l,p[5]=-d,p[8]=1-f*(l*l+d*d);consth=t.Matrix3.fromRotationZ(-c.s,no),m=t.Matrix3.multiply(p,h,to),g=e.dayNumber,y=e.secondsOfDay-Nt.computeTaiMinusUtc(e)+s.ut1MinusUtc,v=g-2451545,w=y/vt.SECONDS_PER_DAY;letC=.779057273264+w+.00273781191135448*(v+w);C=C%1*o.CesiumMath.TWO_PI;constb=t.Matrix3.fromRotationZ(C,no),_=t.Matrix3.multiply(m,b,to),x=Math.cos(s.xPoleWander),E=Math.cos(s.yPoleWander),O=Math.sin(s.xPoleWander),S=Math.sin(s.yPoleWander);letA=a-Xr+u/vt.SECONDS_PER_DAY;A/=36525;constq=-47e-6*A*o.CesiumMath.RADIANS_PER_DEGREE/3600,k=Math.cos(q),D=Math.sin(q),I=no;returnI[0]=x*k,I[1]=x*D,I[2]=O,I[3]=-E*D+S*O*k,I[4]=E*k+S*O*D,I[5]=-S*x,I[6]=-S*D-E*O*k,I[7]=S*k-E*O*D,I[8]=E*x,t.Matrix3.multiply(_,I,i)};constro=newt.Cartesian4;Er.pointToWindowCoordinates=function(e,t,n,r){returnr=Er.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},Er.pointToGLWindowCoordinates=function(e,o,i,s){if(!r.defined(e))thrownewn.DeveloperError("modelViewProjectionMatrix is required.");if(!r.defined(o))thrownewn.DeveloperError("viewportTransformation is required.");if(!r.defined(i))thrownewn.DeveloperError("point is required.");r.defined(s)||(s=newt.Cartesian2);consta=ro;returnt.Matrix4.multiplyByVector(e,t.Cartesian4.fromElements(i.x,i.y,i.z,1,a),a),t.Cartesian4.multiplyByScalar(a,1/a.w,a),t.Matrix4.multiplyByVector(o,a,a),t.Cartesian2.fromCartesian4(a,s)};constoo=newt.Cartesian3,io=newt.Cartesian3,so=newt.Cartesian3;Er.rotationMatrixFromPositionVelocity=function(e,i,s,a){if(!r.defined(e))thrownewn.DeveloperError("position is required.");if(!r.defined(i))thrownewn.DeveloperError("velocity is required.");constu=r.defaultValue(s,t.Ellipsoid.WGS84).geodeticSurfaceNormal(e,oo);letc=t.Cartesian3.cross(i,u,io);t.Cartesian3.equalsEpsilon(c,t.Cartesian3.ZERO,o.CesiumMath.EPSILON6)&&(c=t.Cartesian3.clone(t.Cartesian3.UNIT_X,c));constl=t.Cartesian3.cross(c,i,so);returnt.Cartesian3.normalize(l,l),t.Cartesian3.cross(i,l,c),t.Cartesian3.negate(c,c),t.Cartesian3.normalize(c,c),r.defined(a)||(a=newt.Matrix3),a[0]=i.x,a[1]=i.y,a[2]=i.z,a[3]=c.x,a[4]=c.y,a[5]=c.z,a[6]=l.x,a[7]=l.y,a[8]=l.z,a};constao=newt.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),uo=newt.Cartographic,co=newt.Cartesian3,lo=newt.Cartesian3,fo=newt.Matrix3,po=newt.Matrix4,ho=newt.Matrix4;Er.basisTo2D=function(e,o,i){if(!r.defined(e))thrownewn.DeveloperError("projection is required.");if(!r.defined(o))thrownewn.DeveloperError("matrix is required.");if(!r.defined(i))thrownewn.DeveloperError("result is required.");consts=t.Matrix4.getTranslation(o,lo),a=e.ellipsoid,u=a.cartesianToCartographic(s,uo),c=e.project(u,co);t.Cartesian3.fromElements(c.z,c.x,c.y,c);constl=Er.eastNorthUpToFixedFrame(s,a,po),d=t.Matrix4.inverseTransformation(l,ho),f=t.Matrix4.getMatrix3(o,fo),p=t.Matrix4.multiplyByMatrix3(d,f,i);returnt.Matrix4.multiply(ao,p,i),t.Matrix4.setTranslation(i,c,i),i},Er.wgs84To2DModelMatrix=function(e,o,i){if(!r.defined(e))thrownewn.DeveloperError("projection is required.");if(!r.defined(o))thrownewn.DeveloperError("center is required.");if(!r.defined(i))thrownewn.DeveloperError("result is required.");consts=e.ellipsoid,a=Er.eastNorthUpToFixedFrame(o,s,po),u=t.Matrix4.inverseTransformation(a,ho),c=s.cartesianToCartographic(o,uo),l=e.project(c,co);t.Cartesian3.fromElements(l.z,l.x,l.y,l);constd=t.Matrix4.fromTranslation(l,po);returnt.Matrix4.multiply(ao,u,i),t.Matrix4.multiply(d,i,i),i},e.BoundingSphere=d,e.FeatureDetection=je,e.GeographicProjection=a,e.Intersect=c,e.Interval=l,e.Quaternion=Fe,e.Resource=$n,e.Transforms=Er,e.buildModuleUrl=vr}));
define(["exports","./defaultValue-94c3e563","./RuntimeError-c581ca93"],(function(e,t,n){"use strict";functiono(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.position=t.defaultValue(e.position,!1),this.normal=t.defaultValue(e.normal,!1),this.st=t.defaultValue(e.st,!1),this.bitangent=t.defaultValue(e.bitangent,!1),this.tangent=t.defaultValue(e.tangent,!1),this.color=t.defaultValue(e.color,!1)}o.POSITION_ONLY=Object.freeze(newo({position:!0})),o.POSITION_AND_NORMAL=Object.freeze(newo({position:!0,normal:!0})),o.POSITION_NORMAL_AND_ST=Object.freeze(newo({position:!0,normal:!0,st:!0})),o.POSITION_AND_ST=Object.freeze(newo({position:!0,st:!0})),o.POSITION_AND_COLOR=Object.freeze(newo({position:!0,color:!0})),o.ALL=Object.freeze(newo({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),o.DEFAULT=o.POSITION_NORMAL_AND_ST,o.packedLength=6,o.pack=function(e,o,i){if(!t.defined(e))thrownewn.DeveloperError("value is required");if(!t.defined(o))thrownewn.DeveloperError("array is required");returni=t.defaultValue(i,0),o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o},o.unpack=function(e,i,r){if(!t.defined(e))thrownewn.DeveloperError("array is required");returni=t.defaultValue(i,0),t.defined(r)||(r=newo),r.position=1===e[i++],r.normal=1===e[i++],r.st=1===e[i++],r.tangent=1===e[i++],r.bitangent=1===e[i++],r.color=1===e[i],r},o.clone=function(e,n){if(t.defined(e))returnt.defined(n)||(n=newo),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},e.VertexFormat=o}));
define(["exports","./Matrix2-fc7e9822","./defaultValue-94c3e563","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6"],(function(e,t,i,o,r){"use strict";functiona(e){this._ellipsoid=i.defaultValue(e,t.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(a.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}}}),a.mercatorAngleToGeodeticLatitude=function(e){returnr.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},a.geodeticLatitudeToMercatorAngle=function(e){e>a.MaximumLatitude?e=a.MaximumLatitude:e<-a.MaximumLatitude&&(e=-a.MaximumLatitude);constt=Math.sin(e);return.5*Math.log((1+t)/(1-t))},a.MaximumLatitude=a.mercatorAngleToGeodeticLatitude(Math.PI),a.prototype.project=function(e,o){constr=this._semimajorAxis,n=e.longitude*r,u=a.geodeticLatitudeToMercatorAngle(e.latitude)*r,d=e.height;returni.defined(o)?(o.x=n,o.y=u,o.z=d,o):newt.Cartesian3(n,u,d)},a.prototype.unproject=function(e,r){if(!i.defined(e))thrownewo.DeveloperError("cartesian is required");constn=this._oneOverSemimajorAxis,u=e.x*n,d=a.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;returni.defined(r)?(r.longitude=u,r.latitude=d,r.height=s,r):newt.Cartographic(u,d,s)},e.WebMercatorProjection=a}));