1
Surpriseplus
2022-09-16 a7e5110ef3f5fe3c9205f7d1a526b9fbbb55d826
1
define(["exports","./RuntimeError-ffc802eb","./when-e3a49219","./ComponentDatatype-64cf6611","./PixelFormat-83d70a69","./WebGLConstants-1c8239cc"],(function(e,t,n,i,r,a){"use strict";function u(e,t){if(null===e||"object"!=typeof e)return e;t=n.defaultValue(t,!1);var i=new e.constructor;for(var r in e)if(e.hasOwnProperty(r)){var a=e[r];t&&(a=u(a,t)),i[r]=a}return i}function o(e,t){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0)}o.fromElements=function(e,t,i){return n.defined(i)?(i.x=e,i.y=t,i):new o(e,t)},o.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e.x,t[i]=e.y,t},o.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new o),i.x=e[t++],i.y=e[t],i},o.packArray=function(e,i){var r=e.length,a=2*r;if(n.defined(i)){if(!Array.isArray(i)&&i.length!==a)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");i.length!==a&&(i.length=a)}else i=new Array(a);for(var u=0;u<r;++u)o.pack(e[u],i,2*u);return i},o.unpackArray=function(e,t){var i=e.length;n.defined(t)?t.length=i/2:t=new Array(i/2);for(var r=0;r<i;r+=2){var a=r/2;t[a]=o.unpack(e,r,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var s=new o;o.distance=function(e,t){return o.subtract(e,t,s),o.magnitude(s)},o.distanceSquared=function(e,t){return o.subtract(e,t,s),o.magnitudeSquared(s)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.cross=function(e,t){return e.x*t.y-e.y*t.x},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var l=new o;o.lerp=function(e,t,n,i){return o.multiplyByScalar(t,n,l),i=o.multiplyByScalar(e,1-n,i),o.add(l,i,i)};var f=new o,d=new o;o.angleBetween=function(e,t){return o.normalize(e,f),o.normalize(t,d),i.CesiumMath.acosClamped(o.dot(f,d))};var h=new o;function c(){return!0}o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,h);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n.defined(e)&&n.defined(t)&&i.CesiumMath.equalsEpsilon(e.x,t.x,r,a)&&i.CesiumMath.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=Object.freeze(new o(0,0)),o.ONE=Object.freeze(new o(1,1)),o.UNIT_X=Object.freeze(new o(1,0)),o.UNIT_Y=Object.freeze(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"};var m={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(m,{maximumCombinedTextureImageUnits:{get:function(){return m._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return m._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return m._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return m._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return m._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return m._maximumTextureSize}},maximumVaryingVectors:{get:function(){return m._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return m._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return m._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return m._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return m._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return m._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return m._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return m._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return m._maximumViewportWidth}},maximumViewportHeight:{get:function(){return m._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return m._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return m._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return m._maximumColorAttachments}},highpFloatSupported:{get:function(){return m._highpFloatSupported}},highpIntSupported:{get:function(){return m._highpIntSupported}}});var p={DONT_CARE:a.WebGLConstants.DONT_CARE,FASTEST:a.WebGLConstants.FASTEST,NICEST:a.WebGLConstants.NICEST,validate:function(e){return e===p.DONT_CARE||e===p.FASTEST||e===p.NICEST}},x=Object.freeze(p),y={NEAREST:a.WebGLConstants.NEAREST,LINEAR:a.WebGLConstants.LINEAR,validate:function(e){return e===y.NEAREST||e===y.LINEAR}},_=Object.freeze(y),g={NEAREST:a.WebGLConstants.NEAREST,LINEAR:a.WebGLConstants.LINEAR,NEAREST_MIPMAP_NEAREST:a.WebGLConstants.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:a.WebGLConstants.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:a.WebGLConstants.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:a.WebGLConstants.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===g.NEAREST||e===g.LINEAR||e===g.NEAREST_MIPMAP_NEAREST||e===g.LINEAR_MIPMAP_NEAREST||e===g.NEAREST_MIPMAP_LINEAR||e===g.LINEAR_MIPMAP_LINEAR}},M=Object.freeze(g),w={CLAMP_TO_EDGE:a.WebGLConstants.CLAMP_TO_EDGE,REPEAT:a.WebGLConstants.REPEAT,MIRRORED_REPEAT:a.WebGLConstants.MIRRORED_REPEAT,validate:function(e){return e===w.CLAMP_TO_EDGE||e===w.REPEAT||e===w.MIRRORED_REPEAT}},E=Object.freeze(w);function v(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);var t=n.defaultValue(e.wrapS,E.CLAMP_TO_EDGE),i=n.defaultValue(e.wrapT,E.CLAMP_TO_EDGE),r=n.defaultValue(e.minificationFilter,M.LINEAR),a=n.defaultValue(e.magnificationFilter,_.LINEAR),u=n.defined(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=a,this._maximumAnisotropy=u}function A(e){var t=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).context,i=e.width,a=e.height,u=e.source;n.defined(u)&&(n.defined(i)||(i=n.defaultValue(u.videoWidth,u.width)),n.defined(a)||(a=n.defaultValue(u.videoHeight,u.height)));var s=n.defaultValue(e.pixelFormat,r.PixelFormat.RGBA),l=n.defaultValue(e.pixelDatatype,r.PixelDatatype.UNSIGNED_BYTE),f=r.PixelFormat.toInternalFormat(s,l,t),d=r.PixelFormat.isCompressedFormat(f),h=e.preMultiplyAlpha||s===r.PixelFormat.RGB||s===r.PixelFormat.LUMINANCE,c=n.defaultValue(e.flipY,!0),m=n.defaultValue(e.skipColorSpaceConversion,!1),p=!0,x=t._gl,y=x.TEXTURE_2D,_=x.createTexture();x.activeTexture(x.TEXTURE0),x.bindTexture(y,_);var g,M=4;if(n.defined(u)&&n.defined(u.arrayBufferView)&&!d&&(M=r.PixelFormat.alignmentInBytes(s,l,i)),x.pixelStorei(x.UNPACK_ALIGNMENT,M),m?x.pixelStorei(x.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.NONE):x.pixelStorei(x.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.BROWSER_DEFAULT_WEBGL),n.defined(u))if(n.defined(u.arrayBufferView)){x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,!1);var w,E,A,T=u.arrayBufferView;if(d){if(x.compressedTexImage2D(y,0,f,i,a,0,T),n.defined(u.mipLevels))for(E=i,A=a,w=0;w<u.mipLevels.length;++w)(E=0|Math.floor(E/2))<1&&(E=1),(A=0|Math.floor(A/2))<1&&(A=1),x.compressedTexImage2D(y,w+1,f,E,A,0,u.mipLevels[w])}else if(c&&(T=r.PixelFormat.flipY(T,s,l,i,a)),x.texImage2D(y,0,f,i,a,0,s,r.PixelDatatype.toWebGLConstant(l,t),T),n.defined(u.mipLevels))for(E=i,A=a,w=0;w<u.mipLevels.length;++w)(E=0|Math.floor(E/2))<1&&(E=1),(A=0|Math.floor(A/2))<1&&(A=1),x.texImage2D(y,w+1,f,E,A,0,s,r.PixelDatatype.toWebGLConstant(l,t),u.mipLevels[w])}else n.defined(u.framebuffer)?(x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,!1),u.framebuffer!==t.defaultFramebuffer&&u.framebuffer._bind(),x.copyTexImage2D(y,0,f,u.xOffset,u.yOffset,i,a,0),u.framebuffer!==t.defaultFramebuffer&&u.framebuffer._unBind()):(x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,h),x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,c),x.texImage2D(y,0,f,s,r.PixelDatatype.toWebGLConstant(l,t),u));else x.texImage2D(y,0,f,i,a,0,s,r.PixelDatatype.toWebGLConstant(l,t),null),p=!1;x.bindTexture(y,null),g=d?r.PixelFormat.compressedTextureSizeInBytes(s,i,a):r.PixelFormat.textureSizeInBytes(s,l,i,a),this._id="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=_,this._internalFormat=f,this._pixelFormat=s,this._pixelDatatype=l,this._width=i,this._height=a,this._dimensions=new o(i,a),this._hasMipmap=!1,this._sizeInBytes=g,this._preMultiplyAlpha=h,this._flipY=c,this._initialized=p,this._sampler=void 0,this.sampler=n.defined(e.sampler)?e.sampler:new v}Object.defineProperties(v.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),v.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},v.NEAREST=Object.freeze(new v({wrapS:E.CLAMP_TO_EDGE,wrapT:E.CLAMP_TO_EDGE,minificationFilter:M.NEAREST,magnificationFilter:_.NEAREST})),A.create=function(e){return new A(e)},A.fromFramebuffer=function(e){var t=(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT)).context,i=t._gl,a=n.defaultValue(e.pixelFormat,r.PixelFormat.RGB),u=n.defaultValue(e.framebufferXOffset,0),o=n.defaultValue(e.framebufferYOffset,0),s=n.defaultValue(e.width,i.drawingBufferWidth),l=n.defaultValue(e.height,i.drawingBufferHeight),f=e.framebuffer;return new A({context:t,width:s,height:l,pixelFormat:a,source:{framebuffer:n.defined(f)?f:t.defaultFramebuffer,xOffset:u,yOffset:o,width:s,height:l}})},Object.defineProperties(A.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,i=e.magnificationFilter,a=this._context,u=this._pixelFormat,o=this._pixelDatatype,s=t===M.NEAREST_MIPMAP_NEAREST||t===M.NEAREST_MIPMAP_LINEAR||t===M.LINEAR_MIPMAP_NEAREST||t===M.LINEAR_MIPMAP_LINEAR;(o===r.PixelDatatype.FLOAT&&!a.textureFloatLinear||o===r.PixelDatatype.HALF_FLOAT&&!a.textureHalfFloatLinear)&&(t=s?M.NEAREST_MIPMAP_NEAREST:M.NEAREST,i=_.NEAREST),a.webgl2&&r.PixelFormat.isDepthFormat(u)&&(t=M.NEAREST,i=_.NEAREST);var l=a._gl,f=this._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(f,this._texture),l.texParameteri(f,l.TEXTURE_MIN_FILTER,t),l.texParameteri(f,l.TEXTURE_MAG_FILTER,i),l.texParameteri(f,l.TEXTURE_WRAP_S,e.wrapS),l.texParameteri(f,l.TEXTURE_WRAP_T,e.wrapT),n.defined(this._textureFilterAnisotropic)&&l.texParameteri(f,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),l.bindTexture(f,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),A.prototype.copyFrom=function(e){var t=n.defaultValue(e.xOffset,0),i=n.defaultValue(e.yOffset,0),a=e.source,u=this._context,o=u._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture);var l=a.width,f=a.height,d=a.arrayBufferView,h=this._width,c=this._height,m=this._internalFormat,p=this._pixelFormat,x=this._pixelDatatype,y=this._preMultiplyAlpha,_=this._flipY,g=n.defaultValue(e.skipColorSpaceConversion,!1),M=4;n.defined(d)&&(M=r.PixelFormat.alignmentInBytes(p,x,l)),o.pixelStorei(o.UNPACK_ALIGNMENT,M),g?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);var w=!1;if(!this._initialized){if(0===t&&0===i&&l===h&&f===c)n.defined(d)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),_&&(d=r.PixelFormat.flipY(d,p,x,h,c)),o.texImage2D(s,0,m,h,c,0,p,r.PixelDatatype.toWebGLConstant(x,u),d)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,_),o.texImage2D(s,0,m,p,r.PixelDatatype.toWebGLConstant(x,u),a)),w=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);var E=r.PixelFormat.createTypedArray(p,x,h,c);o.texImage2D(s,0,m,h,c,0,p,r.PixelDatatype.toWebGLConstant(x,u),E)}this._initialized=!0}w||(n.defined(d)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),_&&(d=r.PixelFormat.flipY(d,p,x,l,f)),o.texSubImage2D(s,0,t,i,l,f,p,r.PixelDatatype.toWebGLConstant(x,u),d)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,_),o.texSubImage2D(s,0,t,i,p,r.PixelDatatype.toWebGLConstant(x,u),a))),o.bindTexture(s,null)},A.prototype.copyFromFramebuffer=function(e,t,i,r,a,u){e=n.defaultValue(e,0),t=n.defaultValue(t,0),i=n.defaultValue(i,0),r=n.defaultValue(r,0),a=n.defaultValue(a,this._width),u=n.defaultValue(u,this._height);var o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexSubImage2D(s,0,e,t,i,r,a,u),o.bindTexture(s,null),this._initialized=!0},A.prototype.generateMipmap=function(e){e=n.defaultValue(e,x.DONT_CARE),this._hasMipmap=!0;var t=this._context._gl,i=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i),t.bindTexture(i,null)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),function(e,t){function n(){}for(var i in e)"function"==typeof e[i]&&(e[i]=n);e.isDestroyed=c}(this)};var T={trustGenerator:["fanfan"],_defaultFloodAnalysis:{floodVar:[0,0,0,500],ym_pos_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ym_pos_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ym_pos_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],rect_flood:[0,0,0,0,0,0,0,0,0],floodSpeed:1,ym_max_index:0,globe:!0,showElseArea:!0},floodAnalysis:{floodVar:[0,0,0,500],ym_pos_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ym_pos_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ym_pos_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],rect_flood:[0,0,0,0,0,0,0,0,0],floodSpeed:1,ym_max_index:0,globe:!0,showElseArea:!0},resetFloodAnalysis:function(){this.floodAnalysis=u(this._defaultFloodAnalysis)},_defaultExcavateAnalysis:{splitNum:30,showSelfOnly:!1,dig_pos_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dig_pos_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dig_pos_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],rect_dig:[0,0,0,0,0,0,0,0,0],dig_max_index:0,excavateHeight:0,excavateMinHeight:9999,excavatePerPoint:!1},excavateAnalysis:{splitNum:30,showSelfOnly:!1,dig_pos_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dig_pos_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dig_pos_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],rect_dig:[0,0,0,0,0,0,0,0,0],dig_max_index:0,excavateHeight:0,excavateMinHeight:9999,excavatePerPoint:!1},resetExcavateAnalysis:function(){this.excavateAnalysis=u(this._defaultExcavateAnalysis)},_defaultTilesEditor:{floodVar:[0,0,0,0],flatRect:[0,0,0,0,0,0,0,0,0],yp_mat_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_mat_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_mat_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_max_index:0,model_min_height:50,IsYaPing:[!1,!1,!1,!1],yp_show_InOrOut:[!1,!0,!0,!1],yp_black_texture:null,hm_dh_attr:[50,1,100],modelLight:2.2,times:(new Date).getTime(),floodColor:[0,0,0,.5]},tilesEditor:{floodVar:[0,0,0,0],flatRect:[0,0,0,0,0,0,0,0,0],yp_mat_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_mat_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_mat_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_max_index:0,model_min_height:50,IsYaPing:[!1,!1,!1,!1],yp_show_InOrOut:[!1,!0,!0,!1],yp_black_texture:null,hm_dh_attr:[50,1,100],modelLight:2.2,times:(new Date).getTime(),floodColor:[0,0,0,.5]},resetTilesEditor:function(){this.tilesEditor=u(this._defaultTilesEditor)},underEarth:{cullFace:void 0,enable:void 0,enableDepth:100,enableSkirt:!1},occlusionOpen:!0,Ellipsoid:{x:6378137,y:6378137,z:6356752.314140356},displaySlopeMap:!1,_smoothSlopeAtHigherAlt:!1,get smoothSlopeAtHigherAlt(){return this._smoothSlopeAtHigherAlt=viewer.scene._globe._surface._debug.maxDepth<2,this._smoothSlopeAtHigherAlt},set smoothSlopeAtHigherAlt(e){this._smoothSlopeAtHigherAlt=e},isSlopeDirty:!0,_sTex:[],get SlopeMapPallete(){return this._sTex.length<=0&&(this._sTex.push({val:100*Math.cos(Cesium.Math.toRadians(90)),color:"#FF0000"}),this._sTex.push({val:100*Math.cos(Cesium.Math.toRadians(70)),color:"#FF0000"}),this._sTex.push({val:100*Math.cos(Cesium.Math.toRadians(45)),color:"#FF8000"}),this._sTex.push({val:100*Math.cos(Cesium.Math.toRadians(31)),color:"#FFF000"}),this._sTex.push({val:100*Math.cos(Cesium.Math.toRadians(17)),color:"#00FF00"}),this._sTex.push({val:100*Math.cos(Cesium.Math.toRadians(6)),color:"#0000FF"}),this._sTex.push({val:100*Math.cos(Cesium.Math.toRadians(0)),color:"#00FFFF"})),this._sTex},set SlopeMapPallete(e){this._sTex=e},createElevationTextureFromPallete:function(e,t){var n=new Uint8Array(4096);n.length;for(var i=e[0].val,a=e[e.length-1].val,u=a,o=1024/(i-a),s=e.length-1;s>0;s--){var l=e[s].color.replace("#",""),f=e[s-1].color.replace("#",""),d=parseInt(l,16),h=parseInt(f,16),c=e[s].val,m=e[s-1].val,p=Math.floor((c-u)*o+.5),x=Math.floor((m-u)*o+.5),y=x-p;if(0!=y)for(var g=(16711680&d)>>16<<16,w=(65280&d)>>8<<16,T=(255&d)<<16,z=(16711680&h)>>16<<16,C=(65280&h)>>8<<16,S=(255&h)<<16,R=Math.floor((z-g)/y),b=Math.floor((C-w)/y),O=Math.floor((S-T)/y),P=p;P<x;P++)g+=R,w+=b,T+=O,n[4*P+0]=g>>16,n[4*P+1]=w>>16,n[4*P+2]=T>>16,n[4*P+3]=255}var I=function(e,t){return new A({context:t.context,pixelFormat:r.PixelFormat.RGBA,pixelDatatype:r.PixelDatatype.UNSIGNED_BYTE,source:{width:1,height:1024,arrayBufferView:e},sampler:new v({wrapS:E.CLAMP_TO_EDGE,wrapT:E.CLAMP_TO_EDGE,minificationFilter:M.LINEAR,magnificationFilter:_.LINEAR})})}(n,t);return this._slopeTex=I,this.slopeMapTexture=this._slopeTex,I},setSlopeMapPallete:function(e){var t=[];(e=Object.entries(e)).length>0&&e.forEach((function(e){2==e.length&&e[0]>=0&&e[0]<=90&&t.push({val:100*Math.cos(Cesium.Math.toRadians(e[0])),color:e[1]})})),0!==t.length?(t.sort((function(e,t){return e.val<t.val?-1:t.val<e.val?1:0})),this.SlopeMapPallete=t,this.isSlopeDirty=!0):console.log("Error setting new pallete for slope map")}};function z(e,t,i){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(i,0)}z.fromSpherical=function(e,t){n.defined(t)||(t=new z);var i=e.clock,r=e.cone,a=n.defaultValue(e.magnitude,1),u=a*Math.sin(r);return t.x=u*Math.cos(i),t.y=u*Math.sin(i),t.z=a*Math.cos(r),t},z.fromElements=function(e,t,i,r){return n.defined(r)?(r.x=e,r.y=t,r.z=i,r):new z(e,t,i)},z.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new z(e.x,e.y,e.z)},z.fromCartesian4=z.clone,z.packedLength=3,z.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i]=e.z,t},z.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new z),i.x=e[t++],i.y=e[t++],i.z=e[t],i},z.packArray=function(e,i){var r=e.length,a=3*r;if(n.defined(i)){if(!Array.isArray(i)&&i.length!==a)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");i.length!==a&&(i.length=a)}else i=new Array(a);for(var u=0;u<r;++u)z.pack(e[u],i,3*u);return i},z.unpackArray=function(e,t){var i=e.length;n.defined(t)?t.length=i/3:t=new Array(i/3);for(var r=0;r<i;r+=3){var a=r/3;t[a]=z.unpack(e,r,t[a])}return t},z.fromArray=z.unpack,z.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},z.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},z.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},z.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},z.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},z.magnitude=function(e){return Math.sqrt(z.magnitudeSquared(e))};var C=new z;z.distance=function(e,t){return z.subtract(e,t,C),z.magnitude(C)},z.distanceSquared=function(e,t){return z.subtract(e,t,C),z.magnitudeSquared(C)},z.normalize=function(e,t){var n=z.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},z.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},z.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},z.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},z.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},z.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},z.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},z.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},z.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},z.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var S=new z;z.lerp=function(e,t,n,i){return z.multiplyByScalar(t,n,S),i=z.multiplyByScalar(e,1-n,i),z.add(S,i,i)};var R=new z,b=new z;z.angleBetween=function(e,t){z.normalize(e,R),z.normalize(t,b);var n=z.dot(R,b),i=z.magnitude(z.cross(R,b,R));return Math.atan2(i,n)};var O=new z;z.mostOrthogonalAxis=function(e,t){var n=z.normalize(e,O);return z.abs(n,n),t=n.x<=n.y?n.x<=n.z?z.clone(z.UNIT_X,t):z.clone(z.UNIT_Z,t):n.y<=n.z?z.clone(z.UNIT_Y,t):z.clone(z.UNIT_Z,t)},z.projectVector=function(e,t,n){var i=z.dot(e,t)/z.dot(t,t);return z.multiplyByScalar(t,i,n)},z.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},z.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},z.equalsEpsilon=function(e,t,r,a){return e===t||n.defined(e)&&n.defined(t)&&i.CesiumMath.equalsEpsilon(e.x,t.x,r,a)&&i.CesiumMath.equalsEpsilon(e.y,t.y,r,a)&&i.CesiumMath.equalsEpsilon(e.z,t.z,r,a)},z.cross=function(e,t,n){var i=e.x,r=e.y,a=e.z,u=t.x,o=t.y,s=t.z,l=r*s-a*o,f=a*u-i*s,d=i*o-r*u;return n.x=l,n.y=f,n.z=d,n},z.midpoint=function(e,t,n){return n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y),n.z=.5*(e.z+t.z),n},z.fromDegrees=function(e,t,n,r,a){return e=i.CesiumMath.toRadians(e),t=i.CesiumMath.toRadians(t),z.fromRadians(e,t,n,r,a)};var P=new z,I=new z,L=new z(T.Ellipsoid.x*T.Ellipsoid.x,T.Ellipsoid.y*T.Ellipsoid.y,T.Ellipsoid.z*T.Ellipsoid.z);z.fromRadians=function(e,t,i,r,a){i=n.defaultValue(i,0);var u=n.defined(r)?r.radiiSquared:L,o=Math.cos(t);P.x=o*Math.cos(e),P.y=o*Math.sin(e),P.z=Math.sin(t),P=z.normalize(P,P),z.multiplyComponents(u,P,I);var s=Math.sqrt(z.dot(P,I));return I=z.divideByScalar(I,s,I),P=z.multiplyByScalar(P,i,P),n.defined(a)||(a=new z),z.add(I,P,a)},z.fromDegreesArray=function(e,t,i){var r=e.length;n.defined(i)?i.length=r/2:i=new Array(r/2);for(var a=0;a<r;a+=2){var u=e[a],o=e[a+1],s=a/2;i[s]=z.fromDegrees(u,o,0,t,i[s])}return i},z.fromRadiansArray=function(e,t,i){var r=e.length;n.defined(i)?i.length=r/2:i=new Array(r/2);for(var a=0;a<r;a+=2){var u=e[a],o=e[a+1],s=a/2;i[s]=z.fromRadians(u,o,0,t,i[s])}return i},z.fromDegreesArrayHeights=function(e,t,i){var r=e.length;n.defined(i)?i.length=r/3:i=new Array(r/3);for(var a=0;a<r;a+=3){var u=e[a],o=e[a+1],s=e[a+2],l=a/3;i[l]=z.fromDegrees(u,o,s,t,i[l])}return i},z.fromRadiansArrayHeights=function(e,t,i){var r=e.length;n.defined(i)?i.length=r/3:i=new Array(r/3);for(var a=0;a<r;a+=3){var u=e[a],o=e[a+1],s=e[a+2],l=a/3;i[l]=z.fromRadians(u,o,s,t,i[l])}return i},z.ZERO=Object.freeze(new z(0,0,0)),z.ONE=Object.freeze(new z(1,1,1)),z.UNIT_X=Object.freeze(new z(1,0,0)),z.UNIT_Y=Object.freeze(new z(0,1,0)),z.UNIT_Z=Object.freeze(new z(0,0,1)),z.prototype.clone=function(e){return z.clone(this,e)},z.prototype.equals=function(e){return z.equals(this,e)},z.prototype.equalsEpsilon=function(e,t,n){return z.equalsEpsilon(this,e,t,n)},z.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};var N=new z,V=new z;function U(e,t,r,a,u){var o=e.x,s=e.y,l=e.z,f=t.x,d=t.y,h=t.z,c=o*o*f*f,m=s*s*d*d,p=l*l*h*h,x=c+m+p,y=Math.sqrt(1/x),_=z.multiplyByScalar(e,y,N);if(x<a)return isFinite(y)?z.clone(_,u):void 0;var g=r.x,M=r.y,w=r.z,E=V;E.x=_.x*g*2,E.y=_.y*M*2,E.z=_.z*w*2;var v,A,T,C,S,R,b,O=(1-y)*z.magnitude(e)/(.5*z.magnitude(E)),P=0;do{P=(v=c*(S=(A=1/(1+(O-=P)*g))*A)+m*(R=(T=1/(1+O*M))*T)+p*(b=(C=1/(1+O*w))*C)-1)/(-2*(c*(S*A)*g+m*(R*T)*M+p*(b*C)*w))}while(Math.abs(v)>i.CesiumMath.EPSILON12);return n.defined(u)?(u.x=o*A,u.y=s*T,u.z=l*C,u):new z(o*A,s*T,l*C)}function q(e,t,i){this.longitude=n.defaultValue(e,0),this.latitude=n.defaultValue(t,0),this.height=n.defaultValue(i,0)}q.fromRadians=function(e,t,i,r){return i=n.defaultValue(i,0),n.defined(r)?(r.longitude=e,r.latitude=t,r.height=i,r):new q(e,t,i)},q.fromDegrees=function(e,t,n,r){return e=i.CesiumMath.toRadians(e),t=i.CesiumMath.toRadians(t),q.fromRadians(e,t,n,r)};var F=new z,W=new z,B=new z,D=new z(1/T.Ellipsoid.x,1/T.Ellipsoid.y,1/T.Ellipsoid.z),G=new z(1/(T.Ellipsoid.x*T.Ellipsoid.x),1/(T.Ellipsoid.y*T.Ellipsoid.y),1/(T.Ellipsoid.z*T.Ellipsoid.z)),k=i.CesiumMath.EPSILON1;function j(e,t,r,a){t=n.defaultValue(t,0),r=n.defaultValue(r,0),a=n.defaultValue(a,0),e._radii=new z(t,r,a),e._radiiSquared=new z(t*t,r*r,a*a),e._radiiToTheFourth=new z(t*t*t*t,r*r*r*r,a*a*a*a),e._oneOverRadii=new z(0===t?0:1/t,0===r?0:1/r,0===a?0:1/a),e._oneOverRadiiSquared=new z(0===t?0:1/(t*t),0===r?0:1/(r*r),0===a?0:1/(a*a)),e._minimumRadius=Math.min(t,r,a),e._maximumRadius=Math.max(t,r,a),e._centerToleranceSquared=i.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Y(e,t,n){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,j(this,e,t,n)}q.fromCartesian=function(e,t,r){var a=n.defined(t)?t.oneOverRadii:D,u=n.defined(t)?t.oneOverRadiiSquared:G,o=U(e,a,u,n.defined(t)?t._centerToleranceSquared:k,W);if(n.defined(o)){var s=z.multiplyComponents(o,u,F);s=z.normalize(s,s);var l=z.subtract(e,o,B),f=Math.atan2(s.y,s.x),d=Math.asin(s.z),h=i.CesiumMath.sign(z.dot(l,e))*z.magnitude(l);return n.defined(r)?(r.longitude=f,r.latitude=d,r.height=h,r):new q(f,d,h)}},q.toCartesian=function(e,t,n){return z.fromRadians(e.longitude,e.latitude,e.height,t,n)},q.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new q(e.longitude,e.latitude,e.height)},q.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},q.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},q.ZERO=Object.freeze(new q(0,0,0)),q.prototype.clone=function(e){return q.clone(this,e)},q.prototype.equals=function(e){return q.equals(this,e)},q.prototype.equalsEpsilon=function(e,t){return q.equalsEpsilon(this,e,t)},q.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(Y.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}}}),Y.clone=function(e,t){if(n.defined(e)){var i=e._radii;return n.defined(t)?(z.clone(i,t._radii),z.clone(e._radiiSquared,t._radiiSquared),z.clone(e._radiiToTheFourth,t._radiiToTheFourth),z.clone(e._oneOverRadii,t._oneOverRadii),z.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Y(i.x,i.y,i.z)}},Y.fromCartesian3=function(e,t){return n.defined(t)||(t=new Y),n.defined(e)?(j(t,e.x,e.y,e.z),t):t},Y.WGS84=Object.freeze(new Y(T.Ellipsoid.x,T.Ellipsoid.y,T.Ellipsoid.z)),Y.UNIT_SPHERE=Object.freeze(new Y(1,1,1)),Y.MOON=Object.freeze(new Y(i.CesiumMath.LUNAR_RADIUS,i.CesiumMath.LUNAR_RADIUS,i.CesiumMath.LUNAR_RADIUS)),Y.prototype.clone=function(e){return Y.clone(this,e)},Y.packedLength=z.packedLength,Y.pack=function(e,t,i){return i=n.defaultValue(i,0),z.pack(e._radii,t,i),t},Y.unpack=function(e,t,i){t=n.defaultValue(t,0);var r=z.unpack(e,t);return Y.fromCartesian3(r,i)},Y.prototype.geocentricSurfaceNormal=z.normalize,Y.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,r=e.latitude,a=Math.cos(r),u=a*Math.cos(i),o=a*Math.sin(i),s=Math.sin(r);return n.defined(t)||(t=new z),t.x=u,t.y=o,t.z=s,z.normalize(t,t)},Y.prototype.geodeticSurfaceNormal=function(e,t){if(!z.equalsEpsilon(e,z.ZERO,i.CesiumMath.EPSILON14))return n.defined(t)||(t=new z),t=z.multiplyComponents(e,this._oneOverRadiiSquared,t),z.normalize(t,t)};var X=new z,H=new z;Y.prototype.cartographicToCartesian=function(e,t){var i=X,r=H;this.geodeticSurfaceNormalCartographic(e,i),z.multiplyComponents(this._radiiSquared,i,r);var a=Math.sqrt(z.dot(i,r));return z.divideByScalar(r,a,r),z.multiplyByScalar(i,e.height,i),n.defined(t)||(t=new z),z.add(r,i,t)},Y.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;n.defined(t)?t.length=i:t=new Array(i);for(var r=0;r<i;r++)t[r]=this.cartographicToCartesian(e[r],t[r]);return t};var K=new z,Z=new z,J=new z;Y.prototype.cartesianToCartographic=function(e,t){var r=this.scaleToGeodeticSurface(e,Z);if(n.defined(r)){var a=this.geodeticSurfaceNormal(r,K),u=z.subtract(e,r,J),o=Math.atan2(a.y,a.x),s=Math.asin(a.z),l=i.CesiumMath.sign(z.dot(u,e))*z.magnitude(u);return n.defined(t)?(t.longitude=o,t.latitude=s,t.height=l,t):new q(o,s,l)}},Y.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;n.defined(t)?t.length=i:t=new Array(i);for(var r=0;r<i;++r)t[r]=this.cartesianToCartographic(e[r],t[r]);return t},Y.prototype.scaleToGeodeticSurface=function(e,t){return U(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},Y.prototype.scaleToGeocentricSurface=function(e,t){n.defined(t)||(t=new z);var i=e.x,r=e.y,a=e.z,u=this._oneOverRadiiSquared,o=1/Math.sqrt(i*i*u.x+r*r*u.y+a*a*u.z);return z.multiplyByScalar(e,o,t)},Y.prototype.transformPositionToScaledSpace=function(e,t){return n.defined(t)||(t=new z),z.multiplyComponents(e,this._oneOverRadii,t)},Y.prototype.transformPositionFromScaledSpace=function(e,t){return n.defined(t)||(t=new z),z.multiplyComponents(e,this._radii,t)},Y.prototype.equals=function(e){return this===e||n.defined(e)&&z.equals(this._radii,e._radii)},Y.prototype.toString=function(){return this._radii.toString()},Y.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,i){t=n.defaultValue(t,0);var r=this._squaredXOverSquaredZ;if(n.defined(i)||(i=new z),i.x=0,i.y=0,i.z=e.z*(1-r),!(Math.abs(i.z)>=this._radii.z-t))return i};var Q=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],$=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function ee(e,t,n){for(var i=.5*(t+e),r=.5*(t-e),a=0,u=0;u<5;u++){var o=r*Q[u];a+=$[u]*(n(i+o)+n(i-o))}return a*=r}function te(e,t,i,r,a,u,o,s,l){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(r,0),this[2]=n.defaultValue(o,0),this[3]=n.defaultValue(t,0),this[4]=n.defaultValue(a,0),this[5]=n.defaultValue(s,0),this[6]=n.defaultValue(i,0),this[7]=n.defaultValue(u,0),this[8]=n.defaultValue(l,0)}Y.prototype.surfaceArea=function(e){for(var t=e.west,n=e.east,r=e.south,a=e.north;n<t;)n+=i.CesiumMath.TWO_PI;var u=this._radiiSquared,o=u.x,s=u.y,l=u.z,f=o*s;return ee(r,a,(function(e){var i=Math.cos(e),r=Math.sin(e);return Math.cos(e)*ee(t,n,(function(e){var t=Math.cos(e),n=Math.sin(e);return Math.sqrt(f*r*r+l*(s*t*t+o*n*n)*i*i)}))}))},te.packedLength=9,te.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t},te.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new te),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},te.clone=function(e,t){if(n.defined(e))return n.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):new te(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},te.fromArray=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new te),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},te.fromColumnMajorArray=function(e,t){return te.clone(e,t)},te.fromRowMajorArray=function(e,t){return n.defined(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new te(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},te.fromQuaternion=function(e,t){var i=e.x*e.x,r=e.x*e.y,a=e.x*e.z,u=e.x*e.w,o=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,c=i-o-f+h,m=2*(r-d),p=2*(a+l),x=2*(r+d),y=-i+o-f+h,_=2*(s-u),g=2*(a-l),M=2*(s+u),w=-i-o+f+h;return n.defined(t)?(t[0]=c,t[1]=x,t[2]=g,t[3]=m,t[4]=y,t[5]=M,t[6]=p,t[7]=_,t[8]=w,t):new te(c,m,p,x,y,_,g,M,w)},te.fromHeadingPitchRoll=function(e,t){var i=Math.cos(-e.pitch),r=Math.cos(-e.heading),a=Math.cos(e.roll),u=Math.sin(-e.pitch),o=Math.sin(-e.heading),s=Math.sin(e.roll),l=i*r,f=-a*o+s*u*r,d=s*o+a*u*r,h=i*o,c=a*r+s*u*o,m=-s*r+a*u*o,p=-u,x=s*i,y=a*i;return n.defined(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=c,t[5]=x,t[6]=d,t[7]=m,t[8]=y,t):new te(l,f,d,h,c,m,p,x,y)},te.fromScale=function(e,t){return n.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new te(e.x,0,0,0,e.y,0,0,0,e.z)},te.fromUniformScale=function(e,t){return n.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new te(e,0,0,0,e,0,0,0,e)},te.fromCrossProduct=function(e,t){return n.defined(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new te(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},te.fromRotationX=function(e,t){var i=Math.cos(e),r=Math.sin(e);return n.defined(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=r,t[6]=0,t[7]=-r,t[8]=i,t):new te(1,0,0,0,i,-r,0,r,i)},te.fromRotationY=function(e,t){var i=Math.cos(e),r=Math.sin(e);return n.defined(t)?(t[0]=i,t[1]=0,t[2]=-r,t[3]=0,t[4]=1,t[5]=0,t[6]=r,t[7]=0,t[8]=i,t):new te(i,0,r,0,1,0,-r,0,i)},te.fromRotationZ=function(e,t){var i=Math.cos(e),r=Math.sin(e);return n.defined(t)?(t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new te(i,-r,0,r,i,0,0,0,1)},te.toArray=function(e,t){return n.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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},te.getElementIndex=function(e,t){return 3*e+t},te.getColumn=function(e,t,n){var i=3*t,r=e[i],a=e[i+1],u=e[i+2];return n.x=r,n.y=a,n.z=u,n},te.setColumn=function(e,t,n,i){var r=3*t;return(i=te.clone(e,i))[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i},te.getRow=function(e,t,n){var i=e[t],r=e[t+3],a=e[t+6];return n.x=i,n.y=r,n.z=a,n},te.setRow=function(e,t,n,i){return(i=te.clone(e,i))[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var ne=new z;te.getScale=function(e,t){return t.x=z.magnitude(z.fromElements(e[0],e[1],e[2],ne)),t.y=z.magnitude(z.fromElements(e[3],e[4],e[5],ne)),t.z=z.magnitude(z.fromElements(e[6],e[7],e[8],ne)),t};var ie=new z;te.getMaximumScale=function(e){return te.getScale(e,ie),z.maximumComponent(ie)},te.multiply=function(e,t,n){var i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],u=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],o=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],l=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=r,n[2]=a,n[3]=u,n[4]=o,n[5]=s,n[6]=l,n[7]=f,n[8]=d,n},te.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},te.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},te.multiplyByVector=function(e,t,n){var i=t.x,r=t.y,a=t.z,u=e[0]*i+e[3]*r+e[6]*a,o=e[1]*i+e[4]*r+e[7]*a,s=e[2]*i+e[5]*r+e[8]*a;return n.x=u,n.y=o,n.z=s,n},te.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},te.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},te.negate=function(e,t){return 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},te.transpose=function(e,t){var n=e[0],i=e[3],r=e[6],a=e[1],u=e[4],o=e[7],s=e[2],l=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=u,t[5]=o,t[6]=s,t[7]=l,t[8]=f,t};var re=new z(1,1,1);te.getRotation=function(e,t){var n=z.divideComponents(re,te.getScale(e,ie),ie);return t=te.multiplyByScale(e,n,t)};var ae=[1,0,0],ue=[2,2,1];function oe(e){for(var t=0,n=0;n<3;++n){var i=e[te.getElementIndex(ue[n],ae[n])];t+=2*i*i}return Math.sqrt(t)}function se(e,t){for(var n=i.CesiumMath.EPSILON15,r=0,a=1,u=0;u<3;++u){var o=Math.abs(e[te.getElementIndex(ue[u],ae[u])]);o>r&&(a=u,r=o)}var s=1,l=0,f=ae[a],d=ue[a];if(Math.abs(e[te.getElementIndex(d,f)])>n){var h,c=(e[te.getElementIndex(d,d)]-e[te.getElementIndex(f,f)])/2/e[te.getElementIndex(d,f)];l=(h=c<0?-1/(-c+Math.sqrt(1+c*c)):1/(c+Math.sqrt(1+c*c)))*(s=1/Math.sqrt(1+h*h))}return(t=te.clone(te.IDENTITY,t))[te.getElementIndex(f,f)]=t[te.getElementIndex(d,d)]=s,t[te.getElementIndex(d,f)]=l,t[te.getElementIndex(f,d)]=-l,t}var le=new te,fe=new te;te.computeEigenDecomposition=function(e,t){var r=i.CesiumMath.EPSILON20,a=0,u=0;n.defined(t)||(t={});for(var o=t.unitary=te.clone(te.IDENTITY,t.unitary),s=t.diagonal=te.clone(e,t.diagonal),l=r*function(e){for(var t=0,n=0;n<9;++n){var i=e[n];t+=i*i}return Math.sqrt(t)}(s);u<10&&oe(s)>l;)se(s,le),te.transpose(le,fe),te.multiply(s,le,s),te.multiply(fe,s,s),te.multiply(o,le,o),++a>2&&(++u,a=0);return t},te.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},te.determinant=function(e){var t=e[0],n=e[3],i=e[6],r=e[1],a=e[4],u=e[7],o=e[2],s=e[5],l=e[8];return t*(a*l-s*u)+r*(s*i-n*l)+o*(n*u-a*i)},te.inverse=function(e,t){var n=e[0],i=e[1],r=e[2],a=e[3],u=e[4],o=e[5],s=e[6],l=e[7],f=e[8],d=te.determinant(e);t[0]=u*f-l*o,t[1]=l*r-i*f,t[2]=i*o-u*r,t[3]=s*o-a*f,t[4]=n*f-s*r,t[5]=a*r-n*o,t[6]=a*l-s*u,t[7]=s*i-n*l,t[8]=n*u-a*i;var h=1/d;return te.multiplyByScalar(t,h,t)};var de=new te;function he(e,t,i,r){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(i,0),this.w=n.defaultValue(r,0)}te.inverseTranspose=function(e,t){return te.inverse(te.transpose(e,de),t)},te.equals=function(e,t){return e===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]},te.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.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},te.IDENTITY=Object.freeze(new te(1,0,0,0,1,0,0,0,1)),te.ZERO=Object.freeze(new te(0,0,0,0,0,0,0,0,0)),te.COLUMN0ROW0=0,te.COLUMN0ROW1=1,te.COLUMN0ROW2=2,te.COLUMN1ROW0=3,te.COLUMN1ROW1=4,te.COLUMN1ROW2=5,te.COLUMN2ROW0=6,te.COLUMN2ROW1=7,te.COLUMN2ROW2=8,Object.defineProperties(te.prototype,{length:{get:function(){return te.packedLength}}}),te.prototype.clone=function(e){return te.clone(this,e)},te.prototype.equals=function(e){return te.equals(this,e)},te.equalsArray=function(e,t,n){return e[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]},te.prototype.equalsEpsilon=function(e,t){return te.equalsEpsilon(this,e,t)},te.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},he.fromElements=function(e,t,i,r,a){return n.defined(a)?(a.x=e,a.y=t,a.z=i,a.w=r,a):new he(e,t,i,r)},he.fromColor=function(e,t){return n.defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new he(e.red,e.green,e.blue,e.alpha)},he.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new he(e.x,e.y,e.z,e.w)},he.packedLength=4,he.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},he.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new he),i.x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},he.packArray=function(e,i){var r=e.length,a=4*r;if(n.defined(i)){if(!Array.isArray(i)&&i.length!==a)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");i.length!==a&&(i.length=a)}else i=new Array(a);for(var u=0;u<r;++u)he.pack(e[u],i,4*u);return i},he.unpackArray=function(e,t){var i=e.length;n.defined(t)?t.length=i/4:t=new Array(i/4);for(var r=0;r<i;r+=4){var a=r/4;t[a]=he.unpack(e,r,t[a])}return t},he.fromArray=he.unpack,he.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},he.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},he.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},he.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},he.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},he.magnitude=function(e){return Math.sqrt(he.magnitudeSquared(e))};var ce=new he;he.distance=function(e,t){return he.subtract(e,t,ce),he.magnitude(ce)},he.distanceSquared=function(e,t){return he.subtract(e,t,ce),he.magnitudeSquared(ce)},he.normalize=function(e,t){var n=he.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},he.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},he.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},he.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},he.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},he.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},he.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},he.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},he.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},he.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var me=new he;he.lerp=function(e,t,n,i){return he.multiplyByScalar(t,n,me),i=he.multiplyByScalar(e,1-n,i),he.add(me,i,i)};var pe=new he;he.mostOrthogonalAxis=function(e,t){var n=he.normalize(e,pe);return he.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?he.clone(he.UNIT_X,t):he.clone(he.UNIT_W,t):n.z<=n.w?he.clone(he.UNIT_Z,t):he.clone(he.UNIT_W,t):n.y<=n.z?n.y<=n.w?he.clone(he.UNIT_Y,t):he.clone(he.UNIT_W,t):n.z<=n.w?he.clone(he.UNIT_Z,t):he.clone(he.UNIT_W,t)},he.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},he.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},he.equalsEpsilon=function(e,t,r,a){return e===t||n.defined(e)&&n.defined(t)&&i.CesiumMath.equalsEpsilon(e.x,t.x,r,a)&&i.CesiumMath.equalsEpsilon(e.y,t.y,r,a)&&i.CesiumMath.equalsEpsilon(e.z,t.z,r,a)&&i.CesiumMath.equalsEpsilon(e.w,t.w,r,a)},he.ZERO=Object.freeze(new he(0,0,0,0)),he.ONE=Object.freeze(new he(1,1,1,1)),he.UNIT_X=Object.freeze(new he(1,0,0,0)),he.UNIT_Y=Object.freeze(new he(0,1,0,0)),he.UNIT_Z=Object.freeze(new he(0,0,1,0)),he.UNIT_W=Object.freeze(new he(0,0,0,1)),he.prototype.clone=function(e){return he.clone(this,e)},he.prototype.equals=function(e){return he.equals(this,e)},he.prototype.equalsEpsilon=function(e,t,n){return he.equalsEpsilon(this,e,t,n)},he.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var xe=new Float32Array(1),ye=new Uint8Array(xe.buffer),_e=new Uint32Array([287454020]),ge=68===new Uint8Array(_e.buffer)[0];function Me(e,t,i,r,a,u,o,s,l,f,d,h,c,m,p,x){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(a,0),this[2]=n.defaultValue(l,0),this[3]=n.defaultValue(c,0),this[4]=n.defaultValue(t,0),this[5]=n.defaultValue(u,0),this[6]=n.defaultValue(f,0),this[7]=n.defaultValue(m,0),this[8]=n.defaultValue(i,0),this[9]=n.defaultValue(o,0),this[10]=n.defaultValue(d,0),this[11]=n.defaultValue(p,0),this[12]=n.defaultValue(r,0),this[13]=n.defaultValue(s,0),this[14]=n.defaultValue(h,0),this[15]=n.defaultValue(x,0)}he.packFloat=function(e,t){return n.defined(t)||(t=new he),xe[0]=e,ge?(t.x=ye[0],t.y=ye[1],t.z=ye[2],t.w=ye[3]):(t.x=ye[3],t.y=ye[2],t.z=ye[1],t.w=ye[0]),t},he.unpackFloat=function(e){return ge?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),xe[0]},Me.packedLength=16,Me.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t[i++]=e[9],t[i++]=e[10],t[i++]=e[11],t[i++]=e[12],t[i++]=e[13],t[i++]=e[14],t[i]=e[15],t},Me.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new Me),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},Me.clone=function(e,t){if(n.defined(e))return n.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):new Me(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])},Me.fromArray=Me.unpack,Me.fromColumnMajorArray=function(e,t){return Me.clone(e,t)},Me.fromRowMajorArray=function(e,t){return n.defined(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Me(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])},Me.fromRotationTranslation=function(e,t,i){return t=n.defaultValue(t,z.ZERO),n.defined(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i):new Me(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},Me.fromTranslationQuaternionRotationScale=function(e,t,i,r){n.defined(r)||(r=new Me);var a=i.x,u=i.y,o=i.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,c=t.y*t.z,m=t.y*t.w,p=t.z*t.z,x=t.z*t.w,y=t.w*t.w,_=s-h-p+y,g=2*(l-x),M=2*(f+m),w=2*(l+x),E=-s+h-p+y,v=2*(c-d),A=2*(f-m),T=2*(c+d),z=-s-h+p+y;return r[0]=_*a,r[1]=w*a,r[2]=A*a,r[3]=0,r[4]=g*u,r[5]=E*u,r[6]=T*u,r[7]=0,r[8]=M*o,r[9]=v*o,r[10]=z*o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},Me.fromTranslationRotationScale=function(e,t){return Me.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},Me.fromTranslation=function(e,t){return Me.fromRotationTranslation(te.IDENTITY,e,t)},Me.fromScale=function(e,t){return n.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Me(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},Me.fromUniformScale=function(e,t){return n.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Me(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var we=new z,Ee=new z,ve=new z;Me.fromCamera=function(e,t){var i=e.position,r=e.direction,a=e.up;z.normalize(r,we),z.normalize(z.cross(we,a,Ee),Ee),z.normalize(z.cross(Ee,we,ve),ve);var u=Ee.x,o=Ee.y,s=Ee.z,l=we.x,f=we.y,d=we.z,h=ve.x,c=ve.y,m=ve.z,p=i.x,x=i.y,y=i.z,_=u*-p+o*-x+s*-y,g=h*-p+c*-x+m*-y,M=l*p+f*x+d*y;return n.defined(t)?(t[0]=u,t[1]=h,t[2]=-l,t[3]=0,t[4]=o,t[5]=c,t[6]=-f,t[7]=0,t[8]=s,t[9]=m,t[10]=-d,t[11]=0,t[12]=_,t[13]=g,t[14]=M,t[15]=1,t):new Me(u,o,s,_,h,c,m,g,-l,-f,-d,M,0,0,0,1)},Me.computePerspectiveFieldOfView=function(e,t,n,i,r){var a=1/Math.tan(.5*e),u=a/t,o=(i+n)/(n-i),s=2*i*n/(n-i);return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=-1,r[12]=0,r[13]=0,r[14]=s,r[15]=0,r},Me.computeOrthographicOffCenter=function(e,t,n,i,r,a,u){var o=1/(t-e),s=1/(i-n),l=1/(a-r),f=-(t+e)*o,d=-(i+n)*s,h=-(a+r)*l;return o*=2,s*=2,l*=-2,u[0]=o,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=s,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=l,u[11]=0,u[12]=f,u[13]=d,u[14]=h,u[15]=1,u},Me.computePerspectiveOffCenter=function(e,t,n,i,r,a,u){var o=2*r/(t-e),s=2*r/(i-n),l=(t+e)/(t-e),f=(i+n)/(i-n),d=-(a+r)/(a-r),h=-2*a*r/(a-r);return u[0]=o,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=s,u[6]=0,u[7]=0,u[8]=l,u[9]=f,u[10]=d,u[11]=-1,u[12]=0,u[13]=0,u[14]=h,u[15]=0,u},Me.computeInfinitePerspectiveOffCenter=function(e,t,n,i,r,a){var u=2*r/(t-e),o=2*r/(i-n),s=(t+e)/(t-e),l=(i+n)/(i-n),f=-2*r;return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=s,a[9]=l,a[10]=-1,a[11]=-1,a[12]=0,a[13]=0,a[14]=f,a[15]=0,a},Me.computeViewportTransformation=function(e,t,i,r){n.defined(r)||(r=new Me),e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);var a=n.defaultValue(e.x,0),u=n.defaultValue(e.y,0),o=n.defaultValue(e.width,0),s=n.defaultValue(e.height,0);t=n.defaultValue(t,0);var l=.5*o,f=.5*s,d=.5*((i=n.defaultValue(i,1))-t),h=l,c=f,m=d,p=a+l,x=u+f,y=t+d;return r[0]=h,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=m,r[11]=0,r[12]=p,r[13]=x,r[14]=y,r[15]=1,r},Me.computeView=function(e,t,n,i,r){return r[0]=i.x,r[1]=n.x,r[2]=-t.x,r[3]=0,r[4]=i.y,r[5]=n.y,r[6]=-t.y,r[7]=0,r[8]=i.z,r[9]=n.z,r[10]=-t.z,r[11]=0,r[12]=-z.dot(i,e),r[13]=-z.dot(n,e),r[14]=z.dot(t,e),r[15]=1,r},Me.toArray=function(e,t){return n.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):[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]]},Me.getElementIndex=function(e,t){return 4*e+t},Me.getColumn=function(e,t,n){var i=4*t,r=e[i],a=e[i+1],u=e[i+2],o=e[i+3];return n.x=r,n.y=a,n.z=u,n.w=o,n},Me.setColumn=function(e,t,n,i){var r=4*t;return(i=Me.clone(e,i))[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i[r+3]=n.w,i},Me.setTranslation=function(e,t,n){return 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]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Ae=new z;Me.setScale=function(e,t,n){var i=Me.getScale(e,Ae),r=z.divideComponents(t,i,Ae);return Me.multiplyByScale(e,r,n)},Me.getRow=function(e,t,n){var i=e[t],r=e[t+4],a=e[t+8],u=e[t+12];return n.x=i,n.y=r,n.z=a,n.w=u,n},Me.setRow=function(e,t,n,i){return(i=Me.clone(e,i))[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};var Te=new z;Me.getScale=function(e,t){return t.x=z.magnitude(z.fromElements(e[0],e[1],e[2],Te)),t.y=z.magnitude(z.fromElements(e[4],e[5],e[6],Te)),t.z=z.magnitude(z.fromElements(e[8],e[9],e[10],Te)),t};var ze=new z;Me.getMaximumScale=function(e){return Me.getScale(e,ze),z.maximumComponent(ze)},Me.multiply=function(e,t,n){var i=e[0],r=e[1],a=e[2],u=e[3],o=e[4],s=e[5],l=e[6],f=e[7],d=e[8],h=e[9],c=e[10],m=e[11],p=e[12],x=e[13],y=e[14],_=e[15],g=t[0],M=t[1],w=t[2],E=t[3],v=t[4],A=t[5],T=t[6],z=t[7],C=t[8],S=t[9],R=t[10],b=t[11],O=t[12],P=t[13],I=t[14],L=t[15],N=i*g+o*M+d*w+p*E,V=r*g+s*M+h*w+x*E,U=a*g+l*M+c*w+y*E,q=u*g+f*M+m*w+_*E,F=i*v+o*A+d*T+p*z,W=r*v+s*A+h*T+x*z,B=a*v+l*A+c*T+y*z,D=u*v+f*A+m*T+_*z,G=i*C+o*S+d*R+p*b,k=r*C+s*S+h*R+x*b,j=a*C+l*S+c*R+y*b,Y=u*C+f*S+m*R+_*b,X=i*O+o*P+d*I+p*L,H=r*O+s*P+h*I+x*L,K=a*O+l*P+c*I+y*L,Z=u*O+f*P+m*I+_*L;return n[0]=N,n[1]=V,n[2]=U,n[3]=q,n[4]=F,n[5]=W,n[6]=B,n[7]=D,n[8]=G,n[9]=k,n[10]=j,n[11]=Y,n[12]=X,n[13]=H,n[14]=K,n[15]=Z,n},Me.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},Me.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},Me.multiplyTransformation=function(e,t,n){var i=e[0],r=e[1],a=e[2],u=e[4],o=e[5],s=e[6],l=e[8],f=e[9],d=e[10],h=e[12],c=e[13],m=e[14],p=t[0],x=t[1],y=t[2],_=t[4],g=t[5],M=t[6],w=t[8],E=t[9],v=t[10],A=t[12],T=t[13],z=t[14],C=i*p+u*x+l*y,S=r*p+o*x+f*y,R=a*p+s*x+d*y,b=i*_+u*g+l*M,O=r*_+o*g+f*M,P=a*_+s*g+d*M,I=i*w+u*E+l*v,L=r*w+o*E+f*v,N=a*w+s*E+d*v,V=i*A+u*T+l*z+h,U=r*A+o*T+f*z+c,q=a*A+s*T+d*z+m;return n[0]=C,n[1]=S,n[2]=R,n[3]=0,n[4]=b,n[5]=O,n[6]=P,n[7]=0,n[8]=I,n[9]=L,n[10]=N,n[11]=0,n[12]=V,n[13]=U,n[14]=q,n[15]=1,n},Me.multiplyByMatrix3=function(e,t,n){var i=e[0],r=e[1],a=e[2],u=e[4],o=e[5],s=e[6],l=e[8],f=e[9],d=e[10],h=t[0],c=t[1],m=t[2],p=t[3],x=t[4],y=t[5],_=t[6],g=t[7],M=t[8],w=i*h+u*c+l*m,E=r*h+o*c+f*m,v=a*h+s*c+d*m,A=i*p+u*x+l*y,T=r*p+o*x+f*y,z=a*p+s*x+d*y,C=i*_+u*g+l*M,S=r*_+o*g+f*M,R=a*_+s*g+d*M;return n[0]=w,n[1]=E,n[2]=v,n[3]=0,n[4]=A,n[5]=T,n[6]=z,n[7]=0,n[8]=C,n[9]=S,n[10]=R,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},Me.multiplyByTranslation=function(e,t,n){var i=t.x,r=t.y,a=t.z,u=i*e[0]+r*e[4]+a*e[8]+e[12],o=i*e[1]+r*e[5]+a*e[9]+e[13],s=i*e[2]+r*e[6]+a*e[10]+e[14];return 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]=u,n[13]=o,n[14]=s,n[15]=e[15],n};var Ce=new z;Me.multiplyByUniformScale=function(e,t,n){return Ce.x=t,Ce.y=t,Ce.z=t,Me.multiplyByScale(e,Ce,n)},Me.multiplyByScale=function(e,t,n){var i=t.x,r=t.y,a=t.z;return 1===i&&1===r&&1===a?Me.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=0,n[4]=r*e[4],n[5]=r*e[5],n[6]=r*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},Me.multiplyByVector=function(e,t,n){var i=t.x,r=t.y,a=t.z,u=t.w,o=e[0]*i+e[4]*r+e[8]*a+e[12]*u,s=e[1]*i+e[5]*r+e[9]*a+e[13]*u,l=e[2]*i+e[6]*r+e[10]*a+e[14]*u,f=e[3]*i+e[7]*r+e[11]*a+e[15]*u;return n.x=o,n.y=s,n.z=l,n.w=f,n},Me.multiplyByPointAsVector=function(e,t,n){var i=t.x,r=t.y,a=t.z,u=e[0]*i+e[4]*r+e[8]*a,o=e[1]*i+e[5]*r+e[9]*a,s=e[2]*i+e[6]*r+e[10]*a;return n.x=u,n.y=o,n.z=s,n},Me.multiplyByPoint=function(e,t,n){var i=t.x,r=t.y,a=t.z,u=e[0]*i+e[4]*r+e[8]*a+e[12],o=e[1]*i+e[5]*r+e[9]*a+e[13],s=e[2]*i+e[6]*r+e[10]*a+e[14];return n.x=u,n.y=o,n.z=s,n},Me.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},Me.negate=function(e,t){return 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},Me.transpose=function(e,t){var n=e[1],i=e[2],r=e[3],a=e[6],u=e[7],o=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=r,t[13]=u,t[14]=o,t[15]=e[15],t},Me.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[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},Me.equals=function(e,t){return e===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]},Me.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.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&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},Me.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},Me.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Se=new te,Re=new te,be=new he,Oe=new he(0,0,0,1);Me.inverse=function(e,n){var r=e[0],a=e[4],u=e[8],o=e[12],s=e[1],l=e[5],f=e[9],d=e[13],h=e[2],c=e[6],m=e[10],p=e[14],x=e[3],y=e[7],_=e[11],g=e[15],M=m*g,w=p*_,E=c*g,v=p*y,A=c*_,T=m*y,z=h*g,C=p*x,S=h*_,R=m*x,b=h*y,O=c*x,P=M*l+v*f+A*d-(w*l+E*f+T*d),I=w*s+z*f+R*d-(M*s+C*f+S*d),L=E*s+C*l+b*d-(v*s+z*l+O*d),N=T*s+S*l+O*f-(A*s+R*l+b*f),V=w*a+E*u+T*o-(M*a+v*u+A*o),U=M*r+C*u+S*o-(w*r+z*u+R*o),q=v*r+z*a+O*o-(E*r+C*a+b*o),F=A*r+R*a+b*u-(T*r+S*a+O*u),W=(M=u*d)*y+(v=o*l)*_+(A=a*f)*g-((w=o*f)*y+(E=a*d)*_+(T=u*l)*g),B=w*x+(z=r*d)*_+(R=u*s)*g-(M*x+(C=o*s)*_+(S=r*f)*g),D=E*x+C*y+(b=r*l)*g-(v*x+z*y+(O=a*s)*g),G=T*x+S*y+O*_-(A*x+R*y+b*_),k=E*m+T*p+w*c-(A*p+M*c+v*m),j=S*p+M*h+C*m-(z*m+R*p+w*h),Y=z*c+O*p+v*h-(b*p+E*h+C*c),X=b*m+A*h+R*c-(S*c+O*m+T*h),H=r*P+a*I+u*L+o*N;if(Math.abs(H)<i.CesiumMath.EPSILON21){if(te.equalsEpsilon(Me.getMatrix3(e,Se),Re,i.CesiumMath.EPSILON7)&&he.equals(Me.getRow(e,3,be),Oe))return n[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;throw new t.RuntimeError("matrix is not invertible because its determinate is zero.")}return H=1/H,n[0]=P*H,n[1]=I*H,n[2]=L*H,n[3]=N*H,n[4]=V*H,n[5]=U*H,n[6]=q*H,n[7]=F*H,n[8]=W*H,n[9]=B*H,n[10]=D*H,n[11]=G*H,n[12]=k*H,n[13]=j*H,n[14]=Y*H,n[15]=X*H,n},Me.inverseTransformation=function(e,t){var n=e[0],i=e[1],r=e[2],a=e[4],u=e[5],o=e[6],s=e[8],l=e[9],f=e[10],d=e[12],h=e[13],c=e[14],m=-n*d-i*h-r*c,p=-a*d-u*h-o*c,x=-s*d-l*h-f*c;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=i,t[5]=u,t[6]=l,t[7]=0,t[8]=r,t[9]=o,t[10]=f,t[11]=0,t[12]=m,t[13]=p,t[14]=x,t[15]=1,t};var Pe=new Me;function Ie(e,t,i,r){this.west=n.defaultValue(e,0),this.south=n.defaultValue(t,0),this.east=n.defaultValue(i,0),this.north=n.defaultValue(r,0)}Me.inverseTranspose=function(e,t){return Me.inverse(Me.transpose(e,Pe),t)},Me.IDENTITY=Object.freeze(new Me(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),Me.ZERO=Object.freeze(new Me(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),Me.COLUMN0ROW0=0,Me.COLUMN0ROW1=1,Me.COLUMN0ROW2=2,Me.COLUMN0ROW3=3,Me.COLUMN1ROW0=4,Me.COLUMN1ROW1=5,Me.COLUMN1ROW2=6,Me.COLUMN1ROW3=7,Me.COLUMN2ROW0=8,Me.COLUMN2ROW1=9,Me.COLUMN2ROW2=10,Me.COLUMN2ROW3=11,Me.COLUMN3ROW0=12,Me.COLUMN3ROW1=13,Me.COLUMN3ROW2=14,Me.COLUMN3ROW3=15,Object.defineProperties(Me.prototype,{length:{get:function(){return Me.packedLength}}}),Me.prototype.clone=function(e){return Me.clone(this,e)},Me.prototype.equals=function(e){return Me.equals(this,e)},Me.equalsArray=function(e,t,n){return e[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]},Me.prototype.equalsEpsilon=function(e,t){return Me.equalsEpsilon(this,e,t)},Me.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(Ie.prototype,{width:{get:function(){return Ie.computeWidth(this)}},height:{get:function(){return Ie.computeHeight(this)}}}),Ie.packedLength=4,Ie.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},Ie.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new Ie),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},Ie.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=i.CesiumMath.TWO_PI),t-n},Ie.computeHeight=function(e){return e.north-e.south},Ie.fromDegrees=function(e,t,r,a,u){return e=i.CesiumMath.toRadians(n.defaultValue(e,0)),t=i.CesiumMath.toRadians(n.defaultValue(t,0)),r=i.CesiumMath.toRadians(n.defaultValue(r,0)),a=i.CesiumMath.toRadians(n.defaultValue(a,0)),n.defined(u)?(u.west=e,u.south=t,u.east=r,u.north=a,u):new Ie(e,t,r,a)},Ie.fromRadians=function(e,t,i,r,a){return n.defined(a)?(a.west=n.defaultValue(e,0),a.south=n.defaultValue(t,0),a.east=n.defaultValue(i,0),a.north=n.defaultValue(r,0),a):new Ie(e,t,i,r)},Ie.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),s=Math.min(s,h.latitude),l=Math.max(l,h.latitude);var c=h.longitude>=0?h.longitude:h.longitude+i.CesiumMath.TWO_PI;u=Math.min(u,c),o=Math.max(o,c)}return a-r>o-u&&(r=u,(a=o)>i.CesiumMath.PI&&(a-=i.CesiumMath.TWO_PI),r>i.CesiumMath.PI&&(r-=i.CesiumMath.TWO_PI)),n.defined(t)?(t.west=r,t.south=s,t.east=a,t.north=l,t):new Ie(r,s,a,l)},Ie.fromCartesianArray=function(e,t,r){t=n.defaultValue(t,Y.WGS84);for(var a=Number.MAX_VALUE,u=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var c=t.cartesianToCartographic(e[d]);a=Math.min(a,c.longitude),u=Math.max(u,c.longitude),l=Math.min(l,c.latitude),f=Math.max(f,c.latitude);var m=c.longitude>=0?c.longitude:c.longitude+i.CesiumMath.TWO_PI;o=Math.min(o,m),s=Math.max(s,m)}return u-a>s-o&&(a=o,(u=s)>i.CesiumMath.PI&&(u-=i.CesiumMath.TWO_PI),a>i.CesiumMath.PI&&(a-=i.CesiumMath.TWO_PI)),n.defined(r)?(r.west=a,r.south=l,r.east=u,r.north=f,r):new Ie(a,l,u,f)},Ie.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Ie(e.west,e.south,e.east,e.north)},Ie.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.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},Ie.prototype.clone=function(e){return Ie.clone(this,e)},Ie.prototype.equals=function(e){return Ie.equals(this,e)},Ie.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Ie.prototype.equalsEpsilon=function(e,t){return Ie.equalsEpsilon(this,e,t)},Ie.validate=function(e){},Ie.southwest=function(e,t){return n.defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new q(e.west,e.south)},Ie.northwest=function(e,t){return n.defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new q(e.west,e.north)},Ie.northeast=function(e,t){return n.defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new q(e.east,e.north)},Ie.southeast=function(e,t){return n.defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new q(e.east,e.south)},Ie.center=function(e,t){var r=e.east,a=e.west;r<a&&(r+=i.CesiumMath.TWO_PI);var u=i.CesiumMath.negativePiToPi(.5*(a+r)),o=.5*(e.south+e.north);return n.defined(t)?(t.longitude=u,t.latitude=o,t.height=0,t):new q(u,o)},Ie.intersection=function(e,t,r){var a=e.east,u=e.west,o=t.east,s=t.west;a<u&&o>0?a+=i.CesiumMath.TWO_PI:o<s&&a>0&&(o+=i.CesiumMath.TWO_PI),a<u&&s<0?s+=i.CesiumMath.TWO_PI:o<s&&u<0&&(u+=i.CesiumMath.TWO_PI);var l=i.CesiumMath.negativePiToPi(Math.max(u,s)),f=i.CesiumMath.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n.defined(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new Ie(l,d,f,h)}},Ie.simpleIntersection=function(e,t,i){var r=Math.max(e.west,t.west),a=Math.max(e.south,t.south),u=Math.min(e.east,t.east),o=Math.min(e.north,t.north);if(!(a>=o||r>=u))return n.defined(i)?(i.west=r,i.south=a,i.east=u,i.north=o,i):new Ie(r,a,u,o)},Ie.union=function(e,t,r){n.defined(r)||(r=new Ie);var a=e.east,u=e.west,o=t.east,s=t.west;a<u&&o>0?a+=i.CesiumMath.TWO_PI:o<s&&a>0&&(o+=i.CesiumMath.TWO_PI),a<u&&s<0?s+=i.CesiumMath.TWO_PI:o<s&&u<0&&(u+=i.CesiumMath.TWO_PI);var l=i.CesiumMath.negativePiToPi(Math.min(u,s)),f=i.CesiumMath.negativePiToPi(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},Ie.expand=function(e,t,i){return n.defined(i)||(i=new Ie),i.west=Math.min(e.west,t.longitude),i.south=Math.min(e.south,t.latitude),i.east=Math.max(e.east,t.longitude),i.north=Math.max(e.north,t.latitude),i},Ie.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,u=e.east;return u<a&&(u+=i.CesiumMath.TWO_PI,n<0&&(n+=i.CesiumMath.TWO_PI)),(n>a||i.CesiumMath.equalsEpsilon(n,a,i.CesiumMath.EPSILON14))&&(n<u||i.CesiumMath.equalsEpsilon(n,u,i.CesiumMath.EPSILON14))&&r>=e.south&&r<=e.north};var Le=new q;function Ne(e,t,i,r){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(i,0),this[2]=n.defaultValue(t,0),this[3]=n.defaultValue(r,0)}Ie.subsample=function(e,t,r,a){t=n.defaultValue(t,Y.WGS84),r=n.defaultValue(r,0),n.defined(a)||(a=[]);var u=0,o=e.north,s=e.south,l=e.east,f=e.west,d=Le;d.height=r,d.longitude=f,d.latitude=o,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.longitude=l,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.latitude=s,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.longitude=f,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.latitude=o<0?o:s>0?s:0;for(var h=1;h<8;++h)d.longitude=-Math.PI+h*i.CesiumMath.PI_OVER_TWO,Ie.contains(e,d)&&(a[u]=t.cartographicToCartesian(d,a[u]),u++);return 0===d.latitude&&(d.longitude=f,a[u]=t.cartographicToCartesian(d,a[u]),u++,d.longitude=l,a[u]=t.cartographicToCartesian(d,a[u]),u++),a.length=u,a},Ie.MAX_VALUE=Object.freeze(new Ie(-Math.PI,-i.CesiumMath.PI_OVER_TWO,Math.PI,i.CesiumMath.PI_OVER_TWO)),Ne.packedLength=4,Ne.pack=function(e,t,i){return i=n.defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},Ne.unpack=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new Ne),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},Ne.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Ne(e[0],e[2],e[1],e[3])},Ne.fromArray=function(e,t,i){return t=n.defaultValue(t,0),n.defined(i)||(i=new Ne),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},Ne.fromColumnMajorArray=function(e,t){return Ne.clone(e,t)},Ne.fromRowMajorArray=function(e,t){return n.defined(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Ne(e[0],e[1],e[2],e[3])},Ne.fromScale=function(e,t){return n.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Ne(e.x,0,0,e.y)},Ne.fromUniformScale=function(e,t){return n.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Ne(e,0,0,e)},Ne.fromRotation=function(e,t){var i=Math.cos(e),r=Math.sin(e);return n.defined(t)?(t[0]=i,t[1]=r,t[2]=-r,t[3]=i,t):new Ne(i,-r,r,i)},Ne.toArray=function(e,t){return n.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},Ne.getElementIndex=function(e,t){return 2*e+t},Ne.getColumn=function(e,t,n){var i=2*t,r=e[i],a=e[i+1];return n.x=r,n.y=a,n},Ne.setColumn=function(e,t,n,i){var r=2*t;return(i=Ne.clone(e,i))[r]=n.x,i[r+1]=n.y,i},Ne.getRow=function(e,t,n){var i=e[t],r=e[t+2];return n.x=i,n.y=r,n},Ne.setRow=function(e,t,n,i){return(i=Ne.clone(e,i))[t]=n.x,i[t+2]=n.y,i};var Ve=new o;Ne.getScale=function(e,t){return t.x=o.magnitude(o.fromElements(e[0],e[1],Ve)),t.y=o.magnitude(o.fromElements(e[2],e[3],Ve)),t};var Ue=new o;Ne.getMaximumScale=function(e){return Ne.getScale(e,Ue),o.maximumComponent(Ue)},Ne.multiply=function(e,t,n){var i=e[0]*t[0]+e[2]*t[1],r=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],u=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=a,n[2]=r,n[3]=u,n},Ne.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},Ne.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},Ne.multiplyByVector=function(e,t,n){var i=e[0]*t.x+e[2]*t.y,r=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=r,n},Ne.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},Ne.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},Ne.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},Ne.transpose=function(e,t){var n=e[0],i=e[2],r=e[1],a=e[3];return t[0]=n,t[1]=i,t[2]=r,t[3]=a,t},Ne.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},Ne.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},Ne.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},Ne.equalsEpsilon=function(e,t,i){return i=n.defaultValue(i,0),e===t||n.defined(e)&&n.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},Ne.IDENTITY=Object.freeze(new Ne(1,0,0,1)),Ne.ZERO=Object.freeze(new Ne(0,0,0,0)),Ne.COLUMN0ROW0=0,Ne.COLUMN0ROW1=1,Ne.COLUMN1ROW0=2,Ne.COLUMN1ROW1=3,Object.defineProperties(Ne.prototype,{length:{get:function(){return Ne.packedLength}}}),Ne.prototype.clone=function(e){return Ne.clone(this,e)},Ne.prototype.equals=function(e){return Ne.equals(this,e)},Ne.prototype.equalsEpsilon=function(e,t){return Ne.equalsEpsilon(this,e,t)},Ne.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},e.Cartesian2=o,e.Cartesian3=z,e.Cartesian4=he,e.Cartographic=q,e.Ellipsoid=Y,e.Matrix2=Ne,e.Matrix3=te,e.Matrix4=Me,e.Rectangle=Ie,e.clone=u}));