!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Cesium={})}(this,function(exports){"use strict";function appendForwardSlash(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}function defined(e){return null!=e}function DeveloperError(e){let t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}defined(Object.create)&&(DeveloperError.prototype=Object.create(Error.prototype),DeveloperError.prototype.constructor=DeveloperError),DeveloperError.prototype.toString=function(){let e=this.name+": "+this.message;return defined(this.stack)&&(e+=` `+this.stack.toString()),e},DeveloperError.throwInstantiationError=function(){throw new DeveloperError("This function defines an interface and should not be called directly.")};const Check={};function getUndefinedErrorMessage(e){return e+" is required, actual value was undefined"}function getFailedTypeErrorMessage(e,t,i){return`Expected ${i} to be typeof ${t}, actual typeof was `+e}function defaultValue(e,t){return null!=e?e:t}Check.typeOf={},Check.defined=function(e,t){if(!defined(t))throw new DeveloperError(getUndefinedErrorMessage(e))},Check.typeOf.func=function(e,t){if("function"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"function",e))},Check.typeOf.string=function(e,t){if("string"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"string",e))},Check.typeOf.number=function(e,t){if("number"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"number",e))},Check.typeOf.number.lessThan=function(e,t,i){if(Check.typeOf.number(e,t),i<=t)throw new DeveloperError(`Expected ${e} to be less than ${i}, actual value was `+t)},Check.typeOf.number.lessThanOrEquals=function(e,t,i){if(Check.typeOf.number(e,t),i>>0,this.mti=1;this.mti>>30,this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0},MersenneTwister.prototype.init_by_array=function(e,t){var i,n,r;for(this.init_seed(19650218),i=1,n=0,r=this.N>t?this.N:t;r;r--){var a=this.mt[i-1]^this.mt[i-1]>>>30;this.mt[i]=(this.mt[i]^(1664525*((4294901760&a)>>>16)<<16)+1664525*(65535&a))+e[n]+n,this.mt[i]>>>=0,n++,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1),t<=n&&(n=0)}for(r=this.N-1;r;r--)a=this.mt[i-1]^this.mt[i-1]>>>30,this.mt[i]=(this.mt[i]^(1566083941*((4294901760&a)>>>16)<<16)+1566083941*(65535&a))-i,this.mt[i]>>>=0,++i>=this.N&&(this.mt[0]=this.mt[this.N-1],i=1);this.mt[0]=2147483648},MersenneTwister.prototype.random_int=function(){var e,t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_seed(5489),t=0;t>>1^i[1&e];for(;t>>1^i[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^i[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,((e^=e<<15&4022730752)^e>>>18)>>>0},MersenneTwister.prototype.random_int31=function(){return this.random_int()>>>1},MersenneTwister.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},MersenneTwister.prototype.random=function(){return this.random_int()*(1/4294967296)},MersenneTwister.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},MersenneTwister.prototype.random_long=function(){return(67108864*(this.random_int()>>>5)+(this.random_int()>>>6))*(1/9007199254740992)};var mersenneTwister=MersenneTwister;const CesiumMath={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};CesiumMath.sign=defaultValue(Math.sign,function(e){return 0==(e=+e)||e!=e?e:0=Math.PI?e-t:e},CesiumMath.clampToLatitudeRange=function(e){return CesiumMath.clamp(e,-1*CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO)},CesiumMath.negativePiToPi=function(e){return e>=-CesiumMath.PI&&e<=CesiumMath.PI?e:CesiumMath.zeroToTwoPi(e+CesiumMath.PI)-CesiumMath.PI},CesiumMath.zeroToTwoPi=function(e){if(0<=e&&e<=CesiumMath.TWO_PI)return e;var t=CesiumMath.mod(e,CesiumMath.TWO_PI);return Math.abs(t)CesiumMath.EPSILON14?CesiumMath.TWO_PI:t},CesiumMath.mod=function(e,t){return CesiumMath.sign(e)===CesiumMath.sign(t)&&Math.abs(e)t?i:e},CesiumMath.isPowerOfTwo=function(e){return 0!==e&&0==(e&e-1)},CesiumMath.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},CesiumMath.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,((e|=e>>32)>>>0)-(e>>>1)},CesiumMath.clamp=function(e,t,i){return eMath.abs(e)?CesiumMath.PI_OVER_TWO-n:n,n=e<0?CesiumMath.PI-n:n,n=t<0?-n:n,n},Cartesian3.fromSpherical=function(e,t){defined(t)||(t=new Cartesian3);var i=e.clock,n=e.cone,r=defaultValue(e.magnitude,1),e=r*Math.sin(n);return t.x=e*Math.cos(i),t.y=e*Math.sin(i),t.z=r*Math.cos(n),t},Cartesian3.fromElements=function(e,t,i,n){return defined(n)?(n.x=e,n.y=t,n.z=i,n):new Cartesian3(e,t,i)},Cartesian3.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Cartesian3(e.x,e.y,e.z)},Cartesian3.fromCartesian4=Cartesian3.clone,Cartesian3.packedLength=3,Cartesian3.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i]=e.z,t},Cartesian3.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Cartesian3:i).x=e[t++],i.y=e[t++],i.z=e[t],i},Cartesian3.packArray=function(t,i){var n=t.length,e=3*n;defined(i)?!Array.isArray(i)&&i.length!==e||i.length===e||(i.length=e):i=new Array(e);for(let e=0;eCesiumMath.EPSILON12;);return defined(r)?(r.x=a*y,r.y=o*C,r.z=s*v,r):new Cartesian3(a*y,o*C,s*v)}function Cartographic(e,t,i){this.longitude=defaultValue(e,0),this.latitude=defaultValue(t,0),this.height=defaultValue(i,0)}Cartographic.fromRadians=function(e,t,i,n){return i=defaultValue(i,0),defined(n)?(n.longitude=e,n.latitude=t,n.height=i,n):new Cartographic(e,t,i)},Cartographic.fromDegrees=function(e,t,i,n){return e=CesiumMath.toRadians(e),t=CesiumMath.toRadians(t),Cartographic.fromRadians(e,t,i,n)};const cartesianToCartographicN$1=new Cartesian3,cartesianToCartographicP$1=new Cartesian3,cartesianToCartographicH$1=new Cartesian3,wgs84OneOverRadii=new Cartesian3(1/6378137,1/6378137,1/6356752.314245179),wgs84OneOverRadiiSquared=new Cartesian3(1/40680631590769,1/40680631590769,1/40408299984661.445),wgs84CenterToleranceSquared=CesiumMath.EPSILON1;function initialize$e(e,t,i,n){t=defaultValue(t,0),i=defaultValue(i,0),n=defaultValue(n,0),e._radii=new Cartesian3(t,i,n),e._radiiSquared=new Cartesian3(t*t,i*i,n*n),e._radiiToTheFourth=new Cartesian3(t*t*t*t,i*i*i*i,n*n*n*n),e._oneOverRadii=new Cartesian3(0===t?0:1/t,0===i?0:1/i,0===n?0:1/n),e._oneOverRadiiSquared=new Cartesian3(0===t?0:1/(t*t),0===i?0:1/(i*i),0===n?0:1/(n*n)),e._minimumRadius=Math.min(t,i,n),e._maximumRadius=Math.max(t,i,n),e._centerToleranceSquared=CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ellipsoid(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,initialize$e(this,e,t,i)}Cartographic.fromCartesian=function(e,t,i){var n=defined(t)?t.oneOverRadii:wgs84OneOverRadii,r=defined(t)?t.oneOverRadiiSquared:wgs84OneOverRadiiSquared,n=scaleToGeodeticSurface(e,n,r,defined(t)?t._centerToleranceSquared:wgs84CenterToleranceSquared,cartesianToCartographicP$1);if(defined(n)){t=Cartesian3.multiplyComponents(n,r,cartesianToCartographicN$1),t=Cartesian3.normalize(t,t),r=Cartesian3.subtract(e,n,cartesianToCartographicH$1),n=Math.atan2(t.y,t.x),t=Math.asin(t.z),r=CesiumMath.sign(Cartesian3.dot(r,e))*Cartesian3.magnitude(r);return defined(i)?(i.longitude=n,i.latitude=t,i.height=r,i):new Cartographic(n,t,r)}},Cartographic.toCartesian=function(e,t,i){return Cartesian3.fromRadians(e.longitude,e.latitude,e.height,t,i)},Cartographic.clone=function(e,t){if(defined(e))return defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Cartographic(e.longitude,e.latitude,e.height)},Cartographic.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},Cartographic.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},Cartographic.ZERO=Object.freeze(new Cartographic(0,0,0)),Cartographic.prototype.clone=function(e){return Cartographic.clone(this,e)},Cartographic.prototype.equals=function(e){return Cartographic.equals(this,e)},Cartographic.prototype.equalsEpsilon=function(e,t){return Cartographic.equalsEpsilon(this,e,t)},Cartographic.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(Ellipsoid.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),Ellipsoid.clone=function(e,t){if(defined(e)){var i=e._radii;return defined(t)?(Cartesian3.clone(i,t._radii),Cartesian3.clone(e._radiiSquared,t._radiiSquared),Cartesian3.clone(e._radiiToTheFourth,t._radiiToTheFourth),Cartesian3.clone(e._oneOverRadii,t._oneOverRadii),Cartesian3.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ellipsoid(i.x,i.y,i.z)}},Ellipsoid.fromCartesian3=function(e,t){return defined(t)||(t=new Ellipsoid),defined(e)&&initialize$e(t,e.x,e.y,e.z),t},Ellipsoid.WGS84=Object.freeze(new Ellipsoid(6378137,6378137,6356752.314245179)),Ellipsoid.UNIT_SPHERE=Object.freeze(new Ellipsoid(1,1,1)),Ellipsoid.MOON=Object.freeze(new Ellipsoid(CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS)),Ellipsoid.prototype.clone=function(e){return Ellipsoid.clone(this,e)},Ellipsoid.packedLength=Cartesian3.packedLength,Ellipsoid.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._radii,t,i),t},Ellipsoid.unpack=function(e,t,i){t=defaultValue(t,0);t=Cartesian3.unpack(e,t);return Ellipsoid.fromCartesian3(t,i)},Ellipsoid.prototype.geocentricSurfaceNormal=Cartesian3.normalize,Ellipsoid.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,n=e.latitude,r=Math.cos(n),e=r*Math.cos(i),i=r*Math.sin(i),n=Math.sin(n);return(t=!defined(t)?new Cartesian3:t).x=e,t.y=i,t.z=n,Cartesian3.normalize(t,t)},Ellipsoid.prototype.geodeticSurfaceNormal=function(e,t){if(!Cartesian3.equalsEpsilon(e,Cartesian3.ZERO,CesiumMath.EPSILON14))return defined(t)||(t=new Cartesian3),t=Cartesian3.multiplyComponents(e,this._oneOverRadiiSquared,t),Cartesian3.normalize(t,t)};const cartographicToCartesianNormal=new Cartesian3,cartographicToCartesianK=new Cartesian3;Ellipsoid.prototype.cartographicToCartesian=function(e,t){var i=cartographicToCartesianNormal,n=cartographicToCartesianK;this.geodeticSurfaceNormalCartographic(e,i),Cartesian3.multiplyComponents(this._radiiSquared,i,n);var r=Math.sqrt(Cartesian3.dot(i,n));return Cartesian3.divideByScalar(n,r,n),Cartesian3.multiplyByScalar(i,e.height,i),defined(t)||(t=new Cartesian3),Cartesian3.add(n,i,t)},Ellipsoid.prototype.cartographicArrayToCartesianArray=function(t,i){var n=t.length;defined(i)?i.length=n:i=new Array(n);for(let e=0;e=this._radii.z-t))return i};const abscissas=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],weights=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function gaussLegendreQuadrature(e,t,i){var n=.5*(t+e),r=.5*(t-e);let a=0;for(let e=0;e<5;e++){const t=r*abscissas[e];a+=weights[e]*(i(n+t)+i(n-t))}return a*=r,a}function GeographicProjection(e){this._ellipsoid=defaultValue(e,Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Ellipsoid.prototype.surfaceArea=function(e){const t=e.west;let r=e.east;for(var i=e.south,e=e.north;rn&&(r=e,n=i)}let a=1,o=0;var s=rowVal[r],l=colVal[r];if(Math.abs(t[Matrix3.getElementIndex(l,s)])>i){const e=(t[Matrix3.getElementIndex(l,l)]-t[Matrix3.getElementIndex(s,s)])/2/t[Matrix3.getElementIndex(l,s)];var c=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e));a=1/Math.sqrt(1+c*c),o=c*a}return(e=Matrix3.clone(Matrix3.IDENTITY,e))[Matrix3.getElementIndex(s,s)]=e[Matrix3.getElementIndex(l,l)]=a,e[Matrix3.getElementIndex(l,s)]=o,e[Matrix3.getElementIndex(s,l)]=-o,e}const jMatrix=new Matrix3,jMatrixTranspose=new Matrix3;Matrix3.computeEigenDecomposition=function(e,t){var i=CesiumMath.EPSILON20;let n=0,r=0;for(var a=(t=!defined(t)?{}:t).unitary=Matrix3.clone(Matrix3.IDENTITY,t.unitary),o=t.diagonal=Matrix3.clone(e,t.diagonal),s=i*computeFrobeniusNorm(o);r<10&&offDiagonalFrobeniusNorm(o)>s;)shurDecomposition(o,jMatrix),Matrix3.transpose(jMatrix,jMatrixTranspose),Matrix3.multiply(o,jMatrix,o),Matrix3.multiply(jMatrixTranspose,o,o),Matrix3.multiply(a,jMatrix,a),2<++n&&(++r,n=0);return t},Matrix3.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},Matrix3.determinant=function(e){var t=e[0],i=e[3],n=e[6],r=e[1],a=e[4],o=e[7],s=e[2],l=e[5],e=e[8];return t*(a*e-l*o)+r*(l*n-i*e)+s*(i*o-a*n)},Matrix3.inverse=function(e,t){var i=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],e=Matrix3.determinant(e);return t[0]=o*u-c*s,t[1]=c*r-n*u,t[2]=n*s-o*r,t[3]=l*s-a*u,t[4]=i*u-l*r,t[5]=a*r-i*s,t[6]=a*c-l*o,t[7]=l*n-i*c,t[8]=i*o-a*n,Matrix3.multiplyByScalar(t,1/e,t)};const scratchTransposeMatrix$1=new Matrix3;function Cartesian4(e,t,i,n){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.z=defaultValue(i,0),this.w=defaultValue(n,0)}Matrix3.inverseTranspose=function(e,t){return Matrix3.inverse(Matrix3.transpose(e,scratchTransposeMatrix$1),t)},Matrix3.equals=function(e,t){return e===t||defined(e)&&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]},Matrix3.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},Matrix3.IDENTITY=Object.freeze(new Matrix3(1,0,0,0,1,0,0,0,1)),Matrix3.ZERO=Object.freeze(new Matrix3(0,0,0,0,0,0,0,0,0)),Matrix3.COLUMN0ROW0=0,Matrix3.COLUMN0ROW1=1,Matrix3.COLUMN0ROW2=2,Matrix3.COLUMN1ROW0=3,Matrix3.COLUMN1ROW1=4,Matrix3.COLUMN1ROW2=5,Matrix3.COLUMN2ROW0=6,Matrix3.COLUMN2ROW1=7,Matrix3.COLUMN2ROW2=8,Object.defineProperties(Matrix3.prototype,{length:{get:function(){return Matrix3.packedLength}}}),Matrix3.prototype.clone=function(e){return Matrix3.clone(this,e)},Matrix3.prototype.equals=function(e){return Matrix3.equals(this,e)},Matrix3.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},Matrix3.prototype.equalsEpsilon=function(e,t){return Matrix3.equalsEpsilon(this,e,t)},Matrix3.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`},Cartesian4.fromElements=function(e,t,i,n,r){return defined(r)?(r.x=e,r.y=t,r.z=i,r.w=n,r):new Cartesian4(e,t,i,n)},Cartesian4.fromColor=function(e,t){return defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Cartesian4(e.red,e.green,e.blue,e.alpha)},Cartesian4.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Cartesian4(e.x,e.y,e.z,e.w)},Cartesian4.packedLength=4,Cartesian4.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},Cartesian4.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Cartesian4:i).x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},Cartesian4.packArray=function(t,i){var n=t.length,e=4*n;defined(i)?!Array.isArray(i)&&i.length!==e||i.length===e||(i.length=e):i=new Array(e);for(let e=0;eo-a&&(n=a,r=o,r>CesiumMath.PI&&(r-=CesiumMath.TWO_PI),n>CesiumMath.PI&&(n-=CesiumMath.TWO_PI)),defined(e)?(e.west=n,e.south=s,e.east=r,e.north=l,e):new Rectangle(n,s,r,l)},Rectangle.fromCartesianArray=function(i,n,e){n=defaultValue(n,Ellipsoid.WGS84);let r=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let e=0,t=i.length;es-o&&(r=o,a=s,a>CesiumMath.PI&&(a-=CesiumMath.TWO_PI),r>CesiumMath.PI&&(r-=CesiumMath.TWO_PI)),defined(e)?(e.west=r,e.south=l,e.east=a,e.north=c,e):new Rectangle(r,l,a,c)},Rectangle.clone=function(e,t){if(defined(e))return defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Rectangle(e.west,e.south,e.east,e.north)},Rectangle.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.west-t.west)<=i&&Math.abs(e.south-t.south)<=i&&Math.abs(e.east-t.east)<=i&&Math.abs(e.north-t.north)<=i},Rectangle.prototype.clone=function(e){return Rectangle.clone(this,e)},Rectangle.prototype.equals=function(e){return Rectangle.equals(this,e)},Rectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Rectangle.prototype.equalsEpsilon=function(e,t){return Rectangle.equalsEpsilon(this,e,t)},Rectangle.validate=function(e){},Rectangle.southwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Cartographic(e.west,e.south)},Rectangle.northwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Cartographic(e.west,e.north)},Rectangle.northeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Cartographic(e.east,e.north)},Rectangle.southeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Cartographic(e.east,e.south)},Rectangle.center=function(e,t){let i=e.east;var n=e.west;it||CesiumMath.equalsEpsilon(i,t,CesiumMath.EPSILON14))&&(i=e.south&&n<=e.north};const subsampleLlaScratch=new Cartographic;function BoundingSphere(e,t){this.center=Cartesian3.clone(defaultValue(e,Cartesian3.ZERO)),this.radius=defaultValue(t,0)}Rectangle.subsample=function(t,i,e,n){i=defaultValue(i,Ellipsoid.WGS84),e=defaultValue(e,0),defined(n)||(n=[]);let r=0;const a=t.north,o=t.south,s=t.east,l=t.west,c=subsampleLlaScratch;c.height=e,c.longitude=l,c.latitude=a,n[r]=i.cartographicToCartesian(c,n[r]),r++,c.longitude=s,n[r]=i.cartographicToCartesian(c,n[r]),r++,c.latitude=o,n[r]=i.cartographicToCartesian(c,n[r]),r++,c.longitude=l,n[r]=i.cartographicToCartesian(c,n[r]),r++,c.latitude=a<0?a:0o.x&&Cartesian3.clone(i,o),cs.y&&Cartesian3.clone(i,s),dl.z&&Cartesian3.clone(i,l)}const d=Cartesian3.magnitudeSquared(Cartesian3.subtract(o,n,fromPointsScratch)),h=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,r,fromPointsScratch)),p=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch));let f=n,m=o,g=d;h>g&&(g=h,f=r,m=s),p>g&&(g=p,f=a,m=l);const _=fromPointsRitterCenter;_.x=.5*(f.x+m.x),_.y=.5*(f.y+m.y),_.z=.5*(f.z+m.z);let y=Cartesian3.magnitudeSquared(Cartesian3.subtract(m,_,fromPointsScratch)),C=Math.sqrt(y);const v=fromPointsMinBoxPt;v.x=n.x,v.y=r.y,v.z=a.z;const S=fromPointsMaxBoxPt;S.x=o.x,S.y=s.y,S.z=l.z;var T=Cartesian3.midpoint(v,S,fromPointsNaiveCenterScratch);let A=0;for(u=0;uA&&(A=t);const n=Cartesian3.magnitudeSquared(Cartesian3.subtract(i,_,fromPointsScratch));if(n>y){const e=Math.sqrt(n);C=.5*(C+e),y=C*C;const t=e-C;_.x=(C*_.x+t*i.x)/e,_.y=(C*_.y+t*i.y)/e,_.z=(C*_.z+t*i.z)/e}}return Cl.x&&Cartesian3.clone(r,l),nc.y&&Cartesian3.clone(r,c),du.z&&Cartesian3.clone(r,u)}var p=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),f=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,o,fromPointsScratch)),m=Cartesian3.magnitudeSquared(Cartesian3.subtract(u,s,fromPointsScratch));let g=a,_=l,y=p;f>y&&(y=f,g=o,_=c),m>y&&(y=m,g=s,_=u);const C=fromPointsRitterCenter;C.x=.5*(g.x+_.x),C.y=.5*(g.y+_.y),C.z=.5*(g.z+_.z);let v=Cartesian3.magnitudeSquared(Cartesian3.subtract(_,C,fromPointsScratch)),S=Math.sqrt(v);const T=fromPointsMinBoxPt;T.x=a.x,T.y=o.y,T.z=s.z;const A=fromPointsMaxBoxPt;A.x=l.x,A.y=c.y,A.z=u.z;var x=Cartesian3.midpoint(T,A,fromPointsNaiveCenterScratch);let E=0;for(h=0;hE&&(E=i);const n=Cartesian3.magnitudeSquared(Cartesian3.subtract(r,C,fromPointsScratch));if(n>v){const e=Math.sqrt(n);S=.5*(S+e),v=S*S;const t=e-S;C.x=(S*C.x+t*r.x)/e,C.y=(S*C.y+t*r.y)/e,C.z=(S*C.z+t*r.z)/e}}return Ss.x&&Cartesian3.clone(n,s),ul.y&&Cartesian3.clone(n,l),hc.z&&Cartesian3.clone(n,c)}const h=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,r,fromPointsScratch)),p=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),f=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,o,fromPointsScratch));let m=r,g=s,_=h;p>_&&(_=p,m=a,g=l),f>_&&(_=f,m=o,g=c);const y=fromPointsRitterCenter;y.x=.5*(m.x+g.x),y.y=.5*(m.y+g.y),y.z=.5*(m.z+g.z);let C=Cartesian3.magnitudeSquared(Cartesian3.subtract(g,y,fromPointsScratch)),v=Math.sqrt(C);const S=fromPointsMinBoxPt;S.x=r.x,S.y=a.y,S.z=o.z;const T=fromPointsMaxBoxPt;T.x=s.x,T.y=l.y,T.z=c.z;var A=Cartesian3.midpoint(S,T,fromPointsNaiveCenterScratch);let x=0;for(d=0;dx&&(x=i);const r=Cartesian3.magnitudeSquared(Cartesian3.subtract(n,y,fromPointsScratch));if(r>C){const e=Math.sqrt(r);v=.5*(v+e),C=v*v;const t=e-v;y.x=(v*y.x+t*n.x)/e,y.y=(v*y.y+t*n.y)/e,y.z=(v*y.z+t*n.z)/e}}return vi.radius&&(i.radius=t),i},BoundingSphere.intersectPlane=function(e,t){var i=e.center,n=e.radius,e=t.normal,t=Cartesian3.dot(e,i)+t.distance;return t<-n?Intersect$1.OUTSIDE:t= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=Math.floor,C=String.fromCharCode;function v(e){throw new RangeError(c[e])}function u(e,t){for(var i=e.length,n=[];i--;)n[i]=t(e[i]);return n}function d(e,t){var i=e.split("@"),n="";return 1>>10&1023|55296),e=56320|1023&e),t+C(e)}).join("")}function T(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,i){var n=0;for(e=i?y(e/700):e>>1,e+=y(e/t);455=_||l>y((g-d)/o))&&v("overflow"),d+=l*o,!(l<(l=s<=p?1:p+26<=s?26:s-p));s+=_)o>y(g/(l=_-l))&&v("overflow"),o*=l;p=A(d-a,t=c.length+1,0==a),y(d/t)>g-h&&v("overflow"),h+=y(d/t),d%=t,c.splice(d++,0,h)}return f(c)}function p(e){for(var t,i,n,r,a,o,s,l,c,u=[],d=(e=S(e)).length,h=128,p=0,f=72,m=0;m=h&&oy((g-p)/(s=t+1))&&v("overflow"),p+=(n-h)*s,h=n,m=0;mg&&v("overflow"),o==h){for(r=p,a=_;!(r<(l=a<=f?1:f+26<=a?26:a-f));a+=_)u.push(C(T(l+(c=r-l)%(l=_-l),0))),r=y(c/l);u.push(C(T(r,0))),f=A(p,s,t==i),p=0,++t}++p,++h}return u.join("")}if(r={version:"1.3.2",ucs2:{decode:S,encode:f},decode:h,encode:p,toASCII:function(e){return d(e,function(e){return s.test(e)?"xn--"+p(e):e})},toUnicode:function(e){return d(e,function(e){return o.test(e)?h(e.slice(4).toLowerCase()):e})}},t&&i)if(m.exports==t)i.exports=r;else for(a in r)r.hasOwnProperty(a)&&(t[a]=r[a]);else e.punycode=r}(commonjsGlobal)}),IPv6=createCommonjsModule(function(e){var t=commonjsGlobal,i=function(e){var t=e&&e.IPv6;return{best:function(e){var t,i=e.toLowerCase().split(":"),n=i.length,r=8;for(""===i[0]&&""===i[1]&&""===i[2]?(i.shift(),i.shift()):""===i[0]&&""===i[1]?i.shift():""===i[n-1]&&""===i[n-2]&&i.pop(),-1!==i[(n=i.length)-1].indexOf(".")&&(r=7),t=0;t=e.length-1)return!1;var i=e.lastIndexOf(".",t-1);if(i<=0||t-1<=i)return!1;var n=r.list[e.slice(t+1)];return!!n&&0<=n.indexOf(" "+e.slice(i+1,t)+" ")},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(0<=e.lastIndexOf(".",t-1))return!1;var i=r.list[e.slice(t+1)];return!!i&&0<=i.indexOf(" "+e.slice(0,t)+" ")},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var i=e.lastIndexOf(".",t-1);if(i<=0||t-1<=i)return null;var n=r.list[e.slice(t+1)];return!n||n.indexOf(" "+e.slice(i+1,t)+" ")<0?null:e.slice(i+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r};e.exports?e.exports=i():t.SecondLevelDomains=i(t)}),URI=createCommonjsModule(function(e){var t=commonjsGlobal,i=function(s,t,c,i){var n=i&&i.URI;function f(e,t){var i=1<=arguments.length;if(!(this instanceof f))return i?2<=arguments.length?new f(e,t):new f(e):new f;if(void 0===e){if(i)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&i)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}f.version="1.19.11";var e=f.prototype,l=Object.prototype.hasOwnProperty;function o(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function d(e){return"Array"===u(e)}function h(e,t){var i,n,r={};if("RegExp"===u(t))r=null;else if(d(t))for(i=0,n=t.length;i]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,f.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},f.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,f.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,f.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},f.hostProtocols=["http","https"],f.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,f.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"},f.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return f.domAttributes[t]}},f.encode=a,f.decode=decodeURIComponent,f.iso8859=function(){f.encode=escape,f.decode=unescape},f.unicode=function(){f.encode=a,f.decode=decodeURIComponent},f.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"}}}},f.encodeQuery=function(e,t){e=f.encode(e+"");return(t=void 0===t?f.escapeQuerySpace:t)?e.replace(/%20/g,"+"):e},f.decodeQuery=function(e,t){e+="",void 0===t&&(t=f.escapeQuerySpace);try{return f.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};function _(i,n){return function(t){try{return f[n](t+"").replace(f.characters[i][n].expression,function(e){return f.characters[i][n].map[e]})}catch(e){return t}}}var y,C={encode:"encode",decode:"decode"};for(y in C)f[y+"PathSegment"]=_("pathname",C[y]),f[y+"UrnPathSegment"]=_("urnpath",C[y]);function v(a,o,s){return function(e){for(var t=s?function(e){return f[o](f[s](e))}:f[o],i=(e+"").split(a),n=0,r=i.length;n>>0,o=Math.max(0,Math.min(p,a)),s=[],l=a-o+1,c=[],u=y();if(o)for(n=u.progress,i=function(e){c.push(e),--l||(t=i=C,u.reject(c))},t=function(e){s.push(e),--o||(t=i=C,u.resolve(s))},r=0;r>>0,a=[],o=y();if(r)for(i=function(e,t){_(e,s).then(function(e){a[t]=e,--r||o.resolve(a)},o.reject)},n=0;n>>0;if((i=arguments).length<=1)for(;;){if(r in t){n=t[r++];break}if(++r>=a)throw new TypeError}else n=i[1];for(;rn&&(r=t[n],this._length=n),r},Heap.prototype.pop=function(e){if(e=defaultValue(e,0),0!==this._length){const t=this._array,i=t[e];return swap$4(t,e,--this._length),this.heapify(e),t[this._length]=void 0,i}};const statistics={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let priorityHeapLength=20;const requestHeap=new Heap({comparator:sortRequests});requestHeap.maximumLength=priorityHeapLength,requestHeap.reserve(priorityHeapLength);const activeRequests=[];let numberOfActiveRequestsByServer={};const pageUri="undefined"!=typeof document?new URI(document.location.href):new URI,requestCompletedEvent=new Event;function RequestScheduler(){}function updatePriority(e){defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function issueRequest(e){return e.state===RequestState$1.UNISSUED&&(e.state=RequestState$1.ISSUED,e.deferred=when.defer()),e.deferred.promise}function getRequestReceivedFunction(i){return function(e){if(i.state!==RequestState$1.CANCELLED){const t=i.deferred;--statistics.numberOfActiveRequests,--numberOfActiveRequestsByServer[i.serverKey],requestCompletedEvent.raiseEvent(),i.state=RequestState$1.RECEIVED,i.deferred=void 0,t.resolve(e)}}}function getRequestFailedFunction(t){return function(e){t.state!==RequestState$1.CANCELLED&&(++statistics.numberOfFailedRequests,--statistics.numberOfActiveRequests,--numberOfActiveRequestsByServer[t.serverKey],requestCompletedEvent.raiseEvent(e),t.state=RequestState$1.FAILED,t.deferred.reject(e))}}function startRequest(e){var t=issueRequest(e);return e.state=RequestState$1.ACTIVE,activeRequests.push(e),++statistics.numberOfActiveRequests,++statistics.numberOfActiveRequestsEver,++numberOfActiveRequestsByServer[e.serverKey],e.requestFunction().then(getRequestReceivedFunction(e)).otherwise(getRequestFailedFunction(e)),t}function cancelRequest(e){const t=e.state===RequestState$1.ACTIVE;if(e.state=RequestState$1.CANCELLED,++statistics.numberOfCancelledRequests,defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--statistics.numberOfActiveRequests,--numberOfActiveRequestsByServer[e.serverKey],++statistics.numberOfCancelledActiveRequests),defined(e.cancelFunction)&&e.cancelFunction()}function updateStatistics(){RequestScheduler.debugShowStatistics&&(0===statistics.numberOfActiveRequests&&0e;)cancelRequest(requestHeap.pop());priorityHeapLength=e,requestHeap.maximumLength=e,requestHeap.reserve(e)}}}),RequestScheduler.serverHasOpenSlots=function(e,t){t=defaultValue(t,1);var i=defaultValue(RequestScheduler.requestsByServer[e],RequestScheduler.maximumRequestsPerServer);return numberOfActiveRequestsByServer[e]+t<=i},RequestScheduler.heapHasOpenSlots=function(e){return requestHeap.length+e<=priorityHeapLength},RequestScheduler.update=function(){let e,t,i=0;var n=activeRequests.length;for(e=0;e=RequestScheduler.maximumRequests)){updatePriority(e);var t=requestHeap.insert(e);if(defined(t)){if(t===e)return;cancelRequest(t)}return issueRequest(e)}}},RequestScheduler.clearForSpecs=function(){for(;0=this.retryAttempts)return when(!1);const i=this;return when(t(this,e)).then(function(e){return++i._retryCount,e})},Resource.prototype.clone=function(e){return(e=!defined(e)?new Resource({url:this._url}):e)._url=this._url,e._queryParameters=clone$1(this._queryParameters),e._templateValues=clone$1(this._templateValues),e.headers=clone$1(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Resource.prototype.getBaseUri=function(e){return getBaseUri(this.getUrlComponent(e),e)},Resource.prototype.appendForwardSlash=function(){this._url=appendForwardSlash(this._url)},Resource.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Resource.fetchArrayBuffer=function(e){return new Resource(e).fetchArrayBuffer()},Resource.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Resource.fetchBlob=function(e){return new Resource(e).fetchBlob()},Resource.prototype.fetchImage=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);const a=defaultValue(e.preferImageBitmap,!1),t=defaultValue(e.preferBlob,!1),o=defaultValue(e.flipY,!1),s=defaultValue(e.skipColorSpaceConversion,!1);if(checkAndResetRequest(this.request),!xhrBlobSupported||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!t)return fetchImage({resource:this,flipY:o,skipColorSpaceConversion:s,preferImageBitmap:a});const l=this.fetchBlob();if(defined(l)){let t,i,n,r;return Resource.supportsImageBitmapOptions().then(function(e){return t=e,i=t&&a,l}).then(function(e){if(defined(e)){if(r=e,i)return Resource.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:s});e=window.URL.createObjectURL(e);return n=new Resource({url:e}),fetchImage({resource:n,flipY:o,skipColorSpaceConversion:s,preferImageBitmap:!1})}}).then(function(e){if(defined(e))return e.blob=r,i||window.URL.revokeObjectURL(n.url),e}).otherwise(function(e){return defined(n)&&window.URL.revokeObjectURL(n.url),e.blob=r,when.reject(e)})}},Resource.fetchImage=function(e){return new Resource(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Resource.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Resource.fetchText=function(e){return new Resource(e).fetchText()},Resource.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(defined(e))return e.then(function(e){if(defined(e))return JSON.parse(e)})},Resource.fetchJson=function(e){return new Resource(e).fetchJson()},Resource.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Resource.fetchXML=function(e){return new Resource(e).fetchXML()},Resource.prototype.fetchJsonp=function(e){let t;for(e=defaultValue(e,"callback"),checkAndResetRequest(this.request);t="loadJsonp"+CesiumMath.nextRandomNumber().toString().substring(2,8),defined(window[t]););return fetchJsonp(this,e,t)},Resource.fetchJsonp=function(e){return new Resource(e).fetchJsonp(e.callbackParameterName)},Resource.prototype._makeRequest=function(s){const l=this;checkAndResetRequest(l.request);const c=l.request;c.url=l.url,c.requestFunction=function(){const e=s.responseType,t=combine$2(s.headers,l.headers),i=s.overrideMimeType,n=s.method,r=s.data,a=when.defer(),o=Resource._Implementations.loadWithXhr(l.url,e,n,r,t,a,i);return defined(o)&&defined(o.abort)&&(c.cancelFunction=function(){o.abort()}),a.promise};const e=RequestScheduler.request(c);if(defined(e))return e.then(function(e){return c.cancelFunction=void 0,e}).otherwise(function(t){return c.cancelFunction=void 0,c.state!==RequestState$1.FAILED?when.reject(t):l.retryOnError(t).then(function(e){return e?(c.state=RequestState$1.UNISSUED,c.deferred=void 0,l.fetch(s)):when.reject(t)})})};const dataUriRegex$1=/^data:(.*?)(;base64)?,(.*)$/;function decodeDataUriText(e,t){t=decodeURIComponent(t);return e?atob(t):t}function decodeDataUriArrayBuffer(e,t){const i=decodeDataUriText(e,t),n=new ArrayBuffer(i.length),r=new Uint8Array(n);for(let e=0;e=s&&(t=s-1);let i=(o.north-n.latitude)/r|0;return i>=l&&(i=l-1),defined(a)?(a.x=t,a.y=i,a):new Cartesian2(t,i)}};const scratchDiagonalCartesianNE=new Cartesian3,scratchDiagonalCartesianSW=new Cartesian3,scratchDiagonalCartographic=new Cartographic,scratchCenterCartesian=new Cartesian3,scratchSurfaceCartesian=new Cartesian3,scratchBoundingSphere$4=new BoundingSphere,tilingScheme=new GeographicTilingScheme,scratchCorners=[new Cartographic,new Cartographic,new Cartographic,new Cartographic],scratchTileXY=new Cartesian2,ApproximateTerrainHeights={};function getTileXYLevel(e){Cartographic.fromRadians(e.east,e.north,0,scratchCorners[0]),Cartographic.fromRadians(e.west,e.north,0,scratchCorners[1]),Cartographic.fromRadians(e.east,e.south,0,scratchCorners[2]),Cartographic.fromRadians(e.west,e.south,0,scratchCorners[3]);let i=0,n=0,r=0,a=0;var t=ApproximateTerrainHeights._terrainHeightsMaxLevel;let o;for(o=0;o<=t;++o){let t=!1;for(let e=0;e<4;++e){const n=scratchCorners[e];if(tilingScheme.positionToTileXY(n,o,scratchTileXY),0===e)r=scratchTileXY.x,a=scratchTileXY.y;else if(r!==scratchTileXY.x||a!==scratchTileXY.y){t=!0;break}}if(t)break;i=r,n=a}if(0!==o)return{x:i,y:n,level:o>t?t:o-1}}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _toConsumableArray$1(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t'+e+"");var n=y?y.createHTML(e):e;if(he===de)try{t=(new a).parseFromString(n,pe)}catch(e){}if(!t||!t.documentElement){t=v.createDocument(he,"template",null);try{t.documentElement.innerHTML=D?"":n}catch(e){}}return n=t.body||t.documentElement,e&&i&&n.insertBefore(r.createTextNode(i),n.childNodes[0]||null),he===de?A.call(t,j?"html":"body")[0]:j?t.documentElement:n}function xe(e){return S.call(e.ownerDocument||e,e,t.SHOW_ELEMENT|t.SHOW_COMMENT|t.SHOW_TEXT,null,!1)}function Ee(e){return"object"===(void 0===h?"undefined":_typeof(h))?e instanceof h:e&&"object"===(void 0===e?"undefined":_typeof(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName}function be(e){var t;if(Ie("beforeSanitizeElements",e,null),(t=e)instanceof p&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof s)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore))return Te(e),1;if(stringMatch(e.nodeName,/[\u0080-\uFFFF]/))return Te(e),1;var i=me(e.nodeName);if(Ie("uponSanitizeElement",e,{tagName:i,allowedTags:F}),!Ee(e.firstElementChild)&&(!Ee(e.content)||!Ee(e.content.firstElementChild))&®ExpTest(/<[/\w]/g,e.innerHTML)&®ExpTest(/<[/\w]/g,e.textContent))return Te(e),1;if("select"===i&®ExpTest(/